iamfebin commited on
Commit
53d8367
·
1 Parent(s): 59a8d26

feat: responsive layout adaptation, markdown latex rendering, and window overflow prevention

Browse files
Files changed (30) hide show
  1. algospaced-ui/dist/assets/{GitHubSyncWindow-Ca288SgB.js → GitHubSyncWindow-Bkz4qSX5.js} +1 -1
  2. algospaced-ui/dist/assets/{JourneyPath-BXnxFEFy.js → JourneyPath-DytnV8uO.js} +1 -1
  3. algospaced-ui/dist/assets/{PythonChallenge-3lpSHvfF.js → MarkdownRenderer-DcpmP1uN.js} +0 -0
  4. algospaced-ui/dist/assets/{PrincessChamber-CXQLBBNW.js → PrincessChamber-BzhzFHRQ.js} +1 -1
  5. algospaced-ui/dist/assets/PythonChallenge-BP6ASjZJ.js +1 -0
  6. algospaced-ui/dist/assets/{ReviewQueue-CYwGYMOV.js → ReviewQueue-WbUnUC1g.js} +0 -0
  7. algospaced-ui/dist/assets/{Settings-C3gzd0DF.js → Settings-5f8XTRov.js} +1 -1
  8. algospaced-ui/dist/assets/{circle-alert-BL6bvZTM.js → circle-alert-B3TumjQg.js} +1 -1
  9. algospaced-ui/dist/assets/{confetti.module-nUzO7Zin.js → confetti.module-BXT-TAy0.js} +1 -1
  10. algospaced-ui/dist/assets/{external-link-BGZfX5Bi.js → external-link-64ub39jt.js} +1 -1
  11. algospaced-ui/dist/assets/{githubSyncService-CsqBgIfT.js → githubSyncService-B4h5nigj.js} +1 -1
  12. algospaced-ui/dist/assets/index-B05nv6MT.css +0 -0
  13. algospaced-ui/dist/assets/{index-V2pPJO9M.js → index-M1GCaKIP.js} +0 -0
  14. algospaced-ui/dist/assets/index-hevgUcKQ.css +0 -0
  15. algospaced-ui/dist/assets/{info-CAmdZoA6.js → info-jE4ZFn-x.js} +1 -1
  16. algospaced-ui/dist/assets/{save-BgzMM0iu.js → save-zS5LwKaW.js} +1 -1
  17. algospaced-ui/dist/index.html +2 -2
  18. algospaced-ui/dist/sw.js +1 -1
  19. algospaced-ui/src/components/MarkdownRenderer.tsx +21 -162
  20. algospaced-ui/src/components/ReviewQueue.tsx +40 -15
  21. algospaced-ui/src/components/WindowShell.tsx +8 -4
  22. algospaced-ui/src/components/desktop/DesktopWindowContainer.tsx +2 -0
  23. algospaced-ui/src/components/review/CodeStudioPanel.tsx +103 -93
  24. algospaced-ui/src/components/review/ProblemSpecPanel.tsx +300 -309
  25. algospaced-ui/src/components/review/RatingBar.tsx +23 -37
  26. algospaced-ui/src/components/review/ReviewHeader.tsx +47 -26
  27. algospaced-ui/src/hooks/useReviewQueue.ts +105 -64
  28. algospaced-ui/src/index.css +52 -10
  29. algospaced-ui/src/utils/markdownUtils.tsx +153 -0
  30. algospaced-ui/src/utils/problemContentParser.tsx +6 -83
algospaced-ui/dist/assets/{GitHubSyncWindow-Ca288SgB.js → GitHubSyncWindow-Bkz4qSX5.js} RENAMED
@@ -1 +1 @@
1
- import{a as e,c as t,t as n}from"./jsx-runtime-j9uSgrFF.js";import{t as r}from"./circle-alert-BL6bvZTM.js";import{t as i}from"./external-link-BGZfX5Bi.js";import{a,c as o,d as s,f as c,i as l,l as u,n as d,o as f,r as p,s as m,t as h,u as g}from"./githubSyncService-CsqBgIfT.js";import{F as _,G as v,T as y,U as b,z as x}from"./index-V2pPJO9M.js";var S=v(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),C=v(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),w=v(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),T=v(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),E=t(e(),1),D=n(),O=({onClose:e,currentProblem:t})=>{let[n,v]=(0,E.useState)(()=>p()),[O,k]=(0,E.useState)(()=>l()),[A,j]=(0,E.useState)(``),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(!1),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(!1),[B,V]=(0,E.useState)(!1),[H,U]=(0,E.useState)(!1),[W,G]=(0,E.useState)(!1),[K,q]=(0,E.useState)(null),J=!!(n.token&&(n.username||O?.login));(0,E.useEffect)(()=>{n.token&&!O&&u(n.token).then(e=>{e.valid&&e.user&&(k(e.user),m({username:e.user.login},e.user))})},[n.token,O]);let Y=async()=>{L(!0),q(null);try{let{token:e,user:t}=await d();k(t);let n=p();v(n);try{await a(e,n.repoName,n.isPrivate)}catch{}q({type:`success`,text:`Connected successfully to GitHub as @${t.login}!`,linkUrl:t.html_url})}catch(e){q({type:`error`,text:e.message||`GitHub OAuth authorization failed.`})}finally{L(!1)}},X=async()=>{let e=A.trim();if(!e){q({type:`error`,text:`Please enter a valid GitHub token.`});return}z(!0),q(null);try{let t=await u(e);if(t.valid&&t.user){k(t.user),m({token:e,username:t.user.login},t.user),v(p());try{await a(e,n.repoName,n.isPrivate)}catch{}j(``),N(!1),q({type:`success`,text:`Verified and connected as @${t.user.login}!`,linkUrl:t.user.html_url})}else q({type:`error`,text:t.error||`Token verification failed. Please check permissions.`})}catch(e){q({type:`error`,text:e.message||`Failed to connect with token.`})}finally{z(!1)}},Z=async()=>{if(n.token){V(!0),q(null);try{let e=await a(n.token,n.repoName,n.isPrivate);m({repoName:n.repoName}),q({type:`success`,text:e.created?`Created new repository ${e.full_name} on GitHub!`:`Connected to existing repository ${e.full_name}!`,linkUrl:e.html_url})}catch(e){q({type:`error`,text:e.message||`Failed to initialize repository.`})}finally{V(!1)}}},Q=async()=>{if(n.token&&n.repoName){U(!0),q(null);try{let e=await o(n.token,n.repoName,n.branch);q({type:`success`,text:e.message||`Synced ${e.synced_count} solutions to ${n.repoName}!`,linkUrl:e.repo_url})}catch(e){q({type:`error`,text:e.message||`Batch sync failed.`})}finally{U(!1)}}},$=async()=>{if(!t||!n.token)return;let e=t.code||t.reference_code;if(!e||!e.trim()){q({type:`error`,text:`Current problem has no code to push. Write or save code first!`});return}G(!0),q(null);try{let r={token:n.token,repo:n.repoName,branch:n.branch,problem_number:t.problem_number,problem_name:t.name||`Algorithm Problem`,difficulty:t.difficulty||`Medium`,pattern:t.pattern||`Algorithms`,optimal_time:t.optimal_time||`O(N)`,optimal_space:t.optimal_space||`O(1)`,description:t.description||``,code:e},i=await f(r);q({type:`success`,text:`Committed ${t.name} to GitHub!`,linkUrl:i.html_url})}catch(e){q({type:`error`,text:e.message||`Failed to push current solution.`})}finally{G(!1)}},ee=e=>{m({autoCommit:e}),v(t=>({...t,autoCommit:e})),q({type:`info`,text:e?`Auto-commit ENABLED: Solutions will sync automatically on submission.`:`Auto-commit DISABLED: You can still push manually any time.`})};return(0,D.jsxs)(`div`,{className:`w-full h-full bg-[#fdf8e1] p-4 sm:p-6 flex flex-col justify-between select-none font-sans text-ink-black overflow-y-auto custom-scrollbar`,children:[(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between border-b-[3px] border-ink-black pb-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`w-9 h-9 bg-ink-black rounded border-2 border-ink-black flex items-center justify-center text-white shadow-[2px_2px_0px_0px_rgba(0,0,0,0.15)]`,children:(0,D.jsx)(`svg`,{className:`w-5 h-5 fill-white`,viewBox:`0 0 19 19`,children:(0,D.jsx)(`path`,{fillRule:`evenodd`,d:`M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844`,clipRule:`evenodd`})})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h3`,{className:`font-headline-md font-bold text-sm uppercase m-0 flex items-center gap-2`,children:`GitHub Solutions Station`}),(0,D.jsx)(`p`,{className:`text-[11px] text-trash-gray font-semibold m-0`,children:`Sync algorithm solutions & auto-commit to your personal portfolio repository`})]})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,D.jsx)(`span`,{className:`px-2.5 py-1 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black ${J?`bg-emerald-300 text-emerald-950`:`bg-amber-200 text-amber-950`}`,children:J?`CONNECTED`:`DISCONNECTED`})})]}),J?(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[O?.avatar_url?(0,D.jsx)(`img`,{src:O.avatar_url,alt:O.login,className:`w-10 h-10 rounded-full border-2 border-ink-black shadow-[1px_1px_0px_0px_#1E293B]`}):(0,D.jsx)(`div`,{className:`w-10 h-10 bg-slate-200 rounded-full border-2 border-ink-black flex items-center justify-center font-bold`,children:`GH`}),(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,D.jsx)(`span`,{className:`font-bold text-xs text-ink-black`,children:O?.name||O?.login||n.username}),(0,D.jsxs)(`span`,{className:`text-[10px] text-trash-gray font-mono`,children:[`(@`,O?.login||n.username,`)`]})]}),(0,D.jsxs)(`div`,{className:`text-[11px] text-slate-600 font-medium flex items-center gap-1 mt-0.5`,children:[(0,D.jsx)(g,{className:`w-3.5 h-3.5 text-blue-600 shrink-0`}),(0,D.jsxs)(`span`,{className:`font-semibold text-ink-black`,children:[n.username||O?.login,`/`,n.repoName]}),(0,D.jsxs)(`span`,{className:`text-slate-400`,children:[`(`,n.branch,`)`]})]})]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsxs)(`a`,{href:`https://github.com/${n.username||O?.login}/${n.repoName}`,target:`_blank`,rel:`noopener noreferrer`,className:`px-3 py-1.5 bg-slate-50 hover:bg-slate-100 border-2 border-ink-black text-xs font-bold text-ink-black flex items-center gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none no-underline cursor-pointer`,children:[(0,D.jsx)(i,{className:`w-3.5 h-3.5`}),(0,D.jsx)(`span`,{children:`View Repo`})]}),(0,D.jsxs)(`button`,{onClick:()=>{window.confirm(`Disconnect your GitHub account from AlgoSpaced?`)&&(h(),v(p()),k(null),q({type:`info`,text:`Disconnected from GitHub.`}))},className:`px-3 py-1.5 bg-white hover:bg-rose-50 border-2 border-rose-300 text-rose-700 text-xs font-bold flex items-center gap-1 cursor-pointer transition-all`,title:`Disconnect GitHub`,children:[(0,D.jsx)(T,{className:`w-3 h-3`}),(0,D.jsx)(`span`,{children:`Disconnect`})]})]})]}),(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] space-y-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2 border-slate-200`,children:[(0,D.jsxs)(`span`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black flex items-center gap-1.5`,children:[(0,D.jsx)(C,{className:`w-3.5 h-3.5 text-ink-black`}),`Target Repository & Branch`]}),(0,D.jsxs)(`button`,{onClick:Z,disabled:B,className:`px-2.5 py-1 bg-yellow-100 hover:bg-yellow-200 border border-ink-black text-[10px] font-bold text-ink-black flex items-center gap-1 cursor-pointer disabled:opacity-50 shadow-[1px_1px_0px_0px_#1E293B]`,children:[B?(0,D.jsx)(_,{className:`w-3 h-3 animate-spin`}):(0,D.jsx)(b,{className:`w-3 h-3 text-emerald-700`}),(0,D.jsx)(`span`,{children:`Verify / Init Repo`})]})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-[10px] font-bold text-trash-gray uppercase mb-1`,children:`Repository Name`}),(0,D.jsx)(`input`,{type:`text`,value:n.repoName,onChange:e=>{let t=e.target.value;v(e=>({...e,repoName:t})),m({repoName:t})},placeholder:`algospaced-solutions`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-1.5 px-2.5 text-xs font-mono font-medium focus:outline-none focus:bg-white`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-[10px] font-bold text-trash-gray uppercase mb-1`,children:`Branch Name`}),(0,D.jsx)(`input`,{type:`text`,value:n.branch,onChange:e=>{let t=e.target.value;v(e=>({...e,branch:t})),m({branch:t})},placeholder:`main`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-1.5 px-2.5 text-xs font-mono font-medium focus:outline-none focus:bg-white`})]})]}),(0,D.jsxs)(`div`,{className:`pt-2 border-t border-slate-100 flex items-center justify-between`,children:[(0,D.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,D.jsx)(y,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-xs font-bold text-ink-black block`,children:`Auto-commit on every submission`}),(0,D.jsx)(`span`,{className:`text-[10px] text-trash-gray font-medium`,children:`Automatically push code to your repo when grading a review card or saving a solution.`})]})]}),(0,D.jsxs)(`label`,{className:`relative inline-flex items-center cursor-pointer select-none`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:n.autoCommit,onChange:e=>ee(e.target.checked),className:`sr-only peer`}),(0,D.jsx)(`div`,{className:`w-9 h-5 bg-slate-300 peer-focus:outline-none border-2 border-ink-black rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-2 after:border-ink-black after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-emerald-500`})]})]})]}),(0,D.jsxs)(`div`,{className:`bg-[#fffdf0] border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] space-y-3`,children:[(0,D.jsxs)(`span`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black flex items-center gap-1.5`,children:[(0,D.jsx)(S,{className:`w-3.5 h-3.5 text-ink-black`}),`Manual Push & Sync Operations`]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,D.jsxs)(`button`,{onClick:$,disabled:W||!t,className:`p-3 bg-white hover:bg-emerald-50 border-2 border-ink-black text-left flex flex-col justify-between gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer transition-all disabled:opacity-50`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,D.jsxs)(`span`,{className:`font-bold text-xs text-ink-black font-headline-md flex items-center gap-1.5`,children:[W?(0,D.jsx)(_,{className:`w-3.5 h-3.5 animate-spin text-emerald-600`}):(0,D.jsx)(w,{className:`w-3.5 h-3.5 text-emerald-600`}),`Push Active Problem`]}),t?.problem_number&&(0,D.jsxs)(`span`,{className:`text-[9px] font-mono px-1.5 py-0.5 bg-emerald-100 text-emerald-800 rounded font-bold`,children:[`#`,t.problem_number]})]}),(0,D.jsx)(`span`,{className:`text-[10px] text-slate-500 line-clamp-1`,children:t?.name||`No active problem open in review`})]}),(0,D.jsxs)(`button`,{onClick:Q,disabled:H,className:`p-3 bg-[#ffe24c] hover:bg-yellow-300 border-2 border-ink-black text-left flex flex-col justify-between gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer transition-all disabled:opacity-50`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,D.jsxs)(`span`,{className:`font-bold text-xs text-ink-black font-headline-md flex items-center gap-1.5`,children:[H?(0,D.jsx)(_,{className:`w-3.5 h-3.5 animate-spin text-ink-black`}):(0,D.jsx)(g,{className:`w-3.5 h-3.5 text-ink-black`}),`Sync Entire Library`]}),(0,D.jsx)(`span`,{className:`text-[8px] font-arcade uppercase font-bold bg-white px-1.5 py-0.5 border border-ink-black`,children:`BATCH`})]}),(0,D.jsx)(`span`,{className:`text-[10px] text-slate-700`,children:`Push all solved problems + generate root README index`})]})]})]})]}):(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-5 sm:p-6 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] text-center space-y-4`,children:[(0,D.jsxs)(`div`,{className:`max-w-md mx-auto space-y-2`,children:[(0,D.jsx)(`h4`,{className:`font-headline-md font-bold text-sm uppercase text-ink-black m-0`,children:`Connect Your GitHub Account`}),(0,D.jsx)(`p`,{className:`text-xs text-trash-gray font-medium leading-relaxed m-0`,children:`Sync all your DSA solutions directly to your GitHub repository. Commit automatically on review completion or push anytime with 1-click.`})]}),(0,D.jsxs)(`div`,{className:`pt-2 flex flex-col items-center`,children:[(0,D.jsx)(`button`,{onClick:Y,disabled:I,className:`w-full sm:w-auto px-6 py-3 bg-[#24292e] hover:bg-black text-white font-bold text-xs uppercase font-headline-md border-[3px] border-ink-black shadow-[3px_3px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none flex items-center justify-center gap-2.5 transition-all cursor-pointer disabled:opacity-50`,children:I?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{className:`w-4 h-4 animate-spin text-yellow-300`}),(0,D.jsx)(`span`,{children:`AUTHORIZING WITH GITHUB...`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`svg`,{className:`w-4 h-4 fill-white`,viewBox:`0 0 19 19`,children:(0,D.jsx)(`path`,{fillRule:`evenodd`,d:`M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844`,clipRule:`evenodd`})}),(0,D.jsx)(`span`,{children:`CONNECT WITH GITHUB (1-CLICK)`})]})}),(0,D.jsxs)(`span`,{className:`text-[10px] text-trash-gray mt-2`,children:[`Direct 1-click OAuth (works for guest and signed-in users). Requests `,(0,D.jsx)(`code`,{children:`repo`}),` access.`]})]})]}),(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)]`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>N(!M),className:`w-full flex items-center justify-between text-left text-xs font-bold text-ink-black font-headline-md uppercase cursor-pointer bg-transparent border-0 p-0`,children:[(0,D.jsx)(`span`,{children:`Or connect via Personal Access Token (PAT)`}),(0,D.jsx)(`span`,{className:`text-slate-500`,children:M?`▲ Hide`:`▼ Show`})]}),M&&(0,D.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-slate-200 space-y-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,D.jsx)(`span`,{className:`font-semibold text-slate-700`,children:`Personal Access Token:`}),(0,D.jsxs)(`a`,{href:`https://github.com/settings/tokens/new?scopes=repo&description=AlgoSpaced%20Solutions%20Sync`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:text-blue-800 font-bold flex items-center gap-1 no-underline text-[10px]`,children:[(0,D.jsx)(`span`,{children:`Generate token with repo scope`}),(0,D.jsx)(i,{className:`w-3 h-3`})]})]}),(0,D.jsxs)(`div`,{className:`relative`,children:[(0,D.jsx)(`input`,{type:P?`text`:`password`,value:A,onChange:e=>j(e.target.value),placeholder:`ghp_... or github_pat_...`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-2 pl-3 pr-9 text-xs font-mono focus:outline-none focus:bg-white`}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>F(!P),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-ink-black cursor-pointer bg-transparent border-0 p-1`,children:P?(0,D.jsx)(c,{className:`w-3.5 h-3.5`}):(0,D.jsx)(s,{className:`w-3.5 h-3.5`})})]}),(0,D.jsx)(`button`,{onClick:X,disabled:R||!A.trim(),className:`px-4 py-2 bg-[#ffe24c] hover:bg-yellow-300 text-ink-black font-bold text-xs uppercase border-2 border-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer disabled:opacity-50 flex items-center gap-1.5`,children:R?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{className:`w-3.5 h-3.5 animate-spin`}),(0,D.jsx)(`span`,{children:`VERIFYING TOKEN...`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(b,{className:`w-3.5 h-3.5`}),(0,D.jsx)(`span`,{children:`SAVE & CONNECT TOKEN`})]})})]})]})]}),K&&(0,D.jsxs)(`div`,{className:`p-3 border-[2px] border-ink-black text-xs font-semibold rounded flex items-center justify-between gap-2 ${K.type===`success`?`bg-emerald-100 text-emerald-900 border-emerald-600`:K.type===`error`?`bg-rose-100 text-rose-900 border-rose-600`:`bg-sky-100 text-sky-900 border-sky-600`}`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K.type===`success`?(0,D.jsx)(x,{className:`w-4 h-4 shrink-0`}):(0,D.jsx)(r,{className:`w-4 h-4 shrink-0`}),(0,D.jsx)(`span`,{children:K.text})]}),K.linkUrl&&(0,D.jsxs)(`a`,{href:K.linkUrl,target:`_blank`,rel:`noopener noreferrer`,className:`px-2 py-0.5 bg-white border border-ink-black text-[10px] font-bold text-ink-black hover:bg-slate-50 no-underline shrink-0 flex items-center gap-1`,children:[(0,D.jsx)(`span`,{children:`Open`}),(0,D.jsx)(i,{className:`w-3 h-3`})]})]})]}),(0,D.jsx)(`div`,{className:`pt-4 border-t border-slate-300 flex justify-end`,children:(0,D.jsx)(`button`,{onClick:e,className:`px-4 py-2 bg-white hover:bg-slate-100 border-[2px] border-ink-black text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer uppercase`,children:`CLOSE`})})]})};export{O as GitHubSyncWindow,O as default};
 
1
+ import{a as e,c as t,t as n}from"./jsx-runtime-j9uSgrFF.js";import{t as r}from"./circle-alert-B3TumjQg.js";import{t as i}from"./external-link-64ub39jt.js";import{a,c as o,d as s,f as c,i as l,l as u,n as d,o as f,r as p,s as m,t as h,u as g}from"./githubSyncService-B4h5nigj.js";import{F as _,G as v,T as y,U as b,z as x}from"./index-M1GCaKIP.js";var S=v(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),C=v(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),w=v(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),T=v(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),E=t(e(),1),D=n(),O=({onClose:e,currentProblem:t})=>{let[n,v]=(0,E.useState)(()=>p()),[O,k]=(0,E.useState)(()=>l()),[A,j]=(0,E.useState)(``),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(!1),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(!1),[B,V]=(0,E.useState)(!1),[H,U]=(0,E.useState)(!1),[W,G]=(0,E.useState)(!1),[K,q]=(0,E.useState)(null),J=!!(n.token&&(n.username||O?.login));(0,E.useEffect)(()=>{n.token&&!O&&u(n.token).then(e=>{e.valid&&e.user&&(k(e.user),m({username:e.user.login},e.user))})},[n.token,O]);let Y=async()=>{L(!0),q(null);try{let{token:e,user:t}=await d();k(t);let n=p();v(n);try{await a(e,n.repoName,n.isPrivate)}catch{}q({type:`success`,text:`Connected successfully to GitHub as @${t.login}!`,linkUrl:t.html_url})}catch(e){q({type:`error`,text:e.message||`GitHub OAuth authorization failed.`})}finally{L(!1)}},X=async()=>{let e=A.trim();if(!e){q({type:`error`,text:`Please enter a valid GitHub token.`});return}z(!0),q(null);try{let t=await u(e);if(t.valid&&t.user){k(t.user),m({token:e,username:t.user.login},t.user),v(p());try{await a(e,n.repoName,n.isPrivate)}catch{}j(``),N(!1),q({type:`success`,text:`Verified and connected as @${t.user.login}!`,linkUrl:t.user.html_url})}else q({type:`error`,text:t.error||`Token verification failed. Please check permissions.`})}catch(e){q({type:`error`,text:e.message||`Failed to connect with token.`})}finally{z(!1)}},Z=async()=>{if(n.token){V(!0),q(null);try{let e=await a(n.token,n.repoName,n.isPrivate);m({repoName:n.repoName}),q({type:`success`,text:e.created?`Created new repository ${e.full_name} on GitHub!`:`Connected to existing repository ${e.full_name}!`,linkUrl:e.html_url})}catch(e){q({type:`error`,text:e.message||`Failed to initialize repository.`})}finally{V(!1)}}},Q=async()=>{if(n.token&&n.repoName){U(!0),q(null);try{let e=await o(n.token,n.repoName,n.branch);q({type:`success`,text:e.message||`Synced ${e.synced_count} solutions to ${n.repoName}!`,linkUrl:e.repo_url})}catch(e){q({type:`error`,text:e.message||`Batch sync failed.`})}finally{U(!1)}}},$=async()=>{if(!t||!n.token)return;let e=t.code||t.reference_code;if(!e||!e.trim()){q({type:`error`,text:`Current problem has no code to push. Write or save code first!`});return}G(!0),q(null);try{let r={token:n.token,repo:n.repoName,branch:n.branch,problem_number:t.problem_number,problem_name:t.name||`Algorithm Problem`,difficulty:t.difficulty||`Medium`,pattern:t.pattern||`Algorithms`,optimal_time:t.optimal_time||`O(N)`,optimal_space:t.optimal_space||`O(1)`,description:t.description||``,code:e},i=await f(r);q({type:`success`,text:`Committed ${t.name} to GitHub!`,linkUrl:i.html_url})}catch(e){q({type:`error`,text:e.message||`Failed to push current solution.`})}finally{G(!1)}},ee=e=>{m({autoCommit:e}),v(t=>({...t,autoCommit:e})),q({type:`info`,text:e?`Auto-commit ENABLED: Solutions will sync automatically on submission.`:`Auto-commit DISABLED: You can still push manually any time.`})};return(0,D.jsxs)(`div`,{className:`w-full h-full bg-[#fdf8e1] p-4 sm:p-6 flex flex-col justify-between select-none font-sans text-ink-black overflow-y-auto custom-scrollbar`,children:[(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between border-b-[3px] border-ink-black pb-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`w-9 h-9 bg-ink-black rounded border-2 border-ink-black flex items-center justify-center text-white shadow-[2px_2px_0px_0px_rgba(0,0,0,0.15)]`,children:(0,D.jsx)(`svg`,{className:`w-5 h-5 fill-white`,viewBox:`0 0 19 19`,children:(0,D.jsx)(`path`,{fillRule:`evenodd`,d:`M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844`,clipRule:`evenodd`})})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h3`,{className:`font-headline-md font-bold text-sm uppercase m-0 flex items-center gap-2`,children:`GitHub Solutions Station`}),(0,D.jsx)(`p`,{className:`text-[11px] text-trash-gray font-semibold m-0`,children:`Sync algorithm solutions & auto-commit to your personal portfolio repository`})]})]}),(0,D.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,D.jsx)(`span`,{className:`px-2.5 py-1 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black ${J?`bg-emerald-300 text-emerald-950`:`bg-amber-200 text-amber-950`}`,children:J?`CONNECTED`:`DISCONNECTED`})})]}),J?(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[O?.avatar_url?(0,D.jsx)(`img`,{src:O.avatar_url,alt:O.login,className:`w-10 h-10 rounded-full border-2 border-ink-black shadow-[1px_1px_0px_0px_#1E293B]`}):(0,D.jsx)(`div`,{className:`w-10 h-10 bg-slate-200 rounded-full border-2 border-ink-black flex items-center justify-center font-bold`,children:`GH`}),(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,D.jsx)(`span`,{className:`font-bold text-xs text-ink-black`,children:O?.name||O?.login||n.username}),(0,D.jsxs)(`span`,{className:`text-[10px] text-trash-gray font-mono`,children:[`(@`,O?.login||n.username,`)`]})]}),(0,D.jsxs)(`div`,{className:`text-[11px] text-slate-600 font-medium flex items-center gap-1 mt-0.5`,children:[(0,D.jsx)(g,{className:`w-3.5 h-3.5 text-blue-600 shrink-0`}),(0,D.jsxs)(`span`,{className:`font-semibold text-ink-black`,children:[n.username||O?.login,`/`,n.repoName]}),(0,D.jsxs)(`span`,{className:`text-slate-400`,children:[`(`,n.branch,`)`]})]})]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsxs)(`a`,{href:`https://github.com/${n.username||O?.login}/${n.repoName}`,target:`_blank`,rel:`noopener noreferrer`,className:`px-3 py-1.5 bg-slate-50 hover:bg-slate-100 border-2 border-ink-black text-xs font-bold text-ink-black flex items-center gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none no-underline cursor-pointer`,children:[(0,D.jsx)(i,{className:`w-3.5 h-3.5`}),(0,D.jsx)(`span`,{children:`View Repo`})]}),(0,D.jsxs)(`button`,{onClick:()=>{window.confirm(`Disconnect your GitHub account from AlgoSpaced?`)&&(h(),v(p()),k(null),q({type:`info`,text:`Disconnected from GitHub.`}))},className:`px-3 py-1.5 bg-white hover:bg-rose-50 border-2 border-rose-300 text-rose-700 text-xs font-bold flex items-center gap-1 cursor-pointer transition-all`,title:`Disconnect GitHub`,children:[(0,D.jsx)(T,{className:`w-3 h-3`}),(0,D.jsx)(`span`,{children:`Disconnect`})]})]})]}),(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] space-y-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2 border-slate-200`,children:[(0,D.jsxs)(`span`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black flex items-center gap-1.5`,children:[(0,D.jsx)(C,{className:`w-3.5 h-3.5 text-ink-black`}),`Target Repository & Branch`]}),(0,D.jsxs)(`button`,{onClick:Z,disabled:B,className:`px-2.5 py-1 bg-yellow-100 hover:bg-yellow-200 border border-ink-black text-[10px] font-bold text-ink-black flex items-center gap-1 cursor-pointer disabled:opacity-50 shadow-[1px_1px_0px_0px_#1E293B]`,children:[B?(0,D.jsx)(_,{className:`w-3 h-3 animate-spin`}):(0,D.jsx)(b,{className:`w-3 h-3 text-emerald-700`}),(0,D.jsx)(`span`,{children:`Verify / Init Repo`})]})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-[10px] font-bold text-trash-gray uppercase mb-1`,children:`Repository Name`}),(0,D.jsx)(`input`,{type:`text`,value:n.repoName,onChange:e=>{let t=e.target.value;v(e=>({...e,repoName:t})),m({repoName:t})},placeholder:`algospaced-solutions`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-1.5 px-2.5 text-xs font-mono font-medium focus:outline-none focus:bg-white`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`label`,{className:`block text-[10px] font-bold text-trash-gray uppercase mb-1`,children:`Branch Name`}),(0,D.jsx)(`input`,{type:`text`,value:n.branch,onChange:e=>{let t=e.target.value;v(e=>({...e,branch:t})),m({branch:t})},placeholder:`main`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-1.5 px-2.5 text-xs font-mono font-medium focus:outline-none focus:bg-white`})]})]}),(0,D.jsxs)(`div`,{className:`pt-2 border-t border-slate-100 flex items-center justify-between`,children:[(0,D.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,D.jsx)(y,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`span`,{className:`text-xs font-bold text-ink-black block`,children:`Auto-commit on every submission`}),(0,D.jsx)(`span`,{className:`text-[10px] text-trash-gray font-medium`,children:`Automatically push code to your repo when grading a review card or saving a solution.`})]})]}),(0,D.jsxs)(`label`,{className:`relative inline-flex items-center cursor-pointer select-none`,children:[(0,D.jsx)(`input`,{type:`checkbox`,checked:n.autoCommit,onChange:e=>ee(e.target.checked),className:`sr-only peer`}),(0,D.jsx)(`div`,{className:`w-9 h-5 bg-slate-300 peer-focus:outline-none border-2 border-ink-black rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-2 after:border-ink-black after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-emerald-500`})]})]})]}),(0,D.jsxs)(`div`,{className:`bg-[#fffdf0] border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] space-y-3`,children:[(0,D.jsxs)(`span`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black flex items-center gap-1.5`,children:[(0,D.jsx)(S,{className:`w-3.5 h-3.5 text-ink-black`}),`Manual Push & Sync Operations`]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,D.jsxs)(`button`,{onClick:$,disabled:W||!t,className:`p-3 bg-white hover:bg-emerald-50 border-2 border-ink-black text-left flex flex-col justify-between gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer transition-all disabled:opacity-50`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,D.jsxs)(`span`,{className:`font-bold text-xs text-ink-black font-headline-md flex items-center gap-1.5`,children:[W?(0,D.jsx)(_,{className:`w-3.5 h-3.5 animate-spin text-emerald-600`}):(0,D.jsx)(w,{className:`w-3.5 h-3.5 text-emerald-600`}),`Push Active Problem`]}),t?.problem_number&&(0,D.jsxs)(`span`,{className:`text-[9px] font-mono px-1.5 py-0.5 bg-emerald-100 text-emerald-800 rounded font-bold`,children:[`#`,t.problem_number]})]}),(0,D.jsx)(`span`,{className:`text-[10px] text-slate-500 line-clamp-1`,children:t?.name||`No active problem open in review`})]}),(0,D.jsxs)(`button`,{onClick:Q,disabled:H,className:`p-3 bg-[#ffe24c] hover:bg-yellow-300 border-2 border-ink-black text-left flex flex-col justify-between gap-1 shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer transition-all disabled:opacity-50`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,D.jsxs)(`span`,{className:`font-bold text-xs text-ink-black font-headline-md flex items-center gap-1.5`,children:[H?(0,D.jsx)(_,{className:`w-3.5 h-3.5 animate-spin text-ink-black`}):(0,D.jsx)(g,{className:`w-3.5 h-3.5 text-ink-black`}),`Sync Entire Library`]}),(0,D.jsx)(`span`,{className:`text-[8px] font-arcade uppercase font-bold bg-white px-1.5 py-0.5 border border-ink-black`,children:`BATCH`})]}),(0,D.jsx)(`span`,{className:`text-[10px] text-slate-700`,children:`Push all solved problems + generate root README index`})]})]})]})]}):(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-5 sm:p-6 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] text-center space-y-4`,children:[(0,D.jsxs)(`div`,{className:`max-w-md mx-auto space-y-2`,children:[(0,D.jsx)(`h4`,{className:`font-headline-md font-bold text-sm uppercase text-ink-black m-0`,children:`Connect Your GitHub Account`}),(0,D.jsx)(`p`,{className:`text-xs text-trash-gray font-medium leading-relaxed m-0`,children:`Sync all your DSA solutions directly to your GitHub repository. Commit automatically on review completion or push anytime with 1-click.`})]}),(0,D.jsxs)(`div`,{className:`pt-2 flex flex-col items-center`,children:[(0,D.jsx)(`button`,{onClick:Y,disabled:I,className:`w-full sm:w-auto px-6 py-3 bg-[#24292e] hover:bg-black text-white font-bold text-xs uppercase font-headline-md border-[3px] border-ink-black shadow-[3px_3px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none flex items-center justify-center gap-2.5 transition-all cursor-pointer disabled:opacity-50`,children:I?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{className:`w-4 h-4 animate-spin text-yellow-300`}),(0,D.jsx)(`span`,{children:`AUTHORIZING WITH GITHUB...`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`svg`,{className:`w-4 h-4 fill-white`,viewBox:`0 0 19 19`,children:(0,D.jsx)(`path`,{fillRule:`evenodd`,d:`M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844`,clipRule:`evenodd`})}),(0,D.jsx)(`span`,{children:`CONNECT WITH GITHUB (1-CLICK)`})]})}),(0,D.jsxs)(`span`,{className:`text-[10px] text-trash-gray mt-2`,children:[`Direct 1-click OAuth (works for guest and signed-in users). Requests `,(0,D.jsx)(`code`,{children:`repo`}),` access.`]})]})]}),(0,D.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)]`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>N(!M),className:`w-full flex items-center justify-between text-left text-xs font-bold text-ink-black font-headline-md uppercase cursor-pointer bg-transparent border-0 p-0`,children:[(0,D.jsx)(`span`,{children:`Or connect via Personal Access Token (PAT)`}),(0,D.jsx)(`span`,{className:`text-slate-500`,children:M?`▲ Hide`:`▼ Show`})]}),M&&(0,D.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-slate-200 space-y-3`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,D.jsx)(`span`,{className:`font-semibold text-slate-700`,children:`Personal Access Token:`}),(0,D.jsxs)(`a`,{href:`https://github.com/settings/tokens/new?scopes=repo&description=AlgoSpaced%20Solutions%20Sync`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-600 hover:text-blue-800 font-bold flex items-center gap-1 no-underline text-[10px]`,children:[(0,D.jsx)(`span`,{children:`Generate token with repo scope`}),(0,D.jsx)(i,{className:`w-3 h-3`})]})]}),(0,D.jsxs)(`div`,{className:`relative`,children:[(0,D.jsx)(`input`,{type:P?`text`:`password`,value:A,onChange:e=>j(e.target.value),placeholder:`ghp_... or github_pat_...`,className:`w-full bg-slate-50 border-2 border-ink-black rounded py-2 pl-3 pr-9 text-xs font-mono focus:outline-none focus:bg-white`}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>F(!P),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-ink-black cursor-pointer bg-transparent border-0 p-1`,children:P?(0,D.jsx)(c,{className:`w-3.5 h-3.5`}):(0,D.jsx)(s,{className:`w-3.5 h-3.5`})})]}),(0,D.jsx)(`button`,{onClick:X,disabled:R||!A.trim(),className:`px-4 py-2 bg-[#ffe24c] hover:bg-yellow-300 text-ink-black font-bold text-xs uppercase border-2 border-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer disabled:opacity-50 flex items-center gap-1.5`,children:R?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(_,{className:`w-3.5 h-3.5 animate-spin`}),(0,D.jsx)(`span`,{children:`VERIFYING TOKEN...`})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(b,{className:`w-3.5 h-3.5`}),(0,D.jsx)(`span`,{children:`SAVE & CONNECT TOKEN`})]})})]})]})]}),K&&(0,D.jsxs)(`div`,{className:`p-3 border-[2px] border-ink-black text-xs font-semibold rounded flex items-center justify-between gap-2 ${K.type===`success`?`bg-emerald-100 text-emerald-900 border-emerald-600`:K.type===`error`?`bg-rose-100 text-rose-900 border-rose-600`:`bg-sky-100 text-sky-900 border-sky-600`}`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K.type===`success`?(0,D.jsx)(x,{className:`w-4 h-4 shrink-0`}):(0,D.jsx)(r,{className:`w-4 h-4 shrink-0`}),(0,D.jsx)(`span`,{children:K.text})]}),K.linkUrl&&(0,D.jsxs)(`a`,{href:K.linkUrl,target:`_blank`,rel:`noopener noreferrer`,className:`px-2 py-0.5 bg-white border border-ink-black text-[10px] font-bold text-ink-black hover:bg-slate-50 no-underline shrink-0 flex items-center gap-1`,children:[(0,D.jsx)(`span`,{children:`Open`}),(0,D.jsx)(i,{className:`w-3 h-3`})]})]})]}),(0,D.jsx)(`div`,{className:`pt-4 border-t border-slate-300 flex justify-end`,children:(0,D.jsx)(`button`,{onClick:e,className:`px-4 py-2 bg-white hover:bg-slate-100 border-[2px] border-ink-black text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none cursor-pointer uppercase`,children:`CLOSE`})})]})};export{O as GitHubSyncWindow,O as default};
algospaced-ui/dist/assets/{JourneyPath-BXnxFEFy.js → JourneyPath-DytnV8uO.js} RENAMED
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,i as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import{a as i,i as a,n as o,r as s,t as c}from"./confetti.module-nUzO7Zin.js";import{t as l}from"./external-link-BGZfX5Bi.js";import{t as u}from"./info-CAmdZoA6.js";import{B as d,D as f,E as p,F as m,G as h,H as g,L as _,N as v,O as y,P as b,T as x,U as S,V as C,c as w,j as T,n as E,u as D,z as O}from"./index-V2pPJO9M.js";var k=h(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),A=h(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),j=h(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),ee=h(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),te=h(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ne=h(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),re=h(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),ie=h(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ae=h(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),oe=h(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),se=h(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),ce=h(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),M=h(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),N=h(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),le=h(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),P=h(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),F=h(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),I=t(e(),1),L=2600,R=1500,z=[{tMax:.15,name:`The Whispering Coast & Lowlands`,biome:`coast`},{tMax:.32,name:`The Elderwood Deep Forest`,biome:`forest`},{tMax:.48,name:`River Elden & The Twin Fords`,biome:`river`},{tMax:.68,name:`The Dragon Tooth Mountains & Passes`,biome:`mountain`},{tMax:.83,name:`The Misty Glade & Highland Woods`,biome:`forest`},{tMax:.93,name:`The Roaring Gorge & Cataracts`,biome:`river`},{tMax:1,name:`The Sunstone Peaks & Ancient Citadel`,biome:`ancient_ruins`}],B=[`Pencil marks still visible from the cartographer’s first survey.`,`A calm breeze sweeps through the grass, carrying the scent of pine.`,`Wooden planks creak underfoot as the river roars below.`,`Craggy pencil hatchings reveal steep, unforgiving granite slopes.`,`Ancient roots break through the worn gravel pathway.`,`The sound of rushing water echoes across the canyon walls.`,`A solitary stone marker inscribed with early explorer symbols.`,`Golden light filters softly through the sketched canopy.`,`Distant mountain ridges frame the expanding horizon.`,`A tranquil haven where wanderers rest before the mountain climb.`];function ue(e=[],t={}){let n=[],r=e.length>0?e.length:150,i=[{t:0,x:220,y:1320,elev:10},{t:.08,x:380,y:1140,elev:45},{t:.16,x:580,y:980,elev:120},{t:.24,x:820,y:1120,elev:90},{t:.32,x:940,y:860,elev:180},{t:.4,x:720,y:640,elev:320},{t:.48,x:1050,y:520,elev:580},{t:.56,x:1320,y:720,elev:890},{t:.64,x:1540,y:480,elev:1250},{t:.72,x:1780,y:680,elev:920},{t:.8,x:1980,y:920,elev:460},{t:.88,x:2220,y:760,elev:750},{t:.94,x:2180,y:480,elev:1180},{t:1,x:2420,y:240,elev:1620}];for(let a=0;a<r;a++){let o=r>1?a/(r-1):0,s=0;for(;s<i.length-2&&i[s+1].t<o;)s++;let c=i[Math.max(0,s-1)],l=i[s],u=i[Math.min(i.length-1,s+1)],d=i[Math.min(i.length-1,s+2)],f=u.t-l.t||.001,p=(o-l.t)/f,m=p,h=m*m,g=h*m,_=-.5*g+h-.5*m,v=1.5*g-2.5*h+1,y=-1.5*g+2*h+.5*m,b=.5*g-.5*h,x=_*c.x+v*l.x+y*u.x+b*d.x,S=_*c.y+v*l.y+y*u.y+b*d.y,C=Math.sin(a*.45)*14+Math.cos(a*.9)*8,w=Math.cos(a*.4)*14+Math.sin(a*.85)*8;x=Math.round(x+C),S=Math.round(S+w);let T=Math.round(l.elev+p*(u.elev-l.elev)+Math.sin(a*.5)*15),E=z.find(e=>o<=e.tMax)||z[z.length-1],D=e.length>0?e[a]:a+1,O=t[D]||(D<0?`Custom Challenge ${a+1}`:`LeetCode #${D}`),k=B[a%B.length];n.push({id:D,sequenceIndex:a,x,y:S,name:O,biome:E.biome,regionName:E.name,elevation:Math.max(10,T),lore:k})}return n}var V=[{id:`wm-bg1`,x:380,y:310,size:70,height:85,ridgeShift:-4,hasSnow:!1,layer:0,elevation:840,rangeName:`Western Crags`},{id:`wm-bg2`,x:490,y:280,size:85,height:105,ridgeShift:6,hasSnow:!0,layer:0,elevation:1120,name:`Peak of the North Wind`,rangeName:`Western Crags`},{id:`wm-bg3`,x:620,y:300,size:75,height:95,ridgeShift:-3,hasSnow:!1,layer:0,elevation:960,rangeName:`Western Crags`},{id:`wm-bg4`,x:730,y:320,size:65,height:80,ridgeShift:4,hasSnow:!1,layer:0,elevation:780,rangeName:`Western Crags`},{id:`m1`,x:430,y:375,size:80,height:105,ridgeShift:5,hasSnow:!0,elevation:1240,name:`Crag of the Mist`,rangeName:`Western Crags`},{id:`m2`,x:530,y:345,size:95,height:125,ridgeShift:-7,hasSnow:!0,elevation:1480,name:`Peak of Solitude`,rangeName:`Western Crags`},{id:`m3`,x:630,y:365,size:85,height:110,ridgeShift:3,hasSnow:!0,elevation:1310,name:`Shadowhorn`,rangeName:`Western Crags`},{id:`m4`,x:720,y:385,size:70,height:90,ridgeShift:-4,hasSnow:!1,elevation:990,rangeName:`Western Crags`},{id:`m5`,x:370,y:430,size:55,height:65,ridgeShift:4,hasSnow:!1,layer:2,elevation:620,rangeName:`Western Crags`},{id:`m6`,x:470,y:425,size:68,height:80,ridgeShift:-3,hasSnow:!1,layer:2,elevation:760,name:`Gullwing Bluff`,rangeName:`Western Crags`},{id:`m6b`,x:575,y:420,size:72,height:88,ridgeShift:3,hasSnow:!1,layer:2,elevation:850,rangeName:`Western Crags`},{id:`m6c`,x:670,y:435,size:58,height:70,ridgeShift:-2,hasSnow:!1,layer:2,elevation:680,rangeName:`Western Crags`},{id:`dt-bg1`,x:1130,y:260,size:90,height:120,ridgeShift:-6,hasSnow:!0,layer:0,elevation:1850,rangeName:`Dragon's Tooth Range`},{id:`dt-bg2`,x:1250,y:225,size:115,height:150,ridgeShift:8,hasSnow:!0,layer:0,elevation:2180,name:`Crown of the North`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg3`,x:1380,y:210,size:130,height:175,ridgeShift:-10,hasSnow:!0,layer:0,elevation:2450,name:`Apex of Clouds`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg4`,x:1510,y:240,size:110,height:145,ridgeShift:7,hasSnow:!0,layer:0,elevation:2020,rangeName:`Dragon's Tooth Range`},{id:`dt-bg5`,x:1640,y:280,size:90,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1690,rangeName:`Dragon's Tooth Range`},{id:`m7`,x:1190,y:325,size:105,height:140,ridgeShift:-8,hasSnow:!0,elevation:1980,name:`The Dragon's Crest`,rangeName:`Dragon's Tooth Range`},{id:`m8`,x:1310,y:295,size:125,height:165,ridgeShift:10,hasSnow:!0,elevation:2360,name:`Frostcrag Pinnacle`,rangeName:`Dragon's Tooth Range`},{id:`m9`,x:1435,y:320,size:115,height:150,ridgeShift:-6,hasSnow:!0,elevation:2120,name:`Thunderhorn Peak`,rangeName:`Dragon's Tooth Range`},{id:`m10`,x:1560,y:355,size:98,height:125,ridgeShift:7,hasSnow:!0,elevation:1780,name:`Screaming Ridge`,rangeName:`Dragon's Tooth Range`},{id:`m10b`,x:1680,y:375,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1420,rangeName:`Dragon's Tooth Range`},{id:`m11`,x:1260,y:415,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1560,name:`Ironhorn Needle`,rangeName:`Dragon's Tooth Range`},{id:`m12`,x:1375,y:405,size:100,height:130,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Shadowcrevasse Crag`,rangeName:`Dragon's Tooth Range`},{id:`m13`,x:1490,y:440,size:88,height:110,ridgeShift:-4,hasSnow:!0,elevation:1490,rangeName:`Dragon's Tooth Range`},{id:`m14`,x:1610,y:435,size:82,height:100,ridgeShift:5,hasSnow:!1,elevation:1320,rangeName:`Dragon's Tooth Range`},{id:`m15`,x:1160,y:590,size:80,height:100,ridgeShift:5,hasSnow:!1,elevation:1180,name:`Wanderer's Bluff`,rangeName:`Mid-Pass Gorge`},{id:`m16`,x:1390,y:610,size:90,height:115,ridgeShift:-6,hasSnow:!0,elevation:1390,name:`Eagle Eye Ridge`,rangeName:`Mid-Pass Gorge`},{id:`m17`,x:1510,y:585,size:95,height:120,ridgeShift:5,hasSnow:!0,elevation:1520,name:`Razorback Spine`,rangeName:`Mid-Pass Gorge`},{id:`m18`,x:1630,y:565,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1280,rangeName:`Mid-Pass Gorge`},{id:`m18b`,x:1740,y:580,size:75,height:90,ridgeShift:3,hasSnow:!1,elevation:1050,rangeName:`Mid-Pass Gorge`},{id:`es-bg1`,x:1980,y:310,size:88,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1650,rangeName:`Sunstone Highlands`},{id:`es-bg2`,x:2110,y:245,size:105,height:140,ridgeShift:6,hasSnow:!0,layer:0,elevation:1980,name:`Sun Pillar`,rangeName:`Sunstone Highlands`},{id:`es-bg3`,x:2260,y:160,size:135,height:180,ridgeShift:-8,hasSnow:!0,layer:0,elevation:2580,name:`Crown of the Heavens`,rangeName:`Sunstone Highlands`},{id:`es-bg4`,x:2410,y:210,size:115,height:150,ridgeShift:7,hasSnow:!0,layer:0,elevation:2240,rangeName:`Sunstone Highlands`},{id:`m19`,x:2040,y:375,size:98,height:128,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Sunstone Spire`,rangeName:`Sunstone Highlands`},{id:`m20`,x:2170,y:315,size:115,height:150,ridgeShift:-7,hasSnow:!0,elevation:2080,name:`Sanctuary Peak`,rangeName:`Sunstone Highlands`},{id:`m21`,x:2310,y:220,size:130,height:170,ridgeShift:8,hasSnow:!0,elevation:2390,name:`Pinnacle of the Ancients`,rangeName:`Sunstone Highlands`},{id:`m22`,x:2440,y:360,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1610,name:`Falcon Perch`,rangeName:`Sunstone Highlands`},{id:`m23`,x:2260,y:405,size:82,height:98,ridgeShift:4,hasSnow:!1,elevation:1250,name:`Altar Crag`,rangeName:`Sunstone Highlands`},{id:`m24`,x:2380,y:420,size:76,height:88,ridgeShift:-3,hasSnow:!1,elevation:1120,rangeName:`Sunstone Highlands`},{id:`m25`,x:2140,y:450,size:70,height:80,ridgeShift:3,hasSnow:!1,elevation:980,rangeName:`Sunstone Highlands`}],H=[{id:`river-elden`,name:`River Elden`,d:`M 1340,290 C 1310,380 1260,460 1210,540 C 1140,640 1020,700 960,820 C 900,940 930,1060 880,1180 C 840,1280 760,1360 690,1480`,width:14,hasBridges:[{x:945,y:855,angle:-35},{x:890,y:1160,angle:25}]},{id:`river-silver`,name:`Silver Meander`,d:`M 580,410 C 650,490 730,550 780,660 C 830,760 910,810 960,820`,width:8,hasBridges:[{x:740,y:620,angle:45}]},{id:`river-cataract`,name:`Highland Torrent`,d:`M 2150,320 C 2100,450 2050,600 2020,760 C 1990,920 1920,1050 1840,1180 C 1760,1310 1710,1420 1660,1500`,width:11,hasBridges:[{x:2010,y:810,angle:-20}]}],U=[{id:`f1`,name:`The Whispering Pines`,cx:580,cy:1040,rx:230,ry:160,treeCount:42,trees:W(580,1040,210,140,42,`pines`)},{id:`f2`,name:`Elderwood Deep`,cx:820,cy:1140,rx:250,ry:180,treeCount:52,trees:W(820,1140,230,160,52,`oaks`)},{id:`f3`,name:`Mistwood Valley`,cx:860,cy:620,rx:190,ry:140,treeCount:36,trees:W(860,620,170,120,36,`willows`)},{id:`f4`,name:`Highland Spruces`,cx:1760,cy:740,rx:210,ry:155,treeCount:38,trees:W(1760,740,190,135,38,`highland_spruce`)},{id:`f5`,name:`Verdant Basin`,cx:1960,cy:980,rx:200,ry:150,treeCount:38,trees:W(1960,980,180,130,38,`mixed`)},{id:`f6`,name:`Shadowglen Copse`,cx:390,cy:690,rx:140,ry:100,treeCount:22,trees:W(390,690,120,80,22,`pines`)},{id:`f7`,name:`Sunstone Grove`,cx:2360,cy:580,rx:150,ry:110,treeCount:24,trees:W(2360,580,130,90,24,`mixed`)}];function W(e,t,n,r,i,a){let o=[];for(let s=0;s<i;s++){let c=s*2.399963+Math.sin(s*1.7)*.4,l=((s+.5)/i)**.65,u=Math.sin(s*4.3+e)*14,d=Math.cos(s*3.9+t)*12,f=Math.round(e+n*l*Math.cos(c)+u),p=Math.round(t+r*l*Math.sin(c)+d),m=.85+s%4*.1;s===0||s===5?m=1.35:s%7==0&&(m=.68);let h=`pine`;if(a===`pines`)h=s%6==0?`birch`:`pine`;else if(a===`oaks`)h=s===0||s===5?`ancient_oak`:s%5==0?`birch`:`oak`;else if(a===`willows`)h=s%3==0?`willow`:s%4==0?`birch`:`oak`;else if(a===`highland_spruce`)h=s%5==0?`pine`:`spruce`;else{let e=s%5;h=e===0?`ancient_oak`:e===1?`pine`:e===2?`oak`:e===3?`spruce`:`birch`}o.push({x:f,y:p,scale:m,type:h,seed:Math.round(e*7+t*11+s*31)})}return o}function G(e){if(e.length===0)return``;if(e.length===1)return`M ${e[0].x},${e[0].y}`;let t=`M ${e[0].x},${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=(r.x+i.x)/2,o=(r.y+i.y)/2;if(n===0)t+=` Q ${r.x},${r.y} ${a},${o}`;else{let a=e[n-1],o=r.x+(i.x-a.x)*.18,s=r.y+(i.y-a.y)*.18;t+=` S ${o},${s} ${i.x},${i.y}`}}return t}function K(e,t){return t<=0||e.length===0?``:G(e.slice(0,t+1))}var de={parchment:{id:`parchment`,name:`Daylight Parchment`,bgClass:`parchment-bg`,textColor:`#2c221a`,pencilColor:`#382e25`,pencilShade:`#8c765c`,riverColor:`#96afbe`,glowColor:`#f59e0b`,glowSubtle:`#fbbf24`,nodeUnlit:`#f0e5ce`,nodeLit:`#fbbf24`,nodeLitStroke:`#ffffff`},dark_parchment:{id:`dark_parchment`,name:`Midnight Cartography`,bgClass:`parchment-dark-bg`,textColor:`#f3e9d2`,pencilColor:`#8a7761`,pencilShade:`#4a3f33`,riverColor:`#365163`,glowColor:`#fbbf24`,glowSubtle:`#f59e0b`,nodeUnlit:`#231e17`,nodeLit:`#f59e0b`,nodeLitStroke:`#fffbeb`}},q=new class{ctx=null;enabled=!0;initCtx(){if(!this.ctx&&typeof window<`u`){let e=window.AudioContext||window.webkitAudioContext;e&&(this.ctx=new e)}this.ctx&&this.ctx.state===`suspended`&&this.ctx.resume()}setEnabled(e){this.enabled=e,e&&this.initCtx()}isEnabled(){return this.enabled}playNodeLightUp(e,t=150){if(this.enabled&&(this.initCtx(),this.ctx))try{let n=this.ctx.currentTime,r=[261.63,293.66,329.63,392,440,523.25,587.33,659.25,783.99,880],i=Math.floor(e/Math.max(1,t)*20),a=1+Math.floor(i/r.length)*.5,o=r[i%r.length]*a,s=this.ctx.createOscillator(),c=this.ctx.createOscillator(),l=this.ctx.createGain();s.type=`sine`,s.frequency.setValueAtTime(o,n),c.type=`triangle`,c.frequency.setValueAtTime(o*2.01,n),l.gain.setValueAtTime(.001,n),l.gain.linearRampToValueAtTime(.12,n+.02),l.gain.exponentialRampToValueAtTime(1e-4,n+.55),s.connect(l),c.connect(l),l.connect(this.ctx.destination),s.start(n),c.start(n),s.stop(n+.6),c.stop(n+.6)}catch{}}playPencilScratch(){if(this.enabled&&(this.initCtx(),this.ctx))try{let e=this.ctx.currentTime,t=Math.floor(this.ctx.sampleRate*.06),n=this.ctx.createBuffer(1,t,this.ctx.sampleRate),r=n.getChannelData(0);for(let e=0;e<t;e++)r[e]=(Math.random()*2-1)*Math.exp(-e/(t*.4));let i=this.ctx.createBufferSource();i.buffer=n;let a=this.ctx.createBiquadFilter();a.type=`bandpass`,a.frequency.setValueAtTime(1400+Math.random()*800,e),a.Q.setValueAtTime(3.5,e);let o=this.ctx.createGain();o.gain.setValueAtTime(.04,e),o.gain.exponentialRampToValueAtTime(.001,e+.05),i.connect(a),a.connect(o),o.connect(this.ctx.destination),i.start(e)}catch{}}playVictoryChime(){this.enabled&&(this.initCtx(),this.ctx&&[523.25,659.25,783.99,1046.5].forEach((e,t)=>{setTimeout(()=>{if(!this.ctx)return;let t=this.ctx.currentTime,n=this.ctx.createOscillator(),r=this.ctx.createGain();n.type=`sine`,n.frequency.setValueAtTime(e,t),r.gain.setValueAtTime(.001,t),r.gain.linearRampToValueAtTime(.15,t+.05),r.gain.exponentialRampToValueAtTime(1e-4,t+1.2),n.connect(r),r.connect(this.ctx.destination),n.start(t),n.stop(t+1.3)},t*120)}))}},J=r();function Y(e){let t=Math.sin(e*12.9898+78.233)*43758.5453;return t-Math.floor(t)}var fe=({mountain:e,theme:t})=>{let n=t.id!==`parchment`,r=t.pencilColor,i=t.pencilShade,{id:a,x:o,y:s,size:c,height:l,ridgeShift:u=0,hasSnow:d=l>95}=e,f=(0,I.useMemo)(()=>{let e=0;for(let t=0;t<a.length;t++)e+=a.charCodeAt(t)*(t+1);e+=Math.round(o+s);let t=o+u,n=s-l,r=o-c,i=o+c,f=[{x:t,y:n}];for(let i=1;i<=6;i++){let a=i/6,o=t-(t-r)*a,s=n+l*a,u=(Y(e+i*17)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+i*31)>.65?l*.04:0;f.push({x:Math.round(o+u),y:Math.round(s+d)})}let p=[];for(let r=1;r<=6;r++){let a=r/6,o=t+(i-t)*a,s=n+l*a,u=(Y(e+r*43)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+r*59)>.65?l*.04:0;p.push({x:Math.round(o+u),y:Math.round(s+d)})}let m=[{x:t,y:n}];for(let r=1;r<=7;r++){let i=r/7,a=t+(o+u*.25+(Y(e+101)-.5)*(c*.15)-t)*i**1.2,s=n+l*i,d=Math.sin(i*Math.PI*2.2+Y(e+113))*(c*.1);m.push({x:Math.round(a+d),y:Math.round(s)})}let h=[],g=m[Math.min(m.length-1,2)];if(g){let t=o+c*.55+(Y(e+201)-.5)*15,n=s-l*.12,r=(g.x+t)/2+12,i=(g.y+n)/2-6;h.push({d:`M ${g.x},${g.y} Q ${r},${i} ${t},${n}`,side:`right`})}let _=m[Math.min(m.length-1,5)];if(_){let t=o+c*.85+(Y(e+209)-.5)*15,n=s,r=(_.x+t)/2+10,i=(_.y+n)/2-4;h.push({d:`M ${_.x},${_.y} Q ${r},${i} ${t},${n}`,side:`right`})}let v=m[Math.min(m.length-1,3)];if(v){let t=o-c*.6+(Y(e+301)-.5)*15,n=s-l*.15,r=(v.x+t)/2-10,i=(v.y+n)/2-5;h.push({d:`M ${v.x},${v.y} Q ${r},${i} ${t},${n}`,side:`left`})}let y=[],b=Math.max(14,Math.round(l/4.8));for(let r=1;r<=b;r++){let a=r/(b+1),o=m[Math.min(m.length-1,Math.max(0,Math.round(a*(m.length-1))))],s=n+l*a,c=p[Math.min(p.length-1,Math.max(0,Math.round(a*(p.length-1))))]||{x:t+(i-t)*a,y:s},u=o.x+(c.x-o.x)*.08,d=s+(Y(e+r*71)-.5)*3,f=r%3==0?.92:r%2==0?.75:.6,h=u+(c.x-u)*f,g=d+((s-n)*.22+(c.y-s)*.35)+(Y(e+r*83)-.5)*4;y.push({x1:Math.round(u),y1:Math.round(d),x2:Math.round(h),y2:Math.round(g),width:r<4?.9:1.25,opacity:r<3?.6:.85}),r>4&&r%2==0&&y.push({x1:Math.round(u+(h-u)*.3),y1:Math.round(d+(g-d)*.3),x2:Math.round(u+(h-u)*.75),y2:Math.round(d+(g-d)*.15),width:.75,opacity:.55})}let x=[],S=Math.max(4,Math.round(l/18));for(let i=1;i<=S;i++){let a=(i+.3)/(S+1),o=n+l*a,s=m[Math.min(m.length-1,Math.round(a*(m.length-1)))],c=f[Math.min(f.length-1,Math.round(a*(f.length-1)))]||{x:t-(t-r)*a,y:o},u=s.x-(s.x-c.x)*.25,d=o+2,p=s.x-(s.x-c.x)*(.6+Y(e+i*97)*.3),h=o+8+Y(e+i*103)*6,g=(u+p)/2-4,_=(d+h)/2+3;if(x.push({d:`M ${Math.round(u)},${Math.round(d)} Q ${Math.round(g)},${Math.round(_)} ${Math.round(p)},${Math.round(h)}`,width:.9}),i%2==1){let e=u-6,t=d+3;x.push({d:`M ${Math.round(e)},${Math.round(t)} L ${Math.round(e-8)},${Math.round(t+10)}`,width:.75})}}let C=``,w=``;if(d){let e=n+l*.32,a=t-(t-r)*.32,o=t+(i-t)*.32,s=m[Math.min(m.length-1,2)]||{x:t,y:e},c={x:t-(t-r)*.16,y:e-4},u={x:t-(t-r)*.26,y:e+6},d={x:t+(i-t)*.14,y:e+3},h={x:t+(i-t)*.24,y:e-2};C=`M ${t},${n}
2
  L ${f[1].x},${f[1].y}
3
  L ${a},${e}
4
  Q ${u.x},${u.y} ${c.x},${c.y}
 
1
+ import{a as e,c as t,i as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import{a as i,i as a,n as o,r as s,t as c}from"./confetti.module-BXT-TAy0.js";import{t as l}from"./external-link-64ub39jt.js";import{t as u}from"./info-jE4ZFn-x.js";import{B as d,D as f,E as p,F as m,G as h,H as g,L as _,N as v,O as y,P as b,T as x,U as S,V as C,c as w,j as T,n as E,u as D,z as O}from"./index-M1GCaKIP.js";var k=h(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),A=h(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),j=h(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),ee=h(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),te=h(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),ne=h(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),re=h(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),ie=h(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),ae=h(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),oe=h(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),se=h(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),ce=h(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),M=h(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),N=h(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),le=h(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),P=h(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),F=h(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),I=t(e(),1),L=2600,R=1500,z=[{tMax:.15,name:`The Whispering Coast & Lowlands`,biome:`coast`},{tMax:.32,name:`The Elderwood Deep Forest`,biome:`forest`},{tMax:.48,name:`River Elden & The Twin Fords`,biome:`river`},{tMax:.68,name:`The Dragon Tooth Mountains & Passes`,biome:`mountain`},{tMax:.83,name:`The Misty Glade & Highland Woods`,biome:`forest`},{tMax:.93,name:`The Roaring Gorge & Cataracts`,biome:`river`},{tMax:1,name:`The Sunstone Peaks & Ancient Citadel`,biome:`ancient_ruins`}],B=[`Pencil marks still visible from the cartographer’s first survey.`,`A calm breeze sweeps through the grass, carrying the scent of pine.`,`Wooden planks creak underfoot as the river roars below.`,`Craggy pencil hatchings reveal steep, unforgiving granite slopes.`,`Ancient roots break through the worn gravel pathway.`,`The sound of rushing water echoes across the canyon walls.`,`A solitary stone marker inscribed with early explorer symbols.`,`Golden light filters softly through the sketched canopy.`,`Distant mountain ridges frame the expanding horizon.`,`A tranquil haven where wanderers rest before the mountain climb.`];function ue(e=[],t={}){let n=[],r=e.length>0?e.length:150,i=[{t:0,x:220,y:1320,elev:10},{t:.08,x:380,y:1140,elev:45},{t:.16,x:580,y:980,elev:120},{t:.24,x:820,y:1120,elev:90},{t:.32,x:940,y:860,elev:180},{t:.4,x:720,y:640,elev:320},{t:.48,x:1050,y:520,elev:580},{t:.56,x:1320,y:720,elev:890},{t:.64,x:1540,y:480,elev:1250},{t:.72,x:1780,y:680,elev:920},{t:.8,x:1980,y:920,elev:460},{t:.88,x:2220,y:760,elev:750},{t:.94,x:2180,y:480,elev:1180},{t:1,x:2420,y:240,elev:1620}];for(let a=0;a<r;a++){let o=r>1?a/(r-1):0,s=0;for(;s<i.length-2&&i[s+1].t<o;)s++;let c=i[Math.max(0,s-1)],l=i[s],u=i[Math.min(i.length-1,s+1)],d=i[Math.min(i.length-1,s+2)],f=u.t-l.t||.001,p=(o-l.t)/f,m=p,h=m*m,g=h*m,_=-.5*g+h-.5*m,v=1.5*g-2.5*h+1,y=-1.5*g+2*h+.5*m,b=.5*g-.5*h,x=_*c.x+v*l.x+y*u.x+b*d.x,S=_*c.y+v*l.y+y*u.y+b*d.y,C=Math.sin(a*.45)*14+Math.cos(a*.9)*8,w=Math.cos(a*.4)*14+Math.sin(a*.85)*8;x=Math.round(x+C),S=Math.round(S+w);let T=Math.round(l.elev+p*(u.elev-l.elev)+Math.sin(a*.5)*15),E=z.find(e=>o<=e.tMax)||z[z.length-1],D=e.length>0?e[a]:a+1,O=t[D]||(D<0?`Custom Challenge ${a+1}`:`LeetCode #${D}`),k=B[a%B.length];n.push({id:D,sequenceIndex:a,x,y:S,name:O,biome:E.biome,regionName:E.name,elevation:Math.max(10,T),lore:k})}return n}var V=[{id:`wm-bg1`,x:380,y:310,size:70,height:85,ridgeShift:-4,hasSnow:!1,layer:0,elevation:840,rangeName:`Western Crags`},{id:`wm-bg2`,x:490,y:280,size:85,height:105,ridgeShift:6,hasSnow:!0,layer:0,elevation:1120,name:`Peak of the North Wind`,rangeName:`Western Crags`},{id:`wm-bg3`,x:620,y:300,size:75,height:95,ridgeShift:-3,hasSnow:!1,layer:0,elevation:960,rangeName:`Western Crags`},{id:`wm-bg4`,x:730,y:320,size:65,height:80,ridgeShift:4,hasSnow:!1,layer:0,elevation:780,rangeName:`Western Crags`},{id:`m1`,x:430,y:375,size:80,height:105,ridgeShift:5,hasSnow:!0,elevation:1240,name:`Crag of the Mist`,rangeName:`Western Crags`},{id:`m2`,x:530,y:345,size:95,height:125,ridgeShift:-7,hasSnow:!0,elevation:1480,name:`Peak of Solitude`,rangeName:`Western Crags`},{id:`m3`,x:630,y:365,size:85,height:110,ridgeShift:3,hasSnow:!0,elevation:1310,name:`Shadowhorn`,rangeName:`Western Crags`},{id:`m4`,x:720,y:385,size:70,height:90,ridgeShift:-4,hasSnow:!1,elevation:990,rangeName:`Western Crags`},{id:`m5`,x:370,y:430,size:55,height:65,ridgeShift:4,hasSnow:!1,layer:2,elevation:620,rangeName:`Western Crags`},{id:`m6`,x:470,y:425,size:68,height:80,ridgeShift:-3,hasSnow:!1,layer:2,elevation:760,name:`Gullwing Bluff`,rangeName:`Western Crags`},{id:`m6b`,x:575,y:420,size:72,height:88,ridgeShift:3,hasSnow:!1,layer:2,elevation:850,rangeName:`Western Crags`},{id:`m6c`,x:670,y:435,size:58,height:70,ridgeShift:-2,hasSnow:!1,layer:2,elevation:680,rangeName:`Western Crags`},{id:`dt-bg1`,x:1130,y:260,size:90,height:120,ridgeShift:-6,hasSnow:!0,layer:0,elevation:1850,rangeName:`Dragon's Tooth Range`},{id:`dt-bg2`,x:1250,y:225,size:115,height:150,ridgeShift:8,hasSnow:!0,layer:0,elevation:2180,name:`Crown of the North`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg3`,x:1380,y:210,size:130,height:175,ridgeShift:-10,hasSnow:!0,layer:0,elevation:2450,name:`Apex of Clouds`,rangeName:`Dragon's Tooth Range`},{id:`dt-bg4`,x:1510,y:240,size:110,height:145,ridgeShift:7,hasSnow:!0,layer:0,elevation:2020,rangeName:`Dragon's Tooth Range`},{id:`dt-bg5`,x:1640,y:280,size:90,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1690,rangeName:`Dragon's Tooth Range`},{id:`m7`,x:1190,y:325,size:105,height:140,ridgeShift:-8,hasSnow:!0,elevation:1980,name:`The Dragon's Crest`,rangeName:`Dragon's Tooth Range`},{id:`m8`,x:1310,y:295,size:125,height:165,ridgeShift:10,hasSnow:!0,elevation:2360,name:`Frostcrag Pinnacle`,rangeName:`Dragon's Tooth Range`},{id:`m9`,x:1435,y:320,size:115,height:150,ridgeShift:-6,hasSnow:!0,elevation:2120,name:`Thunderhorn Peak`,rangeName:`Dragon's Tooth Range`},{id:`m10`,x:1560,y:355,size:98,height:125,ridgeShift:7,hasSnow:!0,elevation:1780,name:`Screaming Ridge`,rangeName:`Dragon's Tooth Range`},{id:`m10b`,x:1680,y:375,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1420,rangeName:`Dragon's Tooth Range`},{id:`m11`,x:1260,y:415,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1560,name:`Ironhorn Needle`,rangeName:`Dragon's Tooth Range`},{id:`m12`,x:1375,y:405,size:100,height:130,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Shadowcrevasse Crag`,rangeName:`Dragon's Tooth Range`},{id:`m13`,x:1490,y:440,size:88,height:110,ridgeShift:-4,hasSnow:!0,elevation:1490,rangeName:`Dragon's Tooth Range`},{id:`m14`,x:1610,y:435,size:82,height:100,ridgeShift:5,hasSnow:!1,elevation:1320,rangeName:`Dragon's Tooth Range`},{id:`m15`,x:1160,y:590,size:80,height:100,ridgeShift:5,hasSnow:!1,elevation:1180,name:`Wanderer's Bluff`,rangeName:`Mid-Pass Gorge`},{id:`m16`,x:1390,y:610,size:90,height:115,ridgeShift:-6,hasSnow:!0,elevation:1390,name:`Eagle Eye Ridge`,rangeName:`Mid-Pass Gorge`},{id:`m17`,x:1510,y:585,size:95,height:120,ridgeShift:5,hasSnow:!0,elevation:1520,name:`Razorback Spine`,rangeName:`Mid-Pass Gorge`},{id:`m18`,x:1630,y:565,size:85,height:105,ridgeShift:-4,hasSnow:!1,elevation:1280,rangeName:`Mid-Pass Gorge`},{id:`m18b`,x:1740,y:580,size:75,height:90,ridgeShift:3,hasSnow:!1,elevation:1050,rangeName:`Mid-Pass Gorge`},{id:`es-bg1`,x:1980,y:310,size:88,height:115,ridgeShift:-5,hasSnow:!0,layer:0,elevation:1650,rangeName:`Sunstone Highlands`},{id:`es-bg2`,x:2110,y:245,size:105,height:140,ridgeShift:6,hasSnow:!0,layer:0,elevation:1980,name:`Sun Pillar`,rangeName:`Sunstone Highlands`},{id:`es-bg3`,x:2260,y:160,size:135,height:180,ridgeShift:-8,hasSnow:!0,layer:0,elevation:2580,name:`Crown of the Heavens`,rangeName:`Sunstone Highlands`},{id:`es-bg4`,x:2410,y:210,size:115,height:150,ridgeShift:7,hasSnow:!0,layer:0,elevation:2240,rangeName:`Sunstone Highlands`},{id:`m19`,x:2040,y:375,size:98,height:128,ridgeShift:6,hasSnow:!0,elevation:1720,name:`Sunstone Spire`,rangeName:`Sunstone Highlands`},{id:`m20`,x:2170,y:315,size:115,height:150,ridgeShift:-7,hasSnow:!0,elevation:2080,name:`Sanctuary Peak`,rangeName:`Sunstone Highlands`},{id:`m21`,x:2310,y:220,size:130,height:170,ridgeShift:8,hasSnow:!0,elevation:2390,name:`Pinnacle of the Ancients`,rangeName:`Sunstone Highlands`},{id:`m22`,x:2440,y:360,size:90,height:115,ridgeShift:-5,hasSnow:!0,elevation:1610,name:`Falcon Perch`,rangeName:`Sunstone Highlands`},{id:`m23`,x:2260,y:405,size:82,height:98,ridgeShift:4,hasSnow:!1,elevation:1250,name:`Altar Crag`,rangeName:`Sunstone Highlands`},{id:`m24`,x:2380,y:420,size:76,height:88,ridgeShift:-3,hasSnow:!1,elevation:1120,rangeName:`Sunstone Highlands`},{id:`m25`,x:2140,y:450,size:70,height:80,ridgeShift:3,hasSnow:!1,elevation:980,rangeName:`Sunstone Highlands`}],H=[{id:`river-elden`,name:`River Elden`,d:`M 1340,290 C 1310,380 1260,460 1210,540 C 1140,640 1020,700 960,820 C 900,940 930,1060 880,1180 C 840,1280 760,1360 690,1480`,width:14,hasBridges:[{x:945,y:855,angle:-35},{x:890,y:1160,angle:25}]},{id:`river-silver`,name:`Silver Meander`,d:`M 580,410 C 650,490 730,550 780,660 C 830,760 910,810 960,820`,width:8,hasBridges:[{x:740,y:620,angle:45}]},{id:`river-cataract`,name:`Highland Torrent`,d:`M 2150,320 C 2100,450 2050,600 2020,760 C 1990,920 1920,1050 1840,1180 C 1760,1310 1710,1420 1660,1500`,width:11,hasBridges:[{x:2010,y:810,angle:-20}]}],U=[{id:`f1`,name:`The Whispering Pines`,cx:580,cy:1040,rx:230,ry:160,treeCount:42,trees:W(580,1040,210,140,42,`pines`)},{id:`f2`,name:`Elderwood Deep`,cx:820,cy:1140,rx:250,ry:180,treeCount:52,trees:W(820,1140,230,160,52,`oaks`)},{id:`f3`,name:`Mistwood Valley`,cx:860,cy:620,rx:190,ry:140,treeCount:36,trees:W(860,620,170,120,36,`willows`)},{id:`f4`,name:`Highland Spruces`,cx:1760,cy:740,rx:210,ry:155,treeCount:38,trees:W(1760,740,190,135,38,`highland_spruce`)},{id:`f5`,name:`Verdant Basin`,cx:1960,cy:980,rx:200,ry:150,treeCount:38,trees:W(1960,980,180,130,38,`mixed`)},{id:`f6`,name:`Shadowglen Copse`,cx:390,cy:690,rx:140,ry:100,treeCount:22,trees:W(390,690,120,80,22,`pines`)},{id:`f7`,name:`Sunstone Grove`,cx:2360,cy:580,rx:150,ry:110,treeCount:24,trees:W(2360,580,130,90,24,`mixed`)}];function W(e,t,n,r,i,a){let o=[];for(let s=0;s<i;s++){let c=s*2.399963+Math.sin(s*1.7)*.4,l=((s+.5)/i)**.65,u=Math.sin(s*4.3+e)*14,d=Math.cos(s*3.9+t)*12,f=Math.round(e+n*l*Math.cos(c)+u),p=Math.round(t+r*l*Math.sin(c)+d),m=.85+s%4*.1;s===0||s===5?m=1.35:s%7==0&&(m=.68);let h=`pine`;if(a===`pines`)h=s%6==0?`birch`:`pine`;else if(a===`oaks`)h=s===0||s===5?`ancient_oak`:s%5==0?`birch`:`oak`;else if(a===`willows`)h=s%3==0?`willow`:s%4==0?`birch`:`oak`;else if(a===`highland_spruce`)h=s%5==0?`pine`:`spruce`;else{let e=s%5;h=e===0?`ancient_oak`:e===1?`pine`:e===2?`oak`:e===3?`spruce`:`birch`}o.push({x:f,y:p,scale:m,type:h,seed:Math.round(e*7+t*11+s*31)})}return o}function G(e){if(e.length===0)return``;if(e.length===1)return`M ${e[0].x},${e[0].y}`;let t=`M ${e[0].x},${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=(r.x+i.x)/2,o=(r.y+i.y)/2;if(n===0)t+=` Q ${r.x},${r.y} ${a},${o}`;else{let a=e[n-1],o=r.x+(i.x-a.x)*.18,s=r.y+(i.y-a.y)*.18;t+=` S ${o},${s} ${i.x},${i.y}`}}return t}function K(e,t){return t<=0||e.length===0?``:G(e.slice(0,t+1))}var de={parchment:{id:`parchment`,name:`Daylight Parchment`,bgClass:`parchment-bg`,textColor:`#2c221a`,pencilColor:`#382e25`,pencilShade:`#8c765c`,riverColor:`#96afbe`,glowColor:`#f59e0b`,glowSubtle:`#fbbf24`,nodeUnlit:`#f0e5ce`,nodeLit:`#fbbf24`,nodeLitStroke:`#ffffff`},dark_parchment:{id:`dark_parchment`,name:`Midnight Cartography`,bgClass:`parchment-dark-bg`,textColor:`#f3e9d2`,pencilColor:`#8a7761`,pencilShade:`#4a3f33`,riverColor:`#365163`,glowColor:`#fbbf24`,glowSubtle:`#f59e0b`,nodeUnlit:`#231e17`,nodeLit:`#f59e0b`,nodeLitStroke:`#fffbeb`}},q=new class{ctx=null;enabled=!0;initCtx(){if(!this.ctx&&typeof window<`u`){let e=window.AudioContext||window.webkitAudioContext;e&&(this.ctx=new e)}this.ctx&&this.ctx.state===`suspended`&&this.ctx.resume()}setEnabled(e){this.enabled=e,e&&this.initCtx()}isEnabled(){return this.enabled}playNodeLightUp(e,t=150){if(this.enabled&&(this.initCtx(),this.ctx))try{let n=this.ctx.currentTime,r=[261.63,293.66,329.63,392,440,523.25,587.33,659.25,783.99,880],i=Math.floor(e/Math.max(1,t)*20),a=1+Math.floor(i/r.length)*.5,o=r[i%r.length]*a,s=this.ctx.createOscillator(),c=this.ctx.createOscillator(),l=this.ctx.createGain();s.type=`sine`,s.frequency.setValueAtTime(o,n),c.type=`triangle`,c.frequency.setValueAtTime(o*2.01,n),l.gain.setValueAtTime(.001,n),l.gain.linearRampToValueAtTime(.12,n+.02),l.gain.exponentialRampToValueAtTime(1e-4,n+.55),s.connect(l),c.connect(l),l.connect(this.ctx.destination),s.start(n),c.start(n),s.stop(n+.6),c.stop(n+.6)}catch{}}playPencilScratch(){if(this.enabled&&(this.initCtx(),this.ctx))try{let e=this.ctx.currentTime,t=Math.floor(this.ctx.sampleRate*.06),n=this.ctx.createBuffer(1,t,this.ctx.sampleRate),r=n.getChannelData(0);for(let e=0;e<t;e++)r[e]=(Math.random()*2-1)*Math.exp(-e/(t*.4));let i=this.ctx.createBufferSource();i.buffer=n;let a=this.ctx.createBiquadFilter();a.type=`bandpass`,a.frequency.setValueAtTime(1400+Math.random()*800,e),a.Q.setValueAtTime(3.5,e);let o=this.ctx.createGain();o.gain.setValueAtTime(.04,e),o.gain.exponentialRampToValueAtTime(.001,e+.05),i.connect(a),a.connect(o),o.connect(this.ctx.destination),i.start(e)}catch{}}playVictoryChime(){this.enabled&&(this.initCtx(),this.ctx&&[523.25,659.25,783.99,1046.5].forEach((e,t)=>{setTimeout(()=>{if(!this.ctx)return;let t=this.ctx.currentTime,n=this.ctx.createOscillator(),r=this.ctx.createGain();n.type=`sine`,n.frequency.setValueAtTime(e,t),r.gain.setValueAtTime(.001,t),r.gain.linearRampToValueAtTime(.15,t+.05),r.gain.exponentialRampToValueAtTime(1e-4,t+1.2),n.connect(r),r.connect(this.ctx.destination),n.start(t),n.stop(t+1.3)},t*120)}))}},J=r();function Y(e){let t=Math.sin(e*12.9898+78.233)*43758.5453;return t-Math.floor(t)}var fe=({mountain:e,theme:t})=>{let n=t.id!==`parchment`,r=t.pencilColor,i=t.pencilShade,{id:a,x:o,y:s,size:c,height:l,ridgeShift:u=0,hasSnow:d=l>95}=e,f=(0,I.useMemo)(()=>{let e=0;for(let t=0;t<a.length;t++)e+=a.charCodeAt(t)*(t+1);e+=Math.round(o+s);let t=o+u,n=s-l,r=o-c,i=o+c,f=[{x:t,y:n}];for(let i=1;i<=6;i++){let a=i/6,o=t-(t-r)*a,s=n+l*a,u=(Y(e+i*17)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+i*31)>.65?l*.04:0;f.push({x:Math.round(o+u),y:Math.round(s+d)})}let p=[];for(let r=1;r<=6;r++){let a=r/6,o=t+(i-t)*a,s=n+l*a,u=(Y(e+r*43)-.48)*(c*.14)*Math.sin(a*Math.PI),d=Y(e+r*59)>.65?l*.04:0;p.push({x:Math.round(o+u),y:Math.round(s+d)})}let m=[{x:t,y:n}];for(let r=1;r<=7;r++){let i=r/7,a=t+(o+u*.25+(Y(e+101)-.5)*(c*.15)-t)*i**1.2,s=n+l*i,d=Math.sin(i*Math.PI*2.2+Y(e+113))*(c*.1);m.push({x:Math.round(a+d),y:Math.round(s)})}let h=[],g=m[Math.min(m.length-1,2)];if(g){let t=o+c*.55+(Y(e+201)-.5)*15,n=s-l*.12,r=(g.x+t)/2+12,i=(g.y+n)/2-6;h.push({d:`M ${g.x},${g.y} Q ${r},${i} ${t},${n}`,side:`right`})}let _=m[Math.min(m.length-1,5)];if(_){let t=o+c*.85+(Y(e+209)-.5)*15,n=s,r=(_.x+t)/2+10,i=(_.y+n)/2-4;h.push({d:`M ${_.x},${_.y} Q ${r},${i} ${t},${n}`,side:`right`})}let v=m[Math.min(m.length-1,3)];if(v){let t=o-c*.6+(Y(e+301)-.5)*15,n=s-l*.15,r=(v.x+t)/2-10,i=(v.y+n)/2-5;h.push({d:`M ${v.x},${v.y} Q ${r},${i} ${t},${n}`,side:`left`})}let y=[],b=Math.max(14,Math.round(l/4.8));for(let r=1;r<=b;r++){let a=r/(b+1),o=m[Math.min(m.length-1,Math.max(0,Math.round(a*(m.length-1))))],s=n+l*a,c=p[Math.min(p.length-1,Math.max(0,Math.round(a*(p.length-1))))]||{x:t+(i-t)*a,y:s},u=o.x+(c.x-o.x)*.08,d=s+(Y(e+r*71)-.5)*3,f=r%3==0?.92:r%2==0?.75:.6,h=u+(c.x-u)*f,g=d+((s-n)*.22+(c.y-s)*.35)+(Y(e+r*83)-.5)*4;y.push({x1:Math.round(u),y1:Math.round(d),x2:Math.round(h),y2:Math.round(g),width:r<4?.9:1.25,opacity:r<3?.6:.85}),r>4&&r%2==0&&y.push({x1:Math.round(u+(h-u)*.3),y1:Math.round(d+(g-d)*.3),x2:Math.round(u+(h-u)*.75),y2:Math.round(d+(g-d)*.15),width:.75,opacity:.55})}let x=[],S=Math.max(4,Math.round(l/18));for(let i=1;i<=S;i++){let a=(i+.3)/(S+1),o=n+l*a,s=m[Math.min(m.length-1,Math.round(a*(m.length-1)))],c=f[Math.min(f.length-1,Math.round(a*(f.length-1)))]||{x:t-(t-r)*a,y:o},u=s.x-(s.x-c.x)*.25,d=o+2,p=s.x-(s.x-c.x)*(.6+Y(e+i*97)*.3),h=o+8+Y(e+i*103)*6,g=(u+p)/2-4,_=(d+h)/2+3;if(x.push({d:`M ${Math.round(u)},${Math.round(d)} Q ${Math.round(g)},${Math.round(_)} ${Math.round(p)},${Math.round(h)}`,width:.9}),i%2==1){let e=u-6,t=d+3;x.push({d:`M ${Math.round(e)},${Math.round(t)} L ${Math.round(e-8)},${Math.round(t+10)}`,width:.75})}}let C=``,w=``;if(d){let e=n+l*.32,a=t-(t-r)*.32,o=t+(i-t)*.32,s=m[Math.min(m.length-1,2)]||{x:t,y:e},c={x:t-(t-r)*.16,y:e-4},u={x:t-(t-r)*.26,y:e+6},d={x:t+(i-t)*.14,y:e+3},h={x:t+(i-t)*.24,y:e-2};C=`M ${t},${n}
2
  L ${f[1].x},${f[1].y}
3
  L ${a},${e}
4
  Q ${u.x},${u.y} ${c.x},${c.y}
algospaced-ui/dist/assets/{PythonChallenge-3lpSHvfF.js → MarkdownRenderer-DcpmP1uN.js} RENAMED
The diff for this file is too large to render. See raw diff
 
algospaced-ui/dist/assets/{PrincessChamber-CXQLBBNW.js → PrincessChamber-BzhzFHRQ.js} RENAMED
@@ -1 +1 @@
1
- import{a as e,c as t,s as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import{A as i,C as a,D as o,E as s,G as c,I as l,O as u,P as d,S as f,T as p,W as m,_ as h,b as g,j as _,v,w as y,x as b,y as x,z as S}from"./index-V2pPJO9M.js";var C=c(`castle`,[[`path`,{d:`M10 5V3`,key:`1y54qe`}],[`path`,{d:`M14 5V3`,key:`m6isi`}],[`path`,{d:`M15 21v-3a3 3 0 0 0-6 0v3`,key:`lbp5hj`}],[`path`,{d:`M18 3v8`,key:`2ollhf`}],[`path`,{d:`M18 5H6`,key:`98imr9`}],[`path`,{d:`M22 11H2`,key:`1lmjae`}],[`path`,{d:`M22 9v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9`,key:`1rly83`}],[`path`,{d:`M6 3v8`,key:`csox7g`}]]),w=c(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),T=c(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),E=c(`scroll`,[[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),D=c(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),O=c(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),k=t(e(),1),A={1:{particleType:`pollen`,particleCount:16,particleColors:[`#FDE047`,`#FEF08A`,`#86EFAC`],gradientBg:`from-[#FFFDF0] via-[#FFF9E6] to-[#FEF3C7]`,glowColor:`rgba(251, 191, 36, 0.3)`,badgeLabel:`🌾 Plains Breeze`},2:{particleType:`leaves`,particleCount:18,particleColors:[`#86EFAC`,`#4ADE80`,`#22C55E`,`#A7F3D0`],gradientBg:`from-[#F0FDF4] via-[#DCFCE7] to-[#FEF9C3]`,glowColor:`rgba(34, 197, 94, 0.3)`,badgeLabel:`🍃 Whispering Leaves`},3:{particleType:`spores`,particleCount:22,particleColors:[`#67E8F9`,`#38BDF8`,`#818CF8`,`#C084FC`],gradientBg:`from-[#F0F9FF] via-[#E0F2FE] to-[#EDE9FE]`,glowColor:`rgba(56, 189, 248, 0.35)`,badgeLabel:`✨ Crystal Spores`},4:{particleType:`snow`,particleCount:28,particleColors:[`#FFFFFF`,`#E0F2FE`,`#BAE6FD`],gradientBg:`from-[#F8FAFC] via-[#F1F5F9] to-[#E2E8F0]`,glowColor:`rgba(186, 230, 253, 0.4)`,badgeLabel:`❄️ Alpine Snowfall`},5:{particleType:`runes`,particleCount:20,particleColors:[`#E879F9`,`#C084FC`,`#A855F7`,`#F472B6`],gradientBg:`from-[#FAF5FF] via-[#F3E8FF] to-[#FCE7F3]`,glowColor:`rgba(192, 132, 252, 0.4)`,badgeLabel:`🔮 Arcane Runes`},6:{particleType:`stardust`,particleCount:35,particleColors:[`#FDE047`,`#F59E0B`,`#E11D48`,`#818CF8`],gradientBg:`from-[#FFFBEB] via-[#FEF3C7] to-[#FFE4E6]`,glowColor:`rgba(245, 158, 11, 0.5)`,badgeLabel:`👑 Spire Gates`}};function j(e){return e<=30?A[1]:e<=60?A[2]:e<=90?A[3]:e<=120?A[4]:e<150?A[5]:A[6]}var M=r();function N({emotion:e,floor:t,rhythm:n,activity:r,isLoading:i=!1}){let a=g[e]||g.smiling_warmly,o=(0,k.useMemo)(()=>j(t),[t]),s=(0,k.useMemo)(()=>{switch(n){case`dawn`:return`from-amber-400/40 via-yellow-300/30 to-rose-300/20`;case`dusk`:return`from-orange-400/40 via-purple-400/30 to-amber-300/20`;case`night`:return`from-indigo-600/40 via-blue-500/30 to-amber-500/20`;default:return`from-amber-400/30 via-yellow-300/40 to-indigo-400/30`}},[n]);return(0,M.jsxs)(`div`,{className:`relative flex flex-col items-center justify-center my-auto w-full max-w-xl`,children:[(0,M.jsx)(`div`,{className:`absolute -inset-10 overflow-hidden pointer-events-none z-0`,children:Array.from({length:Math.min(18,o.particleCount)}).map((e,t)=>{let n=o.particleColors[t%o.particleColors.length],r=`${t*19%100}%`,i=`${6+t%5*2}s`,a=`${t*.7%4}s`,s=o.particleType===`leaves`||o.particleType===`runes`?`w-2.5 h-2.5`:`w-1.5 h-1.5`;return(0,M.jsx)(`span`,{className:`absolute rounded-full opacity-65 animate-pulse ${s}`,style:{backgroundColor:n,left:r,top:`${t*23%90}%`,boxShadow:`0 0 8px ${n}`,animationDuration:i,animationDelay:a}},t)})}),(0,M.jsxs)(`div`,{className:`relative group z-10`,children:[(0,M.jsx)(`div`,{className:`absolute -inset-2 bg-gradient-to-r ${s} rounded-2xl blur-md opacity-80 group-hover:opacity-100 transition duration-500`}),(0,M.jsxs)(`div`,{className:`relative w-36 h-44 sm:w-44 sm:h-52 bg-gradient-to-b from-amber-100 to-amber-200 border-[3px] border-ink-black rounded-xl overflow-hidden shadow-[4px_4px_0px_0px_#1E293B] transition-transform duration-300 flex items-center justify-center`,children:[(0,M.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center text-amber-700/40 pointer-events-none select-none`,children:[(0,M.jsx)(_,{className:`w-8 h-8 animate-pulse`}),(0,M.jsx)(`span`,{className:`font-arcade text-[10px] mt-2`,children:`Princess Aurelia`})]}),(0,M.jsx)(`img`,{src:a.imagePath,alt:a.label,loading:`eager`,className:`w-full h-full object-cover object-top transition-all duration-300 relative z-10 ${i?`scale-105 filter saturate-125`:`scale-100`}`,onError:e=>{let t=e.currentTarget;t.src.endsWith(`/sprites/princess/neutral.png`)?t.style.display=`none`:t.src=`/sprites/princess/neutral.png`}}),(0,M.jsxs)(`div`,{className:`absolute bottom-0 inset-x-0 bg-ink-black/85 backdrop-blur-xs text-[10px] text-amber-300 py-1 px-2 font-bold uppercase tracking-wider text-center flex items-center justify-center gap-1.5`,children:[(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${i?`bg-amber-400 animate-ping`:`bg-emerald-400`}`}),(0,M.jsx)(`span`,{children:i?`Pondering...`:a.label})]})]}),(0,M.jsx)(`div`,{className:`absolute -top-2 -right-2 bg-[#FFE24C] border-[2px] border-ink-black rounded-full p-1 shadow-[2px_2px_0px_0px_#1E293B]`,children:(0,M.jsx)(_,{className:`w-3.5 h-3.5 text-amber-800`})})]}),r&&(0,M.jsx)(`div`,{className:`mt-2 text-center max-w-sm px-2`,children:(0,M.jsxs)(`span`,{className:`text-[10px] font-semibold text-slate-700 bg-white/85 px-2.5 py-0.5 rounded-full border border-ink-black/20 shadow-xs inline-flex items-center gap-1`,children:[(0,M.jsx)(`span`,{children:`🏰`}),(0,M.jsx)(`span`,{className:`truncate`,children:r})]})})]})}function P({text:e,characterName:t,emotion:n,isLoading:r=!1,isStreaming:i=!1,toolCalls:a,onTypingStatusChange:o}){let[s,c]=(0,k.useState)(e),[l,u]=(0,k.useState)(!1),d=(0,k.useRef)(null),f=(0,k.useRef)(e),p=(0,k.useRef)(0),m=(0,k.useRef)(o);(0,k.useEffect)(()=>{m.current=o},[o]);let h=g[n]||g.smiling_warmly,_=e=>{u(e),m.current?.(e)};return(0,k.useEffect)(()=>{if(i){d.current&&clearInterval(d.current),c(e),_(!0),e.length-p.current>=4&&(p.current=e.length,v(e.length)),f.current=e;return}if(e!==f.current&&!r){let t=f.current.length>0&&e.startsWith(f.current);if(f.current=e,d.current&&clearInterval(d.current),t)c(e),_(!1);else{c(``),_(!0);let t=0;d.current=setInterval(()=>{t<e.length?(t++,c(e.slice(0,t)),t%2==0&&e[t-1]!==` `&&v(t)):(d.current&&clearInterval(d.current),_(!1))},22)}}else!r&&e===f.current&&!i&&(c(e),l&&_(!1));return()=>{d.current&&clearInterval(d.current)}},[e,r,i]),(0,M.jsxs)(`div`,{onClick:()=>{l&&(d.current&&clearInterval(d.current),c(e),_(!1))},className:`w-full max-w-xl mt-3 sm:mt-4 relative bg-white border-[3px] border-ink-black rounded-xl p-3.5 sm:p-4 shadow-[4px_4px_0px_0px_#1E293B] transition-all cursor-pointer group select-text`,children:[(0,M.jsx)(`div`,{className:`absolute -top-3 left-1/2 -translate-x-1/2 w-0 h-0 border-x-8 border-x-transparent border-b-8 border-b-ink-black pointer-events-none`}),(0,M.jsx)(`div`,{className:`absolute -top-2 left-1/2 -translate-x-1/2 w-0 h-0 border-x-6 border-x-transparent border-b-6 border-b-white pointer-events-none`}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-amber-100 pb-1.5 mb-2 select-none`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,M.jsxs)(`span`,{className:`font-headline-md font-bold text-xs text-amber-900 flex items-center gap-1`,children:[`👑 `,t||`Princess Aurelia`]}),(0,M.jsx)(`span`,{className:`text-[9px] bg-amber-100 text-amber-800 font-bold px-1.5 py-0.2 rounded border border-amber-200`,children:h.label})]}),l&&(0,M.jsx)(`span`,{className:`text-[9px] text-trash-gray font-medium animate-pulse`,children:`Click bubble to skip`})]}),r?(0,M.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs font-medium text-trash-gray select-none`,children:[(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce`}),(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce [animation-delay:0.2s]`}),(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce [animation-delay:0.4s]`}),(0,M.jsxs)(`span`,{className:`ml-1 text-slate-600`,children:[t||`Princess Aurelia`,` is attuning the crystal relay...`]})]}):(0,M.jsxs)(`div`,{className:`text-xs sm:text-[13px] text-ink-black font-medium leading-relaxed whitespace-pre-wrap`,children:[(e=>e.split(/(\*[^*]+\*)/g).map((e,t)=>e.startsWith(`*`)&&e.endsWith(`*`)?(0,M.jsx)(`span`,{className:`text-amber-700 italic font-semibold mr-1 inline-block`,children:e},t):(0,M.jsx)(`span`,{children:e},t)))(s),l&&(0,M.jsx)(`span`,{className:`inline-block w-1.5 h-3.5 bg-amber-500 ml-1 animate-pulse align-middle`})]}),a&&a.length>0&&!r&&(0,M.jsx)(`div`,{className:`mt-2.5 pt-2 border-t border-amber-100/80 flex flex-wrap gap-1.5 select-none`,children:a.map((e,t)=>{let n=`✨ Enchantment: ${e.name}`;return e.name===`open_app_window`&&(n=`📜 Summoned: ${e.args?.window_id||`Grimoire`}`),e.name===`set_study_timer`&&(n=`⏳ Hourglass: ${e.args?.minutes||15}m rest`),e.name===`play_ambient_sound`&&(n=`🔥 Kindled: ${e.args?.soundscape||`Soundscape`}`),e.name===`write_spire_diary`&&(n=`📖 Chronicled in Spire Diary`),(0,M.jsx)(`span`,{className:`px-2 py-0.5 rounded-full bg-indigo-50 border border-indigo-200 text-[10px] font-bold text-indigo-800 flex items-center gap-1 shadow-xs`,children:(0,M.jsx)(`span`,{children:n})},t)})})]})}var F=[{label:`💪 Solved a Tough One`,prompt:`I just solved a really tough problem! Felt so good getting all test cases to pass.`},{label:`😩 Feeling Stuck`,prompt:`I feel really stuck and discouraged today. It feels like everyone else gets this except me.`},{label:`☕ Need a Breather`,prompt:`My brain is pretty fried from practicing today. Can we just take a short breather?`},{label:`🌙 Life Beyond the Tower`,prompt:`What’s the first thing you want to do once we break the seals and get you out of that tower?`}];function I({suggestions:e,isLoading:t=!1,onSendMessage:n,placeholder:r=`Speak with Princess Aurelia...`}){let[i,a]=(0,k.useState)(``),o=()=>{let e=i.trim();e&&!t&&(n(e),a(``))},s=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),o())},c=Array.isArray(e)&&e.length>0;return(0,M.jsxs)(`div`,{className:`w-full flex flex-col items-center gap-2 select-none z-10`,children:[(0,M.jsx)(`div`,{className:`w-full max-w-xl flex items-center justify-center gap-1.5 flex-wrap py-1.5 px-2`,children:c?e.map((e,r)=>(0,M.jsxs)(`button`,{type:`button`,onClick:()=>n(e),disabled:t,className:`px-2.5 py-1 bg-white hover:bg-amber-100 disabled:opacity-50 border-[1.5px] border-ink-black rounded-full text-[10px] sm:text-[11px] font-bold text-slate-800 cursor-pointer shadow-[1px_1px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1`,children:[(0,M.jsx)(_,{className:`w-3 h-3 text-amber-600 shrink-0`}),(0,M.jsx)(`span`,{className:`truncate max-w-[200px]`,children:e})]},r)):F.map((e,r)=>(0,M.jsx)(`button`,{type:`button`,onClick:()=>n(e.prompt),disabled:t,className:`px-2.5 py-1 bg-white hover:bg-amber-100 disabled:opacity-50 border-[1.5px] border-ink-black rounded-full text-[10px] sm:text-[11px] font-bold text-slate-800 cursor-pointer shadow-[1px_1px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all`,children:e.label},r))}),(0,M.jsxs)(`div`,{className:`w-full bg-white border-t-[3px] border-ink-black p-3 sm:px-4 flex items-center gap-2 shrink-0`,children:[(0,M.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),onKeyDown:s,disabled:t,placeholder:r,className:`flex-1 bg-[#FFFDF0] border-[2px] border-ink-black rounded-lg px-3.5 py-2 text-xs sm:text-sm font-medium text-ink-black placeholder-slate-400 focus:outline-none focus:border-amber-500 shadow-inner disabled:opacity-50`}),(0,M.jsxs)(`button`,{type:`button`,onClick:o,disabled:t||!i.trim(),className:`px-4 sm:px-5 py-2 bg-[#FFE24C] hover:bg-yellow-300 disabled:opacity-50 border-[2px] border-ink-black rounded-lg font-bold text-xs sm:text-sm text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer flex items-center gap-1.5 shrink-0`,children:[(0,M.jsx)(D,{className:`w-3.5 h-3.5`}),(0,M.jsx)(`span`,{children:`Send`})]})]})]})}function L({currentFloor:e,onClose:t}){let n=y(e),r=Math.min(100,Math.round(e/150*100));return(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/40 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200 select-none`,onClick:t,children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl p-4 sm:p-5 max-w-md w-full shadow-[6px_6px_0px_0px_#1E293B] flex flex-col gap-3.5`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(C,{className:`w-5 h-5 text-indigo-600`}),(0,M.jsx)(`h4`,{className:`font-headline-md font-bold text-sm text-ink-black m-0`,children:`Journey to the Big-O Spire`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(s,{className:`w-4 h-4`})})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-xs font-bold font-headline-md`,children:[(0,M.jsx)(`span`,{children:`Path Progress:`}),(0,M.jsxs)(`span`,{className:`font-arcade bg-indigo-100 text-indigo-900 px-2 py-0.5 rounded border border-indigo-300`,children:[e,` / 150 Leagues`]})]}),(0,M.jsx)(`div`,{className:`w-full bg-slate-200 h-4 border-[2px] border-ink-black rounded-full overflow-hidden p-0.5`,children:(0,M.jsx)(`div`,{className:`bg-gradient-to-r from-amber-400 via-yellow-400 to-emerald-400 h-full rounded-full transition-all duration-500`,style:{width:`${r}%`}})}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-trash-gray font-medium`,children:[(0,M.jsxs)(`span`,{children:[`Progress: `,(0,M.jsxs)(`strong`,{children:[r,`%`]})]}),(0,M.jsxs)(`span`,{children:[`Distance to Tower: `,(0,M.jsxs)(`strong`,{children:[Math.max(0,150-e),` leagues`]})]})]})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[2px] border-ink-black rounded-lg p-3 shadow-[2px_2px_0px_0px_#1E293B] flex flex-col gap-1`,children:[(0,M.jsx)(`div`,{className:`text-[10px] font-bold uppercase text-amber-700 tracking-wider`,children:`Current Realm:`}),(0,M.jsx)(`div`,{className:`font-bold text-xs text-ink-black`,children:n.title}),(0,M.jsx)(`p`,{className:`text-[11px] text-slate-600 m-0 leading-relaxed font-medium`,children:n.description}),(0,M.jsxs)(`div`,{className:`text-[10px] text-amber-900 bg-amber-50 p-1.5 rounded border border-amber-200 italic mt-1`,children:[`📜 `,n.bgLore]})]}),(0,M.jsx)(`div`,{className:`flex items-center justify-between gap-1 text-center`,children:[{floor:30,label:`Arrays`},{floor:60,label:`Pointers`},{floor:90,label:`Trees`},{floor:120,label:`Heaps`},{floor:150,label:`Spire`}].map(t=>{let n=e>=t.floor;return(0,M.jsxs)(`div`,{className:`flex-1 p-1.5 rounded border text-[10px] flex flex-col items-center ${n?`bg-emerald-100 border-emerald-600 text-emerald-900 font-bold`:`bg-slate-100 border-slate-300 text-slate-500`}`,children:[(0,M.jsx)(`span`,{children:n?`✓`:t.floor}),(0,M.jsx)(`span`,{className:`text-[9px] truncate w-full`,children:t.label})]},t.floor)})}),(0,M.jsx)(`div`,{className:`flex items-center justify-end border-t border-slate-200 pt-2 mt-1`,children:(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`px-4 py-1.5 bg-white hover:bg-slate-100 border-[1.5px] border-ink-black rounded font-bold text-xs text-ink-black cursor-pointer shadow-xs active:translate-y-0.5`,children:`Done`})})]})})}function R({unlockedLetters:e,spireChronicles:t,currentFloor:n,heroCodex:r,episodicEvents:o,recentToolTelemetry:c,onRemoveCodexItem:u,onClose:d}){let[f,h]=(0,k.useState)(`letters`),[g,v]=(0,k.useState)(e[e.length-1]||null);return(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/50 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200 select-none`,onClick:d,children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl max-w-lg w-full h-[85%] max-h-[560px] shadow-[6px_6px_0px_0px_#1E293B] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`bg-white border-b-[2px] border-ink-black px-4 py-2.5 flex items-center justify-between shrink-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(E,{className:`w-5 h-5 text-amber-700`}),(0,M.jsx)(`h4`,{className:`font-headline-md font-bold text-sm text-ink-black m-0`,children:`The Royal Satchel`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:d,className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(s,{className:`w-4 h-4`})})]}),(0,M.jsxs)(`div`,{className:`flex border-b-2 border-ink-black bg-amber-100/70 shrink-0`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>h(`letters`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer border-r border-ink-black/20 ${f===`letters`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(E,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Missives (`,e.length,`/5)`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>h(`diary`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer border-r border-ink-black/20 ${f===`diary`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(m,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Chronicles (`,t.length,`)`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>h(`codex`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer ${f===`codex`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(_,{className:`w-3.5 h-3.5 text-amber-700`}),(0,M.jsx)(`span`,{children:`Codex`})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 p-3 sm:p-4 overflow-y-auto custom-scrollbar flex flex-col gap-3 min-h-0`,children:[f===`letters`&&(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[(0,M.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1`,children:[30,60,90,120,150].map(e=>{let t=a[e],r=n>=e,i=g?.floor===e;return(0,M.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>r&&v(t),className:`px-3 py-1 rounded-full text-[11px] font-bold border-[1.5px] border-ink-black flex items-center gap-1 shrink-0 transition-all cursor-pointer ${r?i?`bg-[#FFE24C] text-ink-black shadow-[1.5px_1.5px_0px_0px_#1E293B]`:`bg-white hover:bg-amber-100 text-slate-800`:`opacity-40 bg-slate-200 text-slate-500 cursor-not-allowed`}`,children:[r?(0,M.jsx)(`span`,{children:`📜`}):(0,M.jsx)(l,{className:`w-3 h-3`}),(0,M.jsxs)(`span`,{children:[`League `,e]})]},e)})}),g?(0,M.jsxs)(`div`,{className:`bg-[#FFF9E6] border-[2px] border-amber-900/40 rounded-lg p-4 shadow-sm flex-1 overflow-y-auto custom-scrollbar flex flex-col select-text`,children:[(0,M.jsxs)(`div`,{className:`border-b border-amber-800/20 pb-2 mb-3 flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`text-[10px] font-bold text-amber-800 uppercase tracking-wider`,children:[g.chapterTitle,` • League `,g.floor]}),(0,M.jsx)(`h5`,{className:`font-headline-md font-bold text-sm text-amber-950 m-0`,children:g.title})]}),(0,M.jsx)(`span`,{className:`text-xl`,children:`🪶`})]}),(0,M.jsx)(`p`,{className:`text-xs sm:text-[13px] text-amber-950 font-serif leading-relaxed whitespace-pre-wrap flex-1 italic`,children:g.letterText})]}):(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-center p-6 text-slate-500`,children:[(0,M.jsx)(l,{className:`w-8 h-8 mb-2 text-slate-400`}),(0,M.jsx)(`p`,{className:`text-xs font-medium`,children:`Conquer 30 LeetCode problems along the path to receive your first Royal Missive from Aurelia.`})]})]}),f===`diary`&&(0,M.jsx)(`div`,{className:`flex flex-col gap-2.5 flex-1`,children:t.length>0?t.map(e=>(0,M.jsxs)(`div`,{className:`p-3 bg-white border-[1.5px] border-ink-black rounded-lg shadow-xs flex flex-col gap-1 select-text`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-amber-800 font-bold border-b border-slate-100 pb-1`,children:[(0,M.jsxs)(`span`,{children:[`League `,e.floor,` along the Path`]}),(0,M.jsx)(`span`,{children:new Date(e.timestamp).toLocaleDateString()})]}),(0,M.jsxs)(`p`,{className:`text-xs text-ink-black font-medium leading-relaxed m-0 italic font-serif`,children:[`“`,e.text,`”`]})]},e.id)):(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-center p-6 text-slate-500`,children:[(0,M.jsx)(m,{className:`w-8 h-8 mb-2 text-slate-400`}),(0,M.jsx)(`p`,{className:`text-xs font-medium`,children:`Aurelia records entries in her Spire Chronicles autonomously as you chat, rest, and cross chapter milestones.`})]})}),f===`codex`&&(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1 select-text`,children:[(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,M.jsx)(_,{className:`w-4 h-4 text-amber-600`}),(0,M.jsx)(`h5`,{className:`font-headline-md font-bold text-xs text-ink-black m-0`,children:`Hero Codex (MemGPT & Mem0 Core Memory)`})]}),(0,M.jsx)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:`Cognitive Sync`})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2 text-xs`,children:[(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Hero Alias`}),(0,M.jsx)(`span`,{className:`font-bold text-ink-black text-xs`,children:r?.heroName||`Champion`})]}),(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Target Goal`}),(0,M.jsx)(`span`,{className:`font-bold text-amber-900 text-xs`,children:r?.targetGoal||`None shared yet (mention to Aurelia!)`})]})]}),r?.preferredLanguage&&(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2 text-xs`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Weapon of Choice (Language)`}),(0,M.jsx)(`span`,{className:`font-bold text-ink-black`,children:r.preferredLanguage})]})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-emerald-800`,children:[(0,M.jsx)(S,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Mastered Patterns (`,r?.strengths?.length||0,`)`]})]}),r?.strengths&&r.strengths.length>0?(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.strengths.map(e=>(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-emerald-50 text-emerald-800 border border-emerald-300`,children:[e,u&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(`strengths`,e),className:`hover:text-red-600 ml-0.5 cursor-pointer`,title:`Forget strength`,children:(0,M.jsx)(s,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Aurelia will note topics you conquer during your practice.`})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-rose-800`,children:[(0,M.jsx)(O,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Nemesis Patterns (`,r?.nemesisPatterns?.length||0,`)`]})]}),r?.nemesisPatterns&&r.nemesisPatterns.length>0?(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.nemesisPatterns.map(e=>(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-rose-50 text-rose-800 border border-rose-300`,children:[e,u&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(`nemesisPatterns`,e),className:`hover:text-red-700 ml-0.5 cursor-pointer`,title:`Forget nemesis`,children:(0,M.jsx)(s,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Aurelia tracks patterns that give you trouble to help you prepare targeted drills.`})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsx)(`div`,{className:`text-xs font-bold text-slate-800`,children:(0,M.jsxs)(`span`,{children:[`Personal Notes & Shared Lore (`,r?.personalNotes?.length||0,`)`]})}),r?.personalNotes&&r.personalNotes.length>0?(0,M.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.personalNotes.map(e=>(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-2 p-2 bg-slate-50 border border-slate-200 rounded text-[11px] text-slate-700`,children:[(0,M.jsxs)(`span`,{children:[`• `,e]}),u&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(`personalNotes`,e),className:`text-slate-400 hover:text-red-600 shrink-0 cursor-pointer p-0.5`,title:`Forget note`,children:(0,M.jsx)(i,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Share your background or routine with Aurelia and she will hold it in her memory.`})]}),o&&o.length>0&&(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1`,children:[(0,M.jsx)(`span`,{className:`text-xs font-bold text-slate-800`,children:`Episodic Memory Chain (EM-LLM)`}),(0,M.jsxs)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:[o.length,` events`]})]}),(0,M.jsx)(`div`,{className:`flex flex-col gap-2 max-h-40 overflow-y-auto custom-scrollbar`,children:o.slice(0,8).map(e=>(0,M.jsxs)(`div`,{className:`text-[11px] p-2 bg-[#FFFDF0] border border-amber-900/15 rounded flex flex-col gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`span`,{className:`font-bold text-ink-black uppercase text-[9px] px-1.5 py-0.5 bg-amber-200/60 rounded`,children:e.eventType.replace(`_`,` `)}),(0,M.jsx)(`span`,{className:`text-[10px] text-slate-400`,children:new Date(e.timestamp).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]}),(0,M.jsx)(`div`,{className:`font-bold text-slate-800 mt-0.5`,children:e.title}),(0,M.jsx)(`div`,{className:`text-slate-600 text-[10px]`,children:e.description})]},e.id))})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-indigo-900`,children:[(0,M.jsx)(p,{className:`w-3.5 h-3.5 text-amber-500`}),(0,M.jsx)(`span`,{children:`Autonomous Enchantment Telemetry`})]}),(0,M.jsxs)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:[c?.length||0,` executed`]})]}),c&&c.length>0?(0,M.jsx)(`div`,{className:`flex flex-col gap-1.5 max-h-36 overflow-y-auto custom-scrollbar`,children:c.slice(0,10).map((e,t)=>(0,M.jsxs)(`div`,{className:`text-[11px] p-2 bg-indigo-50/50 border border-indigo-100 rounded flex items-center justify-between gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,M.jsxs)(`span`,{className:`font-bold text-indigo-950 font-mono text-[10px] truncate`,children:[e.tool_name,`()`]}),e.args&&Object.keys(e.args).length>0&&(0,M.jsx)(`span`,{className:`text-[9px] text-slate-500 truncate`,children:JSON.stringify(e.args).slice(0,50)})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.execution_time_ms!==void 0&&(0,M.jsxs)(`span`,{className:`text-[9px] text-slate-400 flex items-center gap-0.5 font-mono`,children:[(0,M.jsx)(w,{className:`w-2.5 h-2.5`}),e.execution_time_ms,`ms`]}),(0,M.jsx)(`span`,{className:`px-1.5 py-0.2 text-[9px] font-bold rounded ${e.success?`bg-emerald-100 text-emerald-800`:`bg-rose-100 text-rose-800`}`,children:e.success?`SUCCESS`:`ERR`})]})]},t))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`No autonomous enchantments executed yet in this session.`})]})]})]}),(0,M.jsx)(`div`,{className:`bg-white border-t border-slate-200 px-4 py-2 flex items-center justify-end shrink-0`,children:(0,M.jsx)(`button`,{type:`button`,onClick:d,className:`px-4 py-1.5 bg-white hover:bg-slate-100 border-[1.5px] border-ink-black rounded font-bold text-xs text-ink-black cursor-pointer shadow-xs active:translate-y-0.5`,children:`Close`})})]})})}var z=n({default:()=>B});function B(){let e=f(),[t,n]=(0,k.useState)(h()),[r,i]=(0,k.useState)(!1),[a,c]=(0,k.useState)(!1),[l,p]=(0,k.useState)(!1);(0,k.useEffect)(()=>{b.syncWithBackend(),b.triggerProactiveGreeting()},[]);let m=()=>{let e=!t;n(e),x(e)},g=()=>{window.confirm(`Clear conversation transcript with Princess Aurelia?`)&&b.clearTranscript()},v=(0,k.useCallback)(e=>{b.setIsTyping(e)},[]),y=(0,k.useMemo)(()=>[...e.transcript].reverse().find(e=>e.sender===`princess`)||e.transcript[0],[e.transcript]);return(0,M.jsxs)(`div`,{className:`relative w-full h-full bg-gradient-to-b from-[#FFFDF0] via-[#FFF9E6] to-[#FFF3CD] flex flex-col select-none font-sans text-ink-black overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`h-12 bg-white/95 backdrop-blur-sm border-b-[3px] border-ink-black px-3 sm:px-4 flex items-center justify-between gap-2 shrink-0 shadow-sm z-20`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,M.jsx)(_,{className:`w-4 h-4 text-amber-500 shrink-0`}),(0,M.jsx)(`h3`,{className:`font-headline-md font-bold text-xs sm:text-sm text-ink-black m-0 truncate`,children:e.companionSettings.name||`Princess Aurelia`})]}),(0,M.jsx)(`span`,{className:`hidden sm:inline-flex px-2 py-0.5 rounded-full bg-amber-100 border border-amber-300 text-[10px] font-bold text-amber-900 shadow-inner shrink-0`,children:e.bondTier}),(0,M.jsx)(`span`,{className:`hidden md:inline-flex px-2 py-0.5 rounded-full bg-indigo-50 border border-indigo-200 text-[10px] font-bold text-indigo-800 shrink-0`,children:e.currentRhythm.toUpperCase()})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 sm:gap-2 shrink-0`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`px-2.5 py-1 bg-amber-100 hover:bg-amber-200 border-[2px] border-ink-black rounded font-bold text-[11px] text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1.5`,title:`View Spire Journey Progress`,children:[(0,M.jsx)(C,{className:`w-3.5 h-3.5 text-indigo-700`}),(0,M.jsxs)(`span`,{className:`font-arcade text-[9px] text-indigo-950`,children:[e.currentFloor,`/150 LC`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>c(!0),className:`px-2.5 py-1 bg-white hover:bg-amber-50 border-[2px] border-ink-black rounded font-bold text-[11px] text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1.5`,title:`Open Royal Satchel (Missives & Diary)`,children:[(0,M.jsx)(E,{className:`w-3.5 h-3.5 text-amber-700`}),(0,M.jsx)(`span`,{className:`hidden md:inline`,children:`Satchel`}),e.unlockedLetters.length>0&&(0,M.jsx)(`span`,{className:`w-4 h-4 rounded-full bg-amber-400 text-ink-black text-[9px] font-extrabold flex items-center justify-center border border-ink-black`,children:e.unlockedLetters.length})]}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>p(!0),className:`p-1.5 bg-white hover:bg-slate-100 border-[2px] border-ink-black rounded text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all`,title:`View Transcript History`,children:(0,M.jsx)(T,{className:`w-3.5 h-3.5 text-slate-700`})}),(0,M.jsx)(`button`,{type:`button`,onClick:m,className:`p-1.5 border-[2px] border-ink-black rounded text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all ${t?`bg-slate-200 opacity-80`:`bg-[#FFE24C] hover:bg-yellow-300`}`,title:t?`Unmute Audio`:`Mute Audio`,children:t?(0,M.jsx)(o,{className:`w-3.5 h-3.5`}):(0,M.jsx)(u,{className:`w-3.5 h-3.5`})})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-start gap-3 sm:gap-4 p-3 sm:p-5 overflow-y-auto custom-scrollbar min-h-0 relative`,children:[(0,M.jsx)(N,{emotion:e.activeEmotion,floor:e.currentFloor,rhythm:e.currentRhythm,activity:e.currentActivity,isLoading:e.isLoading}),(0,M.jsx)(P,{text:y?.text||`I believe in you, champion!`,characterName:e.companionSettings.name,emotion:e.activeEmotion,isLoading:e.isLoading,isStreaming:y?.isStreaming,toolCalls:y?.toolCalls,onTypingStatusChange:v})]}),(0,M.jsx)(I,{suggestions:y?.choiceSuggestions,isLoading:e.isLoading,onSendMessage:e=>b.sendMessage(e),placeholder:`Speak with ${e.companionSettings.name||`Princess Aurelia`}...`}),r&&(0,M.jsx)(L,{currentFloor:e.currentFloor,totalSolved:e.totalSolved,onClose:()=>i(!1)}),a&&(0,M.jsx)(R,{unlockedLetters:e.unlockedLetters,spireChronicles:e.spireChronicles,currentFloor:e.currentFloor,heroCodex:e.heroCodex,episodicEvents:e.episodicEvents,recentToolTelemetry:e.recentToolTelemetry,onRemoveCodexItem:b.removeCodexItem,onClose:()=>c(!1)}),l&&(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/40 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200`,onClick:()=>p(!1),children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl max-w-lg w-full h-[80%] max-h-[520px] shadow-[6px_6px_0px_0px_#1E293B] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`bg-white border-b-[2px] border-ink-black px-4 py-2.5 flex items-center justify-between shrink-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(T,{className:`w-4 h-4 text-ink-black`}),(0,M.jsxs)(`h4`,{className:`font-headline-md font-bold text-xs sm:text-sm text-ink-black m-0`,children:[`Dialogue Transcript (`,e.transcript.length,` turns)`]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:g,className:`p-1 hover:bg-rose-100 text-rose-700 rounded text-[11px] font-bold flex items-center gap-1 cursor-pointer mr-1`,title:`Clear Chat History`,children:[(0,M.jsx)(d,{className:`w-3.5 h-3.5`}),(0,M.jsx)(`span`,{children:`Clear`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>p(!1),className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(s,{className:`w-4 h-4`})})]})]}),(0,M.jsx)(`div`,{className:`flex-1 p-3 sm:p-4 overflow-y-auto custom-scrollbar flex flex-col gap-2.5`,children:e.transcript.map((t,n)=>(0,M.jsxs)(`div`,{className:`p-2.5 rounded-lg border-[2px] border-ink-black shadow-[2px_2px_0px_0px_#1E293B] max-w-[90%] ${t.sender===`princess`?`bg-white text-ink-black self-start`:`bg-[#FFE24C] text-ink-black self-end`}`,children:[(0,M.jsx)(`div`,{className:`text-[10px] font-bold font-headline-md mb-1 text-slate-600`,children:t.sender===`princess`?e.companionSettings.name:`Hero`}),(0,M.jsx)(`p`,{className:`text-xs font-medium m-0 leading-relaxed whitespace-pre-wrap select-text`,children:t.text})]},t.id||n))})]})})]})}export{z as t};
 
1
+ import{a as e,c as t,s as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import{A as i,C as a,D as o,E as s,G as c,I as l,O as u,P as d,S as f,T as p,W as m,_ as h,b as g,j as _,v,w as y,x as b,y as x,z as S}from"./index-M1GCaKIP.js";var C=c(`castle`,[[`path`,{d:`M10 5V3`,key:`1y54qe`}],[`path`,{d:`M14 5V3`,key:`m6isi`}],[`path`,{d:`M15 21v-3a3 3 0 0 0-6 0v3`,key:`lbp5hj`}],[`path`,{d:`M18 3v8`,key:`2ollhf`}],[`path`,{d:`M18 5H6`,key:`98imr9`}],[`path`,{d:`M22 11H2`,key:`1lmjae`}],[`path`,{d:`M22 9v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9`,key:`1rly83`}],[`path`,{d:`M6 3v8`,key:`csox7g`}]]),w=c(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),T=c(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),E=c(`scroll`,[[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),D=c(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),O=c(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),k=t(e(),1),A={1:{particleType:`pollen`,particleCount:16,particleColors:[`#FDE047`,`#FEF08A`,`#86EFAC`],gradientBg:`from-[#FFFDF0] via-[#FFF9E6] to-[#FEF3C7]`,glowColor:`rgba(251, 191, 36, 0.3)`,badgeLabel:`🌾 Plains Breeze`},2:{particleType:`leaves`,particleCount:18,particleColors:[`#86EFAC`,`#4ADE80`,`#22C55E`,`#A7F3D0`],gradientBg:`from-[#F0FDF4] via-[#DCFCE7] to-[#FEF9C3]`,glowColor:`rgba(34, 197, 94, 0.3)`,badgeLabel:`🍃 Whispering Leaves`},3:{particleType:`spores`,particleCount:22,particleColors:[`#67E8F9`,`#38BDF8`,`#818CF8`,`#C084FC`],gradientBg:`from-[#F0F9FF] via-[#E0F2FE] to-[#EDE9FE]`,glowColor:`rgba(56, 189, 248, 0.35)`,badgeLabel:`✨ Crystal Spores`},4:{particleType:`snow`,particleCount:28,particleColors:[`#FFFFFF`,`#E0F2FE`,`#BAE6FD`],gradientBg:`from-[#F8FAFC] via-[#F1F5F9] to-[#E2E8F0]`,glowColor:`rgba(186, 230, 253, 0.4)`,badgeLabel:`❄️ Alpine Snowfall`},5:{particleType:`runes`,particleCount:20,particleColors:[`#E879F9`,`#C084FC`,`#A855F7`,`#F472B6`],gradientBg:`from-[#FAF5FF] via-[#F3E8FF] to-[#FCE7F3]`,glowColor:`rgba(192, 132, 252, 0.4)`,badgeLabel:`🔮 Arcane Runes`},6:{particleType:`stardust`,particleCount:35,particleColors:[`#FDE047`,`#F59E0B`,`#E11D48`,`#818CF8`],gradientBg:`from-[#FFFBEB] via-[#FEF3C7] to-[#FFE4E6]`,glowColor:`rgba(245, 158, 11, 0.5)`,badgeLabel:`👑 Spire Gates`}};function j(e){return e<=30?A[1]:e<=60?A[2]:e<=90?A[3]:e<=120?A[4]:e<150?A[5]:A[6]}var M=r();function N({emotion:e,floor:t,rhythm:n,activity:r,isLoading:i=!1}){let a=g[e]||g.smiling_warmly,o=(0,k.useMemo)(()=>j(t),[t]),s=(0,k.useMemo)(()=>{switch(n){case`dawn`:return`from-amber-400/40 via-yellow-300/30 to-rose-300/20`;case`dusk`:return`from-orange-400/40 via-purple-400/30 to-amber-300/20`;case`night`:return`from-indigo-600/40 via-blue-500/30 to-amber-500/20`;default:return`from-amber-400/30 via-yellow-300/40 to-indigo-400/30`}},[n]);return(0,M.jsxs)(`div`,{className:`relative flex flex-col items-center justify-center my-auto w-full max-w-xl`,children:[(0,M.jsx)(`div`,{className:`absolute -inset-10 overflow-hidden pointer-events-none z-0`,children:Array.from({length:Math.min(18,o.particleCount)}).map((e,t)=>{let n=o.particleColors[t%o.particleColors.length],r=`${t*19%100}%`,i=`${6+t%5*2}s`,a=`${t*.7%4}s`,s=o.particleType===`leaves`||o.particleType===`runes`?`w-2.5 h-2.5`:`w-1.5 h-1.5`;return(0,M.jsx)(`span`,{className:`absolute rounded-full opacity-65 animate-pulse ${s}`,style:{backgroundColor:n,left:r,top:`${t*23%90}%`,boxShadow:`0 0 8px ${n}`,animationDuration:i,animationDelay:a}},t)})}),(0,M.jsxs)(`div`,{className:`relative group z-10`,children:[(0,M.jsx)(`div`,{className:`absolute -inset-2 bg-gradient-to-r ${s} rounded-2xl blur-md opacity-80 group-hover:opacity-100 transition duration-500`}),(0,M.jsxs)(`div`,{className:`relative w-36 h-44 sm:w-44 sm:h-52 bg-gradient-to-b from-amber-100 to-amber-200 border-[3px] border-ink-black rounded-xl overflow-hidden shadow-[4px_4px_0px_0px_#1E293B] transition-transform duration-300 flex items-center justify-center`,children:[(0,M.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center text-amber-700/40 pointer-events-none select-none`,children:[(0,M.jsx)(_,{className:`w-8 h-8 animate-pulse`}),(0,M.jsx)(`span`,{className:`font-arcade text-[10px] mt-2`,children:`Princess Aurelia`})]}),(0,M.jsx)(`img`,{src:a.imagePath,alt:a.label,loading:`eager`,className:`w-full h-full object-cover object-top transition-all duration-300 relative z-10 ${i?`scale-105 filter saturate-125`:`scale-100`}`,onError:e=>{let t=e.currentTarget;t.src.endsWith(`/sprites/princess/neutral.png`)?t.style.display=`none`:t.src=`/sprites/princess/neutral.png`}}),(0,M.jsxs)(`div`,{className:`absolute bottom-0 inset-x-0 bg-ink-black/85 backdrop-blur-xs text-[10px] text-amber-300 py-1 px-2 font-bold uppercase tracking-wider text-center flex items-center justify-center gap-1.5`,children:[(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${i?`bg-amber-400 animate-ping`:`bg-emerald-400`}`}),(0,M.jsx)(`span`,{children:i?`Pondering...`:a.label})]})]}),(0,M.jsx)(`div`,{className:`absolute -top-2 -right-2 bg-[#FFE24C] border-[2px] border-ink-black rounded-full p-1 shadow-[2px_2px_0px_0px_#1E293B]`,children:(0,M.jsx)(_,{className:`w-3.5 h-3.5 text-amber-800`})})]}),r&&(0,M.jsx)(`div`,{className:`mt-2 text-center max-w-sm px-2`,children:(0,M.jsxs)(`span`,{className:`text-[10px] font-semibold text-slate-700 bg-white/85 px-2.5 py-0.5 rounded-full border border-ink-black/20 shadow-xs inline-flex items-center gap-1`,children:[(0,M.jsx)(`span`,{children:`🏰`}),(0,M.jsx)(`span`,{className:`truncate`,children:r})]})})]})}function P({text:e,characterName:t,emotion:n,isLoading:r=!1,isStreaming:i=!1,toolCalls:a,onTypingStatusChange:o}){let[s,c]=(0,k.useState)(e),[l,u]=(0,k.useState)(!1),d=(0,k.useRef)(null),f=(0,k.useRef)(e),p=(0,k.useRef)(0),m=(0,k.useRef)(o);(0,k.useEffect)(()=>{m.current=o},[o]);let h=g[n]||g.smiling_warmly,_=e=>{u(e),m.current?.(e)};return(0,k.useEffect)(()=>{if(i){d.current&&clearInterval(d.current),c(e),_(!0),e.length-p.current>=4&&(p.current=e.length,v(e.length)),f.current=e;return}if(e!==f.current&&!r){let t=f.current.length>0&&e.startsWith(f.current);if(f.current=e,d.current&&clearInterval(d.current),t)c(e),_(!1);else{c(``),_(!0);let t=0;d.current=setInterval(()=>{t<e.length?(t++,c(e.slice(0,t)),t%2==0&&e[t-1]!==` `&&v(t)):(d.current&&clearInterval(d.current),_(!1))},22)}}else!r&&e===f.current&&!i&&(c(e),l&&_(!1));return()=>{d.current&&clearInterval(d.current)}},[e,r,i]),(0,M.jsxs)(`div`,{onClick:()=>{l&&(d.current&&clearInterval(d.current),c(e),_(!1))},className:`w-full max-w-xl mt-3 sm:mt-4 relative bg-white border-[3px] border-ink-black rounded-xl p-3.5 sm:p-4 shadow-[4px_4px_0px_0px_#1E293B] transition-all cursor-pointer group select-text`,children:[(0,M.jsx)(`div`,{className:`absolute -top-3 left-1/2 -translate-x-1/2 w-0 h-0 border-x-8 border-x-transparent border-b-8 border-b-ink-black pointer-events-none`}),(0,M.jsx)(`div`,{className:`absolute -top-2 left-1/2 -translate-x-1/2 w-0 h-0 border-x-6 border-x-transparent border-b-6 border-b-white pointer-events-none`}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-amber-100 pb-1.5 mb-2 select-none`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,M.jsxs)(`span`,{className:`font-headline-md font-bold text-xs text-amber-900 flex items-center gap-1`,children:[`👑 `,t||`Princess Aurelia`]}),(0,M.jsx)(`span`,{className:`text-[9px] bg-amber-100 text-amber-800 font-bold px-1.5 py-0.2 rounded border border-amber-200`,children:h.label})]}),l&&(0,M.jsx)(`span`,{className:`text-[9px] text-trash-gray font-medium animate-pulse`,children:`Click bubble to skip`})]}),r?(0,M.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs font-medium text-trash-gray select-none`,children:[(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce`}),(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce [animation-delay:0.2s]`}),(0,M.jsx)(`span`,{className:`inline-block w-2 h-2 bg-amber-500 rounded-full animate-bounce [animation-delay:0.4s]`}),(0,M.jsxs)(`span`,{className:`ml-1 text-slate-600`,children:[t||`Princess Aurelia`,` is attuning the crystal relay...`]})]}):(0,M.jsxs)(`div`,{className:`text-xs sm:text-[13px] text-ink-black font-medium leading-relaxed whitespace-pre-wrap`,children:[(e=>e.split(/(\*[^*]+\*)/g).map((e,t)=>e.startsWith(`*`)&&e.endsWith(`*`)?(0,M.jsx)(`span`,{className:`text-amber-700 italic font-semibold mr-1 inline-block`,children:e},t):(0,M.jsx)(`span`,{children:e},t)))(s),l&&(0,M.jsx)(`span`,{className:`inline-block w-1.5 h-3.5 bg-amber-500 ml-1 animate-pulse align-middle`})]}),a&&a.length>0&&!r&&(0,M.jsx)(`div`,{className:`mt-2.5 pt-2 border-t border-amber-100/80 flex flex-wrap gap-1.5 select-none`,children:a.map((e,t)=>{let n=`✨ Enchantment: ${e.name}`;return e.name===`open_app_window`&&(n=`📜 Summoned: ${e.args?.window_id||`Grimoire`}`),e.name===`set_study_timer`&&(n=`⏳ Hourglass: ${e.args?.minutes||15}m rest`),e.name===`play_ambient_sound`&&(n=`🔥 Kindled: ${e.args?.soundscape||`Soundscape`}`),e.name===`write_spire_diary`&&(n=`📖 Chronicled in Spire Diary`),(0,M.jsx)(`span`,{className:`px-2 py-0.5 rounded-full bg-indigo-50 border border-indigo-200 text-[10px] font-bold text-indigo-800 flex items-center gap-1 shadow-xs`,children:(0,M.jsx)(`span`,{children:n})},t)})})]})}var F=[{label:`💪 Solved a Tough One`,prompt:`I just solved a really tough problem! Felt so good getting all test cases to pass.`},{label:`😩 Feeling Stuck`,prompt:`I feel really stuck and discouraged today. It feels like everyone else gets this except me.`},{label:`☕ Need a Breather`,prompt:`My brain is pretty fried from practicing today. Can we just take a short breather?`},{label:`🌙 Life Beyond the Tower`,prompt:`What’s the first thing you want to do once we break the seals and get you out of that tower?`}];function I({suggestions:e,isLoading:t=!1,onSendMessage:n,placeholder:r=`Speak with Princess Aurelia...`}){let[i,a]=(0,k.useState)(``),o=()=>{let e=i.trim();e&&!t&&(n(e),a(``))},s=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),o())},c=Array.isArray(e)&&e.length>0;return(0,M.jsxs)(`div`,{className:`w-full flex flex-col items-center gap-2 select-none z-10`,children:[(0,M.jsx)(`div`,{className:`w-full max-w-xl flex items-center justify-center gap-1.5 flex-wrap py-1.5 px-2`,children:c?e.map((e,r)=>(0,M.jsxs)(`button`,{type:`button`,onClick:()=>n(e),disabled:t,className:`px-2.5 py-1 bg-white hover:bg-amber-100 disabled:opacity-50 border-[1.5px] border-ink-black rounded-full text-[10px] sm:text-[11px] font-bold text-slate-800 cursor-pointer shadow-[1px_1px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1`,children:[(0,M.jsx)(_,{className:`w-3 h-3 text-amber-600 shrink-0`}),(0,M.jsx)(`span`,{className:`truncate max-w-[200px]`,children:e})]},r)):F.map((e,r)=>(0,M.jsx)(`button`,{type:`button`,onClick:()=>n(e.prompt),disabled:t,className:`px-2.5 py-1 bg-white hover:bg-amber-100 disabled:opacity-50 border-[1.5px] border-ink-black rounded-full text-[10px] sm:text-[11px] font-bold text-slate-800 cursor-pointer shadow-[1px_1px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all`,children:e.label},r))}),(0,M.jsxs)(`div`,{className:`w-full bg-white border-t-[3px] border-ink-black p-3 sm:px-4 flex items-center gap-2 shrink-0`,children:[(0,M.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),onKeyDown:s,disabled:t,placeholder:r,className:`flex-1 bg-[#FFFDF0] border-[2px] border-ink-black rounded-lg px-3.5 py-2 text-xs sm:text-sm font-medium text-ink-black placeholder-slate-400 focus:outline-none focus:border-amber-500 shadow-inner disabled:opacity-50`}),(0,M.jsxs)(`button`,{type:`button`,onClick:o,disabled:t||!i.trim(),className:`px-4 sm:px-5 py-2 bg-[#FFE24C] hover:bg-yellow-300 disabled:opacity-50 border-[2px] border-ink-black rounded-lg font-bold text-xs sm:text-sm text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer flex items-center gap-1.5 shrink-0`,children:[(0,M.jsx)(D,{className:`w-3.5 h-3.5`}),(0,M.jsx)(`span`,{children:`Send`})]})]})]})}function L({currentFloor:e,onClose:t}){let n=y(e),r=Math.min(100,Math.round(e/150*100));return(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/40 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200 select-none`,onClick:t,children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl p-4 sm:p-5 max-w-md w-full shadow-[6px_6px_0px_0px_#1E293B] flex flex-col gap-3.5`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(C,{className:`w-5 h-5 text-indigo-600`}),(0,M.jsx)(`h4`,{className:`font-headline-md font-bold text-sm text-ink-black m-0`,children:`Journey to the Big-O Spire`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(s,{className:`w-4 h-4`})})]}),(0,M.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-xs font-bold font-headline-md`,children:[(0,M.jsx)(`span`,{children:`Path Progress:`}),(0,M.jsxs)(`span`,{className:`font-arcade bg-indigo-100 text-indigo-900 px-2 py-0.5 rounded border border-indigo-300`,children:[e,` / 150 Leagues`]})]}),(0,M.jsx)(`div`,{className:`w-full bg-slate-200 h-4 border-[2px] border-ink-black rounded-full overflow-hidden p-0.5`,children:(0,M.jsx)(`div`,{className:`bg-gradient-to-r from-amber-400 via-yellow-400 to-emerald-400 h-full rounded-full transition-all duration-500`,style:{width:`${r}%`}})}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-trash-gray font-medium`,children:[(0,M.jsxs)(`span`,{children:[`Progress: `,(0,M.jsxs)(`strong`,{children:[r,`%`]})]}),(0,M.jsxs)(`span`,{children:[`Distance to Tower: `,(0,M.jsxs)(`strong`,{children:[Math.max(0,150-e),` leagues`]})]})]})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[2px] border-ink-black rounded-lg p-3 shadow-[2px_2px_0px_0px_#1E293B] flex flex-col gap-1`,children:[(0,M.jsx)(`div`,{className:`text-[10px] font-bold uppercase text-amber-700 tracking-wider`,children:`Current Realm:`}),(0,M.jsx)(`div`,{className:`font-bold text-xs text-ink-black`,children:n.title}),(0,M.jsx)(`p`,{className:`text-[11px] text-slate-600 m-0 leading-relaxed font-medium`,children:n.description}),(0,M.jsxs)(`div`,{className:`text-[10px] text-amber-900 bg-amber-50 p-1.5 rounded border border-amber-200 italic mt-1`,children:[`📜 `,n.bgLore]})]}),(0,M.jsx)(`div`,{className:`flex items-center justify-between gap-1 text-center`,children:[{floor:30,label:`Arrays`},{floor:60,label:`Pointers`},{floor:90,label:`Trees`},{floor:120,label:`Heaps`},{floor:150,label:`Spire`}].map(t=>{let n=e>=t.floor;return(0,M.jsxs)(`div`,{className:`flex-1 p-1.5 rounded border text-[10px] flex flex-col items-center ${n?`bg-emerald-100 border-emerald-600 text-emerald-900 font-bold`:`bg-slate-100 border-slate-300 text-slate-500`}`,children:[(0,M.jsx)(`span`,{children:n?`✓`:t.floor}),(0,M.jsx)(`span`,{className:`text-[9px] truncate w-full`,children:t.label})]},t.floor)})}),(0,M.jsx)(`div`,{className:`flex items-center justify-end border-t border-slate-200 pt-2 mt-1`,children:(0,M.jsx)(`button`,{type:`button`,onClick:t,className:`px-4 py-1.5 bg-white hover:bg-slate-100 border-[1.5px] border-ink-black rounded font-bold text-xs text-ink-black cursor-pointer shadow-xs active:translate-y-0.5`,children:`Done`})})]})})}function R({unlockedLetters:e,spireChronicles:t,currentFloor:n,heroCodex:r,episodicEvents:o,recentToolTelemetry:c,onRemoveCodexItem:u,onClose:d}){let[f,h]=(0,k.useState)(`letters`),[g,v]=(0,k.useState)(e[e.length-1]||null);return(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/50 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200 select-none`,onClick:d,children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl max-w-lg w-full h-[85%] max-h-[560px] shadow-[6px_6px_0px_0px_#1E293B] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`bg-white border-b-[2px] border-ink-black px-4 py-2.5 flex items-center justify-between shrink-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(E,{className:`w-5 h-5 text-amber-700`}),(0,M.jsx)(`h4`,{className:`font-headline-md font-bold text-sm text-ink-black m-0`,children:`The Royal Satchel`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:d,className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(s,{className:`w-4 h-4`})})]}),(0,M.jsxs)(`div`,{className:`flex border-b-2 border-ink-black bg-amber-100/70 shrink-0`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>h(`letters`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer border-r border-ink-black/20 ${f===`letters`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(E,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Missives (`,e.length,`/5)`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>h(`diary`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer border-r border-ink-black/20 ${f===`diary`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(m,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Chronicles (`,t.length,`)`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>h(`codex`),className:`flex-1 py-2 text-xs font-bold font-headline-md flex items-center justify-center gap-1.5 transition-colors cursor-pointer ${f===`codex`?`bg-[#FFFDF0] text-amber-950 border-b-2 border-b-[#FFFDF0] -mb-[2px]`:`text-slate-600 hover:bg-amber-200/50`}`,children:[(0,M.jsx)(_,{className:`w-3.5 h-3.5 text-amber-700`}),(0,M.jsx)(`span`,{children:`Codex`})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 p-3 sm:p-4 overflow-y-auto custom-scrollbar flex flex-col gap-3 min-h-0`,children:[f===`letters`&&(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1`,children:[(0,M.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1`,children:[30,60,90,120,150].map(e=>{let t=a[e],r=n>=e,i=g?.floor===e;return(0,M.jsxs)(`button`,{type:`button`,disabled:!r,onClick:()=>r&&v(t),className:`px-3 py-1 rounded-full text-[11px] font-bold border-[1.5px] border-ink-black flex items-center gap-1 shrink-0 transition-all cursor-pointer ${r?i?`bg-[#FFE24C] text-ink-black shadow-[1.5px_1.5px_0px_0px_#1E293B]`:`bg-white hover:bg-amber-100 text-slate-800`:`opacity-40 bg-slate-200 text-slate-500 cursor-not-allowed`}`,children:[r?(0,M.jsx)(`span`,{children:`📜`}):(0,M.jsx)(l,{className:`w-3 h-3`}),(0,M.jsxs)(`span`,{children:[`League `,e]})]},e)})}),g?(0,M.jsxs)(`div`,{className:`bg-[#FFF9E6] border-[2px] border-amber-900/40 rounded-lg p-4 shadow-sm flex-1 overflow-y-auto custom-scrollbar flex flex-col select-text`,children:[(0,M.jsxs)(`div`,{className:`border-b border-amber-800/20 pb-2 mb-3 flex items-center justify-between`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`div`,{className:`text-[10px] font-bold text-amber-800 uppercase tracking-wider`,children:[g.chapterTitle,` • League `,g.floor]}),(0,M.jsx)(`h5`,{className:`font-headline-md font-bold text-sm text-amber-950 m-0`,children:g.title})]}),(0,M.jsx)(`span`,{className:`text-xl`,children:`🪶`})]}),(0,M.jsx)(`p`,{className:`text-xs sm:text-[13px] text-amber-950 font-serif leading-relaxed whitespace-pre-wrap flex-1 italic`,children:g.letterText})]}):(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-center p-6 text-slate-500`,children:[(0,M.jsx)(l,{className:`w-8 h-8 mb-2 text-slate-400`}),(0,M.jsx)(`p`,{className:`text-xs font-medium`,children:`Conquer 30 LeetCode problems along the path to receive your first Royal Missive from Aurelia.`})]})]}),f===`diary`&&(0,M.jsx)(`div`,{className:`flex flex-col gap-2.5 flex-1`,children:t.length>0?t.map(e=>(0,M.jsxs)(`div`,{className:`p-3 bg-white border-[1.5px] border-ink-black rounded-lg shadow-xs flex flex-col gap-1 select-text`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between text-[10px] text-amber-800 font-bold border-b border-slate-100 pb-1`,children:[(0,M.jsxs)(`span`,{children:[`League `,e.floor,` along the Path`]}),(0,M.jsx)(`span`,{children:new Date(e.timestamp).toLocaleDateString()})]}),(0,M.jsxs)(`p`,{className:`text-xs text-ink-black font-medium leading-relaxed m-0 italic font-serif`,children:[`“`,e.text,`”`]})]},e.id)):(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center text-center p-6 text-slate-500`,children:[(0,M.jsx)(m,{className:`w-8 h-8 mb-2 text-slate-400`}),(0,M.jsx)(`p`,{className:`text-xs font-medium`,children:`Aurelia records entries in her Spire Chronicles autonomously as you chat, rest, and cross chapter milestones.`})]})}),f===`codex`&&(0,M.jsxs)(`div`,{className:`flex flex-col gap-3 flex-1 select-text`,children:[(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,M.jsx)(_,{className:`w-4 h-4 text-amber-600`}),(0,M.jsx)(`h5`,{className:`font-headline-md font-bold text-xs text-ink-black m-0`,children:`Hero Codex (MemGPT & Mem0 Core Memory)`})]}),(0,M.jsx)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:`Cognitive Sync`})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2 text-xs`,children:[(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Hero Alias`}),(0,M.jsx)(`span`,{className:`font-bold text-ink-black text-xs`,children:r?.heroName||`Champion`})]}),(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Target Goal`}),(0,M.jsx)(`span`,{className:`font-bold text-amber-900 text-xs`,children:r?.targetGoal||`None shared yet (mention to Aurelia!)`})]})]}),r?.preferredLanguage&&(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border border-amber-900/20 rounded p-2 text-xs`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-bold text-slate-500 uppercase tracking-wider block`,children:`Weapon of Choice (Language)`}),(0,M.jsx)(`span`,{className:`font-bold text-ink-black`,children:r.preferredLanguage})]})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-emerald-800`,children:[(0,M.jsx)(S,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Mastered Patterns (`,r?.strengths?.length||0,`)`]})]}),r?.strengths&&r.strengths.length>0?(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.strengths.map(e=>(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-emerald-50 text-emerald-800 border border-emerald-300`,children:[e,u&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(`strengths`,e),className:`hover:text-red-600 ml-0.5 cursor-pointer`,title:`Forget strength`,children:(0,M.jsx)(s,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Aurelia will note topics you conquer during your practice.`})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-rose-800`,children:[(0,M.jsx)(O,{className:`w-3.5 h-3.5`}),(0,M.jsxs)(`span`,{children:[`Nemesis Patterns (`,r?.nemesisPatterns?.length||0,`)`]})]}),r?.nemesisPatterns&&r.nemesisPatterns.length>0?(0,M.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.nemesisPatterns.map(e=>(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[11px] font-bold bg-rose-50 text-rose-800 border border-rose-300`,children:[e,u&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(`nemesisPatterns`,e),className:`hover:text-red-700 ml-0.5 cursor-pointer`,title:`Forget nemesis`,children:(0,M.jsx)(s,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Aurelia tracks patterns that give you trouble to help you prepare targeted drills.`})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsx)(`div`,{className:`text-xs font-bold text-slate-800`,children:(0,M.jsxs)(`span`,{children:[`Personal Notes & Shared Lore (`,r?.personalNotes?.length||0,`)`]})}),r?.personalNotes&&r.personalNotes.length>0?(0,M.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:r.personalNotes.map(e=>(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-2 p-2 bg-slate-50 border border-slate-200 rounded text-[11px] text-slate-700`,children:[(0,M.jsxs)(`span`,{children:[`• `,e]}),u&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(`personalNotes`,e),className:`text-slate-400 hover:text-red-600 shrink-0 cursor-pointer p-0.5`,title:`Forget note`,children:(0,M.jsx)(i,{className:`w-3 h-3`})})]},e))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`Share your background or routine with Aurelia and she will hold it in her memory.`})]}),o&&o.length>0&&(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1`,children:[(0,M.jsx)(`span`,{className:`text-xs font-bold text-slate-800`,children:`Episodic Memory Chain (EM-LLM)`}),(0,M.jsxs)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:[o.length,` events`]})]}),(0,M.jsx)(`div`,{className:`flex flex-col gap-2 max-h-40 overflow-y-auto custom-scrollbar`,children:o.slice(0,8).map(e=>(0,M.jsxs)(`div`,{className:`text-[11px] p-2 bg-[#FFFDF0] border border-amber-900/15 rounded flex flex-col gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,M.jsx)(`span`,{className:`font-bold text-ink-black uppercase text-[9px] px-1.5 py-0.5 bg-amber-200/60 rounded`,children:e.eventType.replace(`_`,` `)}),(0,M.jsx)(`span`,{className:`text-[10px] text-slate-400`,children:new Date(e.timestamp).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]}),(0,M.jsx)(`div`,{className:`font-bold text-slate-800 mt-0.5`,children:e.title}),(0,M.jsx)(`div`,{className:`text-slate-600 text-[10px]`,children:e.description})]},e.id))})]}),(0,M.jsxs)(`div`,{className:`bg-white border-[1.5px] border-ink-black rounded-lg p-3 shadow-xs flex flex-col gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 pb-1`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-bold text-indigo-900`,children:[(0,M.jsx)(p,{className:`w-3.5 h-3.5 text-amber-500`}),(0,M.jsx)(`span`,{children:`Autonomous Enchantment Telemetry`})]}),(0,M.jsxs)(`span`,{className:`text-[10px] text-slate-400 font-mono`,children:[c?.length||0,` executed`]})]}),c&&c.length>0?(0,M.jsx)(`div`,{className:`flex flex-col gap-1.5 max-h-36 overflow-y-auto custom-scrollbar`,children:c.slice(0,10).map((e,t)=>(0,M.jsxs)(`div`,{className:`text-[11px] p-2 bg-indigo-50/50 border border-indigo-100 rounded flex items-center justify-between gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,M.jsxs)(`span`,{className:`font-bold text-indigo-950 font-mono text-[10px] truncate`,children:[e.tool_name,`()`]}),e.args&&Object.keys(e.args).length>0&&(0,M.jsx)(`span`,{className:`text-[9px] text-slate-500 truncate`,children:JSON.stringify(e.args).slice(0,50)})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.execution_time_ms!==void 0&&(0,M.jsxs)(`span`,{className:`text-[9px] text-slate-400 flex items-center gap-0.5 font-mono`,children:[(0,M.jsx)(w,{className:`w-2.5 h-2.5`}),e.execution_time_ms,`ms`]}),(0,M.jsx)(`span`,{className:`px-1.5 py-0.2 text-[9px] font-bold rounded ${e.success?`bg-emerald-100 text-emerald-800`:`bg-rose-100 text-rose-800`}`,children:e.success?`SUCCESS`:`ERR`})]})]},t))}):(0,M.jsx)(`p`,{className:`text-[11px] text-slate-400 italic m-0`,children:`No autonomous enchantments executed yet in this session.`})]})]})]}),(0,M.jsx)(`div`,{className:`bg-white border-t border-slate-200 px-4 py-2 flex items-center justify-end shrink-0`,children:(0,M.jsx)(`button`,{type:`button`,onClick:d,className:`px-4 py-1.5 bg-white hover:bg-slate-100 border-[1.5px] border-ink-black rounded font-bold text-xs text-ink-black cursor-pointer shadow-xs active:translate-y-0.5`,children:`Close`})})]})})}var z=n({default:()=>B});function B(){let e=f(),[t,n]=(0,k.useState)(h()),[r,i]=(0,k.useState)(!1),[a,c]=(0,k.useState)(!1),[l,p]=(0,k.useState)(!1);(0,k.useEffect)(()=>{b.syncWithBackend(),b.triggerProactiveGreeting()},[]);let m=()=>{let e=!t;n(e),x(e)},g=()=>{window.confirm(`Clear conversation transcript with Princess Aurelia?`)&&b.clearTranscript()},v=(0,k.useCallback)(e=>{b.setIsTyping(e)},[]),y=(0,k.useMemo)(()=>[...e.transcript].reverse().find(e=>e.sender===`princess`)||e.transcript[0],[e.transcript]);return(0,M.jsxs)(`div`,{className:`relative w-full h-full bg-gradient-to-b from-[#FFFDF0] via-[#FFF9E6] to-[#FFF3CD] flex flex-col select-none font-sans text-ink-black overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`h-12 bg-white/95 backdrop-blur-sm border-b-[3px] border-ink-black px-3 sm:px-4 flex items-center justify-between gap-2 shrink-0 shadow-sm z-20`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,M.jsx)(_,{className:`w-4 h-4 text-amber-500 shrink-0`}),(0,M.jsx)(`h3`,{className:`font-headline-md font-bold text-xs sm:text-sm text-ink-black m-0 truncate`,children:e.companionSettings.name||`Princess Aurelia`})]}),(0,M.jsx)(`span`,{className:`hidden sm:inline-flex px-2 py-0.5 rounded-full bg-amber-100 border border-amber-300 text-[10px] font-bold text-amber-900 shadow-inner shrink-0`,children:e.bondTier}),(0,M.jsx)(`span`,{className:`hidden md:inline-flex px-2 py-0.5 rounded-full bg-indigo-50 border border-indigo-200 text-[10px] font-bold text-indigo-800 shrink-0`,children:e.currentRhythm.toUpperCase()})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 sm:gap-2 shrink-0`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`px-2.5 py-1 bg-amber-100 hover:bg-amber-200 border-[2px] border-ink-black rounded font-bold text-[11px] text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1.5`,title:`View Spire Journey Progress`,children:[(0,M.jsx)(C,{className:`w-3.5 h-3.5 text-indigo-700`}),(0,M.jsxs)(`span`,{className:`font-arcade text-[9px] text-indigo-950`,children:[e.currentFloor,`/150 LC`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>c(!0),className:`px-2.5 py-1 bg-white hover:bg-amber-50 border-[2px] border-ink-black rounded font-bold text-[11px] text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all flex items-center gap-1.5`,title:`Open Royal Satchel (Missives & Diary)`,children:[(0,M.jsx)(E,{className:`w-3.5 h-3.5 text-amber-700`}),(0,M.jsx)(`span`,{className:`hidden md:inline`,children:`Satchel`}),e.unlockedLetters.length>0&&(0,M.jsx)(`span`,{className:`w-4 h-4 rounded-full bg-amber-400 text-ink-black text-[9px] font-extrabold flex items-center justify-center border border-ink-black`,children:e.unlockedLetters.length})]}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>p(!0),className:`p-1.5 bg-white hover:bg-slate-100 border-[2px] border-ink-black rounded text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all`,title:`View Transcript History`,children:(0,M.jsx)(T,{className:`w-3.5 h-3.5 text-slate-700`})}),(0,M.jsx)(`button`,{type:`button`,onClick:m,className:`p-1.5 border-[2px] border-ink-black rounded text-ink-black cursor-pointer shadow-[1.5px_1.5px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all ${t?`bg-slate-200 opacity-80`:`bg-[#FFE24C] hover:bg-yellow-300`}`,title:t?`Unmute Audio`:`Mute Audio`,children:t?(0,M.jsx)(o,{className:`w-3.5 h-3.5`}):(0,M.jsx)(u,{className:`w-3.5 h-3.5`})})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-start gap-3 sm:gap-4 p-3 sm:p-5 overflow-y-auto custom-scrollbar min-h-0 relative`,children:[(0,M.jsx)(N,{emotion:e.activeEmotion,floor:e.currentFloor,rhythm:e.currentRhythm,activity:e.currentActivity,isLoading:e.isLoading}),(0,M.jsx)(P,{text:y?.text||`I believe in you, champion!`,characterName:e.companionSettings.name,emotion:e.activeEmotion,isLoading:e.isLoading,isStreaming:y?.isStreaming,toolCalls:y?.toolCalls,onTypingStatusChange:v})]}),(0,M.jsx)(I,{suggestions:y?.choiceSuggestions,isLoading:e.isLoading,onSendMessage:e=>b.sendMessage(e),placeholder:`Speak with ${e.companionSettings.name||`Princess Aurelia`}...`}),r&&(0,M.jsx)(L,{currentFloor:e.currentFloor,totalSolved:e.totalSolved,onClose:()=>i(!1)}),a&&(0,M.jsx)(R,{unlockedLetters:e.unlockedLetters,spireChronicles:e.spireChronicles,currentFloor:e.currentFloor,heroCodex:e.heroCodex,episodicEvents:e.episodicEvents,recentToolTelemetry:e.recentToolTelemetry,onRemoveCodexItem:b.removeCodexItem,onClose:()=>c(!1)}),l&&(0,M.jsx)(`div`,{className:`absolute inset-0 z-50 bg-ink-black/40 backdrop-blur-xs flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200`,onClick:()=>p(!1),children:(0,M.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black rounded-xl max-w-lg w-full h-[80%] max-h-[520px] shadow-[6px_6px_0px_0px_#1E293B] flex flex-col overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,M.jsxs)(`div`,{className:`bg-white border-b-[2px] border-ink-black px-4 py-2.5 flex items-center justify-between shrink-0`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(T,{className:`w-4 h-4 text-ink-black`}),(0,M.jsxs)(`h4`,{className:`font-headline-md font-bold text-xs sm:text-sm text-ink-black m-0`,children:[`Dialogue Transcript (`,e.transcript.length,` turns)`]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:g,className:`p-1 hover:bg-rose-100 text-rose-700 rounded text-[11px] font-bold flex items-center gap-1 cursor-pointer mr-1`,title:`Clear Chat History`,children:[(0,M.jsx)(d,{className:`w-3.5 h-3.5`}),(0,M.jsx)(`span`,{children:`Clear`})]}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>p(!1),className:`p-1 hover:bg-slate-200 rounded text-slate-700 cursor-pointer`,title:`Close`,children:(0,M.jsx)(s,{className:`w-4 h-4`})})]})]}),(0,M.jsx)(`div`,{className:`flex-1 p-3 sm:p-4 overflow-y-auto custom-scrollbar flex flex-col gap-2.5`,children:e.transcript.map((t,n)=>(0,M.jsxs)(`div`,{className:`p-2.5 rounded-lg border-[2px] border-ink-black shadow-[2px_2px_0px_0px_#1E293B] max-w-[90%] ${t.sender===`princess`?`bg-white text-ink-black self-start`:`bg-[#FFE24C] text-ink-black self-end`}`,children:[(0,M.jsx)(`div`,{className:`text-[10px] font-bold font-headline-md mb-1 text-slate-600`,children:t.sender===`princess`?e.companionSettings.name:`Hero`}),(0,M.jsx)(`p`,{className:`text-xs font-medium m-0 leading-relaxed whitespace-pre-wrap select-text`,children:t.text})]},t.id||n))})]})})]})}export{z as t};
algospaced-ui/dist/assets/PythonChallenge-BP6ASjZJ.js ADDED
@@ -0,0 +1 @@
 
 
1
+ import{a as e,c as t,i as n,t as r}from"./jsx-runtime-j9uSgrFF.js";import{t as i}from"./MarkdownRenderer-DcpmP1uN.js";var a=t(e(),1),o=r();function s(){let[e,t]=(0,a.useState)(null),[r,s]=(0,a.useState)(``),[c,l]=(0,a.useState)(!1),[u,d]=(0,a.useState)([]),[f,p]=(0,a.useState)(``),[m,h]=(0,a.useState)(!0),[g,_]=(0,a.useState)(0),v=async()=>{h(!0),p(``);try{let{data:{session:e}}=await n.auth.getSession();if(!e){p(`Unauthenticated session`);return}let r=await fetch(`/api/challenges/python/daily`,{headers:{Authorization:`Bearer ${e.access_token}`}});if(r.ok){let e=await r.json();t(e),s(e.starter_code),_(e.total_score)}else p(`Failed to load challenge from server.`)}catch{p(`Connection timed out.`)}finally{h(!1)}};return(0,a.useEffect)(()=>{v()},[]),m?(0,o.jsxs)(`div`,{className:`w-full h-full bg-paper-white p-6 flex flex-col items-center justify-center font-arcade text-[10px]`,children:[(0,o.jsx)(`div`,{className:`animate-bounce mb-2`,children:`LOADING CHALLENGE...`}),(0,o.jsx)(`div`,{className:`w-48 h-4 bg-white border-[3px] border-ink-black overflow-hidden relative`,children:(0,o.jsx)(`div`,{className:`absolute inset-y-0 left-0 bg-[#9d4edd] w-2/3 animate-pulse border-r-2 border-ink-black`})})]}):e?(0,o.jsx)(`div`,{className:`w-full h-full bg-paper-white text-ink-black flex flex-col overflow-hidden text-xs md:text-sm`,children:(0,o.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4 custom-scrollbar flex flex-col gap-4`,children:[(0,o.jsxs)(`div`,{className:`flex justify-between items-center bg-slate-100 border-[3px] border-ink-black p-3`,children:[(0,o.jsxs)(`div`,{className:`flex gap-2`,children:[(0,o.jsx)(`span`,{className:`px-2 py-0.5 border-2 border-ink-black font-bold uppercase text-[9px] ${e.difficulty===`Easy`?`bg-green-200 text-green-800`:e.difficulty===`Medium`?`bg-yellow-200 text-yellow-800`:`bg-red-200 text-red-800`}`,children:e.difficulty}),(0,o.jsxs)(`span`,{className:`bg-blue-100 text-blue-800 px-2 py-0.5 border-2 border-ink-black font-bold text-[9px]`,children:[`+`,e.points,` PTS`]}),e.completed?(0,o.jsx)(`span`,{className:`bg-emerald-500 text-white px-2 py-0.5 border-2 border-ink-black font-bold text-[9px]`,children:`COMPLETED`}):(0,o.jsx)(`span`,{className:`bg-rose-500 text-white px-2 py-0.5 border-2 border-ink-black font-bold text-[9px]`,children:`INCOMPLETE`})]}),(0,o.jsxs)(`div`,{className:`font-arcade text-[8px] text-purple-700 font-bold bg-white border-2 border-ink-black px-2 py-0.5 shadow-[1px_1px_0_0_#1E293B]`,children:[`TOTAL SCORE: `,g]})]}),(0,o.jsxs)(`div`,{className:`border-2 border-ink-black bg-slate-50 p-3 rounded font-sans leading-relaxed text-xs`,children:[(0,o.jsxs)(`h3`,{className:`font-bold border-b border-slate-300 pb-1 mb-2 uppercase tracking-wide text-primary-purple flex items-center gap-1`,children:[(0,o.jsx)(`span`,{className:`material-symbols-outlined text-sm`,children:`description`}),`Problem: `,e.title]}),(0,o.jsx)(i,{content:e.description})]}),(0,o.jsxs)(`div`,{className:`flex flex-col flex-1 min-h-[220px]`,children:[(0,o.jsxs)(`div`,{className:`flex justify-between items-center mb-1`,children:[(0,o.jsxs)(`span`,{className:`font-bold text-[10px] tracking-wide uppercase flex items-center gap-1`,children:[(0,o.jsx)(`span`,{className:`material-symbols-outlined text-sm text-purple-600`,children:`code`}),`Write Python Solution:`]}),(0,o.jsx)(`button`,{onClick:()=>s(e.starter_code),className:`text-[9px] underline text-blue-600 hover:text-blue-800 cursor-pointer font-sans`,children:`Reset Starter Code`})]}),(0,o.jsx)(`textarea`,{value:r,onChange:e=>s(e.target.value),className:`flex-1 w-full bg-slate-900 text-[#4ADE80] font-mono p-3 border-[3px] border-ink-black rounded outline-none focus:ring-2 focus:ring-primary-purple text-xs leading-relaxed resize-none`,placeholder:`# Write your python code here`,spellCheck:`false`})]}),(0,o.jsx)(`div`,{className:`shrink-0`,children:(0,o.jsx)(`button`,{disabled:c,onClick:async()=>{l(!0),p(``),d([]);try{let{data:{session:e}}=await n.auth.getSession();if(!e){p(`Unauthenticated session`);return}let i=await fetch(`/api/challenges/python/submit`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${e.access_token}`},body:JSON.stringify({code:r})});if(i.ok){let e=await i.json();e.success?(d(e.results),e.all_passed&&(_(e.total_score),t(e=>e?{...e,completed:!0}:null))):p(e.error)}else p(`Submission failed at server host.`)}catch{p(`Network connection lost.`)}finally{l(!1)}},className:`w-full bg-highlight-pink text-white font-window-title font-bold py-2 px-4 border-[3px] border-ink-black shadow-[3px_3px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none hover:bg-pink-400 transition-all disabled:opacity-50 cursor-pointer text-center text-xs`,children:c?`EXECUTING TEST CASES...`:`RUN SOLUTION SUBMISSION`})}),f&&(0,o.jsxs)(`div`,{className:`border-[3px] border-red-500 bg-red-50 text-red-800 p-3 font-mono text-xs whitespace-pre-wrap`,children:[(0,o.jsx)(`div`,{className:`font-bold mb-1`,children:`COMPILER / RUNTIME ERROR:`}),f]}),u.length>0&&(0,o.jsxs)(`div`,{className:`border-[3px] border-ink-black bg-slate-100 p-3`,children:[(0,o.jsx)(`div`,{className:`font-bold text-[10px] border-b border-slate-300 pb-1 mb-2 uppercase`,children:`Test Case Executions:`}),(0,o.jsx)(`div`,{className:`space-y-1.5 font-mono text-xs`,children:u.map((e,t)=>(0,o.jsxs)(`div`,{className:`flex flex-col p-2 border border-slate-300 bg-white`,children:[(0,o.jsxs)(`div`,{className:`flex justify-between`,children:[(0,o.jsxs)(`span`,{className:`font-bold`,children:[`Test Case `,t+1,`:`]}),(0,o.jsx)(`span`,{className:`font-bold uppercase ${e.status===`passed`?`text-green-600`:`text-red-600`}`,children:e.status})]}),(0,o.jsxs)(`div`,{className:`text-[10px] text-slate-500 mt-1`,children:[(0,o.jsxs)(`div`,{children:[`Input: `,JSON.stringify(e.input)]}),e.status===`passed`&&(0,o.jsxs)(`div`,{children:[`Output: `,JSON.stringify(e.got)]}),e.status===`failed`&&(0,o.jsxs)(`div`,{className:`text-red-700`,children:[`Expected: `,JSON.stringify(e.expected),` | Got: `,JSON.stringify(e.got)]}),e.status===`error`&&(0,o.jsxs)(`div`,{className:`text-red-700 font-semibold`,children:[`Error: `,e.error]})]})]},t))})]})]})}):(0,o.jsxs)(`div`,{className:`w-full h-full bg-paper-white p-6 flex flex-col items-center justify-center font-sans text-center gap-3`,children:[(0,o.jsx)(`span`,{className:`material-symbols-outlined text-red-500 text-4xl`,children:`error`}),(0,o.jsx)(`div`,{className:`font-bold text-ink-black text-sm`,children:f||`No active challenge found.`}),(0,o.jsx)(`button`,{onClick:v,className:`px-3 py-1.5 bg-yellow-400 hover:bg-yellow-300 border-[3px] border-ink-black text-xs font-bold font-window-title cursor-pointer shadow-[2px_2px_0px_rgba(0,0,0,1)] active:translate-y-0.5 active:shadow-none`,children:`RETRY`})]})}export{s as default};
algospaced-ui/dist/assets/{ReviewQueue-CYwGYMOV.js → ReviewQueue-WbUnUC1g.js} RENAMED
The diff for this file is too large to render. See raw diff
 
algospaced-ui/dist/assets/{Settings-C3gzd0DF.js → Settings-5f8XTRov.js} RENAMED
@@ -1 +1 @@
1
- import{a as e,c as t,t as n}from"./jsx-runtime-j9uSgrFF.js";import{t as r}from"./circle-alert-BL6bvZTM.js";import{t as i}from"./external-link-BGZfX5Bi.js";import{a,d as ee,f as o,i as s,n as c,r as l,s as u,t as d,u as f}from"./githubSyncService-CsqBgIfT.js";import{t as p}from"./info-CAmdZoA6.js";import{t as m}from"./save-BgzMM0iu.js";import{F as h,G as g,M as _,P as v,R as y,T as b,f as x,g as S,h as C,j as te,k as ne,m as w,p as T,y as E,z as D}from"./index-V2pPJO9M.js";var O=g(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),k=g(`key`,[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]),A=t(e(),1),j=n(),M=[{id:`default`,name:`Default`,desc:`Subject to Availability`},{id:`groq`,name:`Groq`,badge:`Fastest`,desc:`Llama 3.3 & Qwen`,keyPrefix:`gsk_...`,portalUrl:`https://console.groq.com/keys`},{id:`gemini`,name:`Google Gemini`,desc:`Gemini 2.5 / 3.5`,keyPrefix:`AIzaSy...`,portalUrl:`https://aistudio.google.com/app/apikey`},{id:`openrouter`,name:`OpenRouter`,desc:`Multi-Provider`,keyPrefix:`sk-or-v1-...`,portalUrl:`https://openrouter.ai/keys`}];function N(){let[e,t]=(0,A.useState)(()=>localStorage.getItem(`algospaced_custom_ai_provider`)||`default`),[n,g]=(0,A.useState)(()=>localStorage.getItem(`algospaced_custom_api_key`)||localStorage.getItem(`sandbox_gemini_api_key`)||``),[N,re]=(0,A.useState)(!1),[P,F]=(0,A.useState)(null),[I,L]=(0,A.useState)(()=>x()),[R,z]=(0,A.useState)(null),[B,V]=(0,A.useState)(()=>T().currentFloor),[H,U]=(0,A.useState)(()=>l()),[W,G]=(0,A.useState)(()=>s()),[K,q]=(0,A.useState)(!1),[J,Y]=(0,A.useState)(null),X=!!(H.token&&(H.username||W?.login)),Z=!!(n.trim()&&e!=="default"),Q=e!=="default"&&!n.trim(),$=M.find(t=>t.id===e),ie=e=>{t(e),localStorage.setItem(`algospaced_custom_ai_provider`,e),F(e==="default"?{type:`info`,text:`Switched to Server Default (Shared Pool).`}:{type:`info`,text:`Switched to ${e.toUpperCase()}.`}),setTimeout(()=>F(null),3e3)},ae=()=>{let t=n.trim();if(!t){F({type:`error`,text:`Please enter an API key for ${e.toUpperCase()}.`}),setTimeout(()=>F(null),3e3);return}localStorage.setItem(`algospaced_custom_api_key`,t),localStorage.setItem(`sandbox_gemini_api_key`,t),localStorage.setItem(`algospaced_custom_ai_provider`,e),F({type:`success`,text:`${e.toUpperCase()} API key saved successfully.`}),setTimeout(()=>F(null),3e3)},oe=()=>{localStorage.removeItem(`algospaced_custom_api_key`),localStorage.removeItem(`sandbox_gemini_api_key`),g(``),F({type:`info`,text:`Cleared custom API key.`}),setTimeout(()=>F(null),3e3)},se=()=>{localStorage.removeItem(`algospaced_custom_api_key`),localStorage.removeItem(`sandbox_gemini_api_key`),localStorage.setItem(`algospaced_custom_ai_provider`,`default`),g(``),t(`default`),F({type:`info`,text:`Reset to Server Default provider.`}),setTimeout(()=>F(null),3e3)},ce=()=>{C(I),z({type:`success`,text:`Princess Companion settings saved!`}),setTimeout(()=>z(null),3e3)},le=()=>{L(S),C(S),z({type:`info`,text:`Reset companion to default settings.`}),setTimeout(()=>z(null),3e3)},ue=()=>{if(window.confirm(`Are you sure you want to reset your Spire Journey progress back to 0 problems?`)){let e=w();V(e.currentFloor),z({type:`info`,text:`Spire journey progress reset to 0 problems.`}),setTimeout(()=>z(null),3e3)}},de=async()=>{q(!0),Y(null);try{let{token:e,user:t}=await c();G(t);let n=l();U(n);try{await a(e,n.repoName,n.isPrivate)}catch{}Y({type:`success`,text:`Connected to GitHub as @${t.login}!`}),setTimeout(()=>Y(null),4e3)}catch(e){Y({type:`error`,text:e.message||`GitHub connection failed.`}),setTimeout(()=>Y(null),5e3)}finally{q(!1)}},fe=()=>{d(),U(l()),G(null),Y({type:`info`,text:`Disconnected from GitHub.`}),setTimeout(()=>Y(null),3e3)},pe=e=>{u({autoCommit:e}),U(t=>({...t,autoCommit:e})),Y({type:`info`,text:e?`Auto-commit enabled for review submissions.`:`Auto-commit disabled.`}),setTimeout(()=>Y(null),3e3)};return(0,j.jsxs)(`div`,{className:`w-full h-full bg-[#fdf8e1] p-5 sm:p-6 flex flex-col gap-4 select-none font-sans text-ink-black overflow-y-auto custom-scrollbar`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-0.5 border-b-[3px] border-ink-black pb-2.5`,children:[(0,j.jsxs)(`h3`,{className:`font-headline-md font-bold text-sm m-0 flex items-center gap-2 tracking-wide`,children:[(0,j.jsx)(k,{className:`w-4 h-4 text-ink-black`}),`API & AI Configuration`]}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray font-medium m-0`,children:`Configure your AI model provider..`})]}),(0,j.jsx)(`div`,{className:`px-4 py-3 border-[3px] border-ink-black shadow-[3px_3px_0px_0px_rgba(30,41,59,1)] transition-all ${Z?`bg-emerald-50`:Q?`bg-rose-50`:`bg-amber-50/70`}`,children:(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[Z?(0,j.jsx)(b,{className:`w-4 h-4 text-emerald-600 shrink-0`}):Q?(0,j.jsx)(r,{className:`w-4 h-4 text-rose-600 shrink-0`}):(0,j.jsx)(O,{className:`w-4 h-4 text-amber-600 shrink-0`}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-xs font-bold font-headline-md text-ink-black flex items-center gap-1.5`,children:(0,j.jsxs)(`span`,{children:[`Active:`,` `,Z?`${e.toUpperCase()} (Custom Key)`:Q?`${e.toUpperCase()} (Key Required)`:`Default`]})}),(0,j.jsx)(`div`,{className:`text-[10px] text-trash-gray font-medium`,children:Z?`Requests are routed directly through your personal API key.`:Q?`Enter your API key below to activate this provider.`:`Using basic, free built-in developer keys with auto-failover.`})]})]}),(0,j.jsx)(`span`,{className:`px-2 py-0.5 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black shrink-0 ${Z?`bg-emerald-300 text-emerald-950`:Q?`bg-rose-300 text-rose-950`:`bg-amber-200 text-amber-950`}`,children:Z?`ACTIVE`:Q?`NEEDS KEY`:`LIMITED`})]})}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider mb-2 font-headline-md flex items-center gap-1.5`,children:[(0,j.jsx)(O,{className:`w-3.5 h-3.5 text-ink-black`}),`Select Provider`]}),(0,j.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:M.map(t=>{let n=e===t.id;return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>ie(t.id),className:`p-2.5 border-[2px] text-left transition-all cursor-pointer flex flex-col justify-between rounded ${n?`border-ink-black bg-[#ffe24c] shadow-[2px_2px_0px_0px_#1E293B] font-bold`:`border-slate-300 bg-slate-50 hover:bg-slate-100 text-slate-700`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,j.jsx)(`span`,{className:`text-xs font-bold font-headline-md`,children:t.name}),t.badge&&(0,j.jsx)(`span`,{className:`text-[8px] font-bold uppercase px-1 py-0.2 bg-orange-100 text-orange-700 rounded border border-orange-300`,children:t.badge})]}),(0,j.jsx)(`span`,{className:`text-[9px] mt-1 text-slate-600 leading-tight block`,children:t.desc})]},t.id)})})]}),e==="default"?(0,j.jsxs)(`div`,{className:`p-3.5 bg-slate-50 border border-slate-200 rounded flex items-start gap-3`,children:[(0,j.jsx)(ne,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs text-slate-700`,children:[(0,j.jsxs)(`span`,{className:`font-bold text-ink-black`,children:[`Shared Quotas (`,(0,j.jsx)(`i`,{children:`limited`}),`)`]}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray m-0 leading-relaxed`,children:`Powered by shared, basic developer keys. Because limits are shared with everyone, requests may fail. Use your own provider keys above for stable performance.`})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md flex items-center gap-1.5`,children:[(0,j.jsx)(k,{className:`w-3.5 h-3.5 text-ink-black`}),$?.name,` API Key`]}),$?.portalUrl&&(0,j.jsxs)(`a`,{href:$.portalUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-sky-600 hover:text-sky-800 font-medium flex items-center gap-1 no-underline`,children:[(0,j.jsx)(`span`,{children:`Get API Key`}),(0,j.jsx)(i,{className:`w-3 h-3`})]})]}),(0,j.jsxs)(`div`,{className:`relative`,children:[(0,j.jsx)(`input`,{type:N?`text`:`password`,value:n,onChange:e=>g(e.target.value),placeholder:`Enter ${$?.keyPrefix||`API Key`}`,className:`w-full bg-white border-[2px] border-ink-black rounded py-2 pl-3 pr-9 text-ink-black placeholder-slate-400 focus:outline-none focus:border-sky-600 text-xs font-code-mono`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>re(!N),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-trash-gray hover:text-ink-black cursor-pointer bg-transparent border-0 outline-none p-1`,title:N?`Hide API key`:`Show API key`,children:N?(0,j.jsx)(o,{className:`w-3.5 h-3.5`}):(0,j.jsx)(ee,{className:`w-3.5 h-3.5`})})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-trash-gray font-medium`,children:[(0,j.jsx)(_,{className:`w-3.5 h-3.5 text-emerald-600 shrink-0`}),(0,j.jsx)(`span`,{children:`Stored locally in your browser. Sent directly via request headers.`})]}),(0,j.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,j.jsxs)(`button`,{onClick:ae,className:`flex-1 flex items-center justify-center gap-1.5 py-2 border-[2px] border-ink-black bg-[#ffe24c] hover:bg-yellow-300 text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:[(0,j.jsx)(m,{className:`w-3.5 h-3.5`}),`Save Key`]}),n&&(0,j.jsx)(`button`,{onClick:oe,className:`px-3 py-2 border-[2px] border-slate-300 bg-white hover:bg-slate-50 text-xs font-bold text-slate-700 hover:text-rose-600 shadow-[2px_2px_0px_0px_rgba(0,0,0,0.05)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:`Clear Key`})]})]}),P&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${P.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:P.type===`error`?`bg-rose-100 border-rose-600 text-rose-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[P.type===`success`?(0,j.jsx)(D,{className:`w-3.5 h-3.5 shrink-0`}):P.type===`error`?(0,j.jsx)(r,{className:`w-3.5 h-3.5 shrink-0`}):(0,j.jsx)(p,{className:`w-3.5 h-3.5 shrink-0`}),P.text]}),e!=="default"&&(0,j.jsx)(`div`,{className:`pt-2 border-t border-slate-200 flex justify-end`,children:(0,j.jsxs)(`button`,{onClick:se,className:`flex items-center gap-1.5 py-1.5 px-3 border border-slate-300 bg-slate-50 hover:bg-slate-100 text-[11px] font-bold text-slate-600 hover:text-ink-black transition-all cursor-pointer rounded`,children:[(0,j.jsx)(v,{className:`w-3 h-3 text-slate-500`}),`Reset to Server Default`]})})]}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(`div`,{className:`w-8 h-8 rounded bg-[#24292e] border-[2px] border-ink-black flex items-center justify-center text-white shadow-[1px_1px_0px_0px_#1E293B]`,children:(0,j.jsx)(f,{className:`w-4 h-4 text-white`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black m-0 flex items-center gap-2`,children:`GitHub Solutions Sync & Auto-Commit`}),(0,j.jsx)(`p`,{className:`text-[10px] text-trash-gray font-medium m-0`,children:`Sync solutions to personal GitHub repository and commit automatically on submission`})]})]}),(0,j.jsx)(`span`,{className:`px-2 py-0.5 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black shrink-0 ${X?`bg-emerald-300 text-emerald-950`:`bg-slate-200 text-slate-800`}`,children:X?`CONNECTED`:`DISCONNECTED`})]}),X?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-2 p-3 bg-slate-50 border border-slate-200 rounded`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[W?.avatar_url&&(0,j.jsx)(`img`,{src:W.avatar_url,alt:W.login,className:`w-7 h-7 rounded-full border border-ink-black`}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`span`,{className:`text-xs font-bold text-ink-black`,children:[`@`,W?.login||H.username]}),(0,j.jsxs)(`span`,{className:`text-[11px] text-slate-600 font-mono block`,children:[H.username,`/`,H.repoName,` (`,H.branch,`)`]})]})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`a`,{href:`https://github.com/${H.username}/${H.repoName}`,target:`_blank`,rel:`noopener noreferrer`,className:`px-2.5 py-1 text-[11px] font-bold bg-white hover:bg-slate-100 text-ink-black border border-slate-300 rounded no-underline flex items-center gap-1 cursor-pointer`,children:[(0,j.jsx)(i,{className:`w-3 h-3`}),(0,j.jsx)(`span`,{children:`View Repo`})]}),(0,j.jsx)(`button`,{type:`button`,onClick:fe,className:`px-2.5 py-1 text-[11px] font-bold bg-white hover:bg-rose-50 text-rose-700 border border-rose-300 rounded cursor-pointer`,children:`Disconnect`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-emerald-50/50 border border-emerald-300 rounded cursor-pointer`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:H.autoCommit,onChange:e=>pe(e.target.checked),className:`w-4 h-4 accent-emerald-600 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`Auto-commit on every submission`}),(0,j.jsxs)(`span`,{className:`text-[10px] text-trash-gray`,children:[`Automatically pushes your code to `,H.repoName,` whenever you grade a review card.`]})]})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 p-3.5 bg-slate-50 border border-slate-200 rounded`,children:[(0,j.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,j.jsx)(`span`,{className:`text-xs font-bold text-ink-black block`,children:`Connect your GitHub Account (1-Click OAuth)`}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray m-0`,children:`Grant repository access to automatically sync your DSA problem solutions as you study.`})]}),(0,j.jsx)(`button`,{type:`button`,onClick:de,disabled:K,className:`px-4 py-2 bg-[#24292e] hover:bg-black text-white text-xs font-bold uppercase rounded border-2 border-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none flex items-center gap-2 shrink-0 cursor-pointer disabled:opacity-50`,children:K?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(h,{className:`w-3.5 h-3.5 animate-spin`}),(0,j.jsx)(`span`,{children:`CONNECTING...`})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(f,{className:`w-3.5 h-3.5 text-yellow-300`}),(0,j.jsx)(`span`,{children:`CONNECT GITHUB`})]})})]}),J&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${J.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:J.type===`error`?`bg-rose-100 border-rose-600 text-rose-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[J.type===`success`?(0,j.jsx)(D,{className:`w-3.5 h-3.5 shrink-0`}):J.type===`error`?(0,j.jsx)(r,{className:`w-3.5 h-3.5 shrink-0`}):(0,j.jsx)(p,{className:`w-3.5 h-3.5 shrink-0`}),J.text]})]}),(0,j.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`div`,{className:`w-7 h-7 rounded bg-[#FFE24C] border-[2px] border-ink-black flex items-center justify-center shadow-[1px_1px_0px_0px_#1E293B]`,children:(0,j.jsx)(te,{className:`w-4 h-4 text-ink-black`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black m-0`,children:`Princess AI Companion & RPG Settings`}),(0,j.jsx)(`p`,{className:`text-[10px] text-trash-gray font-medium m-0`,children:`Trapped Princess Persona, Study Break Timer & 8-bit RPG Audio`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-bold text-ink-black font-headline-md uppercase`,children:I.enabled?`Enabled`:`Disabled`}),(0,j.jsx)(`input`,{type:`checkbox`,checked:I.enabled,onChange:e=>L(t=>({...t,enabled:e.target.checked})),className:`w-4 h-4 accent-amber-500 cursor-pointer`})]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md`,children:`Companion Name`}),(0,j.jsx)(`input`,{type:`text`,value:I.name,onChange:e=>L(t=>({...t,name:e.target.value})),placeholder:`e.g. Princess Aurelia`,className:`bg-white border-[2px] border-ink-black rounded py-2 px-3 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md flex items-center gap-1`,children:[(0,j.jsx)(y,{className:`w-3.5 h-3.5 text-amber-700`}),`Study Break Reminder`]}),(0,j.jsxs)(`select`,{value:I.breakIntervalMinutes,onChange:e=>L(t=>({...t,breakIntervalMinutes:Number(e.target.value)})),className:`bg-white border-[2px] border-ink-black rounded py-2 px-3 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600 cursor-pointer`,children:[(0,j.jsx)(`option`,{value:25,children:`Every 25 Minutes (Classic Pomodoro)`}),(0,j.jsx)(`option`,{value:45,children:`Every 45 Minutes`}),(0,j.jsx)(`option`,{value:60,children:`Every 60 Minutes`}),(0,j.jsx)(`option`,{value:0,children:`Disabled (No automatic break popups)`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md`,children:`Princess Backstory & Persona Prompt`}),(0,j.jsx)(`textarea`,{rows:2,value:I.backstory,onChange:e=>L(t=>({...t,backstory:e.target.value})),placeholder:`Describe her background, tone, and connection to your DSA studies...`,className:`bg-white border-[2px] border-ink-black rounded p-2.5 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600 resize-y`})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1`,children:[(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-white border border-slate-300 rounded cursor-pointer hover:border-ink-black transition-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:I.soundEnabled,onChange:e=>{let t=e.target.checked;L(e=>({...e,soundEnabled:t})),E(!t)},className:`w-4 h-4 accent-amber-500 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`8-bit Sound Effects`}),(0,j.jsx)(`span`,{className:`text-[10px] text-trash-gray`,children:`Typewriter blips, chimes & fanfare`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-white border border-slate-300 rounded cursor-pointer hover:border-ink-black transition-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:I.autoPopupEnabled,onChange:e=>L(t=>({...t,autoPopupEnabled:e.target.checked})),className:`w-4 h-4 accent-amber-500 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`Spontaneous RPG Popups`}),(0,j.jsx)(`span`,{className:`text-[10px] text-trash-gray`,children:`Speech bubbles for breaks & milestones`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 pt-2 border-t border-slate-200`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:ce,className:`flex items-center gap-1.5 py-2 px-4 border-[2px] border-ink-black bg-[#ffe24c] hover:bg-yellow-300 text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:[(0,j.jsx)(m,{className:`w-3.5 h-3.5`}),`Save Companion Settings`]}),(0,j.jsx)(`button`,{type:`button`,onClick:le,className:`py-2 px-3 border border-slate-300 bg-white hover:bg-slate-50 text-xs font-bold text-slate-700 transition-all cursor-pointer rounded`,children:`Default Persona`})]}),(0,j.jsxs)(`button`,{type:`button`,onClick:ue,className:`flex items-center gap-1 py-1.5 px-3 border border-rose-300 bg-rose-50 hover:bg-rose-100 text-rose-700 text-[11px] font-bold transition-all cursor-pointer rounded`,children:[(0,j.jsx)(v,{className:`w-3 h-3 text-rose-500`}),(0,j.jsxs)(`span`,{children:[`Reset Journey (`,B,`/150 LC)`]})]})]}),R&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${R.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[(0,j.jsx)(D,{className:`w-3.5 h-3.5 shrink-0`}),R.text]})]}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-2.5`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,j.jsx)(p,{className:`w-3.5 h-3.5 text-[#0ea5e9]`}),(0,j.jsx)(`h4`,{className:`text-xs font-bold uppercase font-headline-md m-0`,children:`Get Free API Keys`})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-2 text-[10px]`,children:[(0,j.jsxs)(`a`,{href:`https://console.groq.com/keys`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`Groq Cloud`}),(0,j.jsx)(i,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Fast inference with generous free rate limits.`})]}),(0,j.jsxs)(`a`,{href:`https://aistudio.google.com/app/apikey`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`Google AI Studio`}),(0,j.jsx)(i,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Free Gemini Flash API quota.`})]}),(0,j.jsxs)(`a`,{href:`https://openrouter.ai/keys`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`OpenRouter`}),(0,j.jsx)(i,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Unified API for open-weights models.`})]})]})]})]})}export{N as default};
 
1
+ import{a as e,c as t,t as n}from"./jsx-runtime-j9uSgrFF.js";import{t as r}from"./circle-alert-B3TumjQg.js";import{t as i}from"./external-link-64ub39jt.js";import{a,d as ee,f as o,i as s,n as c,r as l,s as u,t as d,u as f}from"./githubSyncService-B4h5nigj.js";import{t as p}from"./info-jE4ZFn-x.js";import{t as m}from"./save-zS5LwKaW.js";import{F as h,G as g,M as _,P as v,R as y,T as b,f as x,g as S,h as C,j as te,k as ne,m as w,p as T,y as E,z as D}from"./index-M1GCaKIP.js";var O=g(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),k=g(`key`,[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]),A=t(e(),1),j=n(),M=[{id:`default`,name:`Default`,desc:`Subject to Availability`},{id:`groq`,name:`Groq`,badge:`Fastest`,desc:`Llama 3.3 & Qwen`,keyPrefix:`gsk_...`,portalUrl:`https://console.groq.com/keys`},{id:`gemini`,name:`Google Gemini`,desc:`Gemini 2.5 / 3.5`,keyPrefix:`AIzaSy...`,portalUrl:`https://aistudio.google.com/app/apikey`},{id:`openrouter`,name:`OpenRouter`,desc:`Multi-Provider`,keyPrefix:`sk-or-v1-...`,portalUrl:`https://openrouter.ai/keys`}];function N(){let[e,t]=(0,A.useState)(()=>localStorage.getItem(`algospaced_custom_ai_provider`)||`default`),[n,g]=(0,A.useState)(()=>localStorage.getItem(`algospaced_custom_api_key`)||localStorage.getItem(`sandbox_gemini_api_key`)||``),[N,re]=(0,A.useState)(!1),[P,F]=(0,A.useState)(null),[I,L]=(0,A.useState)(()=>x()),[R,z]=(0,A.useState)(null),[B,V]=(0,A.useState)(()=>T().currentFloor),[H,U]=(0,A.useState)(()=>l()),[W,G]=(0,A.useState)(()=>s()),[K,q]=(0,A.useState)(!1),[J,Y]=(0,A.useState)(null),X=!!(H.token&&(H.username||W?.login)),Z=!!(n.trim()&&e!=="default"),Q=e!=="default"&&!n.trim(),$=M.find(t=>t.id===e),ie=e=>{t(e),localStorage.setItem(`algospaced_custom_ai_provider`,e),F(e==="default"?{type:`info`,text:`Switched to Server Default (Shared Pool).`}:{type:`info`,text:`Switched to ${e.toUpperCase()}.`}),setTimeout(()=>F(null),3e3)},ae=()=>{let t=n.trim();if(!t){F({type:`error`,text:`Please enter an API key for ${e.toUpperCase()}.`}),setTimeout(()=>F(null),3e3);return}localStorage.setItem(`algospaced_custom_api_key`,t),localStorage.setItem(`sandbox_gemini_api_key`,t),localStorage.setItem(`algospaced_custom_ai_provider`,e),F({type:`success`,text:`${e.toUpperCase()} API key saved successfully.`}),setTimeout(()=>F(null),3e3)},oe=()=>{localStorage.removeItem(`algospaced_custom_api_key`),localStorage.removeItem(`sandbox_gemini_api_key`),g(``),F({type:`info`,text:`Cleared custom API key.`}),setTimeout(()=>F(null),3e3)},se=()=>{localStorage.removeItem(`algospaced_custom_api_key`),localStorage.removeItem(`sandbox_gemini_api_key`),localStorage.setItem(`algospaced_custom_ai_provider`,`default`),g(``),t(`default`),F({type:`info`,text:`Reset to Server Default provider.`}),setTimeout(()=>F(null),3e3)},ce=()=>{C(I),z({type:`success`,text:`Princess Companion settings saved!`}),setTimeout(()=>z(null),3e3)},le=()=>{L(S),C(S),z({type:`info`,text:`Reset companion to default settings.`}),setTimeout(()=>z(null),3e3)},ue=()=>{if(window.confirm(`Are you sure you want to reset your Spire Journey progress back to 0 problems?`)){let e=w();V(e.currentFloor),z({type:`info`,text:`Spire journey progress reset to 0 problems.`}),setTimeout(()=>z(null),3e3)}},de=async()=>{q(!0),Y(null);try{let{token:e,user:t}=await c();G(t);let n=l();U(n);try{await a(e,n.repoName,n.isPrivate)}catch{}Y({type:`success`,text:`Connected to GitHub as @${t.login}!`}),setTimeout(()=>Y(null),4e3)}catch(e){Y({type:`error`,text:e.message||`GitHub connection failed.`}),setTimeout(()=>Y(null),5e3)}finally{q(!1)}},fe=()=>{d(),U(l()),G(null),Y({type:`info`,text:`Disconnected from GitHub.`}),setTimeout(()=>Y(null),3e3)},pe=e=>{u({autoCommit:e}),U(t=>({...t,autoCommit:e})),Y({type:`info`,text:e?`Auto-commit enabled for review submissions.`:`Auto-commit disabled.`}),setTimeout(()=>Y(null),3e3)};return(0,j.jsxs)(`div`,{className:`w-full h-full bg-[#fdf8e1] p-5 sm:p-6 flex flex-col gap-4 select-none font-sans text-ink-black overflow-y-auto custom-scrollbar`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-0.5 border-b-[3px] border-ink-black pb-2.5`,children:[(0,j.jsxs)(`h3`,{className:`font-headline-md font-bold text-sm m-0 flex items-center gap-2 tracking-wide`,children:[(0,j.jsx)(k,{className:`w-4 h-4 text-ink-black`}),`API & AI Configuration`]}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray font-medium m-0`,children:`Configure your AI model provider..`})]}),(0,j.jsx)(`div`,{className:`px-4 py-3 border-[3px] border-ink-black shadow-[3px_3px_0px_0px_rgba(30,41,59,1)] transition-all ${Z?`bg-emerald-50`:Q?`bg-rose-50`:`bg-amber-50/70`}`,children:(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[Z?(0,j.jsx)(b,{className:`w-4 h-4 text-emerald-600 shrink-0`}):Q?(0,j.jsx)(r,{className:`w-4 h-4 text-rose-600 shrink-0`}):(0,j.jsx)(O,{className:`w-4 h-4 text-amber-600 shrink-0`}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`text-xs font-bold font-headline-md text-ink-black flex items-center gap-1.5`,children:(0,j.jsxs)(`span`,{children:[`Active:`,` `,Z?`${e.toUpperCase()} (Custom Key)`:Q?`${e.toUpperCase()} (Key Required)`:`Default`]})}),(0,j.jsx)(`div`,{className:`text-[10px] text-trash-gray font-medium`,children:Z?`Requests are routed directly through your personal API key.`:Q?`Enter your API key below to activate this provider.`:`Using basic, free built-in developer keys with auto-failover.`})]})]}),(0,j.jsx)(`span`,{className:`px-2 py-0.5 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black shrink-0 ${Z?`bg-emerald-300 text-emerald-950`:Q?`bg-rose-300 text-rose-950`:`bg-amber-200 text-amber-950`}`,children:Z?`ACTIVE`:Q?`NEEDS KEY`:`LIMITED`})]})}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider mb-2 font-headline-md flex items-center gap-1.5`,children:[(0,j.jsx)(O,{className:`w-3.5 h-3.5 text-ink-black`}),`Select Provider`]}),(0,j.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2`,children:M.map(t=>{let n=e===t.id;return(0,j.jsxs)(`button`,{type:`button`,onClick:()=>ie(t.id),className:`p-2.5 border-[2px] text-left transition-all cursor-pointer flex flex-col justify-between rounded ${n?`border-ink-black bg-[#ffe24c] shadow-[2px_2px_0px_0px_#1E293B] font-bold`:`border-slate-300 bg-slate-50 hover:bg-slate-100 text-slate-700`}`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between w-full`,children:[(0,j.jsx)(`span`,{className:`text-xs font-bold font-headline-md`,children:t.name}),t.badge&&(0,j.jsx)(`span`,{className:`text-[8px] font-bold uppercase px-1 py-0.2 bg-orange-100 text-orange-700 rounded border border-orange-300`,children:t.badge})]}),(0,j.jsx)(`span`,{className:`text-[9px] mt-1 text-slate-600 leading-tight block`,children:t.desc})]},t.id)})})]}),e==="default"?(0,j.jsxs)(`div`,{className:`p-3.5 bg-slate-50 border border-slate-200 rounded flex items-start gap-3`,children:[(0,j.jsx)(ne,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1 text-xs text-slate-700`,children:[(0,j.jsxs)(`span`,{className:`font-bold text-ink-black`,children:[`Shared Quotas (`,(0,j.jsx)(`i`,{children:`limited`}),`)`]}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray m-0 leading-relaxed`,children:`Powered by shared, basic developer keys. Because limits are shared with everyone, requests may fail. Use your own provider keys above for stable performance.`})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md flex items-center gap-1.5`,children:[(0,j.jsx)(k,{className:`w-3.5 h-3.5 text-ink-black`}),$?.name,` API Key`]}),$?.portalUrl&&(0,j.jsxs)(`a`,{href:$.portalUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-sky-600 hover:text-sky-800 font-medium flex items-center gap-1 no-underline`,children:[(0,j.jsx)(`span`,{children:`Get API Key`}),(0,j.jsx)(i,{className:`w-3 h-3`})]})]}),(0,j.jsxs)(`div`,{className:`relative`,children:[(0,j.jsx)(`input`,{type:N?`text`:`password`,value:n,onChange:e=>g(e.target.value),placeholder:`Enter ${$?.keyPrefix||`API Key`}`,className:`w-full bg-white border-[2px] border-ink-black rounded py-2 pl-3 pr-9 text-ink-black placeholder-slate-400 focus:outline-none focus:border-sky-600 text-xs font-code-mono`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>re(!N),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-trash-gray hover:text-ink-black cursor-pointer bg-transparent border-0 outline-none p-1`,title:N?`Hide API key`:`Show API key`,children:N?(0,j.jsx)(o,{className:`w-3.5 h-3.5`}):(0,j.jsx)(ee,{className:`w-3.5 h-3.5`})})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-trash-gray font-medium`,children:[(0,j.jsx)(_,{className:`w-3.5 h-3.5 text-emerald-600 shrink-0`}),(0,j.jsx)(`span`,{children:`Stored locally in your browser. Sent directly via request headers.`})]}),(0,j.jsxs)(`div`,{className:`flex gap-2 pt-1`,children:[(0,j.jsxs)(`button`,{onClick:ae,className:`flex-1 flex items-center justify-center gap-1.5 py-2 border-[2px] border-ink-black bg-[#ffe24c] hover:bg-yellow-300 text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:[(0,j.jsx)(m,{className:`w-3.5 h-3.5`}),`Save Key`]}),n&&(0,j.jsx)(`button`,{onClick:oe,className:`px-3 py-2 border-[2px] border-slate-300 bg-white hover:bg-slate-50 text-xs font-bold text-slate-700 hover:text-rose-600 shadow-[2px_2px_0px_0px_rgba(0,0,0,0.05)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:`Clear Key`})]})]}),P&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${P.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:P.type===`error`?`bg-rose-100 border-rose-600 text-rose-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[P.type===`success`?(0,j.jsx)(D,{className:`w-3.5 h-3.5 shrink-0`}):P.type===`error`?(0,j.jsx)(r,{className:`w-3.5 h-3.5 shrink-0`}):(0,j.jsx)(p,{className:`w-3.5 h-3.5 shrink-0`}),P.text]}),e!=="default"&&(0,j.jsx)(`div`,{className:`pt-2 border-t border-slate-200 flex justify-end`,children:(0,j.jsxs)(`button`,{onClick:se,className:`flex items-center gap-1.5 py-1.5 px-3 border border-slate-300 bg-slate-50 hover:bg-slate-100 text-[11px] font-bold text-slate-600 hover:text-ink-black transition-all cursor-pointer rounded`,children:[(0,j.jsx)(v,{className:`w-3 h-3 text-slate-500`}),`Reset to Server Default`]})})]}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,j.jsx)(`div`,{className:`w-8 h-8 rounded bg-[#24292e] border-[2px] border-ink-black flex items-center justify-center text-white shadow-[1px_1px_0px_0px_#1E293B]`,children:(0,j.jsx)(f,{className:`w-4 h-4 text-white`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black m-0 flex items-center gap-2`,children:`GitHub Solutions Sync & Auto-Commit`}),(0,j.jsx)(`p`,{className:`text-[10px] text-trash-gray font-medium m-0`,children:`Sync solutions to personal GitHub repository and commit automatically on submission`})]})]}),(0,j.jsx)(`span`,{className:`px-2 py-0.5 text-[9px] font-bold font-arcade uppercase border-2 border-ink-black shrink-0 ${X?`bg-emerald-300 text-emerald-950`:`bg-slate-200 text-slate-800`}`,children:X?`CONNECTED`:`DISCONNECTED`})]}),X?(0,j.jsxs)(`div`,{className:`space-y-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-2 p-3 bg-slate-50 border border-slate-200 rounded`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[W?.avatar_url&&(0,j.jsx)(`img`,{src:W.avatar_url,alt:W.login,className:`w-7 h-7 rounded-full border border-ink-black`}),(0,j.jsxs)(`div`,{children:[(0,j.jsxs)(`span`,{className:`text-xs font-bold text-ink-black`,children:[`@`,W?.login||H.username]}),(0,j.jsxs)(`span`,{className:`text-[11px] text-slate-600 font-mono block`,children:[H.username,`/`,H.repoName,` (`,H.branch,`)`]})]})]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`a`,{href:`https://github.com/${H.username}/${H.repoName}`,target:`_blank`,rel:`noopener noreferrer`,className:`px-2.5 py-1 text-[11px] font-bold bg-white hover:bg-slate-100 text-ink-black border border-slate-300 rounded no-underline flex items-center gap-1 cursor-pointer`,children:[(0,j.jsx)(i,{className:`w-3 h-3`}),(0,j.jsx)(`span`,{children:`View Repo`})]}),(0,j.jsx)(`button`,{type:`button`,onClick:fe,className:`px-2.5 py-1 text-[11px] font-bold bg-white hover:bg-rose-50 text-rose-700 border border-rose-300 rounded cursor-pointer`,children:`Disconnect`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-emerald-50/50 border border-emerald-300 rounded cursor-pointer`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:H.autoCommit,onChange:e=>pe(e.target.checked),className:`w-4 h-4 accent-emerald-600 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`Auto-commit on every submission`}),(0,j.jsxs)(`span`,{className:`text-[10px] text-trash-gray`,children:[`Automatically pushes your code to `,H.repoName,` whenever you grade a review card.`]})]})]})]}):(0,j.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 p-3.5 bg-slate-50 border border-slate-200 rounded`,children:[(0,j.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,j.jsx)(`span`,{className:`text-xs font-bold text-ink-black block`,children:`Connect your GitHub Account (1-Click OAuth)`}),(0,j.jsx)(`p`,{className:`text-[11px] text-trash-gray m-0`,children:`Grant repository access to automatically sync your DSA problem solutions as you study.`})]}),(0,j.jsx)(`button`,{type:`button`,onClick:de,disabled:K,className:`px-4 py-2 bg-[#24292e] hover:bg-black text-white text-xs font-bold uppercase rounded border-2 border-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none flex items-center gap-2 shrink-0 cursor-pointer disabled:opacity-50`,children:K?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(h,{className:`w-3.5 h-3.5 animate-spin`}),(0,j.jsx)(`span`,{children:`CONNECTING...`})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(f,{className:`w-3.5 h-3.5 text-yellow-300`}),(0,j.jsx)(`span`,{children:`CONNECT GITHUB`})]})})]}),J&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${J.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:J.type===`error`?`bg-rose-100 border-rose-600 text-rose-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[J.type===`success`?(0,j.jsx)(D,{className:`w-3.5 h-3.5 shrink-0`}):J.type===`error`?(0,j.jsx)(r,{className:`w-3.5 h-3.5 shrink-0`}):(0,j.jsx)(p,{className:`w-3.5 h-3.5 shrink-0`}),J.text]})]}),(0,j.jsxs)(`div`,{className:`bg-[#FFFDF0] border-[3px] border-ink-black p-4 sm:p-5 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between border-b-[2px] border-ink-black pb-3`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(`div`,{className:`w-7 h-7 rounded bg-[#FFE24C] border-[2px] border-ink-black flex items-center justify-center shadow-[1px_1px_0px_0px_#1E293B]`,children:(0,j.jsx)(te,{className:`w-4 h-4 text-ink-black`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h4`,{className:`font-headline-md font-bold text-xs uppercase text-ink-black m-0`,children:`Princess AI Companion & RPG Settings`}),(0,j.jsx)(`p`,{className:`text-[10px] text-trash-gray font-medium m-0`,children:`Trapped Princess Persona, Study Break Timer & 8-bit RPG Audio`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,j.jsx)(`span`,{className:`text-[11px] font-bold text-ink-black font-headline-md uppercase`,children:I.enabled?`Enabled`:`Disabled`}),(0,j.jsx)(`input`,{type:`checkbox`,checked:I.enabled,onChange:e=>L(t=>({...t,enabled:e.target.checked})),className:`w-4 h-4 accent-amber-500 cursor-pointer`})]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md`,children:`Companion Name`}),(0,j.jsx)(`input`,{type:`text`,value:I.name,onChange:e=>L(t=>({...t,name:e.target.value})),placeholder:`e.g. Princess Aurelia`,className:`bg-white border-[2px] border-ink-black rounded py-2 px-3 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600`})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsxs)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md flex items-center gap-1`,children:[(0,j.jsx)(y,{className:`w-3.5 h-3.5 text-amber-700`}),`Study Break Reminder`]}),(0,j.jsxs)(`select`,{value:I.breakIntervalMinutes,onChange:e=>L(t=>({...t,breakIntervalMinutes:Number(e.target.value)})),className:`bg-white border-[2px] border-ink-black rounded py-2 px-3 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600 cursor-pointer`,children:[(0,j.jsx)(`option`,{value:25,children:`Every 25 Minutes (Classic Pomodoro)`}),(0,j.jsx)(`option`,{value:45,children:`Every 45 Minutes`}),(0,j.jsx)(`option`,{value:60,children:`Every 60 Minutes`}),(0,j.jsx)(`option`,{value:0,children:`Disabled (No automatic break popups)`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,j.jsx)(`label`,{className:`block text-xs font-bold text-ink-black uppercase tracking-wider font-headline-md`,children:`Princess Backstory & Persona Prompt`}),(0,j.jsx)(`textarea`,{rows:2,value:I.backstory,onChange:e=>L(t=>({...t,backstory:e.target.value})),placeholder:`Describe her background, tone, and connection to your DSA studies...`,className:`bg-white border-[2px] border-ink-black rounded p-2.5 text-ink-black text-xs font-sans font-medium focus:outline-none focus:border-amber-600 resize-y`})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1`,children:[(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-white border border-slate-300 rounded cursor-pointer hover:border-ink-black transition-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:I.soundEnabled,onChange:e=>{let t=e.target.checked;L(e=>({...e,soundEnabled:t})),E(!t)},className:`w-4 h-4 accent-amber-500 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`8-bit Sound Effects`}),(0,j.jsx)(`span`,{className:`text-[10px] text-trash-gray`,children:`Typewriter blips, chimes & fanfare`})]})]}),(0,j.jsxs)(`label`,{className:`flex items-center gap-2.5 p-2.5 bg-white border border-slate-300 rounded cursor-pointer hover:border-ink-black transition-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:I.autoPopupEnabled,onChange:e=>L(t=>({...t,autoPopupEnabled:e.target.checked})),className:`w-4 h-4 accent-amber-500 cursor-pointer`}),(0,j.jsxs)(`div`,{className:`text-xs`,children:[(0,j.jsx)(`span`,{className:`font-bold text-ink-black block`,children:`Spontaneous RPG Popups`}),(0,j.jsx)(`span`,{className:`text-[10px] text-trash-gray`,children:`Speech bubbles for breaks & milestones`})]})]})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 pt-2 border-t border-slate-200`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsxs)(`button`,{type:`button`,onClick:ce,className:`flex items-center gap-1.5 py-2 px-4 border-[2px] border-ink-black bg-[#ffe24c] hover:bg-yellow-300 text-xs font-bold text-ink-black shadow-[2px_2px_0px_0px_#1E293B] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer rounded uppercase`,children:[(0,j.jsx)(m,{className:`w-3.5 h-3.5`}),`Save Companion Settings`]}),(0,j.jsx)(`button`,{type:`button`,onClick:le,className:`py-2 px-3 border border-slate-300 bg-white hover:bg-slate-50 text-xs font-bold text-slate-700 transition-all cursor-pointer rounded`,children:`Default Persona`})]}),(0,j.jsxs)(`button`,{type:`button`,onClick:ue,className:`flex items-center gap-1 py-1.5 px-3 border border-rose-300 bg-rose-50 hover:bg-rose-100 text-rose-700 text-[11px] font-bold transition-all cursor-pointer rounded`,children:[(0,j.jsx)(v,{className:`w-3 h-3 text-rose-500`}),(0,j.jsxs)(`span`,{children:[`Reset Journey (`,B,`/150 LC)`]})]})]}),R&&(0,j.jsxs)(`div`,{className:`p-2.5 border-[2px] border-ink-black text-xs font-medium rounded flex items-center gap-2 ${R.type===`success`?`bg-emerald-100 border-emerald-600 text-emerald-900`:`bg-sky-100 border-sky-600 text-sky-900`}`,children:[(0,j.jsx)(D,{className:`w-3.5 h-3.5 shrink-0`}),R.text]})]}),(0,j.jsxs)(`div`,{className:`bg-white border-[3px] border-ink-black p-4 shadow-[4px_4px_0px_0px_rgba(30,41,59,1)] flex flex-col gap-2.5`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,j.jsx)(p,{className:`w-3.5 h-3.5 text-[#0ea5e9]`}),(0,j.jsx)(`h4`,{className:`text-xs font-bold uppercase font-headline-md m-0`,children:`Get Free API Keys`})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-2 text-[10px]`,children:[(0,j.jsxs)(`a`,{href:`https://console.groq.com/keys`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`Groq Cloud`}),(0,j.jsx)(i,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Fast inference with generous free rate limits.`})]}),(0,j.jsxs)(`a`,{href:`https://aistudio.google.com/app/apikey`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`Google AI Studio`}),(0,j.jsx)(i,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Free Gemini Flash API quota.`})]}),(0,j.jsxs)(`a`,{href:`https://openrouter.ai/keys`,target:`_blank`,rel:`noopener noreferrer`,className:`p-2.5 border border-slate-200 hover:border-ink-black hover:bg-slate-50 rounded flex flex-col justify-between gap-1 transition-all no-underline text-inherit cursor-pointer`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between font-bold text-ink-black`,children:[(0,j.jsx)(`span`,{children:`OpenRouter`}),(0,j.jsx)(i,{className:`w-3 h-3 text-slate-400`})]}),(0,j.jsx)(`p`,{className:`m-0 text-trash-gray leading-normal`,children:`Unified API for open-weights models.`})]})]})]})]})}export{N as default};
algospaced-ui/dist/assets/{circle-alert-BL6bvZTM.js → circle-alert-B3TumjQg.js} RENAMED
@@ -1 +1 @@
1
- import{G as e}from"./index-V2pPJO9M.js";var t=e(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);export{t};
 
1
+ import{G as e}from"./index-M1GCaKIP.js";var t=e(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]);export{t};
algospaced-ui/dist/assets/{confetti.module-nUzO7Zin.js → confetti.module-BXT-TAy0.js} RENAMED
@@ -1,2 +1,2 @@
1
- import{G as e}from"./index-V2pPJO9M.js";var t=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),n=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),r=e(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),i=e(`trophy`,[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]),a={};(function e(t,n,r,i){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D==`function`&&typeof DOMMatrix==`function`,s=(function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),n=e.getContext(`2d`);n.fillRect(0,0,1,1);var r=e.transferToImageBitmap();n.createPattern(r,`no-repeat`)}catch{return!1}return!0})();function c(){}function l(e){var r=n.exports.Promise,i=r===void 0?t.Promise:r;return typeof i==`function`?new i(e):(e(c,c),null)}var u=(function(e,t){return{transform:function(n){if(e)return n;if(t.has(n))return t.get(n);var r=new OffscreenCanvas(n.width,n.height);return r.getContext(`2d`).drawImage(n,0,0),t.set(n,r),r},clear:function(){t.clear()}}})(s,new Map),d=function(){var e,t,n={},r=0;return typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?(e=function(e){var t=Math.random();return n[t]=requestAnimationFrame(function i(a){r===a||r+16-1<a?(r=a,delete n[t],e()):n[t]=requestAnimationFrame(i)}),t},t=function(e){n[e]&&cancelAnimationFrame(n[e])}):(e=function(e){return setTimeout(e,16)},t=function(e){return clearTimeout(e)}),{frame:e,cancel:t}}(),f=(function(){var t,n,i={};function o(e){function t(t,n){e.postMessage({options:t||{},callback:n})}e.init=function(t){var n=t.transferControlToOffscreen();e.postMessage({canvas:n},[n])},e.fire=function(r,a,o){if(n)return t(r,null),n;var s=Math.random().toString(36).slice(2);return n=l(function(a){function c(t){t.data.callback===s&&(delete i[s],e.removeEventListener(`message`,c),n=null,u.clear(),o(),a())}e.addEventListener(`message`,c),t(r,s),i[s]=c.bind(null,{data:{callback:s}})}),n},e.reset=function(){for(var t in e.postMessage({reset:!0}),i)i[t](),delete i[t]}}return function(){if(t)return t;if(!r&&a){var n=[`var CONFETTI, SIZE = {}, module = {};`,`(`+e.toString()+`)(this, module, true, SIZE);`,`onmessage = function(msg) {`,` if (msg.data.options) {`,` CONFETTI(msg.data.options).then(function () {`,` if (msg.data.callback) {`,` postMessage({ callback: msg.data.callback });`,` }`,` });`,` } else if (msg.data.reset) {`,` CONFETTI && CONFETTI.reset();`,` } else if (msg.data.resize) {`,` SIZE.width = msg.data.resize.width;`,` SIZE.height = msg.data.resize.height;`,` } else if (msg.data.canvas) {`,` SIZE.width = msg.data.canvas.width;`,` SIZE.height = msg.data.canvas.height;`,` CONFETTI = module.exports.create(msg.data.canvas);`,` }`,`}`].join(`
2
  `);try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console<`u`&&typeof console.warn==`function`&&console.warn(`🎊 Could not load worker`,e),null}o(t)}return t}})(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:[`square`,`circle`],zIndex:100,colors:[`#26ccff`,`#a25afd`,`#ff5e7e`,`#88ff5a`,`#fcff42`,`#ffa62d`,`#ff36ff`],disableForReducedMotion:!1,scalar:1};function m(e,t){return t?t(e):e}function h(e){return e!=null}function g(e,t,n){return m(e&&h(e[t])?e[t]:p[t],n)}function _(e){return e<0?0:Math.floor(e)}function v(e,t){return Math.floor(Math.random()*(t-e))+e}function y(e){return parseInt(e,16)}function b(e){return e.map(x)}function x(e){var t=String(e).replace(/[^0-9a-f]/gi,``);return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:y(t.substring(0,2)),g:y(t.substring(2,4)),b:y(t.substring(4,6))}}function S(e){var t=g(e,`origin`,Object);return t.x=g(t,`x`,Number),t.y=g(t,`y`,Number),t}function C(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function w(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function T(e){var t=document.createElement(`canvas`);return t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.pointerEvents=`none`,t.style.zIndex=e,t}function E(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),e.arc(0,0,1,o,s,c),e.restore()}function D(e){var t=e.angle*(Math.PI/180),n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:(Math.random()*.5+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function O(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var n=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,a=t.wobbleX+t.random*t.tiltCos,s=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle=`rgba(`+t.color.r+`, `+t.color.g+`, `+t.color.b+`, `+(1-n)+`)`,e.beginPath(),o&&t.shape.type===`path`&&typeof t.shape.path==`string`&&Array.isArray(t.shape.matrix))e.fill(N(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(a-r)*.1,Math.abs(s-i)*.1,Math.PI/10*t.wobble));else if(t.shape.type===`bitmap`){var c=Math.PI/10*t.wobble,l=Math.abs(a-r)*.1,d=Math.abs(s-i)*.1,f=t.shape.bitmap.width*t.scalar,p=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(c)*l,Math.sin(c)*l,-Math.sin(c)*d,Math.cos(c)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var h=e.createPattern(u.transform(t.shape.bitmap),`no-repeat`);h.setTransform(m),e.globalAlpha=1-n,e.fillStyle=h,e.fillRect(t.x-f/2,t.y-p/2,f,p),e.globalAlpha=1}else if(t.shape===`circle`)e.ellipse?e.ellipse(t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):E(e,t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if(t.shape===`star`)for(var g=Math.PI/2*3,_=4*t.scalar,v=8*t.scalar,y=t.x,b=t.y,x=5,S=Math.PI/x;x--;)y=t.x+Math.cos(g)*v,b=t.y+Math.sin(g)*v,e.lineTo(y,b),g+=S,y=t.x+Math.cos(g)*_,b=t.y+Math.sin(g)*_,e.lineTo(y,b),g+=S;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(i)),e.lineTo(Math.floor(a),Math.floor(s)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function k(e,t,n,a,o){var s=t.slice(),c=e.getContext(`2d`),f,p,m=l(function(t){function l(){f=p=null,c.clearRect(0,0,a.width,a.height),u.clear(),o(),t()}function m(){r&&(a.width!==i.width||a.height!==i.height)&&(a.width=e.width=i.width,a.height=e.height=i.height),!a.width&&!a.height&&(n(e),a.width=e.width,a.height=e.height),c.clearRect(0,0,a.width,a.height),s=s.filter(function(e){return O(c,e)}),s.length?f=d.frame(m):l()}f=d.frame(m),p=l});return{addFettis:function(e){return s=s.concat(e),m},canvas:e,promise:m,reset:function(){f&&d.cancel(f),p&&p()}}}function A(e,n){var r=!e,i=!!g(n||{},`resize`),o=!1,s=g(n,`disableForReducedMotion`,Boolean),c=a&&g(n||{},`useWorker`)?f():null,u=r?C:w,d=e&&c?!!e.__confetti_initialized:!1,p=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion)`).matches,m;function h(t,n,r){for(var i=g(t,`particleCount`,_),a=g(t,`angle`,Number),o=g(t,`spread`,Number),s=g(t,`startVelocity`,Number),c=g(t,`decay`,Number),l=g(t,`gravity`,Number),d=g(t,`drift`,Number),f=g(t,`colors`,b),p=g(t,`ticks`,Number),h=g(t,`shapes`),y=g(t,`scalar`),x=!!g(t,`flat`),C=S(t),w=i,T=[],E=e.width*C.x,O=e.height*C.y;w--;)T.push(D({x:E,y:O,angle:a,spread:o,startVelocity:s,color:f[w%f.length],shape:h[v(0,h.length)],ticks:p,decay:c,gravity:l,drift:d,scalar:y,flat:x}));return m?m.addFettis(T):(m=k(e,T,u,n,r),m.promise)}function y(n){var a=s||g(n,`disableForReducedMotion`,Boolean),f=g(n,`zIndex`,Number);if(a&&p)return l(function(e){e()});r&&m?e=m.canvas:r&&!e&&(e=T(f),document.body.appendChild(e)),i&&!d&&u(e);var _={width:e.width,height:e.height};c&&!d&&c.init(e),d=!0,c&&(e.__confetti_initialized=!0);function v(){if(c){var t={getBoundingClientRect:function(){if(!r)return e.getBoundingClientRect()}};u(t),c.postMessage({resize:{width:t.width,height:t.height}});return}_.width=_.height=null}function y(){m=null,i&&(o=!1,t.removeEventListener(`resize`,v)),r&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,d=!1)}return i&&!o&&(o=!0,t.addEventListener(`resize`,v,!1)),c?c.fire(n,_,y):h(n,_,y)}return y.reset=function(){c&&c.reset(),m&&m.reset()},y}var j;function M(){return j||=A(null,{useWorker:!0,resize:!0}),j}function N(e,t,n,r,i,a,o){var s=new Path2D(e),c=new Path2D;c.addPath(s,new DOMMatrix(t));var l=new Path2D;return l.addPath(c,new DOMMatrix([Math.cos(o)*i,Math.sin(o)*i,-Math.sin(o)*a,Math.cos(o)*a,n,r])),l}function P(e){if(!o)throw Error(`path confetti are not supported in this browser`);var t,n;typeof e==`string`?t=e:(t=e.path,n=e.matrix);var r=new Path2D(t),i=document.createElement(`canvas`).getContext(`2d`);if(!n){for(var a=1e3,s=a,c=a,l=0,u=0,d,f,p=0;p<a;p+=2)for(var m=0;m<a;m+=2)i.isPointInPath(r,p,m,`nonzero`)&&(s=Math.min(s,p),c=Math.min(c,m),l=Math.max(l,p),u=Math.max(u,m));d=l-s,f=u-c;var h=10,g=Math.min(h/d,h/f);n=[g,0,0,g,-Math.round(d/2+s)*g,-Math.round(f/2+c)*g]}return{type:`path`,path:t,matrix:n}}function F(e){var t,n=1,r=`#000000`,i=`"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif`;typeof e==`string`?t=e:(t=e.text,n=`scalar`in e?e.scalar:n,i=`fontFamily`in e?e.fontFamily:i,r=`color`in e?e.color:r);var a=10*n,o=``+a+`px `+i,s=new OffscreenCanvas(a,a),c=s.getContext(`2d`);c.font=o;var l=c.measureText(t),u=Math.ceil(l.actualBoundingBoxRight+l.actualBoundingBoxLeft),d=Math.ceil(l.actualBoundingBoxAscent+l.actualBoundingBoxDescent),f=2,p=l.actualBoundingBoxLeft+f,m=l.actualBoundingBoxAscent+f;u+=f+f,d+=f+f,s=new OffscreenCanvas(u,d),c=s.getContext(`2d`),c.font=o,c.fillStyle=r,c.fillText(t,p,m);var h=1/n;return{type:`bitmap`,bitmap:s.transferToImageBitmap(),matrix:[h,0,0,h,-u*h/2,-d*h/2]}}n.exports=function(){return M().apply(this,arguments)},n.exports.reset=function(){M().reset()},n.exports.create=A,n.exports.shapeFromPath=P,n.exports.shapeFromText=F})((function(){return typeof window<`u`?window:typeof self<`u`?self:this||{}})(),a,!1);var o=a.exports;a.exports.create;export{t as a,n as i,i as n,r,o as t};
 
1
+ import{G as e}from"./index-M1GCaKIP.js";var t=e(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),n=e(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),r=e(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),i=e(`trophy`,[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]),a={};(function e(t,n,r,i){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D==`function`&&typeof DOMMatrix==`function`,s=(function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),n=e.getContext(`2d`);n.fillRect(0,0,1,1);var r=e.transferToImageBitmap();n.createPattern(r,`no-repeat`)}catch{return!1}return!0})();function c(){}function l(e){var r=n.exports.Promise,i=r===void 0?t.Promise:r;return typeof i==`function`?new i(e):(e(c,c),null)}var u=(function(e,t){return{transform:function(n){if(e)return n;if(t.has(n))return t.get(n);var r=new OffscreenCanvas(n.width,n.height);return r.getContext(`2d`).drawImage(n,0,0),t.set(n,r),r},clear:function(){t.clear()}}})(s,new Map),d=function(){var e,t,n={},r=0;return typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?(e=function(e){var t=Math.random();return n[t]=requestAnimationFrame(function i(a){r===a||r+16-1<a?(r=a,delete n[t],e()):n[t]=requestAnimationFrame(i)}),t},t=function(e){n[e]&&cancelAnimationFrame(n[e])}):(e=function(e){return setTimeout(e,16)},t=function(e){return clearTimeout(e)}),{frame:e,cancel:t}}(),f=(function(){var t,n,i={};function o(e){function t(t,n){e.postMessage({options:t||{},callback:n})}e.init=function(t){var n=t.transferControlToOffscreen();e.postMessage({canvas:n},[n])},e.fire=function(r,a,o){if(n)return t(r,null),n;var s=Math.random().toString(36).slice(2);return n=l(function(a){function c(t){t.data.callback===s&&(delete i[s],e.removeEventListener(`message`,c),n=null,u.clear(),o(),a())}e.addEventListener(`message`,c),t(r,s),i[s]=c.bind(null,{data:{callback:s}})}),n},e.reset=function(){for(var t in e.postMessage({reset:!0}),i)i[t](),delete i[t]}}return function(){if(t)return t;if(!r&&a){var n=[`var CONFETTI, SIZE = {}, module = {};`,`(`+e.toString()+`)(this, module, true, SIZE);`,`onmessage = function(msg) {`,` if (msg.data.options) {`,` CONFETTI(msg.data.options).then(function () {`,` if (msg.data.callback) {`,` postMessage({ callback: msg.data.callback });`,` }`,` });`,` } else if (msg.data.reset) {`,` CONFETTI && CONFETTI.reset();`,` } else if (msg.data.resize) {`,` SIZE.width = msg.data.resize.width;`,` SIZE.height = msg.data.resize.height;`,` } else if (msg.data.canvas) {`,` SIZE.width = msg.data.canvas.width;`,` SIZE.height = msg.data.canvas.height;`,` CONFETTI = module.exports.create(msg.data.canvas);`,` }`,`}`].join(`
2
  `);try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console<`u`&&typeof console.warn==`function`&&console.warn(`🎊 Could not load worker`,e),null}o(t)}return t}})(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:[`square`,`circle`],zIndex:100,colors:[`#26ccff`,`#a25afd`,`#ff5e7e`,`#88ff5a`,`#fcff42`,`#ffa62d`,`#ff36ff`],disableForReducedMotion:!1,scalar:1};function m(e,t){return t?t(e):e}function h(e){return e!=null}function g(e,t,n){return m(e&&h(e[t])?e[t]:p[t],n)}function _(e){return e<0?0:Math.floor(e)}function v(e,t){return Math.floor(Math.random()*(t-e))+e}function y(e){return parseInt(e,16)}function b(e){return e.map(x)}function x(e){var t=String(e).replace(/[^0-9a-f]/gi,``);return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:y(t.substring(0,2)),g:y(t.substring(2,4)),b:y(t.substring(4,6))}}function S(e){var t=g(e,`origin`,Object);return t.x=g(t,`x`,Number),t.y=g(t,`y`,Number),t}function C(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function w(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function T(e){var t=document.createElement(`canvas`);return t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.pointerEvents=`none`,t.style.zIndex=e,t}function E(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),e.arc(0,0,1,o,s,c),e.restore()}function D(e){var t=e.angle*(Math.PI/180),n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:(Math.random()*.5+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function O(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var n=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,a=t.wobbleX+t.random*t.tiltCos,s=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle=`rgba(`+t.color.r+`, `+t.color.g+`, `+t.color.b+`, `+(1-n)+`)`,e.beginPath(),o&&t.shape.type===`path`&&typeof t.shape.path==`string`&&Array.isArray(t.shape.matrix))e.fill(N(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(a-r)*.1,Math.abs(s-i)*.1,Math.PI/10*t.wobble));else if(t.shape.type===`bitmap`){var c=Math.PI/10*t.wobble,l=Math.abs(a-r)*.1,d=Math.abs(s-i)*.1,f=t.shape.bitmap.width*t.scalar,p=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(c)*l,Math.sin(c)*l,-Math.sin(c)*d,Math.cos(c)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var h=e.createPattern(u.transform(t.shape.bitmap),`no-repeat`);h.setTransform(m),e.globalAlpha=1-n,e.fillStyle=h,e.fillRect(t.x-f/2,t.y-p/2,f,p),e.globalAlpha=1}else if(t.shape===`circle`)e.ellipse?e.ellipse(t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):E(e,t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if(t.shape===`star`)for(var g=Math.PI/2*3,_=4*t.scalar,v=8*t.scalar,y=t.x,b=t.y,x=5,S=Math.PI/x;x--;)y=t.x+Math.cos(g)*v,b=t.y+Math.sin(g)*v,e.lineTo(y,b),g+=S,y=t.x+Math.cos(g)*_,b=t.y+Math.sin(g)*_,e.lineTo(y,b),g+=S;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(i)),e.lineTo(Math.floor(a),Math.floor(s)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function k(e,t,n,a,o){var s=t.slice(),c=e.getContext(`2d`),f,p,m=l(function(t){function l(){f=p=null,c.clearRect(0,0,a.width,a.height),u.clear(),o(),t()}function m(){r&&(a.width!==i.width||a.height!==i.height)&&(a.width=e.width=i.width,a.height=e.height=i.height),!a.width&&!a.height&&(n(e),a.width=e.width,a.height=e.height),c.clearRect(0,0,a.width,a.height),s=s.filter(function(e){return O(c,e)}),s.length?f=d.frame(m):l()}f=d.frame(m),p=l});return{addFettis:function(e){return s=s.concat(e),m},canvas:e,promise:m,reset:function(){f&&d.cancel(f),p&&p()}}}function A(e,n){var r=!e,i=!!g(n||{},`resize`),o=!1,s=g(n,`disableForReducedMotion`,Boolean),c=a&&g(n||{},`useWorker`)?f():null,u=r?C:w,d=e&&c?!!e.__confetti_initialized:!1,p=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion)`).matches,m;function h(t,n,r){for(var i=g(t,`particleCount`,_),a=g(t,`angle`,Number),o=g(t,`spread`,Number),s=g(t,`startVelocity`,Number),c=g(t,`decay`,Number),l=g(t,`gravity`,Number),d=g(t,`drift`,Number),f=g(t,`colors`,b),p=g(t,`ticks`,Number),h=g(t,`shapes`),y=g(t,`scalar`),x=!!g(t,`flat`),C=S(t),w=i,T=[],E=e.width*C.x,O=e.height*C.y;w--;)T.push(D({x:E,y:O,angle:a,spread:o,startVelocity:s,color:f[w%f.length],shape:h[v(0,h.length)],ticks:p,decay:c,gravity:l,drift:d,scalar:y,flat:x}));return m?m.addFettis(T):(m=k(e,T,u,n,r),m.promise)}function y(n){var a=s||g(n,`disableForReducedMotion`,Boolean),f=g(n,`zIndex`,Number);if(a&&p)return l(function(e){e()});r&&m?e=m.canvas:r&&!e&&(e=T(f),document.body.appendChild(e)),i&&!d&&u(e);var _={width:e.width,height:e.height};c&&!d&&c.init(e),d=!0,c&&(e.__confetti_initialized=!0);function v(){if(c){var t={getBoundingClientRect:function(){if(!r)return e.getBoundingClientRect()}};u(t),c.postMessage({resize:{width:t.width,height:t.height}});return}_.width=_.height=null}function y(){m=null,i&&(o=!1,t.removeEventListener(`resize`,v)),r&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,d=!1)}return i&&!o&&(o=!0,t.addEventListener(`resize`,v,!1)),c?c.fire(n,_,y):h(n,_,y)}return y.reset=function(){c&&c.reset(),m&&m.reset()},y}var j;function M(){return j||=A(null,{useWorker:!0,resize:!0}),j}function N(e,t,n,r,i,a,o){var s=new Path2D(e),c=new Path2D;c.addPath(s,new DOMMatrix(t));var l=new Path2D;return l.addPath(c,new DOMMatrix([Math.cos(o)*i,Math.sin(o)*i,-Math.sin(o)*a,Math.cos(o)*a,n,r])),l}function P(e){if(!o)throw Error(`path confetti are not supported in this browser`);var t,n;typeof e==`string`?t=e:(t=e.path,n=e.matrix);var r=new Path2D(t),i=document.createElement(`canvas`).getContext(`2d`);if(!n){for(var a=1e3,s=a,c=a,l=0,u=0,d,f,p=0;p<a;p+=2)for(var m=0;m<a;m+=2)i.isPointInPath(r,p,m,`nonzero`)&&(s=Math.min(s,p),c=Math.min(c,m),l=Math.max(l,p),u=Math.max(u,m));d=l-s,f=u-c;var h=10,g=Math.min(h/d,h/f);n=[g,0,0,g,-Math.round(d/2+s)*g,-Math.round(f/2+c)*g]}return{type:`path`,path:t,matrix:n}}function F(e){var t,n=1,r=`#000000`,i=`"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif`;typeof e==`string`?t=e:(t=e.text,n=`scalar`in e?e.scalar:n,i=`fontFamily`in e?e.fontFamily:i,r=`color`in e?e.color:r);var a=10*n,o=``+a+`px `+i,s=new OffscreenCanvas(a,a),c=s.getContext(`2d`);c.font=o;var l=c.measureText(t),u=Math.ceil(l.actualBoundingBoxRight+l.actualBoundingBoxLeft),d=Math.ceil(l.actualBoundingBoxAscent+l.actualBoundingBoxDescent),f=2,p=l.actualBoundingBoxLeft+f,m=l.actualBoundingBoxAscent+f;u+=f+f,d+=f+f,s=new OffscreenCanvas(u,d),c=s.getContext(`2d`),c.font=o,c.fillStyle=r,c.fillText(t,p,m);var h=1/n;return{type:`bitmap`,bitmap:s.transferToImageBitmap(),matrix:[h,0,0,h,-u*h/2,-d*h/2]}}n.exports=function(){return M().apply(this,arguments)},n.exports.reset=function(){M().reset()},n.exports.create=A,n.exports.shapeFromPath=P,n.exports.shapeFromText=F})((function(){return typeof window<`u`?window:typeof self<`u`?self:this||{}})(),a,!1);var o=a.exports;a.exports.create;export{t as a,n as i,i as n,r,o as t};
algospaced-ui/dist/assets/{external-link-BGZfX5Bi.js → external-link-64ub39jt.js} RENAMED
@@ -1 +1 @@
1
- import{G as e}from"./index-V2pPJO9M.js";var t=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);export{t};
 
1
+ import{G as e}from"./index-M1GCaKIP.js";var t=e(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);export{t};
algospaced-ui/dist/assets/{githubSyncService-CsqBgIfT.js → githubSyncService-B4h5nigj.js} RENAMED
@@ -1 +1 @@
1
- import{i as e}from"./jsx-runtime-j9uSgrFF.js";import{G as t}from"./index-V2pPJO9M.js";var n=t(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),r=t(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),i=t(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),a={TOKEN:`algospaced_github_token`,USERNAME:`algospaced_github_username`,REPO:`algospaced_github_repo`,BRANCH:`algospaced_github_branch`,AUTOCOMMIT:`algospaced_github_autocommit`,PRIVATE:`algospaced_github_private`,AVATAR:`algospaced_github_avatar`,NAME:`algospaced_github_name`};function o(){return{token:localStorage.getItem(a.TOKEN)||``,username:localStorage.getItem(a.USERNAME)||``,repoName:localStorage.getItem(a.REPO)||`algospaced-solutions`,branch:localStorage.getItem(a.BRANCH)||`main`,autoCommit:localStorage.getItem(a.AUTOCOMMIT)!==`false`,isPrivate:localStorage.getItem(a.PRIVATE)!==`false`}}function s(){let e=localStorage.getItem(a.USERNAME);return e?{login:e,name:localStorage.getItem(a.NAME)||e,avatar_url:localStorage.getItem(a.AVATAR)||``,html_url:`https://github.com/${e}`}:null}function c(e,t){e.token!==void 0&&localStorage.setItem(a.TOKEN,e.token.trim()),e.username!==void 0&&localStorage.setItem(a.USERNAME,e.username.trim()),e.repoName!==void 0&&localStorage.setItem(a.REPO,e.repoName.trim()),e.branch!==void 0&&localStorage.setItem(a.BRANCH,e.branch.trim()),e.autoCommit!==void 0&&localStorage.setItem(a.AUTOCOMMIT,String(e.autoCommit)),e.isPrivate!==void 0&&localStorage.setItem(a.PRIVATE,String(e.isPrivate)),t&&(t.login&&localStorage.setItem(a.USERNAME,t.login),t.name&&localStorage.setItem(a.NAME,t.name),t.avatar_url&&localStorage.setItem(a.AVATAR,t.avatar_url))}function l(){Object.values(a).forEach(e=>localStorage.removeItem(e))}async function u(){let e=window.open(`/api/github/oauth/login`,`algospaced_github_oauth`,`width=600,height=750,menubar=no,toolbar=no,status=no,location=no`);if(!e)throw Error(`Popup window was blocked by your browser. Please allow popups for AlgoSpaced and try again.`);let t=await new Promise((t,n)=>{let r=null,i=()=>{window.removeEventListener(`message`,a),r!==null&&(clearInterval(r),r=null)},a=e=>{if(!e.data||typeof e.data!=`object`)return;let r=e.data;r.type===`GITHUB_OAUTH_SUCCESS`?(i(),r.token&&typeof r.token==`string`?t(r.token.trim()):n(Error(`GitHub authorization succeeded but no access token was returned.`))):r.type===`GITHUB_OAUTH_ERROR`&&(i(),n(Error(r.error||`GitHub authorization was denied or encountered an error.`)))};window.addEventListener(`message`,a),r=setInterval(()=>{e.closed&&(i(),n(Error(`GitHub authorization window was closed before completing.`)))},1e3)}),n=await d(t);if(!n.valid||!n.user)throw Error(n.error||`Failed to retrieve profile with GitHub token.`);let r=n.user;return c({token:t,username:r.login,repoName:o().repoName||`algospaced-solutions`},r),{token:t,user:r}}async function d(e){let t=await fetch(`/api/github/verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e.trim()})});return t.ok?await t.json():{valid:!1,error:(await t.json().catch(()=>({}))).detail||`Server returned error (${t.status})`}}async function f(e,t,n=!0){let r=await fetch(`/api/github/init-repo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e.trim(),repo_name:t.trim(),private:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.detail||`Failed to initialize repository (${r.status})`)}return await r.json()}async function p(e){let t=await fetch(`/api/github/push-solution`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.detail||`Failed to commit solution (${t.status})`)}return await t.json()}async function m(t,n,r=`main`){let{data:{session:i}}=await e.auth.getSession(),a=i?`Bearer ${i.access_token}`:`Bearer sandbox`,o=await fetch(`/api/github/sync-all`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:a},body:JSON.stringify({token:t.trim(),repo:n.trim(),branch:r.trim()})});if(!o.ok){let e=await o.json().catch(()=>({}));throw Error(e.detail||`Sync failed (${o.status})`)}return await o.json()}export{f as a,m as c,r as d,n as f,s as i,d as l,u as n,p as o,o as r,c as s,l as t,i as u};
 
1
+ import{i as e}from"./jsx-runtime-j9uSgrFF.js";import{G as t}from"./index-M1GCaKIP.js";var n=t(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),r=t(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),i=t(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),a={TOKEN:`algospaced_github_token`,USERNAME:`algospaced_github_username`,REPO:`algospaced_github_repo`,BRANCH:`algospaced_github_branch`,AUTOCOMMIT:`algospaced_github_autocommit`,PRIVATE:`algospaced_github_private`,AVATAR:`algospaced_github_avatar`,NAME:`algospaced_github_name`};function o(){return{token:localStorage.getItem(a.TOKEN)||``,username:localStorage.getItem(a.USERNAME)||``,repoName:localStorage.getItem(a.REPO)||`algospaced-solutions`,branch:localStorage.getItem(a.BRANCH)||`main`,autoCommit:localStorage.getItem(a.AUTOCOMMIT)!==`false`,isPrivate:localStorage.getItem(a.PRIVATE)!==`false`}}function s(){let e=localStorage.getItem(a.USERNAME);return e?{login:e,name:localStorage.getItem(a.NAME)||e,avatar_url:localStorage.getItem(a.AVATAR)||``,html_url:`https://github.com/${e}`}:null}function c(e,t){e.token!==void 0&&localStorage.setItem(a.TOKEN,e.token.trim()),e.username!==void 0&&localStorage.setItem(a.USERNAME,e.username.trim()),e.repoName!==void 0&&localStorage.setItem(a.REPO,e.repoName.trim()),e.branch!==void 0&&localStorage.setItem(a.BRANCH,e.branch.trim()),e.autoCommit!==void 0&&localStorage.setItem(a.AUTOCOMMIT,String(e.autoCommit)),e.isPrivate!==void 0&&localStorage.setItem(a.PRIVATE,String(e.isPrivate)),t&&(t.login&&localStorage.setItem(a.USERNAME,t.login),t.name&&localStorage.setItem(a.NAME,t.name),t.avatar_url&&localStorage.setItem(a.AVATAR,t.avatar_url))}function l(){Object.values(a).forEach(e=>localStorage.removeItem(e))}async function u(){let e=window.open(`/api/github/oauth/login`,`algospaced_github_oauth`,`width=600,height=750,menubar=no,toolbar=no,status=no,location=no`);if(!e)throw Error(`Popup window was blocked by your browser. Please allow popups for AlgoSpaced and try again.`);let t=await new Promise((t,n)=>{let r=null,i=()=>{window.removeEventListener(`message`,a),r!==null&&(clearInterval(r),r=null)},a=e=>{if(!e.data||typeof e.data!=`object`)return;let r=e.data;r.type===`GITHUB_OAUTH_SUCCESS`?(i(),r.token&&typeof r.token==`string`?t(r.token.trim()):n(Error(`GitHub authorization succeeded but no access token was returned.`))):r.type===`GITHUB_OAUTH_ERROR`&&(i(),n(Error(r.error||`GitHub authorization was denied or encountered an error.`)))};window.addEventListener(`message`,a),r=setInterval(()=>{e.closed&&(i(),n(Error(`GitHub authorization window was closed before completing.`)))},1e3)}),n=await d(t);if(!n.valid||!n.user)throw Error(n.error||`Failed to retrieve profile with GitHub token.`);let r=n.user;return c({token:t,username:r.login,repoName:o().repoName||`algospaced-solutions`},r),{token:t,user:r}}async function d(e){let t=await fetch(`/api/github/verify`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e.trim()})});return t.ok?await t.json():{valid:!1,error:(await t.json().catch(()=>({}))).detail||`Server returned error (${t.status})`}}async function f(e,t,n=!0){let r=await fetch(`/api/github/init-repo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:e.trim(),repo_name:t.trim(),private:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.detail||`Failed to initialize repository (${r.status})`)}return await r.json()}async function p(e){let t=await fetch(`/api/github/push-solution`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.detail||`Failed to commit solution (${t.status})`)}return await t.json()}async function m(t,n,r=`main`){let{data:{session:i}}=await e.auth.getSession(),a=i?`Bearer ${i.access_token}`:`Bearer sandbox`,o=await fetch(`/api/github/sync-all`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:a},body:JSON.stringify({token:t.trim(),repo:n.trim(),branch:r.trim()})});if(!o.ok){let e=await o.json().catch(()=>({}));throw Error(e.detail||`Sync failed (${o.status})`)}return await o.json()}export{f as a,m as c,r as d,n as f,s as i,d as l,u as n,p as o,o as r,c as s,l as t,i as u};
algospaced-ui/dist/assets/index-B05nv6MT.css DELETED
The diff for this file is too large to render. See raw diff
 
algospaced-ui/dist/assets/{index-V2pPJO9M.js → index-M1GCaKIP.js} RENAMED
The diff for this file is too large to render. See raw diff
 
algospaced-ui/dist/assets/index-hevgUcKQ.css ADDED
The diff for this file is too large to render. See raw diff
 
algospaced-ui/dist/assets/{info-CAmdZoA6.js → info-jE4ZFn-x.js} RENAMED
@@ -1 +1 @@
1
- import{G as e}from"./index-V2pPJO9M.js";var t=e(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]);export{t};
 
1
+ import{G as e}from"./index-M1GCaKIP.js";var t=e(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]);export{t};
algospaced-ui/dist/assets/{save-BgzMM0iu.js → save-zS5LwKaW.js} RENAMED
@@ -1 +1 @@
1
- import{G as e}from"./index-V2pPJO9M.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
 
1
+ import{G as e}from"./index-M1GCaKIP.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
algospaced-ui/dist/index.html CHANGED
@@ -13,9 +13,9 @@
13
  <link
14
  href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&amp;family=Be+Vietnam+Pro:wght@500;700&amp;family=Courier+Prime:wght@400;700&amp;family=Press+Start+2P&amp;family=Cinzel:wght@500;700;900&amp;family=Cinzel+Decorative:wght@700;900&amp;family=EB+Garamond:ital,wght@0,400;0,600;1,400;1,600&amp;family=Kalam:wght@400;700&amp;display=swap"
15
  rel="stylesheet" />
16
- <script type="module" crossorigin src="/assets/index-V2pPJO9M.js"></script>
17
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-j9uSgrFF.js">
18
- <link rel="stylesheet" crossorigin href="/assets/index-B05nv6MT.css">
19
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
20
 
21
  <body>
 
13
  <link
14
  href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&amp;family=Be+Vietnam+Pro:wght@500;700&amp;family=Courier+Prime:wght@400;700&amp;family=Press+Start+2P&amp;family=Cinzel:wght@500;700;900&amp;family=Cinzel+Decorative:wght@700;900&amp;family=EB+Garamond:ital,wght@0,400;0,600;1,400;1,600&amp;family=Kalam:wght@400;700&amp;display=swap"
15
  rel="stylesheet" />
16
+ <script type="module" crossorigin src="/assets/index-M1GCaKIP.js"></script>
17
  <link rel="modulepreload" crossorigin href="/assets/jsx-runtime-j9uSgrFF.js">
18
+ <link rel="stylesheet" crossorigin href="/assets/index-hevgUcKQ.css">
19
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
20
 
21
  <body>
algospaced-ui/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(n,i)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const t=s=>l(s,r),o={module:{uri:r},exports:u,require:t};e[r]=Promise.all(n.map(s=>o[s]||t(s))).then(s=>(i(...s),u))}}define(["./workbox-9c191d2f"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"834860cdeecf27887bf032636cab8c90"},{url:"assets/TerminalEmulator-CI1oWIOR.js",revision:null},{url:"assets/Settings-C3gzd0DF.js",revision:null},{url:"assets/save-BgzMM0iu.js",revision:null},{url:"assets/ReviewQueue-CYwGYMOV.js",revision:null},{url:"assets/PythonChallenge-3lpSHvfF.js",revision:null},{url:"assets/PrincessChamber-CXQLBBNW.js",revision:null},{url:"assets/MySQLPlayground-BdJWX3_8.js",revision:null},{url:"assets/jsx-runtime-j9uSgrFF.js",revision:null},{url:"assets/JourneyPath-BXnxFEFy.js",revision:null},{url:"assets/info-CAmdZoA6.js",revision:null},{url:"assets/index-V2pPJO9M.js",revision:null},{url:"assets/index-B05nv6MT.css",revision:null},{url:"assets/GitHubSyncWindow-Ca288SgB.js",revision:null},{url:"assets/githubSyncService-CsqBgIfT.js",revision:null},{url:"assets/FileExplorer-CRW7B6yJ.js",revision:null},{url:"assets/external-link-BGZfX5Bi.js",revision:null},{url:"assets/CreateProblemForm-Cu_hnDPM.js",revision:null},{url:"assets/confetti.module-nUzO7Zin.js",revision:null},{url:"assets/circle-alert-BL6bvZTM.js",revision:null},{url:"manifest.webmanifest",revision:"7c8ff056d2e188c868d851bcb349e28e"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))});
 
1
+ if(!self.define){let s,e={};const n=(n,l)=>(n=new URL(n+".js",l).href,e[n]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=n,s.onload=e,document.head.appendChild(s)}else s=n,importScripts(n),e()}).then(()=>{let s=e[n];if(!s)throw new Error(`Module ${n} didn’t register its module`);return s}));self.define=(l,r)=>{const i=s||("document"in self?document.currentScript.src:"")||location.href;if(e[i])return;let u={};const t=s=>n(s,i),o={module:{uri:i},exports:u,require:t};e[i]=Promise.all(l.map(s=>o[s]||t(s))).then(s=>(r(...s),u))}}define(["./workbox-9c191d2f"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"e29bb26b42705ebf3e3bb15cd5fa0758"},{url:"assets/TerminalEmulator-CI1oWIOR.js",revision:null},{url:"assets/Settings-5f8XTRov.js",revision:null},{url:"assets/save-zS5LwKaW.js",revision:null},{url:"assets/ReviewQueue-WbUnUC1g.js",revision:null},{url:"assets/PythonChallenge-BP6ASjZJ.js",revision:null},{url:"assets/PrincessChamber-BzhzFHRQ.js",revision:null},{url:"assets/MySQLPlayground-BdJWX3_8.js",revision:null},{url:"assets/MarkdownRenderer-DcpmP1uN.js",revision:null},{url:"assets/jsx-runtime-j9uSgrFF.js",revision:null},{url:"assets/JourneyPath-DytnV8uO.js",revision:null},{url:"assets/info-jE4ZFn-x.js",revision:null},{url:"assets/index-M1GCaKIP.js",revision:null},{url:"assets/index-hevgUcKQ.css",revision:null},{url:"assets/GitHubSyncWindow-Bkz4qSX5.js",revision:null},{url:"assets/githubSyncService-B4h5nigj.js",revision:null},{url:"assets/FileExplorer-CRW7B6yJ.js",revision:null},{url:"assets/external-link-64ub39jt.js",revision:null},{url:"assets/CreateProblemForm-Cu_hnDPM.js",revision:null},{url:"assets/confetti.module-BXT-TAy0.js",revision:null},{url:"assets/circle-alert-B3TumjQg.js",revision:null},{url:"manifest.webmanifest",revision:"7c8ff056d2e188c868d851bcb349e28e"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))});
algospaced-ui/src/components/MarkdownRenderer.tsx CHANGED
@@ -1,151 +1,11 @@
1
  import React from 'react';
2
- import katex from 'katex';
3
- import 'katex/dist/katex.min.css';
4
 
5
  interface MarkdownRendererProps {
6
  content: string;
7
  className?: string;
8
  }
9
 
10
- function renderKatex(math: string, displayMode: boolean = false): string {
11
- try {
12
- return katex.renderToString(math.trim(), {
13
- displayMode,
14
- throwOnError: false,
15
- output: 'htmlAndMathml'
16
- });
17
- } catch (err) {
18
- return math;
19
- }
20
- }
21
-
22
- /**
23
- * Tokenize and render inline text elements (inline math, code, bold, italic, links).
24
- */
25
- export function renderInlineMarkdown(text: string): React.ReactNode[] {
26
- if (!text) return [];
27
-
28
- // Regex matching inline tokens in order:
29
- // 1. Display math: $$ ... $$
30
- // 2. Display math: \[ ... \]
31
- // 3. Inline math: \( ... \)
32
- // 4. Inline math: $ ... $
33
- // 5. Inline code: ` ... `
34
- // 6. Bold: ** ... ** or __ ... __
35
- // 7. Italic: * ... * or _ ... _
36
- // 8. Link: [text](url)
37
- const tokenRegex = /(\$\$[\s\S]*?\$\$|\\\[[\s\S]*?\\\]|\\\([\s\S]*?\\\)|\$(?:\\\$|[^\$\n])+\$|`[^`\n]+`|\*\*[^\*\n]+\*\*|__[^\_\n]+__|(?<!\*)\*[^\*\n]+(?<!\*)\*|\[[^\]\n]+\]\([^)\n]+\))/g;
38
-
39
- const parts = text.split(tokenRegex);
40
-
41
- return parts.map((part, index) => {
42
- if (!part) return null;
43
-
44
- // 1. Display math $$ ... $$
45
- if (part.startsWith('$$') && part.endsWith('$$') && part.length >= 4) {
46
- const math = part.slice(2, -2);
47
- const html = renderKatex(math, true);
48
- return (
49
- <span
50
- key={index}
51
- className="inline-block my-1 px-1 overflow-x-auto align-middle"
52
- dangerouslySetInnerHTML={{ __html: html }}
53
- />
54
- );
55
- }
56
-
57
- // 2. Display math \[ ... \]
58
- if (part.startsWith('\\[') && part.endsWith('\\]') && part.length >= 4) {
59
- const math = part.slice(2, -2);
60
- const html = renderKatex(math, true);
61
- return (
62
- <span
63
- key={index}
64
- className="inline-block my-1 px-1 overflow-x-auto align-middle"
65
- dangerouslySetInnerHTML={{ __html: html }}
66
- />
67
- );
68
- }
69
-
70
- // 3. Inline math \( ... \)
71
- if (part.startsWith('\\(') && part.endsWith('\\)') && part.length >= 4) {
72
- const math = part.slice(2, -2);
73
- const html = renderKatex(math, false);
74
- return (
75
- <span
76
- key={index}
77
- className="inline-katex px-0.5 align-baseline"
78
- dangerouslySetInnerHTML={{ __html: html }}
79
- />
80
- );
81
- }
82
-
83
- // 4. Inline math $ ... $
84
- if (part.startsWith('$') && part.endsWith('$') && part.length >= 2) {
85
- const math = part.slice(1, -1);
86
- const html = renderKatex(math, false);
87
- return (
88
- <span
89
- key={index}
90
- className="inline-katex px-0.5 align-baseline"
91
- dangerouslySetInnerHTML={{ __html: html }}
92
- />
93
- );
94
- }
95
-
96
- // 5. Inline code ` ... `
97
- if (part.startsWith('`') && part.endsWith('`') && part.length >= 2) {
98
- return (
99
- <code
100
- key={index}
101
- className="bg-[#1E293B] text-[#4ADE80] px-1.5 py-0.5 rounded text-[11px] font-mono border border-ink-black shadow-[1px_1px_0px_0px_#000]"
102
- >
103
- {part.slice(1, -1)}
104
- </code>
105
- );
106
- }
107
-
108
- // 6. Bold ** ... ** or __ ... __
109
- if (
110
- (part.startsWith('**') && part.endsWith('**') && part.length >= 4) ||
111
- (part.startsWith('__') && part.endsWith('__') && part.length >= 4)
112
- ) {
113
- return (
114
- <strong key={index} className="text-ink-black font-extrabold">
115
- {renderInlineMarkdown(part.slice(2, -2))}
116
- </strong>
117
- );
118
- }
119
-
120
- // 7. Italic * ... *
121
- if (part.startsWith('*') && part.endsWith('*') && part.length >= 2) {
122
- return (
123
- <em key={index} className="italic text-slate-800">
124
- {renderInlineMarkdown(part.slice(1, -1))}
125
- </em>
126
- );
127
- }
128
-
129
- // 8. Link [text](url)
130
- const linkMatch = part.match(/^\[([^\]]+)\]\(([^)]+)\)$/);
131
- if (linkMatch) {
132
- return (
133
- <a
134
- key={index}
135
- href={linkMatch[2]}
136
- target="_blank"
137
- rel="noopener noreferrer"
138
- className="text-primary underline hover:text-primary/80 font-bold"
139
- >
140
- {linkMatch[1]}
141
- </a>
142
- );
143
- }
144
-
145
- return part;
146
- });
147
- }
148
-
149
  /**
150
  * Full Markdown + LaTeX component with retro aesthetic
151
  */
@@ -161,17 +21,16 @@ export const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ content, cla
161
  {blocks.map((block, blockIndex) => {
162
  if (!block) return null;
163
 
 
 
164
  // Code Block: ```lang ... ```
165
- if (block.startsWith('```') && block.endsWith('```')) {
166
- const firstLineEnd = block.indexOf('\n');
167
- let lang = '';
168
- let codeContent = '';
169
- if (firstLineEnd !== -1) {
170
- lang = block.slice(3, firstLineEnd).trim();
171
- codeContent = block.slice(firstLineEnd + 1, -3).trimEnd();
172
- } else {
173
- codeContent = block.slice(3, -3).trim();
174
- }
175
 
176
  return (
177
  <div
@@ -193,10 +52,10 @@ export const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ content, cla
193
 
194
  // Display Math Block: $$ ... $$ or \[ ... \]
195
  if (
196
- (block.startsWith('$$') && block.endsWith('$$')) ||
197
- (block.startsWith('\\[') && block.endsWith('\\]'))
198
  ) {
199
- const math = block.startsWith('$$') ? block.slice(2, -2) : block.slice(2, -2);
200
  const html = renderKatex(math, true);
201
  return (
202
  <div
@@ -275,38 +134,38 @@ export const MarkdownRenderer: React.FC<MarkdownRendererProps> = ({ content, cla
275
  }
276
 
277
  // Headings
278
- if (line.startsWith('#### ')) {
279
  renderedElements.push(
280
  <h4 key={lineKey} className="text-xs font-bold text-ink-black mt-3 mb-1 font-headline-md">
281
- {renderInlineMarkdown(line.substring(5))}
282
  </h4>
283
  );
284
  i++;
285
  continue;
286
  }
287
- if (line.startsWith('### ')) {
288
  renderedElements.push(
289
  <h3 key={lineKey} className="text-xs font-bold text-primary mt-4 mb-1.5 uppercase font-arcade tracking-wide flex items-center gap-1.5">
290
  <span className="w-2 h-2 bg-primary inline-block rounded-xs" />
291
- {renderInlineMarkdown(line.substring(4))}
292
  </h3>
293
  );
294
  i++;
295
  continue;
296
  }
297
- if (line.startsWith('## ')) {
298
  renderedElements.push(
299
  <h2 key={lineKey} className="text-sm font-extrabold text-ink-black mt-4 mb-2 font-headline-md border-b-2 border-ink-black pb-1">
300
- {renderInlineMarkdown(line.substring(3))}
301
  </h2>
302
  );
303
  i++;
304
  continue;
305
  }
306
- if (line.startsWith('# ')) {
307
  renderedElements.push(
308
  <h1 key={lineKey} className="text-base font-black text-ink-black mt-5 mb-2 font-headline-md">
309
- {renderInlineMarkdown(line.substring(2))}
310
  </h1>
311
  );
312
  i++;
 
1
  import React from 'react';
2
+ import { renderKatex, renderInlineMarkdown } from '../utils/markdownUtils';
 
3
 
4
  interface MarkdownRendererProps {
5
  content: string;
6
  className?: string;
7
  }
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  /**
10
  * Full Markdown + LaTeX component with retro aesthetic
11
  */
 
21
  {blocks.map((block, blockIndex) => {
22
  if (!block) return null;
23
 
24
+ const trimmedBlock = block.trim();
25
+
26
  // Code Block: ```lang ... ```
27
+ if (trimmedBlock.startsWith('```') && trimmedBlock.endsWith('```') && trimmedBlock.length >= 6) {
28
+ const firstLineEnd = trimmedBlock.indexOf('\n');
29
+ const lang = firstLineEnd !== -1 ? trimmedBlock.slice(3, firstLineEnd).trim() : '';
30
+ const codeContent =
31
+ firstLineEnd !== -1
32
+ ? trimmedBlock.slice(firstLineEnd + 1, -3).trimEnd()
33
+ : trimmedBlock.slice(3, -3).trim();
 
 
 
34
 
35
  return (
36
  <div
 
52
 
53
  // Display Math Block: $$ ... $$ or \[ ... \]
54
  if (
55
+ (trimmedBlock.startsWith('$$') && trimmedBlock.endsWith('$$') && trimmedBlock.length >= 4) ||
56
+ (trimmedBlock.startsWith('\\[') && trimmedBlock.endsWith('\\]') && trimmedBlock.length >= 4)
57
  ) {
58
+ const math = trimmedBlock.slice(2, -2);
59
  const html = renderKatex(math, true);
60
  return (
61
  <div
 
134
  }
135
 
136
  // Headings
137
+ if (trimmed.startsWith('#### ')) {
138
  renderedElements.push(
139
  <h4 key={lineKey} className="text-xs font-bold text-ink-black mt-3 mb-1 font-headline-md">
140
+ {renderInlineMarkdown(trimmed.substring(5))}
141
  </h4>
142
  );
143
  i++;
144
  continue;
145
  }
146
+ if (trimmed.startsWith('### ')) {
147
  renderedElements.push(
148
  <h3 key={lineKey} className="text-xs font-bold text-primary mt-4 mb-1.5 uppercase font-arcade tracking-wide flex items-center gap-1.5">
149
  <span className="w-2 h-2 bg-primary inline-block rounded-xs" />
150
+ {renderInlineMarkdown(trimmed.substring(4))}
151
  </h3>
152
  );
153
  i++;
154
  continue;
155
  }
156
+ if (trimmed.startsWith('## ')) {
157
  renderedElements.push(
158
  <h2 key={lineKey} className="text-sm font-extrabold text-ink-black mt-4 mb-2 font-headline-md border-b-2 border-ink-black pb-1">
159
+ {renderInlineMarkdown(trimmed.substring(3))}
160
  </h2>
161
  );
162
  i++;
163
  continue;
164
  }
165
+ if (trimmed.startsWith('# ')) {
166
  renderedElements.push(
167
  <h1 key={lineKey} className="text-base font-black text-ink-black mt-5 mb-2 font-headline-md">
168
+ {renderInlineMarkdown(trimmed.substring(2))}
169
  </h1>
170
  );
171
  i++;
algospaced-ui/src/components/ReviewQueue.tsx CHANGED
@@ -35,9 +35,22 @@ export default function ReviewQueue({
35
  onOpenOnboarding,
36
  refreshTrigger
37
  }: ReviewQueueProps) {
 
 
38
  const [leftTab, setLeftTab] = useState<'spec' | 'ref' | 'leitner'>('spec');
39
  const [mobileView, setMobileView] = useState<'spec' | 'code' | 'ref'>('spec');
40
  const [copiedSnippet, setCopiedSnippet] = useState<string | null>(null);
 
 
 
 
 
 
 
 
 
 
 
41
  const [isOnboardingOpen, setIsOnboardingOpen] = useState(false);
42
 
43
  const [isAutocompleteEnabled, setIsAutocompleteEnabled] = useState<boolean>(() => {
@@ -332,7 +345,7 @@ export default function ReviewQueue({
332
  const effectiveReferenceCode = userSolution || officialSolution || rawSavedCode || '';
333
 
334
  return (
335
- <div className="w-full h-full bg-[#fdf8e1] flex flex-col overflow-hidden select-none">
336
  {/* 1. TOP STATUS & QUEUE TRACKER STRIP */}
337
  <ReviewHeader
338
  problem={effectiveProblem}
@@ -346,45 +359,55 @@ export default function ReviewQueue({
346
  }}
347
  />
348
 
349
- {/* MOBILE / NARROW VIEW SWITCHER TABS (Shown below lg) */}
350
- <div className="lg:hidden shrink-0 bg-amber-100 border-b-[3px] border-ink-black px-3 py-1.5 flex gap-2 overflow-x-auto">
 
 
 
 
351
  <button
352
- onClick={() => setMobileView('spec')}
353
- className={`px-3 py-1 text-[9px] font-arcade font-bold border-2 border-ink-black transition-all cursor-pointer flex items-center gap-1.5 ${
 
 
 
354
  mobileView === 'spec'
355
  ? 'bg-paper-white translate-y-0.5 shadow-none text-ink-black'
356
  : 'bg-white shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] text-trash-gray'
357
  }`}
358
  >
359
- <FileText className="w-3 h-3" />
360
- SPEC
361
  </button>
362
  <button
363
  onClick={() => setMobileView('code')}
364
- className={`px-3 py-1 text-[9px] font-arcade font-bold border-2 border-ink-black transition-all cursor-pointer flex items-center gap-1.5 ${
365
  mobileView === 'code'
366
  ? 'bg-paper-white translate-y-0.5 shadow-none text-ink-black'
367
  : 'bg-white shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] text-trash-gray'
368
  }`}
369
  >
370
- <Code className="w-3 h-3" />
371
- CODE STUDIO
372
  </button>
373
  <button
374
- onClick={() => setMobileView('ref')}
375
- className={`px-3 py-1 text-[9px] font-arcade font-bold border-2 border-ink-black transition-all cursor-pointer flex items-center gap-1.5 ${
 
 
 
376
  mobileView === 'ref'
377
  ? 'bg-paper-white translate-y-0.5 shadow-none text-ink-black'
378
  : 'bg-white shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] text-trash-gray'
379
  }`}
380
  >
381
- <BookOpen className="w-3 h-3" />
382
- SOLUTION
383
  </button>
384
  </div>
385
 
386
  {/* 2. MAIN TWO-PANE WORKSTATION */}
387
- <div className="flex-1 flex flex-col lg:flex-row overflow-hidden">
388
  <ProblemSpecPanel
389
  leftTab={leftTab}
390
  onSelectLeftTab={(tab) => {
@@ -393,6 +416,7 @@ export default function ReviewQueue({
393
  else if (tab === 'spec') setMobileView('spec');
394
  }}
395
  mobileView={mobileView}
 
396
  problem={effectiveProblem}
397
  parsed={parsed}
398
  userSolution={userSolution}
@@ -437,6 +461,7 @@ export default function ReviewQueue({
437
 
438
  <CodeStudioPanel
439
  mobileView={mobileView}
 
440
  isAutocompleteEnabled={isAutocompleteEnabled}
441
  onToggleAutocomplete={(enabled) => {
442
  setIsAutocompleteEnabled(enabled);
 
35
  onOpenOnboarding,
36
  refreshTrigger
37
  }: ReviewQueueProps) {
38
+ const [containerWidth, setContainerWidth] = useState<number | null>(null);
39
+ const isNarrow = containerWidth !== null ? containerWidth < 780 : false;
40
  const [leftTab, setLeftTab] = useState<'spec' | 'ref' | 'leitner'>('spec');
41
  const [mobileView, setMobileView] = useState<'spec' | 'code' | 'ref'>('spec');
42
  const [copiedSnippet, setCopiedSnippet] = useState<string | null>(null);
43
+
44
+ const containerCallbackRef = useCallback((node: HTMLDivElement | null) => {
45
+ if (!node) return;
46
+ setContainerWidth(node.clientWidth);
47
+ const observer = new ResizeObserver((entries) => {
48
+ for (const entry of entries) {
49
+ setContainerWidth(entry.contentRect.width);
50
+ }
51
+ });
52
+ observer.observe(node);
53
+ }, []);
54
  const [isOnboardingOpen, setIsOnboardingOpen] = useState(false);
55
 
56
  const [isAutocompleteEnabled, setIsAutocompleteEnabled] = useState<boolean>(() => {
 
345
  const effectiveReferenceCode = userSolution || officialSolution || rawSavedCode || '';
346
 
347
  return (
348
+ <div ref={containerCallbackRef} className="w-full h-full bg-[#fdf8e1] flex flex-col overflow-hidden select-none">
349
  {/* 1. TOP STATUS & QUEUE TRACKER STRIP */}
350
  <ReviewHeader
351
  problem={effectiveProblem}
 
359
  }}
360
  />
361
 
362
+ {/* MOBILE / NARROW VIEW SWITCHER TABS */}
363
+ <div
364
+ className={`${
365
+ isNarrow ? 'flex' : 'hidden'
366
+ } shrink-0 bg-amber-100 border-b-[3px] border-ink-black px-2.5 sm:px-3 py-1.5 gap-1.5 sm:gap-2 overflow-x-auto no-scrollbar`}
367
+ >
368
  <button
369
+ onClick={() => {
370
+ setMobileView('spec');
371
+ setLeftTab('spec');
372
+ }}
373
+ className={`px-2.5 sm:px-3 py-1 text-[9px] font-arcade font-bold border-2 border-ink-black transition-all cursor-pointer flex items-center gap-1.5 whitespace-nowrap ${
374
  mobileView === 'spec'
375
  ? 'bg-paper-white translate-y-0.5 shadow-none text-ink-black'
376
  : 'bg-white shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] text-trash-gray'
377
  }`}
378
  >
379
+ <FileText className="w-3 h-3 shrink-0" />
380
+ <span>SPEC</span>
381
  </button>
382
  <button
383
  onClick={() => setMobileView('code')}
384
+ className={`px-2.5 sm:px-3 py-1 text-[9px] font-arcade font-bold border-2 border-ink-black transition-all cursor-pointer flex items-center gap-1.5 whitespace-nowrap ${
385
  mobileView === 'code'
386
  ? 'bg-paper-white translate-y-0.5 shadow-none text-ink-black'
387
  : 'bg-white shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] text-trash-gray'
388
  }`}
389
  >
390
+ <Code className="w-3 h-3 shrink-0" />
391
+ <span>CODE STUDIO</span>
392
  </button>
393
  <button
394
+ onClick={() => {
395
+ setMobileView('ref');
396
+ setLeftTab('ref');
397
+ }}
398
+ className={`px-2.5 sm:px-3 py-1 text-[9px] font-arcade font-bold border-2 border-ink-black transition-all cursor-pointer flex items-center gap-1.5 whitespace-nowrap ${
399
  mobileView === 'ref'
400
  ? 'bg-paper-white translate-y-0.5 shadow-none text-ink-black'
401
  : 'bg-white shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] text-trash-gray'
402
  }`}
403
  >
404
+ <BookOpen className="w-3 h-3 shrink-0" />
405
+ <span>SOLUTION</span>
406
  </button>
407
  </div>
408
 
409
  {/* 2. MAIN TWO-PANE WORKSTATION */}
410
+ <div className={`flex-1 flex ${isNarrow ? 'flex-col' : 'flex-row'} overflow-hidden min-h-0`}>
411
  <ProblemSpecPanel
412
  leftTab={leftTab}
413
  onSelectLeftTab={(tab) => {
 
416
  else if (tab === 'spec') setMobileView('spec');
417
  }}
418
  mobileView={mobileView}
419
+ isNarrow={isNarrow}
420
  problem={effectiveProblem}
421
  parsed={parsed}
422
  userSolution={userSolution}
 
461
 
462
  <CodeStudioPanel
463
  mobileView={mobileView}
464
+ isNarrow={isNarrow}
465
  isAutocompleteEnabled={isAutocompleteEnabled}
466
  onToggleAutocomplete={(enabled) => {
467
  setIsAutocompleteEnabled(enabled);
algospaced-ui/src/components/WindowShell.tsx CHANGED
@@ -14,6 +14,8 @@ interface WindowShellProps {
14
  icon?: string;
15
  defaultWidth?: string;
16
  defaultHeight?: string;
 
 
17
  defaultX?: number;
18
  defaultY?: number;
19
  titleBarColor?: string;
@@ -33,6 +35,8 @@ export default function WindowShell({
33
  icon = 'terminal',
34
  defaultWidth = '700px',
35
  defaultHeight = '600px',
 
 
36
  defaultX,
37
  defaultY,
38
  titleBarColor = '#0ea5e9',
@@ -109,9 +113,9 @@ export default function WindowShell({
109
  const deltaX = e.clientX - resizeStart.current.x;
110
  const deltaY = e.clientY - resizeStart.current.y;
111
 
112
- // Enforce minimum dimensions (350x250 px)
113
- const newWidth = Math.max(350, resizeStart.current.width + deltaX);
114
- const newHeight = Math.max(250, resizeStart.current.height + deltaY);
115
 
116
  setDimensions({
117
  width: newWidth,
@@ -134,7 +138,7 @@ export default function WindowShell({
134
  document.removeEventListener('mousemove', handleMouseMove);
135
  document.removeEventListener('mouseup', handleMouseUp);
136
  };
137
- }, [isDragging, isResizing, isMobile]);
138
 
139
  if (!isOpen || isMinimized) return null;
140
 
 
14
  icon?: string;
15
  defaultWidth?: string;
16
  defaultHeight?: string;
17
+ minWidth?: number;
18
+ minHeight?: number;
19
  defaultX?: number;
20
  defaultY?: number;
21
  titleBarColor?: string;
 
35
  icon = 'terminal',
36
  defaultWidth = '700px',
37
  defaultHeight = '600px',
38
+ minWidth = 380,
39
+ minHeight = 280,
40
  defaultX,
41
  defaultY,
42
  titleBarColor = '#0ea5e9',
 
113
  const deltaX = e.clientX - resizeStart.current.x;
114
  const deltaY = e.clientY - resizeStart.current.y;
115
 
116
+ // Enforce minimum dimensions
117
+ const newWidth = Math.max(minWidth, resizeStart.current.width + deltaX);
118
+ const newHeight = Math.max(minHeight, resizeStart.current.height + deltaY);
119
 
120
  setDimensions({
121
  width: newWidth,
 
138
  document.removeEventListener('mousemove', handleMouseMove);
139
  document.removeEventListener('mouseup', handleMouseUp);
140
  };
141
+ }, [isDragging, isResizing, isMobile, minWidth, minHeight]);
142
 
143
  if (!isOpen || isMinimized) return null;
144
 
algospaced-ui/src/components/desktop/DesktopWindowContainer.tsx CHANGED
@@ -80,6 +80,8 @@ export const DesktopWindowContainer: React.FC<DesktopWindowContainerProps> = ({
80
  setActiveWindow={setActiveWindow}
81
  defaultWidth="980px"
82
  defaultHeight="680px"
 
 
83
  isMobile={isMobile}
84
  >
85
  <Suspense
 
80
  setActiveWindow={setActiveWindow}
81
  defaultWidth="980px"
82
  defaultHeight="680px"
83
+ minWidth={440}
84
+ minHeight={360}
85
  isMobile={isMobile}
86
  >
87
  <Suspense
algospaced-ui/src/components/review/CodeStudioPanel.tsx CHANGED
@@ -59,6 +59,7 @@ interface CodeStudioPanelProps {
59
  onAiEvaluation: () => void;
60
  optimalTime: string;
61
  optimalSpace: string;
 
62
  onPushToGitHub?: () => void;
63
  pushingToGitHub?: boolean;
64
  githubPushedUrl?: string | null;
@@ -67,6 +68,7 @@ interface CodeStudioPanelProps {
67
 
68
  export const CodeStudioPanel: React.FC<CodeStudioPanelProps> = ({
69
  mobileView,
 
70
  isAutocompleteEnabled,
71
  onToggleAutocomplete,
72
  onResetStarterCode,
@@ -118,69 +120,75 @@ export const CodeStudioPanel: React.FC<CodeStudioPanelProps> = ({
118
 
119
  return (
120
  <div
121
- className={`w-full lg:w-[54%] flex flex-col bg-[#fffdfa] overflow-y-auto custom-scrollbar ${
122
- mobileView !== 'code' ? 'hidden lg:flex' : 'flex'
 
 
123
  }`}
124
  >
125
  {/* Studio Toolbar */}
126
- <div className="shrink-0 bg-[#f7f5ed] border-b-2 border-ink-black p-2 sm:px-4 flex flex-wrap items-center justify-between gap-2">
127
- {/* Language Selector Dropdown */}
128
- <div className="relative" ref={langDropdownRef}>
129
- <button
130
- type="button"
131
- onClick={() => setIsLangDropdownOpen((prev) => !prev)}
132
- className="h-7 px-2.5 bg-white hover:bg-slate-100 border-2 border-ink-black shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none flex items-center gap-1.5 font-arcade text-[9px] font-bold text-ink-black cursor-pointer transition-all select-none"
133
- title="Select programming language"
134
- aria-expanded={isLangDropdownOpen}
135
- aria-haspopup="listbox"
136
- >
137
- <PythonLogo className="w-3.5 h-3.5 shrink-0" />
138
- <span>{currentLang.name}</span>
139
- <ChevronDown className={`w-3 h-3 text-ink-black transition-transform duration-150 ${isLangDropdownOpen ? 'rotate-180' : ''}`} />
140
- </button>
141
-
142
- {/* Dropdown Menu */}
143
- {isLangDropdownOpen && (
144
- <div
145
- className="absolute top-full mt-1.5 left-0 z-50 w-52 bg-paper-white border-[3px] border-ink-black gadget-shadow p-1.5 space-y-1"
146
- role="listbox"
147
  >
148
- <div className="px-2 py-1 text-[8px] font-arcade font-bold text-trash-gray uppercase border-b border-slate-200">
149
- SELECT LANGUAGE
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  </div>
151
- {AVAILABLE_LANGUAGES.map((lang) => {
152
- const isSelected = selectedLanguage === lang.id;
153
- return (
154
- <button
155
- key={lang.id}
156
- type="button"
157
- role="option"
158
- aria-selected={isSelected}
159
- onClick={() => {
160
- setSelectedLanguage(lang.id);
161
- setIsLangDropdownOpen(false);
162
- }}
163
- className={`w-full flex items-center justify-between px-2.5 py-1.5 border-2 border-ink-black text-left transition-all cursor-pointer ${
164
- isSelected
165
- ? 'bg-amber-200 shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] font-bold text-ink-black'
166
- : 'bg-white hover:bg-slate-100 text-slate-800'
167
- }`}
168
- >
169
- <div className="flex items-center gap-1.5 font-arcade text-[9px]">
170
- <PythonLogo className="w-3.5 h-3.5 shrink-0" />
171
- <span>{lang.name}</span>
172
- </div>
173
- <span className="font-mono text-[8px] font-bold px-1.5 py-0.5 bg-white border border-ink-black text-slate-700 shadow-[1px_1px_0px_0px_rgba(30,41,59,0.3)]">
174
- v{lang.version}
175
- </span>
176
- </button>
177
- );
178
- })}
179
- </div>
180
- )}
181
- </div>
182
- {/* Quick Actions & Autocomplete */}
183
- <div className="flex items-center gap-1.5 sm:gap-2 flex-wrap">
184
  <label className="inline-flex items-center gap-1.5 cursor-pointer select-none">
185
  <input
186
  type="checkbox"
@@ -189,13 +197,14 @@ export const CodeStudioPanel: React.FC<CodeStudioPanelProps> = ({
189
  className="sr-only peer"
190
  />
191
  <div className="relative w-7 h-3.5 bg-slate-300 border border-ink-black rounded-full peer peer-checked:bg-grass-green transition-all after:content-[''] after:absolute after:top-[1px] after:left-[2px] after:bg-white after:border after:border-ink-black after:rounded-full after:h-2 after:w-2 after:transition-all peer-checked:after:translate-x-3"></div>
192
- <span className="text-[8px] font-arcade font-bold text-trash-gray peer-checked:text-ink-black">
193
  AUTOCOMPLETE
194
  </span>
195
  </label>
 
196
 
197
- <div className="h-4 w-[2px] bg-slate-300 mx-0.5 hidden sm:block" />
198
-
199
  {/* Reset Starter Code */}
200
  <button
201
  onClick={onResetStarterCode}
@@ -216,38 +225,6 @@ export const CodeStudioPanel: React.FC<CodeStudioPanelProps> = ({
216
  <Trash2 className="w-3.5 h-3.5 text-rose-600" />
217
  </button>
218
 
219
- <div className="h-4 w-[2px] bg-slate-300 mx-0.5 hidden sm:block" />
220
-
221
- {/* Run Tests (Local Python Sandbox) */}
222
- <button
223
- onClick={onRunSandbox}
224
- disabled={sandboxRunning || !code.trim()}
225
- className="w-7 h-7 bg-emerald-600 hover:bg-emerald-500 border-2 border-ink-black shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none text-white flex items-center justify-center cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed transition-all"
226
- title={sandboxRunning ? 'Running sandbox tests...' : 'Run tests in local sandbox (zero tokens)'}
227
- aria-label="Run tests"
228
- >
229
- {sandboxRunning ? (
230
- <RefreshCw className="w-3.5 h-3.5 animate-spin" />
231
- ) : (
232
- <Play className="w-3.5 h-3.5 fill-white text-white ml-0.5" />
233
- )}
234
- </button>
235
-
236
- {/* Gemini AI Evaluation */}
237
- <button
238
- onClick={onAiEvaluation}
239
- disabled={aiLoading || !code.trim()}
240
- className="w-7 h-7 bg-purple-600 hover:bg-purple-500 border-2 border-ink-black shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none text-white flex items-center justify-center cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed transition-all"
241
- title={aiLoading ? 'Evaluating code with Gemini...' : 'Gemini Eval (AI code review & complexity)'}
242
- aria-label="Gemini Eval"
243
- >
244
- {aiLoading ? (
245
- <RefreshCw className="w-3.5 h-3.5 animate-spin" />
246
- ) : (
247
- <Sparkles className="w-3.5 h-3.5 text-amber-300" />
248
- )}
249
- </button>
250
-
251
  {/* Overwrite / Save Solution with Studio Code */}
252
  {onSaveReference && (
253
  <button
@@ -294,6 +271,39 @@ export const CodeStudioPanel: React.FC<CodeStudioPanelProps> = ({
294
  </button>
295
  )}
296
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  </div>
298
 
299
  <div className="p-4 sm:p-5 flex-1 flex flex-col space-y-4">
 
59
  onAiEvaluation: () => void;
60
  optimalTime: string;
61
  optimalSpace: string;
62
+ isNarrow?: boolean;
63
  onPushToGitHub?: () => void;
64
  pushingToGitHub?: boolean;
65
  githubPushedUrl?: string | null;
 
68
 
69
  export const CodeStudioPanel: React.FC<CodeStudioPanelProps> = ({
70
  mobileView,
71
+ isNarrow = false,
72
  isAutocompleteEnabled,
73
  onToggleAutocomplete,
74
  onResetStarterCode,
 
120
 
121
  return (
122
  <div
123
+ className={`w-full ${
124
+ isNarrow ? 'flex flex-1' : 'lg:w-[51%] flex'
125
+ } flex-col bg-[#fffdfa] overflow-y-auto no-scrollbar ${
126
+ isNarrow && mobileView !== 'code' ? 'hidden' : 'flex'
127
  }`}
128
  >
129
  {/* Studio Toolbar */}
130
+ <div className="shrink-0 bg-[#f7f5ed] border-b-2 border-ink-black p-2 sm:px-3 flex flex-wrap items-center justify-between gap-1.5 sm:gap-2">
131
+ {/* Left: Language Selector & Autocomplete */}
132
+ <div className="flex items-center gap-1.5 sm:gap-2 flex-wrap">
133
+ {/* Language Selector Dropdown */}
134
+ <div className="relative" ref={langDropdownRef}>
135
+ <button
136
+ type="button"
137
+ onClick={() => setIsLangDropdownOpen((prev) => !prev)}
138
+ className="h-7 px-2.5 bg-white hover:bg-slate-100 border-2 border-ink-black shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none flex items-center gap-1.5 font-arcade text-[9px] font-bold text-ink-black cursor-pointer transition-all select-none"
139
+ title="Select programming language"
140
+ aria-expanded={isLangDropdownOpen}
141
+ aria-haspopup="listbox"
 
 
 
 
 
 
 
 
 
142
  >
143
+ <PythonLogo className="w-3.5 h-3.5 shrink-0" />
144
+ <span>{currentLang.name}</span>
145
+ <ChevronDown className={`w-3 h-3 text-ink-black transition-transform duration-150 ${isLangDropdownOpen ? 'rotate-180' : ''}`} />
146
+ </button>
147
+
148
+ {/* Dropdown Menu */}
149
+ {isLangDropdownOpen && (
150
+ <div
151
+ className="absolute top-full mt-1.5 left-0 z-50 w-52 bg-paper-white border-[3px] border-ink-black gadget-shadow p-1.5 space-y-1"
152
+ role="listbox"
153
+ >
154
+ <div className="px-2 py-1 text-[8px] font-arcade font-bold text-trash-gray uppercase border-b border-slate-200">
155
+ SELECT LANGUAGE
156
+ </div>
157
+ {AVAILABLE_LANGUAGES.map((lang) => {
158
+ const isSelected = selectedLanguage === lang.id;
159
+ return (
160
+ <button
161
+ key={lang.id}
162
+ type="button"
163
+ role="option"
164
+ aria-selected={isSelected}
165
+ onClick={() => {
166
+ setSelectedLanguage(lang.id);
167
+ setIsLangDropdownOpen(false);
168
+ }}
169
+ className={`w-full flex items-center justify-between px-2.5 py-1.5 border-2 border-ink-black text-left transition-all cursor-pointer ${
170
+ isSelected
171
+ ? 'bg-amber-200 shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] font-bold text-ink-black'
172
+ : 'bg-white hover:bg-slate-100 text-slate-800'
173
+ }`}
174
+ >
175
+ <div className="flex items-center gap-1.5 font-arcade text-[9px]">
176
+ <PythonLogo className="w-3.5 h-3.5 shrink-0" />
177
+ <span>{lang.name}</span>
178
+ </div>
179
+ <span className="font-mono text-[8px] font-bold px-1.5 py-0.5 bg-white border border-ink-black text-slate-700 shadow-[1px_1px_0px_0px_rgba(30,41,59,0.3)]">
180
+ v{lang.version}
181
+ </span>
182
+ </button>
183
+ );
184
+ })}
185
  </div>
186
+ )}
187
+ </div>
188
+
189
+ <div className="h-4 w-[2px] bg-slate-300 mx-0.5 hidden sm:block" />
190
+
191
+ {/* Autocomplete Toggle */}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  <label className="inline-flex items-center gap-1.5 cursor-pointer select-none">
193
  <input
194
  type="checkbox"
 
197
  className="sr-only peer"
198
  />
199
  <div className="relative w-7 h-3.5 bg-slate-300 border border-ink-black rounded-full peer peer-checked:bg-grass-green transition-all after:content-[''] after:absolute after:top-[1px] after:left-[2px] after:bg-white after:border after:border-ink-black after:rounded-full after:h-2 after:w-2 after:transition-all peer-checked:after:translate-x-3"></div>
200
+ <span className="text-[7.5px] min-[400px]:text-[8px] font-arcade font-bold text-trash-gray peer-checked:text-ink-black whitespace-nowrap">
201
  AUTOCOMPLETE
202
  </span>
203
  </label>
204
+ </div>
205
 
206
+ {/* Middle: Secondary Tools (Reset, Delete, Save, GitHub) */}
207
+ <div className="flex items-center gap-1.5 sm:gap-2">
208
  {/* Reset Starter Code */}
209
  <button
210
  onClick={onResetStarterCode}
 
225
  <Trash2 className="w-3.5 h-3.5 text-rose-600" />
226
  </button>
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  {/* Overwrite / Save Solution with Studio Code */}
229
  {onSaveReference && (
230
  <button
 
271
  </button>
272
  )}
273
  </div>
274
+
275
+ {/* Right: Primary Actions (Run & Gemini Eval) */}
276
+ <div className="flex items-center gap-1.5 sm:gap-2">
277
+ {/* Run Tests (Local Python Sandbox) */}
278
+ <button
279
+ onClick={onRunSandbox}
280
+ disabled={sandboxRunning || !code.trim()}
281
+ className="w-7 h-7 bg-emerald-600 hover:bg-emerald-500 border-2 border-ink-black shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none text-white flex items-center justify-center cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed transition-all"
282
+ title={sandboxRunning ? 'Running sandbox tests...' : 'Run tests in local sandbox (zero tokens)'}
283
+ aria-label="Run tests"
284
+ >
285
+ {sandboxRunning ? (
286
+ <RefreshCw className="w-3.5 h-3.5 animate-spin" />
287
+ ) : (
288
+ <Play className="w-3.5 h-3.5 fill-white text-white ml-0.5" />
289
+ )}
290
+ </button>
291
+
292
+ {/* Gemini AI Evaluation */}
293
+ <button
294
+ onClick={onAiEvaluation}
295
+ disabled={aiLoading || !code.trim()}
296
+ className="w-7 h-7 bg-purple-600 hover:bg-purple-500 border-2 border-ink-black shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none text-white flex items-center justify-center cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed transition-all"
297
+ title={aiLoading ? 'Evaluating code with Gemini...' : 'Gemini Eval (AI code review & complexity)'}
298
+ aria-label="Gemini Eval"
299
+ >
300
+ {aiLoading ? (
301
+ <RefreshCw className="w-3.5 h-3.5 animate-spin" />
302
+ ) : (
303
+ <Sparkles className="w-3.5 h-3.5 text-amber-300" />
304
+ )}
305
+ </button>
306
+ </div>
307
  </div>
308
 
309
  <div className="p-4 sm:p-5 flex-1 flex flex-col space-y-4">
algospaced-ui/src/components/review/ProblemSpecPanel.tsx CHANGED
@@ -21,7 +21,8 @@ import {
21
  X
22
  } from 'lucide-react';
23
  import type { ProblemItem, ReviewItem, ParsedExample, ProblemSolution } from '../../types/reviewTypes';
24
- import { renderInlineMarkdown, parseMarkdown, normalizeProblemSolutions } from '../../utils/problemContentParser';
 
25
  import { updateProblemSolutions } from '../../services/reviewService';
26
 
27
  const COMMON_PATTERNS = [
@@ -49,6 +50,7 @@ interface ProblemSpecPanelProps {
49
  leftTab: 'spec' | 'ref' | 'leitner';
50
  onSelectLeftTab: (tab: 'spec' | 'ref' | 'leitner') => void;
51
  mobileView: 'spec' | 'code' | 'ref';
 
52
  problem: ProblemItem;
53
  parsed: {
54
  description: string;
@@ -84,6 +86,7 @@ export const ProblemSpecPanel: React.FC<ProblemSpecPanelProps> = ({
84
  leftTab,
85
  onSelectLeftTab,
86
  mobileView,
 
87
  problem,
88
  parsed,
89
  userSolution,
@@ -290,183 +293,165 @@ export const ProblemSpecPanel: React.FC<ProblemSpecPanelProps> = ({
290
  }
291
  };
292
 
 
 
 
 
 
 
 
293
  return (
294
  <div
295
- className={`w-full lg:w-[46%] flex flex-col bg-paper-white border-b-[3px] lg:border-b-0 lg:border-r-[3px] border-ink-black overflow-hidden ${
296
- mobileView !== 'spec' && mobileView !== 'ref' ? 'hidden lg:flex' : 'flex'
 
 
 
 
297
  }`}
298
  >
299
  {/* Sub-tab strip */}
300
- <div className="shrink-0 bg-[#f4f1ea] border-b-2 border-ink-black px-3 pt-2 flex items-end gap-1.5 font-arcade text-[9px]">
301
  <button
302
  onClick={() => onSelectLeftTab('spec')}
303
- className={`h-11 px-3 border-t-2 border-x-2 border-ink-black cursor-pointer font-bold transition-all flex items-center justify-center gap-1.5 focus:outline-none focus-visible:outline-none ${
304
- leftTab === 'spec'
305
- ? 'bg-paper-white text-ink-black -mb-[2px] pb-2 font-extrabold shadow-[0_-2px_0_0_rgba(30,41,59,0.1)] relative z-10 border-b-2 border-b-paper-white'
306
- : 'bg-slate-200 text-trash-gray hover:bg-slate-100 hover:text-ink-black border-b-2 border-b-ink-black'
307
- }`}
308
  >
309
- <FileText className="w-3.5 h-3.5 text-purple-700 shrink-0" />
310
- <span>SPECIFICATION</span>
311
  </button>
312
  <button
313
  onClick={() => onSelectLeftTab('ref')}
314
- className={`h-11 px-3 border-t-2 border-x-2 border-ink-black cursor-pointer font-bold transition-all flex items-center justify-center gap-1.5 focus:outline-none focus-visible:outline-none ${
315
- leftTab === 'ref'
316
- ? 'bg-paper-white text-ink-black -mb-[2px] pb-2 font-extrabold shadow-[0_-2px_0_0_rgba(30,41,59,0.1)] relative z-10 border-b-2 border-b-paper-white'
317
- : 'bg-slate-200 text-trash-gray hover:bg-slate-100 hover:text-ink-black border-b-2 border-b-ink-black'
318
- }`}
319
  >
320
- <Code className="w-3.5 h-3.5 text-blue-700 shrink-0" />
321
- <span className="text-center leading-tight">SOLUTIONS ({solutions.length})</span>
322
  </button>
323
  <button
324
  onClick={() => onSelectLeftTab('leitner')}
325
- className={`h-11 px-3 border-t-2 border-x-2 border-ink-black cursor-pointer font-bold transition-all flex items-center justify-center gap-1.5 focus:outline-none focus-visible:outline-none ${
326
- leftTab === 'leitner'
327
- ? 'bg-paper-white text-ink-black -mb-[2px] pb-2 font-extrabold shadow-[0_-2px_0_0_rgba(30,41,59,0.1)] relative z-10 border-b-2 border-b-paper-white'
328
- : 'bg-slate-200 text-trash-gray hover:bg-slate-100 hover:text-ink-black border-b-2 border-b-ink-black'
329
- }`}
330
  >
331
- <TrendingUp className="w-3.5 h-3.5 text-emerald-700 shrink-0" />
332
- <span className="text-center leading-tight">FSRS<br />STATS</span>
333
  </button>
334
  </div>
335
 
336
  {/* Dossier Scroll Area */}
337
- <div className="flex-1 overflow-y-auto custom-scrollbar p-4 sm:p-5 space-y-4">
338
  {/* SUBTAB 1: PROBLEM SPEC (Active Recall Mode - No Spoilers!) */}
339
  {leftTab === 'spec' && (
340
  <div className="space-y-4">
341
- {/* 1. Problem Title Header Banner */}
342
- <div className="p-4 bg-white border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] space-y-1.5">
343
- <div className="flex items-center justify-between gap-3">
 
344
  <h2 className="text-base sm:text-lg font-extrabold text-ink-black font-headline-md leading-tight m-0 select-text">
345
  {problem.name || 'Algorithm Problem'}
346
  </h2>
347
- <div className="flex items-center gap-1.5 shrink-0">
348
- {problem.problem_number !== undefined && problem.problem_number !== null && (
349
- <span className="font-arcade text-[9px] font-bold px-2 py-0.5 bg-amber-200 border border-ink-black text-ink-black">
350
- LC #{problem.problem_number}
351
- </span>
352
- )}
353
- <span
354
- className={`font-arcade text-[9px] font-bold px-2 py-0.5 border border-ink-black text-white ${
355
- problem.difficulty === 'Easy'
356
- ? 'bg-emerald-500'
357
- : problem.difficulty === 'Medium'
358
- ? 'bg-amber-500'
359
- : 'bg-rose-500'
360
- }`}
361
- >
362
- {problem.difficulty ? problem.difficulty.toUpperCase() : 'MEDIUM'}
363
- </span>
364
- </div>
365
  </div>
366
- </div>
367
 
368
- {/* Problem Description */}
369
- {parsed.description && (
370
- <div className="p-4 bg-white border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)]">
371
- <div className="text-[9px] font-arcade text-trash-gray uppercase font-bold mb-2 flex items-center gap-1">
372
- <BookOpen className="w-3 h-3 text-primary" />
373
- PROBLEM DESCRIPTION
374
- </div>
375
- <div className="font-sans text-xs sm:text-[13px] text-slate-800 leading-relaxed space-y-2 font-medium">
376
- {parsed.description.split('\n').map((line: string, idx: number) =>
377
- line.trim() ? (
378
- <p key={idx} className="m-0 leading-relaxed whitespace-pre-wrap select-text">
379
- {renderInlineMarkdown(line)}
380
- </p>
381
- ) : (
382
- <div key={idx} className="h-1.5" />
383
- )
384
- )}
 
385
  </div>
386
- </div>
387
- )}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
 
389
- {/* Structured Examples */}
390
- {parsed.examples.length > 0 && (
391
- <div className="space-y-2.5">
392
- <div className="text-[9px] font-arcade text-trash-gray uppercase font-bold flex items-center gap-1.5">
393
- <Zap className="w-3 h-3 text-amber-500" />
394
- EXAMPLES ({parsed.examples.length})
395
- </div>
396
- <div className="space-y-2.5">
397
- {parsed.examples.map((ex, i) => (
398
- <div
399
- key={i}
400
- className="p-3 bg-white border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] space-y-2 text-xs"
401
- >
402
- <div className="flex items-center justify-between">
403
- <span className="font-arcade text-[9px] font-bold text-primary">
404
- EXAMPLE {i + 1}
405
- </span>
406
  {ex.input && (
407
- <button
408
- onClick={() => onCopyText(ex.input, `ex-${i}`)}
409
- className="px-2 py-0.5 bg-slate-100 hover:bg-slate-200 border border-ink-black text-[9px] font-arcade text-ink-black flex items-center gap-1 cursor-pointer"
410
- title="Copy input data"
411
- >
412
- <Copy className="w-2.5 h-2.5" />
413
- {copiedSnippet === `ex-${i}` ? 'COPIED!' : 'COPY'}
414
- </button>
415
  )}
416
- </div>
417
 
418
- {ex.input && (
419
- <div className="space-y-1">
420
- <span className="text-[9px] font-arcade text-trash-gray font-bold uppercase block">
421
- Input:
422
- </span>
423
- <div className="bg-[#1E293B] text-[#4ADE80] font-code-mono p-2 border border-ink-black text-[11px] break-all select-text">
424
- {ex.input}
 
425
  </div>
426
- </div>
427
- )}
428
 
429
- {ex.output && (
430
- <div className="space-y-1">
431
- <span className="text-[9px] font-arcade text-trash-gray font-bold uppercase block">
432
- Output:
433
- </span>
434
- <div className="bg-[#1E293B] text-[#4ADE80] font-code-mono p-2 border border-ink-black text-[11px] break-all select-text">
435
- {ex.output}
436
  </div>
437
- </div>
438
- )}
439
-
440
- {ex.explanation && (
441
- <div className="text-[11px] font-sans text-slate-600 bg-slate-50 p-2 border border-slate-200">
442
- <span className="font-bold text-slate-700">Explanation: </span>
443
- {ex.explanation}
444
- </div>
445
- )}
446
- </div>
447
- ))}
448
  </div>
449
- </div>
450
- )}
451
 
452
- {/* Constraints */}
453
- {parsed.constraints.length > 0 && (
454
- <div className="p-4 bg-white border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)]">
455
- <div className="text-[9px] font-arcade text-trash-gray uppercase font-bold mb-2">
456
- CONSTRAINTS
 
 
 
 
 
 
 
 
 
 
 
457
  </div>
458
- <ul className="space-y-1.5 list-none m-0 p-0">
459
- {parsed.constraints.map((c, i) => (
460
- <li key={i} className="flex items-start gap-2 text-xs">
461
- <span className="text-primary font-bold select-none">•</span>
462
- <code className="bg-white text-ink-black font-code-mono px-2 py-0.5 border border-slate-300 text-[11px] select-text">
463
- {c}
464
- </code>
465
- </li>
466
- ))}
467
- </ul>
468
- </div>
469
- )}
470
 
471
  {/* Optimal Complexity Target Spoiler Shield (Positioned below constraints for active recall) */}
472
  {!showComplexitySpoiler ? (
@@ -549,31 +534,35 @@ export const ProblemSpecPanel: React.FC<ProblemSpecPanelProps> = ({
549
  )}
550
 
551
  {/* SOLUTION SELECTOR TAB BAR */}
552
- <div className="flex items-center gap-1.5 p-1 bg-slate-200/90 border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] overflow-x-auto custom-scrollbar">
553
- {solutions.map((sol, idx) => (
554
- <button
555
- key={sol.id || idx}
556
- type="button"
557
- onClick={() => {
558
- setSelectedSolutionIndex(idx);
559
- setIsAddingSolution(false);
560
- setEditingSolutionId(null);
561
- }}
562
- className={`py-1.5 px-3 font-arcade text-[9px] font-bold flex items-center justify-center gap-1.5 border-2 border-ink-black transition-all cursor-pointer whitespace-nowrap shrink-0 ${
563
- safeIndex === idx && !isAddingSolution && !editingSolutionId
564
- ? 'bg-sky-600 text-white shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] -translate-y-0.5'
565
- : 'bg-white text-ink-black hover:bg-sky-50 shadow-none'
566
- }`}
567
- >
568
- {sol.is_optimal ? <Sparkles className="w-3 h-3 text-amber-300" /> : <BookOpen className="w-3 h-3" />}
569
- <span>{`SOL ${idx + 1}: ${sol.name.toUpperCase()}`}</span>
570
- {sol.is_optimal && (
571
- <span className="text-[7.5px] px-1 py-0.2 bg-amber-300 text-ink-black border border-ink-black font-extrabold">
572
- OPTIMAL
573
- </span>
574
- )}
575
- </button>
576
- ))}
 
 
 
 
577
 
578
  <button
579
  type="button"
@@ -590,15 +579,15 @@ export const ProblemSpecPanel: React.FC<ProblemSpecPanelProps> = ({
590
  is_optimal: false
591
  });
592
  }}
593
- className={`py-1.5 px-2.5 font-arcade text-[9px] font-bold flex items-center gap-1 border-2 border-ink-black cursor-pointer whitespace-nowrap shrink-0 active:translate-y-0.5 transition-all ${
594
  isAddingSolution
595
- ? 'bg-emerald-600 text-white shadow-[2px_2px_0px_0px_rgba(30,41,59,1)]'
596
  : 'bg-amber-300 text-ink-black hover:bg-amber-200'
597
  }`}
598
  title="Add another solution / method for this problem"
 
599
  >
600
- <Plus className="w-3 h-3" />
601
- <span>+ ADD SOLUTION</span>
602
  </button>
603
  </div>
604
 
@@ -703,7 +692,7 @@ export const ProblemSpecPanel: React.FC<ProblemSpecPanelProps> = ({
703
  value={solutionForm.code}
704
  onChange={(e) => setSolutionForm({ ...solutionForm, code: e.target.value })}
705
  placeholder="class Solution:&#10; def solve(self, nums):&#10; ..."
706
- className="w-full p-2.5 border-2 border-ink-black bg-[#1E293B] text-[#4ADE80] font-code-mono text-xs focus:outline-none custom-scrollbar"
707
  />
708
  </div>
709
 
@@ -717,7 +706,7 @@ export const ProblemSpecPanel: React.FC<ProblemSpecPanelProps> = ({
717
  value={solutionForm.explanation}
718
  onChange={(e) => setSolutionForm({ ...solutionForm, explanation: e.target.value })}
719
  placeholder="Key insight, trade-offs, and state tracking notes..."
720
- className="w-full p-2 border-2 border-ink-black text-xs bg-[#fdf8e1] focus:outline-none focus:bg-white custom-scrollbar"
721
  />
722
  </div>
723
 
@@ -761,159 +750,161 @@ export const ProblemSpecPanel: React.FC<ProblemSpecPanelProps> = ({
761
  ) : activeSolution ? (
762
  /* VIEWING ACTIVE SOLUTION */
763
  <div className="space-y-3.5">
764
- {/* Solution Metadata Banner (Pattern, Time, Space shown right here!) */}
765
- <div className="p-3 bg-white border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] flex flex-col sm:flex-row sm:items-center justify-between gap-2.5">
766
- <div className="flex items-center gap-2 flex-wrap">
767
- <h3 className="font-headline-md font-extrabold text-sm sm:text-base text-ink-black m-0 select-text">
768
- {activeSolution.name || `Solution ${safeIndex + 1}`}
769
- </h3>
770
- {activeSolution.is_optimal && (
771
- <span className="px-2 py-0.5 bg-amber-300 border border-ink-black font-arcade text-[8px] font-bold text-ink-black shadow-[1px_1px_0px_0px_rgba(30,41,59,1)]">
772
- ★ OPTIMAL
773
- </span>
774
- )}
775
- </div>
776
-
777
- {/* Pattern & Complexities for this specific solution! */}
778
- <div className="flex items-center gap-2 flex-wrap sm:ml-auto">
779
- <div className="flex items-center gap-1">
780
- <span className="font-arcade text-[8px] text-trash-gray uppercase">Pattern:</span>
781
- <span className="px-2 py-0.5 bg-purple-50 border border-purple-300 font-arcade text-[8.5px] text-purple-800 font-bold">
782
- {activeSolution.pattern || 'General Algorithm'}
783
- </span>
784
- </div>
785
- <div className="flex items-center gap-1.5">
786
- <code className="bg-[#1E293B] text-[#4ADE80] font-code-mono px-1.5 py-0.5 text-[11px] border border-ink-black font-bold">
787
- T: {activeSolution.time_complexity || 'O(N)'}
788
- </code>
789
- <code className="bg-[#1E293B] text-[#4ADE80] font-code-mono px-1.5 py-0.5 text-[11px] border border-ink-black font-bold">
790
- S: {activeSolution.space_complexity || 'O(1)'}
791
- </code>
792
  </div>
793
- <div className="flex items-center gap-1 ml-auto">
794
- <button
795
- type="button"
796
- onClick={() => {
797
- setEditingSolutionId(activeSolution.id);
798
- setIsAddingSolution(false);
799
- setSolutionForm({
800
- name: activeSolution.name,
801
- pattern: activeSolution.pattern,
802
- time_complexity: activeSolution.time_complexity,
803
- space_complexity: activeSolution.space_complexity,
804
- code: activeSolution.code,
805
- explanation: activeSolution.explanation || '',
806
- is_optimal: Boolean(activeSolution.is_optimal)
807
- });
808
- }}
809
- className="px-2 py-1 bg-white hover:bg-slate-100 border border-ink-black text-ink-black font-arcade text-[8px] font-bold flex items-center gap-1 cursor-pointer"
810
- title="Edit this solution"
811
- >
812
- <Edit3 className="w-3 h-3 text-slate-700" />
813
- <span className="hidden sm:inline">EDIT</span>
814
- </button>
815
- {solutions.length > 1 && (
816
  <button
817
  type="button"
818
- onClick={() => handleDeleteSolution(activeSolution.id)}
819
- className="px-1.5 py-1 bg-white hover:bg-rose-50 border border-ink-black text-rose-700 font-arcade text-[8px] font-bold flex items-center gap-1 cursor-pointer"
820
- title="Delete this solution"
 
 
 
 
 
 
 
 
 
 
 
 
821
  >
822
- <Trash2 className="w-3 h-3" />
 
823
  </button>
824
- )}
 
 
 
 
 
 
 
 
 
 
825
  </div>
826
  </div>
827
- </div>
828
 
829
- {/* Reference Code Container */}
830
- {activeSolution.code ? (
831
- <div className="border-2 border-ink-black bg-[#0f172a] shadow-[3px_3px_0px_0px_rgba(30,41,59,1)]">
832
- <div className="bg-[#1e293b] px-3 py-1.5 border-b-2 border-ink-black flex items-center justify-between">
833
- <span className="font-arcade text-[8px] text-slate-300 font-bold uppercase">
834
- PYTHON 3 IMPLEMENTATION
835
- </span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
836
  <button
837
- onClick={() => onCopyText(activeSolution.code, `sol-${activeSolution.id}`)}
838
- className="px-2 py-0.5 bg-white hover:bg-slate-100 text-ink-black border border-ink-black text-[9px] font-arcade font-bold flex items-center gap-1 cursor-pointer shrink-0"
839
- title="Copy solution code"
840
  >
841
- <Copy className="w-2.5 h-2.5" />
842
- {copiedSnippet === `sol-${activeSolution.id}` ? 'COPIED!' : 'COPY'}
 
 
 
 
 
 
 
 
 
843
  </button>
844
- </div>
845
- <div className="p-3 text-xs overflow-x-auto max-h-80 custom-scrollbar">
846
- <pre className="font-code-mono text-[#4ADE80] text-[11px] leading-relaxed select-text m-0">
847
- <code>{activeSolution.code}</code>
848
- </pre>
849
- </div>
850
- </div>
851
- ) : (
852
- <div className="p-4 bg-amber-50 border-2 border-dashed border-amber-300 text-center space-y-3 shadow-[2px_2px_0px_0px_rgba(30,41,59,1)]">
853
- <p className="text-xs font-sans text-stone-700">No code implementation archived for this solution yet.</p>
854
- <button
855
- onClick={onFetchAiSolution}
856
- disabled={aiSolutionLoading}
857
- className="px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white font-arcade text-[9px] font-bold border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer inline-flex items-center gap-2 disabled:opacity-50"
858
- >
859
- {aiSolutionLoading ? (
860
- <>
861
- <RefreshCw className="w-3.5 h-3.5 animate-spin" />
862
- <span>CONSULTING AI GRIMOIRE...</span>
863
- </>
864
- ) : (
865
- <>
866
- <Sparkles className="w-3.5 h-3.5 text-amber-300" />
867
- <span>CONSULT AI GRIMOIRE FOR SOLUTION</span>
868
- </>
869
  )}
870
- </button>
871
- {aiSolutionError && (
872
- <div className="text-xs text-rose-600 font-medium">{aiSolutionError}</div>
873
- )}
874
- </div>
875
- )}
876
 
877
- {/* Solution Explanation / Intuition */}
878
- {activeSolution.explanation && (
879
- <div className="p-3.5 bg-white border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] space-y-1.5 select-text">
880
- <span className="font-arcade text-[8.5px] text-trash-gray uppercase font-bold block">
881
- SOLUTION INTUITION & STRATEGY:
882
- </span>
883
- <div className="font-sans text-xs text-slate-800 leading-relaxed font-medium space-y-1.5">
884
- {parseMarkdown(activeSolution.explanation)}
885
  </div>
886
- </div>
887
- )}
888
 
889
- {/* Gemini Code Explanation Action */}
890
  {activeSolution.code && (
891
- <div className="space-y-3 pt-1">
892
- <button
893
- onClick={() =>
894
- onExplainCode(
895
- activeSolution.code,
896
- activeSolution.pattern,
897
- activeSolution.time_complexity,
898
- activeSolution.space_complexity
899
- )
900
- }
901
- disabled={explainLoading}
902
- className="w-full bg-amber-300 hover:bg-amber-400 border-2 border-ink-black text-ink-black font-arcade text-[9px] py-2.5 px-4 font-bold flex items-center justify-center gap-2 shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer disabled:opacity-50"
903
- >
904
- {explainLoading ? (
905
- <>
906
- <RefreshCw className="w-3.5 h-3.5 animate-spin" />
907
- <span>EXPLAINING THIS SOLUTION VIA GEMINI...</span>
908
- </>
909
- ) : (
910
- <>
911
- <Sparkles className="w-3.5 h-3.5 text-purple-700" />
912
- <span>EXPLAIN THIS SOLUTION WITH GEMINI</span>
913
- </>
914
- )}
915
- </button>
916
-
917
  {explainError && (
918
  <div className="p-3 border-2 border-rose-500 bg-rose-50 text-rose-800 text-xs font-semibold">
919
  {explainError}
@@ -928,8 +919,8 @@ export const ProblemSpecPanel: React.FC<ProblemSpecPanelProps> = ({
928
  Gemini Code Breakdown ({activeSolution.name})
929
  </span>
930
  </div>
931
- <div className="font-sans text-xs space-y-2 max-h-80 overflow-y-auto custom-scrollbar pt-1 font-medium text-slate-800">
932
- {parseMarkdown(explanationText)}
933
  </div>
934
  </div>
935
  )}
 
21
  X
22
  } from 'lucide-react';
23
  import type { ProblemItem, ReviewItem, ParsedExample, ProblemSolution } from '../../types/reviewTypes';
24
+ import { renderInlineMarkdown, normalizeProblemSolutions } from '../../utils/problemContentParser';
25
+ import { MarkdownRenderer } from '../MarkdownRenderer';
26
  import { updateProblemSolutions } from '../../services/reviewService';
27
 
28
  const COMMON_PATTERNS = [
 
50
  leftTab: 'spec' | 'ref' | 'leitner';
51
  onSelectLeftTab: (tab: 'spec' | 'ref' | 'leitner') => void;
52
  mobileView: 'spec' | 'code' | 'ref';
53
+ isNarrow?: boolean;
54
  problem: ProblemItem;
55
  parsed: {
56
  description: string;
 
86
  leftTab,
87
  onSelectLeftTab,
88
  mobileView,
89
+ isNarrow = false,
90
  problem,
91
  parsed,
92
  userSolution,
 
293
  }
294
  };
295
 
296
+ const getTabClassName = (isActive: boolean) =>
297
+ `cursor-pointer font-arcade text-[7.5px] min-[400px]:text-[8px] sm:text-[8.5px] transition-all flex items-center justify-center gap-1 sm:gap-1.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-ink-black select-none whitespace-nowrap shrink-0 ${
298
+ isActive
299
+ ? 'h-10 px-2 sm:px-2.5 bg-paper-white text-ink-black font-extrabold border-t-2 border-x-2 border-b-0 border-ink-black relative z-10 -mb-[2px] pb-[10px] shadow-[0_-2px_0_0_rgba(30,41,59,0.06)] after:content-[\'\'] after:absolute after:-bottom-[2px] after:left-0 after:right-0 after:h-[2.5px] after:bg-paper-white after:z-10'
300
+ : 'h-9 px-2 sm:px-2.5 bg-[#e8e4da] text-trash-gray hover:bg-[#efece3] hover:text-ink-black font-bold border-2 border-ink-black relative z-0 mb-0'
301
+ }`;
302
+
303
  return (
304
  <div
305
+ className={`w-full ${
306
+ isNarrow ? 'flex flex-1' : 'lg:w-[49%] flex'
307
+ } flex-col bg-paper-white border-b-[3px] lg:border-b-0 ${
308
+ isNarrow ? '' : 'lg:border-r-[3px]'
309
+ } border-ink-black overflow-hidden ${
310
+ isNarrow && mobileView !== 'spec' && mobileView !== 'ref' ? 'hidden' : 'flex'
311
  }`}
312
  >
313
  {/* Sub-tab strip */}
314
+ <div className="shrink-0 bg-[#f4f1ea] border-b-2 border-ink-black px-1.5 sm:px-2.5 pt-2 flex items-end gap-1 relative z-10 overflow-x-auto no-scrollbar">
315
  <button
316
  onClick={() => onSelectLeftTab('spec')}
317
+ className={getTabClassName(leftTab === 'spec')}
 
 
 
 
318
  >
319
+ <FileText className="w-3 h-3 text-purple-700 shrink-0" />
320
+ <span>{isNarrow ? 'SPEC' : 'SPECIFICATIONS'}</span>
321
  </button>
322
  <button
323
  onClick={() => onSelectLeftTab('ref')}
324
+ className={getTabClassName(leftTab === 'ref')}
 
 
 
 
325
  >
326
+ <Code className="w-3 h-3 text-blue-700 shrink-0" />
327
+ <span>{isNarrow ? `SOL (${solutions.length})` : `SOLUTIONS (${solutions.length})`}</span>
328
  </button>
329
  <button
330
  onClick={() => onSelectLeftTab('leitner')}
331
+ className={getTabClassName(leftTab === 'leitner')}
 
 
 
 
332
  >
333
+ <TrendingUp className="w-3 h-3 text-emerald-700 shrink-0" />
334
+ <span className="whitespace-nowrap">{isNarrow ? 'FSRS' : 'FSRS STATS'}</span>
335
  </button>
336
  </div>
337
 
338
  {/* Dossier Scroll Area */}
339
+ <div className="flex-1 overflow-y-auto no-scrollbar p-4 sm:p-5 space-y-4">
340
  {/* SUBTAB 1: PROBLEM SPEC (Active Recall Mode - No Spoilers!) */}
341
  {leftTab === 'spec' && (
342
  <div className="space-y-4">
343
+ {/* Main Problem Specification & Description Container */}
344
+ <div className="p-4 bg-white border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] space-y-3.5">
345
+ {/* Header: Title */}
346
+ <div>
347
  <h2 className="text-base sm:text-lg font-extrabold text-ink-black font-headline-md leading-tight m-0 select-text">
348
  {problem.name || 'Algorithm Problem'}
349
  </h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
  </div>
 
351
 
352
+ {/* Problem Description Body */}
353
+ {parsed.description && (
354
+ <div className="pt-3.5 border-t border-slate-200">
355
+ <div className="text-[9px] font-arcade text-trash-gray uppercase font-bold mb-2 flex items-center gap-1">
356
+ <BookOpen className="w-3 h-3 text-primary" />
357
+ PROBLEM DESCRIPTION
358
+ </div>
359
+ <div className="font-sans text-xs sm:text-[13px] text-slate-800 leading-relaxed space-y-2 font-medium">
360
+ {parsed.description.split('\n').map((line: string, idx: number) =>
361
+ line.trim() ? (
362
+ <p key={idx} className="m-0 leading-relaxed whitespace-pre-wrap select-text">
363
+ {renderInlineMarkdown(line)}
364
+ </p>
365
+ ) : (
366
+ <div key={idx} className="h-1.5" />
367
+ )
368
+ )}
369
+ </div>
370
  </div>
371
+ )}
372
+
373
+ {/* Structured Examples */}
374
+ {parsed.examples.length > 0 && (
375
+ <div className="pt-3.5 border-t border-slate-200 space-y-2.5">
376
+ <div className="text-[9px] font-arcade text-trash-gray uppercase font-bold flex items-center gap-1.5">
377
+ <Zap className="w-3 h-3 text-amber-500" />
378
+ EXAMPLES ({parsed.examples.length})
379
+ </div>
380
+ <div className="space-y-2.5">
381
+ {parsed.examples.map((ex, i) => (
382
+ <div
383
+ key={i}
384
+ className="p-3 bg-slate-50 border border-slate-200 space-y-2 text-xs"
385
+ >
386
+ <div className="flex items-center justify-between">
387
+ <span className="font-arcade text-[9px] font-bold text-primary">
388
+ EXAMPLE {i + 1}
389
+ </span>
390
+ {ex.input && (
391
+ <button
392
+ onClick={() => onCopyText(ex.input, `ex-${i}`)}
393
+ className="px-2 py-0.5 bg-white hover:bg-slate-100 border border-ink-black text-[9px] font-arcade text-ink-black flex items-center gap-1 cursor-pointer"
394
+ title="Copy input data"
395
+ >
396
+ <Copy className="w-2.5 h-2.5" />
397
+ {copiedSnippet === `ex-${i}` ? 'COPIED!' : 'COPY'}
398
+ </button>
399
+ )}
400
+ </div>
401
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
402
  {ex.input && (
403
+ <div className="space-y-1">
404
+ <span className="text-[9px] font-arcade text-trash-gray font-bold uppercase block">
405
+ Input:
406
+ </span>
407
+ <div className="bg-[#1E293B] text-[#4ADE80] font-code-mono p-2 border border-ink-black text-[11px] break-all select-text">
408
+ {ex.input}
409
+ </div>
410
+ </div>
411
  )}
 
412
 
413
+ {ex.output && (
414
+ <div className="space-y-1">
415
+ <span className="text-[9px] font-arcade text-trash-gray font-bold uppercase block">
416
+ Output:
417
+ </span>
418
+ <div className="bg-[#1E293B] text-[#4ADE80] font-code-mono p-2 border border-ink-black text-[11px] break-all select-text">
419
+ {ex.output}
420
+ </div>
421
  </div>
422
+ )}
 
423
 
424
+ {ex.explanation && (
425
+ <div className="text-[11px] font-sans text-slate-600 bg-white p-2 border border-slate-200">
426
+ <span className="font-bold text-slate-700">Explanation: </span>
427
+ {renderInlineMarkdown(ex.explanation)}
 
 
 
428
  </div>
429
+ )}
430
+ </div>
431
+ ))}
432
+ </div>
 
 
 
 
 
 
 
433
  </div>
434
+ )}
 
435
 
436
+ {/* Constraints */}
437
+ {parsed.constraints.length > 0 && (
438
+ <div className="pt-3.5 border-t border-slate-200">
439
+ <div className="text-[9px] font-arcade text-trash-gray uppercase font-bold mb-2">
440
+ CONSTRAINTS
441
+ </div>
442
+ <ul className="space-y-1.5 list-none m-0 p-0">
443
+ {parsed.constraints.map((c, i) => (
444
+ <li key={i} className="flex items-start gap-2 text-xs">
445
+ <span className="text-primary font-bold select-none">•</span>
446
+ <code className="bg-slate-100 text-ink-black font-code-mono px-2 py-0.5 border border-slate-300 text-[11px] select-text">
447
+ {c}
448
+ </code>
449
+ </li>
450
+ ))}
451
+ </ul>
452
  </div>
453
+ )}
454
+ </div>
 
 
 
 
 
 
 
 
 
 
455
 
456
  {/* Optimal Complexity Target Spoiler Shield (Positioned below constraints for active recall) */}
457
  {!showComplexitySpoiler ? (
 
534
  )}
535
 
536
  {/* SOLUTION SELECTOR TAB BAR */}
537
+ <div className="flex items-center gap-1 p-1 bg-slate-200/90 border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] overflow-x-auto no-scrollbar">
538
+ {solutions.map((sol, idx) => {
539
+ const isSelected = safeIndex === idx && !isAddingSolution && !editingSolutionId;
540
+ return (
541
+ <button
542
+ key={sol.id || idx}
543
+ type="button"
544
+ onClick={() => {
545
+ setSelectedSolutionIndex(idx);
546
+ setIsAddingSolution(false);
547
+ setEditingSolutionId(null);
548
+ }}
549
+ className={`py-1 px-2 rounded-full font-arcade text-[8px] font-bold flex items-center justify-center gap-1 border-2 border-ink-black transition-all cursor-pointer whitespace-nowrap shrink-0 ${
550
+ isSelected
551
+ ? 'bg-sky-600 text-white shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] -translate-y-0.5'
552
+ : 'bg-white text-ink-black hover:bg-sky-50 shadow-none'
553
+ }`}
554
+ title={sol.name ? `${sol.name} (${sol.pattern || 'Algorithm'})` : `Solution ${idx + 1}`}
555
+ >
556
+ {sol.is_optimal ? <Sparkles className="w-3 h-3 text-amber-300" /> : <BookOpen className="w-3 h-3" />}
557
+ <span>{`Sol ${idx + 1}`}</span>
558
+ {sol.is_optimal && (
559
+ <span className="text-[6.5px] px-1 py-0.2 bg-amber-300 text-ink-black border border-ink-black font-extrabold rounded-full tracking-tight">
560
+ OPTIMAL
561
+ </span>
562
+ )}
563
+ </button>
564
+ );
565
+ })}
566
 
567
  <button
568
  type="button"
 
579
  is_optimal: false
580
  });
581
  }}
582
+ className={`h-6 w-6 rounded-full font-arcade text-[9px] font-bold flex items-center justify-center border-2 border-ink-black cursor-pointer shrink-0 active:translate-y-0.5 transition-all shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] ${
583
  isAddingSolution
584
+ ? 'bg-emerald-600 text-white'
585
  : 'bg-amber-300 text-ink-black hover:bg-amber-200'
586
  }`}
587
  title="Add another solution / method for this problem"
588
+ aria-label="Add Solution"
589
  >
590
+ <Plus className="w-3 h-3 stroke-[2.5]" />
 
591
  </button>
592
  </div>
593
 
 
692
  value={solutionForm.code}
693
  onChange={(e) => setSolutionForm({ ...solutionForm, code: e.target.value })}
694
  placeholder="class Solution:&#10; def solve(self, nums):&#10; ..."
695
+ className="w-full p-2.5 border-2 border-ink-black bg-[#1E293B] text-[#4ADE80] font-code-mono text-xs focus:outline-none no-scrollbar"
696
  />
697
  </div>
698
 
 
706
  value={solutionForm.explanation}
707
  onChange={(e) => setSolutionForm({ ...solutionForm, explanation: e.target.value })}
708
  placeholder="Key insight, trade-offs, and state tracking notes..."
709
+ className="w-full p-2 border-2 border-ink-black text-xs bg-[#fdf8e1] focus:outline-none focus:bg-white no-scrollbar"
710
  />
711
  </div>
712
 
 
750
  ) : activeSolution ? (
751
  /* VIEWING ACTIVE SOLUTION */
752
  <div className="space-y-3.5">
753
+ {/* Unified Solution Article Layout Container */}
754
+ <div className="p-4 bg-white border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] space-y-3.5">
755
+ {/* Solution Metadata Header (Seamlessly precedes the implementation) */}
756
+ <div className="flex flex-wrap items-center justify-between gap-2 pb-3 border-b border-slate-200">
757
+ <div className="flex items-center gap-2 flex-wrap min-w-0">
758
+ <h3 className="font-headline-md font-extrabold text-sm sm:text-base text-ink-black m-0 select-text break-words">
759
+ {activeSolution.name || `Solution ${safeIndex + 1}`}
760
+ </h3>
761
+ {activeSolution.is_optimal && (
762
+ <span className="px-2 py-0.5 bg-amber-300 border border-ink-black font-arcade text-[8px] font-bold text-ink-black shadow-[1px_1px_0px_0px_rgba(30,41,59,1)] shrink-0">
763
+ ★ OPTIMAL
764
+ </span>
765
+ )}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
766
  </div>
767
+
768
+ {/* Pattern & Complexities for this specific solution! */}
769
+ <div className="flex items-center gap-2 flex-wrap sm:ml-auto">
770
+ <div className="flex items-center gap-1">
771
+ <span className="font-arcade text-[8px] text-trash-gray uppercase">Pattern:</span>
772
+ <span className="px-2 py-0.5 bg-purple-50 border border-purple-300 font-arcade text-[8.5px] text-purple-800 font-bold">
773
+ {activeSolution.pattern || 'General Algorithm'}
774
+ </span>
775
+ </div>
776
+ <div className="flex items-center gap-1.5">
777
+ <code className="bg-[#1E293B] text-[#4ADE80] font-code-mono px-1.5 py-0.5 text-[11px] border border-ink-black font-bold">
778
+ T: {activeSolution.time_complexity || 'O(N)'}
779
+ </code>
780
+ <code className="bg-[#1E293B] text-[#4ADE80] font-code-mono px-1.5 py-0.5 text-[11px] border border-ink-black font-bold">
781
+ S: {activeSolution.space_complexity || 'O(1)'}
782
+ </code>
783
+ </div>
784
+ <div className="flex items-center gap-1 ml-auto">
 
 
 
 
 
785
  <button
786
  type="button"
787
+ onClick={() => {
788
+ setEditingSolutionId(activeSolution.id);
789
+ setIsAddingSolution(false);
790
+ setSolutionForm({
791
+ name: activeSolution.name,
792
+ pattern: activeSolution.pattern,
793
+ time_complexity: activeSolution.time_complexity,
794
+ space_complexity: activeSolution.space_complexity,
795
+ code: activeSolution.code,
796
+ explanation: activeSolution.explanation || '',
797
+ is_optimal: Boolean(activeSolution.is_optimal)
798
+ });
799
+ }}
800
+ className="px-2 py-1 bg-white hover:bg-slate-100 border border-ink-black text-ink-black font-arcade text-[8px] font-bold flex items-center gap-1 cursor-pointer"
801
+ title="Edit this solution"
802
  >
803
+ <Edit3 className="w-3 h-3 text-slate-700" />
804
+ <span className="hidden sm:inline">EDIT</span>
805
  </button>
806
+ {solutions.length > 1 && (
807
+ <button
808
+ type="button"
809
+ onClick={() => handleDeleteSolution(activeSolution.id)}
810
+ className="px-1.5 py-1 bg-white hover:bg-rose-50 border border-ink-black text-rose-700 font-arcade text-[8px] font-bold flex items-center gap-1 cursor-pointer"
811
+ title="Delete this solution"
812
+ >
813
+ <Trash2 className="w-3 h-3" />
814
+ </button>
815
+ )}
816
+ </div>
817
  </div>
818
  </div>
 
819
 
820
+ {/* Reference Code Snippet */}
821
+ {activeSolution.code ? (
822
+ <div className="border border-ink-black bg-[#0f172a] overflow-hidden">
823
+ <div className="bg-[#1e293b] px-2.5 sm:px-3 py-1.5 border-b border-ink-black flex items-center justify-between gap-1.5 flex-wrap min-w-0">
824
+ <span className="font-arcade text-[8px] text-slate-300 font-bold uppercase truncate min-w-0 flex-1">
825
+ {isNarrow ? 'PYTHON 3' : 'PYTHON 3 IMPLEMENTATION'}
826
+ </span>
827
+ <div className="flex items-center gap-1.5 shrink-0">
828
+ {/* Explain with Gemini Secondary Utility */}
829
+ <button
830
+ type="button"
831
+ onClick={() =>
832
+ onExplainCode(
833
+ activeSolution.code,
834
+ activeSolution.pattern,
835
+ activeSolution.time_complexity,
836
+ activeSolution.space_complexity
837
+ )
838
+ }
839
+ disabled={explainLoading}
840
+ className="px-2 py-0.5 bg-purple-50 hover:bg-purple-100 text-purple-800 border border-ink-black text-[9px] font-arcade font-bold flex items-center gap-1 cursor-pointer shrink-0 disabled:opacity-50 active:translate-y-0.5 transition-all"
841
+ title="Explain this solution with Gemini AI"
842
+ >
843
+ {explainLoading ? (
844
+ <RefreshCw className="w-2.5 h-2.5 animate-spin text-purple-700" />
845
+ ) : (
846
+ <Sparkles className="w-2.5 h-2.5 text-purple-600" />
847
+ )}
848
+ <span>Explain ✦</span>
849
+ </button>
850
+
851
+ {/* Copy Code */}
852
+ <button
853
+ onClick={() => onCopyText(activeSolution.code, `sol-${activeSolution.id}`)}
854
+ className="px-2 py-0.5 bg-white hover:bg-slate-100 text-ink-black border border-ink-black text-[9px] font-arcade font-bold flex items-center gap-1 cursor-pointer shrink-0 active:translate-y-0.5 transition-all"
855
+ title="Copy solution code"
856
+ >
857
+ <Copy className="w-2.5 h-2.5" />
858
+ {copiedSnippet === `sol-${activeSolution.id}` ? 'COPIED!' : 'COPY'}
859
+ </button>
860
+ </div>
861
+ </div>
862
+ <div className="p-3 text-xs overflow-x-auto max-h-80 no-scrollbar">
863
+ <pre className="font-code-mono text-[#4ADE80] text-[11px] leading-relaxed select-text m-0">
864
+ <code>{activeSolution.code}</code>
865
+ </pre>
866
+ </div>
867
+ </div>
868
+ ) : (
869
+ <div className="p-4 bg-amber-50 border border-dashed border-amber-300 text-center space-y-3">
870
+ <p className="text-xs font-sans text-stone-700">No code implementation archived for this solution yet.</p>
871
  <button
872
+ onClick={onFetchAiSolution}
873
+ disabled={aiSolutionLoading}
874
+ className="px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white font-arcade text-[9px] font-bold border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer inline-flex items-center gap-2 disabled:opacity-50"
875
  >
876
+ {aiSolutionLoading ? (
877
+ <>
878
+ <RefreshCw className="w-3.5 h-3.5 animate-spin" />
879
+ <span>CONSULTING AI GRIMOIRE...</span>
880
+ </>
881
+ ) : (
882
+ <>
883
+ <Sparkles className="w-3.5 h-3.5 text-amber-300" />
884
+ <span>CONSULT AI GRIMOIRE FOR SOLUTION</span>
885
+ </>
886
+ )}
887
  </button>
888
+ {aiSolutionError && (
889
+ <div className="text-xs text-rose-600 font-medium">{aiSolutionError}</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
890
  )}
891
+ </div>
892
+ )}
 
 
 
 
893
 
894
+ {/* Solution Explanation / Intuition */}
895
+ {activeSolution.explanation && (
896
+ <div className="pt-3.5 border-t border-slate-200 space-y-1.5 select-text">
897
+ <span className="font-arcade text-[8.5px] text-trash-gray uppercase font-bold block">
898
+ SOLUTION INTUITION & STRATEGY:
899
+ </span>
900
+ <MarkdownRenderer content={activeSolution.explanation} />
 
901
  </div>
902
+ )}
903
+ </div>
904
 
905
+ {/* Gemini Code Breakdown Results */}
906
  {activeSolution.code && (
907
+ <div className="space-y-3">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
908
  {explainError && (
909
  <div className="p-3 border-2 border-rose-500 bg-rose-50 text-rose-800 text-xs font-semibold">
910
  {explainError}
 
919
  Gemini Code Breakdown ({activeSolution.name})
920
  </span>
921
  </div>
922
+ <div className="max-h-96 overflow-y-auto no-scrollbar pt-1 select-text">
923
+ <MarkdownRenderer content={explanationText} />
924
  </div>
925
  </div>
926
  )}
algospaced-ui/src/components/review/RatingBar.tsx CHANGED
@@ -17,15 +17,9 @@ export const RatingBar: React.FC<RatingBarProps> = ({
17
  onGrade
18
  }) => {
19
  return (
20
- <div className="shrink-0 bg-[#f8f5eb] border-t-[3px] border-ink-black p-3 sm:p-3.5 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 shadow-[0_-3px_0_0_rgba(30,41,59,0.08)]">
21
- {/* Shortcut instruction note */}
22
- <div className="hidden sm:flex items-center gap-2 font-arcade text-[8px] text-trash-gray font-bold uppercase">
23
- <span className="px-1.5 py-0.5 bg-white border border-ink-black">KEYS 1-4</span>
24
- <span>QUICK GRADE</span>
25
- </div>
26
-
27
  {/* 4 Chunky Arcade Action Buttons */}
28
- <div className="flex-1 flex flex-col">
29
  {gradeError && (
30
  <div className="p-2.5 mb-2 bg-red-100 border-2 border-red-500 text-red-800 text-xs font-semibold shadow-[2px_2px_0px_0px_#1E293B] flex items-center justify-between">
31
  <span className="flex items-center gap-1.5">
@@ -41,12 +35,12 @@ export const RatingBar: React.FC<RatingBarProps> = ({
41
  </div>
42
  )}
43
 
44
- <div className="flex gap-2 sm:gap-3">
45
  {/* [1] Again */}
46
  <button
47
  onClick={() => onGrade(1)}
48
  disabled={submitting}
49
- className="flex-1 bg-[#ff4d4d] hover:bg-[#ff3333] border-[3px] border-ink-black py-2.5 sm:py-3 px-2 arcade-btn cursor-pointer disabled:opacity-60 text-white flex flex-col items-center justify-center font-bold transition-all select-none"
50
  title="Press 1 on keyboard"
51
  >
52
  {submittingRating === 1 ? (
@@ -54,12 +48,10 @@ export const RatingBar: React.FC<RatingBarProps> = ({
54
  <RefreshCw className="w-3.5 h-3.5 animate-spin" />
55
  </div>
56
  ) : (
57
- <>
58
- <div className="flex items-center gap-1 font-headline-md text-xs sm:text-sm font-extrabold tracking-wide uppercase">
59
- <span className="font-arcade text-[9px] px-1 py-0.5 bg-black/20 rounded">1</span>
60
- <span>Again</span>
61
- </div>
62
- </>
63
  )}
64
  </button>
65
 
@@ -67,7 +59,7 @@ export const RatingBar: React.FC<RatingBarProps> = ({
67
  <button
68
  onClick={() => onGrade(2)}
69
  disabled={submitting}
70
- className="flex-1 bg-[#ff9933] hover:bg-[#ff8000] border-[3px] border-ink-black py-2.5 sm:py-3 px-2 arcade-btn cursor-pointer disabled:opacity-60 text-ink-black flex flex-col items-center justify-center font-bold transition-all select-none"
71
  title="Press 2 on keyboard"
72
  >
73
  {submittingRating === 2 ? (
@@ -75,12 +67,10 @@ export const RatingBar: React.FC<RatingBarProps> = ({
75
  <RefreshCw className="w-3.5 h-3.5 animate-spin text-ink-black" />
76
  </div>
77
  ) : (
78
- <>
79
- <div className="flex items-center gap-1 font-headline-md text-xs sm:text-sm font-extrabold tracking-wide uppercase">
80
- <span className="font-arcade text-[9px] px-1 py-0.5 bg-black/10 rounded">2</span>
81
- <span>Hard</span>
82
- </div>
83
- </>
84
  )}
85
  </button>
86
 
@@ -88,7 +78,7 @@ export const RatingBar: React.FC<RatingBarProps> = ({
88
  <button
89
  onClick={() => onGrade(3)}
90
  disabled={submitting}
91
- className="flex-1 bg-[#4ade80] hover:bg-[#22c55e] border-[3px] border-ink-black py-2.5 sm:py-3 px-2 arcade-btn cursor-pointer disabled:opacity-60 text-ink-black flex flex-col items-center justify-center font-bold transition-all select-none"
92
  title="Press 3 on keyboard"
93
  >
94
  {submittingRating === 3 ? (
@@ -96,12 +86,10 @@ export const RatingBar: React.FC<RatingBarProps> = ({
96
  <RefreshCw className="w-3.5 h-3.5 animate-spin text-ink-black" />
97
  </div>
98
  ) : (
99
- <>
100
- <div className="flex items-center gap-1 font-headline-md text-xs sm:text-sm font-extrabold tracking-wide uppercase">
101
- <span className="font-arcade text-[9px] px-1 py-0.5 bg-black/10 rounded">3</span>
102
- <span>Good</span>
103
- </div>
104
- </>
105
  )}
106
  </button>
107
 
@@ -109,7 +97,7 @@ export const RatingBar: React.FC<RatingBarProps> = ({
109
  <button
110
  onClick={() => onGrade(4)}
111
  disabled={submitting}
112
- className="flex-1 bg-[#60a5fa] hover:bg-[#3b82f6] border-[3px] border-ink-black py-2.5 sm:py-3 px-2 arcade-btn cursor-pointer disabled:opacity-60 text-ink-black flex flex-col items-center justify-center font-bold transition-all select-none"
113
  title="Press 4 on keyboard"
114
  >
115
  {submittingRating === 4 ? (
@@ -117,12 +105,10 @@ export const RatingBar: React.FC<RatingBarProps> = ({
117
  <RefreshCw className="w-3.5 h-3.5 animate-spin text-ink-black" />
118
  </div>
119
  ) : (
120
- <>
121
- <div className="flex items-center gap-1 font-headline-md text-xs sm:text-sm font-extrabold tracking-wide uppercase">
122
- <span className="font-arcade text-[9px] px-1 py-0.5 bg-black/10 rounded">4</span>
123
- <span>Easy</span>
124
- </div>
125
- </>
126
  )}
127
  </button>
128
  </div>
 
17
  onGrade
18
  }) => {
19
  return (
20
+ <div className="shrink-0 bg-[#f8f5eb] border-t-[3px] border-ink-black p-2 sm:p-3 flex flex-col items-stretch gap-1.5 sm:gap-2 shadow-[0_-3px_0_0_rgba(30,41,59,0.08)]">
 
 
 
 
 
 
21
  {/* 4 Chunky Arcade Action Buttons */}
22
+ <div className="w-full flex flex-col">
23
  {gradeError && (
24
  <div className="p-2.5 mb-2 bg-red-100 border-2 border-red-500 text-red-800 text-xs font-semibold shadow-[2px_2px_0px_0px_#1E293B] flex items-center justify-between">
25
  <span className="flex items-center gap-1.5">
 
35
  </div>
36
  )}
37
 
38
+ <div className="flex gap-1.5 sm:gap-2.5 w-full">
39
  {/* [1] Again */}
40
  <button
41
  onClick={() => onGrade(1)}
42
  disabled={submitting}
43
+ className="flex-1 min-w-0 bg-[#ff4d4d] hover:bg-[#ff3333] border-2 sm:border-[3px] border-ink-black py-2 sm:py-2.5 px-1 sm:px-2 arcade-btn cursor-pointer disabled:opacity-60 text-white flex flex-col items-center justify-center font-bold transition-all select-none"
44
  title="Press 1 on keyboard"
45
  >
46
  {submittingRating === 1 ? (
 
48
  <RefreshCw className="w-3.5 h-3.5 animate-spin" />
49
  </div>
50
  ) : (
51
+ <div className="flex items-center gap-1 font-headline-md text-[10px] min-[400px]:text-xs sm:text-sm font-extrabold tracking-wide uppercase truncate">
52
+ <span className="font-arcade text-[8px] sm:text-[9px] px-1 py-0.5 bg-black/20 rounded shrink-0">1</span>
53
+ <span className="truncate">Again</span>
54
+ </div>
 
 
55
  )}
56
  </button>
57
 
 
59
  <button
60
  onClick={() => onGrade(2)}
61
  disabled={submitting}
62
+ className="flex-1 min-w-0 bg-[#ff9933] hover:bg-[#ff8000] border-2 sm:border-[3px] border-ink-black py-2 sm:py-2.5 px-1 sm:px-2 arcade-btn cursor-pointer disabled:opacity-60 text-ink-black flex flex-col items-center justify-center font-bold transition-all select-none"
63
  title="Press 2 on keyboard"
64
  >
65
  {submittingRating === 2 ? (
 
67
  <RefreshCw className="w-3.5 h-3.5 animate-spin text-ink-black" />
68
  </div>
69
  ) : (
70
+ <div className="flex items-center gap-1 font-headline-md text-[10px] min-[400px]:text-xs sm:text-sm font-extrabold tracking-wide uppercase truncate">
71
+ <span className="font-arcade text-[8px] sm:text-[9px] px-1 py-0.5 bg-black/10 rounded shrink-0">2</span>
72
+ <span className="truncate">Hard</span>
73
+ </div>
 
 
74
  )}
75
  </button>
76
 
 
78
  <button
79
  onClick={() => onGrade(3)}
80
  disabled={submitting}
81
+ className="flex-1 min-w-0 bg-[#4ade80] hover:bg-[#22c55e] border-2 sm:border-[3px] border-ink-black py-2 sm:py-2.5 px-1 sm:px-2 arcade-btn cursor-pointer disabled:opacity-60 text-ink-black flex flex-col items-center justify-center font-bold transition-all select-none"
82
  title="Press 3 on keyboard"
83
  >
84
  {submittingRating === 3 ? (
 
86
  <RefreshCw className="w-3.5 h-3.5 animate-spin text-ink-black" />
87
  </div>
88
  ) : (
89
+ <div className="flex items-center gap-1 font-headline-md text-[10px] min-[400px]:text-xs sm:text-sm font-extrabold tracking-wide uppercase truncate">
90
+ <span className="font-arcade text-[8px] sm:text-[9px] px-1 py-0.5 bg-black/10 rounded shrink-0">3</span>
91
+ <span className="truncate">Good</span>
92
+ </div>
 
 
93
  )}
94
  </button>
95
 
 
97
  <button
98
  onClick={() => onGrade(4)}
99
  disabled={submitting}
100
+ className="flex-1 min-w-0 bg-[#60a5fa] hover:bg-[#3b82f6] border-2 sm:border-[3px] border-ink-black py-2 sm:py-2.5 px-1 sm:px-2 arcade-btn cursor-pointer disabled:opacity-60 text-ink-black flex flex-col items-center justify-center font-bold transition-all select-none"
101
  title="Press 4 on keyboard"
102
  >
103
  {submittingRating === 4 ? (
 
105
  <RefreshCw className="w-3.5 h-3.5 animate-spin text-ink-black" />
106
  </div>
107
  ) : (
108
+ <div className="flex items-center gap-1 font-headline-md text-[10px] min-[400px]:text-xs sm:text-sm font-extrabold tracking-wide uppercase truncate">
109
+ <span className="font-arcade text-[8px] sm:text-[9px] px-1 py-0.5 bg-black/10 rounded shrink-0">4</span>
110
+ <span className="truncate">Easy</span>
111
+ </div>
 
 
112
  )}
113
  </button>
114
  </div>
algospaced-ui/src/components/review/ReviewHeader.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
2
  import {
3
  PlusCircle,
4
  Edit3,
@@ -22,41 +22,62 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
22
  problem,
23
  totalInQueue,
24
  reviews = [],
25
- overrideProblemId,
26
  onOpenCreateProblem,
27
  onOpenEditProblem
28
  }) => {
29
  const [isQueueListOpen, setIsQueueListOpen] = useState(false);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  const leetcodeUrl = problem.problem_number
32
  ? `https://leetcode.com/problemset/all/?search=${problem.problem_number}`
33
  : `https://leetcode.com/problemset/all/?search=${encodeURIComponent(problem.name || '')}`;
34
 
35
  return (
36
- <div className="shrink-0 bg-paper-white border-b-[3px] border-ink-black px-4 py-2.5 flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 shadow-[0_2px_0_0_rgba(30,41,59,0.05)] relative z-20">
37
  {/* Left: Card Counter & Badges (Title moved to Specification) */}
38
- <div className="flex items-center gap-2 sm:gap-3 flex-wrap sm:flex-nowrap">
39
  {/* Card Counter & Queue Popover Trigger */}
40
- <div className="relative">
41
  <button
42
  onClick={() => setIsQueueListOpen((prev) => !prev)}
43
- className="flex items-center gap-1.5 px-2.5 py-1 bg-amber-300 hover:bg-amber-200 border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer shrink-0"
44
- title={overrideProblemId ? 'Journey Practice Session' : "Click to view all cards due in today's queue"}
45
  >
46
  <span className="w-2 h-2 rounded-full bg-emerald-500 animate-ping shrink-0" />
47
- <span className="font-arcade text-[9px] font-bold text-ink-black tracking-wide">
48
- {overrideProblemId ? 'JOURNEY PRACTICE' : `CARD 1 OF ${totalInQueue}`}
49
  </span>
50
  {totalInQueue > 1 && (
51
- <ChevronDown className={`w-3 h-3 text-ink-black transition-transform ${isQueueListOpen ? 'rotate-180' : ''}`} />
52
  )}
53
  </button>
54
 
55
  {/* Queue List Popover */}
56
  {isQueueListOpen && reviews.length > 0 && (
57
- <div className="absolute top-10 left-0 z-50 w-72 sm:w-80 bg-paper-white border-[3px] border-ink-black gadget-shadow p-3 space-y-2">
58
  <div className="flex items-center justify-between border-b-2 border-ink-black pb-1.5 font-arcade text-[9px] font-bold text-ink-black">
59
- <span>{overrideProblemId ? 'JOURNEY PRACTICE (1 CARD)' : `DAILY QUEUE (${reviews.length} CARDS)`}</span>
60
  <button
61
  onClick={() => setIsQueueListOpen(false)}
62
  className="px-1 hover:text-rose-600 font-bold cursor-pointer"
@@ -65,7 +86,7 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
65
  ✕
66
  </button>
67
  </div>
68
- <div className="max-h-60 overflow-y-auto custom-scrollbar space-y-1.5 pr-1">
69
  {reviews.map((rev, idx) => {
70
  const revProb = rev.problems || {};
71
  const num = revProb.problem_number;
@@ -112,14 +133,14 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
112
 
113
  {/* LeetCode Number Badge */}
114
  {problem.problem_number !== undefined && problem.problem_number !== null && (
115
- <span className="font-arcade text-[9px] font-bold px-2 py-0.5 bg-amber-200 border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] text-ink-black shrink-0">
116
  {problem.problem_number > 0 ? `LC #${problem.problem_number}` : 'CUSTOM'}
117
  </span>
118
  )}
119
 
120
  {/* Difficulty pill */}
121
  <span
122
- className={`text-[9px] font-arcade font-bold px-2 py-0.5 border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] shrink-0 text-white ${
123
  problem.difficulty === 'Easy'
124
  ? 'bg-emerald-500'
125
  : problem.difficulty === 'Medium'
@@ -132,24 +153,24 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
132
  </div>
133
 
134
  {/* Right: Action buttons, Links, Override Exit */}
135
- <div className="flex items-center gap-2 shrink-0 justify-end">
136
  <button
137
  onClick={onOpenCreateProblem}
138
- className="px-2 py-1 bg-white hover:bg-purple-50 border-2 border-ink-black text-ink-black text-[9px] font-arcade font-bold flex items-center gap-1 shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer"
139
  title="Create or Import Problem"
140
  >
141
- <PlusCircle className="w-3 h-3 text-purple-600" />
142
- <span className="hidden sm:inline">ADD</span>
143
  </button>
144
 
145
  {onOpenEditProblem && (
146
  <button
147
  onClick={onOpenEditProblem}
148
- className="px-2 py-1 bg-white hover:bg-emerald-50 border-2 border-ink-black text-ink-black text-[9px] font-arcade font-bold flex items-center gap-1 shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer"
149
  title="Edit Problem Specification"
150
  >
151
- <Edit3 className="w-3 h-3 text-emerald-600" />
152
- <span className="hidden sm:inline">EDIT</span>
153
  </button>
154
  )}
155
 
@@ -159,11 +180,11 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
159
  href={problem.google_doc_url}
160
  target="_blank"
161
  rel="noreferrer"
162
- className="px-2 py-1 bg-white hover:bg-slate-100 border-2 border-ink-black text-ink-black text-[9px] font-arcade font-bold flex items-center gap-1 shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer"
163
  title="Open Google Doc Notes"
164
  >
165
  <span>DOC</span>
166
- <ExternalLink className="w-2.5 h-2.5 text-primary" />
167
  </a>
168
  )}
169
 
@@ -171,11 +192,11 @@ export const ReviewHeader: React.FC<ReviewHeaderProps> = ({
171
  href={leetcodeUrl}
172
  target="_blank"
173
  rel="noreferrer"
174
- className="px-2 py-1 bg-white hover:bg-slate-100 border-2 border-ink-black text-ink-black text-[9px] font-arcade font-bold flex items-center gap-1 shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer"
175
  title="Search LeetCode"
176
  >
177
  <span>LC</span>
178
- <ExternalLink className="w-2.5 h-2.5 text-amber-600" />
179
  </a>
180
  </div>
181
  </div>
 
1
+ import React, { useState, useRef, useEffect } from 'react';
2
  import {
3
  PlusCircle,
4
  Edit3,
 
22
  problem,
23
  totalInQueue,
24
  reviews = [],
 
25
  onOpenCreateProblem,
26
  onOpenEditProblem
27
  }) => {
28
  const [isQueueListOpen, setIsQueueListOpen] = useState(false);
29
+ const queueDropdownRef = useRef<HTMLDivElement>(null);
30
+
31
+ useEffect(() => {
32
+ const handleClickOutside = (event: MouseEvent) => {
33
+ if (queueDropdownRef.current && !queueDropdownRef.current.contains(event.target as Node)) {
34
+ setIsQueueListOpen(false);
35
+ }
36
+ };
37
+ const handleKeyDown = (event: KeyboardEvent) => {
38
+ if (event.key === 'Escape') {
39
+ setIsQueueListOpen(false);
40
+ }
41
+ };
42
+ if (isQueueListOpen) {
43
+ document.addEventListener('mousedown', handleClickOutside);
44
+ document.addEventListener('keydown', handleKeyDown);
45
+ }
46
+ return () => {
47
+ document.removeEventListener('mousedown', handleClickOutside);
48
+ document.removeEventListener('keydown', handleKeyDown);
49
+ };
50
+ }, [isQueueListOpen]);
51
 
52
  const leetcodeUrl = problem.problem_number
53
  ? `https://leetcode.com/problemset/all/?search=${problem.problem_number}`
54
  : `https://leetcode.com/problemset/all/?search=${encodeURIComponent(problem.name || '')}`;
55
 
56
  return (
57
+ <div className="shrink-0 bg-paper-white border-b-[3px] border-ink-black px-2.5 sm:px-4 py-2 flex flex-wrap items-center justify-between gap-2 shadow-[0_2px_0_0_rgba(30,41,59,0.05)] relative z-40">
58
  {/* Left: Card Counter & Badges (Title moved to Specification) */}
59
+ <div className="flex items-center gap-1.5 sm:gap-2 flex-wrap min-w-0">
60
  {/* Card Counter & Queue Popover Trigger */}
61
+ <div className="relative shrink-0" ref={queueDropdownRef}>
62
  <button
63
  onClick={() => setIsQueueListOpen((prev) => !prev)}
64
+ className="h-7 inline-flex items-center gap-1.5 px-2 sm:px-2.5 bg-amber-300 hover:bg-amber-200 border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer shrink-0"
65
+ title="Click to view all cards due in today's queue"
66
  >
67
  <span className="w-2 h-2 rounded-full bg-emerald-500 animate-ping shrink-0" />
68
+ <span className="font-arcade text-[8px] sm:text-[9px] font-bold text-ink-black tracking-wide whitespace-nowrap">
69
+ {`CARD 1 OF ${totalInQueue}`}
70
  </span>
71
  {totalInQueue > 1 && (
72
+ <ChevronDown className={`w-3 h-3 text-ink-black transition-transform shrink-0 ${isQueueListOpen ? 'rotate-180' : ''}`} />
73
  )}
74
  </button>
75
 
76
  {/* Queue List Popover */}
77
  {isQueueListOpen && reviews.length > 0 && (
78
+ <div className="absolute top-9 left-0 z-50 w-64 min-[400px]:w-72 sm:w-80 bg-paper-white border-[3px] border-ink-black gadget-shadow p-3 space-y-2 max-w-[calc(100vw-32px)]">
79
  <div className="flex items-center justify-between border-b-2 border-ink-black pb-1.5 font-arcade text-[9px] font-bold text-ink-black">
80
+ <span>{`DAILY QUEUE (${reviews.length} CARDS)`}</span>
81
  <button
82
  onClick={() => setIsQueueListOpen(false)}
83
  className="px-1 hover:text-rose-600 font-bold cursor-pointer"
 
86
  ✕
87
  </button>
88
  </div>
89
+ <div className="max-h-60 overflow-y-auto no-scrollbar space-y-1.5 pr-1">
90
  {reviews.map((rev, idx) => {
91
  const revProb = rev.problems || {};
92
  const num = revProb.problem_number;
 
133
 
134
  {/* LeetCode Number Badge */}
135
  {problem.problem_number !== undefined && problem.problem_number !== null && (
136
+ <span className="h-7 inline-flex items-center px-2 font-arcade text-[8px] sm:text-[9px] font-bold bg-amber-200 border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] text-ink-black shrink-0 select-none whitespace-nowrap">
137
  {problem.problem_number > 0 ? `LC #${problem.problem_number}` : 'CUSTOM'}
138
  </span>
139
  )}
140
 
141
  {/* Difficulty pill */}
142
  <span
143
+ className={`h-7 inline-flex items-center px-2 font-arcade text-[8px] sm:text-[9px] font-bold border-2 border-ink-black shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] shrink-0 text-white select-none whitespace-nowrap ${
144
  problem.difficulty === 'Easy'
145
  ? 'bg-emerald-500'
146
  : problem.difficulty === 'Medium'
 
153
  </div>
154
 
155
  {/* Right: Action buttons, Links, Override Exit */}
156
+ <div className="flex items-center gap-1.5 sm:gap-2 shrink-0 flex-wrap justify-end">
157
  <button
158
  onClick={onOpenCreateProblem}
159
+ className="h-7 inline-flex items-center gap-1 px-2 sm:px-2.5 bg-white hover:bg-purple-50 border-2 border-ink-black text-ink-black text-[8px] sm:text-[9px] font-arcade font-bold shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer shrink-0"
160
  title="Create or Import Problem"
161
  >
162
+ <PlusCircle className="w-3 h-3 text-purple-600 shrink-0" />
163
+ <span className="hidden min-[480px]:inline">ADD</span>
164
  </button>
165
 
166
  {onOpenEditProblem && (
167
  <button
168
  onClick={onOpenEditProblem}
169
+ className="h-7 inline-flex items-center gap-1 px-2 sm:px-2.5 bg-white hover:bg-emerald-50 border-2 border-ink-black text-ink-black text-[8px] sm:text-[9px] font-arcade font-bold shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer shrink-0"
170
  title="Edit Problem Specification"
171
  >
172
+ <Edit3 className="w-3 h-3 text-emerald-600 shrink-0" />
173
+ <span className="hidden min-[480px]:inline">EDIT</span>
174
  </button>
175
  )}
176
 
 
180
  href={problem.google_doc_url}
181
  target="_blank"
182
  rel="noreferrer"
183
+ className="h-7 inline-flex items-center gap-1 px-2 sm:px-2.5 bg-white hover:bg-slate-100 border-2 border-ink-black text-ink-black text-[8px] sm:text-[9px] font-arcade font-bold shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer shrink-0"
184
  title="Open Google Doc Notes"
185
  >
186
  <span>DOC</span>
187
+ <ExternalLink className="w-2.5 h-2.5 text-primary shrink-0" />
188
  </a>
189
  )}
190
 
 
192
  href={leetcodeUrl}
193
  target="_blank"
194
  rel="noreferrer"
195
+ className="h-7 inline-flex items-center gap-1 px-2 sm:px-2.5 bg-white hover:bg-slate-100 border-2 border-ink-black text-ink-black text-[8px] sm:text-[9px] font-arcade font-bold shadow-[2px_2px_0px_0px_rgba(30,41,59,1)] active:translate-y-0.5 active:shadow-none transition-all cursor-pointer shrink-0"
196
  title="Search LeetCode"
197
  >
198
  <span>LC</span>
199
+ <ExternalLink className="w-2.5 h-2.5 text-amber-600 shrink-0" />
200
  </a>
201
  </div>
202
  </div>
algospaced-ui/src/hooks/useReviewQueue.ts CHANGED
@@ -42,6 +42,7 @@ export function useReviewQueue({
42
  const onOpenOnboardingRef = useRef(onOpenOnboarding);
43
  const setIsOnboardingOpenRef = useRef(setIsOnboardingOpen);
44
  const onClearOverrideRef = useRef(onClearOverride);
 
45
 
46
  useEffect(() => {
47
  onOpenOnboardingRef.current = onOpenOnboarding;
@@ -60,10 +61,12 @@ export function useReviewQueue({
60
  const fetchQueue = useCallback(async (showLoading = true) => {
61
  if (showLoading) {
62
  setLoading(true);
 
 
 
 
 
63
  }
64
- setGradeError(null);
65
- setCode('');
66
- confettiTriggeredRef.current = false;
67
 
68
  try {
69
  const { data: { session } } = await supabase.auth.getSession();
@@ -74,56 +77,89 @@ export function useReviewQueue({
74
 
75
  const headers = { 'Authorization': `Bearer ${token}` };
76
 
77
- let url = `${import.meta.env.VITE_API_BASE_URL}/api/reviews/due`;
78
- if (overrideProblemId) {
79
- url = `${import.meta.env.VITE_API_BASE_URL}/api/reviews/problems/id/${overrideProblemId}`;
 
 
80
  }
81
 
82
- const res = await fetch(url, { headers });
83
- if (res.ok) {
84
- let data = await res.json();
 
 
 
 
 
 
 
 
85
 
86
- // If an override was requested but returned no reviews (e.g. not yet enrolled into FSRS),
87
- // attempt auto-activation from the canonical catalog
88
- if (overrideProblemId && (!data || data.length === 0)) {
89
- const isNumeric = /^\d+$/.test(overrideProblemId);
90
- const catalogProb = findCatalogProblem(
91
- isNumeric ? parseInt(overrideProblemId, 10) : undefined,
92
- overrideProblemId
 
 
 
93
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
95
- if (catalogProb) {
96
- try {
97
- const actRes = await activateCatalogProblem(catalogProb);
98
- if (actRes?.problem_id) {
99
- const retryRes = await fetch(
100
- `${import.meta.env.VITE_API_BASE_URL}/api/reviews/problems/id/${actRes.problem_id}`,
101
- { headers }
102
- );
103
- if (retryRes.ok) {
104
- const retryData = await retryRes.json();
105
- if (retryData && retryData.length > 0) {
106
- data = retryData;
 
107
  }
108
  }
 
 
109
  }
110
- } catch (actErr) {
111
- console.error('Failed to auto-activate problem for override review:', actErr);
112
  }
113
  }
 
 
 
 
114
  }
 
115
 
116
- setReviews(data);
117
 
118
- // Check if user has completed onboarding protocol
119
- const rawUid = session?.user?.id;
120
- const uid = (rawUid === 'sandbox-user-id' || !rawUid) ? 'sandbox' : rawUid;
121
- const onbDone = localStorage.getItem(`algospaced_onboarding_done_${uid}`);
122
- if (!onbDone && !overrideProblemId) {
123
- handleOpenOnboardingInternal();
124
- }
125
 
126
- if (data && data.length > 0) {
 
127
  const activeReview = data[0];
128
  const rawProblem = activeReview.problems;
129
  const probNum = rawProblem?.problem_number ??
@@ -136,7 +172,8 @@ export function useReviewQueue({
136
 
137
  const starter = catalogProb?.starter_code || rawProblem?.starter_code || '';
138
  setCode(starter);
139
- } else {
 
140
  // Empty queue: discover next milestone from journey progress
141
  try {
142
  const progRes = await fetch(`${import.meta.env.VITE_API_BASE_URL}/api/journey-progress`, { headers });
@@ -150,8 +187,7 @@ export function useReviewQueue({
150
  setNextMilestone(getNextUnsolvedProblem(new Set()) ?? null);
151
  }
152
  }
153
- }
154
- } catch (err) {
155
  console.error('Error fetching review queue:', err);
156
  } finally {
157
  setLoading(false);
@@ -159,6 +195,10 @@ export function useReviewQueue({
159
  }, [overrideProblemId, handleOpenOnboardingInternal]);
160
 
161
  useEffect(() => {
 
 
 
 
162
  let isCancelled = false;
163
  // Invoke asynchronously to avoid cascading synchronous render in effect body
164
  const timer = setTimeout(() => {
@@ -257,30 +297,31 @@ export function useReviewQueue({
257
  }
258
 
259
  if (overrideProblemId && onClearOverrideRef.current) {
 
260
  onClearOverrideRef.current();
261
- } else {
262
- // Optimistically remove the completed card for instant, snappy UI
263
- setReviews((prev) => {
264
- const nextReviews = prev.slice(1);
265
- if (nextReviews.length > 0) {
266
- const nextActive = nextReviews[0];
267
- const rawProb = nextActive.problems;
268
- const probNum = rawProb?.problem_number ??
269
- (/^\d+$/.test(nextActive?.problem_id || '') ? parseInt(nextActive.problem_id, 10) : undefined);
270
- const catalogProb = findCatalogProblem(
271
- probNum,
272
- rawProb?.id || nextActive?.problem_id,
273
- rawProb?.name
274
- );
275
- const nextStarter = catalogProb?.starter_code || rawProb?.starter_code || '';
276
- setCode(nextStarter);
277
- } else {
278
- setCode('');
279
- }
280
- return nextReviews;
281
- });
282
- void fetchQueue(false);
283
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  } else {
285
  const errorData = await res.json().catch(() => ({}));
286
  setGradeError(errorData.detail || `Server returned error (${res.status}). Please try again.`);
 
42
  const onOpenOnboardingRef = useRef(onOpenOnboarding);
43
  const setIsOnboardingOpenRef = useRef(setIsOnboardingOpen);
44
  const onClearOverrideRef = useRef(onClearOverride);
45
+ const isTransitioningOverrideRef = useRef(false);
46
 
47
  useEffect(() => {
48
  onOpenOnboardingRef.current = onOpenOnboarding;
 
61
  const fetchQueue = useCallback(async (showLoading = true) => {
62
  if (showLoading) {
63
  setLoading(true);
64
+ setGradeError(null);
65
+ setCode('');
66
+ confettiTriggeredRef.current = false;
67
+ } else {
68
+ setGradeError(null);
69
  }
 
 
 
70
 
71
  try {
72
  const { data: { session } } = await supabase.auth.getSession();
 
77
 
78
  const headers = { 'Authorization': `Bearer ${token}` };
79
 
80
+ // 1. Fetch current due queue
81
+ const dueRes = await fetch(`${import.meta.env.VITE_API_BASE_URL}/api/reviews/due`, { headers });
82
+ let data: ReviewItem[] = dueRes.ok ? await dueRes.json() : [];
83
+ if (!Array.isArray(data)) {
84
+ data = [];
85
  }
86
 
87
+ // 2. If reviewing a problem from journey path (or override id)
88
+ if (overrideProblemId) {
89
+ const targetStr = String(overrideProblemId).trim().toLowerCase();
90
+ const existingIdx = data.findIndex((r) => {
91
+ const prob = r.problems;
92
+ if (r.problem_id && String(r.problem_id).trim().toLowerCase() === targetStr) return true;
93
+ if (prob?.id && String(prob.id).trim().toLowerCase() === targetStr) return true;
94
+ if (prob?.problem_number !== undefined && prob?.problem_number !== null && String(prob.problem_number) === targetStr) return true;
95
+ if (prob?.name && prob.name.trim().toLowerCase() === targetStr) return true;
96
+ return false;
97
+ });
98
 
99
+ if (existingIdx > 0) {
100
+ // If already in queue, prioritize it to the front as Card 1
101
+ const [targetReview] = data.splice(existingIdx, 1);
102
+ data.unshift(targetReview);
103
+ } else if (existingIdx === -1) {
104
+ // If not in cards yet: fetch its review record or activate it into FSRS and add to cards
105
+ let overrideReview: ReviewItem | null = null;
106
+ const overrideRes = await fetch(
107
+ `${import.meta.env.VITE_API_BASE_URL}/api/reviews/problems/id/${overrideProblemId}`,
108
+ { headers }
109
  );
110
+ if (overrideRes.ok) {
111
+ const overrideData = await overrideRes.json();
112
+ if (Array.isArray(overrideData) && overrideData.length > 0) {
113
+ overrideReview = overrideData[0];
114
+ }
115
+ }
116
+
117
+ if (!overrideReview) {
118
+ const isNumeric = /^\d+$/.test(overrideProblemId);
119
+ const catalogProb = findCatalogProblem(
120
+ isNumeric ? parseInt(overrideProblemId, 10) : undefined,
121
+ overrideProblemId
122
+ );
123
 
124
+ if (catalogProb) {
125
+ try {
126
+ const actRes = await activateCatalogProblem(catalogProb);
127
+ if (actRes?.problem_id) {
128
+ const retryRes = await fetch(
129
+ `${import.meta.env.VITE_API_BASE_URL}/api/reviews/problems/id/${actRes.problem_id}`,
130
+ { headers }
131
+ );
132
+ if (retryRes.ok) {
133
+ const retryData = await retryRes.json();
134
+ if (Array.isArray(retryData) && retryData.length > 0) {
135
+ overrideReview = retryData[0];
136
+ }
137
  }
138
  }
139
+ } catch (actErr) {
140
+ console.error('Failed to auto-activate problem for override review:', actErr);
141
  }
 
 
142
  }
143
  }
144
+
145
+ if (overrideReview) {
146
+ data.unshift(overrideReview);
147
+ }
148
  }
149
+ }
150
 
151
+ setReviews(data);
152
 
153
+ // Check if user has completed onboarding protocol
154
+ const rawUid = session?.user?.id;
155
+ const uid = (rawUid === 'sandbox-user-id' || !rawUid) ? 'sandbox' : rawUid;
156
+ const onbDone = localStorage.getItem(`algospaced_onboarding_done_${uid}`);
157
+ if (!onbDone && !overrideProblemId) {
158
+ handleOpenOnboardingInternal();
159
+ }
160
 
161
+ if (data && data.length > 0) {
162
+ if (showLoading) {
163
  const activeReview = data[0];
164
  const rawProblem = activeReview.problems;
165
  const probNum = rawProblem?.problem_number ??
 
172
 
173
  const starter = catalogProb?.starter_code || rawProblem?.starter_code || '';
174
  setCode(starter);
175
+ }
176
+ } else {
177
  // Empty queue: discover next milestone from journey progress
178
  try {
179
  const progRes = await fetch(`${import.meta.env.VITE_API_BASE_URL}/api/journey-progress`, { headers });
 
187
  setNextMilestone(getNextUnsolvedProblem(new Set()) ?? null);
188
  }
189
  }
190
+ } catch (err) {
 
191
  console.error('Error fetching review queue:', err);
192
  } finally {
193
  setLoading(false);
 
195
  }, [overrideProblemId, handleOpenOnboardingInternal]);
196
 
197
  useEffect(() => {
198
+ if (isTransitioningOverrideRef.current) {
199
+ isTransitioningOverrideRef.current = false;
200
+ return;
201
+ }
202
  let isCancelled = false;
203
  // Invoke asynchronously to avoid cascading synchronous render in effect body
204
  const timer = setTimeout(() => {
 
297
  }
298
 
299
  if (overrideProblemId && onClearOverrideRef.current) {
300
+ isTransitioningOverrideRef.current = true;
301
  onClearOverrideRef.current();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  }
303
+
304
+ // Optimistically remove the completed card for instant, snappy UI
305
+ setReviews((prev) => {
306
+ const nextReviews = prev.slice(1);
307
+ if (nextReviews.length > 0) {
308
+ const nextActive = nextReviews[0];
309
+ const rawProb = nextActive.problems;
310
+ const probNum = rawProb?.problem_number ??
311
+ (/^\d+$/.test(nextActive?.problem_id || '') ? parseInt(nextActive.problem_id, 10) : undefined);
312
+ const catalogProb = findCatalogProblem(
313
+ probNum,
314
+ rawProb?.id || nextActive?.problem_id,
315
+ rawProb?.name
316
+ );
317
+ const nextStarter = catalogProb?.starter_code || rawProb?.starter_code || '';
318
+ setCode(nextStarter);
319
+ } else {
320
+ setCode('');
321
+ }
322
+ return nextReviews;
323
+ });
324
+ void fetchQueue(false);
325
  } else {
326
  const errorData = await res.json().catch(() => ({}));
327
  setGradeError(errorData.detail || `Server returned error (${res.status}). Please try again.`);
algospaced-ui/src/index.css CHANGED
@@ -56,7 +56,7 @@ body {
56
  vertical-align: middle;
57
  }
58
 
59
- /* Custom Scrollbars - Retro & Chunky */
60
  ::-webkit-scrollbar {
61
  width: 12px;
62
  height: 12px;
@@ -64,31 +64,73 @@ body {
64
 
65
  ::-webkit-scrollbar-track {
66
  background: #F9F8F3;
67
- border-left: 3px solid #1E293B;
68
  }
69
 
70
  ::-webkit-scrollbar-thumb {
71
- background: #fde047;
72
- border: 3px solid #1E293B;
73
- border-radius: 4px;
74
  }
75
 
76
  ::-webkit-scrollbar-thumb:hover {
77
- background: #ffe24c;
78
  }
79
 
80
  /* Specific scrollbar styling for windows that scroll */
 
 
 
 
 
81
  .custom-scrollbar::-webkit-scrollbar {
82
  width: 10px;
83
  height: 10px;
84
  }
 
85
  .custom-scrollbar::-webkit-scrollbar-track {
86
- background: #F9F8F3;
87
- border-left: 3px solid #1E293B;
88
  }
 
 
 
 
 
 
 
 
 
 
 
89
  .custom-scrollbar::-webkit-scrollbar-thumb {
90
- background: #0ea5e9;
91
- border: 3px solid #1E293B;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
 
94
  /* Retro Shadow Effects */
 
56
  vertical-align: middle;
57
  }
58
 
59
+ /* Custom Scrollbars - Retro & Chunky (1-bit / Neo-brutalist Flat Style) */
60
  ::-webkit-scrollbar {
61
  width: 12px;
62
  height: 12px;
 
64
 
65
  ::-webkit-scrollbar-track {
66
  background: #F9F8F3;
67
+ border-left: 2px solid #1E293B;
68
  }
69
 
70
  ::-webkit-scrollbar-thumb {
71
+ background: #1E293B;
72
+ border-radius: 0px;
 
73
  }
74
 
75
  ::-webkit-scrollbar-thumb:hover {
76
+ background: #334155;
77
  }
78
 
79
  /* Specific scrollbar styling for windows that scroll */
80
+ .custom-scrollbar {
81
+ scrollbar-width: thin;
82
+ scrollbar-color: #1E293B #F4F1EA;
83
+ }
84
+
85
  .custom-scrollbar::-webkit-scrollbar {
86
  width: 10px;
87
  height: 10px;
88
  }
89
+
90
  .custom-scrollbar::-webkit-scrollbar-track {
91
+ background: #F4F1EA;
 
92
  }
93
+
94
+ .custom-scrollbar::-webkit-scrollbar-track:vertical {
95
+ border-left: 2px solid #1E293B;
96
+ border-top: none;
97
+ }
98
+
99
+ .custom-scrollbar::-webkit-scrollbar-track:horizontal {
100
+ border-top: 2px solid #1E293B;
101
+ border-left: none;
102
+ }
103
+
104
  .custom-scrollbar::-webkit-scrollbar-thumb {
105
+ background: #1E293B;
106
+ border-radius: 0px !important;
107
+ border: none;
108
+ }
109
+
110
+ .custom-scrollbar::-webkit-scrollbar-thumb:hover {
111
+ background: #334155;
112
+ }
113
+
114
+ .custom-scrollbar::-webkit-scrollbar-thumb:active {
115
+ background: #0F172A;
116
+ }
117
+
118
+ .custom-scrollbar::-webkit-scrollbar-corner {
119
+ background: #F4F1EA;
120
+ border-left: 2px solid #1E293B;
121
+ border-top: 2px solid #1E293B;
122
+ }
123
+
124
+ /* Utility to completely suppress scrollbars while preserving touch/wheel scroll */
125
+ .no-scrollbar::-webkit-scrollbar {
126
+ display: none !important;
127
+ width: 0 !important;
128
+ height: 0 !important;
129
+ }
130
+
131
+ .no-scrollbar {
132
+ -ms-overflow-style: none !important;
133
+ scrollbar-width: none !important;
134
  }
135
 
136
  /* Retro Shadow Effects */
algospaced-ui/src/utils/markdownUtils.tsx ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React from 'react';
2
+ import katex from 'katex';
3
+ import 'katex/dist/katex.min.css';
4
+
5
+ export function renderKatex(math: string, displayMode: boolean = false): string {
6
+ try {
7
+ return katex.renderToString(math.trim(), {
8
+ displayMode,
9
+ throwOnError: false,
10
+ output: 'html'
11
+ });
12
+ } catch {
13
+ const escaped = math
14
+ .replace(/&/g, '&amp;')
15
+ .replace(/</g, '&lt;')
16
+ .replace(/>/g, '&gt;');
17
+ return `<span class="katex-error text-rose-600 font-mono text-[11px]">${escaped}</span>`;
18
+ }
19
+ }
20
+
21
+ /**
22
+ * Tokenize and render inline text elements (inline math, code, bold, italic, links).
23
+ */
24
+ export function renderInlineMarkdown(text: string): React.ReactNode[] {
25
+ if (!text) return [];
26
+
27
+ // Regex matching inline tokens in order:
28
+ // 1. Display math: $$ ... $$
29
+ // 2. Display math: \[ ... \]
30
+ // 3. Inline math: \( ... \)
31
+ // 4. Inline math: $ ... $ (non-greedy)
32
+ // 5. Inline code: ` ... `
33
+ // 6. Bold: ** ... ** or __ ... __
34
+ // 7. Italic: * ... * or _ ... _
35
+ // 8. Link: [text](url)
36
+ const tokenRegex = /(\$\$[\s\S]*?\$\$|\\\[[\s\S]*?\\\]|\\\([\s\S]*?\\\)|\$(?:\\\$|[^$\n])+?\$|`[^`\n]+`|\*\*[^*\n]+\*\*|__[^_\n]+__|(?<!\*)\*[^*\n]+(?<!\*)\*|(?<!_)_[^_\n]+(?<!_)_|\[[^\]\n]+\]\([^)\n]+\))/g;
37
+
38
+ const parts = text.split(tokenRegex);
39
+
40
+ return parts.map((part, index) => {
41
+ if (!part) return null;
42
+
43
+ // 1. Display math $$ ... $$
44
+ if (part.startsWith('$$') && part.endsWith('$$') && part.length >= 4) {
45
+ const math = part.slice(2, -2);
46
+ if (!math.trim()) return part;
47
+ const html = renderKatex(math, true);
48
+ return (
49
+ <span
50
+ key={index}
51
+ className="inline-block my-1 px-1 overflow-x-auto align-middle"
52
+ dangerouslySetInnerHTML={{ __html: html }}
53
+ />
54
+ );
55
+ }
56
+
57
+ // 2. Display math \[ ... \]
58
+ if (part.startsWith('\\[') && part.endsWith('\\]') && part.length >= 4) {
59
+ const math = part.slice(2, -2);
60
+ if (!math.trim()) return part;
61
+ const html = renderKatex(math, true);
62
+ return (
63
+ <span
64
+ key={index}
65
+ className="inline-block my-1 px-1 overflow-x-auto align-middle"
66
+ dangerouslySetInnerHTML={{ __html: html }}
67
+ />
68
+ );
69
+ }
70
+
71
+ // 3. Inline math \( ... \)
72
+ if (part.startsWith('\\(') && part.endsWith('\\)') && part.length >= 4) {
73
+ const math = part.slice(2, -2);
74
+ if (!math.trim()) return part;
75
+ const html = renderKatex(math, false);
76
+ return (
77
+ <span
78
+ key={index}
79
+ className="inline-katex px-0.5 align-baseline"
80
+ dangerouslySetInnerHTML={{ __html: html }}
81
+ />
82
+ );
83
+ }
84
+
85
+ // 4. Inline math $ ... $
86
+ if (part.startsWith('$') && part.endsWith('$') && part.length >= 2) {
87
+ const math = part.slice(1, -1);
88
+ if (!math.trim()) return part;
89
+ const html = renderKatex(math, false);
90
+ return (
91
+ <span
92
+ key={index}
93
+ className="inline-katex px-0.5 align-baseline"
94
+ dangerouslySetInnerHTML={{ __html: html }}
95
+ />
96
+ );
97
+ }
98
+
99
+ // 5. Inline code ` ... `
100
+ if (part.startsWith('`') && part.endsWith('`') && part.length >= 2) {
101
+ return (
102
+ <code
103
+ key={index}
104
+ className="bg-[#1E293B] text-[#4ADE80] px-1.5 py-0.5 rounded text-[11px] font-mono border border-ink-black shadow-[1px_1px_0px_0px_#000]"
105
+ >
106
+ {part.slice(1, -1)}
107
+ </code>
108
+ );
109
+ }
110
+
111
+ // 6. Bold ** ... ** or __ ... __
112
+ if (
113
+ (part.startsWith('**') && part.endsWith('**') && part.length >= 4) ||
114
+ (part.startsWith('__') && part.endsWith('__') && part.length >= 4)
115
+ ) {
116
+ return (
117
+ <strong key={index} className="text-ink-black font-extrabold">
118
+ {renderInlineMarkdown(part.slice(2, -2))}
119
+ </strong>
120
+ );
121
+ }
122
+
123
+ // 7. Italic * ... * or _ ... _
124
+ if (
125
+ (part.startsWith('*') && part.endsWith('*') && part.length >= 2) ||
126
+ (part.startsWith('_') && part.endsWith('_') && part.length >= 2)
127
+ ) {
128
+ return (
129
+ <em key={index} className="italic text-slate-800">
130
+ {renderInlineMarkdown(part.slice(1, -1))}
131
+ </em>
132
+ );
133
+ }
134
+
135
+ // 8. Link [text](url)
136
+ const linkMatch = part.match(/^\[([^\]]+)\]\(([^)]+)\)$/);
137
+ if (linkMatch) {
138
+ return (
139
+ <a
140
+ key={index}
141
+ href={linkMatch[2]}
142
+ target="_blank"
143
+ rel="noopener noreferrer"
144
+ className="text-primary underline hover:text-primary/80 font-bold"
145
+ >
146
+ {linkMatch[1]}
147
+ </a>
148
+ );
149
+ }
150
+
151
+ return part;
152
+ });
153
+ }
algospaced-ui/src/utils/problemContentParser.tsx CHANGED
@@ -105,91 +105,14 @@ export function parseProblemContent(problem: ProblemItem | null | undefined): {
105
  return { description, examples, constraints };
106
  }
107
 
108
- export function renderInlineMarkdown(text: string): React.ReactNode[] {
109
- const regex = /(\*\*.*?\*\*|`.*?`)/g;
110
- const tokens = text.split(regex);
111
-
112
- return tokens.map((token, index) => {
113
- if (token.startsWith('**') && token.endsWith('**')) {
114
- return (
115
- <strong key={index} className="text-ink-black font-bold">
116
- {token.slice(2, -2)}
117
- </strong>
118
- );
119
- }
120
- if (token.startsWith('`') && token.endsWith('`')) {
121
- return (
122
- <code
123
- key={index}
124
- className="bg-[#1E293B] text-[#4ADE80] px-1.5 py-0.5 font-code-mono text-[11px] border border-ink-black"
125
- >
126
- {token.slice(1, -1)}
127
- </code>
128
- );
129
- }
130
- return token;
131
- });
132
- }
133
 
134
- export function parseMarkdown(text: string): React.ReactNode[] {
135
- const parts = text.split(/(```[\s\S]*?```)/g);
136
- return parts.map((part, index) => {
137
- if (part.startsWith('```')) {
138
- const lines = part.split('\n');
139
- const code = lines.slice(1, -1).join('\n');
140
- return (
141
- <pre
142
- key={index}
143
- className="bg-[#1E293B] p-3 border border-ink-black overflow-x-auto font-code-mono text-[11px] text-[#4ADE80] my-2 select-text"
144
- >
145
- <code>{code}</code>
146
- </pre>
147
- );
148
- }
149
 
150
- const lines = part.split('\n');
151
- return lines.map((line, lineIndex) => {
152
- const key = `${index}-${lineIndex}`;
153
- if (line.startsWith('### ')) {
154
- return (
155
- <h3 key={key} className="text-xs font-bold text-ink-black mt-3 mb-1.5 uppercase font-arcade">
156
- {line.substring(4)}
157
- </h3>
158
- );
159
- }
160
- if (line.startsWith('## ')) {
161
- return (
162
- <h2 key={key} className="text-sm font-bold text-ink-black mt-4 mb-2 font-headline-md">
163
- {line.substring(3)}
164
- </h2>
165
- );
166
- }
167
- if (line.startsWith('# ')) {
168
- return (
169
- <h1 key={key} className="text-base font-extrabold text-ink-black mt-5 mb-2 font-headline-md">
170
- {line.substring(2)}
171
- </h1>
172
- );
173
- }
174
- if (line.trim().startsWith('- ') || line.trim().startsWith('* ')) {
175
- const content = line.trim().substring(2);
176
- return (
177
- <div key={key} className="flex items-start gap-1.5 pl-2 my-1">
178
- <span className="text-primary mt-1">•</span>
179
- <span className="text-ink-black text-xs leading-relaxed">{renderInlineMarkdown(content)}</span>
180
- </div>
181
- );
182
- }
183
- if (line.trim() === '') {
184
- return <div key={key} className="h-2" />;
185
- }
186
- return (
187
- <p key={key} className="text-ink-black text-xs leading-relaxed my-1">
188
- {renderInlineMarkdown(line)}
189
- </p>
190
- );
191
- });
192
- });
193
  }
194
 
195
  export interface ParsedProblemTitle {
 
105
  return { description, examples, constraints };
106
  }
107
 
108
+ import { renderInlineMarkdown } from './markdownUtils';
109
+ import { MarkdownRenderer } from '../components/MarkdownRenderer';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
 
111
+ export { renderInlineMarkdown };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
+ export function parseMarkdown(text: string): React.ReactNode[] {
114
+ if (!text) return [];
115
+ return [<MarkdownRenderer key="md-content" content={text} />];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  }
117
 
118
  export interface ParsedProblemTitle {