loki-mode 7.45.1 → 7.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +16 -12
  2. package/SKILL.md +5 -5
  3. package/VERSION +1 -1
  4. package/autonomy/CONSTITUTION.md +9 -2
  5. package/autonomy/completion-council.sh +113 -0
  6. package/autonomy/lib/sentrux-gate.sh +1 -1
  7. package/autonomy/loki +2 -2
  8. package/autonomy/run.sh +445 -96
  9. package/autonomy/spec-interrogation.sh +549 -0
  10. package/dashboard/__init__.py +1 -1
  11. package/dashboard/auth.py +117 -2
  12. package/dashboard/server.py +9 -10
  13. package/docs/ACKNOWLEDGEMENTS.md +1 -1
  14. package/docs/COMPARISON.md +10 -10
  15. package/docs/COMPETITIVE-ANALYSIS.md +2 -2
  16. package/docs/INSTALLATION.md +2 -2
  17. package/docs/OPEN-CORE-BOUNDARY.md +6 -5
  18. package/docs/P0-SWEEP-PLAN.md +163 -0
  19. package/docs/P2-SPEC-ROBUSTNESS-PLAN.md +192 -0
  20. package/docs/R9-OPEN-CORE-HOOKS-PLAN.md +2 -2
  21. package/docs/architecture/STATE-MACHINES.md +18 -19
  22. package/docs/architecture/bmad-loki-voice-agent-council-analysis.md +1 -1
  23. package/docs/auto-claude-comparison.md +16 -13
  24. package/docs/certification/01-core-concepts/lesson.md +12 -11
  25. package/docs/certification/01-core-concepts/quiz.md +6 -6
  26. package/docs/certification/05-troubleshooting/lesson.md +23 -13
  27. package/docs/certification/05-troubleshooting/quiz.md +3 -3
  28. package/docs/certification/README.md +1 -1
  29. package/docs/certification/answer-key.md +2 -2
  30. package/docs/certification/certification-exam.md +9 -9
  31. package/docs/competitive/bolt-new-analysis.md +2 -2
  32. package/docs/competitive/emergence-others-analysis.md +14 -14
  33. package/docs/competitive/replit-lovable-analysis.md +7 -7
  34. package/docs/cursor-comparison.md +15 -12
  35. package/docs/dashboard-guide.md +9 -7
  36. package/docs/enterprise/security.md +43 -3
  37. package/docs/prd-purple-lab-platform-v2.md +1 -1
  38. package/docs/prd-purple-lab-platform.md +3 -3
  39. package/docs/show-hn-post.md +3 -3
  40. package/loki-ts/dist/loki.js +2 -2
  41. package/mcp/__init__.py +1 -1
  42. package/package.json +2 -2
  43. package/plugins/loki-mode/.claude-plugin/plugin.json +2 -2
  44. package/plugins/loki-mode/README.md +1 -1
  45. package/references/magic-rarv-integration.md +1 -1
  46. package/references/quality-control.md +5 -5
  47. package/references/sdlc-phases.md +1 -2
  48. package/skills/00-index.md +1 -1
  49. package/skills/artifacts.md +1 -1
  50. package/skills/healing.md +1 -1
  51. package/skills/magic-modules.md +3 -3
  52. package/skills/quality-gates.md +52 -39
  53. package/skills/testing.md +1 -1
  54. package/web-app/dist/assets/{AdminPage-CKUOsWZW.js → AdminPage-CcCJ0Sjt.js} +1 -1
  55. package/web-app/dist/assets/{Avatar-CL9Id9Hi.js → Avatar-DK8kmayw.js} +1 -1
  56. package/web-app/dist/assets/{Badge-B12zwlD7.js → Badge-4uAWnemi.js} +1 -1
  57. package/web-app/dist/assets/{Button-CFLVoduT.js → Button-BBMk33tk.js} +1 -1
  58. package/web-app/dist/assets/ComparePage-bt9rwvST.js +1 -0
  59. package/web-app/dist/assets/{GitHubIssuesPanel-CSitxtAX.js → GitHubIssuesPanel-WDbH47UM.js} +1 -1
  60. package/web-app/dist/assets/{GitHubPRsPanel-BIT06FRo.js → GitHubPRsPanel-C2CiYtTx.js} +1 -1
  61. package/web-app/dist/assets/{HomePage-pU_0fGny.js → HomePage-BQk-MUjn.js} +4 -4
  62. package/web-app/dist/assets/{LoginPage-DTZtt2Yb.js → LoginPage-DMOZVGGL.js} +1 -1
  63. package/web-app/dist/assets/{MagicPage-10zfra8o.js → MagicPage-Bzp2Nt1z.js} +1 -1
  64. package/web-app/dist/assets/{MetricsPage-C-wiKUkv.js → MetricsPage-C39JVdsw.js} +1 -1
  65. package/web-app/dist/assets/{NotFoundPage-BDkcmhYe.js → NotFoundPage-6vT_U9UL.js} +1 -1
  66. package/web-app/dist/assets/{ProjectPage-CiCavQ8n.js → ProjectPage-BfFcZp-E.js} +3 -3
  67. package/web-app/dist/assets/{ProjectsPage-BLCXQwwC.js → ProjectsPage-CPMBf8Wt.js} +1 -1
  68. package/web-app/dist/assets/{SettingsPage-PkxtaMyg.js → SettingsPage-BnNN6ETl.js} +1 -1
  69. package/web-app/dist/assets/{ShowcasePage-iECp8Tha.js → ShowcasePage-WDrMf-cx.js} +1 -1
  70. package/web-app/dist/assets/{SystemSettingsPage-DS6Anno1.js → SystemSettingsPage-DX4jb2e8.js} +1 -1
  71. package/web-app/dist/assets/{TeamsPage-ls6h6bNL.js → TeamsPage-BCfqcXzu.js} +1 -1
  72. package/web-app/dist/assets/{TemplatesPage-Bk0QzlPt.js → TemplatesPage-CZvmimDj.js} +1 -1
  73. package/web-app/dist/assets/{TerminalOutput-4-1hWCtZ.js → TerminalOutput-BlRqFwWV.js} +1 -1
  74. package/web-app/dist/assets/{activity-DH3ih2nS.js → activity-CacZsUyr.js} +1 -1
  75. package/web-app/dist/assets/{bell-Gn17S6uv.js → bell-DK2qtHnk.js} +1 -1
  76. package/web-app/dist/assets/{bot-Cbycc3VE.js → bot-CkcUtHad.js} +1 -1
  77. package/web-app/dist/assets/{check-nIAqa-kf.js → check-CbCPjX3M.js} +1 -1
  78. package/web-app/dist/assets/{chevron-left-D2jcWDll.js → chevron-left-5NUKWw3i.js} +1 -1
  79. package/web-app/dist/assets/{circle-alert-CpL4Bhvt.js → circle-alert-S7uFoxC2.js} +1 -1
  80. package/web-app/dist/assets/{clock-IW4Wq86N.js → clock-CaQRrIrs.js} +1 -1
  81. package/web-app/dist/assets/{cloud-Cn8nNuH2.js → cloud-DBAX6c0r.js} +1 -1
  82. package/web-app/dist/assets/{code-xml-BiJBteXf.js → code-xml-De5-EXv3.js} +1 -1
  83. package/web-app/dist/assets/{copy-CnqkyNsi.js → copy-CUkT6k1v.js} +1 -1
  84. package/web-app/dist/assets/{database-CKSReqa5.js → database-BAWf1Gwt.js} +1 -1
  85. package/web-app/dist/assets/{dollar-sign-CDzDY64R.js → dollar-sign-Ji8zk86R.js} +1 -1
  86. package/web-app/dist/assets/{file-code-corner-Box4IwG1.js → file-code-corner-ChtXoBwS.js} +1 -1
  87. package/web-app/dist/assets/{file-plus-DpGqlXF8.js → file-plus-bFa37P76.js} +1 -1
  88. package/web-app/dist/assets/{folder-open-B57dAoBv.js → folder-open-DhXpXscO.js} +1 -1
  89. package/web-app/dist/assets/{git-commit-horizontal-BVbucmO5.js → git-commit-horizontal-DVPeDQ3j.js} +1 -1
  90. package/web-app/dist/assets/{globe-BkOnKl4x.js → globe-BPZgPeeu.js} +1 -1
  91. package/web-app/dist/assets/{hammer-DRbIQ4QU.js → hammer-jLCaujYH.js} +1 -1
  92. package/web-app/dist/assets/{index-CM_b_EhP.js → index-B-0iHBPO.js} +2 -2
  93. package/web-app/dist/assets/{layers-B78BiFiU.js → layers-B1vsrsFW.js} +1 -1
  94. package/web-app/dist/assets/{lightbulb-B-Itbm9g.js → lightbulb-C-uLoq9Y.js} +1 -1
  95. package/web-app/dist/assets/{loader-circle-Oq6NQhW2.js → loader-circle-JTfD-ZuM.js} +1 -1
  96. package/web-app/dist/assets/{lock-DbJ9zxbw.js → lock-G9rxD4gZ.js} +1 -1
  97. package/web-app/dist/assets/{mail-CzMRod6m.js → mail-BJ0PTN_V.js} +1 -1
  98. package/web-app/dist/assets/{package-WZ5osvej.js → package-CXClfLOO.js} +1 -1
  99. package/web-app/dist/assets/{plus-j08lFR-K.js → plus-EoL5OCB7.js} +1 -1
  100. package/web-app/dist/assets/{refresh-cw-CIr7E-g2.js → refresh-cw-BjREUnVq.js} +1 -1
  101. package/web-app/dist/assets/{rotate-ccw-gwoXxDeE.js → rotate-ccw-DahWX07H.js} +1 -1
  102. package/web-app/dist/assets/{save-B8fV_ZpE.js → save-Dek3gCn1.js} +1 -1
  103. package/web-app/dist/assets/{server-D5dO1paz.js → server-D6V1BAia.js} +1 -1
  104. package/web-app/dist/assets/{shield-alert-Du08zhdg.js → shield-alert-BtTK5Sxb.js} +1 -1
  105. package/web-app/dist/assets/{trash-2-DEKSVae5.js → trash-2-BT5o_g0r.js} +1 -1
  106. package/web-app/dist/assets/{trending-down-DBiXUtxJ.js → trending-down-D4Jk7KF3.js} +1 -1
  107. package/web-app/dist/assets/{trending-up-BgmK_tHq.js → trending-up-EQFTzhEo.js} +1 -1
  108. package/web-app/dist/assets/{upload-IaViyeVD.js → upload-JfI5lCSE.js} +1 -1
  109. package/web-app/dist/assets/{usePolling-PiRLqNu6.js → usePolling-BnhPUuGd.js} +1 -1
  110. package/web-app/dist/assets/{user-BB5J8wAF.js → user-DSUiUYtj.js} +1 -1
  111. package/web-app/dist/index.html +1 -1
  112. package/web-app/dist/assets/ComparePage-Dg0UdZAk.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as he,j as e,P as We,r as n,a as j,C as Ue,M as fe,R as re,u as ae,b as Ve,A as Qe,S as Ye,d as Ke,U as Ze,e as Je}from"./index-CM_b_EhP.js";import{u as R}from"./usePolling-PiRLqNu6.js";import{P as Xe,S as et,F as tt,E as F,T as st}from"./TerminalOutput-4-1hWCtZ.js";import{B as rt}from"./Badge-B12zwlD7.js";import{P as at}from"./package-WZ5osvej.js";import{C as nt}from"./cloud-Cn8nNuH2.js";import{C as be}from"./code-xml-BiJBteXf.js";import{H as it}from"./hammer-DRbIQ4QU.js";import{C as lt}from"./chevron-left-D2jcWDll.js";import{L as ot}from"./layers-B78BiFiU.js";import{C as ct}from"./check-nIAqa-kf.js";import{M as dt}from"./mail-CzMRod6m.js";import{B as xt}from"./bell-Gn17S6uv.js";import{F as mt}from"./file-code-corner-Box4IwG1.js";import"./lock-DbJ9zxbw.js";import"./clock-IW4Wq86N.js";import"./circle-alert-CpL4Bhvt.js";/**
1
+ import{c as he,j as e,P as We,r as n,a as j,C as Ue,M as fe,R as re,u as ae,b as Ve,A as Qe,S as Ye,d as Ke,U as Ze,e as Je}from"./index-B-0iHBPO.js";import{u as R}from"./usePolling-BnhPUuGd.js";import{P as Xe,S as et,F as tt,E as F,T as st}from"./TerminalOutput-BlRqFwWV.js";import{B as rt}from"./Badge-4uAWnemi.js";import{P as at}from"./package-CXClfLOO.js";import{C as nt}from"./cloud-DBAX6c0r.js";import{C as be}from"./code-xml-De5-EXv3.js";import{H as lt}from"./hammer-jLCaujYH.js";import{C as it}from"./chevron-left-5NUKWw3i.js";import{L as ot}from"./layers-B1vsrsFW.js";import{C as ct}from"./check-CbCPjX3M.js";import{M as dt}from"./mail-BJ0PTN_V.js";import{B as mt}from"./bell-DK2qtHnk.js";import{F as xt}from"./file-code-corner-ChtXoBwS.js";import"./lock-G9rxD4gZ.js";import"./clock-CaQRrIrs.js";import"./circle-alert-S7uFoxC2.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,7 +8,7 @@ import{c as he,j as e,P as We,r as n,a as j,C as Ue,M as fe,R as re,u as ae,b as
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const ht=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],ft=he("party-popper",ht);function bt(t){if(t<60)return`${Math.round(t)}s`;if(t<3600)return`${Math.floor(t/60)}m ${Math.round(t%60)}s`;const s=Math.floor(t/3600),r=Math.floor(t%3600/60);return`${s}h ${r}m`}function gt(t,s){if(!t||t<=0)return"--";const r={simple:{opus:1,haiku:1,total:3},standard:{opus:2,haiku:2,total:5},complex:{opus:3,haiku:3,total:8}},a=r[s]||r.standard;return t<=a.opus?"Opus":t>a.total-a.haiku?"Haiku":"Sonnet"}function jt({status:t,prdSummary:s,onStop:r,onPause:a,onResume:i,isPaused:o}){const l=t?gt(t.iteration??0,t.complexity||"standard"):"--",d=o??(t==null?void 0:t.paused)??!1;return e.jsxs("div",{className:"card px-5 py-3 flex items-center gap-6 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium",children:"Phase"}),e.jsx("span",{className:"font-mono font-semibold text-ink",children:(t==null?void 0:t.phase)||"idle"})]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium",children:"Complexity"}),e.jsx("span",{className:`font-mono font-semibold ${(t==null?void 0:t.complexity)==="complex"?"text-warning":(t==null?void 0:t.complexity)==="simple"?"text-success":"text-ink"}`,children:(t==null?void 0:t.complexity)||"standard"})]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium",children:"Model"}),e.jsx("span",{className:`font-mono font-semibold px-2 py-0.5 rounded-md text-xs ${l==="Opus"?"bg-primary/10 text-primary":l==="Haiku"?"bg-success/10 text-success":"bg-primary/10 text-primary"}`,children:l})]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium",children:"Tasks"}),e.jsx("span",{className:"font-mono text-ink",children:t!=null&&t.current_task?e.jsx("span",{className:"text-xs",children:t.current_task}):e.jsx("span",{className:"text-muted",children:"--"})}),((t==null?void 0:t.pending_tasks)??0)>0&&e.jsxs("span",{className:"text-xs text-primary font-mono",children:["+",t==null?void 0:t.pending_tasks," pending"]})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium flex-shrink-0",children:"Building"}),e.jsx("span",{className:"text-xs font-mono text-ink truncate max-w-[220px]",title:s,children:s.length>60?s.slice(0,60)+"...":s})]})]}),e.jsx("div",{className:"flex-1"}),((t==null?void 0:t.uptime)??0)>0&&e.jsx("span",{className:"font-mono text-xs text-muted",children:bt((t==null?void 0:t.uptime)??0)}),(a||i)&&e.jsxs("button",{onClick:d?i:a,className:"flex items-center gap-1.5 px-4 py-1.5 rounded-btn text-xs font-semibold border border-warning/30 text-warning hover:bg-warning/10 transition-colors",children:[d?e.jsx(We,{size:14}):e.jsx(Xe,{size:14}),d?"Resume":"Pause"]}),r&&e.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-4 py-1.5 rounded-btn text-xs font-semibold bg-danger/10 text-danger border border-danger/20 hover:bg-danger/20 transition-colors",children:[e.jsx(et,{size:14}),"Stop"]})]})}function vt({status:t}){const s=[{label:"Iteration",value:t?t.iteration.toString():"--",color:"text-primary"},{label:"Agents",value:t?t.running_agents.toString():"--",color:t&&t.running_agents>0?"text-success":"text-muted"},{label:"Pending",value:t?t.pending_tasks.toString():"--",color:t&&t.pending_tasks>0?"text-warning":"text-muted"},{label:"Provider",value:(t==null?void 0:t.provider)||"--",color:"text-primary"}];return e.jsx("div",{className:"grid grid-cols-4 gap-3",children:s.map(r=>e.jsxs("div",{className:"card p-4 text-center",children:[e.jsx("div",{className:`text-2xl font-bold font-mono ${r.color}`,children:r.value}),e.jsx("div",{className:"text-xs text-muted font-medium mt-1 uppercase tracking-wider",children:r.label})]},r.label))})}function yt({plan:t,loading:s,onConfirm:r,onCancel:a}){return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-sm",children:e.jsxs("div",{className:"card w-full max-w-lg mx-4 p-6 rounded-card shadow-card-hover",children:[e.jsx("h2",{className:"text-lg font-bold text-ink mb-4",children:"Build Estimate"}),s?e.jsxs("div",{className:"flex flex-col items-center py-8 gap-3",children:[e.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"}),e.jsx("p",{className:"text-sm text-muted",children:"Analyzing spec..."}),e.jsxs("div",{className:"flex gap-3 mt-4",children:[e.jsx("button",{onClick:a,className:"px-4 py-2 text-sm font-medium text-muted hover:text-ink transition-colors",children:"Cancel"}),e.jsx("button",{onClick:r,className:"px-4 py-2 text-sm font-medium text-primary hover:text-primary/80 transition-colors underline",children:"Skip analysis, build now"})]})]}):t?e.jsxs(e.Fragment,{children:[t.returncode!==0&&e.jsxs("div",{className:"mb-4 px-3 py-2 rounded-btn bg-warning/10 border border-warning/20 text-warning text-xs",children:["loki plan exited with code ",t.returncode," - showing partial results"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Complexity"}),e.jsx("div",{className:"text-base font-bold text-ink capitalize",children:t.complexity})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Est. Cost"}),e.jsx("div",{className:"text-base font-bold text-ink",children:t.cost_estimate})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Iterations"}),e.jsx("div",{className:"text-base font-bold text-ink",children:t.iterations})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Phases"}),e.jsx("div",{className:"text-xs text-ink capitalize",children:t.phases.join(", ")})]})]}),t.output_text&&e.jsxs("details",{className:"mb-4",children:[e.jsx("summary",{className:"text-xs text-muted cursor-pointer hover:text-ink transition-colors",children:"Raw output"}),e.jsx("pre",{className:"mt-2 text-xs font-mono text-muted-accessible bg-black/5 rounded-card p-3 overflow-auto max-h-40 whitespace-pre-wrap",children:t.output_text})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:a,className:"px-4 py-2 text-sm font-medium text-muted hover:text-ink transition-colors",children:"Cancel"}),e.jsx("button",{onClick:r,className:"px-5 py-2 rounded-card text-sm font-semibold bg-primary text-white hover:bg-primary/90 transition-all shadow-button",children:"Start Build"})]})]}):e.jsx("div",{className:"text-sm text-muted py-4",children:"No plan data available."})]})})}function Nt({onSubmit:t,running:s,error:r,provider:a,onProviderChange:i,initialPrd:o}){const[l,d]=n.useState(""),[c,m]=n.useState(""),[u,v]=n.useState("claude"),[p,b]=n.useState(""),y=a??u,[N,k]=n.useState(!1),[w,B]=n.useState([]),[h,L]=n.useState(!1),[E,z]=n.useState(!1),[I,C]=n.useState(!1),[H,S]=n.useState(null),[A,_]=n.useState(!1),[q,$]=n.useState(!1);n.useEffect(()=>{j.getTemplates().then(g=>{B(g),L(!1)}).catch(()=>{B([]),L(!0)})},[]),n.useEffect(()=>{o&&d(o)},[o]),n.useEffect(()=>{if(o)return;const g=localStorage.getItem("loki-prd-draft");g&&d(g),j.getPrdPrefill().then(({content:D})=>{D&&d(D)}).catch(()=>{})},[o]),n.useEffect(()=>{l.trim()?localStorage.setItem("loki-prd-draft",l):localStorage.removeItem("loki-prd-draft")},[l]);const V=n.useCallback(async(g,D)=>{m(D),k(!1);try{const T=await j.getTemplateContent(g);d(T.content)}catch{d(`# ${D}
11
+ */const ht=[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]],ft=he("party-popper",ht);function bt(t){if(t<60)return`${Math.round(t)}s`;if(t<3600)return`${Math.floor(t/60)}m ${Math.round(t%60)}s`;const s=Math.floor(t/3600),r=Math.floor(t%3600/60);return`${s}h ${r}m`}function gt(t,s){if(!t||t<=0)return"--";const r={simple:{opus:1,haiku:1,total:3},standard:{opus:2,haiku:2,total:5},complex:{opus:3,haiku:3,total:8}},a=r[s]||r.standard;return t<=a.opus?"Opus":t>a.total-a.haiku?"Haiku":"Sonnet"}function jt({status:t,prdSummary:s,onStop:r,onPause:a,onResume:l,isPaused:o}){const i=t?gt(t.iteration??0,t.complexity||"standard"):"--",d=o??(t==null?void 0:t.paused)??!1;return e.jsxs("div",{className:"card px-5 py-3 flex items-center gap-6 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium",children:"Phase"}),e.jsx("span",{className:"font-mono font-semibold text-ink",children:(t==null?void 0:t.phase)||"idle"})]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium",children:"Complexity"}),e.jsx("span",{className:`font-mono font-semibold ${(t==null?void 0:t.complexity)==="complex"?"text-warning":(t==null?void 0:t.complexity)==="simple"?"text-success":"text-ink"}`,children:(t==null?void 0:t.complexity)||"standard"})]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium",children:"Model"}),e.jsx("span",{className:`font-mono font-semibold px-2 py-0.5 rounded-md text-xs ${i==="Opus"?"bg-primary/10 text-primary":i==="Haiku"?"bg-success/10 text-success":"bg-primary/10 text-primary"}`,children:i})]}),e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium",children:"Tasks"}),e.jsx("span",{className:"font-mono text-ink",children:t!=null&&t.current_task?e.jsx("span",{className:"text-xs",children:t.current_task}):e.jsx("span",{className:"text-muted",children:"--"})}),((t==null?void 0:t.pending_tasks)??0)>0&&e.jsxs("span",{className:"text-xs text-primary font-mono",children:["+",t==null?void 0:t.pending_tasks," pending"]})]}),s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-5 bg-border"}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-xs text-muted uppercase tracking-wider font-medium flex-shrink-0",children:"Building"}),e.jsx("span",{className:"text-xs font-mono text-ink truncate max-w-[220px]",title:s,children:s.length>60?s.slice(0,60)+"...":s})]})]}),e.jsx("div",{className:"flex-1"}),((t==null?void 0:t.uptime)??0)>0&&e.jsx("span",{className:"font-mono text-xs text-muted",children:bt((t==null?void 0:t.uptime)??0)}),(a||l)&&e.jsxs("button",{onClick:d?l:a,className:"flex items-center gap-1.5 px-4 py-1.5 rounded-btn text-xs font-semibold border border-warning/30 text-warning hover:bg-warning/10 transition-colors",children:[d?e.jsx(We,{size:14}):e.jsx(Xe,{size:14}),d?"Resume":"Pause"]}),r&&e.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 px-4 py-1.5 rounded-btn text-xs font-semibold bg-danger/10 text-danger border border-danger/20 hover:bg-danger/20 transition-colors",children:[e.jsx(et,{size:14}),"Stop"]})]})}function vt({status:t}){const s=[{label:"Iteration",value:t?t.iteration.toString():"--",color:"text-primary"},{label:"Agents",value:t?t.running_agents.toString():"--",color:t&&t.running_agents>0?"text-success":"text-muted"},{label:"Pending",value:t?t.pending_tasks.toString():"--",color:t&&t.pending_tasks>0?"text-warning":"text-muted"},{label:"Provider",value:(t==null?void 0:t.provider)||"--",color:"text-primary"}];return e.jsx("div",{className:"grid grid-cols-4 gap-3",children:s.map(r=>e.jsxs("div",{className:"card p-4 text-center",children:[e.jsx("div",{className:`text-2xl font-bold font-mono ${r.color}`,children:r.value}),e.jsx("div",{className:"text-xs text-muted font-medium mt-1 uppercase tracking-wider",children:r.label})]},r.label))})}function yt({plan:t,loading:s,onConfirm:r,onCancel:a}){return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-sm",children:e.jsxs("div",{className:"card w-full max-w-lg mx-4 p-6 rounded-card shadow-card-hover",children:[e.jsx("h2",{className:"text-lg font-bold text-ink mb-4",children:"Build Estimate"}),s?e.jsxs("div",{className:"flex flex-col items-center py-8 gap-3",children:[e.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"}),e.jsx("p",{className:"text-sm text-muted",children:"Analyzing spec..."}),e.jsxs("div",{className:"flex gap-3 mt-4",children:[e.jsx("button",{onClick:a,className:"px-4 py-2 text-sm font-medium text-muted hover:text-ink transition-colors",children:"Cancel"}),e.jsx("button",{onClick:r,className:"px-4 py-2 text-sm font-medium text-primary hover:text-primary/80 transition-colors underline",children:"Skip analysis, build now"})]})]}):t?e.jsxs(e.Fragment,{children:[t.returncode!==0&&e.jsxs("div",{className:"mb-4 px-3 py-2 rounded-btn bg-warning/10 border border-warning/20 text-warning text-xs",children:["loki plan exited with code ",t.returncode," - showing partial results"]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4",children:[e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Complexity"}),e.jsx("div",{className:"text-base font-bold text-ink capitalize",children:t.complexity})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Est. Cost"}),e.jsx("div",{className:"text-base font-bold text-ink",children:t.cost_estimate})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Iterations"}),e.jsx("div",{className:"text-base font-bold text-ink",children:t.iterations})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Phases"}),e.jsx("div",{className:"text-xs text-ink capitalize",children:t.phases.join(", ")})]})]}),t.output_text&&e.jsxs("details",{className:"mb-4",children:[e.jsx("summary",{className:"text-xs text-muted cursor-pointer hover:text-ink transition-colors",children:"Raw output"}),e.jsx("pre",{className:"mt-2 text-xs font-mono text-muted-accessible bg-black/5 rounded-card p-3 overflow-auto max-h-40 whitespace-pre-wrap",children:t.output_text})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:a,className:"px-4 py-2 text-sm font-medium text-muted hover:text-ink transition-colors",children:"Cancel"}),e.jsx("button",{onClick:r,className:"px-5 py-2 rounded-card text-sm font-semibold bg-primary text-white hover:bg-primary/90 transition-all shadow-button",children:"Start Build"})]})]}):e.jsx("div",{className:"text-sm text-muted py-4",children:"No plan data available."})]})})}function Nt({onSubmit:t,running:s,error:r,provider:a,onProviderChange:l,initialPrd:o}){const[i,d]=n.useState(""),[c,x]=n.useState(""),[u,v]=n.useState("claude"),[p,b]=n.useState(""),y=a??u,[N,k]=n.useState(!1),[w,B]=n.useState([]),[h,L]=n.useState(!1),[E,z]=n.useState(!1),[I,C]=n.useState(!1),[O,S]=n.useState(null),[A,_]=n.useState(!1),[q,$]=n.useState(!1);n.useEffect(()=>{j.getTemplates().then(g=>{B(g),L(!1)}).catch(()=>{B([]),L(!0)})},[]),n.useEffect(()=>{o&&d(o)},[o]),n.useEffect(()=>{if(o)return;const g=localStorage.getItem("loki-prd-draft");g&&d(g),j.getPrdPrefill().then(({content:D})=>{D&&d(D)}).catch(()=>{})},[o]),n.useEffect(()=>{i.trim()?localStorage.setItem("loki-prd-draft",i):localStorage.removeItem("loki-prd-draft")},[i]);const V=n.useCallback(async(g,D)=>{x(D),k(!1);try{const T=await j.getTemplateContent(g);d(T.content)}catch{d(`# ${D}
12
12
 
13
13
  ## Overview
14
14
 
@@ -24,5 +24,5 @@ Describe your project here...
24
24
 
25
25
  - Requirement 1
26
26
  - Requirement 2
27
- `)}},[]),Q=async()=>{if(!(!l.trim()||A)){_(!0),S(null),$(!0);try{const g=await j.planSession(l,y);S(g)}catch{S({complexity:"unknown",cost_estimate:"N/A",iterations:0,phases:[],output_text:"Failed to run loki plan. The CLI may not be available.",returncode:1})}finally{_(!1)}}},G=async()=>{if(!(!l.trim()||s||E)){$(!1),z(!0);try{await t(l,y,p.trim()||void 0,I?"quick":void 0)}finally{z(!1)}}};return e.jsxs(e.Fragment,{children:[q&&e.jsx(yt,{plan:H,loading:A,onConfirm:G,onCancel:()=>$(!1)}),e.jsxs("div",{className:"card p-6 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Product Requirements"}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>k(!N),className:"text-xs font-medium px-3 py-1.5 rounded-card border border-primary/20 text-primary hover:bg-primary/5 transition-colors",children:c||"Templates"}),N&&e.jsx("div",{className:"absolute right-0 top-full mt-1 w-56 card rounded-card overflow-hidden z-20 shadow-card-hover",children:e.jsxs("div",{className:"py-1 max-h-64 overflow-y-auto terminal-scroll",children:[h&&e.jsx("div",{className:"px-3 py-2 text-xs text-warning border-b border-warning/10",children:"Could not load templates from server. Check that the backend is running."}),!h&&w.length===0&&e.jsx("div",{className:"px-3 py-2 text-xs text-muted",children:"Loading..."}),w.map(g=>e.jsx("button",{onClick:()=>V(g.filename,g.name),className:"w-full text-left px-3 py-2 text-sm text-ink hover:bg-primary/5 transition-colors",children:g.name},g.filename))]})})]})})]}),e.jsx("textarea",{value:l,onChange:g=>d(g.target.value),placeholder:"Paste your spec or PRD here, or select a template above to get started...",className:"flex-1 min-h-[280px] w-full bg-card rounded-card border border-border-light px-4 py-3 text-sm font-mono text-ink placeholder:text-primary/60 resize-none focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/30 transition-all",spellCheck:!1}),e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"block text-xs text-muted font-medium mb-1 uppercase tracking-wider",children:"Project Directory"}),e.jsx("input",{type:"text",value:p,onChange:g=>b(g.target.value),placeholder:"Leave blank to auto-create, or type a path (e.g. /Users/you/my-project)",className:"w-full bg-card rounded-card border border-border-light px-4 py-2 text-sm font-mono text-ink placeholder:text-primary/60/70 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/30 transition-all",spellCheck:!1}),e.jsx("p",{className:"text-xs text-muted-accessible mt-1",children:"Type a path or leave blank to auto-create under ~/purple-lab-projects/"})]}),r&&e.jsx("div",{className:"mt-3 px-3 py-2 rounded-btn bg-danger/10 border border-danger/20 text-danger text-xs font-medium",children:r}),e.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[e.jsxs("button",{onClick:()=>C(!I),title:"Quick Mode: 3 iterations max, faster builds",className:`flex items-center gap-1.5 px-3 py-1.5 rounded-card text-xs font-semibold border transition-all ${I?"bg-primary/10 border-primary/30 text-primary":"border-border-light text-muted hover:text-ink hover:bg-card"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${I?"bg-primary":"bg-muted/40"}`}),"Quick"]}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-xs text-muted font-mono",children:[l.length.toLocaleString()," chars"]}),e.jsx("button",{onClick:Q,disabled:!l.trim()||s||E||A,className:`px-6 py-2.5 rounded-card text-sm font-semibold transition-all ${!l.trim()||s||E||A?"bg-primary/10 text-muted cursor-not-allowed":"bg-primary text-white hover:bg-primary/90 shadow-button"}`,children:A?"Analyzing...":E?"Starting...":s?"Building...":"Start Build"})]})]})]})}const O=[{key:"reason",label:"Reason",description:"Analyzing task, planning approach"},{key:"act",label:"Act",description:"Implementing changes, writing code"},{key:"reflect",label:"Reflect",description:"Reviewing output, self-critique"},{key:"verify",label:"Verify",description:"Testing, validation, quality gates"}];function wt(t){if(!t)return"reason";const s=t.toLowerCase();return s.includes("reason")||s.includes("plan")?"reason":s.includes("act")||s.includes("implement")||s.includes("code")?"act":s.includes("reflect")||s.includes("review")?"reflect":s.includes("verify")||s.includes("test")||s.includes("check")?"verify":"idle"}function kt({currentPhase:t,iteration:s}){const r=wt(t);return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"RARV Cycle"}),e.jsxs("span",{className:"font-mono text-xs text-muted",children:["Iteration ",s]})]}),e.jsx("div",{className:"flex items-center justify-center mb-5",children:e.jsxs("svg",{viewBox:"0 0 120 120",className:"w-28 h-28",children:[O.map((a,i)=>{const o=a.key===r,l=r!=="idle"&&O.findIndex(u=>u.key===r)>i,d=(i*90-90)*(Math.PI/180),c=60+40*Math.cos(d),m=60+40*Math.sin(d);return e.jsxs("g",{children:[i<O.length-1&&e.jsx("line",{x1:c,y1:m,x2:60+40*Math.cos(((i+1)*90-90)*(Math.PI/180)),y2:60+40*Math.sin(((i+1)*90-90)*(Math.PI/180)),stroke:l?"#553DE9":"#ECEAE3",strokeWidth:l?2:1,strokeDasharray:l?"none":"4 3"}),i===O.length-1&&e.jsx("line",{x1:c,y1:m,x2:60+40*Math.cos(-90*(Math.PI/180)),y2:60+40*Math.sin(-90*(Math.PI/180)),stroke:"#ECEAE3",strokeWidth:1,strokeDasharray:"4 3"}),e.jsx("circle",{cx:c,cy:m,r:o?14:10,fill:o||l?"#553DE9":"#E8E4FD",stroke:o?"#4432c4":l?"#553DE9":"#ECEAE3",strokeWidth:o?3:1.5,className:o?"phase-active":""}),e.jsx("text",{x:c,y:m+(i===0?-20:i===2?24:0),textAnchor:"middle",className:"text-[9px] font-semibold fill-ink",dx:i===1?22:i===3?-22:0,children:a.label[0]})]},a.key)}),e.jsx("text",{x:"60",y:"64",textAnchor:"middle",className:"text-lg font-bold font-mono fill-primary",children:s})]})}),e.jsx("div",{className:"space-y-2",children:O.map(a=>{const i=a.key===r;return e.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 rounded-card transition-all duration-200 ${i?"bg-primary/8 border border-primary/20":"opacity-50"}`,children:[e.jsx("div",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${i?"bg-primary phase-active":"bg-border"}`}),e.jsxs("div",{children:[e.jsx("span",{className:`text-sm font-semibold ${i?"text-primary":"text-muted"}`,children:a.label}),i&&e.jsx("p",{className:"text-xs text-muted mt-0.5",children:a.description})]})]},a.key)})})]})}const ee={architect:"bg-primary/10 text-primary border-primary/20",developer:"bg-primary/10 text-primary border-primary/20",tester:"bg-success/10 text-success border-success/20",reviewer:"bg-warning/10 text-warning border-warning/20",planner:"bg-primary/60/20 text-ink border-primary/60/30",default:"bg-border/30 text-muted border-border/50"};function Et(t){if(!t)return ee.default;const s=t.toLowerCase();for(const[r,a]of Object.entries(ee))if(s.includes(r))return a;return ee.default}function St({agents:t,loading:s}){const r=(t==null?void 0:t.filter(i=>i.alive))||[],a=(t==null?void 0:t.filter(i=>!i.alive))||[];return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Agents"}),e.jsxs("span",{className:"font-mono text-xs text-muted",children:[r.length," active"]})]}),s&&!t&&e.jsx("div",{className:"text-center py-8 text-muted text-sm",children:"Loading agents..."}),!s&&(t==null?void 0:t.length)===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-muted text-sm",children:"No agents running"}),e.jsx("p",{className:"text-primary/60 text-xs mt-1",children:"Start a build to spawn agents"})]}),r.length>0&&e.jsx("div",{className:"space-y-2 mb-4",children:r.map(i=>e.jsx(de,{agent:i},i.id))}),a.length>0&&e.jsxs("details",{className:"mt-3",children:[e.jsxs("summary",{className:"text-xs text-muted cursor-pointer hover:text-ink transition-colors",children:[a.length," completed"]}),e.jsx("div",{className:"space-y-1.5 mt-2",children:a.slice(0,10).map(i=>e.jsx(de,{agent:i,compact:!0},i.id))})]})]})}function de({agent:t,compact:s}){const r=Et(t.type||t.name||"");return s?e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 rounded-btn bg-hover text-xs",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-muted/30"}),e.jsx("span",{className:"font-medium text-muted truncate",children:t.name||t.id}),e.jsx("span",{className:"text-primary/60 ml-auto",children:t.type})]}):e.jsxs("div",{className:`flex items-start gap-3 px-3 py-2.5 rounded-card border ${r}`,children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${t.alive?"bg-success phase-active":"bg-muted/30"}`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold truncate",children:t.name||t.id}),t.type&&e.jsx("span",{className:"text-xs font-mono font-medium opacity-70",children:t.type})]}),t.task&&e.jsx("p",{className:"text-xs opacity-70 mt-0.5 truncate",children:t.task}),t.status&&t.status!=="unknown"&&e.jsx("span",{className:"inline-block text-xs font-mono mt-1 opacity-60",children:t.status})]}),t.pid&&e.jsxs("span",{className:"text-xs font-mono text-muted-accessible flex-shrink-0",children:["PID ",t.pid]})]})}function Ct({text:t,position:s="top",size:r=14}){const[a,i]=n.useState(!1),o=n.useRef(null);n.useEffect(()=>{if(!a)return;const c=m=>{o.current&&!o.current.contains(m.target)&&i(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[a]);const l={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},d={top:"top-full left-1/2 -translate-x-1/2 border-t-[#1A1A1E] dark:border-t-card border-l-transparent border-r-transparent border-b-transparent border-4",bottom:"bottom-full left-1/2 -translate-x-1/2 border-b-[#1A1A1E] dark:border-b-card border-l-transparent border-r-transparent border-t-transparent border-4",left:"left-full top-1/2 -translate-y-1/2 border-l-[#1A1A1E] dark:border-l-card border-t-transparent border-b-transparent border-r-transparent border-4",right:"right-full top-1/2 -translate-y-1/2 border-r-[#1A1A1E] dark:border-r-card border-t-transparent border-b-transparent border-l-transparent border-4"};return e.jsxs("div",{className:"relative inline-flex items-center",ref:o,children:[e.jsx("button",{onClick:()=>i(!a),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:"text-muted/50 hover:text-primary transition-colors p-0.5 rounded-full","aria-label":"Help",type:"button",children:e.jsx(Ue,{size:r})}),a&&e.jsx("div",{className:`absolute z-50 ${l[s]}`,role:"tooltip",children:e.jsxs("div",{className:"relative bg-[#1A1A1E] text-white px-3 py-2 rounded-lg shadow-lg max-w-[240px]",children:[e.jsx("p",{className:"text-[11px] leading-relaxed",children:t}),e.jsx("span",{className:`absolute ${d[s]}`})]})})]})}const At={qualityGates:"Automated checks ensuring your code meets quality standards. Includes static analysis, test coverage, and security scanning."},Dt={pass:{badge:"bg-success/10 text-success border-success/20",dot:"bg-success",label:"Pass"},fail:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Fail"},skip:{badge:"bg-muted/10 text-muted border-muted/20",dot:"bg-muted/40",label:"Skip"},pending:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Pending"}};function Pt({item:t}){const[s,r]=n.useState(!1),a=Dt[t.status];return e.jsxs("div",{className:`border rounded-card overflow-hidden ${a.badge}`,children:[e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-3 py-2.5 text-left",onClick:()=>t.details&&r(!s),children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${a.dot}`}),e.jsx("span",{className:"text-sm font-medium flex-1 truncate",children:t.label}),e.jsx("span",{className:"text-xs font-mono font-semibold uppercase tracking-wider flex-shrink-0",children:a.label}),t.details&&e.jsx("span",{className:"text-xs text-muted/60 flex-shrink-0",children:s?"v":">"})]}),s&&t.details&&e.jsx("div",{className:"px-3 pb-2.5 pt-0",children:e.jsx("p",{className:"text-xs font-mono opacity-70 leading-relaxed",children:t.details})})]})}function Ft({checklist:t,loading:s}){const r=t&&t.total>0?t.passed/t.total*100:0;return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Quality Gates"}),e.jsx(Ct,{text:At.qualityGates,position:"right",size:13})]}),t&&e.jsxs("span",{className:"font-mono text-xs text-muted",children:[t.passed,"/",t.total," passed"]})]}),s&&!t&&e.jsx("div",{className:"text-center py-8 text-muted text-sm",children:"Loading gates..."}),!s&&!t&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-muted text-sm",children:"No quality gate data"}),e.jsx("p",{className:"text-primary/60 text-xs mt-1",children:"Gates run during verification phase"})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-3 text-xs",children:[e.jsxs("span",{className:"text-success font-medium",children:[t.passed," passed"]}),t.failed>0&&e.jsxs("span",{className:"text-danger font-medium",children:[t.failed," failed"]}),t.skipped>0&&e.jsxs("span",{className:"text-muted",children:[t.skipped," skipped"]}),t.pending>0&&e.jsxs("span",{className:"text-warning",children:[t.pending," pending"]})]}),e.jsx("div",{className:"w-full h-2 bg-charcoal/10 rounded-full overflow-hidden mb-4",children:e.jsx("div",{className:"h-full bg-success rounded-full transition-all duration-500",style:{width:`${r}%`}})}),e.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto terminal-scroll",children:t.items.map(a=>e.jsx(Pt,{item:a},a.id))})]})]})}const Lt={".py":"bg-success",".ts":"bg-primary",".tsx":"bg-primary",".md":"bg-warning",".sh":"bg-primary"};function Tt(t){const s=t.substring(t.lastIndexOf("."));return Lt[s]||"bg-muted"}function Mt(t){return t==null?"":t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}const te=100;function ge({node:t,depth:s,onSelectFile:r,selectedPath:a}){const[i,o]=n.useState(!1),[l,d]=n.useState(te),c=t.type==="directory",m=t.path===a,u=c&&i?t.children??[]:[],v=u.length>l;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:`w-full flex items-center gap-2 px-2 py-1 rounded-btn text-left text-sm transition-colors hover:bg-hover ${m?"bg-primary/10 text-primary":"text-ink"}`,style:{paddingLeft:`${s*16+8}px`},onClick:()=>{c?(o(!i),i&&d(te)):r(t.path)},children:[c?e.jsx("span",{className:"font-mono text-xs text-muted w-3 flex-shrink-0",children:i?"v":">"}):e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${Tt(t.name)}`}),e.jsx("span",{className:`truncate ${c?"font-medium":"font-mono text-xs"}`,children:t.name}),!c&&t.size!==void 0&&e.jsx("span",{className:"ml-auto text-xs font-mono text-muted-accessible flex-shrink-0",children:Mt(t.size)})]}),u.length>0&&e.jsxs("div",{children:[u.slice(0,l).map(p=>e.jsx(ge,{node:p,depth:s+1,onSelectFile:r,selectedPath:a},p.path)),v&&e.jsxs("button",{type:"button",className:"w-full text-left text-xs text-primary hover:text-primary/80 py-1 transition-colors",style:{paddingLeft:`${(s+1)*16+8}px`},onClick:()=>d(p=>p+te),children:["Show more (",u.length-l," remaining)"]})]})]})}function Rt({files:t,loading:s}){const[r,a]=n.useState(null),[i,o]=n.useState(null),[l,d]=n.useState(!1),[c,m]=n.useState(null),u=n.useCallback(async p=>{o(null),a(p),d(!0),m(null);try{const b=await j.getFileContent(p);o(b.content)}catch(b){const y=b instanceof Error?b.message:"Unknown error",N=b instanceof TypeError||y==="Request timeout",k=y.includes("404")||y.includes("not found")||y.includes("Not found");m(N?"Network error - server may be unreachable":k?"File not found - it may have been deleted or renamed":y),o(null)}finally{d(!1)}},[]),v=n.useCallback(p=>{u(p)},[u]);return e.jsxs("div",{className:"card p-6 flex flex-col",style:{minHeight:"300px"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"File Browser"}),e.jsx("span",{className:"font-mono text-xs text-muted",children:".loki/"})]}),s&&!t&&e.jsx("div",{className:"text-center py-8 text-muted text-sm",children:"Loading files..."}),!s&&(!t||t.length===0)&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-muted text-sm",children:"No project files found"}),e.jsx("p",{className:"text-primary/60 text-xs mt-1",children:"Start a session to generate .loki/ state"})]}),t&&t.length>0&&e.jsxs("div",{className:"flex gap-4 flex-1 min-h-0",children:[e.jsx("div",{className:"w-1/2 overflow-y-auto terminal-scroll pr-2",children:t.map(p=>e.jsx(ge,{node:p,depth:0,onSelectFile:v,selectedPath:r},p.path))}),e.jsxs("div",{className:"w-1/2 bg-charcoal/5 rounded-card p-3 overflow-hidden flex flex-col",children:[!r&&e.jsx("div",{className:"flex-1 flex items-center justify-center text-muted text-xs",children:"Select a file to preview"}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-xs font-mono text-primary mb-2 truncate",children:r}),e.jsx("div",{className:"flex-1 overflow-y-auto terminal-scroll",children:l?e.jsx("div",{className:"text-muted text-xs",children:"Loading..."}):c?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-6",children:[e.jsx("p",{className:"text-danger text-xs font-medium",children:"Failed to load file"}),e.jsx("p",{className:"text-muted-accessible text-xs text-center max-w-[200px] break-words",children:c}),e.jsx("button",{type:"button",onClick:()=>r&&u(r),className:"mt-1 px-3 py-1 text-xs font-semibold rounded-btn border border-primary/20 text-primary hover:bg-primary/5 transition-colors",children:"Retry"})]}):e.jsx("pre",{className:"text-xs font-mono text-ink whitespace-pre-wrap break-words leading-relaxed",children:i})})]})]})]})]})}const xe=5e5;function me(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function Bt(t){if(!t)return"Never";try{const s=new Date(t),a=new Date().getTime()-s.getTime(),i=Math.floor(a/(1e3*60*60));return i<1?"Just now":i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}catch{return t}}function It({memory:t,loading:s}){const r=t?[{label:"Episodic",count:t.episodic_count,color:"text-primary",bg:"bg-primary/10",border:"border-primary/20"},{label:"Semantic",count:t.semantic_count,color:"text-success",bg:"bg-success/10",border:"border-success/20"},{label:"Skills",count:t.skill_count,color:"text-warning",bg:"bg-warning/10",border:"border-warning/20"}]:[],a=t?Math.min(t.total_tokens/xe*100,100):0;return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Memory System"}),t&&e.jsx("span",{className:"font-mono text-xs text-muted",children:Bt(t.last_consolidation)})]}),s&&!t&&e.jsx("div",{className:"text-center py-8 text-muted text-sm",children:"Loading memory..."}),!s&&!t&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-muted text-sm",children:"No memory data available"}),e.jsx("p",{className:"text-primary/60 text-xs mt-1",children:"Memory populates during autonomous runs"})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-3 gap-3 mb-4",children:r.map(i=>e.jsxs("div",{className:`${i.bg} border ${i.border} rounded-card p-3 text-center`,children:[e.jsx("div",{className:`text-2xl font-bold font-mono ${i.color}`,children:i.count}),e.jsx("div",{className:"text-xs text-muted-accessible font-medium mt-1 uppercase tracking-wider",children:i.label})]},i.label))}),e.jsxs("div",{className:"mt-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{className:"text-xs text-muted font-medium",children:"Token Usage"}),e.jsxs("span",{className:"text-xs font-mono text-ink",children:[me(t.total_tokens)," / ",me(xe)]})]}),e.jsx("div",{className:"w-full h-2 bg-charcoal/10 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${a>80?"bg-danger":a>50?"bg-warning":"bg-info"}`,style:{width:`${a}%`}})})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted",children:"Last Consolidation"}),e.jsx("span",{className:"font-mono text-ink",children:t.last_consolidation?new Date(t.last_consolidation).toLocaleString():"Never"})]})]})]})}function _t({visible:t}){const[s,r]=n.useState("markdown"),[a,i]=n.useState(null),[o,l]=n.useState(null),[d,c]=n.useState(!1),[m,u]=n.useState(!1),[v,p]=n.useState(null),[b,y]=n.useState(!1);if(!t)return null;const N=async()=>{c(!0),p(null),i(null),l(null);try{const h=await j.generateReport(s);i(h)}catch(h){p(h instanceof Error?h.message:"Failed to generate report")}finally{c(!1)}},k=async()=>{u(!0),p(null);try{const h=await j.shareSession();l(h)}catch(h){p(h instanceof Error?h.message:"Failed to share session")}finally{u(!1)}},w=async h=>{try{await navigator.clipboard.writeText(h),y(!0),setTimeout(()=>y(!1),2e3)}catch{}},B=()=>{if(!a)return;const h=new Blob([a.content],{type:s==="html"?"text/html":"text/markdown"}),L=URL.createObjectURL(h),E=document.createElement("a");E.href=L,E.download=`loki-report.${s==="html"?"html":"md"}`,E.click(),URL.revokeObjectURL(L)};return e.jsxs("div",{className:"card p-4 rounded-card",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Session Report"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center gap-1 card rounded-card p-1",children:["markdown","html"].map(h=>e.jsx("button",{onClick:()=>r(h),className:`px-3 py-1 text-xs font-semibold rounded-btn transition-all ${s===h?"bg-primary text-white shadow-sm":"text-muted hover:text-ink hover:bg-hover"}`,children:h.toUpperCase()},h))}),e.jsx("button",{onClick:N,disabled:d,className:"px-4 py-1.5 rounded-card text-xs font-semibold bg-primary text-white hover:bg-primary/90 disabled:opacity-50 transition-all",children:d?"Generating...":"Generate Report"})]})]}),v&&e.jsx("div",{className:"mb-3 px-3 py-2 rounded-btn bg-danger/10 border border-danger/20 text-danger text-xs",children:v}),a&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("span",{className:"text-xs text-muted",children:["Report generated (",a.format,")"]}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>w(a.content),className:"px-3 py-1 text-xs font-medium text-muted hover:text-ink border border-border-light rounded-btn hover:bg-hover transition-all",children:b?"Copied":"Copy"}),e.jsx("button",{onClick:B,className:"px-3 py-1 text-xs font-medium text-muted hover:text-ink border border-border-light rounded-btn hover:bg-hover transition-all",children:"Download"}),e.jsx("button",{onClick:k,disabled:m,className:"px-3 py-1 text-xs font-medium bg-primary/10 text-primary border border-primary/20 rounded-btn hover:bg-primary/20 disabled:opacity-50 transition-all",children:m?"Sharing...":"Share as Gist"})]}),o&&e.jsxs("div",{className:"mb-2 flex items-center gap-2 px-3 py-2 rounded-btn bg-success/10 border border-success/20",children:[e.jsx("span",{className:"text-xs text-success font-medium",children:"Shared:"}),o.url?e.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary underline flex-1 truncate",children:o.url}):e.jsx("span",{className:"text-xs text-muted flex-1",children:"No URL returned"}),o.url&&e.jsx("button",{onClick:()=>w(o.url),className:"text-xs text-muted hover:text-ink",children:"Copy URL"})]}),e.jsx("pre",{className:"text-[11px] font-mono text-ink bg-black/5 rounded-card p-3 overflow-auto max-h-64 whitespace-pre-wrap terminal-scroll",children:a.content||"(empty report)"})]})]})}function ue({visible:t}){const s=n.useCallback(()=>j.getMetrics(),[]),{data:r,loading:a}=R(s,15e3,t);return t?e.jsxs("div",{className:"card p-4 rounded-card",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Session Metrics"}),a&&e.jsx("div",{className:"w-4 h-4 border-2 border-primary border-t-transparent rounded-full animate-spin"})]}),r?e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Iterations"}),e.jsx("div",{className:"text-xl font-bold text-ink",children:r.iterations??0})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Gate Pass Rate"}),e.jsx("div",{className:"text-xl font-bold text-ink",children:typeof r.quality_gate_pass_rate=="number"?`${r.quality_gate_pass_rate.toFixed(0)}%`:"N/A"})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Tokens Used"}),e.jsx("div",{className:"text-xl font-bold text-ink",children:(r.tokens_used??0).toLocaleString()})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Time Elapsed"}),e.jsx("div",{className:"text-xl font-bold text-ink",children:r.time_elapsed||"N/A"})]})]}):e.jsx("div",{className:"text-sm text-muted py-4 text-center",children:a?"Loading metrics...":"No metrics available"})]}):null}function $t(t){switch(t){case"completed":case"complete":case"done":return"completed";case"in_progress":return"running";case"started":return"started";case"error":case"failed":return"failed";default:return"empty"}}const zt={completed:"Completed",complete:"Completed",done:"Completed",in_progress:"In Progress",started:"Started",error:"Failed",failed:"Failed",empty:"Empty"};function Ot({onLoadSession:t}){const s=n.useCallback(()=>j.getSessionsHistory(),[]),{data:r,loading:a}=R(s,6e4,!0);return a&&!r?e.jsxs("div",{className:"card p-4 rounded-card",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider mb-3",children:"Past Builds"}),e.jsx("div",{className:"text-sm text-muted",children:"Loading..."})]}):!r||r.length===0?null:e.jsxs("div",{className:"card p-4 rounded-card",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider mb-3",children:"Past Builds"}),e.jsx("div",{className:"flex flex-col gap-2 max-h-64 overflow-y-auto terminal-scroll",children:r.map(i=>{const o=i.file_count;return e.jsxs("button",{onClick:()=>t==null?void 0:t(i),className:"text-left px-4 py-3 rounded-card card hover:bg-hover transition-all group cursor-pointer",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs font-mono text-muted-accessible",children:i.date}),e.jsxs("div",{className:"flex items-center gap-2",children:[o!==void 0&&o>0&&e.jsxs("span",{className:"text-xs font-mono text-muted-accessible",children:[o," files"]}),e.jsx(rt,{status:$t(i.status),children:zt[i.status]||i.status})]})]}),e.jsx("div",{className:"text-xs text-ink truncate group-hover:text-primary transition-colors",children:i.prd_snippet||i.id}),e.jsx("div",{className:"text-xs font-mono text-muted-accessible mt-0.5 truncate",children:i.path})]},i.id)})})]})}function Ht({end:t,suffix:s="",duration:r=1500}){const[a,i]=n.useState(0),o=n.useRef(null),l=n.useRef(!1);return n.useEffect(()=>{const d=new IntersectionObserver(([c])=>{if(c.isIntersecting&&!l.current){l.current=!0;const m=performance.now(),u=v=>{const p=v-m,b=Math.min(p/r,1),y=1-Math.pow(1-b,3);i(Math.floor(y*t)),b<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}},{threshold:.3});return o.current&&d.observe(o.current),()=>d.disconnect()},[t,r]),e.jsxs("span",{ref:o,className:"tabular-nums",children:[a,s]})}const qt=[{icon:at,value:21,suffix:"+",label:"Templates"},{icon:nt,value:5,suffix:"",label:"AI Providers"},{icon:be,value:100,suffix:"%",label:"Open Source"}];function Gt(){return e.jsxs("section",{className:"w-full max-w-3xl mx-auto mt-16 mb-4",children:[e.jsx("p",{className:"text-center text-sm text-[#6B6960] mb-8 tracking-wide uppercase font-medium",children:"Trusted by developers building the future"}),e.jsx("div",{className:"flex items-center justify-center gap-12 sm:gap-16",children:qt.map(t=>{const s=t.icon;return e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(s,{size:20,className:"text-[#553DE9]",strokeWidth:1.5}),e.jsx("span",{className:"text-2xl font-bold text-[#36342E]",children:e.jsx(Ht,{end:t.value,suffix:t.suffix})}),e.jsx("span",{className:"text-xs text-[#6B6960] font-medium",children:t.label})]},t.label)})}),e.jsx("div",{className:"mt-12 border-t border-[#ECEAE3]"})]})}function se({icon:t,number:s,title:r,description:a,mockup:i,delay:o}){const l=n.useRef(null),[d,c]=n.useState(!1);return n.useEffect(()=>{const m=new IntersectionObserver(([u])=>{u.isIntersecting&&(setTimeout(()=>c(!0),o),m.disconnect())},{threshold:.2});return l.current&&m.observe(l.current),()=>m.disconnect()},[o]),e.jsxs("div",{ref:l,className:`flex flex-col items-center text-center max-w-xs transition-all duration-700 ${d?"opacity-100 translate-y-0":"opacity-0 translate-y-6"}`,children:[e.jsxs("div",{className:"relative mb-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-[#553DE9]/10 flex items-center justify-center",children:e.jsx(t,{size:24,className:"text-[#553DE9]",strokeWidth:1.5})}),e.jsx("span",{className:"absolute -top-2 -right-2 w-6 h-6 rounded-full bg-[#553DE9] text-white text-xs font-bold flex items-center justify-center",children:s})]}),e.jsx("h3",{className:"text-lg font-bold text-[#36342E] mb-1.5",children:r}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-4 leading-relaxed",children:a}),e.jsx("div",{className:"w-full rounded-xl border border-[#ECEAE3] bg-white p-3 shadow-sm",children:i})]})}function Wt(){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 px-3 py-2 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3] text-left",children:e.jsx("span",{className:"text-xs text-[#36342E]",children:"Build a SaaS dashboard with analytics"})}),e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#553DE9] flex items-center justify-center flex-shrink-0",children:e.jsx(re,{size:12,className:"text-white"})})]})}function Ut(){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] text-[#6B6960]",children:[e.jsx("span",{children:"Phase: Implementation"}),e.jsx("span",{children:"68%"})]}),e.jsx("div",{className:"w-full h-2 rounded-full bg-[#ECEAE3] overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-[#553DE9] to-[#1FC5A8]",style:{width:"68%"}})}),e.jsx("div",{className:"flex gap-1",children:["Planning","Scaffolding","Implementation","Testing","Deploy"].map((t,s)=>e.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded ${s<=2?"bg-[#553DE9]/10 text-[#553DE9] font-medium":"bg-[#ECEAE3]/60 text-[#6B6960]"}`,children:t},t))})]})}function Vt(){return e.jsxs("div",{className:"space-y-2 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-full bg-[#1FC5A8]/20 flex items-center justify-center",children:e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"#1FC5A8",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("span",{className:"text-xs font-semibold text-[#1FC5A8]",children:"Deployed successfully"})]}),e.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3]",children:e.jsx("span",{className:"text-[10px] font-mono text-[#553DE9]",children:"https://my-app.vercel.app"})})]})}function Qt(){return e.jsxs("section",{className:"w-full max-w-5xl mx-auto py-16",children:[e.jsx("h2",{className:"font-heading text-h2 text-[#36342E] text-center mb-3",children:"How It Works"}),e.jsx("p",{className:"text-sm text-[#6B6960] text-center mb-12 max-w-lg mx-auto",children:"Three steps from idea to production. No manual coding required."}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start justify-center gap-10 md:gap-8",children:[e.jsx("div",{className:"hidden md:block absolute top-7 left-1/2 -translate-x-1/2 w-[60%] h-px border-t-2 border-dashed border-[#ECEAE3] z-0"}),e.jsx(se,{icon:fe,number:1,title:"Describe Your Idea",description:"Type a one-line description. Loki handles the rest.",mockup:e.jsx(Wt,{}),delay:0}),e.jsx(se,{icon:it,number:2,title:"Watch It Build",description:"AI writes code, runs tests, and ensures quality.",mockup:e.jsx(Ut,{}),delay:150}),e.jsx(se,{icon:re,number:3,title:"Ship It",description:"Deploy to Vercel, Netlify, or GitHub in one click.",mockup:e.jsx(Vt,{}),delay:300})]})]})}const Yt=[{name:"SaaS Dashboard",description:"Full-stack analytics dashboard with auth, billing, and user management.",tech:["React","Node.js","PostgreSQL"],gradient:"from-violet-500/20 via-purple-500/10 to-indigo-500/20"},{name:"REST API",description:"Production-ready API with authentication, rate limiting, and docs.",tech:["Python","FastAPI","Redis"],gradient:"from-emerald-500/20 via-teal-500/10 to-cyan-500/20"},{name:"E-Commerce Store",description:"Online store with Stripe payments, cart, and inventory management.",tech:["React","Node.js","MongoDB"],gradient:"from-amber-500/20 via-orange-500/10 to-yellow-500/20"},{name:"Discord Bot",description:"Feature-rich bot with slash commands, moderation, and webhooks.",tech:["TypeScript","Discord","SQLite"],gradient:"from-blue-500/20 via-sky-500/10 to-cyan-500/20"},{name:"CLI Tool",description:"Interactive command-line application with argument parsing and config.",tech:["TypeScript","CLI","Node.js"],gradient:"from-rose-500/20 via-pink-500/10 to-fuchsia-500/20"},{name:"Landing Page",description:"Responsive marketing site with pricing, testimonials, and CTAs.",tech:["React","Tailwind","Vite"],gradient:"from-slate-500/20 via-gray-500/10 to-zinc-500/20"}],Kt={React:"bg-sky-500/10 text-sky-600","Node.js":"bg-green-500/10 text-green-600",Python:"bg-yellow-500/10 text-yellow-700",TypeScript:"bg-blue-500/10 text-blue-600",PostgreSQL:"bg-indigo-500/10 text-indigo-600",MongoDB:"bg-green-600/10 text-green-700",Redis:"bg-red-500/10 text-red-600",FastAPI:"bg-teal-500/10 text-teal-600",SQLite:"bg-blue-400/10 text-blue-500",Tailwind:"bg-cyan-400/10 text-cyan-600",Discord:"bg-indigo-400/10 text-indigo-500",CLI:"bg-amber-500/10 text-amber-600",Vite:"bg-purple-400/10 text-purple-500"};function Zt(){const t=ae(),s=n.useRef(null),[r,a]=n.useState(!1),[i,o]=n.useState(!0),l=()=>{const c=s.current;c&&(a(c.scrollLeft>8),o(c.scrollLeft<c.scrollWidth-c.clientWidth-8))};n.useEffect(()=>{const c=s.current;if(c)return l(),c.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{c.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[]);const d=c=>{const m=s.current;if(!m)return;const u=320;m.scrollBy({left:c==="left"?-u:u,behavior:"smooth"})};return e.jsxs("section",{className:"w-full max-w-5xl mx-auto py-16",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-heading text-h2 text-[#36342E]",children:"Start from a Template"}),e.jsx("p",{className:"text-sm text-[#6B6960] mt-1",children:"Production-ready starting points for common use cases."})]}),e.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[e.jsx("button",{onClick:()=>d("left"),disabled:!r,className:`w-8 h-8 rounded-lg border flex items-center justify-center transition-all ${r?"border-[#ECEAE3] text-[#36342E] hover:bg-[#F8F4F0]":"border-[#ECEAE3]/50 text-[#6B6960]/30 cursor-not-allowed"}`,"aria-label":"Scroll left",children:e.jsx(lt,{size:16})}),e.jsx("button",{onClick:()=>d("right"),disabled:!i,className:`w-8 h-8 rounded-lg border flex items-center justify-center transition-all ${i?"border-[#ECEAE3] text-[#36342E] hover:bg-[#F8F4F0]":"border-[#ECEAE3]/50 text-[#6B6960]/30 cursor-not-allowed"}`,"aria-label":"Scroll right",children:e.jsx(Ve,{size:16})})]})]}),e.jsxs("div",{ref:s,className:"flex gap-4 overflow-x-auto pb-4 snap-x snap-mandatory scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[Yt.map(c=>e.jsxs("div",{className:"flex-shrink-0 w-64 rounded-xl border border-[#ECEAE3] bg-white overflow-hidden snap-start hover:shadow-lg hover:border-[#553DE9]/30 transition-all cursor-pointer group",onClick:()=>t("/templates"),children:[e.jsx("div",{className:`h-20 bg-gradient-to-br ${c.gradient} flex items-end p-3`,children:e.jsx("h3",{className:"text-sm font-bold text-[#36342E] group-hover:text-[#553DE9] transition-colors",children:c.name})}),e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-xs text-[#6B6960] mb-3 leading-relaxed line-clamp-2",children:c.description}),e.jsx("div",{className:"flex flex-wrap gap-1",children:c.tech.map(m=>e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${Kt[m]||"bg-gray-100 text-gray-600"}`,children:m},m))})]})]},c.name)),e.jsxs("div",{className:"flex-shrink-0 w-48 rounded-xl border border-dashed border-[#ECEAE3] bg-[#FAF9F6] flex flex-col items-center justify-center gap-2 snap-start cursor-pointer hover:border-[#553DE9]/40 hover:bg-[#553DE9]/5 transition-all group",onClick:()=>t("/templates"),children:[e.jsx(Qe,{size:20,className:"text-[#6B6960] group-hover:text-[#553DE9] transition-colors"}),e.jsx("span",{className:"text-sm font-semibold text-[#6B6960] group-hover:text-[#553DE9] transition-colors",children:"View All Templates"})]})]})]})}function Jt({icon:t,title:s,description:r}){return e.jsxs("div",{className:"rounded-xl border border-[#ECEAE3] bg-white p-5 hover:border-[#553DE9]/40 hover:shadow-lg transition-all group",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#553DE9]/10 flex items-center justify-center mb-3 group-hover:bg-[#553DE9]/15 transition-colors",children:e.jsx(t,{size:20,className:"text-[#553DE9]",strokeWidth:1.5})}),e.jsx("h3",{className:"text-sm font-bold text-[#36342E] mb-1.5",children:s}),e.jsx("p",{className:"text-xs text-[#6B6960] leading-relaxed",children:r})]})}const Xt=[{icon:ot,title:"Multi-AI",description:"Use Claude, GPT, Gemini. Pick the best for each task."},{icon:Ye,title:"Quality First",description:"10 quality gates. 3 blind reviewers. Zero sycophancy."},{icon:pt,title:"Self-Hosted",description:"Your code stays on your machine. Full privacy."},{icon:be,title:"Open Source",description:"MIT-licensed. Fork it, extend it, own it."}];function es(){return e.jsxs("section",{className:"w-full max-w-4xl mx-auto py-16",children:[e.jsx("h2",{className:"font-heading text-h2 text-[#36342E] text-center mb-3",children:"Why developers choose Loki Mode"}),e.jsx("p",{className:"text-sm text-[#6B6960] text-center mb-10 max-w-lg mx-auto",children:"Built by developers, for developers. Every decision optimized for shipping faster."}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:Xt.map(t=>e.jsx(Jt,{...t},t.title))})]})}const ts=[{title:"Product",links:[{label:"Features",to:"/"},{label:"Templates",to:"/templates"},{label:"Pricing",href:"https://www.autonomi.dev/#pricing"},{label:"Docs",href:"https://github.com/asklokesh/loki-mode/wiki"}]},{title:"Developers",links:[{label:"Quick Start",to:"/"},{label:"API Reference",href:"https://github.com/asklokesh/loki-mode/wiki/API-Reference"},{label:"CLI Docs",href:"https://github.com/asklokesh/loki-mode/wiki/CLI-Reference"},{label:"Changelog",href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md"}]},{title:"Company",links:[{label:"About Autonomi",href:"https://www.autonomi.dev/"},{label:"Blog",href:"https://www.autonomi.dev/blog"},{label:"Careers",href:"https://www.autonomi.dev/careers"},{label:"Contact",href:"mailto:hello@autonomi.dev"}]},{title:"Community",links:[{label:"GitHub",href:"https://github.com/asklokesh/loki-mode"},{label:"Discord",href:"https://discord.gg/autonomi"},{label:"Twitter",href:"https://twitter.com/autonomidev"},{label:"Forum",href:"https://github.com/asklokesh/loki-mode/discussions"}]}];function ss(){const t=ae(),s=(r,a)=>{r.to&&(a.preventDefault(),t(r.to))};return e.jsx("footer",{className:"w-full bg-[#F0EDE8] border-t border-[#ECEAE3] mt-8",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-12",children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-8 mb-10",children:ts.map(r=>e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-[#36342E] uppercase tracking-wider mb-4",children:r.title}),e.jsx("ul",{className:"space-y-2.5",children:r.links.map(a=>e.jsx("li",{children:e.jsx("a",{href:a.href||a.to||"#",onClick:i=>s(a,i),className:"text-sm text-[#6B6960] hover:text-[#553DE9] transition-colors",...a.href?{target:"_blank",rel:"noopener noreferrer"}:{},children:a.label})},a.label))})]},r.title))}),e.jsxs("div",{className:"border-t border-[#ECEAE3] pt-6 flex flex-col sm:flex-row items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-[#6B6960]",children:[e.jsx("span",{children:"Built with care by Autonomi"}),e.jsx("span",{className:"hidden sm:inline text-[#ECEAE3]",children:"|"}),e.jsx("span",{className:"px-2 py-0.5 rounded bg-[#553DE9]/10 text-[#553DE9] font-semibold text-[10px]",children:"v6.73.0"})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-[#6B6960]",children:[e.jsx("a",{href:"https://www.autonomi.dev/privacy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#553DE9] transition-colors",children:"Privacy"}),e.jsx("a",{href:"https://www.autonomi.dev/terms",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#553DE9] transition-colors",children:"Terms"})]})]})]})})}function rs({label:t,value:s,suffix:r=""}){const[a,i]=n.useState(0),o=n.useRef(!1),l=n.useRef(null);return n.useEffect(()=>{if(o.current)return;const d=new IntersectionObserver(([c])=>{if(c.isIntersecting&&!o.current){let m=function(p){const b=p-v,y=Math.min(b/u,1),N=1-Math.pow(1-y,3);i(Math.round(s*N)),y<1&&requestAnimationFrame(m)};o.current=!0;const u=800,v=performance.now();requestAnimationFrame(m)}},{threshold:.3});return l.current&&d.observe(l.current),()=>d.disconnect()},[s]),e.jsxs("div",{ref:l,className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-[#36342E] dark:text-[#E8E6E3] tabular-nums",children:[a.toLocaleString(),r]}),e.jsx("div",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] mt-1",children:t})]})}const W="asklokesh/loki-mode",as="loki-mode";function ns(){const[t,s]=n.useState([{label:"GitHub Stars",value:0},{label:"Forks",value:0},{label:"Contributors",value:0},{label:"npm Downloads",value:0,suffix:"+"}]);return n.useEffect(()=>{(async()=>{try{const[a,i,o]=await Promise.allSettled([fetch(`https://api.github.com/repos/${W}`),fetch(`https://api.github.com/repos/${W}/contributors?per_page=1&anon=true`,{method:"HEAD"}),fetch(`https://api.npmjs.org/downloads/point/last-month/${as}`)]);let l=0,d=0,c=0,m=0;if(a.status==="fulfilled"&&a.value.ok){const u=await a.value.json();l=u.stargazers_count||0,d=u.forks_count||0}if(i.status==="fulfilled"){const v=(i.value.headers.get("Link")||"").match(/page=(\d+)>; rel="last"/);if(v)c=parseInt(v[1],10);else{const p=await fetch(`https://api.github.com/repos/${W}/contributors?per_page=100&anon=true`);if(p.ok){const b=await p.json();c=Array.isArray(b)?b.length:0}}}o.status==="fulfilled"&&o.value.ok&&(m=(await o.value.json()).downloads||0),s([{label:"GitHub Stars",value:l},{label:"Forks",value:d},{label:"Contributors",value:c},{label:"npm Downloads",value:m,suffix:"+"}])}catch{}})()},[]),e.jsxs("div",{className:"py-8 border-t border-[#ECEAE3] dark:border-[#2A2A30]",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-6",children:[e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#36342E] dark:text-[#E8E6E3]",children:e.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",fill:"currentColor"})}),e.jsx("span",{className:"text-sm font-semibold text-[#36342E] dark:text-[#E8E6E3]",children:"Open Source"})]}),e.jsx("div",{className:"grid grid-cols-4 gap-6 max-w-lg mx-auto",children:t.map(r=>e.jsx(rs,{...r},r.label))}),e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("a",{href:`https://github.com/${W}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-[#553DE9] hover:text-[#4832c7] font-medium transition-colors",children:["Star us on GitHub",e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M7 17L17 7M17 7H7M17 7V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})}function is(){const[t,s]=n.useState(""),[r,a]=n.useState(!1),[i,o]=n.useState(""),l=d=>{d.preventDefault(),o("");const c=t.trim();if(c){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c)){o("Please enter a valid email address.");return}try{const m=JSON.parse(localStorage.getItem("pl_newsletter_emails")||"[]");m.includes(c)||(m.push(c),localStorage.setItem("pl_newsletter_emails",JSON.stringify(m)))}catch{}a(!0),s("")}};return r?e.jsxs("div",{className:"flex items-center gap-2 py-3 px-4 rounded-xl bg-[#1FC5A8]/10 border border-[#1FC5A8]/20",children:[e.jsx(ct,{size:16,className:"text-[#1FC5A8] flex-shrink-0"}),e.jsx("span",{className:"text-sm text-[#36342E] font-medium",children:"Thanks for subscribing! We will keep you posted."})]}):e.jsxs("div",{className:"py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(dt,{size:14,className:"text-[#6B6960]"}),e.jsx("span",{className:"text-sm text-[#6B6960]",children:"Get updates on new features and tips"})]}),e.jsxs("form",{onSubmit:l,className:"flex gap-2",children:[e.jsx("input",{type:"email",value:t,onChange:d=>s(d.target.value),placeholder:"you@example.com",className:"flex-1 px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] bg-white focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30 focus:border-[#553DE9]/40"}),e.jsx("button",{type:"submit",className:"px-4 py-2 text-sm font-semibold rounded-lg bg-[#553DE9] text-white hover:bg-[#4832c7] transition-colors",children:"Subscribe"})]}),i&&e.jsx("p",{className:"mt-1.5 text-xs text-[#C45B5B]",children:i})]})}const ls={"build-complete":{icon:e.jsx(ft,{size:24,className:"text-teal"}),title:"Build complete!",description:"Your code is ready. Time to ship it."},"deploy-success":{icon:e.jsx(re,{size:24,className:"text-primary"}),title:"Your app is live!",description:"Successfully deployed. The world can see your work now."},"first-project":{icon:e.jsx(Ke,{size:24,className:"text-warning"}),title:"First build complete!",description:"Welcome to Purple Lab. This is just the beginning."}},pe=["#553DE9","#1FC5A8","#D63384","#2F71E3","#D4A03C","#E8E4FD"],os=40;function cs({index:t}){const s=pe[t%pe.length],r=Math.random()*100,a=Math.random()*1.5,i=2+Math.random()*1.5,o=4+Math.random()*6,l=t%3===0,d=Math.random()*360;return e.jsx("div",{className:"confetti-piece",style:{position:"absolute",left:`${r}%`,top:"-10px",width:`${o}px`,height:`${o}px`,backgroundColor:s,borderRadius:l?"50%":"1px",opacity:0,transform:`rotate(${d}deg)`,animation:`confetti-fall ${i}s ease-in ${a}s forwards`}})}function ds({type:t,onDismiss:s}){const[r,a]=n.useState(!0),i=ls[t];return n.useEffect(()=>{const o=setTimeout(()=>{a(!1),s==null||s()},3500);return()=>clearTimeout(o)},[s]),r?e.jsxs("div",{className:"fixed inset-0 z-50 pointer-events-none",children:[e.jsx("div",{className:"absolute inset-0 overflow-hidden",children:Array.from({length:os},(o,l)=>e.jsx(cs,{index:l},l))}),e.jsx("div",{className:"absolute top-8 left-1/2 -translate-x-1/2 pointer-events-auto celebration-banner-enter",children:e.jsxs("div",{className:"bg-card border border-border rounded-card shadow-lg px-6 py-4 flex items-center gap-3",children:[i.icon,e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-ink",children:i.title}),e.jsx("p",{className:"text-xs text-muted",children:i.description})]})]})})]}):null}const xs={"no-projects":{icon:e.jsx(tt,{size:32,className:"text-primary/60"}),title:"Your workspace is a blank canvas",description:"What will you create today? Describe your idea and watch it come to life.",defaultActionLabel:"Start a new project"},"no-files":{icon:e.jsx(mt,{size:32,className:"text-teal/60"}),title:"This project is brand new",description:"Let's add some code! Start building and files will appear here as they're created.",defaultActionLabel:"Open editor"},"no-chat":{icon:e.jsx(fe,{size:32,className:"text-primary/60"}),title:"Start a conversation with Loki",description:"Try something like 'Add a contact form to my app' or 'Create a dark mode toggle.'",defaultActionLabel:"Say hello"},"no-team":{icon:e.jsx(Ze,{size:32,className:"text-pink/60"}),title:"Building alone is great, but building together is better",description:"Invite teammates to collaborate on this project in real time.",defaultActionLabel:"Invite a teammate"},"no-notifications":{icon:e.jsx(xt,{size:32,className:"text-teal/60"}),title:"All clear!",description:"No notifications right now. When something needs your attention, it will show up here.",defaultActionLabel:"Dismiss"}};function ms({type:t}){const r={"no-projects":{primary:"#553DE9",secondary:"#1FC5A8"},"no-files":{primary:"#1FC5A8",secondary:"#553DE9"},"no-chat":{primary:"#553DE9",secondary:"#D63384"},"no-team":{primary:"#D63384",secondary:"#553DE9"},"no-notifications":{primary:"#1FC5A8",secondary:"#2F71E3"}}[t];return e.jsxs("svg",{width:"120",height:"80",viewBox:"0 0 120 80",fill:"none",className:"mb-4 opacity-60",children:[e.jsx("circle",{cx:"60",cy:"40",r:"28",stroke:r.primary,strokeWidth:"1.5",strokeDasharray:"4 3"}),e.jsx("circle",{cx:"30",cy:"25",r:"8",fill:r.primary,opacity:"0.1"}),e.jsx("circle",{cx:"90",cy:"55",r:"12",fill:r.secondary,opacity:"0.1"}),e.jsx("circle",{cx:"60",cy:"40",r:"4",fill:r.primary,opacity:"0.3"}),e.jsx("line",{x1:"20",y1:"60",x2:"45",y2:"45",stroke:r.secondary,strokeWidth:"1",opacity:"0.2"}),e.jsx("line",{x1:"75",y1:"35",x2:"100",y2:"20",stroke:r.primary,strokeWidth:"1",opacity:"0.2"}),e.jsx("rect",{x:"50",y:"15",width:"20",height:"3",rx:"1.5",fill:r.secondary,opacity:"0.15"}),e.jsx("rect",{x:"42",y:"62",width:"36",height:"3",rx:"1.5",fill:r.primary,opacity:"0.15"})]})}function us({type:t,action:s,actionLabel:r}){const a=xs[t];return e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-6 text-center warm-empty-state-enter",children:[e.jsx(ms,{type:t}),e.jsx("div",{className:"mb-3",children:a.icon}),e.jsx("h3",{className:"text-sm font-semibold text-ink mb-1.5",children:a.title}),e.jsx("p",{className:"text-xs text-muted max-w-[260px] leading-relaxed",children:a.description}),s&&e.jsx("button",{onClick:s,className:"mt-4 px-4 py-2 text-xs font-semibold rounded-btn bg-primary/10 text-primary hover:bg-primary/20 transition-colors",children:r||a.defaultActionLabel})]})}const U=["Build a SaaS dashboard with user analytics...","Create a REST API with authentication...","Make a landing page with pricing tiers...","Build a chat app with real-time messaging...","Create an e-commerce store with Stripe..."];function ps(){const t=new Date().getHours();return t>=5&&t<12?"Good morning! What shall we build today?":t>=12&&t<17?"Good afternoon! Ready to create something amazing?":t>=17&&t<22?"Good evening! Let's build something cool.":"Burning the midnight oil? Let's build something cool."}function Ls(){const t=ae(),[s,r]=n.useState(null),[a,i]=n.useState(()=>sessionStorage.getItem("pl_running")==="1"),[o,l]=n.useState(!1),[d,c]=n.useState(()=>sessionStorage.getItem("pl_prd")),[m,u]=n.useState(!1),[v,p]=n.useState(!1),[b,y]=n.useState(!1),[N,k]=n.useState(()=>sessionStorage.getItem("pl_tab")||"terminal"),[w,B]=n.useState(()=>sessionStorage.getItem("pl_provider")||"claude"),[h,L]=n.useState(void 0),[E,z]=n.useState(!1),I=n.useMemo(()=>ps(),[]),[C,H]=n.useState(""),[S,A]=n.useState(!1),[_,q]=n.useState(!1),[$,V]=n.useState(0),[Q,G]=n.useState(!1),g=n.useRef(null),D=n.useRef(null);n.useEffect(()=>{const x=setInterval(()=>{G(!0),setTimeout(()=>{V(f=>(f+1)%U.length),G(!1)},300)},3e3);return()=>clearInterval(x)},[]),n.useEffect(()=>{const x=sessionStorage.getItem("pl_template");x&&(sessionStorage.removeItem("pl_template"),j.getTemplateContent(x).then(({content:f})=>{f&&(L(f),q(!0))}).catch(()=>{}))},[]);const[T,Y]=n.useState(null),[ne,K]=n.useState(null),[ie,Z]=n.useState(null),je=n.useCallback(x=>{if(!x){Y(null),K(null),Z(null);return}Y(x.status),K(x.agents),Z(x.logs),i(x.status.running??!1),l(x.status.paused??!1)},[]),{connected:J,subscribe:ve}=Je(je),ye=n.useCallback(()=>j.getStatus(),[]),{data:M}=R(ye,3e4,!J);n.useEffect(()=>{T===null&&M!==null&&(i(M.running??!1),l(M.paused??!1))},[M,T]),n.useEffect(()=>{sessionStorage.setItem("pl_running",a?"1":"0"),a&&u(!0)},[a]),n.useEffect(()=>{d?sessionStorage.setItem("pl_prd",d):sessionStorage.removeItem("pl_prd")},[d]),n.useEffect(()=>{sessionStorage.setItem("pl_provider",w)},[w]),n.useEffect(()=>{sessionStorage.setItem("pl_tab",N)},[N]);const X=n.useRef(void 0);n.useEffect(()=>{var f;const x=(f=T??M)==null?void 0:f.phase;x==="complete"&&X.current&&X.current!=="complete"&&z(!0),X.current=x},[T,M]);const Ne=n.useCallback(()=>j.getMemorySummary(),[]),we=n.useCallback(()=>j.getChecklist(),[]),ke=n.useCallback(()=>j.getFiles(),[]),Ee=n.useCallback(()=>j.getSessionsHistory(),[]),{data:Se,loading:Ce}=R(Ne,3e4,a),{data:Ae,loading:De}=R(we,3e4,a),{data:Pe,loading:Fe}=R(ke,3e4,a),{data:le}=R(Ee,6e4,!0),P=T??M,Le=ne,Te=ie,Me=ne===null,Re=ie===null,oe=n.useCallback(async()=>{const x=C.trim();if(!(!x||S)){r(null),A(!0),u(!1),p(!1),k("terminal");try{const f=await j.quickStart(x,w);f.started&&f.session_id&&(c(x),i(!0),t(`/project/${f.session_id}`))}catch(f){r(f instanceof Error?f.message:"Failed to start build")}finally{A(!1)}}},[C,S,w,t]),Be=n.useCallback(async(x,f,qe,Ge)=>{r(null),u(!1),p(!1),k("terminal");try{await j.startSession({prd:x,provider:f,projectDir:qe,mode:Ge}),c(x),i(!0)}catch(ce){r(ce instanceof Error?ce.message:"Failed to start session")}},[]),Ie=n.useCallback(async()=>{try{(await j.stopSession()).stopped&&(i(!1),l(!1),c(null),Y(null),K(null),Z(null))}catch{i(!1),l(!1),c(null)}sessionStorage.removeItem("pl_running"),sessionStorage.removeItem("pl_prd"),sessionStorage.removeItem("pl_tab")},[]),_e=n.useCallback(x=>{t(`/project/${x.id}`)},[t]),$e=n.useCallback(x=>{B(x)},[]),ze=n.useCallback(async()=>{try{await j.pauseSession(),l(!0)}catch{}},[]),Oe=n.useCallback(async()=>{try{await j.resumeSession(),l(!1)}catch{}},[]),He=d&&d.replace(/^#+\s*/gm,"").split(`
28
- `).find(x=>x.trim().length>0)||null;return e.jsxs("div",{className:"min-h-screen bg-[#FAF9F6] relative",children:[e.jsx("div",{className:"pattern-nodes"}),e.jsx("div",{className:"max-w-[1920px] mx-auto px-6 py-6 relative z-10",children:a?e.jsxs(e.Fragment,{children:[e.jsx(F,{name:"ControlBar",children:e.jsx(jt,{status:P,prdSummary:He,onStop:Ie,onPause:ze,onResume:Oe,isPaused:o})}),e.jsx("div",{className:"mt-4",children:e.jsx(F,{name:"StatusOverview",children:e.jsx(vt,{status:P})})}),e.jsxs("div",{className:"mt-4 grid grid-cols-12 gap-6",style:{height:"calc(100vh - 340px)",minHeight:"400px"},children:[e.jsx("div",{className:"col-span-3 flex flex-col gap-6",children:e.jsx(F,{name:"PhaseVisualizer",children:e.jsx(kt,{currentPhase:(P==null?void 0:P.phase)||"idle",iteration:(P==null?void 0:P.iteration)||0})})}),e.jsxs("div",{className:"col-span-5 flex flex-col gap-0 min-h-0",children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 flex-shrink-0",children:[e.jsx("button",{onClick:()=>k("terminal"),className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all ${N==="terminal"?"bg-[#553DE9] text-white":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0]"}`,children:"Terminal"}),e.jsx("button",{onClick:()=>k("metrics"),className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all ${N==="metrics"?"bg-[#553DE9] text-white":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0]"}`,children:"Metrics"})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(F,{name:"Terminal",children:N==="terminal"?e.jsx(st,{logs:Te,loading:Re,subscribe:ve}):e.jsx(ue,{visible:!0})})})]}),e.jsxs("div",{className:"col-span-4 flex flex-col gap-6 overflow-y-auto",children:[e.jsx(F,{name:"AgentDashboard",children:e.jsx(St,{agents:Le,loading:Me})}),e.jsx(F,{name:"QualityGates",children:e.jsx(Ft,{checklist:Ae,loading:De})})]})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-12 gap-6",children:[e.jsx("div",{className:"col-span-6",children:e.jsx(F,{name:"FileBrowser",children:e.jsx(Rt,{files:Pe,loading:Fe})})}),e.jsx("div",{className:"col-span-6",children:e.jsx(F,{name:"MemoryViewer",children:e.jsx(It,{memory:Se,loading:Ce})})})]})]}):e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{ref:D,className:"text-center mt-12 mb-10",children:[e.jsx("p",{className:"text-sm font-medium text-[#553DE9] mb-2",children:I}),e.jsx("h2",{className:"font-heading text-h1 text-[#36342E]",children:"Describe it. Build it. Ship it."}),e.jsx("p",{className:"text-[#6B6960] mt-3 text-base max-w-xl mx-auto",children:"Type what you want to build. Purple Lab handles the rest -- from code to containers, autonomously."})]}),e.jsxs("div",{className:"w-full max-w-2xl",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:g,type:"text",value:C,onChange:x=>H(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),oe())},className:"w-full text-xl px-6 py-4 rounded-2xl bg-white border border-[#ECEAE3] shadow-sm focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30 focus:border-[#553DE9]/40 focus:shadow-lg transition-all placeholder:text-transparent",disabled:S,"aria-label":"Describe what you want to build"}),!C&&e.jsx("div",{className:"absolute left-6 top-1/2 -translate-y-1/2 text-xl text-[#6B6960]/50 pointer-events-none select-none","aria-hidden":"true",children:e.jsx("span",{className:Q?"quick-input-placeholder-exit":"quick-input-placeholder",children:U[$]},$)})]}),e.jsx("div",{className:"mt-4 flex items-center justify-center gap-4",children:e.jsx("button",{onClick:oe,disabled:!C.trim()||S,className:`px-8 py-3 rounded-xl text-base font-semibold transition-all ${!C.trim()||S?"bg-[#553DE9]/20 text-[#553DE9]/40 cursor-not-allowed":"bg-[#553DE9] text-white hover:bg-[#4832c7] shadow-lg shadow-[#553DE9]/25 hover:shadow-xl hover:shadow-[#553DE9]/30 active:scale-[0.98]"}`,children:S?"Starting...":"Start Building"})}),s&&e.jsx("div",{className:"mt-3 px-4 py-2.5 rounded-xl bg-[#C45B5B]/10 border border-[#C45B5B]/20 text-[#C45B5B] text-sm font-medium text-center",children:s}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx("button",{onClick:()=>q(!_),className:"text-sm text-[#553DE9] hover:text-[#4832c7] font-medium transition-colors",children:_?"Hide advanced options":"Advanced (write full spec)"})}),_&&e.jsx("div",{className:"mt-4",children:e.jsx(Nt,{onSubmit:Be,running:a,error:s,provider:w,onProviderChange:$e,initialPrd:h})})]}),m&&!a&&e.jsxs("div",{className:"w-full max-w-3xl mt-6 flex flex-col gap-4",children:[e.jsx("button",{onClick:async()=>{try{const x=await j.getSessionsHistory();x.length>0&&t(`/project/${x[0].id}`)}catch{}},className:"w-full px-6 py-4 rounded-card text-base font-bold bg-[#553DE9] text-white hover:bg-[#553DE9]/90 transition-all shadow-lg shadow-[#553DE9]/20",children:"View Project -- Browse Files and Preview"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>p(!v),className:"px-4 py-2 rounded-card text-sm font-semibold border border-[#553DE9]/30 text-[#553DE9] hover:bg-[#553DE9]/5 transition-all",children:v?"Hide Report":"Report"}),e.jsx("button",{onClick:()=>y(!b),className:"px-4 py-2 rounded-card text-sm font-semibold border border-[#ECEAE3] text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0] transition-all",children:b?"Hide Metrics":"Metrics"})]}),e.jsx(_t,{visible:v}),e.jsx(ue,{visible:b})]}),e.jsx("div",{className:"w-full max-w-3xl mt-6",children:le&&le.length===0?e.jsx(us,{type:"no-projects",action:()=>{var f;const x=U[Math.floor(Math.random()*U.length)];H(x),(f=g.current)==null||f.focus()},actionLabel:"Try an example"}):e.jsx(Ot,{onLoadSession:_e})}),e.jsxs("div",{className:"mt-6 text-xs text-[#6B6960] flex items-center gap-2",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${J?"bg-[#1FC5A8]":"bg-[#C45B5B]"}`}),J?"Connected to Purple Lab backend":"Waiting for backend connection..."]}),e.jsx(Gt,{}),e.jsx(Qt,{}),e.jsx(Zt,{}),e.jsx(es,{}),e.jsx("section",{className:"w-full max-w-3xl mx-auto py-16",children:e.jsxs("div",{className:"rounded-2xl bg-gradient-to-br from-[#553DE9]/5 via-[#553DE9]/10 to-[#1FC5A8]/5 border border-[#553DE9]/15 p-10 text-center",children:[e.jsx("h2",{className:"font-heading text-h2 text-[#36342E] mb-3",children:"Ready to build something amazing?"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6 max-w-md mx-auto",children:"Go from idea to deployed product in minutes, not months. Let AI handle the heavy lifting."}),e.jsxs("div",{className:"flex items-center justify-center gap-3 flex-wrap",children:[e.jsx("button",{onClick:()=>{var x;(x=D.current)==null||x.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{var f;return(f=g.current)==null?void 0:f.focus()},500)},className:"px-8 py-3 rounded-xl text-base font-semibold bg-[#553DE9] text-white hover:bg-[#4832c7] shadow-lg shadow-[#553DE9]/25 hover:shadow-xl hover:shadow-[#553DE9]/30 active:scale-[0.98] transition-all",children:"Start Building"}),e.jsx("button",{onClick:()=>t("/templates"),className:"px-8 py-3 rounded-xl text-base font-semibold border border-[#553DE9]/30 text-[#553DE9] hover:bg-[#553DE9]/5 transition-all",children:"View Templates"})]})]})}),e.jsx(is,{}),e.jsx(ns,{})]})}),!a&&e.jsx(ss,{}),E&&e.jsx(ds,{type:"build-complete",onDismiss:()=>z(!1)})]})}export{Ls as default};
27
+ `)}},[]),Q=async()=>{if(!(!i.trim()||A)){_(!0),S(null),$(!0);try{const g=await j.planSession(i,y);S(g)}catch{S({complexity:"unknown",cost_estimate:"N/A",iterations:0,phases:[],output_text:"Failed to run loki plan. The CLI may not be available.",returncode:1})}finally{_(!1)}}},G=async()=>{if(!(!i.trim()||s||E)){$(!1),z(!0);try{await t(i,y,p.trim()||void 0,I?"quick":void 0)}finally{z(!1)}}};return e.jsxs(e.Fragment,{children:[q&&e.jsx(yt,{plan:O,loading:A,onConfirm:G,onCancel:()=>$(!1)}),e.jsxs("div",{className:"card p-6 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Product Requirements"}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>k(!N),className:"text-xs font-medium px-3 py-1.5 rounded-card border border-primary/20 text-primary hover:bg-primary/5 transition-colors",children:c||"Templates"}),N&&e.jsx("div",{className:"absolute right-0 top-full mt-1 w-56 card rounded-card overflow-hidden z-20 shadow-card-hover",children:e.jsxs("div",{className:"py-1 max-h-64 overflow-y-auto terminal-scroll",children:[h&&e.jsx("div",{className:"px-3 py-2 text-xs text-warning border-b border-warning/10",children:"Could not load templates from server. Check that the backend is running."}),!h&&w.length===0&&e.jsx("div",{className:"px-3 py-2 text-xs text-muted",children:"Loading..."}),w.map(g=>e.jsx("button",{onClick:()=>V(g.filename,g.name),className:"w-full text-left px-3 py-2 text-sm text-ink hover:bg-primary/5 transition-colors",children:g.name},g.filename))]})})]})})]}),e.jsx("textarea",{value:i,onChange:g=>d(g.target.value),placeholder:"Paste your spec or PRD here, or select a template above to get started...",className:"flex-1 min-h-[280px] w-full bg-card rounded-card border border-border-light px-4 py-3 text-sm font-mono text-ink placeholder:text-primary/60 resize-none focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/30 transition-all",spellCheck:!1}),e.jsxs("div",{className:"mt-3",children:[e.jsx("label",{className:"block text-xs text-muted font-medium mb-1 uppercase tracking-wider",children:"Project Directory"}),e.jsx("input",{type:"text",value:p,onChange:g=>b(g.target.value),placeholder:"Leave blank to auto-create, or type a path (e.g. /Users/you/my-project)",className:"w-full bg-card rounded-card border border-border-light px-4 py-2 text-sm font-mono text-ink placeholder:text-primary/60/70 focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/30 transition-all",spellCheck:!1}),e.jsx("p",{className:"text-xs text-muted-accessible mt-1",children:"Type a path or leave blank to auto-create under ~/purple-lab-projects/"})]}),r&&e.jsx("div",{className:"mt-3 px-3 py-2 rounded-btn bg-danger/10 border border-danger/20 text-danger text-xs font-medium",children:r}),e.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[e.jsxs("button",{onClick:()=>C(!I),title:"Quick Mode: 3 iterations max, faster builds",className:`flex items-center gap-1.5 px-3 py-1.5 rounded-card text-xs font-semibold border transition-all ${I?"bg-primary/10 border-primary/30 text-primary":"border-border-light text-muted hover:text-ink hover:bg-card"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${I?"bg-primary":"bg-muted/40"}`}),"Quick"]}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-xs text-muted font-mono",children:[i.length.toLocaleString()," chars"]}),e.jsx("button",{onClick:Q,disabled:!i.trim()||s||E||A,className:`px-6 py-2.5 rounded-card text-sm font-semibold transition-all ${!i.trim()||s||E||A?"bg-primary/10 text-muted cursor-not-allowed":"bg-primary text-white hover:bg-primary/90 shadow-button"}`,children:A?"Analyzing...":E?"Starting...":s?"Building...":"Start Build"})]})]})]})}const H=[{key:"reason",label:"Reason",description:"Analyzing task, planning approach"},{key:"act",label:"Act",description:"Implementing changes, writing code"},{key:"reflect",label:"Reflect",description:"Reviewing output, self-critique"},{key:"verify",label:"Verify",description:"Testing, validation, quality gates"}];function wt(t){if(!t)return"reason";const s=t.toLowerCase();return s.includes("reason")||s.includes("plan")?"reason":s.includes("act")||s.includes("implement")||s.includes("code")?"act":s.includes("reflect")||s.includes("review")?"reflect":s.includes("verify")||s.includes("test")||s.includes("check")?"verify":"idle"}function kt({currentPhase:t,iteration:s}){const r=wt(t);return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"RARV Cycle"}),e.jsxs("span",{className:"font-mono text-xs text-muted",children:["Iteration ",s]})]}),e.jsx("div",{className:"flex items-center justify-center mb-5",children:e.jsxs("svg",{viewBox:"0 0 120 120",className:"w-28 h-28",children:[H.map((a,l)=>{const o=a.key===r,i=r!=="idle"&&H.findIndex(u=>u.key===r)>l,d=(l*90-90)*(Math.PI/180),c=60+40*Math.cos(d),x=60+40*Math.sin(d);return e.jsxs("g",{children:[l<H.length-1&&e.jsx("line",{x1:c,y1:x,x2:60+40*Math.cos(((l+1)*90-90)*(Math.PI/180)),y2:60+40*Math.sin(((l+1)*90-90)*(Math.PI/180)),stroke:i?"#553DE9":"#ECEAE3",strokeWidth:i?2:1,strokeDasharray:i?"none":"4 3"}),l===H.length-1&&e.jsx("line",{x1:c,y1:x,x2:60+40*Math.cos(-90*(Math.PI/180)),y2:60+40*Math.sin(-90*(Math.PI/180)),stroke:"#ECEAE3",strokeWidth:1,strokeDasharray:"4 3"}),e.jsx("circle",{cx:c,cy:x,r:o?14:10,fill:o||i?"#553DE9":"#E8E4FD",stroke:o?"#4432c4":i?"#553DE9":"#ECEAE3",strokeWidth:o?3:1.5,className:o?"phase-active":""}),e.jsx("text",{x:c,y:x+(l===0?-20:l===2?24:0),textAnchor:"middle",className:"text-[9px] font-semibold fill-ink",dx:l===1?22:l===3?-22:0,children:a.label[0]})]},a.key)}),e.jsx("text",{x:"60",y:"64",textAnchor:"middle",className:"text-lg font-bold font-mono fill-primary",children:s})]})}),e.jsx("div",{className:"space-y-2",children:H.map(a=>{const l=a.key===r;return e.jsxs("div",{className:`flex items-center gap-3 px-3 py-2 rounded-card transition-all duration-200 ${l?"bg-primary/8 border border-primary/20":"opacity-50"}`,children:[e.jsx("div",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${l?"bg-primary phase-active":"bg-border"}`}),e.jsxs("div",{children:[e.jsx("span",{className:`text-sm font-semibold ${l?"text-primary":"text-muted"}`,children:a.label}),l&&e.jsx("p",{className:"text-xs text-muted mt-0.5",children:a.description})]})]},a.key)})})]})}const ee={architect:"bg-primary/10 text-primary border-primary/20",developer:"bg-primary/10 text-primary border-primary/20",tester:"bg-success/10 text-success border-success/20",reviewer:"bg-warning/10 text-warning border-warning/20",planner:"bg-primary/60/20 text-ink border-primary/60/30",default:"bg-border/30 text-muted border-border/50"};function Et(t){if(!t)return ee.default;const s=t.toLowerCase();for(const[r,a]of Object.entries(ee))if(s.includes(r))return a;return ee.default}function St({agents:t,loading:s}){const r=(t==null?void 0:t.filter(l=>l.alive))||[],a=(t==null?void 0:t.filter(l=>!l.alive))||[];return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Agents"}),e.jsxs("span",{className:"font-mono text-xs text-muted",children:[r.length," active"]})]}),s&&!t&&e.jsx("div",{className:"text-center py-8 text-muted text-sm",children:"Loading agents..."}),!s&&(t==null?void 0:t.length)===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-muted text-sm",children:"No agents running"}),e.jsx("p",{className:"text-primary/60 text-xs mt-1",children:"Start a build to spawn agents"})]}),r.length>0&&e.jsx("div",{className:"space-y-2 mb-4",children:r.map(l=>e.jsx(de,{agent:l},l.id))}),a.length>0&&e.jsxs("details",{className:"mt-3",children:[e.jsxs("summary",{className:"text-xs text-muted cursor-pointer hover:text-ink transition-colors",children:[a.length," completed"]}),e.jsx("div",{className:"space-y-1.5 mt-2",children:a.slice(0,10).map(l=>e.jsx(de,{agent:l,compact:!0},l.id))})]})]})}function de({agent:t,compact:s}){const r=Et(t.type||t.name||"");return s?e.jsxs("div",{className:"flex items-center gap-2 px-2 py-1 rounded-btn bg-hover text-xs",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-muted/30"}),e.jsx("span",{className:"font-medium text-muted truncate",children:t.name||t.id}),e.jsx("span",{className:"text-primary/60 ml-auto",children:t.type})]}):e.jsxs("div",{className:`flex items-start gap-3 px-3 py-2.5 rounded-card border ${r}`,children:[e.jsx("div",{className:"flex-shrink-0 mt-0.5",children:e.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${t.alive?"bg-success phase-active":"bg-muted/30"}`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold truncate",children:t.name||t.id}),t.type&&e.jsx("span",{className:"text-xs font-mono font-medium opacity-70",children:t.type})]}),t.task&&e.jsx("p",{className:"text-xs opacity-70 mt-0.5 truncate",children:t.task}),t.status&&t.status!=="unknown"&&e.jsx("span",{className:"inline-block text-xs font-mono mt-1 opacity-60",children:t.status})]}),t.pid&&e.jsxs("span",{className:"text-xs font-mono text-muted-accessible flex-shrink-0",children:["PID ",t.pid]})]})}function Ct({text:t,position:s="top",size:r=14}){const[a,l]=n.useState(!1),o=n.useRef(null);n.useEffect(()=>{if(!a)return;const c=x=>{o.current&&!o.current.contains(x.target)&&l(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[a]);const i={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},d={top:"top-full left-1/2 -translate-x-1/2 border-t-[#1A1A1E] dark:border-t-card border-l-transparent border-r-transparent border-b-transparent border-4",bottom:"bottom-full left-1/2 -translate-x-1/2 border-b-[#1A1A1E] dark:border-b-card border-l-transparent border-r-transparent border-t-transparent border-4",left:"left-full top-1/2 -translate-y-1/2 border-l-[#1A1A1E] dark:border-l-card border-t-transparent border-b-transparent border-r-transparent border-4",right:"right-full top-1/2 -translate-y-1/2 border-r-[#1A1A1E] dark:border-r-card border-t-transparent border-b-transparent border-l-transparent border-4"};return e.jsxs("div",{className:"relative inline-flex items-center",ref:o,children:[e.jsx("button",{onClick:()=>l(!a),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:"text-muted/50 hover:text-primary transition-colors p-0.5 rounded-full","aria-label":"Help",type:"button",children:e.jsx(Ue,{size:r})}),a&&e.jsx("div",{className:`absolute z-50 ${i[s]}`,role:"tooltip",children:e.jsxs("div",{className:"relative bg-[#1A1A1E] text-white px-3 py-2 rounded-lg shadow-lg max-w-[240px]",children:[e.jsx("p",{className:"text-[11px] leading-relaxed",children:t}),e.jsx("span",{className:`absolute ${d[s]}`})]})})]})}const At={qualityGates:"Automated checks ensuring your code meets quality standards. Includes static analysis, test coverage, and security scanning."},Dt={pass:{badge:"bg-success/10 text-success border-success/20",dot:"bg-success",label:"Pass"},fail:{badge:"bg-danger/10 text-danger border-danger/20",dot:"bg-danger",label:"Fail"},skip:{badge:"bg-muted/10 text-muted border-muted/20",dot:"bg-muted/40",label:"Skip"},pending:{badge:"bg-warning/10 text-warning border-warning/20",dot:"bg-warning",label:"Pending"}};function Pt({item:t}){const[s,r]=n.useState(!1),a=Dt[t.status];return e.jsxs("div",{className:`border rounded-card overflow-hidden ${a.badge}`,children:[e.jsxs("button",{type:"button",className:"w-full flex items-center gap-3 px-3 py-2.5 text-left",onClick:()=>t.details&&r(!s),children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${a.dot}`}),e.jsx("span",{className:"text-sm font-medium flex-1 truncate",children:t.label}),e.jsx("span",{className:"text-xs font-mono font-semibold uppercase tracking-wider flex-shrink-0",children:a.label}),t.details&&e.jsx("span",{className:"text-xs text-muted/60 flex-shrink-0",children:s?"v":">"})]}),s&&t.details&&e.jsx("div",{className:"px-3 pb-2.5 pt-0",children:e.jsx("p",{className:"text-xs font-mono opacity-70 leading-relaxed",children:t.details})})]})}function Ft({checklist:t,loading:s}){const r=t&&t.total>0?t.passed/t.total*100:0;return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Quality Gates"}),e.jsx(Ct,{text:At.qualityGates,position:"right",size:13})]}),t&&e.jsxs("span",{className:"font-mono text-xs text-muted",children:[t.passed,"/",t.total," passed"]})]}),s&&!t&&e.jsx("div",{className:"text-center py-8 text-muted text-sm",children:"Loading gates..."}),!s&&!t&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-muted text-sm",children:"No quality gate data"}),e.jsx("p",{className:"text-primary/60 text-xs mt-1",children:"Gates run during verification phase"})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-3 text-xs",children:[e.jsxs("span",{className:"text-success font-medium",children:[t.passed," passed"]}),t.failed>0&&e.jsxs("span",{className:"text-danger font-medium",children:[t.failed," failed"]}),t.skipped>0&&e.jsxs("span",{className:"text-muted",children:[t.skipped," skipped"]}),t.pending>0&&e.jsxs("span",{className:"text-warning",children:[t.pending," pending"]})]}),e.jsx("div",{className:"w-full h-2 bg-charcoal/10 rounded-full overflow-hidden mb-4",children:e.jsx("div",{className:"h-full bg-success rounded-full transition-all duration-500",style:{width:`${r}%`}})}),e.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto terminal-scroll",children:t.items.map(a=>e.jsx(Pt,{item:a},a.id))})]})]})}const Lt={".py":"bg-success",".ts":"bg-primary",".tsx":"bg-primary",".md":"bg-warning",".sh":"bg-primary"};function Tt(t){const s=t.substring(t.lastIndexOf("."));return Lt[s]||"bg-muted"}function Mt(t){return t==null?"":t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}const te=100;function ge({node:t,depth:s,onSelectFile:r,selectedPath:a}){const[l,o]=n.useState(!1),[i,d]=n.useState(te),c=t.type==="directory",x=t.path===a,u=c&&l?t.children??[]:[],v=u.length>i;return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:`w-full flex items-center gap-2 px-2 py-1 rounded-btn text-left text-sm transition-colors hover:bg-hover ${x?"bg-primary/10 text-primary":"text-ink"}`,style:{paddingLeft:`${s*16+8}px`},onClick:()=>{c?(o(!l),l&&d(te)):r(t.path)},children:[c?e.jsx("span",{className:"font-mono text-xs text-muted w-3 flex-shrink-0",children:l?"v":">"}):e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${Tt(t.name)}`}),e.jsx("span",{className:`truncate ${c?"font-medium":"font-mono text-xs"}`,children:t.name}),!c&&t.size!==void 0&&e.jsx("span",{className:"ml-auto text-xs font-mono text-muted-accessible flex-shrink-0",children:Mt(t.size)})]}),u.length>0&&e.jsxs("div",{children:[u.slice(0,i).map(p=>e.jsx(ge,{node:p,depth:s+1,onSelectFile:r,selectedPath:a},p.path)),v&&e.jsxs("button",{type:"button",className:"w-full text-left text-xs text-primary hover:text-primary/80 py-1 transition-colors",style:{paddingLeft:`${(s+1)*16+8}px`},onClick:()=>d(p=>p+te),children:["Show more (",u.length-i," remaining)"]})]})]})}function Rt({files:t,loading:s}){const[r,a]=n.useState(null),[l,o]=n.useState(null),[i,d]=n.useState(!1),[c,x]=n.useState(null),u=n.useCallback(async p=>{o(null),a(p),d(!0),x(null);try{const b=await j.getFileContent(p);o(b.content)}catch(b){const y=b instanceof Error?b.message:"Unknown error",N=b instanceof TypeError||y==="Request timeout",k=y.includes("404")||y.includes("not found")||y.includes("Not found");x(N?"Network error - server may be unreachable":k?"File not found - it may have been deleted or renamed":y),o(null)}finally{d(!1)}},[]),v=n.useCallback(p=>{u(p)},[u]);return e.jsxs("div",{className:"card p-6 flex flex-col",style:{minHeight:"300px"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"File Browser"}),e.jsx("span",{className:"font-mono text-xs text-muted",children:".loki/"})]}),s&&!t&&e.jsx("div",{className:"text-center py-8 text-muted text-sm",children:"Loading files..."}),!s&&(!t||t.length===0)&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-muted text-sm",children:"No project files found"}),e.jsx("p",{className:"text-primary/60 text-xs mt-1",children:"Start a session to generate .loki/ state"})]}),t&&t.length>0&&e.jsxs("div",{className:"flex gap-4 flex-1 min-h-0",children:[e.jsx("div",{className:"w-1/2 overflow-y-auto terminal-scroll pr-2",children:t.map(p=>e.jsx(ge,{node:p,depth:0,onSelectFile:v,selectedPath:r},p.path))}),e.jsxs("div",{className:"w-1/2 bg-charcoal/5 rounded-card p-3 overflow-hidden flex flex-col",children:[!r&&e.jsx("div",{className:"flex-1 flex items-center justify-center text-muted text-xs",children:"Select a file to preview"}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-xs font-mono text-primary mb-2 truncate",children:r}),e.jsx("div",{className:"flex-1 overflow-y-auto terminal-scroll",children:i?e.jsx("div",{className:"text-muted text-xs",children:"Loading..."}):c?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 py-6",children:[e.jsx("p",{className:"text-danger text-xs font-medium",children:"Failed to load file"}),e.jsx("p",{className:"text-muted-accessible text-xs text-center max-w-[200px] break-words",children:c}),e.jsx("button",{type:"button",onClick:()=>r&&u(r),className:"mt-1 px-3 py-1 text-xs font-semibold rounded-btn border border-primary/20 text-primary hover:bg-primary/5 transition-colors",children:"Retry"})]}):e.jsx("pre",{className:"text-xs font-mono text-ink whitespace-pre-wrap break-words leading-relaxed",children:l})})]})]})]})]})}const me=5e5;function xe(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function Bt(t){if(!t)return"Never";try{const s=new Date(t),a=new Date().getTime()-s.getTime(),l=Math.floor(a/(1e3*60*60));return l<1?"Just now":l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}catch{return t}}function It({memory:t,loading:s}){const r=t?[{label:"Episodic",count:t.episodic_count,color:"text-primary",bg:"bg-primary/10",border:"border-primary/20"},{label:"Semantic",count:t.semantic_count,color:"text-success",bg:"bg-success/10",border:"border-success/20"},{label:"Skills",count:t.skill_count,color:"text-warning",bg:"bg-warning/10",border:"border-warning/20"}]:[],a=t?Math.min(t.total_tokens/me*100,100):0;return e.jsxs("div",{className:"card p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Memory System"}),t&&e.jsx("span",{className:"font-mono text-xs text-muted",children:Bt(t.last_consolidation)})]}),s&&!t&&e.jsx("div",{className:"text-center py-8 text-muted text-sm",children:"Loading memory..."}),!s&&!t&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx("p",{className:"text-muted text-sm",children:"No memory data available"}),e.jsx("p",{className:"text-primary/60 text-xs mt-1",children:"Memory populates during autonomous runs"})]}),t&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-3 gap-3 mb-4",children:r.map(l=>e.jsxs("div",{className:`${l.bg} border ${l.border} rounded-card p-3 text-center`,children:[e.jsx("div",{className:`text-2xl font-bold font-mono ${l.color}`,children:l.count}),e.jsx("div",{className:"text-xs text-muted-accessible font-medium mt-1 uppercase tracking-wider",children:l.label})]},l.label))}),e.jsxs("div",{className:"mt-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[e.jsx("span",{className:"text-xs text-muted font-medium",children:"Token Usage"}),e.jsxs("span",{className:"text-xs font-mono text-ink",children:[xe(t.total_tokens)," / ",xe(me)]})]}),e.jsx("div",{className:"w-full h-2 bg-charcoal/10 rounded-full overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${a>80?"bg-danger":a>50?"bg-warning":"bg-info"}`,style:{width:`${a}%`}})})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-muted",children:"Last Consolidation"}),e.jsx("span",{className:"font-mono text-ink",children:t.last_consolidation?new Date(t.last_consolidation).toLocaleString():"Never"})]})]})]})}function _t({visible:t}){const[s,r]=n.useState("markdown"),[a,l]=n.useState(null),[o,i]=n.useState(null),[d,c]=n.useState(!1),[x,u]=n.useState(!1),[v,p]=n.useState(null),[b,y]=n.useState(!1);if(!t)return null;const N=async()=>{c(!0),p(null),l(null),i(null);try{const h=await j.generateReport(s);l(h)}catch(h){p(h instanceof Error?h.message:"Failed to generate report")}finally{c(!1)}},k=async()=>{u(!0),p(null);try{const h=await j.shareSession();i(h)}catch(h){p(h instanceof Error?h.message:"Failed to share session")}finally{u(!1)}},w=async h=>{try{await navigator.clipboard.writeText(h),y(!0),setTimeout(()=>y(!1),2e3)}catch{}},B=()=>{if(!a)return;const h=new Blob([a.content],{type:s==="html"?"text/html":"text/markdown"}),L=URL.createObjectURL(h),E=document.createElement("a");E.href=L,E.download=`loki-report.${s==="html"?"html":"md"}`,E.click(),URL.revokeObjectURL(L)};return e.jsxs("div",{className:"card p-4 rounded-card",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Session Report"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex items-center gap-1 card rounded-card p-1",children:["markdown","html"].map(h=>e.jsx("button",{onClick:()=>r(h),className:`px-3 py-1 text-xs font-semibold rounded-btn transition-all ${s===h?"bg-primary text-white shadow-sm":"text-muted hover:text-ink hover:bg-hover"}`,children:h.toUpperCase()},h))}),e.jsx("button",{onClick:N,disabled:d,className:"px-4 py-1.5 rounded-card text-xs font-semibold bg-primary text-white hover:bg-primary/90 disabled:opacity-50 transition-all",children:d?"Generating...":"Generate Report"})]})]}),v&&e.jsx("div",{className:"mb-3 px-3 py-2 rounded-btn bg-danger/10 border border-danger/20 text-danger text-xs",children:v}),a&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("span",{className:"text-xs text-muted",children:["Report generated (",a.format,")"]}),e.jsx("div",{className:"flex-1"}),e.jsx("button",{onClick:()=>w(a.content),className:"px-3 py-1 text-xs font-medium text-muted hover:text-ink border border-border-light rounded-btn hover:bg-hover transition-all",children:b?"Copied":"Copy"}),e.jsx("button",{onClick:B,className:"px-3 py-1 text-xs font-medium text-muted hover:text-ink border border-border-light rounded-btn hover:bg-hover transition-all",children:"Download"}),e.jsx("button",{onClick:k,disabled:x,className:"px-3 py-1 text-xs font-medium bg-primary/10 text-primary border border-primary/20 rounded-btn hover:bg-primary/20 disabled:opacity-50 transition-all",children:x?"Sharing...":"Share as Gist"})]}),o&&e.jsxs("div",{className:"mb-2 flex items-center gap-2 px-3 py-2 rounded-btn bg-success/10 border border-success/20",children:[e.jsx("span",{className:"text-xs text-success font-medium",children:"Shared:"}),o.url?e.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary underline flex-1 truncate",children:o.url}):e.jsx("span",{className:"text-xs text-muted flex-1",children:"No URL returned"}),o.url&&e.jsx("button",{onClick:()=>w(o.url),className:"text-xs text-muted hover:text-ink",children:"Copy URL"})]}),e.jsx("pre",{className:"text-[11px] font-mono text-ink bg-black/5 rounded-card p-3 overflow-auto max-h-64 whitespace-pre-wrap terminal-scroll",children:a.content||"(empty report)"})]})]})}function ue({visible:t}){const s=n.useCallback(()=>j.getMetrics(),[]),{data:r,loading:a}=R(s,15e3,t);return t?e.jsxs("div",{className:"card p-4 rounded-card",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Session Metrics"}),a&&e.jsx("div",{className:"w-4 h-4 border-2 border-primary border-t-transparent rounded-full animate-spin"})]}),r?e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Iterations"}),e.jsx("div",{className:"text-xl font-bold text-ink",children:r.iterations??0})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Gate Pass Rate"}),e.jsx("div",{className:"text-xl font-bold text-ink",children:typeof r.quality_gate_pass_rate=="number"?`${r.quality_gate_pass_rate.toFixed(0)}%`:"N/A"})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Tokens Used"}),e.jsx("div",{className:"text-xl font-bold text-ink",children:(r.tokens_used??0).toLocaleString()})]}),e.jsxs("div",{className:"card rounded-card p-3",children:[e.jsx("div",{className:"text-xs font-semibold text-muted-accessible uppercase tracking-wider mb-1",children:"Time Elapsed"}),e.jsx("div",{className:"text-xl font-bold text-ink",children:r.time_elapsed||"N/A"})]})]}):e.jsx("div",{className:"text-sm text-muted py-4 text-center",children:a?"Loading metrics...":"No metrics available"})]}):null}function $t(t){switch(t){case"completed":case"complete":case"done":return"completed";case"in_progress":return"running";case"started":return"started";case"error":case"failed":return"failed";default:return"empty"}}const zt={completed:"Completed",complete:"Completed",done:"Completed",in_progress:"In Progress",started:"Started",error:"Failed",failed:"Failed",empty:"Empty"};function Ht({onLoadSession:t}){const s=n.useCallback(()=>j.getSessionsHistory(),[]),{data:r,loading:a}=R(s,6e4,!0);return a&&!r?e.jsxs("div",{className:"card p-4 rounded-card",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider mb-3",children:"Past Builds"}),e.jsx("div",{className:"text-sm text-muted",children:"Loading..."})]}):!r||r.length===0?null:e.jsxs("div",{className:"card p-4 rounded-card",children:[e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider mb-3",children:"Past Builds"}),e.jsx("div",{className:"flex flex-col gap-2 max-h-64 overflow-y-auto terminal-scroll",children:r.map(l=>{const o=l.file_count;return e.jsxs("button",{onClick:()=>t==null?void 0:t(l),className:"text-left px-4 py-3 rounded-card card hover:bg-hover transition-all group cursor-pointer",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs font-mono text-muted-accessible",children:l.date}),e.jsxs("div",{className:"flex items-center gap-2",children:[o!==void 0&&o>0&&e.jsxs("span",{className:"text-xs font-mono text-muted-accessible",children:[o," files"]}),e.jsx(rt,{status:$t(l.status),children:zt[l.status]||l.status})]})]}),e.jsx("div",{className:"text-xs text-ink truncate group-hover:text-primary transition-colors",children:l.prd_snippet||l.id}),e.jsx("div",{className:"text-xs font-mono text-muted-accessible mt-0.5 truncate",children:l.path})]},l.id)})})]})}function Ot({end:t,suffix:s="",duration:r=1500}){const[a,l]=n.useState(0),o=n.useRef(null),i=n.useRef(!1);return n.useEffect(()=>{const d=new IntersectionObserver(([c])=>{if(c.isIntersecting&&!i.current){i.current=!0;const x=performance.now(),u=v=>{const p=v-x,b=Math.min(p/r,1),y=1-Math.pow(1-b,3);l(Math.floor(y*t)),b<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}},{threshold:.3});return o.current&&d.observe(o.current),()=>d.disconnect()},[t,r]),e.jsxs("span",{ref:o,className:"tabular-nums",children:[a,s]})}const qt=[{icon:at,value:21,suffix:"+",label:"Templates"},{icon:nt,value:5,suffix:"",label:"AI Providers"},{icon:be,value:100,suffix:"%",label:"Source-Available"}];function Gt(){return e.jsxs("section",{className:"w-full max-w-3xl mx-auto mt-16 mb-4",children:[e.jsx("p",{className:"text-center text-sm text-[#6B6960] mb-8 tracking-wide uppercase font-medium",children:"Trusted by developers building the future"}),e.jsx("div",{className:"flex items-center justify-center gap-12 sm:gap-16",children:qt.map(t=>{const s=t.icon;return e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(s,{size:20,className:"text-[#553DE9]",strokeWidth:1.5}),e.jsx("span",{className:"text-2xl font-bold text-[#36342E]",children:e.jsx(Ot,{end:t.value,suffix:t.suffix})}),e.jsx("span",{className:"text-xs text-[#6B6960] font-medium",children:t.label})]},t.label)})}),e.jsx("div",{className:"mt-12 border-t border-[#ECEAE3]"})]})}function se({icon:t,number:s,title:r,description:a,mockup:l,delay:o}){const i=n.useRef(null),[d,c]=n.useState(!1);return n.useEffect(()=>{const x=new IntersectionObserver(([u])=>{u.isIntersecting&&(setTimeout(()=>c(!0),o),x.disconnect())},{threshold:.2});return i.current&&x.observe(i.current),()=>x.disconnect()},[o]),e.jsxs("div",{ref:i,className:`flex flex-col items-center text-center max-w-xs transition-all duration-700 ${d?"opacity-100 translate-y-0":"opacity-0 translate-y-6"}`,children:[e.jsxs("div",{className:"relative mb-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-[#553DE9]/10 flex items-center justify-center",children:e.jsx(t,{size:24,className:"text-[#553DE9]",strokeWidth:1.5})}),e.jsx("span",{className:"absolute -top-2 -right-2 w-6 h-6 rounded-full bg-[#553DE9] text-white text-xs font-bold flex items-center justify-center",children:s})]}),e.jsx("h3",{className:"text-lg font-bold text-[#36342E] mb-1.5",children:r}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-4 leading-relaxed",children:a}),e.jsx("div",{className:"w-full rounded-xl border border-[#ECEAE3] bg-white p-3 shadow-sm",children:l})]})}function Wt(){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1 px-3 py-2 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3] text-left",children:e.jsx("span",{className:"text-xs text-[#36342E]",children:"Build a SaaS dashboard with analytics"})}),e.jsx("div",{className:"w-7 h-7 rounded-lg bg-[#553DE9] flex items-center justify-center flex-shrink-0",children:e.jsx(re,{size:12,className:"text-white"})})]})}function Ut(){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-[10px] text-[#6B6960]",children:[e.jsx("span",{children:"Phase: Implementation"}),e.jsx("span",{children:"68%"})]}),e.jsx("div",{className:"w-full h-2 rounded-full bg-[#ECEAE3] overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-[#553DE9] to-[#1FC5A8]",style:{width:"68%"}})}),e.jsx("div",{className:"flex gap-1",children:["Planning","Scaffolding","Implementation","Testing","Deploy"].map((t,s)=>e.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded ${s<=2?"bg-[#553DE9]/10 text-[#553DE9] font-medium":"bg-[#ECEAE3]/60 text-[#6B6960]"}`,children:t},t))})]})}function Vt(){return e.jsxs("div",{className:"space-y-2 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-5 h-5 rounded-full bg-[#1FC5A8]/20 flex items-center justify-center",children:e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"#1FC5A8",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("span",{className:"text-xs font-semibold text-[#1FC5A8]",children:"Deployed successfully"})]}),e.jsx("div",{className:"px-3 py-1.5 rounded-lg bg-[#FAF9F6] border border-[#ECEAE3]",children:e.jsx("span",{className:"text-[10px] font-mono text-[#553DE9]",children:"https://my-app.vercel.app"})})]})}function Qt(){return e.jsxs("section",{className:"w-full max-w-5xl mx-auto py-16",children:[e.jsx("h2",{className:"font-heading text-h2 text-[#36342E] text-center mb-3",children:"How It Works"}),e.jsx("p",{className:"text-sm text-[#6B6960] text-center mb-12 max-w-lg mx-auto",children:"Three steps from idea to production. No manual coding required."}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start justify-center gap-10 md:gap-8",children:[e.jsx("div",{className:"hidden md:block absolute top-7 left-1/2 -translate-x-1/2 w-[60%] h-px border-t-2 border-dashed border-[#ECEAE3] z-0"}),e.jsx(se,{icon:fe,number:1,title:"Describe Your Idea",description:"Type a one-line description. Loki handles the rest.",mockup:e.jsx(Wt,{}),delay:0}),e.jsx(se,{icon:lt,number:2,title:"Watch It Build",description:"AI writes code, runs tests, and ensures quality.",mockup:e.jsx(Ut,{}),delay:150}),e.jsx(se,{icon:re,number:3,title:"Ship It",description:"Deploy to Vercel, Netlify, or GitHub in one click.",mockup:e.jsx(Vt,{}),delay:300})]})]})}const Yt=[{name:"SaaS Dashboard",description:"Full-stack analytics dashboard with auth, billing, and user management.",tech:["React","Node.js","PostgreSQL"],gradient:"from-violet-500/20 via-purple-500/10 to-indigo-500/20"},{name:"REST API",description:"Production-ready API with authentication, rate limiting, and docs.",tech:["Python","FastAPI","Redis"],gradient:"from-emerald-500/20 via-teal-500/10 to-cyan-500/20"},{name:"E-Commerce Store",description:"Online store with Stripe payments, cart, and inventory management.",tech:["React","Node.js","MongoDB"],gradient:"from-amber-500/20 via-orange-500/10 to-yellow-500/20"},{name:"Discord Bot",description:"Feature-rich bot with slash commands, moderation, and webhooks.",tech:["TypeScript","Discord","SQLite"],gradient:"from-blue-500/20 via-sky-500/10 to-cyan-500/20"},{name:"CLI Tool",description:"Interactive command-line application with argument parsing and config.",tech:["TypeScript","CLI","Node.js"],gradient:"from-rose-500/20 via-pink-500/10 to-fuchsia-500/20"},{name:"Landing Page",description:"Responsive marketing site with pricing, testimonials, and CTAs.",tech:["React","Tailwind","Vite"],gradient:"from-slate-500/20 via-gray-500/10 to-zinc-500/20"}],Kt={React:"bg-sky-500/10 text-sky-600","Node.js":"bg-green-500/10 text-green-600",Python:"bg-yellow-500/10 text-yellow-700",TypeScript:"bg-blue-500/10 text-blue-600",PostgreSQL:"bg-indigo-500/10 text-indigo-600",MongoDB:"bg-green-600/10 text-green-700",Redis:"bg-red-500/10 text-red-600",FastAPI:"bg-teal-500/10 text-teal-600",SQLite:"bg-blue-400/10 text-blue-500",Tailwind:"bg-cyan-400/10 text-cyan-600",Discord:"bg-indigo-400/10 text-indigo-500",CLI:"bg-amber-500/10 text-amber-600",Vite:"bg-purple-400/10 text-purple-500"};function Zt(){const t=ae(),s=n.useRef(null),[r,a]=n.useState(!1),[l,o]=n.useState(!0),i=()=>{const c=s.current;c&&(a(c.scrollLeft>8),o(c.scrollLeft<c.scrollWidth-c.clientWidth-8))};n.useEffect(()=>{const c=s.current;if(c)return i(),c.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",i),()=>{c.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[]);const d=c=>{const x=s.current;if(!x)return;const u=320;x.scrollBy({left:c==="left"?-u:u,behavior:"smooth"})};return e.jsxs("section",{className:"w-full max-w-5xl mx-auto py-16",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-heading text-h2 text-[#36342E]",children:"Start from a Template"}),e.jsx("p",{className:"text-sm text-[#6B6960] mt-1",children:"Production-ready starting points for common use cases."})]}),e.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[e.jsx("button",{onClick:()=>d("left"),disabled:!r,className:`w-8 h-8 rounded-lg border flex items-center justify-center transition-all ${r?"border-[#ECEAE3] text-[#36342E] hover:bg-[#F8F4F0]":"border-[#ECEAE3]/50 text-[#6B6960]/30 cursor-not-allowed"}`,"aria-label":"Scroll left",children:e.jsx(it,{size:16})}),e.jsx("button",{onClick:()=>d("right"),disabled:!l,className:`w-8 h-8 rounded-lg border flex items-center justify-center transition-all ${l?"border-[#ECEAE3] text-[#36342E] hover:bg-[#F8F4F0]":"border-[#ECEAE3]/50 text-[#6B6960]/30 cursor-not-allowed"}`,"aria-label":"Scroll right",children:e.jsx(Ve,{size:16})})]})]}),e.jsxs("div",{ref:s,className:"flex gap-4 overflow-x-auto pb-4 snap-x snap-mandatory scrollbar-hide",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[Yt.map(c=>e.jsxs("div",{className:"flex-shrink-0 w-64 rounded-xl border border-[#ECEAE3] bg-white overflow-hidden snap-start hover:shadow-lg hover:border-[#553DE9]/30 transition-all cursor-pointer group",onClick:()=>t("/templates"),children:[e.jsx("div",{className:`h-20 bg-gradient-to-br ${c.gradient} flex items-end p-3`,children:e.jsx("h3",{className:"text-sm font-bold text-[#36342E] group-hover:text-[#553DE9] transition-colors",children:c.name})}),e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-xs text-[#6B6960] mb-3 leading-relaxed line-clamp-2",children:c.description}),e.jsx("div",{className:"flex flex-wrap gap-1",children:c.tech.map(x=>e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${Kt[x]||"bg-gray-100 text-gray-600"}`,children:x},x))})]})]},c.name)),e.jsxs("div",{className:"flex-shrink-0 w-48 rounded-xl border border-dashed border-[#ECEAE3] bg-[#FAF9F6] flex flex-col items-center justify-center gap-2 snap-start cursor-pointer hover:border-[#553DE9]/40 hover:bg-[#553DE9]/5 transition-all group",onClick:()=>t("/templates"),children:[e.jsx(Qe,{size:20,className:"text-[#6B6960] group-hover:text-[#553DE9] transition-colors"}),e.jsx("span",{className:"text-sm font-semibold text-[#6B6960] group-hover:text-[#553DE9] transition-colors",children:"View All Templates"})]})]})]})}function Jt({icon:t,title:s,description:r}){return e.jsxs("div",{className:"rounded-xl border border-[#ECEAE3] bg-white p-5 hover:border-[#553DE9]/40 hover:shadow-lg transition-all group",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#553DE9]/10 flex items-center justify-center mb-3 group-hover:bg-[#553DE9]/15 transition-colors",children:e.jsx(t,{size:20,className:"text-[#553DE9]",strokeWidth:1.5})}),e.jsx("h3",{className:"text-sm font-bold text-[#36342E] mb-1.5",children:s}),e.jsx("p",{className:"text-xs text-[#6B6960] leading-relaxed",children:r})]})}const Xt=[{icon:ot,title:"Multi-AI",description:"Use Claude, GPT, Gemini. Pick the best for each task."},{icon:Ye,title:"Quality First",description:"10 quality gates. 3 blind reviewers. Zero sycophancy."},{icon:pt,title:"Self-Hosted",description:"Your code stays on your machine. Full privacy."},{icon:be,title:"Source-Available",description:"BUSL-1.1 source-available. Read it, fork it, self-host it."}];function es(){return e.jsxs("section",{className:"w-full max-w-4xl mx-auto py-16",children:[e.jsx("h2",{className:"font-heading text-h2 text-[#36342E] text-center mb-3",children:"Why developers choose Loki Mode"}),e.jsx("p",{className:"text-sm text-[#6B6960] text-center mb-10 max-w-lg mx-auto",children:"Built by developers, for developers. Every decision optimized for shipping faster."}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:Xt.map(t=>e.jsx(Jt,{...t},t.title))})]})}const ts=[{title:"Product",links:[{label:"Features",to:"/"},{label:"Templates",to:"/templates"},{label:"Pricing",href:"https://www.autonomi.dev/#pricing"},{label:"Docs",href:"https://github.com/asklokesh/loki-mode/wiki"}]},{title:"Developers",links:[{label:"Quick Start",to:"/"},{label:"API Reference",href:"https://github.com/asklokesh/loki-mode/wiki/API-Reference"},{label:"CLI Docs",href:"https://github.com/asklokesh/loki-mode/wiki/CLI-Reference"},{label:"Changelog",href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md"}]},{title:"Company",links:[{label:"About Autonomi",href:"https://www.autonomi.dev/"},{label:"Blog",href:"https://www.autonomi.dev/blog"},{label:"Careers",href:"https://www.autonomi.dev/careers"},{label:"Contact",href:"mailto:hello@autonomi.dev"}]},{title:"Community",links:[{label:"GitHub",href:"https://github.com/asklokesh/loki-mode"},{label:"Discord",href:"https://discord.gg/autonomi"},{label:"Twitter",href:"https://twitter.com/autonomidev"},{label:"Forum",href:"https://github.com/asklokesh/loki-mode/discussions"}]}];function ss(){const t=ae(),s=(r,a)=>{r.to&&(a.preventDefault(),t(r.to))};return e.jsx("footer",{className:"w-full bg-[#F0EDE8] border-t border-[#ECEAE3] mt-8",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-12",children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-8 mb-10",children:ts.map(r=>e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-bold text-[#36342E] uppercase tracking-wider mb-4",children:r.title}),e.jsx("ul",{className:"space-y-2.5",children:r.links.map(a=>e.jsx("li",{children:e.jsx("a",{href:a.href||a.to||"#",onClick:l=>s(a,l),className:"text-sm text-[#6B6960] hover:text-[#553DE9] transition-colors",...a.href?{target:"_blank",rel:"noopener noreferrer"}:{},children:a.label})},a.label))})]},r.title))}),e.jsxs("div",{className:"border-t border-[#ECEAE3] pt-6 flex flex-col sm:flex-row items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 text-xs text-[#6B6960]",children:[e.jsx("span",{children:"Built with care by Autonomi"}),e.jsx("span",{className:"hidden sm:inline text-[#ECEAE3]",children:"|"}),e.jsx("span",{className:"px-2 py-0.5 rounded bg-[#553DE9]/10 text-[#553DE9] font-semibold text-[10px]",children:"v6.73.0"})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-[#6B6960]",children:[e.jsx("a",{href:"https://www.autonomi.dev/privacy",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#553DE9] transition-colors",children:"Privacy"}),e.jsx("a",{href:"https://www.autonomi.dev/terms",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#553DE9] transition-colors",children:"Terms"})]})]})]})})}function rs({label:t,value:s,suffix:r=""}){const[a,l]=n.useState(0),o=n.useRef(!1),i=n.useRef(null);return n.useEffect(()=>{if(o.current)return;const d=new IntersectionObserver(([c])=>{if(c.isIntersecting&&!o.current){let x=function(p){const b=p-v,y=Math.min(b/u,1),N=1-Math.pow(1-y,3);l(Math.round(s*N)),y<1&&requestAnimationFrame(x)};o.current=!0;const u=800,v=performance.now();requestAnimationFrame(x)}},{threshold:.3});return i.current&&d.observe(i.current),()=>d.disconnect()},[s]),e.jsxs("div",{ref:i,className:"text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-[#36342E] dark:text-[#E8E6E3] tabular-nums",children:[a.toLocaleString(),r]}),e.jsx("div",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] mt-1",children:t})]})}const W="asklokesh/loki-mode",as="loki-mode";function ns(){const[t,s]=n.useState([{label:"GitHub Stars",value:0},{label:"Forks",value:0},{label:"Contributors",value:0},{label:"npm Downloads",value:0,suffix:"+"}]);return n.useEffect(()=>{(async()=>{try{const[a,l,o]=await Promise.allSettled([fetch(`https://api.github.com/repos/${W}`),fetch(`https://api.github.com/repos/${W}/contributors?per_page=1&anon=true`,{method:"HEAD"}),fetch(`https://api.npmjs.org/downloads/point/last-month/${as}`)]);let i=0,d=0,c=0,x=0;if(a.status==="fulfilled"&&a.value.ok){const u=await a.value.json();i=u.stargazers_count||0,d=u.forks_count||0}if(l.status==="fulfilled"){const v=(l.value.headers.get("Link")||"").match(/page=(\d+)>; rel="last"/);if(v)c=parseInt(v[1],10);else{const p=await fetch(`https://api.github.com/repos/${W}/contributors?per_page=100&anon=true`);if(p.ok){const b=await p.json();c=Array.isArray(b)?b.length:0}}}o.status==="fulfilled"&&o.value.ok&&(x=(await o.value.json()).downloads||0),s([{label:"GitHub Stars",value:i},{label:"Forks",value:d},{label:"Contributors",value:c},{label:"npm Downloads",value:x,suffix:"+"}])}catch{}})()},[]),e.jsxs("div",{className:"py-8 border-t border-[#ECEAE3] dark:border-[#2A2A30]",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-6",children:[e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#36342E] dark:text-[#E8E6E3]",children:e.jsx("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",fill:"currentColor"})}),e.jsx("span",{className:"text-sm font-semibold text-[#36342E] dark:text-[#E8E6E3]",children:"Source-Available"})]}),e.jsx("div",{className:"grid grid-cols-4 gap-6 max-w-lg mx-auto",children:t.map(r=>e.jsx(rs,{...r},r.label))}),e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("a",{href:`https://github.com/${W}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-[#553DE9] hover:text-[#4832c7] font-medium transition-colors",children:["Star us on GitHub",e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M7 17L17 7M17 7H7M17 7V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})}function ls(){const[t,s]=n.useState(""),[r,a]=n.useState(!1),[l,o]=n.useState(""),i=d=>{d.preventDefault(),o("");const c=t.trim();if(c){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c)){o("Please enter a valid email address.");return}try{const x=JSON.parse(localStorage.getItem("pl_newsletter_emails")||"[]");x.includes(c)||(x.push(c),localStorage.setItem("pl_newsletter_emails",JSON.stringify(x)))}catch{}a(!0),s("")}};return r?e.jsxs("div",{className:"flex items-center gap-2 py-3 px-4 rounded-xl bg-[#1FC5A8]/10 border border-[#1FC5A8]/20",children:[e.jsx(ct,{size:16,className:"text-[#1FC5A8] flex-shrink-0"}),e.jsx("span",{className:"text-sm text-[#36342E] font-medium",children:"Thanks for subscribing! We will keep you posted."})]}):e.jsxs("div",{className:"py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(dt,{size:14,className:"text-[#6B6960]"}),e.jsx("span",{className:"text-sm text-[#6B6960]",children:"Get updates on new features and tips"})]}),e.jsxs("form",{onSubmit:i,className:"flex gap-2",children:[e.jsx("input",{type:"email",value:t,onChange:d=>s(d.target.value),placeholder:"you@example.com",className:"flex-1 px-3 py-2 text-sm rounded-lg border border-[#ECEAE3] bg-white focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30 focus:border-[#553DE9]/40"}),e.jsx("button",{type:"submit",className:"px-4 py-2 text-sm font-semibold rounded-lg bg-[#553DE9] text-white hover:bg-[#4832c7] transition-colors",children:"Subscribe"})]}),l&&e.jsx("p",{className:"mt-1.5 text-xs text-[#C45B5B]",children:l})]})}const is={"build-complete":{icon:e.jsx(ft,{size:24,className:"text-teal"}),title:"Build complete!",description:"Your code is ready. Time to ship it."},"deploy-success":{icon:e.jsx(re,{size:24,className:"text-primary"}),title:"Your app is live!",description:"Successfully deployed. The world can see your work now."},"first-project":{icon:e.jsx(Ke,{size:24,className:"text-warning"}),title:"First build complete!",description:"Welcome to Purple Lab. This is just the beginning."}},pe=["#553DE9","#1FC5A8","#D63384","#2F71E3","#D4A03C","#E8E4FD"],os=40;function cs({index:t}){const s=pe[t%pe.length],r=Math.random()*100,a=Math.random()*1.5,l=2+Math.random()*1.5,o=4+Math.random()*6,i=t%3===0,d=Math.random()*360;return e.jsx("div",{className:"confetti-piece",style:{position:"absolute",left:`${r}%`,top:"-10px",width:`${o}px`,height:`${o}px`,backgroundColor:s,borderRadius:i?"50%":"1px",opacity:0,transform:`rotate(${d}deg)`,animation:`confetti-fall ${l}s ease-in ${a}s forwards`}})}function ds({type:t,onDismiss:s}){const[r,a]=n.useState(!0),l=is[t];return n.useEffect(()=>{const o=setTimeout(()=>{a(!1),s==null||s()},3500);return()=>clearTimeout(o)},[s]),r?e.jsxs("div",{className:"fixed inset-0 z-50 pointer-events-none",children:[e.jsx("div",{className:"absolute inset-0 overflow-hidden",children:Array.from({length:os},(o,i)=>e.jsx(cs,{index:i},i))}),e.jsx("div",{className:"absolute top-8 left-1/2 -translate-x-1/2 pointer-events-auto celebration-banner-enter",children:e.jsxs("div",{className:"bg-card border border-border rounded-card shadow-lg px-6 py-4 flex items-center gap-3",children:[l.icon,e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-ink",children:l.title}),e.jsx("p",{className:"text-xs text-muted",children:l.description})]})]})})]}):null}const ms={"no-projects":{icon:e.jsx(tt,{size:32,className:"text-primary/60"}),title:"Your workspace is a blank canvas",description:"What will you create today? Describe your idea and watch it come to life.",defaultActionLabel:"Start a new project"},"no-files":{icon:e.jsx(xt,{size:32,className:"text-teal/60"}),title:"This project is brand new",description:"Let's add some code! Start building and files will appear here as they're created.",defaultActionLabel:"Open editor"},"no-chat":{icon:e.jsx(fe,{size:32,className:"text-primary/60"}),title:"Start a conversation with Loki",description:"Try something like 'Add a contact form to my app' or 'Create a dark mode toggle.'",defaultActionLabel:"Say hello"},"no-team":{icon:e.jsx(Ze,{size:32,className:"text-pink/60"}),title:"Building alone is great, but building together is better",description:"Invite teammates to collaborate on this project in real time.",defaultActionLabel:"Invite a teammate"},"no-notifications":{icon:e.jsx(mt,{size:32,className:"text-teal/60"}),title:"All clear!",description:"No notifications right now. When something needs your attention, it will show up here.",defaultActionLabel:"Dismiss"}};function xs({type:t}){const r={"no-projects":{primary:"#553DE9",secondary:"#1FC5A8"},"no-files":{primary:"#1FC5A8",secondary:"#553DE9"},"no-chat":{primary:"#553DE9",secondary:"#D63384"},"no-team":{primary:"#D63384",secondary:"#553DE9"},"no-notifications":{primary:"#1FC5A8",secondary:"#2F71E3"}}[t];return e.jsxs("svg",{width:"120",height:"80",viewBox:"0 0 120 80",fill:"none",className:"mb-4 opacity-60",children:[e.jsx("circle",{cx:"60",cy:"40",r:"28",stroke:r.primary,strokeWidth:"1.5",strokeDasharray:"4 3"}),e.jsx("circle",{cx:"30",cy:"25",r:"8",fill:r.primary,opacity:"0.1"}),e.jsx("circle",{cx:"90",cy:"55",r:"12",fill:r.secondary,opacity:"0.1"}),e.jsx("circle",{cx:"60",cy:"40",r:"4",fill:r.primary,opacity:"0.3"}),e.jsx("line",{x1:"20",y1:"60",x2:"45",y2:"45",stroke:r.secondary,strokeWidth:"1",opacity:"0.2"}),e.jsx("line",{x1:"75",y1:"35",x2:"100",y2:"20",stroke:r.primary,strokeWidth:"1",opacity:"0.2"}),e.jsx("rect",{x:"50",y:"15",width:"20",height:"3",rx:"1.5",fill:r.secondary,opacity:"0.15"}),e.jsx("rect",{x:"42",y:"62",width:"36",height:"3",rx:"1.5",fill:r.primary,opacity:"0.15"})]})}function us({type:t,action:s,actionLabel:r}){const a=ms[t];return e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-6 text-center warm-empty-state-enter",children:[e.jsx(xs,{type:t}),e.jsx("div",{className:"mb-3",children:a.icon}),e.jsx("h3",{className:"text-sm font-semibold text-ink mb-1.5",children:a.title}),e.jsx("p",{className:"text-xs text-muted max-w-[260px] leading-relaxed",children:a.description}),s&&e.jsx("button",{onClick:s,className:"mt-4 px-4 py-2 text-xs font-semibold rounded-btn bg-primary/10 text-primary hover:bg-primary/20 transition-colors",children:r||a.defaultActionLabel})]})}const U=["Build a SaaS dashboard with user analytics...","Create a REST API with authentication...","Make a landing page with pricing tiers...","Build a chat app with real-time messaging...","Create an e-commerce store with Stripe..."];function ps(){const t=new Date().getHours();return t>=5&&t<12?"Good morning! What shall we build today?":t>=12&&t<17?"Good afternoon! Ready to create something amazing?":t>=17&&t<22?"Good evening! Let's build something cool.":"Burning the midnight oil? Let's build something cool."}function Ls(){const t=ae(),[s,r]=n.useState(null),[a,l]=n.useState(()=>sessionStorage.getItem("pl_running")==="1"),[o,i]=n.useState(!1),[d,c]=n.useState(()=>sessionStorage.getItem("pl_prd")),[x,u]=n.useState(!1),[v,p]=n.useState(!1),[b,y]=n.useState(!1),[N,k]=n.useState(()=>sessionStorage.getItem("pl_tab")||"terminal"),[w,B]=n.useState(()=>sessionStorage.getItem("pl_provider")||"claude"),[h,L]=n.useState(void 0),[E,z]=n.useState(!1),I=n.useMemo(()=>ps(),[]),[C,O]=n.useState(""),[S,A]=n.useState(!1),[_,q]=n.useState(!1),[$,V]=n.useState(0),[Q,G]=n.useState(!1),g=n.useRef(null),D=n.useRef(null);n.useEffect(()=>{const m=setInterval(()=>{G(!0),setTimeout(()=>{V(f=>(f+1)%U.length),G(!1)},300)},3e3);return()=>clearInterval(m)},[]),n.useEffect(()=>{const m=sessionStorage.getItem("pl_template");m&&(sessionStorage.removeItem("pl_template"),j.getTemplateContent(m).then(({content:f})=>{f&&(L(f),q(!0))}).catch(()=>{}))},[]);const[T,Y]=n.useState(null),[ne,K]=n.useState(null),[le,Z]=n.useState(null),je=n.useCallback(m=>{if(!m){Y(null),K(null),Z(null);return}Y(m.status),K(m.agents),Z(m.logs),l(m.status.running??!1),i(m.status.paused??!1)},[]),{connected:J,subscribe:ve}=Je(je),ye=n.useCallback(()=>j.getStatus(),[]),{data:M}=R(ye,3e4,!J);n.useEffect(()=>{T===null&&M!==null&&(l(M.running??!1),i(M.paused??!1))},[M,T]),n.useEffect(()=>{sessionStorage.setItem("pl_running",a?"1":"0"),a&&u(!0)},[a]),n.useEffect(()=>{d?sessionStorage.setItem("pl_prd",d):sessionStorage.removeItem("pl_prd")},[d]),n.useEffect(()=>{sessionStorage.setItem("pl_provider",w)},[w]),n.useEffect(()=>{sessionStorage.setItem("pl_tab",N)},[N]);const X=n.useRef(void 0);n.useEffect(()=>{var f;const m=(f=T??M)==null?void 0:f.phase;m==="complete"&&X.current&&X.current!=="complete"&&z(!0),X.current=m},[T,M]);const Ne=n.useCallback(()=>j.getMemorySummary(),[]),we=n.useCallback(()=>j.getChecklist(),[]),ke=n.useCallback(()=>j.getFiles(),[]),Ee=n.useCallback(()=>j.getSessionsHistory(),[]),{data:Se,loading:Ce}=R(Ne,3e4,a),{data:Ae,loading:De}=R(we,3e4,a),{data:Pe,loading:Fe}=R(ke,3e4,a),{data:ie}=R(Ee,6e4,!0),P=T??M,Le=ne,Te=le,Me=ne===null,Re=le===null,oe=n.useCallback(async()=>{const m=C.trim();if(!(!m||S)){r(null),A(!0),u(!1),p(!1),k("terminal");try{const f=await j.quickStart(m,w);f.started&&f.session_id&&(c(m),l(!0),t(`/project/${f.session_id}`))}catch(f){r(f instanceof Error?f.message:"Failed to start build")}finally{A(!1)}}},[C,S,w,t]),Be=n.useCallback(async(m,f,qe,Ge)=>{r(null),u(!1),p(!1),k("terminal");try{await j.startSession({prd:m,provider:f,projectDir:qe,mode:Ge}),c(m),l(!0)}catch(ce){r(ce instanceof Error?ce.message:"Failed to start session")}},[]),Ie=n.useCallback(async()=>{try{(await j.stopSession()).stopped&&(l(!1),i(!1),c(null),Y(null),K(null),Z(null))}catch{l(!1),i(!1),c(null)}sessionStorage.removeItem("pl_running"),sessionStorage.removeItem("pl_prd"),sessionStorage.removeItem("pl_tab")},[]),_e=n.useCallback(m=>{t(`/project/${m.id}`)},[t]),$e=n.useCallback(m=>{B(m)},[]),ze=n.useCallback(async()=>{try{await j.pauseSession(),i(!0)}catch{}},[]),He=n.useCallback(async()=>{try{await j.resumeSession(),i(!1)}catch{}},[]),Oe=d&&d.replace(/^#+\s*/gm,"").split(`
28
+ `).find(m=>m.trim().length>0)||null;return e.jsxs("div",{className:"min-h-screen bg-[#FAF9F6] relative",children:[e.jsx("div",{className:"pattern-nodes"}),e.jsx("div",{className:"max-w-[1920px] mx-auto px-6 py-6 relative z-10",children:a?e.jsxs(e.Fragment,{children:[e.jsx(F,{name:"ControlBar",children:e.jsx(jt,{status:P,prdSummary:Oe,onStop:Ie,onPause:ze,onResume:He,isPaused:o})}),e.jsx("div",{className:"mt-4",children:e.jsx(F,{name:"StatusOverview",children:e.jsx(vt,{status:P})})}),e.jsxs("div",{className:"mt-4 grid grid-cols-12 gap-6",style:{height:"calc(100vh - 340px)",minHeight:"400px"},children:[e.jsx("div",{className:"col-span-3 flex flex-col gap-6",children:e.jsx(F,{name:"PhaseVisualizer",children:e.jsx(kt,{currentPhase:(P==null?void 0:P.phase)||"idle",iteration:(P==null?void 0:P.iteration)||0})})}),e.jsxs("div",{className:"col-span-5 flex flex-col gap-0 min-h-0",children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 flex-shrink-0",children:[e.jsx("button",{onClick:()=>k("terminal"),className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all ${N==="terminal"?"bg-[#553DE9] text-white":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0]"}`,children:"Terminal"}),e.jsx("button",{onClick:()=>k("metrics"),className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all ${N==="metrics"?"bg-[#553DE9] text-white":"text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0]"}`,children:"Metrics"})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(F,{name:"Terminal",children:N==="terminal"?e.jsx(st,{logs:Te,loading:Re,subscribe:ve}):e.jsx(ue,{visible:!0})})})]}),e.jsxs("div",{className:"col-span-4 flex flex-col gap-6 overflow-y-auto",children:[e.jsx(F,{name:"AgentDashboard",children:e.jsx(St,{agents:Le,loading:Me})}),e.jsx(F,{name:"QualityGates",children:e.jsx(Ft,{checklist:Ae,loading:De})})]})]}),e.jsxs("div",{className:"mt-6 grid grid-cols-12 gap-6",children:[e.jsx("div",{className:"col-span-6",children:e.jsx(F,{name:"FileBrowser",children:e.jsx(Rt,{files:Pe,loading:Fe})})}),e.jsx("div",{className:"col-span-6",children:e.jsx(F,{name:"MemoryViewer",children:e.jsx(It,{memory:Se,loading:Ce})})})]})]}):e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{ref:D,className:"text-center mt-12 mb-10",children:[e.jsx("p",{className:"text-sm font-medium text-[#553DE9] mb-2",children:I}),e.jsx("h2",{className:"font-heading text-h1 text-[#36342E]",children:"Describe it. Build it. Ship it."}),e.jsx("p",{className:"text-[#6B6960] mt-3 text-base max-w-xl mx-auto",children:"Type what you want to build. Purple Lab handles the rest -- from code to containers, autonomously."})]}),e.jsxs("div",{className:"w-full max-w-2xl",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{ref:g,type:"text",value:C,onChange:m=>O(m.target.value),onKeyDown:m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),oe())},className:"w-full text-xl px-6 py-4 rounded-2xl bg-white border border-[#ECEAE3] shadow-sm focus:outline-none focus:ring-2 focus:ring-[#553DE9]/30 focus:border-[#553DE9]/40 focus:shadow-lg transition-all placeholder:text-transparent",disabled:S,"aria-label":"Describe what you want to build"}),!C&&e.jsx("div",{className:"absolute left-6 top-1/2 -translate-y-1/2 text-xl text-[#6B6960]/50 pointer-events-none select-none","aria-hidden":"true",children:e.jsx("span",{className:Q?"quick-input-placeholder-exit":"quick-input-placeholder",children:U[$]},$)})]}),e.jsx("div",{className:"mt-4 flex items-center justify-center gap-4",children:e.jsx("button",{onClick:oe,disabled:!C.trim()||S,className:`px-8 py-3 rounded-xl text-base font-semibold transition-all ${!C.trim()||S?"bg-[#553DE9]/20 text-[#553DE9]/40 cursor-not-allowed":"bg-[#553DE9] text-white hover:bg-[#4832c7] shadow-lg shadow-[#553DE9]/25 hover:shadow-xl hover:shadow-[#553DE9]/30 active:scale-[0.98]"}`,children:S?"Starting...":"Start Building"})}),s&&e.jsx("div",{className:"mt-3 px-4 py-2.5 rounded-xl bg-[#C45B5B]/10 border border-[#C45B5B]/20 text-[#C45B5B] text-sm font-medium text-center",children:s}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx("button",{onClick:()=>q(!_),className:"text-sm text-[#553DE9] hover:text-[#4832c7] font-medium transition-colors",children:_?"Hide advanced options":"Advanced (write full spec)"})}),_&&e.jsx("div",{className:"mt-4",children:e.jsx(Nt,{onSubmit:Be,running:a,error:s,provider:w,onProviderChange:$e,initialPrd:h})})]}),x&&!a&&e.jsxs("div",{className:"w-full max-w-3xl mt-6 flex flex-col gap-4",children:[e.jsx("button",{onClick:async()=>{try{const m=await j.getSessionsHistory();m.length>0&&t(`/project/${m[0].id}`)}catch{}},className:"w-full px-6 py-4 rounded-card text-base font-bold bg-[#553DE9] text-white hover:bg-[#553DE9]/90 transition-all shadow-lg shadow-[#553DE9]/20",children:"View Project -- Browse Files and Preview"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>p(!v),className:"px-4 py-2 rounded-card text-sm font-semibold border border-[#553DE9]/30 text-[#553DE9] hover:bg-[#553DE9]/5 transition-all",children:v?"Hide Report":"Report"}),e.jsx("button",{onClick:()=>y(!b),className:"px-4 py-2 rounded-card text-sm font-semibold border border-[#ECEAE3] text-[#6B6960] hover:text-[#36342E] hover:bg-[#F8F4F0] transition-all",children:b?"Hide Metrics":"Metrics"})]}),e.jsx(_t,{visible:v}),e.jsx(ue,{visible:b})]}),e.jsx("div",{className:"w-full max-w-3xl mt-6",children:ie&&ie.length===0?e.jsx(us,{type:"no-projects",action:()=>{var f;const m=U[Math.floor(Math.random()*U.length)];O(m),(f=g.current)==null||f.focus()},actionLabel:"Try an example"}):e.jsx(Ht,{onLoadSession:_e})}),e.jsxs("div",{className:"mt-6 text-xs text-[#6B6960] flex items-center gap-2",children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${J?"bg-[#1FC5A8]":"bg-[#C45B5B]"}`}),J?"Connected to Purple Lab backend":"Waiting for backend connection..."]}),e.jsx(Gt,{}),e.jsx(Qt,{}),e.jsx(Zt,{}),e.jsx(es,{}),e.jsx("section",{className:"w-full max-w-3xl mx-auto py-16",children:e.jsxs("div",{className:"rounded-2xl bg-gradient-to-br from-[#553DE9]/5 via-[#553DE9]/10 to-[#1FC5A8]/5 border border-[#553DE9]/15 p-10 text-center",children:[e.jsx("h2",{className:"font-heading text-h2 text-[#36342E] mb-3",children:"Ready to build something amazing?"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-6 max-w-md mx-auto",children:"Go from idea to deployed product in minutes, not months. Let AI handle the heavy lifting."}),e.jsxs("div",{className:"flex items-center justify-center gap-3 flex-wrap",children:[e.jsx("button",{onClick:()=>{var m;(m=D.current)==null||m.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{var f;return(f=g.current)==null?void 0:f.focus()},500)},className:"px-8 py-3 rounded-xl text-base font-semibold bg-[#553DE9] text-white hover:bg-[#4832c7] shadow-lg shadow-[#553DE9]/25 hover:shadow-xl hover:shadow-[#553DE9]/30 active:scale-[0.98] transition-all",children:"Start Building"}),e.jsx("button",{onClick:()=>t("/templates"),className:"px-8 py-3 rounded-xl text-base font-semibold border border-[#553DE9]/30 text-[#553DE9] hover:bg-[#553DE9]/5 transition-all",children:"View Templates"})]})]})}),e.jsx(ls,{}),e.jsx(ns,{})]})}),!a&&e.jsx(ss,{}),E&&e.jsx(ds,{type:"build-complete",onDismiss:()=>z(!1)})]})}export{Ls as default};
@@ -1 +1 @@
1
- import{V as r,u as o,r as c,j as e}from"./index-CM_b_EhP.js";function x(){const{user:l,loading:t,login:i,isLocalMode:n}=r(),s=o();return c.useEffect(()=>{!t&&(l||n)&&s("/",{replace:!0})},[l,t,n,s]),t?e.jsx("div",{className:"h-screen bg-[#FAF9F6] flex items-center justify-center text-[#6B6960] text-sm",children:"Loading..."}):e.jsx("div",{className:"h-screen bg-[#FAF9F6] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-sm mx-auto px-6",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"font-heading text-3xl font-bold text-[#36342E] mb-1",children:"Purple Lab"}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:"Autonomous agent workspace powered by Loki"})]}),e.jsxs("div",{className:"bg-white rounded-lg border border-[#ECEAE3] shadow-sm p-6 space-y-4",children:[e.jsx("h2",{className:"text-base font-medium text-[#36342E] text-center",children:"Sign in to continue"}),e.jsxs("button",{type:"button",onClick:()=>i("github"),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-[5px] border border-[#ECEAE3] bg-[#24292f] text-white text-sm font-medium hover:bg-[#1b1f23] transition-colors",children:[e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),"Sign in with GitHub"]}),e.jsxs("button",{type:"button",onClick:()=>i("google"),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-[5px] border border-[#ECEAE3] bg-white text-[#36342E] text-sm font-medium hover:bg-[#F8F4F0] transition-colors",children:[e.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Sign in with Google"]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-[#ECEAE3]"})}),e.jsx("div",{className:"relative flex justify-center text-xs",children:e.jsx("span",{className:"bg-white px-2 text-[#939084]",children:"or"})})]}),e.jsx("button",{type:"button",onClick:()=>s("/"),className:"w-full text-center text-sm text-[#6B6960] hover:text-[#553DE9] transition-colors py-1",children:"Continue without account (local mode)"})]}),e.jsx("p",{className:"text-xs text-[#939084] text-center mt-4",children:"Local mode stores everything on your machine. Sign in for cloud sync and collaboration."})]})})}export{x as default};
1
+ import{V as r,u as o,r as c,j as e}from"./index-B-0iHBPO.js";function x(){const{user:l,loading:t,login:i,isLocalMode:n}=r(),s=o();return c.useEffect(()=>{!t&&(l||n)&&s("/",{replace:!0})},[l,t,n,s]),t?e.jsx("div",{className:"h-screen bg-[#FAF9F6] flex items-center justify-center text-[#6B6960] text-sm",children:"Loading..."}):e.jsx("div",{className:"h-screen bg-[#FAF9F6] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-sm mx-auto px-6",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"font-heading text-3xl font-bold text-[#36342E] mb-1",children:"Purple Lab"}),e.jsx("p",{className:"text-sm text-[#6B6960]",children:"Autonomous agent workspace powered by Loki"})]}),e.jsxs("div",{className:"bg-white rounded-lg border border-[#ECEAE3] shadow-sm p-6 space-y-4",children:[e.jsx("h2",{className:"text-base font-medium text-[#36342E] text-center",children:"Sign in to continue"}),e.jsxs("button",{type:"button",onClick:()=>i("github"),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-[5px] border border-[#ECEAE3] bg-[#24292f] text-white text-sm font-medium hover:bg-[#1b1f23] transition-colors",children:[e.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"})}),"Sign in with GitHub"]}),e.jsxs("button",{type:"button",onClick:()=>i("google"),className:"w-full flex items-center justify-center gap-2 px-4 py-2.5 rounded-[5px] border border-[#ECEAE3] bg-white text-[#36342E] text-sm font-medium hover:bg-[#F8F4F0] transition-colors",children:[e.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Sign in with Google"]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-[#ECEAE3]"})}),e.jsx("div",{className:"relative flex justify-center text-xs",children:e.jsx("span",{className:"bg-white px-2 text-[#939084]",children:"or"})})]}),e.jsx("button",{type:"button",onClick:()=>s("/"),className:"w-full text-center text-sm text-[#6B6960] hover:text-[#553DE9] transition-colors py-1",children:"Continue without account (local mode)"})]}),e.jsx("p",{className:"text-xs text-[#939084] text-center mt-4",children:"Local mode stores everything on your machine. Sign in for cloud sync and collaboration."})]})})}export{x as default};
@@ -1,4 +1,4 @@
1
- import{c as C,r as s,j as e,v as _,X as H,m as Q,f as I,T as K,F as Y,n as ee}from"./index-CM_b_EhP.js";import{U as te}from"./upload-IaViyeVD.js";import{C as se}from"./circle-alert-CpL4Bhvt.js";import{L as R}from"./loader-circle-Oq6NQhW2.js";import{C as ae}from"./code-xml-BiJBteXf.js";/**
1
+ import{c as C,r as s,j as e,v as _,X as H,m as Q,f as I,T as K,F as Y,n as ee}from"./index-B-0iHBPO.js";import{U as te}from"./upload-JfI5lCSE.js";import{C as se}from"./circle-alert-S7uFoxC2.js";import{L as R}from"./loader-circle-JTfD-ZuM.js";import{C as ae}from"./code-xml-De5-EXv3.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as X,r as v,j as e,b as Y,A as z,x as U,d as K,m as Z}from"./index-CM_b_EhP.js";import{G as W}from"./git-commit-horizontal-BVbucmO5.js";import{C as J}from"./chevron-left-D2jcWDll.js";import{F as ee}from"./file-code-corner-Box4IwG1.js";import{P as te}from"./plus-j08lFR-K.js";import{M as se,T as ne}from"./trending-down-DBiXUtxJ.js";import{C as B}from"./clock-IW4Wq86N.js";import{D as _}from"./dollar-sign-CDzDY64R.js";import{L as re}from"./layers-B78BiFiU.js";import{T as ae}from"./trending-up-BgmK_tHq.js";/**
1
+ import{c as X,r as v,j as e,b as Y,A as z,x as U,d as K,m as Z}from"./index-B-0iHBPO.js";import{G as W}from"./git-commit-horizontal-DVPeDQ3j.js";import{C as J}from"./chevron-left-5NUKWw3i.js";import{F as ee}from"./file-code-corner-ChtXoBwS.js";import{P as te}from"./plus-EoL5OCB7.js";import{M as se,T as ne}from"./trending-down-D4Jk7KF3.js";import{C as B}from"./clock-CaQRrIrs.js";import{D as _}from"./dollar-sign-Ji8zk86R.js";import{L as re}from"./layers-B1vsrsFW.js";import{T as ae}from"./trending-up-EQFTzhEo.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e,J as t,a0 as s,a1 as o}from"./index-CM_b_EhP.js";function r(){return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[60vh] p-8 text-center",children:[e.jsx("div",{className:"text-6xl font-heading font-bold text-primary/20 mb-4",children:"404"}),e.jsx("h1",{className:"text-h3 font-heading font-bold text-ink mb-2",children:"Page not found"}),e.jsx("p",{className:"text-sm text-muted-accessible mb-6 max-w-xs",children:"The page you are looking for does not exist or has been moved."}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:()=>window.history.back(),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium rounded-btn border border-border text-secondary hover:bg-hover transition-colors",children:[e.jsx(t,{size:14}),"Go Back"]}),e.jsxs(s,{to:"/",className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium rounded-btn bg-primary text-white hover:bg-[#4432c4] transition-colors shadow-button",children:[e.jsx(o,{size:14}),"Home"]})]})]})}export{r as default};
1
+ import{j as e,J as t,a0 as s,a1 as o}from"./index-B-0iHBPO.js";function r(){return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[60vh] p-8 text-center",children:[e.jsx("div",{className:"text-6xl font-heading font-bold text-primary/20 mb-4",children:"404"}),e.jsx("h1",{className:"text-h3 font-heading font-bold text-ink mb-2",children:"Page not found"}),e.jsx("p",{className:"text-sm text-muted-accessible mb-6 max-w-xs",children:"The page you are looking for does not exist or has been moved."}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:()=>window.history.back(),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium rounded-btn border border-border text-secondary hover:bg-hover transition-colors",children:[e.jsx(t,{size:14}),"Go Back"]}),e.jsxs(s,{to:"/",className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium rounded-btn bg-primary text-white hover:bg-[#4432c4] transition-colors shadow-button",children:[e.jsx(o,{size:14}),"Home"]})]})]})}export{r as default};