loki-mode 7.46.0 → 7.48.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 (90) hide show
  1. package/README.md +1 -1
  2. package/SKILL.md +2 -2
  3. package/VERSION +1 -1
  4. package/autonomy/completion-council.sh +113 -0
  5. package/autonomy/crash.sh +47 -21
  6. package/autonomy/loki +50 -27
  7. package/autonomy/run.sh +468 -5
  8. package/autonomy/spec-interrogation.sh +550 -0
  9. package/autonomy/telemetry.sh +28 -8
  10. package/bin/postinstall.js +22 -10
  11. package/dashboard/__init__.py +1 -1
  12. package/dashboard/auth.py +117 -2
  13. package/dashboard/telemetry.py +34 -6
  14. package/docs/ACKNOWLEDGEMENTS.md +1 -1
  15. package/docs/COMPETITIVE-ANALYSIS.md +1 -1
  16. package/docs/INSTALLATION.md +10 -3
  17. package/docs/OPEN-CORE-BOUNDARY.md +6 -5
  18. package/docs/P2-SPEC-ROBUSTNESS-PLAN.md +192 -0
  19. package/docs/PRIVACY.md +82 -24
  20. package/docs/R9-OPEN-CORE-HOOKS-PLAN.md +2 -2
  21. package/docs/auto-claude-comparison.md +2 -2
  22. package/docs/certification/README.md +1 -1
  23. package/docs/competitive/bolt-new-analysis.md +1 -1
  24. package/docs/competitive/emergence-others-analysis.md +6 -6
  25. package/docs/competitive/replit-lovable-analysis.md +4 -4
  26. package/docs/enterprise/security.md +43 -3
  27. package/docs/show-hn-post.md +1 -1
  28. package/loki-ts/dist/loki.js +30 -30
  29. package/mcp/__init__.py +1 -1
  30. package/package.json +1 -1
  31. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  32. package/web-app/dist/assets/{AdminPage-CKUOsWZW.js → AdminPage-CcCJ0Sjt.js} +1 -1
  33. package/web-app/dist/assets/{Avatar-CL9Id9Hi.js → Avatar-DK8kmayw.js} +1 -1
  34. package/web-app/dist/assets/{Badge-B12zwlD7.js → Badge-4uAWnemi.js} +1 -1
  35. package/web-app/dist/assets/{Button-CFLVoduT.js → Button-BBMk33tk.js} +1 -1
  36. package/web-app/dist/assets/ComparePage-bt9rwvST.js +1 -0
  37. package/web-app/dist/assets/{GitHubIssuesPanel-CSitxtAX.js → GitHubIssuesPanel-WDbH47UM.js} +1 -1
  38. package/web-app/dist/assets/{GitHubPRsPanel-BIT06FRo.js → GitHubPRsPanel-C2CiYtTx.js} +1 -1
  39. package/web-app/dist/assets/{HomePage-pU_0fGny.js → HomePage-BQk-MUjn.js} +4 -4
  40. package/web-app/dist/assets/{LoginPage-DTZtt2Yb.js → LoginPage-DMOZVGGL.js} +1 -1
  41. package/web-app/dist/assets/{MagicPage-10zfra8o.js → MagicPage-Bzp2Nt1z.js} +1 -1
  42. package/web-app/dist/assets/{MetricsPage-C-wiKUkv.js → MetricsPage-C39JVdsw.js} +1 -1
  43. package/web-app/dist/assets/{NotFoundPage-BDkcmhYe.js → NotFoundPage-6vT_U9UL.js} +1 -1
  44. package/web-app/dist/assets/{ProjectPage-CiCavQ8n.js → ProjectPage-BfFcZp-E.js} +3 -3
  45. package/web-app/dist/assets/{ProjectsPage-BLCXQwwC.js → ProjectsPage-CPMBf8Wt.js} +1 -1
  46. package/web-app/dist/assets/{SettingsPage-PkxtaMyg.js → SettingsPage-BnNN6ETl.js} +1 -1
  47. package/web-app/dist/assets/{ShowcasePage-iECp8Tha.js → ShowcasePage-WDrMf-cx.js} +1 -1
  48. package/web-app/dist/assets/{SystemSettingsPage-DS6Anno1.js → SystemSettingsPage-DX4jb2e8.js} +1 -1
  49. package/web-app/dist/assets/{TeamsPage-ls6h6bNL.js → TeamsPage-BCfqcXzu.js} +1 -1
  50. package/web-app/dist/assets/{TemplatesPage-Bk0QzlPt.js → TemplatesPage-CZvmimDj.js} +1 -1
  51. package/web-app/dist/assets/{TerminalOutput-4-1hWCtZ.js → TerminalOutput-BlRqFwWV.js} +1 -1
  52. package/web-app/dist/assets/{activity-DH3ih2nS.js → activity-CacZsUyr.js} +1 -1
  53. package/web-app/dist/assets/{bell-Gn17S6uv.js → bell-DK2qtHnk.js} +1 -1
  54. package/web-app/dist/assets/{bot-Cbycc3VE.js → bot-CkcUtHad.js} +1 -1
  55. package/web-app/dist/assets/{check-nIAqa-kf.js → check-CbCPjX3M.js} +1 -1
  56. package/web-app/dist/assets/{chevron-left-D2jcWDll.js → chevron-left-5NUKWw3i.js} +1 -1
  57. package/web-app/dist/assets/{circle-alert-CpL4Bhvt.js → circle-alert-S7uFoxC2.js} +1 -1
  58. package/web-app/dist/assets/{clock-IW4Wq86N.js → clock-CaQRrIrs.js} +1 -1
  59. package/web-app/dist/assets/{cloud-Cn8nNuH2.js → cloud-DBAX6c0r.js} +1 -1
  60. package/web-app/dist/assets/{code-xml-BiJBteXf.js → code-xml-De5-EXv3.js} +1 -1
  61. package/web-app/dist/assets/{copy-CnqkyNsi.js → copy-CUkT6k1v.js} +1 -1
  62. package/web-app/dist/assets/{database-CKSReqa5.js → database-BAWf1Gwt.js} +1 -1
  63. package/web-app/dist/assets/{dollar-sign-CDzDY64R.js → dollar-sign-Ji8zk86R.js} +1 -1
  64. package/web-app/dist/assets/{file-code-corner-Box4IwG1.js → file-code-corner-ChtXoBwS.js} +1 -1
  65. package/web-app/dist/assets/{file-plus-DpGqlXF8.js → file-plus-bFa37P76.js} +1 -1
  66. package/web-app/dist/assets/{folder-open-B57dAoBv.js → folder-open-DhXpXscO.js} +1 -1
  67. package/web-app/dist/assets/{git-commit-horizontal-BVbucmO5.js → git-commit-horizontal-DVPeDQ3j.js} +1 -1
  68. package/web-app/dist/assets/{globe-BkOnKl4x.js → globe-BPZgPeeu.js} +1 -1
  69. package/web-app/dist/assets/{hammer-DRbIQ4QU.js → hammer-jLCaujYH.js} +1 -1
  70. package/web-app/dist/assets/{index-CM_b_EhP.js → index-B-0iHBPO.js} +2 -2
  71. package/web-app/dist/assets/{layers-B78BiFiU.js → layers-B1vsrsFW.js} +1 -1
  72. package/web-app/dist/assets/{lightbulb-B-Itbm9g.js → lightbulb-C-uLoq9Y.js} +1 -1
  73. package/web-app/dist/assets/{loader-circle-Oq6NQhW2.js → loader-circle-JTfD-ZuM.js} +1 -1
  74. package/web-app/dist/assets/{lock-DbJ9zxbw.js → lock-G9rxD4gZ.js} +1 -1
  75. package/web-app/dist/assets/{mail-CzMRod6m.js → mail-BJ0PTN_V.js} +1 -1
  76. package/web-app/dist/assets/{package-WZ5osvej.js → package-CXClfLOO.js} +1 -1
  77. package/web-app/dist/assets/{plus-j08lFR-K.js → plus-EoL5OCB7.js} +1 -1
  78. package/web-app/dist/assets/{refresh-cw-CIr7E-g2.js → refresh-cw-BjREUnVq.js} +1 -1
  79. package/web-app/dist/assets/{rotate-ccw-gwoXxDeE.js → rotate-ccw-DahWX07H.js} +1 -1
  80. package/web-app/dist/assets/{save-B8fV_ZpE.js → save-Dek3gCn1.js} +1 -1
  81. package/web-app/dist/assets/{server-D5dO1paz.js → server-D6V1BAia.js} +1 -1
  82. package/web-app/dist/assets/{shield-alert-Du08zhdg.js → shield-alert-BtTK5Sxb.js} +1 -1
  83. package/web-app/dist/assets/{trash-2-DEKSVae5.js → trash-2-BT5o_g0r.js} +1 -1
  84. package/web-app/dist/assets/{trending-down-DBiXUtxJ.js → trending-down-D4Jk7KF3.js} +1 -1
  85. package/web-app/dist/assets/{trending-up-BgmK_tHq.js → trending-up-EQFTzhEo.js} +1 -1
  86. package/web-app/dist/assets/{upload-IaViyeVD.js → upload-JfI5lCSE.js} +1 -1
  87. package/web-app/dist/assets/{usePolling-PiRLqNu6.js → usePolling-BnhPUuGd.js} +1 -1
  88. package/web-app/dist/assets/{user-BB5J8wAF.js → user-DSUiUYtj.js} +1 -1
  89. package/web-app/dist/index.html +1 -1
  90. package/web-app/dist/assets/ComparePage-Dg0UdZAk.js +0 -1
@@ -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};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GitHubIssuesPanel-CSitxtAX.js","assets/index-CM_b_EhP.js","assets/index-BfZSDej1.css","assets/Button-CFLVoduT.js","assets/refresh-cw-CIr7E-g2.js","assets/circle-alert-CpL4Bhvt.js","assets/user-BB5J8wAF.js","assets/rotate-ccw-gwoXxDeE.js","assets/loader-circle-Oq6NQhW2.js","assets/TerminalOutput-4-1hWCtZ.js","assets/lock-DbJ9zxbw.js","assets/package-WZ5osvej.js","assets/file-code-corner-Box4IwG1.js","assets/file-plus-DpGqlXF8.js","assets/clock-IW4Wq86N.js","assets/activity-DH3ih2nS.js","assets/bot-Cbycc3VE.js","assets/check-nIAqa-kf.js","assets/hammer-DRbIQ4QU.js","assets/dollar-sign-CDzDY64R.js","assets/globe-BkOnKl4x.js","assets/copy-CnqkyNsi.js","assets/git-commit-horizontal-BVbucmO5.js","assets/upload-IaViyeVD.js","assets/plus-j08lFR-K.js","assets/trash-2-DEKSVae5.js","assets/trending-down-DBiXUtxJ.js","assets/save-B8fV_ZpE.js","assets/code-xml-BiJBteXf.js","assets/trending-up-BgmK_tHq.js","assets/layers-B78BiFiU.js","assets/folder-open-B57dAoBv.js","assets/server-D5dO1paz.js","assets/GitHubPRsPanel-BIT06FRo.js","assets/chevron-left-D2jcWDll.js","assets/shield-alert-Du08zhdg.js"])))=>i.map(i=>d[i]);
2
- var ta=e=>{throw TypeError(e)};var sa=(e,t,s)=>t.has(e)||ta("Cannot "+s);var Fs=(e,t,s)=>(sa(e,t,"read from private field"),s?s.call(e):t.get(e)),ia=(e,t,s)=>t.has(e)?ta("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ra=(e,t,s,i)=>(sa(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s);import{c as ae,r as d,W as ks,j as r,f as Zr,g as Ul,h as dr,i as ls,I as Kl,T as Ot,R as $t,k as es,M as ql,l as er,m as kt,S as Vl,U as _d,X as ft,n as ts,Z as Zt,a as W,E as ss,G as ze,K as xd,o as vd,p as bd,F as fi,P as It,_ as Jn,b as ur,q as Gl,s as Yl,t as yd,v as Sd,A as Zn,L as wd,B as Gs,w as Qr,x as Cd,e as kd,y as ys,z as na,D as oa,H as Nd,J as Xl,N as ii,O as jd,u as Ed}from"./index-CM_b_EhP.js";import{T as Dd,R as Rd,S as tr,P as Jl,F as Pd,E as Hi}from"./TerminalOutput-4-1hWCtZ.js";import{B as he}from"./Button-CFLVoduT.js";import{P as Zl}from"./package-WZ5osvej.js";import{F as Z}from"./file-code-corner-Box4IwG1.js";import{F as fr}from"./file-plus-DpGqlXF8.js";import{C as nt}from"./clock-IW4Wq86N.js";import{A as Md}from"./activity-DH3ih2nS.js";import{B as Ld}from"./bot-Cbycc3VE.js";import{C as Ut}from"./check-nIAqa-kf.js";import{L as mi}from"./loader-circle-Oq6NQhW2.js";import{H as Bd}from"./hammer-DRbIQ4QU.js";import{D as Ql}from"./dollar-sign-CDzDY64R.js";import{R as gt}from"./refresh-cw-CIr7E-g2.js";import{C as Rs}from"./circle-alert-CpL4Bhvt.js";import{G as en}from"./globe-BkOnKl4x.js";import{C as Qn}from"./copy-CnqkyNsi.js";import{G as ec}from"./git-commit-horizontal-BVbucmO5.js";import{U as tc}from"./upload-IaViyeVD.js";import{P as mr}from"./plus-j08lFR-K.js";import{T as eo}from"./trash-2-DEKSVae5.js";import{R as sc,E as Td}from"./rotate-ccw-gwoXxDeE.js";import{M as ic,T as zd}from"./trending-down-DBiXUtxJ.js";import{S as Ad}from"./save-B8fV_ZpE.js";import{C as tn}from"./code-xml-BiJBteXf.js";import{T as Od}from"./trending-up-BgmK_tHq.js";import{L as $d}from"./layers-B78BiFiU.js";import{F as sn}from"./folder-open-B57dAoBv.js";import{S as Id}from"./server-D5dO1paz.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GitHubIssuesPanel-WDbH47UM.js","assets/index-B-0iHBPO.js","assets/index-BfZSDej1.css","assets/Button-BBMk33tk.js","assets/refresh-cw-BjREUnVq.js","assets/circle-alert-S7uFoxC2.js","assets/user-DSUiUYtj.js","assets/rotate-ccw-DahWX07H.js","assets/loader-circle-JTfD-ZuM.js","assets/TerminalOutput-BlRqFwWV.js","assets/lock-G9rxD4gZ.js","assets/package-CXClfLOO.js","assets/file-code-corner-ChtXoBwS.js","assets/file-plus-bFa37P76.js","assets/clock-CaQRrIrs.js","assets/activity-CacZsUyr.js","assets/bot-CkcUtHad.js","assets/check-CbCPjX3M.js","assets/hammer-jLCaujYH.js","assets/dollar-sign-Ji8zk86R.js","assets/globe-BPZgPeeu.js","assets/copy-CUkT6k1v.js","assets/git-commit-horizontal-DVPeDQ3j.js","assets/upload-JfI5lCSE.js","assets/plus-EoL5OCB7.js","assets/trash-2-BT5o_g0r.js","assets/trending-down-D4Jk7KF3.js","assets/save-Dek3gCn1.js","assets/code-xml-De5-EXv3.js","assets/trending-up-EQFTzhEo.js","assets/layers-B1vsrsFW.js","assets/folder-open-DhXpXscO.js","assets/server-D6V1BAia.js","assets/GitHubPRsPanel-C2CiYtTx.js","assets/chevron-left-5NUKWw3i.js","assets/shield-alert-BtTK5Sxb.js"])))=>i.map(i=>d[i]);
2
+ var ta=e=>{throw TypeError(e)};var sa=(e,t,s)=>t.has(e)||ta("Cannot "+s);var Fs=(e,t,s)=>(sa(e,t,"read from private field"),s?s.call(e):t.get(e)),ia=(e,t,s)=>t.has(e)?ta("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ra=(e,t,s,i)=>(sa(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s);import{c as ae,r as d,W as ks,j as r,f as Zr,g as Ul,h as dr,i as ls,I as Kl,T as Ot,R as $t,k as es,M as ql,l as er,m as kt,S as Vl,U as _d,X as ft,n as ts,Z as Zt,a as W,E as ss,G as ze,K as xd,o as vd,p as bd,F as fi,P as It,_ as Jn,b as ur,q as Gl,s as Yl,t as yd,v as Sd,A as Zn,L as wd,B as Gs,w as Qr,x as Cd,e as kd,y as ys,z as na,D as oa,H as Nd,J as Xl,N as ii,O as jd,u as Ed}from"./index-B-0iHBPO.js";import{T as Dd,R as Rd,S as tr,P as Jl,F as Pd,E as Hi}from"./TerminalOutput-BlRqFwWV.js";import{B as he}from"./Button-BBMk33tk.js";import{P as Zl}from"./package-CXClfLOO.js";import{F as Z}from"./file-code-corner-ChtXoBwS.js";import{F as fr}from"./file-plus-bFa37P76.js";import{C as nt}from"./clock-CaQRrIrs.js";import{A as Md}from"./activity-CacZsUyr.js";import{B as Ld}from"./bot-CkcUtHad.js";import{C as Ut}from"./check-CbCPjX3M.js";import{L as mi}from"./loader-circle-JTfD-ZuM.js";import{H as Bd}from"./hammer-jLCaujYH.js";import{D as Ql}from"./dollar-sign-Ji8zk86R.js";import{R as gt}from"./refresh-cw-BjREUnVq.js";import{C as Rs}from"./circle-alert-S7uFoxC2.js";import{G as en}from"./globe-BPZgPeeu.js";import{C as Qn}from"./copy-CUkT6k1v.js";import{G as ec}from"./git-commit-horizontal-DVPeDQ3j.js";import{U as tc}from"./upload-JfI5lCSE.js";import{P as mr}from"./plus-EoL5OCB7.js";import{T as eo}from"./trash-2-BT5o_g0r.js";import{R as sc,E as Td}from"./rotate-ccw-DahWX07H.js";import{M as ic,T as zd}from"./trending-down-D4Jk7KF3.js";import{S as Ad}from"./save-Dek3gCn1.js";import{C as tn}from"./code-xml-De5-EXv3.js";import{T as Od}from"./trending-up-EQFTzhEo.js";import{L as $d}from"./layers-B1vsrsFW.js";import{F as sn}from"./folder-open-DhXpXscO.js";import{S as Id}from"./server-D6V1BAia.js";/**
3
3
  * @license lucide-react v0.577.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
@@ -247,7 +247,7 @@ WARNING: This link could potentially be dangerous`)){let s=window.open();if(s){t
247
247
  \x1B[31m-- Terminal disconnected. Max reconnect attempts reached. Refresh the page to try again. --\x1B[0m`);return}const y=Math.min(ex*Math.pow(2,v),tx);h.current=v+1,g&&g.writeln(`\r
248
248
  \x1B[33m-- Terminal disconnected. Reconnecting in ${(y/1e3).toFixed(0)}s (attempt ${v+1}/${Cl})... --\x1B[0m`),a.current=setTimeout(()=>{l.current&&u()},y)},_.onerror=()=>{}},[e,c]);return d.useEffect(()=>{l.current=!0,h.current=0;const m=s.current;if(!m)return;const f=new U_({cursorBlink:!0,fontSize:13,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, Monaco, monospace",theme:{background:"#1a1a2e",foreground:"#e0e0e0",cursor:"#a78bfa",selectionBackground:"#3d3d5c",black:"#1a1a2e",red:"#ff6b6b",green:"#51cf66",yellow:"#ffd43b",blue:"#74c0fc",magenta:"#da77f2",cyan:"#66d9ef",white:"#e0e0e0",brightBlack:"#4a4a6a",brightRed:"#ff8787",brightGreen:"#69db7c",brightYellow:"#ffe066",brightBlue:"#91d5ff",brightMagenta:"#e599f7",brightCyan:"#99f7f5",brightWhite:"#ffffff"},scrollback:1e4,convertEol:!0,allowProposedApi:!0}),_=new V_,p=new Q_;f.loadAddon(_),f.loadAddon(p),f.open(m),i.current=f,n.current=_;try{_.fit()}catch{}f.onData(y=>{const x=o.current;x&&x.readyState===WebSocket.OPEN&&x.send(JSON.stringify({type:"input",data:y}))}),u();let g=null;const v=new ResizeObserver(()=>{g&&clearTimeout(g),g=setTimeout(()=>{if(!(!n.current||!i.current))try{n.current.fit(),c()}catch{}},50)});return v.observe(m),()=>{l.current=!1,v.disconnect(),g&&clearTimeout(g),a.current&&clearTimeout(a.current),o.current&&(o.current.onclose=null,o.current.close(),o.current=null),f.dispose(),i.current=null,n.current=null}},[u,c]),d.useEffect(()=>{if(t&&n.current&&i.current){const m=setTimeout(()=>{var f;try{(f=n.current)==null||f.fit(),c()}catch{}},50);return()=>clearTimeout(m)}},[t,c]),r.jsx("div",{ref:s,className:"h-full w-full",style:{backgroundColor:"#1a1a2e"}})}const kl={file_created:{icon:fr,color:"bg-blue-500",bgColor:"bg-blue-500/10",labelColor:"text-blue-600"},file_modified:{icon:Z,color:"bg-blue-400",bgColor:"bg-blue-400/10",labelColor:"text-blue-500"},dependency_install:{icon:Zl,color:"bg-teal-500",bgColor:"bg-teal-500/10",labelColor:"text-teal-600"},test_pass:{icon:kt,color:"bg-green-500",bgColor:"bg-green-500/10",labelColor:"text-green-600"},test_fail:{icon:er,color:"bg-red-500",bgColor:"bg-red-500/10",labelColor:"text-red-500"},error:{icon:er,color:"bg-red-500",bgColor:"bg-red-500/10",labelColor:"text-red-500"},narration:{icon:ql,color:"bg-purple-500",bgColor:"bg-purple-500/10",labelColor:"text-purple-600"},command:{icon:es,color:"bg-gray-500",bgColor:"bg-gray-500/10",labelColor:"text-gray-600"},phase_change:{icon:$t,color:"bg-primary",bgColor:"bg-primary/10",labelColor:"text-primary"},deploy:{icon:$t,color:"bg-primary",bgColor:"bg-primary/10",labelColor:"text-primary"},warning:{icon:Ot,color:"bg-yellow-500",bgColor:"bg-yellow-500/10",labelColor:"text-yellow-600"},info:{icon:Kl,color:"bg-gray-400",bgColor:"bg-gray-400/10",labelColor:"text-gray-500"}};function Nl(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function ix({event:e,isLast:t,onFileClick:s}){const i=kl[e.type]||kl.info,n=i.icon,o=e.type==="narration";return r.jsxs("div",{className:"flex gap-3 group",children:[r.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[r.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center ${i.bgColor}`,children:r.jsx(n,{size:14,className:i.labelColor})}),!t&&r.jsx("div",{className:"w-px flex-1 bg-border min-h-[16px]"})]}),r.jsx("div",{className:"flex-1 min-w-0 pb-4 ",children:o?r.jsxs("div",{className:"relative bg-purple-500/5 border border-purple-500/20 rounded-lg px-3 py-2 mt-0.5",children:[r.jsx("div",{className:"absolute -left-1.5 top-2.5 w-2.5 h-2.5 bg-purple-500/5 border-l border-b border-purple-500/20 rotate-45"}),r.jsx("p",{className:"text-xs text-ink leading-relaxed",children:e.message}),e.detail&&r.jsx("p",{className:"text-[11px] text-muted mt-1 leading-relaxed",children:e.detail}),r.jsxs("span",{className:"text-[10px] text-muted/60 mt-1.5 flex items-center gap-1",children:[r.jsx(nt,{size:10}),Nl(e.timestamp)]})]}):r.jsxs("div",{className:"mt-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:`text-xs font-medium ${i.labelColor}`,children:e.message}),e.filePath&&s&&r.jsx("button",{onClick:()=>s(e.filePath),className:"text-[11px] font-mono text-primary hover:text-primary/80 hover:underline truncate max-w-[200px]",title:e.filePath,children:e.filePath})]}),r.jsxs("span",{className:"text-[10px] text-muted/60 flex items-center gap-1 mt-0.5",children:[r.jsx(nt,{size:10}),Nl(e.timestamp)]})]})})]})}const qr=20,jl=10;function rx({events:e,onFileClick:t,maxHeight:s}){const i=d.useRef(null),[n,o]=d.useState(!0);if(d.useEffect(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e.length]),d.useEffect(()=>{e.length>qr},[e.length,n]),e.length===0)return r.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[r.jsx(Ul,{size:28,className:"text-muted/30 mb-3"}),r.jsx("p",{className:"text-xs text-muted font-medium",children:"No build events yet"}),r.jsx("p",{className:"text-[11px] text-muted/70 mt-1",children:"Events will appear here as the build progresses."})]});const a=e.length>qr&&n,l=a?e.slice(-jl):e,h=a?e.length-jl:0;return r.jsxs("div",{ref:i,className:"overflow-y-auto terminal-scroll px-3 py-3",style:{maxHeight:s||"100%"},children:[a&&h>0&&r.jsxs("button",{onClick:()=>o(!1),className:"flex items-center gap-1.5 text-[11px] text-primary hover:text-primary/80 font-medium mb-3 ml-9",children:[r.jsx(dr,{size:12}),"Show ",h," earlier event",h!==1?"s":""]}),!n&&e.length>qr&&r.jsxs("button",{onClick:()=>o(!0),className:"flex items-center gap-1.5 text-[11px] text-primary hover:text-primary/80 font-medium mb-3 ml-9",children:[r.jsx(ls,{size:12}),"Collapse older events"]}),l.map((c,u)=>r.jsx(ix,{event:c,isLast:u===l.length-1,onFileClick:t},c.id))]})}const El=[{id:"terminal",label:"Terminal",icon:es,alwaysShow:!0},{id:"activity",label:"Activity",icon:Md,alwaysShow:!0},{id:"build",label:"Build Log",icon:ju},{id:"agents",label:"Agents",icon:Ld},{id:"quality",label:"Quality",icon:Vl}];function nx({status:e}){switch(e){case"pass":return r.jsx(Ut,{size:14,className:"text-success"});case"fail":return r.jsx(ft,{size:14,className:"text-danger"});default:return r.jsx(nt,{size:14,className:"text-muted"})}}function ox({agents:e}){return!e||e.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center h-full",children:[r.jsx(_d,{size:24,className:"text-muted/30 mb-2"}),r.jsx("p",{className:"text-xs text-muted font-medium",children:"No agents active"}),r.jsx("p",{className:"text-[11px] text-muted/70 mt-0.5",children:"Agents appear here during active builds"})]}):r.jsx("div",{className:"p-2 space-y-1 overflow-y-auto terminal-scroll",children:e.map(t=>r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-btn bg-hover text-xs",children:[r.jsx("span",{className:"font-semibold text-ink truncate",children:t.name}),r.jsx("span",{className:"text-xs font-mono text-muted-accessible px-1.5 py-0.5 rounded-btn bg-card",children:t.type}),r.jsx("span",{className:`text-xs font-semibold ${t.status==="running"?"text-success":"text-muted"}`,children:t.status}),r.jsx("span",{className:"ml-auto text-xs text-muted-accessible font-mono truncate max-w-[200px]",children:t.task})]},t.id))})}function ax({checklist:e}){return!e||!e.items||e.items.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center h-full",children:[r.jsx(Vl,{size:24,className:"text-muted/30 mb-2"}),r.jsx("p",{className:"text-xs text-muted font-medium",children:"No quality gate data"}),r.jsx("p",{className:"text-[11px] text-muted/70 mt-0.5",children:"Quality gates appear during active builds"})]}):r.jsxs("div",{className:"p-2 space-y-1 overflow-y-auto terminal-scroll",children:[r.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 text-xs text-muted-accessible font-semibold uppercase",children:[r.jsx("span",{children:"Gate"}),r.jsxs("span",{className:"ml-auto",children:[e.passed,"/",e.total," passed"]})]}),e.items.map(t=>r.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-btn hover:bg-hover text-xs",children:[r.jsx(nx,{status:t.status}),r.jsx("span",{className:"text-ink",children:t.label}),t.details&&r.jsx("span",{className:"ml-auto text-xs text-muted-accessible truncate max-w-[200px]",children:t.details})]},t.id))]})}function lx({logs:e,logsLoading:t,agents:s,checklist:i,sessionId:n,isRunning:o,subscribe:a,buildEvents:l,onFileClick:h}){var g;const[c,u]=d.useState("terminal"),m=s&&s.length>0,f=i&&i.items&&i.items.length>0,_=e&&e.length>0,p=El.filter(v=>!!(v.alwaysShow||v.id==="build"&&(_||o)||v.id==="agents"&&(m||o)||v.id==="quality"&&(f||o)));return p.find(v=>v.id===c)||u("terminal"),r.jsxs("div",{className:"h-full flex flex-col bg-card",children:[r.jsx("div",{role:"tablist",className:"flex items-center border-b border-border px-2 flex-shrink-0",children:p.map(v=>{const y=v.icon,x=c===v.id;return r.jsxs("button",{role:"tab","aria-selected":x,onClick:()=>u(v.id),className:`flex items-center gap-1.5 px-3 py-2 text-xs font-medium transition-colors border-b-2 ${x?"border-primary text-primary":"border-transparent text-muted hover:text-ink"}`,children:[r.jsx(y,{size:14}),v.label,v.id==="agents"&&m&&r.jsx("span",{className:"ml-0.5 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-primary/10 text-primary",children:s.length}),v.id==="quality"&&f&&r.jsxs("span",{className:"ml-0.5 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-success/10 text-success",children:[i.passed,"/",i.total]})]},v.id)})}),r.jsxs("div",{role:"tabpanel","aria-label":(g=El.find(v=>v.id===c))==null?void 0:g.label,className:"flex-1 min-h-0 overflow-hidden relative",children:[r.jsx("div",{className:"absolute inset-0",style:{visibility:c==="terminal"?"visible":"hidden",zIndex:c==="terminal"?1:0},children:r.jsx(sx,{sessionId:n,isActive:c==="terminal"})}),c==="build"&&r.jsx(Dd,{logs:e,loading:t,subscribe:a}),c==="agents"&&r.jsx(ox,{agents:s}),c==="activity"&&r.jsx(rx,{events:l||[],onFileClick:h}),c==="quality"&&r.jsx(ax,{checklist:i})]})]})}const Dl={ai:["Warming up the AI...","Reading your code...","Thinking about the best approach...","Running quality checks...","Almost there..."],build:["Setting things up...","Installing dependencies...","Compiling your project...","Running the build pipeline...","Finishing touches..."],deploy:["Preparing containers...","Pushing to the cloud...","Configuring services...","Running health checks...","Almost live..."],general:["Loading...","Getting things ready...","Just a moment...","Fetching data...","Almost there..."]};function cx({context:e="general",className:t=""}){const s=Dl[e]||Dl.general,[i,n]=d.useState(0),[o,a]=d.useState(!1);return d.useEffect(()=>{const l=setInterval(()=>{a(!0),setTimeout(()=>{n(h=>(h+1)%s.length),a(!1)},300)},3e3);return()=>clearInterval(l)},[s.length]),r.jsxs("div",{className:`flex items-center gap-2 ${t}`,children:[r.jsx(mi,{size:14,className:"animate-spin text-primary/60"}),r.jsx("span",{className:`text-xs text-muted transition-opacity duration-300 ${o?"opacity-0":"opacity-100"}`,children:s[i]})]})}const Vr=[{id:"planning",label:"Plan",color:"bg-blue-500",textColor:"text-blue-500",icon:Jd},{id:"building",label:"Build",color:"bg-primary",textColor:"text-primary",icon:Bd},{id:"testing",label:"Test",color:"bg-teal",textColor:"text-teal",icon:ri},{id:"reviewing",label:"Review",color:"bg-warning",textColor:"text-warning",icon:ts},{id:"complete",label:"Done",color:"bg-success",textColor:"text-success",icon:kt}];function hx({phase:e,iteration:t,maxIterations:s,cost:i,startTime:n,isRunning:o}){const[a,l]=d.useState(0),[h,c]=d.useState(e),[u,m]=d.useState(!1);if(d.useEffect(()=>{if(!o||!n)return;const x=setInterval(()=>{l(Math.floor((Date.now()-n)/1e3))},1e3);return()=>clearInterval(x)},[o,n]),d.useEffect(()=>{if(e!==h){m(!0);const x=setTimeout(()=>{c(e),m(!1)},400);return()=>clearTimeout(x)}},[e,h]),!o&&e==="idle")return null;const f=Vr.findIndex(x=>x.id===e),_=s>0?Math.min(t/s*100,100):0,p=t>0?a/t:60,g=Math.max(0,s-t),v=Math.ceil(p*g),y=x=>x<60?`${x}s`:`${Math.floor(x/60)}m ${x%60}s`;return r.jsxs("div",{className:"flex-shrink-0 build-progress-container",children:[r.jsxs("div",{className:"h-1 bg-border relative overflow-hidden",children:[r.jsx("div",{className:"h-full bg-gradient-to-r from-primary to-teal build-progress-bar",style:{width:`${_}%`}}),o&&r.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-shimmer"})]}),r.jsxs("div",{className:`px-4 py-1.5 flex items-center gap-4 bg-card border-b border-border text-xs ${u?"phase-transitioning":""}`,children:[r.jsx("div",{className:"flex items-center gap-1",children:Vr.map((x,k)=>{const N=k<f,w=k===f,D=x.icon;return r.jsxs("div",{className:`flex items-center gap-1 phase-indicator ${w?"phase-indicator-active":""} ${N?"phase-indicator-complete":""}`,children:[r.jsx("div",{className:`phase-icon-wrapper ${w?"phase-icon-active":""} ${N?"phase-icon-complete":""}`,children:N?r.jsx(kt,{size:14,className:"text-success phase-check-enter"}):w?r.jsx(D,{size:14,className:`${x.textColor} phase-icon-spin`}):r.jsx(D,{size:14,className:"text-muted/40"})}),r.jsx("span",{className:`text-[11px] font-medium transition-all duration-300 ${w?"text-ink":N?"text-success":"text-muted/50"}`,children:x.label}),k<Vr.length-1&&r.jsx("div",{className:`mx-1 h-px w-4 transition-all duration-500 ${N?"bg-success":"bg-border"}`})]},x.id)})}),o&&e!=="complete"&&e!=="idle"&&r.jsx(cx,{context:"build"}),r.jsx("div",{className:"flex-1"}),r.jsxs("div",{className:"flex items-center gap-3 text-muted",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Zt,{size:12}),"Iter ",t,"/",s]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(nt,{size:12}),y(a),o&&v>0&&r.jsxs("span",{className:"text-muted/60",children:["(",y(v)," left)"]})]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Ql,{size:12}),"$",i.toFixed(2)]})]})]})]})}const Gr=[{id:"vercel",name:"Vercel",description:"Optimized for Next.js, React, and static sites with global CDN.",initial:"V",color:"text-ink",bgColor:"bg-ink/10",borderColor:"border-ink/20",tokenUrl:"https://vercel.com/account/tokens",tokenUrlLabel:"Get your token from vercel.com/account/tokens",hasTokenAuth:!0},{id:"netlify",name:"Netlify",description:"Deploy with CI/CD, serverless functions, and form handling.",initial:"N",color:"text-teal-600",bgColor:"bg-teal-500/10",borderColor:"border-teal-500/20",tokenUrl:"https://app.netlify.com/user/applications#personal-access-tokens",tokenUrlLabel:"Get your token from app.netlify.com/user/applications",hasTokenAuth:!0},{id:"github",name:"GitHub",description:"Free hosting for static sites directly from a GitHub repository.",initial:"G",color:"text-purple-600",bgColor:"bg-purple-500/10",borderColor:"border-purple-500/20",tokenUrl:"https://cli.github.com/",tokenUrlLabel:"Install GitHub CLI",hasTokenAuth:!1}];function dx({platform:e,onConnect:t}){const[s,i]=d.useState(""),[n,o]=d.useState(!1),[a,l]=d.useState(null),h=d.useCallback(async c=>{if(c.preventDefault(),!!s.trim()){o(!0),l(null);try{await t(s.trim()),i("")}catch(u){l(u instanceof Error?u.message:"Connection failed")}finally{o(!1)}}},[s,t]);return r.jsxs("form",{onSubmit:h,className:"mt-3 space-y-2.5",children:[r.jsxs("div",{children:[r.jsxs("label",{htmlFor:`token-${e.id}`,className:"sr-only",children:[e.name," Token"]}),r.jsx("input",{id:`token-${e.id}`,type:"password",value:s,onChange:c=>i(c.target.value),placeholder:`${e.name} access token`,disabled:n,className:`w-full px-3 py-2 text-sm border border-border rounded-lg bg-card text-ink
249
249
  focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary
250
- placeholder:text-muted disabled:opacity-50`})]}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsxs("a",{href:e.tokenUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[11px] text-primary hover:underline",children:[e.tokenUrlLabel,r.jsx(ss,{size:10})]}),r.jsx(he,{type:"submit",variant:"primary",size:"sm",loading:n,disabled:!s.trim()||n,children:"Connect"})]}),a&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-red-500 mt-1",children:[r.jsx(Rs,{size:12}),a]})]})}function ux(){return r.jsxs("div",{className:"mt-3 space-y-2",children:[r.jsxs("div",{className:"flex items-start gap-2 bg-amber-500/5 border border-amber-500/15 rounded-lg px-3 py-2.5",children:[r.jsx(es,{size:14,className:"text-amber-600 flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-xs text-muted leading-relaxed",children:[r.jsx("p",{className:"font-medium text-ink mb-1",children:"Run in your terminal:"}),r.jsx("code",{className:"block bg-ink/5 rounded px-2 py-1 font-mono text-[11px] text-ink",children:"gh auth login"})]})]}),r.jsxs("a",{href:"https://cli.github.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[11px] text-primary hover:underline",children:["Install GitHub CLI",r.jsx(ss,{size:10})]})]})}function fx({platform:e,status:t,onConnect:s,onDisconnect:i}){const[n,o]=d.useState(!1),[a,l]=d.useState(!1),h=d.useCallback(async()=>{l(!0);try{i()}finally{l(!1)}},[i]),c=d.useCallback(async u=>{await s(u),o(!1)},[s]);return r.jsxs("div",{className:`border rounded-lg p-4 transition-colors ${t.connected?"border-green-500/30 bg-green-500/5":"border-border hover:border-primary/30 hover:bg-hover"}`,children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${e.bgColor}`,children:r.jsx("span",{className:`text-sm font-bold ${e.color}`,children:e.initial})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:"text-sm font-semibold text-ink",children:e.name}),r.jsx("p",{className:"text-[11px] text-muted leading-snug mt-0.5",children:e.description})]}),r.jsx("div",{className:"flex-shrink-0",children:r.jsx("span",{className:`inline-block w-2.5 h-2.5 rounded-full ${t.connected?"bg-green-500":"bg-gray-300"}`,title:t.connected?"Connected":"Not connected"})})]}),t.connected?r.jsxs("div",{className:"mt-3 space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-green-600 font-medium",children:[r.jsx(kt,{size:14}),"Connected as ",t.user||"unknown"]}),t.last_deployed&&r.jsxs("p",{className:"text-[11px] text-muted",children:["Last deployed: ",new Date(t.last_deployed).toLocaleString()]}),r.jsx(he,{variant:"danger",size:"sm",icon:Hu,onClick:h,loading:a,className:"w-full",children:"Disconnect"})]}):r.jsx(r.Fragment,{children:e.hasTokenAuth?r.jsxs(r.Fragment,{children:[!n&&r.jsx("div",{className:"mt-3",children:r.jsxs(he,{variant:"secondary",size:"sm",onClick:()=>o(!0),className:"w-full",children:["Connect ",e.name]})}),n&&r.jsx(dx,{platform:e,onConnect:c})]}):r.jsx(ux,{})})]})}function mx({compact:e=!1,onStatusChange:t}){const[s,i]=d.useState({vercel:{connected:!1},netlify:{connected:!1},github:{connected:!1}}),[n,o]=d.useState(!0),[a,l]=d.useState(null),h=d.useCallback(async()=>{try{const p=await W.getDeployStatus();i(p),t==null||t(p),l(null)}catch(p){l(p instanceof Error?p.message:"Failed to fetch connection status")}finally{o(!1)}},[t]);d.useEffect(()=>{h();const p=setInterval(h,3e4);return()=>clearInterval(p)},[h]);const c=d.useCallback(async p=>{const g=await W.connectVercel(p);g.success&&(i(v=>({...v,vercel:{connected:!0,user:g.user}})),t==null||t({...s,vercel:{connected:!0,user:g.user}}))},[s,t]),u=d.useCallback(async p=>{const g=await W.connectNetlify(p);g.success&&(i(v=>({...v,netlify:{connected:!0,user:g.user}})),t==null||t({...s,netlify:{connected:!0,user:g.user}}))},[s,t]),m=d.useCallback(async p=>{await W.disconnectPlatform(p),i(v=>({...v,[p]:{connected:!1}}));const g={...s,[p]:{connected:!1}};t==null||t(g)},[s,t]),f={vercel:c,netlify:u,github:async()=>{}};if(n)return r.jsxs("div",{className:"flex items-center justify-center py-8",children:[r.jsx(mi,{size:20,className:"text-primary animate-spin"}),r.jsx("span",{className:"text-sm text-muted ml-2",children:"Loading connections..."})]});const _=[s.vercel,s.netlify,s.github].filter(p=>p.connected).length;return r.jsxs("div",{className:e?"space-y-3":"space-y-4",children:[!e&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Platform Connections"}),r.jsxs("p",{className:"text-[11px] text-muted mt-0.5",children:[_," of ",Gr.length," platforms connected"]})]}),r.jsx("button",{onClick:h,className:"p-1.5 text-muted hover:text-ink rounded transition-colors",title:"Refresh connection status",children:r.jsx(gt,{size:14})})]}),e&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"flex items-center gap-3",children:Gr.map(p=>{const g=s[p.id];return r.jsxs("div",{className:"flex items-center gap-1.5",title:`${p.name}: ${g.connected?`Connected as ${g.user}`:"Not connected"}`,children:[r.jsx("span",{className:`w-2 h-2 rounded-full ${g.connected?"bg-green-500":"bg-gray-300"}`}),r.jsx("span",{className:"text-[11px] text-muted",children:p.name})]},p.id)})}),r.jsx("button",{onClick:h,className:"p-1 text-muted hover:text-ink rounded transition-colors",title:"Refresh",children:r.jsx(gt,{size:12})})]}),a&&r.jsxs("div",{className:"flex items-center gap-2 bg-red-500/5 border border-red-500/15 rounded-lg px-3 py-2",children:[r.jsx(Rs,{size:14,className:"text-red-500 flex-shrink-0"}),r.jsx("span",{className:"text-xs text-red-600",children:a})]}),r.jsx("div",{className:e?"space-y-2":"space-y-3",children:Gr.map(p=>r.jsx(fx,{platform:p,status:s[p.id],onConnect:f[p.id],onDisconnect:()=>m(p.id)},p.id))})]})}const px=[{id:"vercel",name:"Vercel",description:"Optimized for Next.js, React, and static sites. Global CDN with instant rollbacks.",icon:en,color:"text-ink",bgColor:"bg-ink/5",connectionKey:"vercel"},{id:"netlify",name:"Netlify",description:"Deploy with CI/CD, serverless functions, and form handling built in.",icon:en,color:"text-teal-600",bgColor:"bg-teal-500/5",connectionKey:"netlify"},{id:"github-pages",name:"GitHub Pages",description:"Free hosting for static sites directly from a GitHub repository.",icon:ze,color:"text-purple-600",bgColor:"bg-purple-500/5",connectionKey:"github"}];function gx({platform:e,deployState:t,onDeploy:s,disabled:i,connected:n}){const[o,a]=d.useState(!1),l=e.icon,h=d.useCallback(async()=>{if(t.url)try{await navigator.clipboard.writeText(t.url),a(!0),setTimeout(()=>a(!1),2e3)}catch{}},[t.url]),c=i||!n;return r.jsxs("div",{className:`border border-border rounded-lg p-4 transition-colors ${t.status==="success"?"border-green-500/30 bg-green-500/5":t.status==="error"?"border-red-500/30 bg-red-500/5":n?"hover:border-primary/30 hover:bg-hover":"opacity-60"}`,children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${e.bgColor}`,children:r.jsx(l,{size:20,className:e.color})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:"text-sm font-semibold text-ink",children:e.name}),r.jsx("p",{className:"text-[11px] text-muted leading-snug mt-0.5",children:e.description})]}),r.jsx("span",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${n?"bg-green-500":"bg-gray-300"}`,title:n?"Connected":"Not connected"})]}),t.status==="idle"&&r.jsxs("div",{className:"relative group",children:[r.jsxs(he,{variant:"secondary",size:"sm",icon:$t,onClick:s,disabled:c,className:"w-full",children:["Deploy to ",e.name]}),!n&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:r.jsxs("span",{className:"bg-ink text-white text-[10px] px-2 py-1 rounded shadow opacity-0 group-hover:opacity-100 transition-opacity",children:["Connect ",e.name," first"]})})]}),t.status==="deploying"&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-btn bg-primary/5 border border-primary/20",children:[r.jsx(mi,{size:14,className:"text-primary animate-spin"}),r.jsxs("span",{className:"text-xs font-medium text-primary",children:["Deploying to ",e.name,"..."]})]}),t.status==="success"&&t.url&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-green-600 font-medium",children:[r.jsx(kt,{size:14}),"Deployed successfully"]}),r.jsxs("div",{className:"flex items-center gap-1.5 bg-card border border-border rounded-btn px-3 py-2",children:[r.jsx(en,{size:12,className:"text-muted flex-shrink-0"}),r.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-mono text-primary hover:underline truncate flex-1",children:t.url}),r.jsxs("button",{onClick:h,className:"flex items-center gap-1 text-[11px] text-muted hover:text-ink transition-colors flex-shrink-0",title:"Copy URL",children:[o?r.jsx(Ut,{size:12,className:"text-green-500"}):r.jsx(Qn,{size:12}),o?"Copied":"Copy"]}),r.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted hover:text-ink transition-colors flex-shrink-0",title:"Open in new tab",children:r.jsx(ss,{size:12})})]})]}),t.status==="error"&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-red-500 font-medium",children:[r.jsx(Rs,{size:14}),"Deploy failed"]}),r.jsx("p",{className:"text-[11px] text-muted bg-red-500/5 border border-red-500/10 rounded px-2 py-1.5 font-mono",children:t.error||"Unknown error"}),r.jsx(he,{variant:"secondary",size:"sm",icon:$t,onClick:s,disabled:c,className:"w-full",children:"Retry"})]})]})}function _x({sessionId:e,disabled:t}){const[s,i]=d.useState({status:"idle"}),[n,o]=d.useState(!1),a=d.useCallback(async()=>{i({status:"pushing"});try{const h=await W.githubPush(e);h.repo_url?i({status:"success",repoUrl:h.repo_url}):i({status:"error",error:h.error||"Push failed"})}catch(h){i({status:"error",error:h instanceof Error?h.message:"Push failed"})}},[e]),l=d.useCallback(async()=>{if(s.repoUrl)try{await navigator.clipboard.writeText(s.repoUrl),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[s.repoUrl]);return r.jsxs("div",{className:"border border-border rounded-lg p-4",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center bg-ink/5",children:r.jsx(ze,{size:20,className:"text-ink"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Push to GitHub"}),r.jsx("p",{className:"text-[11px] text-muted leading-snug mt-0.5",children:"Create a repository and push your code to GitHub."})]})]}),s.status==="idle"&&r.jsx(he,{variant:"secondary",size:"sm",icon:ze,onClick:a,disabled:t,className:"w-full",children:"Create Repo + Push"}),s.status==="pushing"&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-btn bg-primary/5 border border-primary/20",children:[r.jsx(mi,{size:14,className:"text-primary animate-spin"}),r.jsx("span",{className:"text-xs font-medium text-primary",children:"Creating repository and pushing..."})]}),s.status==="success"&&s.repoUrl&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-green-600 font-medium",children:[r.jsx(kt,{size:14}),"Pushed to GitHub"]}),r.jsxs("div",{className:"flex items-center gap-1.5 bg-card border border-border rounded-btn px-3 py-2",children:[r.jsx(ze,{size:12,className:"text-muted flex-shrink-0"}),r.jsx("a",{href:s.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-mono text-primary hover:underline truncate flex-1",children:s.repoUrl}),r.jsxs("button",{onClick:l,className:"flex items-center gap-1 text-[11px] text-muted hover:text-ink transition-colors flex-shrink-0",title:"Copy URL",children:[n?r.jsx(Ut,{size:12,className:"text-green-500"}):r.jsx(Qn,{size:12}),n?"Copied":"Copy"]})]})]}),s.status==="error"&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-red-500 font-medium",children:[r.jsx(Rs,{size:14}),"Push failed"]}),r.jsx("p",{className:"text-[11px] text-muted bg-red-500/5 border border-red-500/10 rounded px-2 py-1.5 font-mono",children:s.error}),r.jsx(he,{variant:"secondary",size:"sm",icon:ze,onClick:a,disabled:t,className:"w-full",children:"Retry"})]})]})}function xx({sessionId:e}){const[t,s]=d.useState({vercel:{status:"idle"},netlify:{status:"idle"},"github-pages":{status:"idle"}}),[i,n]=d.useState({vercel:{connected:!1},netlify:{connected:!1},github:{connected:!1}}),[o,a]=d.useState(!1),l=Object.values(t).some(u=>u.status==="deploying"),h=d.useCallback(async u=>{s(m=>({...m,[u]:{status:"deploying"}}));try{const m=await W.deployProject(e,u);m.url?s(f=>({...f,[u]:{status:"success",url:m.url}})):s(f=>({...f,[u]:{status:"error",error:m.error||"Deploy failed"}}))}catch(m){s(f=>({...f,[u]:{status:"error",error:m instanceof Error?m.message:"Deploy failed"}}))}},[e]),c=u=>{var m;return((m=i[u.connectionKey])==null?void 0:m.connected)??!1};return r.jsx("div",{className:"h-full overflow-y-auto terminal-scroll",children:r.jsxs("div",{className:"p-6 max-w-2xl mx-auto space-y-6",children:[r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg font-heading font-bold text-ink flex items-center gap-2",children:[r.jsx($t,{size:20,className:"text-primary"}),"Deploy Your Project"]}),r.jsx("p",{className:"text-xs text-muted mt-1",children:"Choose a platform to deploy your project. One click to go live."})]}),r.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[r.jsxs("button",{type:"button",onClick:()=>a(!o),className:"flex items-center justify-between w-full px-4 py-3 text-left hover:bg-hover transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ac,{size:16,className:"text-primary"}),r.jsx("span",{className:"text-sm font-medium text-ink",children:"Platform Connections"}),r.jsx("div",{className:"flex items-center gap-1 ml-2",children:["vercel","netlify","github"].map(u=>{var m,f;return r.jsx("span",{className:`w-2 h-2 rounded-full ${(m=i[u])!=null&&m.connected?"bg-green-500":"bg-gray-300"}`,title:`${u}: ${(f=i[u])!=null&&f.connected?"Connected":"Not connected"}`},u)})})]}),r.jsx("span",{className:"text-xs text-muted",children:o?"Hide":"Manage"})]}),o&&r.jsx("div",{className:"border-t border-border p-4",children:r.jsx(mx,{compact:!0,onStatusChange:n})})]}),r.jsx("div",{className:"space-y-3",children:px.map(u=>r.jsx(gx,{platform:u,deployState:t[u.id],onDeploy:()=>h(u.id),disabled:l,connected:c(u)},u.id))}),r.jsx("div",{className:"border-t border-border"}),r.jsx(_x,{sessionId:e,disabled:l})]})})}const Sh=typeof navigator<"u"&&/Mac/.test(navigator.userAgent),wt=Sh?"Cmd":"Ctrl",Rl=[{keys:[`${wt}+K`],label:"Open Command Palette",category:"navigation"},{keys:[`${wt}+P`],label:"Quick open file",category:"navigation"},{keys:[`${wt}+,`],label:"Open settings",category:"navigation"},{keys:[`${wt}+S`],label:"Save file",category:"editor"},{keys:[`${wt}+Z`],label:"Undo",category:"editor"},{keys:[`${wt}+Shift+Z`],label:"Redo",category:"editor"},{keys:[`${wt}+B`],label:"Start / stop build",category:"build"},{keys:[`${wt}+\``],label:"Toggle terminal",category:"build"},{keys:["?"],label:"Show keyboard shortcuts",category:"general"},{keys:[`${wt}+?`],label:"Show keyboard shortcuts (alt)",category:"general"},{keys:["Escape"],label:"Close modals",category:"general"}],vx={navigation:"Navigation",editor:"Editor",build:"Build",general:"General"},bx=["navigation","editor","build","general"];function yx({onToggleTerminal:e,onToggleBuild:t}){const[s,i]=d.useState(!1),n=d.useCallback(o=>{var c,u;const a=Sh?o.metaKey:o.ctrlKey,l=(c=o.target)==null?void 0:c.tagName,h=l==="INPUT"||l==="TEXTAREA"||((u=o.target)==null?void 0:u.isContentEditable);if(a&&(o.key==="?"||o.shiftKey&&o.key==="/")){o.preventDefault(),i(m=>!m);return}if(o.key==="?"&&!a&&!h){o.preventDefault(),i(m=>!m);return}if(a&&o.key==="`"){o.preventDefault(),e==null||e();return}if(a&&o.key==="b"){o.preventDefault(),t==null||t();return}o.key==="Escape"&&s&&i(!1)},[e,t,s]);return d.useEffect(()=>(window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)),[n]),{showHelp:s,setShowHelp:i}}function Sx({open:e,onClose:t}){const[s,i]=d.useState("");d.useEffect(()=>{e&&i("")},[e]);const n=d.useMemo(()=>{if(!s.trim())return Rl;const a=s.toLowerCase();return Rl.filter(l=>l.label.toLowerCase().includes(a)||l.keys.some(h=>h.toLowerCase().includes(a))||l.category.toLowerCase().includes(a))},[s]),o=d.useMemo(()=>{const a={};for(const l of n)a[l.category]||(a[l.category]=[]),a[l.category].push(l);return a},[n]);return e?r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/20",onClick:t,children:r.jsxs("div",{className:"bg-card rounded-xl shadow-2xl border border-border w-full max-w-md mx-4 overflow-hidden",onClick:a=>a.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(xd,{size:16,className:"text-primary"}),r.jsx("h2",{className:"text-sm font-heading font-bold text-ink",children:"Keyboard Shortcuts"})]}),r.jsx("button",{onClick:t,className:"text-muted hover:text-ink transition-colors p-1 rounded-btn hover:bg-hover",children:r.jsx(ft,{size:16})})]}),r.jsx("div",{className:"px-4 py-2 border-b border-border",children:r.jsxs("div",{className:"relative",children:[r.jsx(ts,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted"}),r.jsx("input",{type:"text",value:s,onChange:a=>i(a.target.value),placeholder:"Filter shortcuts...",className:"w-full pl-9 pr-3 py-1.5 text-xs bg-card border border-border rounded-btn outline-none focus:border-primary transition-colors",autoFocus:!0})]})}),r.jsxs("div",{className:"max-h-[400px] overflow-y-auto terminal-scroll",children:[bx.map(a=>{const l=o[a];return!l||l.length===0?null:r.jsxs("div",{children:[r.jsx("div",{className:"px-5 pt-3 pb-1",children:r.jsx("span",{className:"text-[10px] font-semibold text-muted uppercase tracking-wider",children:vx[a]})}),r.jsx("div",{className:"px-4 space-y-0.5 pb-2",children:l.map(h=>r.jsxs("div",{className:"flex items-center justify-between px-2 py-2 rounded-btn hover:bg-hover",children:[r.jsx("span",{className:"text-xs text-ink",children:h.label}),r.jsx("div",{className:"flex items-center gap-1",children:h.keys.map(c=>r.jsx("kbd",{className:"px-2 py-0.5 text-[11px] font-mono bg-hover border border-border rounded text-muted-accessible",children:c},c))})]},h.label))})]},a)}),n.length===0&&r.jsx("div",{className:"px-5 py-8 text-center",children:r.jsxs("p",{className:"text-xs text-muted",children:['No shortcuts matching "',s,'"']})})]}),r.jsx("div",{className:"px-5 py-3 border-t border-border text-center",children:r.jsxs("span",{className:"text-[11px] text-muted",children:["Press ",r.jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-hover border border-border rounded",children:"Escape"})," to close"]})})]})}):null}function wx({onClick:e}){return r.jsx("button",{onClick:e,title:"Keyboard shortcuts",className:"inline-flex items-center justify-center w-7 h-7 rounded-btn text-muted hover:text-ink hover:bg-hover transition-colors text-xs font-bold",children:"?"})}const wh="pl_recent_commands",Cx=5;function Ch(){try{const e=localStorage.getItem(wh);return e?JSON.parse(e):[]}catch{return[]}}function Yr(e){try{const t=Ch().filter(s=>s!==e);t.unshift(e),localStorage.setItem(wh,JSON.stringify(t.slice(0,Cx)))}catch{}}function kx(e){var i;const t=((i=e.split(".").pop())==null?void 0:i.toLowerCase())||"";return{js:Z,ts:Z,tsx:Z,jsx:Z,py:Z,go:Z,rs:Z,rb:Z,sh:Z,html:nc,css:so,json:to,md:fi}[t]||io}function Nx(e,t){const s=e.toLowerCase(),i=t.toLowerCase(),n=[];let o=0;for(let a=0;a<i.length&&o<s.length;a++)i[a]===s[o]&&(n.push(a),o++);return o===s.length?n:null}function Pl({text:e,indices:t}){if(t.length===0)return r.jsx(r.Fragment,{children:e});const s=new Set(t);return r.jsx(r.Fragment,{children:e.split("").map((i,n)=>s.has(n)?r.jsx("span",{className:"text-primary font-semibold",children:i},n):r.jsx("span",{children:i},n))})}function jx({isOpen:e,onClose:t,commands:s,sessionId:i,onFileSelect:n}){const[o,a]=d.useState(""),[l,h]=d.useState(0),[c,u]=d.useState([]),[m,f]=d.useState(!1),_=d.useRef(null),p=d.useRef(null),g=vd(e);bd(e,t),d.useEffect(()=>{e&&(a(""),h(0),u([]),f(!1),setTimeout(()=>{var S;return(S=_.current)==null?void 0:S.focus()},50))},[e]);const v=d.useMemo(()=>Ch().map(j=>s.find(C=>C.id===j)).filter(Boolean),[s]),y=d.useMemo(()=>{if(!o.trim())return s.map(j=>({cmd:j,indices:[]}));const S=[];for(const j of s){const C=Nx(o,j.label);if(C){const B=C[0]*10+(C[C.length-1]-C[0]);S.push({cmd:j,indices:C,score:B})}}return S.sort((j,C)=>j.score-C.score),S.map(j=>({cmd:j.cmd,indices:j.indices}))},[s,o]),x=d.useMemo(()=>o.trim()?y.filter(S=>S.cmd.category==="setting"):[],[y,o]),k=d.useMemo(()=>y.filter(S=>S.cmd.category!=="setting"),[y]);d.useEffect(()=>{if(!i||!o.trim()){u([]),f(!1);return}return f(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(async()=>{try{const S=await W.searchFiles(i,o);u(S.filter(j=>j.type==="file"))}catch{u([])}f(!1)},200),()=>{p.current&&clearTimeout(p.current)}},[o,i]);const N=!o.trim()&&v.length>0,w=d.useMemo(()=>{const S=[];return N&&v.forEach((j,C)=>S.push({type:"recent",index:C})),k.forEach((j,C)=>S.push({type:"command",index:C})),x.length>0&&x.forEach((j,C)=>S.push({type:"setting",index:C})),c.forEach((j,C)=>S.push({type:"file",index:C})),S},[N,v,k,x,c]),D=w.length;d.useEffect(()=>{h(0)},[o]);const T=d.useCallback(S=>{const j=w[S];if(j){if(j.type==="recent"){const C=v[j.index];C&&(Yr(C.id),C.action(),t())}else if(j.type==="command"){const C=k[j.index];C&&(Yr(C.cmd.id),C.cmd.action(),t())}else if(j.type==="setting"){const C=x[j.index];C&&(Yr(C.cmd.id),C.cmd.action(),t())}else if(j.type==="file"){const C=c[j.index];C&&n&&(n(C.path,C.name),t())}}},[w,v,k,x,c,n,t]),U=d.useCallback(S=>{S.key==="ArrowDown"?(S.preventDefault(),h(j=>Math.min(j+1,D-1))):S.key==="ArrowUp"?(S.preventDefault(),h(j=>Math.max(j-1,0))):S.key==="Enter"&&D>0?T(l):S.key==="Escape"&&t()},[D,l,T,t]);if(!e)return null;let G=0;const K=()=>G++,A=k.length>0,M=x.length>0,E=c.length>0,L=m&&o.trim().length>0;return r.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",onClick:t,children:[r.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),r.jsxs("div",{ref:g,className:"relative w-full max-w-lg bg-card rounded-xl shadow-2xl border border-border overflow-hidden",onClick:S=>S.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[r.jsx(ts,{size:18,className:"text-muted"}),r.jsx("input",{ref:_,value:o,onChange:S=>a(S.target.value),onKeyDown:U,placeholder:"Search commands, files, settings...",className:"flex-1 bg-transparent text-sm outline-none text-ink placeholder:text-muted"}),r.jsx("kbd",{className:"text-[10px] text-muted bg-hover px-1.5 py-0.5 rounded border border-border font-mono",children:"ESC"})]}),r.jsxs("div",{className:"max-h-[360px] overflow-y-auto py-1 terminal-scroll",children:[N&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"px-4 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider flex items-center gap-1.5",children:[r.jsx(nt,{size:10})," Recent"]}),v.map((S,j)=>{const C=K(),B=S.icon;return r.jsxs("button",{onClick:()=>T(C),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors ${C===l?"bg-primary/10 text-primary":"text-ink hover:bg-hover"}`,children:[r.jsx(B,{size:16}),r.jsx("span",{className:"flex-1 text-left",children:S.label}),S.shortcut&&r.jsx("kbd",{className:"text-[10px] text-muted bg-hover px-1.5 py-0.5 rounded border border-border font-mono",children:S.shortcut})]},`recent-${S.id}`)})]}),A&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider",children:"Commands"}),k.map((S,j)=>{const C=K(),B=S.cmd.icon;return r.jsxs("button",{onClick:()=>T(C),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors ${C===l?"bg-primary/10 text-primary":"text-ink hover:bg-hover"}`,children:[r.jsx(B,{size:16}),r.jsx("span",{className:"flex-1 text-left",children:o.trim()?r.jsx(Pl,{text:S.cmd.label,indices:S.indices}):S.cmd.label}),S.cmd.shortcut&&r.jsx("kbd",{className:"text-[10px] text-muted bg-hover px-1.5 py-0.5 rounded border border-border font-mono",children:S.cmd.shortcut})]},S.cmd.id)})]}),M&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider mt-1",children:"Settings"}),x.map((S,j)=>{const C=K(),B=S.cmd.icon;return r.jsxs("button",{onClick:()=>T(C),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors ${C===l?"bg-primary/10 text-primary":"text-ink hover:bg-hover"}`,children:[r.jsx(B,{size:16}),r.jsx("span",{className:"flex-1 text-left",children:r.jsx(Pl,{text:S.cmd.label,indices:S.indices})}),S.cmd.shortcut&&r.jsx("kbd",{className:"text-[10px] text-muted bg-hover px-1.5 py-0.5 rounded border border-border font-mono",children:S.cmd.shortcut})]},`setting-${S.cmd.id}`)})]}),E&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider mt-1",children:"Files"}),c.map((S,j)=>{const C=K(),B=S.type==="directory"?ro:kx(S.name);return r.jsxs("button",{onClick:()=>T(C),className:`w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors ${C===l?"bg-primary/10 text-primary":"text-ink hover:bg-hover"}`,children:[r.jsx(B,{size:14}),r.jsx("span",{className:"flex-1 text-left font-mono text-xs truncate",children:S.name}),r.jsx("span",{className:"text-[10px] text-muted truncate max-w-[200px]",children:S.path})]},`file-${S.path}`)})]}),L&&!E&&r.jsx("div",{className:"px-4 py-2 text-xs text-muted animate-pulse",children:"Searching files..."}),D===0&&!L&&r.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted",children:"No results found"})]})]})]})}const Ex=d.lazy(()=>Jn(()=>import("./GitHubIssuesPanel-CSitxtAX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32])).then(e=>({default:e.GitHubIssuesPanel}))),Dx=d.lazy(()=>Jn(()=>import("./GitHubPRsPanel-BIT06FRo.js"),__vite__mapDeps([33,1,2,3,34,4,5,35,12,14,17,9,10,11,13,15,16,8,18,19,20,21,22,23,24,25,7,26,27,28,29,30,31,32])).then(e=>({default:e.GitHubPRsPanel}))),Rx=d.lazy(()=>Jn(()=>Promise.resolve().then(()=>Gx),void 0).then(e=>({default:e.CICDPanel}))),Px=3e4,Mx={modified:r.jsx(Z,{size:13,className:"text-yellow-500"}),added:r.jsx(fr,{size:13,className:"text-green-500"}),deleted:r.jsx(eo,{size:13,className:"text-red-400"}),renamed:r.jsx(Z,{size:13,className:"text-blue-400"}),untracked:r.jsx(oc,{size:13,className:"text-muted"})},Lx={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"?"};function Bx({commit:e}){return r.jsx("div",{className:"px-3 py-2 border-b border-border hover:bg-hover transition-colors",children:r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(ec,{size:14,className:"text-primary mt-0.5 flex-shrink-0"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-xs font-medium text-ink truncate",children:e.message}),r.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[r.jsx("span",{className:"text-[11px] font-mono text-primary/70",children:e.short_hash}),r.jsx("span",{className:"text-[11px] text-muted",children:e.author}),r.jsx("span",{className:"text-[11px] text-muted ml-auto flex-shrink-0",children:e.date})]}),e.refs.length>0&&r.jsx("div",{className:"flex gap-1 mt-1",children:e.refs.map((t,s)=>r.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[10px] font-mono bg-primary/10 text-primary rounded",children:[r.jsx(ze,{size:9}),t]},s))})]})]})})}function Ml({file:e}){return r.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 hover:bg-hover transition-colors text-xs",children:[Mx[e.status]||r.jsx(oc,{size:13}),r.jsx("span",{className:"font-mono text-ink truncate flex-1",children:e.path}),r.jsx("span",{className:`font-mono text-[10px] px-1 rounded ${e.staged?"bg-green-500/10 text-green-500":"bg-muted/10 text-muted"}`,children:Lx[e.status]||"?"})]})}function Tx({sessionId:e}){const[t,s]=d.useState("changes"),[i,n]=d.useState(null),[o,a]=d.useState([]),[l,h]=d.useState([]),[c,u]=d.useState(!0),[m,f]=d.useState(null),[_,p]=d.useState(""),[g,v]=d.useState(!1),[y,x]=d.useState(null),[k,N]=d.useState(!1),[w,D]=d.useState(""),[T,U]=d.useState(!1),[G,K]=d.useState(!1),[A,M]=d.useState(""),[E,L]=d.useState(""),[S,j]=d.useState(!1),[C,B]=d.useState(null),[X,oe]=d.useState(!1),q=d.useCallback(async()=>{u(!0),f(null);try{const[R,le,_e]=await Promise.all([W.git.status(e),W.git.log(e),W.git.branches(e)]);n(R),a(le),h(_e)}catch(R){f(R instanceof Error?R.message:"Failed to load git data")}u(!1)},[e]);d.useEffect(()=>{q()},[q]);const Q=async()=>{if(!(!_.trim()||g)){v(!0),x(null);try{const R=await W.git.commit(e,_.trim());x(`Committed: ${R.hash}`),p(""),await q()}catch(R){x(`Error: ${R instanceof Error?R.message:"Commit failed"}`)}v(!1)}},ie=async()=>{if(!(!w.trim()||T)){U(!0);try{await W.git.createBranch(e,w.trim()),D(""),N(!1),await q()}catch(R){f(R instanceof Error?R.message:"Branch creation failed")}U(!1)}},de=async R=>{try{await W.git.checkoutBranch(e,R),await q()}catch(le){f(le instanceof Error?le.message:"Checkout failed")}},ue=async()=>{oe(!0);try{await W.git.push(e),await q()}catch(R){f(R instanceof Error?R.message:"Push failed")}oe(!1)},z=async()=>{if(!(!A.trim()||S)){j(!0),B(null);try{const R=await W.git.pr(e,A.trim(),E.trim());B(R.url),M(""),L(""),K(!1)}catch(R){B(`Error: ${R instanceof Error?R.message:"PR creation failed"}`)}j(!1)}},V=(i==null?void 0:i.files.filter(R=>R.staged))||[],J=(i==null?void 0:i.files.filter(R=>!R.staged))||[];return c&&!i?r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(gt,{size:20,className:"text-muted animate-spin"}),r.jsx("span",{className:"text-xs text-muted",children:"Loading git status..."})]})}):m&&!i?r.jsx("div",{className:"h-full flex items-center justify-center p-6",children:r.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[r.jsx(Rs,{size:32,className:"text-muted/40"}),r.jsx("p",{className:"text-sm text-muted",children:m}),r.jsx("p",{className:"text-xs text-muted/60",children:"This project may not be a git repository."}),r.jsx(he,{size:"sm",variant:"secondary",icon:gt,onClick:q,children:"Retry"})]})}):r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-hover flex-shrink-0",children:[r.jsx(ze,{size:14,className:"text-primary"}),r.jsx("span",{className:"text-xs font-semibold text-ink",children:(i==null?void 0:i.branch)||"unknown"}),i&&(i.ahead>0||i.behind>0)&&r.jsxs("span",{className:"text-[10px] text-muted font-mono",children:[i.ahead>0&&`+${i.ahead}`,i.ahead>0&&i.behind>0&&" / ",i.behind>0&&`-${i.behind}`]}),(i==null?void 0:i.clean)&&r.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-green-500",children:[r.jsx(Ut,{size:10})," Clean"]}),r.jsx("div",{className:"flex-1"}),r.jsx("button",{onClick:q,className:"p-1 text-muted hover:text-ink rounded transition-colors",title:"Refresh",children:r.jsx(gt,{size:13,className:c?"animate-spin":""})})]}),r.jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border flex-shrink-0",children:[{id:"changes",label:"Changes",icon:Z,count:(i==null?void 0:i.files.length)||0},{id:"history",label:"History",icon:nt},{id:"branches",label:"Branches",icon:ze,count:l.length}].map(R=>r.jsxs("button",{onClick:()=>s(R.id),className:`flex items-center gap-1 px-2.5 py-1 text-[11px] font-medium rounded-btn transition-colors ${t===R.id?"bg-primary/10 text-primary":"text-muted hover:text-ink"}`,children:[r.jsx(R.icon,{size:12}),R.label,R.count!==void 0&&R.count>0&&r.jsx("span",{className:"ml-0.5 px-1 py-0 text-[9px] rounded-full bg-primary/20 text-primary font-mono",children:R.count})]},R.id))}),m&&r.jsx("div",{className:"px-3 py-2 bg-red-500/5 border-b border-red-500/20 text-xs text-red-400",children:m}),r.jsxs("div",{className:"flex-1 overflow-y-auto terminal-scroll",children:[t==="changes"&&r.jsx("div",{className:"flex flex-col h-full",children:(i==null?void 0:i.files.length)===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[r.jsx(Ut,{size:28,className:"text-green-500/30 mb-2"}),r.jsx("p",{className:"text-xs text-muted",children:"Working tree clean"}),r.jsx("p",{className:"text-[11px] text-muted/60 mt-0.5",children:"No changes to commit."})]}):r.jsxs(r.Fragment,{children:[V.length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"px-3 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider bg-green-500/5 border-b border-border",children:["Staged (",V.length,")"]}),V.map((R,le)=>r.jsx(Ml,{file:R},`s-${le}`))]}),J.length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"px-3 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider bg-yellow-500/5 border-b border-border",children:["Unstaged (",J.length,")"]}),J.map((R,le)=>r.jsx(Ml,{file:R},`u-${le}`))]}),r.jsxs("div",{className:"mt-auto border-t border-border p-3 space-y-2 flex-shrink-0",children:[r.jsx("textarea",{value:_,onChange:R=>p(R.target.value),placeholder:"Commit message...",rows:2,className:"w-full px-3 py-1.5 text-xs bg-card border border-border rounded-btn outline-none focus:border-primary transition-colors resize-none font-mono"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(he,{size:"sm",icon:ec,onClick:Q,disabled:!_.trim()||g,loading:g,children:"Commit"}),r.jsx(he,{size:"sm",variant:"secondary",icon:tc,onClick:ue,loading:X,disabled:X,children:"Push"}),r.jsx(he,{size:"sm",variant:"ghost",icon:rn,onClick:()=>K(!G),children:"PR"})]}),y&&r.jsx("p",{className:`text-[11px] font-mono ${y.startsWith("Error")?"text-red-400":"text-green-500"}`,children:y}),C&&r.jsx("p",{className:"text-[11px] font-mono text-primary",children:C.startsWith("Error")?r.jsx("span",{className:"text-red-400",children:C}):r.jsx("a",{href:C,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-primary/80",children:C})})]}),G&&r.jsxs("div",{className:"border-t border-border p-3 space-y-2 flex-shrink-0 bg-hover",children:[r.jsx("p",{className:"text-[11px] font-semibold text-ink",children:"Create Pull Request"}),r.jsx("input",{value:A,onChange:R=>M(R.target.value),placeholder:"PR title...",className:"w-full px-3 py-1.5 text-xs bg-card border border-border rounded-btn outline-none focus:border-primary"}),r.jsx("textarea",{value:E,onChange:R=>L(R.target.value),placeholder:"PR description (optional)...",rows:3,className:"w-full px-3 py-1.5 text-xs bg-card border border-border rounded-btn outline-none focus:border-primary resize-none"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(he,{size:"sm",icon:rn,onClick:z,disabled:!A.trim()||S,loading:S,children:"Create PR"}),r.jsx(he,{size:"sm",variant:"ghost",onClick:()=>K(!1),children:"Cancel"})]})]})]})}),t==="history"&&r.jsx("div",{children:o.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[r.jsx(nt,{size:28,className:"text-muted/30 mb-2"}),r.jsx("p",{className:"text-xs text-muted",children:"No commits yet"})]}):o.map((R,le)=>r.jsx(Bx,{commit:R},le))}),t==="branches"&&r.jsxs("div",{children:[r.jsx("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:r.jsxs("button",{onClick:()=>N(!k),className:"flex items-center gap-1 text-xs text-primary hover:text-primary/80 font-medium",children:[r.jsx(mr,{size:12}),"New Branch"]})}),k&&r.jsxs("div",{className:"px-3 py-2 border-b border-border bg-hover flex items-center gap-2",children:[r.jsx("input",{value:w,onChange:R=>D(R.target.value),placeholder:"branch-name",className:"flex-1 px-2 py-1 text-xs font-mono bg-card border border-border rounded-btn outline-none focus:border-primary",onKeyDown:R=>{R.key==="Enter"&&ie()}}),r.jsx(he,{size:"sm",onClick:ie,disabled:!w.trim()||T,loading:T,children:"Create"})]}),l.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[r.jsx(ze,{size:28,className:"text-muted/30 mb-2"}),r.jsx("p",{className:"text-xs text-muted",children:"No branches found"})]}):r.jsxs("div",{children:[l.filter(R=>!R.remote).map((R,le)=>r.jsxs("button",{onClick:()=>!R.current&&de(R.name),disabled:R.current,className:`w-full text-left flex items-center gap-2 px-3 py-2 text-xs border-b border-border transition-colors ${R.current?"bg-primary/5":"hover:bg-hover cursor-pointer"}`,children:[r.jsx(ze,{size:13,className:R.current?"text-primary":"text-muted"}),r.jsx("span",{className:`font-mono ${R.current?"text-primary font-semibold":"text-ink"}`,children:R.name}),R.current&&r.jsx("span",{className:"ml-auto text-[10px] bg-primary/10 text-primary px-1.5 py-0.5 rounded font-medium",children:"current"})]},`l-${le}`)),l.filter(R=>R.remote).length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-3 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider bg-hover border-b border-border",children:"Remote"}),l.filter(R=>R.remote).map((R,le)=>r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs border-b border-border",children:[r.jsx(ze,{size:13,className:"text-muted/60"}),r.jsx("span",{className:"font-mono text-muted",children:R.name})]},`r-${le}`))]})]})]})]})]})}function Xr(){return r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(gt,{size:20,className:"text-muted animate-spin"}),r.jsx("span",{className:"text-xs text-muted",children:"Loading..."})]})})}function Jr({sessionId:e,onPushed:t}){const[s,i]=d.useState(!1),[n,o]=d.useState(null),a=async()=>{i(!0),o(null);try{await W.githubPush(e),t()}catch(l){o(l instanceof Error?l.message:"Push to GitHub failed")}i(!1)};return r.jsx("div",{className:"h-full flex items-center justify-center p-8",children:r.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-xs",children:[r.jsx(lu,{size:40,className:"text-muted/30"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-ink",children:"This project isn't connected to GitHub yet"}),r.jsx("p",{className:"text-xs text-muted mt-1",children:"Push your project to GitHub to access issues, pull requests, and CI/CD workflows."})]}),r.jsx("div",{className:"flex items-center gap-2",children:r.jsx(he,{size:"sm",icon:tc,onClick:a,loading:s,children:"Push to GitHub"})}),n&&r.jsx("p",{className:"text-[11px] text-red-400 font-mono",children:n})]})})}function zx({sessionId:e}){const[t,s]=d.useState("changes"),[i,n]=d.useState(!0),[o,a]=d.useState(null),[l,h]=d.useState({issues:0,prs:0,actions:0,fetchedAt:0}),c=d.useRef(!1),u=d.useCallback(async()=>{n(!0);try{const g=await W.getStatus();a({has_remote:!0,repo:"",owner:""})}catch{a({has_remote:!1})}n(!1)},[e]);d.useEffect(()=>{u()},[u]);const m=d.useCallback(async()=>{if(!(!(o!=null&&o.has_remote)||Date.now()-l.fetchedAt<Px)&&!c.current){c.current=!0;try{const[v,y,x]=await Promise.allSettled([W.getGitHubIssues(e,"open",1),W.getGitHubPRs(e,"open",1),W.getWorkflowRuns(e,5)]);h({issues:v.status==="fulfilled"?v.value.length:0,prs:y.status==="fulfilled"?y.value.length:0,actions:x.status==="fulfilled"?x.value.filter(k=>k.status==="in_progress").length:0,fetchedAt:Date.now()})}catch{}c.current=!1}},[e,o==null?void 0:o.has_remote,l.fetchedAt]);if(d.useEffect(()=>{o!=null&&o.has_remote&&m()},[o==null?void 0:o.has_remote,m]),d.useEffect(()=>{["issues","prs","actions"].includes(t)&&(o!=null&&o.has_remote)&&m()},[t,o==null?void 0:o.has_remote,m]),i)return r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(gt,{size:20,className:"text-muted animate-spin"}),r.jsx("span",{className:"text-xs text-muted",children:"Checking GitHub connection..."})]})});const f=(o==null?void 0:o.has_remote)??!1,_=[{id:"changes",label:"Changes",icon:Z,requiresRemote:!1},{id:"issues",label:"Issues",icon:Yd,count:l.issues,requiresRemote:!0},{id:"prs",label:"PRs",icon:rn,count:l.prs,requiresRemote:!0},{id:"actions",label:"Actions",icon:It,count:l.actions,requiresRemote:!0}],p=_;return r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-hover flex-shrink-0",children:[p.map(g=>{const v=g.requiresRemote&&!f;return r.jsxs("button",{onClick:()=>s(g.id),disabled:v,className:`flex items-center gap-1 px-2.5 py-1 text-[11px] font-medium rounded-btn transition-colors ${t===g.id?"bg-primary/10 text-primary":v?"text-muted/40 cursor-not-allowed":"text-muted hover:text-ink"}`,title:v?"Connect to GitHub to access this tab":void 0,children:[r.jsx(g.icon,{size:12}),g.label,g.count!==void 0&&g.count>0&&r.jsx("span",{className:"ml-0.5 px-1 py-0 text-[9px] rounded-full bg-primary/20 text-primary font-mono",children:g.count})]},g.id)}),f&&(o==null?void 0:o.owner)&&r.jsxs("div",{className:"ml-auto flex items-center gap-1 text-[10px] text-muted font-mono",children:[r.jsx(ac,{size:10}),o.owner,"/",o.repo]})]}),r.jsxs("div",{className:"flex-1 overflow-hidden",children:[t==="changes"&&r.jsx(Tx,{sessionId:e}),t==="issues"&&(f?r.jsx(d.Suspense,{fallback:r.jsx(Xr,{}),children:r.jsx(Ex,{sessionId:e})}):r.jsx(Jr,{sessionId:e,onPushed:u})),t==="prs"&&(f?r.jsx(d.Suspense,{fallback:r.jsx(Xr,{}),children:r.jsx(Dx,{sessionId:e})}):r.jsx(Jr,{sessionId:e,onPushed:u})),t==="actions"&&(f?r.jsx(d.Suspense,{fallback:r.jsx(Xr,{}),children:r.jsx("div",{className:"h-full overflow-y-auto p-4",children:r.jsx(Rx,{sessionId:e})})}):r.jsx(Jr,{sessionId:e,onPushed:u}))]})]})}function Ax({sessionId:e,onRestore:t}){const[s,i]=d.useState([]),[n,o]=d.useState(!0),[a,l]=d.useState(null),[h,c]=d.useState(null),[u,m]=d.useState(null),f=d.useCallback(async()=>{try{const g=await W.getCheckpoints(e);i(g),m(null)}catch{m("Failed to load checkpoints")}o(!1)},[e]);d.useEffect(()=>{f();const g=setInterval(f,15e3);return()=>clearInterval(g)},[f]);const _=d.useCallback(async g=>{if(a)return;const v=s.find(x=>x.id===g);if(!(!v||!window.confirm(`Restore to checkpoint "${v.description}"?
250
+ placeholder:text-muted disabled:opacity-50`})]}),r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsxs("a",{href:e.tokenUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[11px] text-primary hover:underline",children:[e.tokenUrlLabel,r.jsx(ss,{size:10})]}),r.jsx(he,{type:"submit",variant:"primary",size:"sm",loading:n,disabled:!s.trim()||n,children:"Connect"})]}),a&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-red-500 mt-1",children:[r.jsx(Rs,{size:12}),a]})]})}function ux(){return r.jsxs("div",{className:"mt-3 space-y-2",children:[r.jsxs("div",{className:"flex items-start gap-2 bg-amber-500/5 border border-amber-500/15 rounded-lg px-3 py-2.5",children:[r.jsx(es,{size:14,className:"text-amber-600 flex-shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-xs text-muted leading-relaxed",children:[r.jsx("p",{className:"font-medium text-ink mb-1",children:"Run in your terminal:"}),r.jsx("code",{className:"block bg-ink/5 rounded px-2 py-1 font-mono text-[11px] text-ink",children:"gh auth login"})]})]}),r.jsxs("a",{href:"https://cli.github.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-[11px] text-primary hover:underline",children:["Install GitHub CLI",r.jsx(ss,{size:10})]})]})}function fx({platform:e,status:t,onConnect:s,onDisconnect:i}){const[n,o]=d.useState(!1),[a,l]=d.useState(!1),h=d.useCallback(async()=>{l(!0);try{i()}finally{l(!1)}},[i]),c=d.useCallback(async u=>{await s(u),o(!1)},[s]);return r.jsxs("div",{className:`border rounded-lg p-4 transition-colors ${t.connected?"border-green-500/30 bg-green-500/5":"border-border hover:border-primary/30 hover:bg-hover"}`,children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${e.bgColor}`,children:r.jsx("span",{className:`text-sm font-bold ${e.color}`,children:e.initial})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:"text-sm font-semibold text-ink",children:e.name}),r.jsx("p",{className:"text-[11px] text-muted leading-snug mt-0.5",children:e.description})]}),r.jsx("div",{className:"flex-shrink-0",children:r.jsx("span",{className:`inline-block w-2.5 h-2.5 rounded-full ${t.connected?"bg-green-500":"bg-gray-300"}`,title:t.connected?"Connected":"Not connected"})})]}),t.connected?r.jsxs("div",{className:"mt-3 space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-green-600 font-medium",children:[r.jsx(kt,{size:14}),"Connected as ",t.user||"unknown"]}),t.last_deployed&&r.jsxs("p",{className:"text-[11px] text-muted",children:["Last deployed: ",new Date(t.last_deployed).toLocaleString()]}),r.jsx(he,{variant:"danger",size:"sm",icon:Hu,onClick:h,loading:a,className:"w-full",children:"Disconnect"})]}):r.jsx(r.Fragment,{children:e.hasTokenAuth?r.jsxs(r.Fragment,{children:[!n&&r.jsx("div",{className:"mt-3",children:r.jsxs(he,{variant:"secondary",size:"sm",onClick:()=>o(!0),className:"w-full",children:["Connect ",e.name]})}),n&&r.jsx(dx,{platform:e,onConnect:c})]}):r.jsx(ux,{})})]})}function mx({compact:e=!1,onStatusChange:t}){const[s,i]=d.useState({vercel:{connected:!1},netlify:{connected:!1},github:{connected:!1}}),[n,o]=d.useState(!0),[a,l]=d.useState(null),h=d.useCallback(async()=>{try{const p=await W.getDeployStatus();i(p),t==null||t(p),l(null)}catch(p){l(p instanceof Error?p.message:"Failed to fetch connection status")}finally{o(!1)}},[t]);d.useEffect(()=>{h();const p=setInterval(h,3e4);return()=>clearInterval(p)},[h]);const c=d.useCallback(async p=>{const g=await W.connectVercel(p);g.success&&(i(v=>({...v,vercel:{connected:!0,user:g.user}})),t==null||t({...s,vercel:{connected:!0,user:g.user}}))},[s,t]),u=d.useCallback(async p=>{const g=await W.connectNetlify(p);g.success&&(i(v=>({...v,netlify:{connected:!0,user:g.user}})),t==null||t({...s,netlify:{connected:!0,user:g.user}}))},[s,t]),m=d.useCallback(async p=>{await W.disconnectPlatform(p),i(v=>({...v,[p]:{connected:!1}}));const g={...s,[p]:{connected:!1}};t==null||t(g)},[s,t]),f={vercel:c,netlify:u,github:async()=>{}};if(n)return r.jsxs("div",{className:"flex items-center justify-center py-8",children:[r.jsx(mi,{size:20,className:"text-primary animate-spin"}),r.jsx("span",{className:"text-sm text-muted ml-2",children:"Loading connections..."})]});const _=[s.vercel,s.netlify,s.github].filter(p=>p.connected).length;return r.jsxs("div",{className:e?"space-y-3":"space-y-4",children:[!e&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Platform Connections"}),r.jsxs("p",{className:"text-[11px] text-muted mt-0.5",children:[_," of ",Gr.length," platforms connected"]})]}),r.jsx("button",{onClick:h,className:"p-1.5 text-muted hover:text-ink rounded transition-colors",title:"Refresh connection status",children:r.jsx(gt,{size:14})})]}),e&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"flex items-center gap-3",children:Gr.map(p=>{const g=s[p.id];return r.jsxs("div",{className:"flex items-center gap-1.5",title:`${p.name}: ${g.connected?`Connected as ${g.user}`:"Not connected"}`,children:[r.jsx("span",{className:`w-2 h-2 rounded-full ${g.connected?"bg-green-500":"bg-gray-300"}`}),r.jsx("span",{className:"text-[11px] text-muted",children:p.name})]},p.id)})}),r.jsx("button",{onClick:h,className:"p-1 text-muted hover:text-ink rounded transition-colors",title:"Refresh",children:r.jsx(gt,{size:12})})]}),a&&r.jsxs("div",{className:"flex items-center gap-2 bg-red-500/5 border border-red-500/15 rounded-lg px-3 py-2",children:[r.jsx(Rs,{size:14,className:"text-red-500 flex-shrink-0"}),r.jsx("span",{className:"text-xs text-red-600",children:a})]}),r.jsx("div",{className:e?"space-y-2":"space-y-3",children:Gr.map(p=>r.jsx(fx,{platform:p,status:s[p.id],onConnect:f[p.id],onDisconnect:()=>m(p.id)},p.id))})]})}const px=[{id:"vercel",name:"Vercel",description:"Optimized for Next.js, React, and static sites. Global CDN with instant rollbacks.",icon:en,color:"text-ink",bgColor:"bg-ink/5",connectionKey:"vercel"},{id:"netlify",name:"Netlify",description:"Deploy with CI/CD, serverless functions, and form handling built in.",icon:en,color:"text-teal-600",bgColor:"bg-teal-500/5",connectionKey:"netlify"},{id:"github-pages",name:"GitHub Pages",description:"Free hosting for static sites directly from a GitHub repository.",icon:ze,color:"text-purple-600",bgColor:"bg-purple-500/5",connectionKey:"github"}];function gx({platform:e,deployState:t,onDeploy:s,disabled:i,connected:n}){const[o,a]=d.useState(!1),l=e.icon,h=d.useCallback(async()=>{if(t.url)try{await navigator.clipboard.writeText(t.url),a(!0),setTimeout(()=>a(!1),2e3)}catch{}},[t.url]),c=i||!n;return r.jsxs("div",{className:`border border-border rounded-lg p-4 transition-colors ${t.status==="success"?"border-green-500/30 bg-green-500/5":t.status==="error"?"border-red-500/30 bg-red-500/5":n?"hover:border-primary/30 hover:bg-hover":"opacity-60"}`,children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${e.bgColor}`,children:r.jsx(l,{size:20,className:e.color})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:"text-sm font-semibold text-ink",children:e.name}),r.jsx("p",{className:"text-[11px] text-muted leading-snug mt-0.5",children:e.description})]}),r.jsx("span",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${n?"bg-green-500":"bg-gray-300"}`,title:n?"Connected":"Not connected"})]}),t.status==="idle"&&r.jsxs("div",{className:"relative group",children:[r.jsxs(he,{variant:"secondary",size:"sm",icon:$t,onClick:s,disabled:c,className:"w-full",children:["Deploy to ",e.name]}),!n&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:r.jsxs("span",{className:"bg-ink text-white text-[10px] px-2 py-1 rounded shadow opacity-0 group-hover:opacity-100 transition-opacity",children:["Connect ",e.name," first"]})})]}),t.status==="deploying"&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-btn bg-primary/5 border border-primary/20",children:[r.jsx(mi,{size:14,className:"text-primary animate-spin"}),r.jsxs("span",{className:"text-xs font-medium text-primary",children:["Deploying to ",e.name,"..."]})]}),t.status==="success"&&t.url&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-green-600 font-medium",children:[r.jsx(kt,{size:14}),"Deployed successfully"]}),r.jsxs("div",{className:"flex items-center gap-1.5 bg-card border border-border rounded-btn px-3 py-2",children:[r.jsx(en,{size:12,className:"text-muted flex-shrink-0"}),r.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-mono text-primary hover:underline truncate flex-1",children:t.url}),r.jsxs("button",{onClick:h,className:"flex items-center gap-1 text-[11px] text-muted hover:text-ink transition-colors flex-shrink-0",title:"Copy URL",children:[o?r.jsx(Ut,{size:12,className:"text-green-500"}):r.jsx(Qn,{size:12}),o?"Copied":"Copy"]}),r.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"text-muted hover:text-ink transition-colors flex-shrink-0",title:"Open in new tab",children:r.jsx(ss,{size:12})})]})]}),t.status==="error"&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-red-500 font-medium",children:[r.jsx(Rs,{size:14}),"Deploy failed"]}),r.jsx("p",{className:"text-[11px] text-muted bg-red-500/5 border border-red-500/10 rounded px-2 py-1.5 font-mono",children:t.error||"Unknown error"}),r.jsx(he,{variant:"secondary",size:"sm",icon:$t,onClick:s,disabled:c,className:"w-full",children:"Retry"})]})]})}function _x({sessionId:e,disabled:t}){const[s,i]=d.useState({status:"idle"}),[n,o]=d.useState(!1),a=d.useCallback(async()=>{i({status:"pushing"});try{const h=await W.githubPush(e);h.repo_url?i({status:"success",repoUrl:h.repo_url}):i({status:"error",error:h.error||"Push failed"})}catch(h){i({status:"error",error:h instanceof Error?h.message:"Push failed"})}},[e]),l=d.useCallback(async()=>{if(s.repoUrl)try{await navigator.clipboard.writeText(s.repoUrl),o(!0),setTimeout(()=>o(!1),2e3)}catch{}},[s.repoUrl]);return r.jsxs("div",{className:"border border-border rounded-lg p-4",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center bg-ink/5",children:r.jsx(ze,{size:20,className:"text-ink"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Push to GitHub"}),r.jsx("p",{className:"text-[11px] text-muted leading-snug mt-0.5",children:"Create a repository and push your code to GitHub."})]})]}),s.status==="idle"&&r.jsx(he,{variant:"secondary",size:"sm",icon:ze,onClick:a,disabled:t,className:"w-full",children:"Create Repo + Push"}),s.status==="pushing"&&r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-btn bg-primary/5 border border-primary/20",children:[r.jsx(mi,{size:14,className:"text-primary animate-spin"}),r.jsx("span",{className:"text-xs font-medium text-primary",children:"Creating repository and pushing..."})]}),s.status==="success"&&s.repoUrl&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-green-600 font-medium",children:[r.jsx(kt,{size:14}),"Pushed to GitHub"]}),r.jsxs("div",{className:"flex items-center gap-1.5 bg-card border border-border rounded-btn px-3 py-2",children:[r.jsx(ze,{size:12,className:"text-muted flex-shrink-0"}),r.jsx("a",{href:s.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-mono text-primary hover:underline truncate flex-1",children:s.repoUrl}),r.jsxs("button",{onClick:l,className:"flex items-center gap-1 text-[11px] text-muted hover:text-ink transition-colors flex-shrink-0",title:"Copy URL",children:[n?r.jsx(Ut,{size:12,className:"text-green-500"}):r.jsx(Qn,{size:12}),n?"Copied":"Copy"]})]})]}),s.status==="error"&&r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-red-500 font-medium",children:[r.jsx(Rs,{size:14}),"Push failed"]}),r.jsx("p",{className:"text-[11px] text-muted bg-red-500/5 border border-red-500/10 rounded px-2 py-1.5 font-mono",children:s.error}),r.jsx(he,{variant:"secondary",size:"sm",icon:ze,onClick:a,disabled:t,className:"w-full",children:"Retry"})]})]})}function xx({sessionId:e}){const[t,s]=d.useState({vercel:{status:"idle"},netlify:{status:"idle"},"github-pages":{status:"idle"}}),[i,n]=d.useState({vercel:{connected:!1},netlify:{connected:!1},github:{connected:!1}}),[o,a]=d.useState(!1),l=Object.values(t).some(u=>u.status==="deploying"),h=d.useCallback(async u=>{s(m=>({...m,[u]:{status:"deploying"}}));try{const m=await W.deployProject(e,u);m.url?s(f=>({...f,[u]:{status:"success",url:m.url}})):s(f=>({...f,[u]:{status:"error",error:m.error||"Deploy failed"}}))}catch(m){s(f=>({...f,[u]:{status:"error",error:m instanceof Error?m.message:"Deploy failed"}}))}},[e]),c=u=>{var m;return((m=i[u.connectionKey])==null?void 0:m.connected)??!1};return r.jsx("div",{className:"h-full overflow-y-auto terminal-scroll",children:r.jsxs("div",{className:"p-6 max-w-2xl mx-auto space-y-6",children:[r.jsxs("div",{children:[r.jsxs("h3",{className:"text-lg font-heading font-bold text-ink flex items-center gap-2",children:[r.jsx($t,{size:20,className:"text-primary"}),"Deploy Your Project"]}),r.jsx("p",{className:"text-xs text-muted mt-1",children:"Choose a platform to deploy your project. One click to go live."})]}),r.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[r.jsxs("button",{type:"button",onClick:()=>a(!o),className:"flex items-center justify-between w-full px-4 py-3 text-left hover:bg-hover transition-colors",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ac,{size:16,className:"text-primary"}),r.jsx("span",{className:"text-sm font-medium text-ink",children:"Platform Connections"}),r.jsx("div",{className:"flex items-center gap-1 ml-2",children:["vercel","netlify","github"].map(u=>{var m,f;return r.jsx("span",{className:`w-2 h-2 rounded-full ${(m=i[u])!=null&&m.connected?"bg-green-500":"bg-gray-300"}`,title:`${u}: ${(f=i[u])!=null&&f.connected?"Connected":"Not connected"}`},u)})})]}),r.jsx("span",{className:"text-xs text-muted",children:o?"Hide":"Manage"})]}),o&&r.jsx("div",{className:"border-t border-border p-4",children:r.jsx(mx,{compact:!0,onStatusChange:n})})]}),r.jsx("div",{className:"space-y-3",children:px.map(u=>r.jsx(gx,{platform:u,deployState:t[u.id],onDeploy:()=>h(u.id),disabled:l,connected:c(u)},u.id))}),r.jsx("div",{className:"border-t border-border"}),r.jsx(_x,{sessionId:e,disabled:l})]})})}const Sh=typeof navigator<"u"&&/Mac/.test(navigator.userAgent),wt=Sh?"Cmd":"Ctrl",Rl=[{keys:[`${wt}+K`],label:"Open Command Palette",category:"navigation"},{keys:[`${wt}+P`],label:"Quick open file",category:"navigation"},{keys:[`${wt}+,`],label:"Open settings",category:"navigation"},{keys:[`${wt}+S`],label:"Save file",category:"editor"},{keys:[`${wt}+Z`],label:"Undo",category:"editor"},{keys:[`${wt}+Shift+Z`],label:"Redo",category:"editor"},{keys:[`${wt}+B`],label:"Start / stop build",category:"build"},{keys:[`${wt}+\``],label:"Toggle terminal",category:"build"},{keys:["?"],label:"Show keyboard shortcuts",category:"general"},{keys:[`${wt}+?`],label:"Show keyboard shortcuts (alt)",category:"general"},{keys:["Escape"],label:"Close modals",category:"general"}],vx={navigation:"Navigation",editor:"Editor",build:"Build",general:"General"},bx=["navigation","editor","build","general"];function yx({onToggleTerminal:e,onToggleBuild:t}){const[s,i]=d.useState(!1),n=d.useCallback(o=>{var c,u;const a=Sh?o.metaKey:o.ctrlKey,l=(c=o.target)==null?void 0:c.tagName,h=l==="INPUT"||l==="TEXTAREA"||((u=o.target)==null?void 0:u.isContentEditable);if(a&&(o.key==="?"||o.shiftKey&&o.key==="/")){o.preventDefault(),i(m=>!m);return}if(o.key==="?"&&!a&&!h){o.preventDefault(),i(m=>!m);return}if(a&&o.key==="`"){o.preventDefault(),e==null||e();return}if(a&&o.key==="b"){o.preventDefault(),t==null||t();return}o.key==="Escape"&&s&&i(!1)},[e,t,s]);return d.useEffect(()=>(window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)),[n]),{showHelp:s,setShowHelp:i}}function Sx({open:e,onClose:t}){const[s,i]=d.useState("");d.useEffect(()=>{e&&i("")},[e]);const n=d.useMemo(()=>{if(!s.trim())return Rl;const a=s.toLowerCase();return Rl.filter(l=>l.label.toLowerCase().includes(a)||l.keys.some(h=>h.toLowerCase().includes(a))||l.category.toLowerCase().includes(a))},[s]),o=d.useMemo(()=>{const a={};for(const l of n)a[l.category]||(a[l.category]=[]),a[l.category].push(l);return a},[n]);return e?r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/20",onClick:t,children:r.jsxs("div",{className:"bg-card rounded-xl shadow-2xl border border-border w-full max-w-md mx-4 overflow-hidden",onClick:a=>a.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(xd,{size:16,className:"text-primary"}),r.jsx("h2",{className:"text-sm font-heading font-bold text-ink",children:"Keyboard Shortcuts"})]}),r.jsx("button",{onClick:t,className:"text-muted hover:text-ink transition-colors p-1 rounded-btn hover:bg-hover",children:r.jsx(ft,{size:16})})]}),r.jsx("div",{className:"px-4 py-2 border-b border-border",children:r.jsxs("div",{className:"relative",children:[r.jsx(ts,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted"}),r.jsx("input",{type:"text",value:s,onChange:a=>i(a.target.value),placeholder:"Filter shortcuts...",className:"w-full pl-9 pr-3 py-1.5 text-xs bg-card border border-border rounded-btn outline-none focus:border-primary transition-colors",autoFocus:!0})]})}),r.jsxs("div",{className:"max-h-[400px] overflow-y-auto terminal-scroll",children:[bx.map(a=>{const l=o[a];return!l||l.length===0?null:r.jsxs("div",{children:[r.jsx("div",{className:"px-5 pt-3 pb-1",children:r.jsx("span",{className:"text-[10px] font-semibold text-muted uppercase tracking-wider",children:vx[a]})}),r.jsx("div",{className:"px-4 space-y-0.5 pb-2",children:l.map(h=>r.jsxs("div",{className:"flex items-center justify-between px-2 py-2 rounded-btn hover:bg-hover",children:[r.jsx("span",{className:"text-xs text-ink",children:h.label}),r.jsx("div",{className:"flex items-center gap-1",children:h.keys.map(c=>r.jsx("kbd",{className:"px-2 py-0.5 text-[11px] font-mono bg-hover border border-border rounded text-muted-accessible",children:c},c))})]},h.label))})]},a)}),n.length===0&&r.jsx("div",{className:"px-5 py-8 text-center",children:r.jsxs("p",{className:"text-xs text-muted",children:['No shortcuts matching "',s,'"']})})]}),r.jsx("div",{className:"px-5 py-3 border-t border-border text-center",children:r.jsxs("span",{className:"text-[11px] text-muted",children:["Press ",r.jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-hover border border-border rounded",children:"Escape"})," to close"]})})]})}):null}function wx({onClick:e}){return r.jsx("button",{onClick:e,title:"Keyboard shortcuts",className:"inline-flex items-center justify-center w-7 h-7 rounded-btn text-muted hover:text-ink hover:bg-hover transition-colors text-xs font-bold",children:"?"})}const wh="pl_recent_commands",Cx=5;function Ch(){try{const e=localStorage.getItem(wh);return e?JSON.parse(e):[]}catch{return[]}}function Yr(e){try{const t=Ch().filter(s=>s!==e);t.unshift(e),localStorage.setItem(wh,JSON.stringify(t.slice(0,Cx)))}catch{}}function kx(e){var i;const t=((i=e.split(".").pop())==null?void 0:i.toLowerCase())||"";return{js:Z,ts:Z,tsx:Z,jsx:Z,py:Z,go:Z,rs:Z,rb:Z,sh:Z,html:nc,css:so,json:to,md:fi}[t]||io}function Nx(e,t){const s=e.toLowerCase(),i=t.toLowerCase(),n=[];let o=0;for(let a=0;a<i.length&&o<s.length;a++)i[a]===s[o]&&(n.push(a),o++);return o===s.length?n:null}function Pl({text:e,indices:t}){if(t.length===0)return r.jsx(r.Fragment,{children:e});const s=new Set(t);return r.jsx(r.Fragment,{children:e.split("").map((i,n)=>s.has(n)?r.jsx("span",{className:"text-primary font-semibold",children:i},n):r.jsx("span",{children:i},n))})}function jx({isOpen:e,onClose:t,commands:s,sessionId:i,onFileSelect:n}){const[o,a]=d.useState(""),[l,h]=d.useState(0),[c,u]=d.useState([]),[m,f]=d.useState(!1),_=d.useRef(null),p=d.useRef(null),g=vd(e);bd(e,t),d.useEffect(()=>{e&&(a(""),h(0),u([]),f(!1),setTimeout(()=>{var S;return(S=_.current)==null?void 0:S.focus()},50))},[e]);const v=d.useMemo(()=>Ch().map(j=>s.find(C=>C.id===j)).filter(Boolean),[s]),y=d.useMemo(()=>{if(!o.trim())return s.map(j=>({cmd:j,indices:[]}));const S=[];for(const j of s){const C=Nx(o,j.label);if(C){const B=C[0]*10+(C[C.length-1]-C[0]);S.push({cmd:j,indices:C,score:B})}}return S.sort((j,C)=>j.score-C.score),S.map(j=>({cmd:j.cmd,indices:j.indices}))},[s,o]),x=d.useMemo(()=>o.trim()?y.filter(S=>S.cmd.category==="setting"):[],[y,o]),k=d.useMemo(()=>y.filter(S=>S.cmd.category!=="setting"),[y]);d.useEffect(()=>{if(!i||!o.trim()){u([]),f(!1);return}return f(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(async()=>{try{const S=await W.searchFiles(i,o);u(S.filter(j=>j.type==="file"))}catch{u([])}f(!1)},200),()=>{p.current&&clearTimeout(p.current)}},[o,i]);const N=!o.trim()&&v.length>0,w=d.useMemo(()=>{const S=[];return N&&v.forEach((j,C)=>S.push({type:"recent",index:C})),k.forEach((j,C)=>S.push({type:"command",index:C})),x.length>0&&x.forEach((j,C)=>S.push({type:"setting",index:C})),c.forEach((j,C)=>S.push({type:"file",index:C})),S},[N,v,k,x,c]),D=w.length;d.useEffect(()=>{h(0)},[o]);const T=d.useCallback(S=>{const j=w[S];if(j){if(j.type==="recent"){const C=v[j.index];C&&(Yr(C.id),C.action(),t())}else if(j.type==="command"){const C=k[j.index];C&&(Yr(C.cmd.id),C.cmd.action(),t())}else if(j.type==="setting"){const C=x[j.index];C&&(Yr(C.cmd.id),C.cmd.action(),t())}else if(j.type==="file"){const C=c[j.index];C&&n&&(n(C.path,C.name),t())}}},[w,v,k,x,c,n,t]),U=d.useCallback(S=>{S.key==="ArrowDown"?(S.preventDefault(),h(j=>Math.min(j+1,D-1))):S.key==="ArrowUp"?(S.preventDefault(),h(j=>Math.max(j-1,0))):S.key==="Enter"&&D>0?T(l):S.key==="Escape"&&t()},[D,l,T,t]);if(!e)return null;let G=0;const K=()=>G++,A=k.length>0,M=x.length>0,E=c.length>0,L=m&&o.trim().length>0;return r.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",onClick:t,children:[r.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),r.jsxs("div",{ref:g,className:"relative w-full max-w-lg bg-card rounded-xl shadow-2xl border border-border overflow-hidden",onClick:S=>S.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border",children:[r.jsx(ts,{size:18,className:"text-muted"}),r.jsx("input",{ref:_,value:o,onChange:S=>a(S.target.value),onKeyDown:U,placeholder:"Search commands, files, settings...",className:"flex-1 bg-transparent text-sm outline-none text-ink placeholder:text-muted"}),r.jsx("kbd",{className:"text-[10px] text-muted bg-hover px-1.5 py-0.5 rounded border border-border font-mono",children:"ESC"})]}),r.jsxs("div",{className:"max-h-[360px] overflow-y-auto py-1 terminal-scroll",children:[N&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"px-4 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider flex items-center gap-1.5",children:[r.jsx(nt,{size:10})," Recent"]}),v.map((S,j)=>{const C=K(),B=S.icon;return r.jsxs("button",{onClick:()=>T(C),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors ${C===l?"bg-primary/10 text-primary":"text-ink hover:bg-hover"}`,children:[r.jsx(B,{size:16}),r.jsx("span",{className:"flex-1 text-left",children:S.label}),S.shortcut&&r.jsx("kbd",{className:"text-[10px] text-muted bg-hover px-1.5 py-0.5 rounded border border-border font-mono",children:S.shortcut})]},`recent-${S.id}`)})]}),A&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider",children:"Commands"}),k.map((S,j)=>{const C=K(),B=S.cmd.icon;return r.jsxs("button",{onClick:()=>T(C),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors ${C===l?"bg-primary/10 text-primary":"text-ink hover:bg-hover"}`,children:[r.jsx(B,{size:16}),r.jsx("span",{className:"flex-1 text-left",children:o.trim()?r.jsx(Pl,{text:S.cmd.label,indices:S.indices}):S.cmd.label}),S.cmd.shortcut&&r.jsx("kbd",{className:"text-[10px] text-muted bg-hover px-1.5 py-0.5 rounded border border-border font-mono",children:S.cmd.shortcut})]},S.cmd.id)})]}),M&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider mt-1",children:"Settings"}),x.map((S,j)=>{const C=K(),B=S.cmd.icon;return r.jsxs("button",{onClick:()=>T(C),className:`w-full flex items-center gap-3 px-4 py-2.5 text-sm transition-colors ${C===l?"bg-primary/10 text-primary":"text-ink hover:bg-hover"}`,children:[r.jsx(B,{size:16}),r.jsx("span",{className:"flex-1 text-left",children:r.jsx(Pl,{text:S.cmd.label,indices:S.indices})}),S.cmd.shortcut&&r.jsx("kbd",{className:"text-[10px] text-muted bg-hover px-1.5 py-0.5 rounded border border-border font-mono",children:S.cmd.shortcut})]},`setting-${S.cmd.id}`)})]}),E&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-4 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider mt-1",children:"Files"}),c.map((S,j)=>{const C=K(),B=S.type==="directory"?ro:kx(S.name);return r.jsxs("button",{onClick:()=>T(C),className:`w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors ${C===l?"bg-primary/10 text-primary":"text-ink hover:bg-hover"}`,children:[r.jsx(B,{size:14}),r.jsx("span",{className:"flex-1 text-left font-mono text-xs truncate",children:S.name}),r.jsx("span",{className:"text-[10px] text-muted truncate max-w-[200px]",children:S.path})]},`file-${S.path}`)})]}),L&&!E&&r.jsx("div",{className:"px-4 py-2 text-xs text-muted animate-pulse",children:"Searching files..."}),D===0&&!L&&r.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted",children:"No results found"})]})]})]})}const Ex=d.lazy(()=>Jn(()=>import("./GitHubIssuesPanel-WDbH47UM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32])).then(e=>({default:e.GitHubIssuesPanel}))),Dx=d.lazy(()=>Jn(()=>import("./GitHubPRsPanel-C2CiYtTx.js"),__vite__mapDeps([33,1,2,3,34,4,5,35,12,14,17,9,10,11,13,15,16,8,18,19,20,21,22,23,24,25,7,26,27,28,29,30,31,32])).then(e=>({default:e.GitHubPRsPanel}))),Rx=d.lazy(()=>Jn(()=>Promise.resolve().then(()=>Gx),void 0).then(e=>({default:e.CICDPanel}))),Px=3e4,Mx={modified:r.jsx(Z,{size:13,className:"text-yellow-500"}),added:r.jsx(fr,{size:13,className:"text-green-500"}),deleted:r.jsx(eo,{size:13,className:"text-red-400"}),renamed:r.jsx(Z,{size:13,className:"text-blue-400"}),untracked:r.jsx(oc,{size:13,className:"text-muted"})},Lx={modified:"M",added:"A",deleted:"D",renamed:"R",untracked:"?"};function Bx({commit:e}){return r.jsx("div",{className:"px-3 py-2 border-b border-border hover:bg-hover transition-colors",children:r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(ec,{size:14,className:"text-primary mt-0.5 flex-shrink-0"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("p",{className:"text-xs font-medium text-ink truncate",children:e.message}),r.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[r.jsx("span",{className:"text-[11px] font-mono text-primary/70",children:e.short_hash}),r.jsx("span",{className:"text-[11px] text-muted",children:e.author}),r.jsx("span",{className:"text-[11px] text-muted ml-auto flex-shrink-0",children:e.date})]}),e.refs.length>0&&r.jsx("div",{className:"flex gap-1 mt-1",children:e.refs.map((t,s)=>r.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 text-[10px] font-mono bg-primary/10 text-primary rounded",children:[r.jsx(ze,{size:9}),t]},s))})]})]})})}function Ml({file:e}){return r.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 hover:bg-hover transition-colors text-xs",children:[Mx[e.status]||r.jsx(oc,{size:13}),r.jsx("span",{className:"font-mono text-ink truncate flex-1",children:e.path}),r.jsx("span",{className:`font-mono text-[10px] px-1 rounded ${e.staged?"bg-green-500/10 text-green-500":"bg-muted/10 text-muted"}`,children:Lx[e.status]||"?"})]})}function Tx({sessionId:e}){const[t,s]=d.useState("changes"),[i,n]=d.useState(null),[o,a]=d.useState([]),[l,h]=d.useState([]),[c,u]=d.useState(!0),[m,f]=d.useState(null),[_,p]=d.useState(""),[g,v]=d.useState(!1),[y,x]=d.useState(null),[k,N]=d.useState(!1),[w,D]=d.useState(""),[T,U]=d.useState(!1),[G,K]=d.useState(!1),[A,M]=d.useState(""),[E,L]=d.useState(""),[S,j]=d.useState(!1),[C,B]=d.useState(null),[X,oe]=d.useState(!1),q=d.useCallback(async()=>{u(!0),f(null);try{const[R,le,_e]=await Promise.all([W.git.status(e),W.git.log(e),W.git.branches(e)]);n(R),a(le),h(_e)}catch(R){f(R instanceof Error?R.message:"Failed to load git data")}u(!1)},[e]);d.useEffect(()=>{q()},[q]);const Q=async()=>{if(!(!_.trim()||g)){v(!0),x(null);try{const R=await W.git.commit(e,_.trim());x(`Committed: ${R.hash}`),p(""),await q()}catch(R){x(`Error: ${R instanceof Error?R.message:"Commit failed"}`)}v(!1)}},ie=async()=>{if(!(!w.trim()||T)){U(!0);try{await W.git.createBranch(e,w.trim()),D(""),N(!1),await q()}catch(R){f(R instanceof Error?R.message:"Branch creation failed")}U(!1)}},de=async R=>{try{await W.git.checkoutBranch(e,R),await q()}catch(le){f(le instanceof Error?le.message:"Checkout failed")}},ue=async()=>{oe(!0);try{await W.git.push(e),await q()}catch(R){f(R instanceof Error?R.message:"Push failed")}oe(!1)},z=async()=>{if(!(!A.trim()||S)){j(!0),B(null);try{const R=await W.git.pr(e,A.trim(),E.trim());B(R.url),M(""),L(""),K(!1)}catch(R){B(`Error: ${R instanceof Error?R.message:"PR creation failed"}`)}j(!1)}},V=(i==null?void 0:i.files.filter(R=>R.staged))||[],J=(i==null?void 0:i.files.filter(R=>!R.staged))||[];return c&&!i?r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(gt,{size:20,className:"text-muted animate-spin"}),r.jsx("span",{className:"text-xs text-muted",children:"Loading git status..."})]})}):m&&!i?r.jsx("div",{className:"h-full flex items-center justify-center p-6",children:r.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[r.jsx(Rs,{size:32,className:"text-muted/40"}),r.jsx("p",{className:"text-sm text-muted",children:m}),r.jsx("p",{className:"text-xs text-muted/60",children:"This project may not be a git repository."}),r.jsx(he,{size:"sm",variant:"secondary",icon:gt,onClick:q,children:"Retry"})]})}):r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-hover flex-shrink-0",children:[r.jsx(ze,{size:14,className:"text-primary"}),r.jsx("span",{className:"text-xs font-semibold text-ink",children:(i==null?void 0:i.branch)||"unknown"}),i&&(i.ahead>0||i.behind>0)&&r.jsxs("span",{className:"text-[10px] text-muted font-mono",children:[i.ahead>0&&`+${i.ahead}`,i.ahead>0&&i.behind>0&&" / ",i.behind>0&&`-${i.behind}`]}),(i==null?void 0:i.clean)&&r.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-green-500",children:[r.jsx(Ut,{size:10})," Clean"]}),r.jsx("div",{className:"flex-1"}),r.jsx("button",{onClick:q,className:"p-1 text-muted hover:text-ink rounded transition-colors",title:"Refresh",children:r.jsx(gt,{size:13,className:c?"animate-spin":""})})]}),r.jsx("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border flex-shrink-0",children:[{id:"changes",label:"Changes",icon:Z,count:(i==null?void 0:i.files.length)||0},{id:"history",label:"History",icon:nt},{id:"branches",label:"Branches",icon:ze,count:l.length}].map(R=>r.jsxs("button",{onClick:()=>s(R.id),className:`flex items-center gap-1 px-2.5 py-1 text-[11px] font-medium rounded-btn transition-colors ${t===R.id?"bg-primary/10 text-primary":"text-muted hover:text-ink"}`,children:[r.jsx(R.icon,{size:12}),R.label,R.count!==void 0&&R.count>0&&r.jsx("span",{className:"ml-0.5 px-1 py-0 text-[9px] rounded-full bg-primary/20 text-primary font-mono",children:R.count})]},R.id))}),m&&r.jsx("div",{className:"px-3 py-2 bg-red-500/5 border-b border-red-500/20 text-xs text-red-400",children:m}),r.jsxs("div",{className:"flex-1 overflow-y-auto terminal-scroll",children:[t==="changes"&&r.jsx("div",{className:"flex flex-col h-full",children:(i==null?void 0:i.files.length)===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[r.jsx(Ut,{size:28,className:"text-green-500/30 mb-2"}),r.jsx("p",{className:"text-xs text-muted",children:"Working tree clean"}),r.jsx("p",{className:"text-[11px] text-muted/60 mt-0.5",children:"No changes to commit."})]}):r.jsxs(r.Fragment,{children:[V.length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"px-3 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider bg-green-500/5 border-b border-border",children:["Staged (",V.length,")"]}),V.map((R,le)=>r.jsx(Ml,{file:R},`s-${le}`))]}),J.length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"px-3 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider bg-yellow-500/5 border-b border-border",children:["Unstaged (",J.length,")"]}),J.map((R,le)=>r.jsx(Ml,{file:R},`u-${le}`))]}),r.jsxs("div",{className:"mt-auto border-t border-border p-3 space-y-2 flex-shrink-0",children:[r.jsx("textarea",{value:_,onChange:R=>p(R.target.value),placeholder:"Commit message...",rows:2,className:"w-full px-3 py-1.5 text-xs bg-card border border-border rounded-btn outline-none focus:border-primary transition-colors resize-none font-mono"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(he,{size:"sm",icon:ec,onClick:Q,disabled:!_.trim()||g,loading:g,children:"Commit"}),r.jsx(he,{size:"sm",variant:"secondary",icon:tc,onClick:ue,loading:X,disabled:X,children:"Push"}),r.jsx(he,{size:"sm",variant:"ghost",icon:rn,onClick:()=>K(!G),children:"PR"})]}),y&&r.jsx("p",{className:`text-[11px] font-mono ${y.startsWith("Error")?"text-red-400":"text-green-500"}`,children:y}),C&&r.jsx("p",{className:"text-[11px] font-mono text-primary",children:C.startsWith("Error")?r.jsx("span",{className:"text-red-400",children:C}):r.jsx("a",{href:C,target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-primary/80",children:C})})]}),G&&r.jsxs("div",{className:"border-t border-border p-3 space-y-2 flex-shrink-0 bg-hover",children:[r.jsx("p",{className:"text-[11px] font-semibold text-ink",children:"Create Pull Request"}),r.jsx("input",{value:A,onChange:R=>M(R.target.value),placeholder:"PR title...",className:"w-full px-3 py-1.5 text-xs bg-card border border-border rounded-btn outline-none focus:border-primary"}),r.jsx("textarea",{value:E,onChange:R=>L(R.target.value),placeholder:"PR description (optional)...",rows:3,className:"w-full px-3 py-1.5 text-xs bg-card border border-border rounded-btn outline-none focus:border-primary resize-none"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(he,{size:"sm",icon:rn,onClick:z,disabled:!A.trim()||S,loading:S,children:"Create PR"}),r.jsx(he,{size:"sm",variant:"ghost",onClick:()=>K(!1),children:"Cancel"})]})]})]})}),t==="history"&&r.jsx("div",{children:o.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[r.jsx(nt,{size:28,className:"text-muted/30 mb-2"}),r.jsx("p",{className:"text-xs text-muted",children:"No commits yet"})]}):o.map((R,le)=>r.jsx(Bx,{commit:R},le))}),t==="branches"&&r.jsxs("div",{children:[r.jsx("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:r.jsxs("button",{onClick:()=>N(!k),className:"flex items-center gap-1 text-xs text-primary hover:text-primary/80 font-medium",children:[r.jsx(mr,{size:12}),"New Branch"]})}),k&&r.jsxs("div",{className:"px-3 py-2 border-b border-border bg-hover flex items-center gap-2",children:[r.jsx("input",{value:w,onChange:R=>D(R.target.value),placeholder:"branch-name",className:"flex-1 px-2 py-1 text-xs font-mono bg-card border border-border rounded-btn outline-none focus:border-primary",onKeyDown:R=>{R.key==="Enter"&&ie()}}),r.jsx(he,{size:"sm",onClick:ie,disabled:!w.trim()||T,loading:T,children:"Create"})]}),l.length===0?r.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[r.jsx(ze,{size:28,className:"text-muted/30 mb-2"}),r.jsx("p",{className:"text-xs text-muted",children:"No branches found"})]}):r.jsxs("div",{children:[l.filter(R=>!R.remote).map((R,le)=>r.jsxs("button",{onClick:()=>!R.current&&de(R.name),disabled:R.current,className:`w-full text-left flex items-center gap-2 px-3 py-2 text-xs border-b border-border transition-colors ${R.current?"bg-primary/5":"hover:bg-hover cursor-pointer"}`,children:[r.jsx(ze,{size:13,className:R.current?"text-primary":"text-muted"}),r.jsx("span",{className:`font-mono ${R.current?"text-primary font-semibold":"text-ink"}`,children:R.name}),R.current&&r.jsx("span",{className:"ml-auto text-[10px] bg-primary/10 text-primary px-1.5 py-0.5 rounded font-medium",children:"current"})]},`l-${le}`)),l.filter(R=>R.remote).length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"px-3 py-1.5 text-[10px] font-semibold text-muted uppercase tracking-wider bg-hover border-b border-border",children:"Remote"}),l.filter(R=>R.remote).map((R,le)=>r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 text-xs border-b border-border",children:[r.jsx(ze,{size:13,className:"text-muted/60"}),r.jsx("span",{className:"font-mono text-muted",children:R.name})]},`r-${le}`))]})]})]})]})]})}function Xr(){return r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(gt,{size:20,className:"text-muted animate-spin"}),r.jsx("span",{className:"text-xs text-muted",children:"Loading..."})]})})}function Jr({sessionId:e,onPushed:t}){const[s,i]=d.useState(!1),[n,o]=d.useState(null),a=async()=>{i(!0),o(null);try{await W.githubPush(e),t()}catch(l){o(l instanceof Error?l.message:"Push to GitHub failed")}i(!1)};return r.jsx("div",{className:"h-full flex items-center justify-center p-8",children:r.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-xs",children:[r.jsx(lu,{size:40,className:"text-muted/30"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-ink",children:"This project isn't connected to GitHub yet"}),r.jsx("p",{className:"text-xs text-muted mt-1",children:"Push your project to GitHub to access issues, pull requests, and CI/CD workflows."})]}),r.jsx("div",{className:"flex items-center gap-2",children:r.jsx(he,{size:"sm",icon:tc,onClick:a,loading:s,children:"Push to GitHub"})}),n&&r.jsx("p",{className:"text-[11px] text-red-400 font-mono",children:n})]})})}function zx({sessionId:e}){const[t,s]=d.useState("changes"),[i,n]=d.useState(!0),[o,a]=d.useState(null),[l,h]=d.useState({issues:0,prs:0,actions:0,fetchedAt:0}),c=d.useRef(!1),u=d.useCallback(async()=>{n(!0);try{const g=await W.getStatus();a({has_remote:!0,repo:"",owner:""})}catch{a({has_remote:!1})}n(!1)},[e]);d.useEffect(()=>{u()},[u]);const m=d.useCallback(async()=>{if(!(!(o!=null&&o.has_remote)||Date.now()-l.fetchedAt<Px)&&!c.current){c.current=!0;try{const[v,y,x]=await Promise.allSettled([W.getGitHubIssues(e,"open",1),W.getGitHubPRs(e,"open",1),W.getWorkflowRuns(e,5)]);h({issues:v.status==="fulfilled"?v.value.length:0,prs:y.status==="fulfilled"?y.value.length:0,actions:x.status==="fulfilled"?x.value.filter(k=>k.status==="in_progress").length:0,fetchedAt:Date.now()})}catch{}c.current=!1}},[e,o==null?void 0:o.has_remote,l.fetchedAt]);if(d.useEffect(()=>{o!=null&&o.has_remote&&m()},[o==null?void 0:o.has_remote,m]),d.useEffect(()=>{["issues","prs","actions"].includes(t)&&(o!=null&&o.has_remote)&&m()},[t,o==null?void 0:o.has_remote,m]),i)return r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center gap-2",children:[r.jsx(gt,{size:20,className:"text-muted animate-spin"}),r.jsx("span",{className:"text-xs text-muted",children:"Checking GitHub connection..."})]})});const f=(o==null?void 0:o.has_remote)??!1,_=[{id:"changes",label:"Changes",icon:Z,requiresRemote:!1},{id:"issues",label:"Issues",icon:Yd,count:l.issues,requiresRemote:!0},{id:"prs",label:"PRs",icon:rn,count:l.prs,requiresRemote:!0},{id:"actions",label:"Actions",icon:It,count:l.actions,requiresRemote:!0}],p=_;return r.jsxs("div",{className:"h-full flex flex-col",children:[r.jsxs("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border bg-hover flex-shrink-0",children:[p.map(g=>{const v=g.requiresRemote&&!f;return r.jsxs("button",{onClick:()=>s(g.id),disabled:v,className:`flex items-center gap-1 px-2.5 py-1 text-[11px] font-medium rounded-btn transition-colors ${t===g.id?"bg-primary/10 text-primary":v?"text-muted/40 cursor-not-allowed":"text-muted hover:text-ink"}`,title:v?"Connect to GitHub to access this tab":void 0,children:[r.jsx(g.icon,{size:12}),g.label,g.count!==void 0&&g.count>0&&r.jsx("span",{className:"ml-0.5 px-1 py-0 text-[9px] rounded-full bg-primary/20 text-primary font-mono",children:g.count})]},g.id)}),f&&(o==null?void 0:o.owner)&&r.jsxs("div",{className:"ml-auto flex items-center gap-1 text-[10px] text-muted font-mono",children:[r.jsx(ac,{size:10}),o.owner,"/",o.repo]})]}),r.jsxs("div",{className:"flex-1 overflow-hidden",children:[t==="changes"&&r.jsx(Tx,{sessionId:e}),t==="issues"&&(f?r.jsx(d.Suspense,{fallback:r.jsx(Xr,{}),children:r.jsx(Ex,{sessionId:e})}):r.jsx(Jr,{sessionId:e,onPushed:u})),t==="prs"&&(f?r.jsx(d.Suspense,{fallback:r.jsx(Xr,{}),children:r.jsx(Dx,{sessionId:e})}):r.jsx(Jr,{sessionId:e,onPushed:u})),t==="actions"&&(f?r.jsx(d.Suspense,{fallback:r.jsx(Xr,{}),children:r.jsx("div",{className:"h-full overflow-y-auto p-4",children:r.jsx(Rx,{sessionId:e})})}):r.jsx(Jr,{sessionId:e,onPushed:u}))]})]})}function Ax({sessionId:e,onRestore:t}){const[s,i]=d.useState([]),[n,o]=d.useState(!0),[a,l]=d.useState(null),[h,c]=d.useState(null),[u,m]=d.useState(null),f=d.useCallback(async()=>{try{const g=await W.getCheckpoints(e);i(g),m(null)}catch{m("Failed to load checkpoints")}o(!1)},[e]);d.useEffect(()=>{f();const g=setInterval(f,15e3);return()=>clearInterval(g)},[f]);const _=d.useCallback(async g=>{if(a)return;const v=s.find(x=>x.id===g);if(!(!v||!window.confirm(`Restore to checkpoint "${v.description}"?
251
251
 
252
252
  This will revert files to this checkpoint state.`))){l(g);try{await W.restoreCheckpoint(e,g),await f(),t==null||t()}catch{m("Failed to restore checkpoint")}l(null)}},[e,s,a,f,t]);if(n)return r.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-card border-b border-border",children:[r.jsx(nn,{size:14,className:"text-muted animate-pulse"}),r.jsx("span",{className:"text-xs text-muted",children:"Loading checkpoints..."})]});if(u&&s.length===0||s.length===0)return null;const p=g=>{if(!g)return"";try{return new Date(g).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}};return r.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 bg-card border-b border-border overflow-x-auto",children:[r.jsx(nn,{size:14,className:"text-muted flex-shrink-0"}),r.jsx("span",{className:"text-[11px] font-medium text-muted flex-shrink-0",children:"Checkpoints"}),r.jsx("div",{className:"flex items-center gap-1 flex-1 min-w-0",children:s.map((g,v)=>r.jsxs("div",{className:"flex items-center gap-1",children:[v>0&&r.jsx("div",{className:"w-4 h-px bg-border flex-shrink-0"}),r.jsxs("div",{className:"relative flex-shrink-0",children:[r.jsx("button",{onClick:()=>_(g.id),onMouseEnter:()=>c(g.id),onMouseLeave:()=>c(null),disabled:a!==null,className:`w-3.5 h-3.5 rounded-full border-2 transition-all cursor-pointer ${g.is_current?"bg-primary border-primary shadow-sm shadow-primary/30":a===g.id?"bg-warning border-warning animate-pulse":"bg-card border-border hover:border-primary hover:bg-primary/10"} ${a!==null&&a!==g.id?"opacity-50":""}`,title:`${g.description} -- Click to restore`}),h===g.id&&r.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 z-50 pointer-events-none",children:[r.jsxs("div",{className:"bg-card border border-border rounded-lg shadow-lg px-3 py-2 whitespace-nowrap",children:[r.jsx("p",{className:"text-xs font-medium text-ink",children:g.description}),r.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[g.timestamp&&r.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted",children:[r.jsx(nt,{size:10}),p(g.timestamp)]}),g.files_changed>0&&r.jsxs("span",{className:"flex items-center gap-1 text-[11px] text-muted",children:[r.jsx(Z,{size:10}),g.files_changed," file",g.files_changed!==1?"s":""]}),g.iteration>0&&r.jsxs("span",{className:"text-[11px] text-muted",children:["Iter ",g.iteration]})]}),!g.is_current&&r.jsxs("div",{className:"flex items-center gap-1 mt-1.5 text-[11px] text-primary font-medium",children:[r.jsx(sc,{size:10}),"Click to restore"]}),g.is_current&&r.jsx("div",{className:"text-[11px] text-success mt-1",children:"Current"})]}),r.jsx("div",{className:"w-2 h-2 bg-card border-r border-b border-border rotate-45 mx-auto -mt-1"})]})]})]},g.id))}),u&&r.jsx("span",{className:"text-[11px] text-danger flex-shrink-0",children:u})]})}function Ox({line:e}){const t=e.type==="add"?"bg-success/10":e.type==="delete"?"bg-danger/10":"",s=e.type==="add"?"text-success":e.type==="delete"?"text-danger":"text-muted",i=e.type==="add"?"+":e.type==="delete"?"-":" ",n=e.type==="delete"?e.old_line:e.new_line;return r.jsxs("div",{className:`flex font-mono text-xs leading-5 ${t}`,children:[r.jsx("span",{className:"w-12 text-right pr-2 text-muted/60 select-none flex-shrink-0 border-r border-border",children:n||""}),r.jsx("span",{className:`w-5 text-center select-none flex-shrink-0 ${s} font-bold`,children:i}),r.jsx("span",{className:`flex-1 whitespace-pre-wrap break-all pl-1 ${e.type==="context"?"text-ink/70":s}`,children:e.content})]})}function $x({file:e,isSelected:t,onToggle:s}){const[i,n]=d.useState(!0),o=e.action==="add"?r.jsx(fr,{size:14,className:"text-success"}):e.action==="delete"?r.jsx(iu,{size:14,className:"text-danger"}):r.jsx(Z,{size:14,className:"text-blue-500"}),a=e.action==="add"?"New":e.action==="delete"?"Deleted":"Modified";return r.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-hover/50",children:[r.jsx("input",{type:"checkbox",checked:t,onChange:s,className:"w-3.5 h-3.5 rounded border-border accent-primary cursor-pointer"}),r.jsxs("button",{onClick:()=>n(l=>!l),className:"flex items-center gap-1 flex-1 min-w-0 text-left",children:[r.jsx(ur,{size:14,className:`text-muted transition-transform flex-shrink-0 ${i?"rotate-90":""}`}),o,r.jsx("span",{className:"text-xs font-mono text-ink truncate",children:e.path})]}),r.jsx("span",{className:`text-[11px] font-medium px-1.5 py-0.5 rounded ${e.action==="add"?"bg-success/10 text-success":e.action==="delete"?"bg-danger/10 text-danger":"bg-blue-500/10 text-blue-500"}`,children:a}),e.additions>0&&r.jsxs("span",{className:"flex items-center gap-0.5 text-[11px] text-success",children:[r.jsx(mr,{size:10}),e.additions]}),e.deletions>0&&r.jsxs("span",{className:"flex items-center gap-0.5 text-[11px] text-danger",children:[r.jsx(ic,{size:10}),e.deletions]})]}),i&&e.hunks.length>0&&r.jsx("div",{className:"border-t border-border max-h-[300px] overflow-y-auto terminal-scroll",children:e.hunks.map((l,h)=>r.jsxs("div",{children:[h>0&&r.jsxs("div",{className:"px-3 py-1 bg-hover/30 text-[11px] text-muted font-mono border-y border-border",children:["@@ -",l.old_start,",",l.old_count," +",l.new_start,",",l.new_count," @@"]}),l.lines.map((c,u)=>r.jsx(Ox,{line:c},`${h}-${u}`))]},h))})]})}function Ix({data:e,onAcceptAll:t,onAcceptSelected:s,onReject:i,onClose:n}){const[o,a]=d.useState(()=>new Set(e.files.map(f=>f.path))),[l,h]=d.useState(0),c=d.useCallback(f=>{a(_=>{const p=new Set(_);return p.has(f)?p.delete(f):p.add(f),p})},[]),u=d.useCallback(()=>{o.size===e.files.length?a(new Set):a(new Set(e.files.map(f=>f.path)))},[o.size,e.files]),m=d.useCallback(()=>{s(Array.from(o))},[o,s]);return e.files.length===0?r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",onClick:n,children:[r.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),r.jsxs("div",{className:"relative bg-card rounded-xl shadow-2xl border border-border p-8 max-w-md",onClick:f=>f.stopPropagation(),children:[r.jsx("p",{className:"text-sm text-ink text-center",children:"No pending changes to preview."}),r.jsx("button",{onClick:n,className:"mt-4 w-full py-2 text-sm font-medium rounded-btn border border-border text-muted hover:text-ink hover:bg-hover transition-colors",children:"Close"})]})]}):r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:n,children:[r.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),r.jsxs("div",{className:"relative bg-card rounded-xl shadow-2xl border border-border w-full max-w-5xl max-h-[85vh] flex flex-col overflow-hidden",onClick:f=>f.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border flex-shrink-0",children:[r.jsx(Z,{size:18,className:"text-primary"}),r.jsx("h3",{className:"text-sm font-bold text-ink flex-1",children:"Change Preview"}),r.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:[r.jsxs("span",{className:"flex items-center gap-1 text-success",children:[r.jsx(mr,{size:12}),e.total_additions]}),r.jsxs("span",{className:"flex items-center gap-1 text-danger",children:[r.jsx(ic,{size:12}),e.total_deletions]}),r.jsxs("span",{children:[e.files.length," file",e.files.length!==1?"s":""]})]}),r.jsx("button",{onClick:n,className:"p-1 rounded hover:bg-hover text-muted hover:text-ink transition-colors",children:r.jsx(ft,{size:16})})]}),r.jsxs("div",{className:"flex flex-1 min-h-0",children:[r.jsxs("div",{className:"w-56 flex-shrink-0 border-r border-border overflow-y-auto terminal-scroll bg-hover/30",children:[r.jsx("div",{className:"px-3 py-2 border-b border-border",children:r.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:o.size===e.files.length,onChange:u,className:"w-3.5 h-3.5 rounded border-border accent-primary"}),r.jsx("span",{className:"text-[11px] font-medium text-muted",children:"Select All"})]})}),e.files.map((f,_)=>{const p=f.action==="add"?"text-success":f.action==="delete"?"text-danger":"text-blue-500";return r.jsxs("button",{onClick:()=>h(_),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left transition-colors ${_===l?"bg-primary/10 text-primary":"text-ink hover:bg-hover"}`,children:[r.jsx("input",{type:"checkbox",checked:o.has(f.path),onChange:()=>c(f.path),onClick:g=>g.stopPropagation(),className:"w-3 h-3 rounded border-border accent-primary flex-shrink-0"}),r.jsx("span",{className:"text-xs font-mono truncate flex-1",children:f.path.split("/").pop()}),r.jsx("span",{className:`text-[10px] flex-shrink-0 ${p}`,children:f.action==="add"?"+":f.action==="delete"?"-":"M"})]},f.path)})]}),r.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 terminal-scroll",children:e.files[l]&&r.jsx($x,{file:e.files[l],isSelected:o.has(e.files[l].path),onToggle:()=>c(e.files[l].path)})})]}),r.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-t border-border bg-hover/30 flex-shrink-0",children:[r.jsxs("button",{onClick:i,className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-btn border border-danger/30 text-danger hover:bg-danger/10 transition-colors",children:[r.jsx(rc,{size:14}),"Reject"]}),r.jsx("div",{className:"flex-1"}),r.jsxs("button",{onClick:m,disabled:o.size===0,className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-btn border border-primary/30 text-primary hover:bg-primary/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[r.jsx(Ut,{size:14}),"Accept Selected (",o.size,")"]}),r.jsxs("button",{onClick:t,className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium rounded-btn bg-primary text-white hover:bg-primary-hover transition-colors",children:[r.jsx(Vd,{size:14}),"Accept All"]})]})]})]})}function Ji(e){if(e.status==="completed")switch(e.conclusion){case"success":return"success";case"failure":return"failed";case"cancelled":return"cancelled";case"skipped":return"skipped";case"timed_out":return"failed";default:return"failed"}return e.status==="in_progress"?"running":e.status==="queued"||e.status==="waiting"||e.status==="requested"||e.status==="pending"?"pending":"running"}function Fx(e){if(e.status==="completed")switch(e.conclusion){case"success":return"success";case"failure":return"failed";case"cancelled":return"cancelled";case"skipped":return"skipped";default:return"failed"}return e.status==="in_progress"?"running":e.status==="queued"||e.status==="waiting"?"pending":"running"}function Hx(e){if(e.status==="completed")switch(e.conclusion){case"success":return"success";case"failure":return"failed";case"cancelled":return"cancelled";case"skipped":return"skipped";default:return"failed"}return e.status==="in_progress"?"running":"pending"}const ko={pending:{color:"text-[#939084]",bg:"bg-[#939084]/10",Icon:nt,label:"Queued"},running:{color:"text-[#553DE9]",bg:"bg-[#553DE9]/10",Icon:pr,label:"Running"},success:{color:"text-[#1FC5A8]",bg:"bg-[#1FC5A8]/10",Icon:Gl,label:"Success"},failed:{color:"text-[#C45B5B]",bg:"bg-[#C45B5B]/10",Icon:er,label:"Failed"},cancelled:{color:"text-[#939084]",bg:"bg-[#939084]/10",Icon:rc,label:"Cancelled"},skipped:{color:"text-[#939084]",bg:"bg-[#939084]/10",Icon:Yl,label:"Skipped"}};function kh(e){const t=new Date(e),i=Math.floor((new Date().getTime()-t.getTime())/1e3);if(i<60)return`${i}s ago`;const n=Math.floor(i/60);if(n<60)return`${n}m ago`;const o=Math.floor(n/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Nh(e,t){if(!t)return"--";const s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"--";const i=Math.floor(s/1e3);if(i<60)return`${i}s`;const n=Math.floor(i/60),o=i%60;if(n<60)return`${n}m ${o}s`;const a=Math.floor(n/60),l=n%60;return`${a}h ${l}m`}function No({status:e}){const t=ko[e];return r.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${t.bg} ${t.color}`,children:[r.jsx(t.Icon,{size:12,className:e==="running"?"animate-spin":""}),t.label]})}function Wx({step:e}){const t=Hx(e),s=ko[t];return r.jsxs("div",{className:"flex items-center gap-2 py-1 px-3 text-xs",children:[r.jsx(s.Icon,{size:12,className:`${s.color} flex-shrink-0 ${t==="running"?"animate-spin":""}`}),r.jsx("span",{className:"text-[#201515] dark:text-[#E8E6E3] flex-1 truncate",children:e.name}),e.startedAt&&e.completedAt&&r.jsx("span",{className:"text-[#939084] font-mono flex-shrink-0",children:Nh(e.startedAt,e.completedAt)}),r.jsx(No,{status:t})]})}function Ux({job:e}){const[t,s]=d.useState(!1),i=Fx(e),n=ko[i];return r.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg overflow-hidden",children:[r.jsxs("button",{onClick:()=>s(!t),className:"w-full flex items-center gap-3 px-4 py-2.5 text-left hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[t?r.jsx(ls,{size:14,className:"text-[#939084]"}):r.jsx(ur,{size:14,className:"text-[#939084]"}),r.jsx(n.Icon,{size:14,className:`${n.color} ${i==="running"?"animate-spin":""}`}),r.jsx("span",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3] flex-1 truncate",children:e.name}),e.startedAt&&r.jsx("span",{className:"text-xs text-[#939084] font-mono flex-shrink-0",children:Nh(e.startedAt,e.completedAt)}),r.jsx(No,{status:i})]}),t&&e.steps&&e.steps.length>0&&r.jsx("div",{className:"border-t border-[#ECEAE3] dark:border-[#2A2A30] bg-[#FAFAF8] dark:bg-[#1A1A1F] divide-y divide-[#ECEAE3] dark:divide-[#2A2A30]",children:e.steps.map(o=>r.jsx(Wx,{step:o},o.number))})]})}function Kx({sessionId:e,runId:t}){const[s,i]=d.useState(null),[n,o]=d.useState(!1),[a,l]=d.useState(null),h=d.useCallback(async()=>{o(!0),l(null);try{const c=await W.getWorkflowRunLogs(e,t);i(c)}catch(c){l(c instanceof Error?c.message:"Failed to fetch logs")}finally{o(!1)}},[e,t]);return d.useEffect(()=>{h()},[h]),n?r.jsxs("div",{className:"bg-[#0F0F11] rounded-lg p-4 text-center",children:[r.jsx(pr,{size:16,className:"animate-spin text-[#939084] inline-block"}),r.jsx("span",{className:"text-xs text-[#939084] ml-2",children:"Loading logs..."})]}):a?r.jsx("div",{className:"bg-[#0F0F11] rounded-lg p-4",children:r.jsx("p",{className:"text-xs text-[#C45B5B] font-mono",children:a})}):r.jsx("div",{className:"bg-[#0F0F11] rounded-lg p-3 max-h-80 overflow-y-auto terminal-scroll",children:r.jsx("pre",{className:"text-xs font-mono leading-relaxed whitespace-pre-wrap text-[#E8E6E3]",children:s||"(No log output)"})})}function qx({run:e,sessionId:t}){const[s,i]=d.useState(!1),[n,o]=d.useState(null),[a,l]=d.useState(!1),[h,c]=d.useState(null),[u,m]=d.useState(!1),f=Ji(e),_=d.useCallback(async()=>{if(!(n||a)){l(!0),c(null);try{const g=await W.getWorkflowRunDetail(t,e.databaseId);o(g)}catch(g){c(g instanceof Error?g.message:"Failed to load run details")}finally{l(!1)}}},[t,e.databaseId,n,a]),p=()=>{const g=!s;i(g),g&&_()};return r.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg overflow-hidden",children:[r.jsxs("button",{onClick:p,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-[#F8F4F0] dark:hover:bg-[#222228] transition-colors",children:[s?r.jsx(ls,{size:14,className:"text-[#939084] flex-shrink-0"}):r.jsx(ur,{size:14,className:"text-[#939084] flex-shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("span",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3] truncate",children:e.name}),r.jsx(No,{status:f})]}),r.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[r.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-[#939084]",children:[r.jsx(ze,{size:12}),e.headBranch]}),r.jsx("span",{className:"text-xs text-[#939084]",children:e.event}),r.jsx("span",{className:"text-xs text-[#939084]",children:kh(e.createdAt)})]})]}),r.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:g=>g.stopPropagation(),className:"text-[#939084] hover:text-[#553DE9] transition-colors flex-shrink-0",title:"Open on GitHub",children:r.jsx(ss,{size:14})})]}),s&&r.jsxs("div",{className:"border-t border-[#ECEAE3] dark:border-[#2A2A30] px-4 pb-4 pt-3 space-y-3",children:[a&&r.jsxs("div",{className:"text-center py-4",children:[r.jsx(pr,{size:16,className:"animate-spin text-[#553DE9] inline-block"}),r.jsx("span",{className:"text-xs text-[#939084] ml-2",children:"Loading jobs..."})]}),h&&r.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-[#C45B5B]/10 text-[#C45B5B]",children:[r.jsx(Ot,{size:14}),r.jsx("span",{className:"text-xs",children:h})]}),n&&n.jobs&&n.jobs.length>0&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("h4",{className:"text-xs font-semibold text-[#939084] uppercase tracking-wider",children:"Jobs"}),n.jobs.map(g=>r.jsx(Ux,{job:g},g.databaseId))]}),n&&(!n.jobs||n.jobs.length===0)&&!a&&r.jsx("p",{className:"text-xs text-[#939084]",children:"No jobs found for this run."}),n&&r.jsxs("div",{className:"pt-1",children:[r.jsxs("button",{onClick:()=>m(!u),className:"inline-flex items-center gap-1.5 text-xs text-[#553DE9] hover:text-[#4432c4] transition-colors",children:[r.jsx(es,{size:12}),u?"Hide full logs":"View full logs"]}),u&&r.jsx("div",{className:"mt-2",children:r.jsx(Kx,{sessionId:t,runId:e.databaseId})})]})]})]})}function Vx({sessionId:e,workflows:t,onClose:s,onDispatched:i}){var _;const[n,o]=d.useState(((_=t[0])==null?void 0:_.name)||""),[a,l]=d.useState(""),[h,c]=d.useState(!1),[u,m]=d.useState(null),f=async()=>{if(n){c(!0),m(null);try{await W.dispatchWorkflow(e,n,a),i(),s()}catch(p){m(p instanceof Error?p.message:"Dispatch failed")}finally{c(!1)}}};return r.jsxs("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg p-4 bg-[#FAFAF8] dark:bg-[#1A1A1F] space-y-3",children:[r.jsx("h4",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3]",children:"Run Workflow"}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-[#939084] mb-1",children:"Workflow"}),r.jsx("select",{value:n,onChange:p=>o(p.target.value),className:"w-full px-3 py-1.5 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#0F0F11] text-[#201515] dark:text-[#E8E6E3] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/40",children:t.map(p=>r.jsxs("option",{value:p.name,children:[p.name," (",p.name,")"]},p.id))})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-[#939084] mb-1",children:"Branch / ref (leave empty for default)"}),r.jsx("input",{type:"text",value:a,onChange:p=>l(p.target.value),placeholder:"main",className:"w-full px-3 py-1.5 text-sm rounded-lg border border-[#ECEAE3] dark:border-[#2A2A30] bg-white dark:bg-[#0F0F11] text-[#201515] dark:text-[#E8E6E3] focus:outline-none focus:ring-2 focus:ring-[#553DE9]/40"})]}),u&&r.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-[#C45B5B]/10 text-[#C45B5B]",children:[r.jsx(Ot,{size:12}),r.jsx("span",{className:"text-xs",children:u})]}),r.jsxs("div",{className:"flex items-center gap-2 justify-end",children:[r.jsx(he,{size:"sm",variant:"ghost",onClick:s,children:"Cancel"}),r.jsx(he,{size:"sm",icon:It,onClick:f,loading:h,children:"Dispatch"})]})]})}function jh({sessionId:e}){const[t,s]=d.useState([]),[i,n]=d.useState([]),[o,a]=d.useState(""),[l,h]=d.useState(!0),[c,u]=d.useState(null),[m,f]=d.useState(!1),[_,p]=d.useState(null),g=d.useRef(null),v=t.some(D=>D.status==="in_progress"||D.status==="queued"||D.status==="waiting"||D.status==="requested"||D.status==="pending"),y=d.useCallback(async(D=!1)=>{if(e){D&&h(!0),u(null);try{const T=await W.getWorkflowRuns(e);s(T),a(""),p(new Date)}catch(T){const U=T instanceof Error?T.message:String(T);U.includes("gh CLI not found")?u({type:"gh_not_found",message:"The gh CLI is not installed. Install it from https://cli.github.com/ to enable CI/CD integration."}):U.includes("not authenticated")||U.includes("401")?u({type:"not_authenticated",message:'The gh CLI is not authenticated. Run "gh auth login" in your terminal.'}):U.includes("Could not detect")?u({type:"no_repo",message:"No GitHub remote detected. Push this project to GitHub first."}):u({type:"generic",message:U})}finally{h(!1)}}},[e]),x=d.useCallback(async()=>{if(e)try{const D=await W.getWorkflows(e);n(D.filter(T=>T.state==="active"))}catch{n([])}},[e]);d.useEffect(()=>{y(!0),x()},[y,x]),d.useEffect(()=>(v&&e?g.current=setInterval(()=>y(!1),1e4):g.current&&(clearInterval(g.current),g.current=null),()=>{g.current&&clearInterval(g.current)}),[v,e,y]);const k=t.filter(D=>Ji(D)==="success").length,N=t.filter(D=>Ji(D)==="failed").length,w=t.filter(D=>{const T=Ji(D);return T==="running"||T==="pending"}).length;return r.jsxs("div",{className:"card p-6",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ze,{size:18,className:"text-[#553DE9]"}),r.jsx("h3",{className:"text-sm font-semibold text-[#201515] dark:text-[#E8E6E3] uppercase tracking-wider",children:"CI/CD Pipelines"}),o&&r.jsx("span",{className:"text-xs text-[#939084] font-mono",children:o})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[_&&r.jsxs("span",{className:"text-[10px] text-[#939084] flex items-center gap-1",children:[r.jsx(cc,{size:10}),kh(_.toISOString())]}),r.jsx(he,{size:"sm",variant:"ghost",icon:gt,onClick:()=>y(!0),children:"Refresh"}),i.length>0&&r.jsx(he,{size:"sm",icon:It,onClick:()=>f(!m),children:"Run Workflow"})]})]}),m&&e&&i.length>0&&r.jsx("div",{className:"mb-4",children:r.jsx(Vx,{sessionId:e,workflows:i,onClose:()=>f(!1),onDispatched:()=>{setTimeout(()=>y(!1),3e3)}})}),c&&r.jsxs("div",{className:"mb-4",children:[c.type==="gh_not_found"&&r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-[#939084]/5 border border-[#ECEAE3] dark:border-[#2A2A30]",children:[r.jsx(Ot,{size:18,className:"text-[#939084] flex-shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:"GitHub CLI not installed"}),r.jsx("p",{className:"text-xs text-[#939084] mt-1",children:c.message}),r.jsxs("a",{href:"https://cli.github.com/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-[#553DE9] hover:text-[#4432c4] mt-2",children:["Install GitHub CLI ",r.jsx(ss,{size:10})]})]})]}),c.type==="not_authenticated"&&r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-[#C45B5B]/5 border border-[#C45B5B]/20",children:[r.jsx(Ot,{size:18,className:"text-[#C45B5B] flex-shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:"Not authenticated"}),r.jsx("p",{className:"text-xs text-[#939084] mt-1",children:c.message}),r.jsx("code",{className:"inline-block text-xs bg-[#0F0F11] text-[#E8E6E3] px-2 py-1 rounded mt-2 font-mono",children:"gh auth login"})]})]}),c.type==="no_repo"&&r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-[#939084]/5 border border-[#ECEAE3] dark:border-[#2A2A30]",children:[r.jsx(ze,{size:18,className:"text-[#939084] flex-shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:"No GitHub repository"}),r.jsx("p",{className:"text-xs text-[#939084] mt-1",children:c.message})]})]}),c.type==="generic"&&r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-[#C45B5B]/5 border border-[#C45B5B]/20",children:[r.jsx(Ot,{size:18,className:"text-[#C45B5B] flex-shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-[#201515] dark:text-[#E8E6E3]",children:"Failed to load workflow runs"}),r.jsx("p",{className:"text-xs text-[#939084] mt-1",children:c.message})]})]})]}),!l&&!c&&t.length>0&&r.jsxs("div",{className:"flex items-center gap-4 mb-4 text-xs",children:[r.jsxs("span",{className:"flex items-center gap-1 text-[#1FC5A8]",children:[r.jsx(Gl,{size:12}),k," passed"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[#C45B5B]",children:[r.jsx(er,{size:12}),N," failed"]}),r.jsxs("span",{className:"flex items-center gap-1 text-[#553DE9]",children:[r.jsx(pr,{size:12,className:w>0?"animate-spin":""}),w," active"]}),v&&r.jsx("span",{className:"text-[#939084] italic",children:"Auto-refreshing every 10s"})]}),l&&r.jsx("div",{className:"space-y-3",children:[1,2,3].map(D=>r.jsx("div",{className:"border border-[#ECEAE3] dark:border-[#2A2A30] rounded-lg p-4 animate-pulse",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-4 h-4 bg-[#ECEAE3] dark:bg-[#2A2A30] rounded"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"h-4 bg-[#ECEAE3] dark:bg-[#2A2A30] rounded w-48"}),r.jsx("div",{className:"h-3 bg-[#ECEAE3] dark:bg-[#2A2A30] rounded w-32 mt-2"})]}),r.jsx("div",{className:"h-5 bg-[#ECEAE3] dark:bg-[#2A2A30] rounded-full w-16"})]})},D))}),!l&&!c&&t.length===0&&r.jsxs("div",{className:"text-center py-8",children:[r.jsx("p",{className:"text-[#939084] text-sm",children:"No workflow runs found"}),r.jsx("p",{className:"text-[#939084]/60 text-xs mt-1",children:"Push commits or trigger a workflow to see runs here"})]}),!l&&!c&&t.length>0&&e&&r.jsx("div",{className:"space-y-3 max-h-[600px] overflow-y-auto terminal-scroll",children:t.map(D=>r.jsx(qx,{run:D,sessionId:e},D.databaseId))})]})}const Gx=Object.freeze(Object.defineProperty({__proto__:null,CICDPanel:jh},Symbol.toStringTag,{value:"Module"}));function Yx({phase:e,buildTime:t,onDismiss:s}){const[i,n]=d.useState(!1),[o,a]=d.useState(!1),l=d.useRef(e);if(d.useEffect(()=>{if(e==="complete"&&l.current!=="complete"){n(!0),a(!1);const c=setTimeout(()=>{n(!1),a(!0),s==null||s()},3e3);return()=>clearTimeout(c)}e!=="complete"&&a(!1),l.current=e},[e,s]),!i||o)return null;const h=c=>{if(c<60)return`${c}s`;const u=Math.floor(c/60),m=c%60;return`${u}m ${m}s`};return r.jsx("div",{className:"build-celebration-overlay",onClick:()=>{n(!1),a(!0),s==null||s()},children:r.jsxs("div",{className:"build-celebration-content",onClick:c=>c.stopPropagation(),children:[r.jsx("div",{className:"build-celebration-icon",children:r.jsx(kt,{size:48,className:"text-success"})}),r.jsx("div",{className:"build-celebration-burst"}),r.jsx("h3",{className:"text-lg font-heading font-bold text-ink mt-4",children:"Your app is ready!"}),r.jsx("p",{className:"text-sm text-muted mt-1",children:t?`Built in ${h(t)}. Time to see it in action.`:"Everything looks great. Go take a look."})]})})}function Xx({tokenHistory:e,budget:t=1e5,className:s=""}){const i=e.slice(-10);if(i.length<2)return null;const n=64,o=20,a=2,l=Math.max(...i,1),h=Math.min(...i,0),c=l-h||1,u=i.map((y,x)=>({x:a+x/(i.length-1)*(n-a*2),y:a+(1-(y-h)/c)*(o-a*2)})),m=u.map((y,x)=>`${x===0?"M":"L"} ${y.x.toFixed(1)} ${y.y.toFixed(1)}`).join(" "),f=`${m} L ${u[u.length-1].x.toFixed(1)} ${o-a} L ${u[0].x.toFixed(1)} ${o-a} Z`,p=i[i.length-1]/t;let g="#1FC5A8",v="rgba(31, 197, 168, 0.15)";return p>1?(g="#C45B5B",v="rgba(196, 91, 91, 0.15)"):p>.75&&(g="#D4A03C",v="rgba(212, 160, 60, 0.15)"),r.jsxs("svg",{width:n,height:o,viewBox:`0 0 ${n} ${o}`,className:`inline-block align-middle ${s}`,"aria-label":"Token usage trend",children:[r.jsx("path",{d:f,fill:v}),r.jsx("path",{d:m,fill:"none",stroke:g,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),r.jsx("circle",{cx:u[u.length-1].x,cy:u[u.length-1].y,r:"2",fill:g})]})}function Jx(){const[e,t]=d.useState([]),s=d.useRef(0);return{history:e,recordTokens:n=>{n!==s.current&&(s.current=n,t(o=>{const a=[...o,n];return a.length>20?a.slice(-20):a}))}}}function Zx(e){var i;const t=((i=e.split(".").pop())==null?void 0:i.toLowerCase())||"";return{js:{icon:Z,color:"text-yellow-600",label:"JavaScript"},jsx:{icon:Z,color:"text-yellow-500",label:"JSX"},ts:{icon:Z,color:"text-blue-500",label:"TypeScript"},tsx:{icon:Z,color:"text-blue-400",label:"TSX"},py:{icon:Z,color:"text-green-600",label:"Python"},html:{icon:Z,color:"text-orange-500",label:"HTML"},css:{icon:so,color:"text-purple-500",label:"CSS"},json:{icon:to,color:"text-green-500",label:"JSON"},md:{icon:fi,color:"text-muted",label:"Markdown"},go:{icon:Z,color:"text-cyan-600",label:"Go"},rs:{icon:Z,color:"text-orange-600",label:"Rust"}}[t]||{icon:io,color:"text-muted",label:t.toUpperCase()||"Plain Text"}}function Qx(e){const t=Math.floor((Date.now()-e)/1e3);return t<2?"just now":t<60?`${t}s ago`:`${Math.floor(t/60)}m ago`}function Ll(e){if(e<60)return`${e}s`;const t=Math.floor(e/60),s=e%60;return`${t}m ${s}s`}function ev({selectedFile:e,fileName:t,isModified:s,isSaving:i,lastSavedAt:n,lineCount:o,cursorLine:a,cursorColumn:l,buildTime:h,sessionId:c,prd:u}){const[m,f]=d.useState(""),[_,p]=d.useState(!1);d.useEffect(()=>{if(!n)return;const N=()=>f(Qx(n));N();const w=setInterval(N,5e3);return()=>clearInterval(w)},[n]);const g=d.useCallback(async()=>{const N=["Built with Loki Mode",c?`Session: ${c}`:"",h?`Build time: ${Ll(h)}`:"",u?`
253
253
  Project: ${u.substring(0,100)}${u.length>100?"...":""}`:"",`
@@ -1,4 +1,4 @@
1
- import{c as $,j as e,r as u,x as D,h as P,i as R,u as z,a as E,n as L,l as M,E as A,f as _}from"./index-CM_b_EhP.js";import{B as C}from"./Button-CFLVoduT.js";import{B as U}from"./Badge-B12zwlD7.js";import{L as I}from"./lightbulb-B-Itbm9g.js";import{T as O}from"./trending-up-BgmK_tHq.js";import{T as H,M as Y}from"./trending-down-DBiXUtxJ.js";import{u as q}from"./usePolling-PiRLqNu6.js";import{R as G}from"./refresh-cw-CIr7E-g2.js";import{P as S}from"./plus-j08lFR-K.js";import{F as K}from"./folder-open-B57dAoBv.js";import{C as Q}from"./copy-CnqkyNsi.js";import{T as V}from"./trash-2-DEKSVae5.js";import"./clock-IW4Wq86N.js";import"./circle-alert-CpL4Bhvt.js";import"./check-nIAqa-kf.js";/**
1
+ import{c as $,j as e,r as u,x as D,h as P,i as R,u as z,a as E,n as L,l as M,E as A,f as _}from"./index-B-0iHBPO.js";import{B as C}from"./Button-BBMk33tk.js";import{B as U}from"./Badge-4uAWnemi.js";import{L as I}from"./lightbulb-C-uLoq9Y.js";import{T as O}from"./trending-up-EQFTzhEo.js";import{T as H,M as Y}from"./trending-down-D4Jk7KF3.js";import{u as q}from"./usePolling-BnhPUuGd.js";import{R as G}from"./refresh-cw-BjREUnVq.js";import{P as S}from"./plus-EoL5OCB7.js";import{F as K}from"./folder-open-DhXpXscO.js";import{C as Q}from"./copy-CUkT6k1v.js";import{T as V}from"./trash-2-BT5o_g0r.js";import"./clock-CaQRrIrs.js";import"./circle-alert-S7uFoxC2.js";import"./check-CbCPjX3M.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 tt,j as e,r as t,y as fe,a as se,z as st,Q as at,K as nt,I as ot,n as it,E as lt}from"./index-CM_b_EhP.js";import{E as rt,R as ct}from"./rotate-ccw-gwoXxDeE.js";import{H as dt}from"./hammer-DRbIQ4QU.js";import{C as ut}from"./cloud-Cn8nNuH2.js";import{L as xt}from"./loader-circle-Oq6NQhW2.js";import{C as mt}from"./check-nIAqa-kf.js";import{C as pt}from"./circle-alert-CpL4Bhvt.js";/**
1
+ import{c as tt,j as e,r as t,y as fe,a as se,z as st,Q as at,K as nt,I as ot,n as it,E as lt}from"./index-B-0iHBPO.js";import{E as rt,R as ct}from"./rotate-ccw-DahWX07H.js";import{H as dt}from"./hammer-jLCaujYH.js";import{C as ut}from"./cloud-DBAX6c0r.js";import{L as xt}from"./loader-circle-JTfD-ZuM.js";import{C as mt}from"./check-CbCPjX3M.js";import{C as pt}from"./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.
@@ -1 +1 @@
1
- import{j as e,r as c,h as m,i as p,X as h,u}from"./index-CM_b_EhP.js";const x=[{label:"Q1 2026",period:"Jan - Mar",features:[{name:"Multi-provider support (5 providers)",status:"completed"},{name:"Memory system with vector search",status:"completed"},{name:"Purple Lab web UI",status:"completed"},{name:"Enterprise auth (OIDC, RBAC)",status:"completed"},{name:"Legacy system healing",status:"completed"}]},{label:"Q2 2026",period:"Apr - Jun",features:[{name:"Real-time collaboration (multi-user)",status:"in-progress"},{name:"Visual workflow builder",status:"in-progress"},{name:"Plugin marketplace",status:"planned"},{name:"Custom agent creation UI",status:"planned"}]},{label:"Q3 2026",period:"Jul - Sep",features:[{name:"Cloud deployment integration",status:"planned"},{name:"Team analytics dashboard",status:"planned"},{name:"AI-powered debugging assistant",status:"planned"},{name:"Mobile companion app",status:"planned"}]},{label:"Q4 2026",period:"Oct - Dec",features:[{name:"Multi-repo orchestration",status:"planned"},{name:"Custom model fine-tuning",status:"planned"},{name:"Compliance report generation",status:"planned"},{name:"On-prem cluster mode",status:"planned"}]}],l={completed:{dot:"bg-[#1FC5A8]",text:"text-[#36342E]",label:"Shipped"},"in-progress":{dot:"bg-[#553DE9]",text:"text-[#36342E]",label:"In Progress"},planned:{dot:"bg-[#939084]",text:"text-[#6B6960]",label:"Planned"}};function b(){return e.jsxs("div",{className:"py-8",children:[e.jsx("h3",{className:"text-xl font-bold text-[#36342E] mb-2",children:"Product Roadmap"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-8",children:"Where we have been and where we are heading."}),e.jsx("div",{className:"flex gap-6 mb-6",children:["completed","in-progress","planned"].map(t=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${l[t].dot}`}),e.jsx("span",{className:"text-[#6B6960]",children:l[t].label})]},t))}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-0.5 bg-[#ECEAE3]"}),e.jsx("div",{className:"space-y-8",children:x.map((t,i)=>e.jsxs("div",{className:"relative pl-8",children:[e.jsx("div",{className:`absolute left-0 top-1 w-[15px] h-[15px] rounded-full border-2 border-white shadow-sm ${i===0?"bg-[#1FC5A8]":i===1?"bg-[#553DE9]":"bg-[#ECEAE3]"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-3",children:[e.jsx("h4",{className:"text-base font-bold text-[#36342E]",children:t.label}),e.jsx("span",{className:"text-xs text-[#939084]",children:t.period}),i===1&&e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-[#553DE9]/10 text-[#553DE9]",children:"Current"})]}),e.jsx("div",{className:"space-y-2",children:t.features.map(a=>{const s=l[a.status];return e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s.dot}`}),e.jsx("span",{className:`text-sm ${s.text}`,children:a.name})]},a.name)})})]})]},t.label))})]})]})}const n=[{version:"6.71.1",date:"Mar 24, 2026",features:["BuildProgressBar server integration with cost, ETA, and phase data","Sprint 1 complete: BuildProgressBar, CommandPalette, dark mode, sidebar theme toggle","Quick-start API, dark mode prep, theme hook foundation"]},{version:"6.70.0",date:"Mar 22, 2026",features:["Embedded Loki Dashboard in Purple Lab workspace","Panel toggles, modern UI, bigger fonts, smooth transitions","Sprint 1 foundation with quick-start API"]},{version:"6.69.0",date:"Mar 20, 2026",features:["Purple Lab IDE workspace with Monaco editor","AI chat panel for iterative development","Activity panel with build log and quality gates"]}];function g(){const[t,i]=c.useState(!1),a=t?n:n.slice(0,2);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-4 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-sm font-bold text-[#36342E]",children:"Recent Changes"}),e.jsx("a",{href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#553DE9] hover:text-[#4832c7] font-medium",children:"View all"})]}),e.jsx("div",{className:"space-y-3",children:a.map(s=>e.jsxs("div",{className:"pb-3 border-b border-[#ECEAE3] last:border-b-0 last:pb-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsxs("span",{className:"px-1.5 py-0.5 text-xs font-mono font-bold rounded bg-[#553DE9]/10 text-[#553DE9]",children:["v",s.version]}),e.jsx("span",{className:"text-xs text-[#939084]",children:s.date})]}),e.jsx("ul",{className:"space-y-1",children:s.features.map((r,o)=>e.jsx("li",{className:"text-xs text-[#6B6960] pl-3 relative before:content-[''] before:absolute before:left-0 before:top-[7px] before:w-1.5 before:h-1.5 before:rounded-full before:bg-[#ECEAE3]",children:r},o))})]},s.version))}),n.length>2&&e.jsxs("button",{onClick:()=>i(!t),className:"mt-2 flex items-center gap-1 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",children:[t?e.jsx(m,{size:12}):e.jsx(p,{size:12}),t?"Show less":`Show ${n.length-2} more`]})]})}const f={default:"bg-[#F8F4F0] text-[#36342E] border-[#ECEAE3] dark:bg-[#222228] dark:text-[#E8E6E3] dark:border-[#2A2A30]",primary:"bg-[#553DE9]/10 text-[#553DE9] border-[#553DE9]/20 dark:bg-[#553DE9]/20 dark:text-[#7B6BEF] dark:border-[#553DE9]/30",success:"bg-[#1FC5A8]/10 text-[#1FC5A8] border-[#1FC5A8]/20",warning:"bg-[#E5A940]/10 text-[#E5A940] border-[#E5A940]/20",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border-[#C45B5B]/20",info:"bg-[#3B82F6]/10 text-[#3B82F6] border-[#3B82F6]/20"};function E({label:t,color:i="default",removable:a=!1,onClick:s,onRemove:r,className:o=""}){return e.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-0.5 text-xs font-medium rounded-full border transition-colors ${f[i]} ${s?"cursor-pointer hover:opacity-80":""} ${o}`,onClick:s,role:s?"button":void 0,children:[t,a&&e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),r==null||r()},className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full hover:bg-black/10 dark:hover:bg-white/10 transition-colors","aria-label":`Remove ${t}`,children:e.jsx(h,{size:10})})]})}const w=[{title:"SaaS Dashboard",description:"Admin dashboard with user analytics, charts, and real-time data visualization.",techStack:["React","Tailwind","Chart.js"],buildTime:"~25 min",gradient:"from-[#553DE9] to-[#7B6BEF]",prompt:"Build a SaaS admin dashboard with user analytics, charts showing MRR and churn, and a table of recent signups"},{title:"REST API Server",description:"Production-ready API with authentication, validation, and database integration.",techStack:["Node.js","Express","PostgreSQL"],buildTime:"~20 min",gradient:"from-[#1FC5A8] to-[#38D9A9]",prompt:"Build a REST API server with JWT authentication, user CRUD, input validation, and PostgreSQL database"},{title:"E-commerce Store",description:"Online store with product catalog, cart, checkout, and payment integration.",techStack:["Next.js","Stripe","Prisma"],buildTime:"~45 min",gradient:"from-[#E93D82] to-[#F06595]",prompt:"Build an e-commerce store with product listings, shopping cart, Stripe checkout, and order management"},{title:"Portfolio Website",description:"Personal portfolio with animations, project showcase, and contact form.",techStack:["React","Framer Motion","Tailwind"],buildTime:"~15 min",gradient:"from-[#F59F00] to-[#FCC419]",prompt:"Build a developer portfolio website with animated sections, project gallery, skills list, and contact form"},{title:"CLI Tool",description:"Command-line tool with subcommands, flags, configuration, and colorful output.",techStack:["Node.js","Commander","Chalk"],buildTime:"~15 min",gradient:"from-[#36342E] to-[#6B6960]",prompt:"Build a CLI tool with subcommands for file management: list, copy, move, and search with glob patterns"},{title:"Discord Bot",description:"Interactive bot with slash commands, moderation, and custom responses.",techStack:["Discord.js","Node.js","SQLite"],buildTime:"~20 min",gradient:"from-[#5865F2] to-[#7289DA]",prompt:"Build a Discord bot with slash commands for polls, reminders, moderation (kick/ban), and a leveling system"},{title:"Blog Platform",description:"Full-featured blog with markdown support, categories, and RSS feed.",techStack:["React","MDX","Tailwind"],buildTime:"~30 min",gradient:"from-[#845EF7] to-[#B197FC]",prompt:"Build a blog platform with MDX support, category filtering, search, RSS feed, and a clean reading experience"},{title:"Task Manager",description:"Kanban-style task board with drag-and-drop, labels, and persistence.",techStack:["React","DnD Kit","SQLite"],buildTime:"~25 min",gradient:"from-[#2F71E3] to-[#5C93E8]",prompt:"Build a task manager with kanban board, drag-and-drop cards, labels, due dates, and local SQLite storage"},{title:"Weather App",description:"Weather dashboard with location search, forecasts, and beautiful visualizations.",techStack:["React","OpenWeatherMap","Chart.js"],buildTime:"~15 min",gradient:"from-[#0EA5E9] to-[#38BDF8]",prompt:"Build a weather app with city search, 5-day forecast, current conditions, and temperature charts"},{title:"Chat Application",description:"Real-time chat with rooms, typing indicators, and message history.",techStack:["React","WebSocket","Node.js"],buildTime:"~30 min",gradient:"from-[#22C55E] to-[#4ADE80]",prompt:"Build a real-time chat application with chat rooms, user presence, typing indicators, and message history"},{title:"Landing Page",description:"Conversion-optimized landing page with hero, features, pricing, and CTA sections.",techStack:["HTML","Tailwind","Alpine.js"],buildTime:"~10 min",gradient:"from-[#F97316] to-[#FB923C]",prompt:"Build a SaaS landing page with hero section, feature grid, pricing table, testimonials, and email signup"},{title:"Mobile App",description:"Cross-platform mobile app with navigation, state management, and native features.",techStack:["React Native","Expo","TypeScript"],buildTime:"~35 min",gradient:"from-[#DC2626] to-[#F87171]",prompt:"Build a React Native mobile app with tab navigation, a home feed, profile page, and push notifications setup"}];function j(){const t=u(),i=a=>{sessionStorage.setItem("pl_showcase_prompt",a),t("/")};return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Showcase"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:'Explore example projects you can build with Loki Mode. Click "Build This" to start any project instantly.'})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:w.map(a=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm hover:shadow-md transition-shadow flex flex-col",children:[e.jsx("div",{className:`h-28 bg-gradient-to-br ${a.gradient} flex items-end p-4`,children:e.jsx("h3",{className:"text-lg font-bold text-white drop-shadow-sm",children:a.title})}),e.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[e.jsx("p",{className:"text-sm text-[#6B6960] mb-3",children:a.description}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:a.techStack.map(s=>e.jsx(E,{label:s,color:"default"},s))}),e.jsxs("div",{className:"mt-auto pt-3 border-t border-[#ECEAE3] flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[#939084]",children:["Est. ",a.buildTime]}),e.jsx("button",{onClick:()=>i(a.prompt),className:"px-4 py-1.5 text-sm font-semibold rounded-lg bg-[#553DE9] text-white hover:bg-[#4832c7] transition-colors",children:"Build This"})]})]})]},a.title))}),e.jsx("div",{className:"mt-12",children:e.jsx(b,{})}),e.jsx("div",{className:"mt-8 max-w-md",children:e.jsx(g,{})})]})})}export{j as default};
1
+ import{j as e,r as c,h as m,i as p,X as h,u}from"./index-B-0iHBPO.js";const x=[{label:"Q1 2026",period:"Jan - Mar",features:[{name:"Multi-provider support (5 providers)",status:"completed"},{name:"Memory system with vector search",status:"completed"},{name:"Purple Lab web UI",status:"completed"},{name:"Enterprise auth (OIDC, RBAC)",status:"completed"},{name:"Legacy system healing",status:"completed"}]},{label:"Q2 2026",period:"Apr - Jun",features:[{name:"Real-time collaboration (multi-user)",status:"in-progress"},{name:"Visual workflow builder",status:"in-progress"},{name:"Plugin marketplace",status:"planned"},{name:"Custom agent creation UI",status:"planned"}]},{label:"Q3 2026",period:"Jul - Sep",features:[{name:"Cloud deployment integration",status:"planned"},{name:"Team analytics dashboard",status:"planned"},{name:"AI-powered debugging assistant",status:"planned"},{name:"Mobile companion app",status:"planned"}]},{label:"Q4 2026",period:"Oct - Dec",features:[{name:"Multi-repo orchestration",status:"planned"},{name:"Custom model fine-tuning",status:"planned"},{name:"Compliance report generation",status:"planned"},{name:"On-prem cluster mode",status:"planned"}]}],l={completed:{dot:"bg-[#1FC5A8]",text:"text-[#36342E]",label:"Shipped"},"in-progress":{dot:"bg-[#553DE9]",text:"text-[#36342E]",label:"In Progress"},planned:{dot:"bg-[#939084]",text:"text-[#6B6960]",label:"Planned"}};function b(){return e.jsxs("div",{className:"py-8",children:[e.jsx("h3",{className:"text-xl font-bold text-[#36342E] mb-2",children:"Product Roadmap"}),e.jsx("p",{className:"text-sm text-[#6B6960] mb-8",children:"Where we have been and where we are heading."}),e.jsx("div",{className:"flex gap-6 mb-6",children:["completed","in-progress","planned"].map(t=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${l[t].dot}`}),e.jsx("span",{className:"text-[#6B6960]",children:l[t].label})]},t))}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-0.5 bg-[#ECEAE3]"}),e.jsx("div",{className:"space-y-8",children:x.map((t,i)=>e.jsxs("div",{className:"relative pl-8",children:[e.jsx("div",{className:`absolute left-0 top-1 w-[15px] h-[15px] rounded-full border-2 border-white shadow-sm ${i===0?"bg-[#1FC5A8]":i===1?"bg-[#553DE9]":"bg-[#ECEAE3]"}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-2 mb-3",children:[e.jsx("h4",{className:"text-base font-bold text-[#36342E]",children:t.label}),e.jsx("span",{className:"text-xs text-[#939084]",children:t.period}),i===1&&e.jsx("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full bg-[#553DE9]/10 text-[#553DE9]",children:"Current"})]}),e.jsx("div",{className:"space-y-2",children:t.features.map(a=>{const s=l[a.status];return e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${s.dot}`}),e.jsx("span",{className:`text-sm ${s.text}`,children:a.name})]},a.name)})})]})]},t.label))})]})]})}const n=[{version:"6.71.1",date:"Mar 24, 2026",features:["BuildProgressBar server integration with cost, ETA, and phase data","Sprint 1 complete: BuildProgressBar, CommandPalette, dark mode, sidebar theme toggle","Quick-start API, dark mode prep, theme hook foundation"]},{version:"6.70.0",date:"Mar 22, 2026",features:["Embedded Loki Dashboard in Purple Lab workspace","Panel toggles, modern UI, bigger fonts, smooth transitions","Sprint 1 foundation with quick-start API"]},{version:"6.69.0",date:"Mar 20, 2026",features:["Purple Lab IDE workspace with Monaco editor","AI chat panel for iterative development","Activity panel with build log and quality gates"]}];function g(){const[t,i]=c.useState(!1),a=t?n:n.slice(0,2);return e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl p-4 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h4",{className:"text-sm font-bold text-[#36342E]",children:"Recent Changes"}),e.jsx("a",{href:"https://github.com/asklokesh/loki-mode/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[#553DE9] hover:text-[#4832c7] font-medium",children:"View all"})]}),e.jsx("div",{className:"space-y-3",children:a.map(s=>e.jsxs("div",{className:"pb-3 border-b border-[#ECEAE3] last:border-b-0 last:pb-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsxs("span",{className:"px-1.5 py-0.5 text-xs font-mono font-bold rounded bg-[#553DE9]/10 text-[#553DE9]",children:["v",s.version]}),e.jsx("span",{className:"text-xs text-[#939084]",children:s.date})]}),e.jsx("ul",{className:"space-y-1",children:s.features.map((r,o)=>e.jsx("li",{className:"text-xs text-[#6B6960] pl-3 relative before:content-[''] before:absolute before:left-0 before:top-[7px] before:w-1.5 before:h-1.5 before:rounded-full before:bg-[#ECEAE3]",children:r},o))})]},s.version))}),n.length>2&&e.jsxs("button",{onClick:()=>i(!t),className:"mt-2 flex items-center gap-1 text-xs text-[#6B6960] hover:text-[#36342E] transition-colors",children:[t?e.jsx(m,{size:12}):e.jsx(p,{size:12}),t?"Show less":`Show ${n.length-2} more`]})]})}const f={default:"bg-[#F8F4F0] text-[#36342E] border-[#ECEAE3] dark:bg-[#222228] dark:text-[#E8E6E3] dark:border-[#2A2A30]",primary:"bg-[#553DE9]/10 text-[#553DE9] border-[#553DE9]/20 dark:bg-[#553DE9]/20 dark:text-[#7B6BEF] dark:border-[#553DE9]/30",success:"bg-[#1FC5A8]/10 text-[#1FC5A8] border-[#1FC5A8]/20",warning:"bg-[#E5A940]/10 text-[#E5A940] border-[#E5A940]/20",danger:"bg-[#C45B5B]/10 text-[#C45B5B] border-[#C45B5B]/20",info:"bg-[#3B82F6]/10 text-[#3B82F6] border-[#3B82F6]/20"};function E({label:t,color:i="default",removable:a=!1,onClick:s,onRemove:r,className:o=""}){return e.jsxs("span",{className:`inline-flex items-center gap-1 px-2.5 py-0.5 text-xs font-medium rounded-full border transition-colors ${f[i]} ${s?"cursor-pointer hover:opacity-80":""} ${o}`,onClick:s,role:s?"button":void 0,children:[t,a&&e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),r==null||r()},className:"inline-flex items-center justify-center w-3.5 h-3.5 rounded-full hover:bg-black/10 dark:hover:bg-white/10 transition-colors","aria-label":`Remove ${t}`,children:e.jsx(h,{size:10})})]})}const w=[{title:"SaaS Dashboard",description:"Admin dashboard with user analytics, charts, and real-time data visualization.",techStack:["React","Tailwind","Chart.js"],buildTime:"~25 min",gradient:"from-[#553DE9] to-[#7B6BEF]",prompt:"Build a SaaS admin dashboard with user analytics, charts showing MRR and churn, and a table of recent signups"},{title:"REST API Server",description:"Production-ready API with authentication, validation, and database integration.",techStack:["Node.js","Express","PostgreSQL"],buildTime:"~20 min",gradient:"from-[#1FC5A8] to-[#38D9A9]",prompt:"Build a REST API server with JWT authentication, user CRUD, input validation, and PostgreSQL database"},{title:"E-commerce Store",description:"Online store with product catalog, cart, checkout, and payment integration.",techStack:["Next.js","Stripe","Prisma"],buildTime:"~45 min",gradient:"from-[#E93D82] to-[#F06595]",prompt:"Build an e-commerce store with product listings, shopping cart, Stripe checkout, and order management"},{title:"Portfolio Website",description:"Personal portfolio with animations, project showcase, and contact form.",techStack:["React","Framer Motion","Tailwind"],buildTime:"~15 min",gradient:"from-[#F59F00] to-[#FCC419]",prompt:"Build a developer portfolio website with animated sections, project gallery, skills list, and contact form"},{title:"CLI Tool",description:"Command-line tool with subcommands, flags, configuration, and colorful output.",techStack:["Node.js","Commander","Chalk"],buildTime:"~15 min",gradient:"from-[#36342E] to-[#6B6960]",prompt:"Build a CLI tool with subcommands for file management: list, copy, move, and search with glob patterns"},{title:"Discord Bot",description:"Interactive bot with slash commands, moderation, and custom responses.",techStack:["Discord.js","Node.js","SQLite"],buildTime:"~20 min",gradient:"from-[#5865F2] to-[#7289DA]",prompt:"Build a Discord bot with slash commands for polls, reminders, moderation (kick/ban), and a leveling system"},{title:"Blog Platform",description:"Full-featured blog with markdown support, categories, and RSS feed.",techStack:["React","MDX","Tailwind"],buildTime:"~30 min",gradient:"from-[#845EF7] to-[#B197FC]",prompt:"Build a blog platform with MDX support, category filtering, search, RSS feed, and a clean reading experience"},{title:"Task Manager",description:"Kanban-style task board with drag-and-drop, labels, and persistence.",techStack:["React","DnD Kit","SQLite"],buildTime:"~25 min",gradient:"from-[#2F71E3] to-[#5C93E8]",prompt:"Build a task manager with kanban board, drag-and-drop cards, labels, due dates, and local SQLite storage"},{title:"Weather App",description:"Weather dashboard with location search, forecasts, and beautiful visualizations.",techStack:["React","OpenWeatherMap","Chart.js"],buildTime:"~15 min",gradient:"from-[#0EA5E9] to-[#38BDF8]",prompt:"Build a weather app with city search, 5-day forecast, current conditions, and temperature charts"},{title:"Chat Application",description:"Real-time chat with rooms, typing indicators, and message history.",techStack:["React","WebSocket","Node.js"],buildTime:"~30 min",gradient:"from-[#22C55E] to-[#4ADE80]",prompt:"Build a real-time chat application with chat rooms, user presence, typing indicators, and message history"},{title:"Landing Page",description:"Conversion-optimized landing page with hero, features, pricing, and CTA sections.",techStack:["HTML","Tailwind","Alpine.js"],buildTime:"~10 min",gradient:"from-[#F97316] to-[#FB923C]",prompt:"Build a SaaS landing page with hero section, feature grid, pricing table, testimonials, and email signup"},{title:"Mobile App",description:"Cross-platform mobile app with navigation, state management, and native features.",techStack:["React Native","Expo","TypeScript"],buildTime:"~35 min",gradient:"from-[#DC2626] to-[#F87171]",prompt:"Build a React Native mobile app with tab navigation, a home feed, profile page, and push notifications setup"}];function j(){const t=u(),i=a=>{sessionStorage.setItem("pl_showcase_prompt",a),t("/")};return e.jsx("div",{className:"min-h-screen bg-[#FAF9F6]",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-[#36342E]",children:"Showcase"}),e.jsx("p",{className:"text-[#6B6960] mt-1",children:'Explore example projects you can build with Loki Mode. Click "Build This" to start any project instantly.'})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:w.map(a=>e.jsxs("div",{className:"bg-white border border-[#ECEAE3] rounded-xl overflow-hidden shadow-sm hover:shadow-md transition-shadow flex flex-col",children:[e.jsx("div",{className:`h-28 bg-gradient-to-br ${a.gradient} flex items-end p-4`,children:e.jsx("h3",{className:"text-lg font-bold text-white drop-shadow-sm",children:a.title})}),e.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[e.jsx("p",{className:"text-sm text-[#6B6960] mb-3",children:a.description}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:a.techStack.map(s=>e.jsx(E,{label:s,color:"default"},s))}),e.jsxs("div",{className:"mt-auto pt-3 border-t border-[#ECEAE3] flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[#939084]",children:["Est. ",a.buildTime]}),e.jsx("button",{onClick:()=>i(a.prompt),className:"px-4 py-1.5 text-sm font-semibold rounded-lg bg-[#553DE9] text-white hover:bg-[#4832c7] transition-colors",children:"Build This"})]})]})]},a.title))}),e.jsx("div",{className:"mt-12",children:e.jsx(b,{})}),e.jsx("div",{className:"mt-8 max-w-md",children:e.jsx(g,{})})]})})}export{j as default};
@@ -1,4 +1,4 @@
1
- import{c as M,r as o,j as e,x as C,y as S,T as D,V as K}from"./index-CM_b_EhP.js";import{B as h}from"./Button-CFLVoduT.js";import{P as L}from"./plus-j08lFR-K.js";import{C as g}from"./check-nIAqa-kf.js";import{C as U}from"./copy-CnqkyNsi.js";import{R as q}from"./refresh-cw-CIr7E-g2.js";import{E as B,R as _}from"./rotate-ccw-gwoXxDeE.js";import{C as $}from"./clock-IW4Wq86N.js";import{T as G}from"./trash-2-DEKSVae5.js";import{S as W}from"./server-D5dO1paz.js";import{H as V}from"./hammer-DRbIQ4QU.js";import{B as Y}from"./bell-Gn17S6uv.js";import{D as H}from"./database-CKSReqa5.js";import{S as Q}from"./shield-alert-Du08zhdg.js";import{S as f}from"./save-B8fV_ZpE.js";/**
1
+ import{c as M,r as o,j as e,x as C,y as S,T as D,V as K}from"./index-B-0iHBPO.js";import{B as h}from"./Button-BBMk33tk.js";import{P as L}from"./plus-EoL5OCB7.js";import{C as g}from"./check-CbCPjX3M.js";import{C as U}from"./copy-CUkT6k1v.js";import{R as q}from"./refresh-cw-BjREUnVq.js";import{E as B,R as _}from"./rotate-ccw-DahWX07H.js";import{C as $}from"./clock-CaQRrIrs.js";import{T as G}from"./trash-2-BT5o_g0r.js";import{S as W}from"./server-D6V1BAia.js";import{H as V}from"./hammer-jLCaujYH.js";import{B as Y}from"./bell-DK2qtHnk.js";import{D as H}from"./database-BAWf1Gwt.js";import{S as Q}from"./shield-alert-BtTK5Sxb.js";import{S as f}from"./save-Dek3gCn1.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 P,r,j as e,U as w,X as B,i as z,y as U,a as F,x as O,b as V,h as H,M as q,R as K,m as Y,Y as G,$ as X}from"./index-CM_b_EhP.js";import{B as N}from"./Button-CFLVoduT.js";import{U as M,A as D}from"./Avatar-CL9Id9Hi.js";import{M as J}from"./mail-CzMRod6m.js";import{L as Q}from"./lock-DbJ9zxbw.js";import{A as k}from"./activity-DH3ih2nS.js";import{P as _}from"./plus-j08lFR-K.js";import{S as W}from"./save-B8fV_ZpE.js";import{T as Z}from"./trash-2-DEKSVae5.js";import{U as ee}from"./user-BB5J8wAF.js";import{C as $}from"./clock-IW4Wq86N.js";import{F as te}from"./file-code-corner-Box4IwG1.js";import{F as se}from"./file-plus-DpGqlXF8.js";import{H as ae}from"./hammer-DRbIQ4QU.js";/**
1
+ import{c as P,r,j as e,U as w,X as B,i as z,y as U,a as F,x as O,b as V,h as H,M as q,R as K,m as Y,Y as G,$ as X}from"./index-B-0iHBPO.js";import{B as N}from"./Button-BBMk33tk.js";import{U as M,A as D}from"./Avatar-DK8kmayw.js";import{M as J}from"./mail-BJ0PTN_V.js";import{L as Q}from"./lock-G9rxD4gZ.js";import{A as k}from"./activity-CacZsUyr.js";import{P as _}from"./plus-EoL5OCB7.js";import{S as W}from"./save-Dek3gCn1.js";import{T as Z}from"./trash-2-BT5o_g0r.js";import{U as ee}from"./user-DSUiUYtj.js";import{C as $}from"./clock-CaQRrIrs.js";import{F as te}from"./file-code-corner-ChtXoBwS.js";import{F as se}from"./file-plus-bFa37P76.js";import{H as ae}from"./hammer-jLCaujYH.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 F,r as o,j as e,b as q,U as V,d as O,w as B,R as D,u as z,a as J,X as P,y as K,F as T,v as Z,J as X,A as ee,n as W,k as te}from"./index-CM_b_EhP.js";import{B as N}from"./Button-CFLVoduT.js";import{u as se}from"./usePolling-PiRLqNu6.js";import{C as ie}from"./chevron-left-D2jcWDll.js";import{C as I}from"./clock-IW4Wq86N.js";import{L as ae}from"./lightbulb-B-Itbm9g.js";import{L as le}from"./layers-B78BiFiU.js";import{C as S}from"./check-nIAqa-kf.js";import{P as L}from"./package-WZ5osvej.js";import{G as re}from"./globe-BkOnKl4x.js";import{S as ne}from"./server-D5dO1paz.js";import{B as oe}from"./bot-Cbycc3VE.js";import{D as ce}from"./database-CKSReqa5.js";import{P as de}from"./plus-j08lFR-K.js";/**
1
+ import{c as F,r as o,j as e,b as q,U as V,d as O,w as B,R as D,u as z,a as J,X as P,y as K,F as T,v as Z,J as X,A as ee,n as W,k as te}from"./index-B-0iHBPO.js";import{B as N}from"./Button-BBMk33tk.js";import{u as se}from"./usePolling-BnhPUuGd.js";import{C as ie}from"./chevron-left-5NUKWw3i.js";import{C as I}from"./clock-CaQRrIrs.js";import{L as ae}from"./lightbulb-C-uLoq9Y.js";import{L as le}from"./layers-B1vsrsFW.js";import{C as S}from"./check-CbCPjX3M.js";import{P as L}from"./package-CXClfLOO.js";import{G as re}from"./globe-BPZgPeeu.js";import{S as ne}from"./server-D6V1BAia.js";import{B as oe}from"./bot-CkcUtHad.js";import{D as ce}from"./database-BAWf1Gwt.js";import{P as de}from"./plus-EoL5OCB7.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.