vibebusiness 1.2.46 → 1.2.49

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 (108) hide show
  1. package/.next/standalone/.env +5 -1
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/app-build-manifest.json +17 -17
  4. package/.next/standalone/.next/app-path-routes-manifest.json +1 -1
  5. package/.next/standalone/.next/build-manifest.json +2 -2
  6. package/.next/standalone/.next/prerender-manifest.json +1 -1
  7. package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
  8. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  10. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  11. package/.next/standalone/.next/server/app/api/analyze/route.js.nft.json +1 -1
  12. package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
  13. package/.next/standalone/.next/server/app/api/epics/[id]/ideas/route.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/api/epics/[id]/route.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/api/epics/route.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/api/goals/[id]/kpis/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/goals/[id]/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/goals/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/hypotheses/[id]/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/hypotheses/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/ideas/[id]/comments/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/ideas/[id]/implement/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/ideas/[id]/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/ideas/[id]/transition/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/ideas/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/implementations/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/kpis/refresh/route.js +1 -1
  28. package/.next/standalone/.next/server/app/api/kpis/refresh/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/social/[id]/publish/route.js +1 -1
  30. package/.next/standalone/.next/server/app/api/social/[id]/publish/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/social/[id]/route.js +1 -1
  32. package/.next/standalone/.next/server/app/api/social/[id]/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/social/route.js +1 -1
  34. package/.next/standalone/.next/server/app/api/social/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/goals/[id]/page_client-reference-manifest.js +1 -1
  36. package/.next/standalone/.next/server/app/goals/page.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/goals/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/hypotheses/[id]/page.js +1 -1
  39. package/.next/standalone/.next/server/app/hypotheses/[id]/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/hypotheses/page.js +1 -1
  41. package/.next/standalone/.next/server/app/hypotheses/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/hypotheses/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/ideas/[id]/page.js +1 -1
  44. package/.next/standalone/.next/server/app/ideas/[id]/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/ideas/[id]/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app/page.js +1 -1
  47. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/roadmap/[id]/page.js +1 -1
  50. package/.next/standalone/.next/server/app/roadmap/[id]/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/roadmap/page.js +1 -1
  52. package/.next/standalone/.next/server/app/roadmap/page.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/roadmap/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/sessions/page.js +1 -1
  55. package/.next/standalone/.next/server/app/sessions/page.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/settings/page.js +1 -1
  58. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/settings.html +1 -1
  60. package/.next/standalone/.next/server/app/settings.rsc +2 -2
  61. package/.next/standalone/.next/server/app/social/page.js +1 -1
  62. package/.next/standalone/.next/server/app/social/page_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/social.html +1 -1
  64. package/.next/standalone/.next/server/app/social.rsc +3 -3
  65. package/.next/standalone/.next/server/app-paths-manifest.json +13 -13
  66. package/.next/standalone/.next/server/chunks/3644.js +1 -1
  67. package/.next/standalone/.next/server/chunks/{7809.js → 3794.js} +103 -2
  68. package/.next/standalone/.next/server/pages/404.html +1 -1
  69. package/.next/standalone/.next/server/pages/500.html +1 -1
  70. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  71. package/.next/standalone/data/business-context.json +7 -4
  72. package/.next/standalone/data/copy/landing-landing-page-2026-02-20.md +1 -1
  73. package/.next/standalone/data/heartbeat-sessions.json +211 -10
  74. package/.next/standalone/data/hypotheses.json +2 -2
  75. package/.next/standalone/data/ideas.json +958 -449
  76. package/.next/standalone/data/implementations.json +136 -2
  77. package/.next/standalone/data/positioning.json +1 -1
  78. package/.next/standalone/data/reports/visuals/promo-launch.png +0 -0
  79. package/.next/standalone/data/reports/visuals/promo-ship-fast.png +0 -0
  80. package/.next/standalone/data/reports/visuals/promo-while-you-slept-v2.png +0 -0
  81. package/.next/standalone/data/reports/visuals/promo-while-you-slept-v3.png +0 -0
  82. package/.next/standalone/data/reports/visuals/promo-while-you-slept.png +0 -0
  83. package/.next/standalone/package.json +2 -2
  84. package/.next/standalone/scripts/analyze.ts +2 -2
  85. package/.next/standalone/scripts/implement.ts +5 -5
  86. package/.next/standalone/scripts/skills/social-media.ts +310 -9
  87. package/.next/static/chunks/{444-125b7b0fa8cbdb81.js → 444-1826396aef4dab2f.js} +1 -1
  88. package/.next/static/chunks/app/hypotheses/[id]/{page-65032da79ae146c5.js → page-8999ee91b824d378.js} +1 -1
  89. package/.next/static/chunks/app/hypotheses/page-6206bce440c44569.js +1 -0
  90. package/.next/static/chunks/app/ideas/[id]/{page-dc9746061e58eea5.js → page-89e3625db9017166.js} +1 -1
  91. package/.next/static/chunks/app/{page-fb66ff080390f20a.js → page-8ba52ac74c75461b.js} +1 -1
  92. package/.next/static/chunks/app/roadmap/[id]/{page-c8c4baf233e0d480.js → page-f437e783039534c4.js} +1 -1
  93. package/.next/static/chunks/app/roadmap/{page-b15554a207ed2813.js → page-6177b8774b4af79f.js} +1 -1
  94. package/.next/static/chunks/app/social/{page-6c61fb0c2546313e.js → page-69e480936711ccf2.js} +1 -1
  95. package/README.md +1 -1
  96. package/dist/bin/vibebusiness.js +22 -0
  97. package/dist/scripts/analyze.js +4 -3
  98. package/dist/scripts/chat.js +10 -2
  99. package/dist/scripts/generate-idea.js +1 -0
  100. package/dist/scripts/heartbeat.js +2265 -653
  101. package/dist/scripts/implement.js +5 -4
  102. package/dist/scripts/init.js +5 -0
  103. package/dist/scripts/scan.js +2 -1
  104. package/package.json +2 -2
  105. package/templates/commands/setup-posthog.md +116 -0
  106. package/.next/static/chunks/app/hypotheses/page-8314da4be7c533bd.js +0 -1
  107. /package/.next/static/{Tko0dnk2wKPorUxfNnm0x → zIIaTqrawBK1MmHg37JOr}/_buildManifest.js +0 -0
  108. /package/.next/static/{Tko0dnk2wKPorUxfNnm0x → zIIaTqrawBK1MmHg37JOr}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[594],{703:function(e,t,s){Promise.resolve().then(s.bind(s,1259)),Promise.resolve().then(s.bind(s,9534))},1259:function(e,t,s){"use strict";s.d(t,{default:function(){return j}});var a=s(7437),r=s(7648),l=s(9376),n=s(5466),i=s(2048),c=s(8896),d=s(8220),o=s(2718),m=s(5621),x=s(8728),h=s(2222),u=s(2023),p=s(1994),b=s(257);let g=[{href:"/",label:"Dashboard",icon:(0,a.jsx)(n.Z,{className:"w-5 h-5"})},{href:"/roadmap",label:"Roadmap",icon:(0,a.jsx)(i.Z,{className:"w-5 h-5"})},{href:"/goals",label:"Goals",icon:(0,a.jsx)(c.Z,{className:"w-5 h-5"})},{href:"/hypotheses",label:"Hypotheses",icon:(0,a.jsx)(d.Z,{className:"w-5 h-5"})},{href:"/social",label:"Social",icon:(0,a.jsx)(o.Z,{className:"w-5 h-5"})},{href:"/sessions",label:"Sessions",icon:(0,a.jsx)(m.Z,{className:"w-5 h-5"})},{href:"/settings",label:"Settings",icon:(0,a.jsx)(x.Z,{className:"w-5 h-5"})}];function j(e){let{children:t}=e,s=(0,l.usePathname)();return(0,a.jsxs)("div",{className:"min-h-screen flex",children:[(0,a.jsxs)("aside",{className:"w-64 bg-slate-900 text-white flex flex-col",children:[(0,a.jsx)("div",{className:"p-4 border-b border-slate-700",children:(0,a.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-emerald-500 rounded-lg flex items-center justify-center",children:(0,a.jsx)(h.Z,{className:"w-6 h-6 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"font-bold text-lg leading-tight",children:"Analyst"}),(0,a.jsx)("p",{className:"text-xs text-slate-400",children:b.env.NEXT_PUBLIC_PRODUCT_NAME||"Business"})]})]})}),(0,a.jsx)("nav",{className:"flex-1 p-4",children:(0,a.jsx)("ul",{className:"space-y-1",children:g.map(e=>{let t="/"===e.href?"/"===s:s.startsWith(e.href);return(0,a.jsx)("li",{children:(0,a.jsxs)(r.default,{href:e.href,className:(0,p.Z)("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",t?"bg-slate-800 text-white":"text-slate-400 hover:text-white hover:bg-slate-800"),children:[e.icon,(0,a.jsx)("span",{children:e.label})]})},e.href)})})}),(0,a.jsx)("div",{className:"p-4 border-t border-slate-700",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,a.jsx)(u.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Powered by Claude"})]})})]}),(0,a.jsx)("main",{className:"flex-1 overflow-auto",children:t})]})}},9534:function(e,t,s){"use strict";s.d(t,{default:function(){return el}});var a=s(7437),r=s(7648),l=s(2265),n=s(519),i=s(1817),c=s(2934),d=s(9388),o=s(5554),m=s(6865),x=s(875),h=s(407),u=s(1723),p=s(1947),b=s(221),g=s(5368),j=s(1047),f=s(4286),N=s(1102),v=s(2660),w=s(505),_=s(1239),y=s(525),Z=s(8736),S=s(3781),k=s(6362),C=s(5846),R=s(8896),P=s(933),I=s(1994),T=s(6153),A=s(9376),D=s(1671),F=s(9227),M=s(3276),q=s(7829),E=s(9076),O=s(6076);let U={primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",warning:"bg-amber-500 text-white hover:bg-amber-600 focus:ring-amber-500"};function L(e){let{ideaId:t,currentStage:s}=e,r=(0,A.useRouter)(),[n,c]=(0,l.useState)(!1),[o,m]=(0,l.useState)(null),[x,h]=(0,l.useState)(null),[p,b]=(0,l.useState)(""),g=function(e){switch(e){case"inbox":return[{toStage:"under_review",label:"Start Review",icon:(0,a.jsx)(u.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"rejected",label:"Reject",icon:(0,a.jsx)(d.Z,{className:"w-4 h-4"}),variant:"danger",requiresComment:!0}];case"under_review":return[{toStage:"approved",label:"Approve",icon:(0,a.jsx)(D.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"deferred",label:"Defer",icon:(0,a.jsx)(F.Z,{className:"w-4 h-4"}),variant:"warning",requiresComment:!0},{toStage:"rejected",label:"Reject",icon:(0,a.jsx)(d.Z,{className:"w-4 h-4"}),variant:"danger",requiresComment:!0}];case"approved":return[{toStage:"in_progress",label:"Start Implementation",icon:(0,a.jsx)(M.Z,{className:"w-4 h-4"}),variant:"primary",triggerImplementation:!0},{toStage:"deferred",label:"Defer",icon:(0,a.jsx)(F.Z,{className:"w-4 h-4"}),variant:"warning",requiresComment:!0}];case"in_progress":return[{toStage:"testing",label:"Move to Testing",icon:(0,a.jsx)(q.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"approved",label:"Back to Approved",icon:(0,a.jsx)(E.Z,{className:"w-4 h-4"}),variant:"secondary"}];case"testing":return[{toStage:"shipped",label:"Ship It!",icon:(0,a.jsx)(O.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"in_progress",label:"Back to In Progress",icon:(0,a.jsx)(E.Z,{className:"w-4 h-4"}),variant:"secondary"}];case"shipped":return[{toStage:"rolled_back",label:"Roll Back",icon:(0,a.jsx)(E.Z,{className:"w-4 h-4"}),variant:"danger",requiresComment:!0}];case"deferred":return[{toStage:"under_review",label:"Reopen Review",icon:(0,a.jsx)(u.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"rejected",label:"Reject",icon:(0,a.jsx)(d.Z,{className:"w-4 h-4"}),variant:"danger",requiresComment:!0}];case"rejected":case"rolled_back":return[{toStage:"inbox",label:"Reopen",icon:(0,a.jsx)(E.Z,{className:"w-4 h-4"}),variant:"secondary"}];default:return[]}}(s),j=async(e,s)=>{c(!0),m(e);try{(await fetch("/api/ideas/".concat(t,"/transition"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to_stage:e,comment:s})})).ok&&r.refresh()}catch(e){console.error("Failed to transition stage:",e)}finally{c(!1),m(null),h(null),b("")}},f=async()=>{c(!0),m("in_progress");try{let e=await fetch("/api/ideas/".concat(t,"/implement"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),s=await e.json();s.success?r.refresh():(console.error("Failed to start implementation:",s.error),alert(s.error||"Failed to start implementation"))}catch(e){console.error("Failed to start implementation:",e),alert("Failed to start implementation")}finally{c(!1),m(null)}},N=e=>{e.triggerImplementation?f():e.requiresComment?h(e):j(e.toStage)};return 0===g.length?null:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"text-sm text-slate-500",children:["Current stage: ",(0,a.jsx)("span",{className:"font-medium text-slate-700",children:T.yb[s]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:g.map(e=>(0,a.jsxs)("button",{onClick:()=>N(e),disabled:n,className:(0,I.Z)("btn gap-2",U[e.variant],n&&"opacity-75"),children:[o===e.toStage?(0,a.jsx)(i.Z,{className:"w-4 h-4 animate-spin"}):e.icon,(0,a.jsx)("span",{children:e.label})]},e.toStage))}),x&&(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-6 w-full max-w-md animate-slide-in",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-2",children:x.label}),(0,a.jsx)("p",{className:"text-sm text-slate-500 mb-4",children:"Please provide a reason for this action."}),(0,a.jsx)("textarea",{value:p,onChange:e=>b(e.target.value),placeholder:"Enter your comment...",className:"textarea h-24 mb-4",autoFocus:!0}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{onClick:()=>{h(null),b("")},className:"btn btn-secondary",disabled:n,children:"Cancel"}),(0,a.jsxs)("button",{onClick:()=>j(x.toStage,p),disabled:n||!p.trim(),className:(0,I.Z)("btn gap-2",U[x.variant]),children:[n?(0,a.jsx)(i.Z,{className:"w-4 h-4 animate-spin"}):x.icon,(0,a.jsx)("span",{children:"Confirm"})]})]})]})})]})}var G=s(2222),z=s(2369),B=s(4743);function V(e){let{ideaId:t,comments:s}=e,r=(0,A.useRouter)(),[n,c]=(0,l.useState)(""),[d,o]=(0,l.useState)(!1),m=async e=>{if(e.preventDefault(),n.trim()&&!d){o(!0);try{(await fetch("/api/ideas/".concat(t,"/comments"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({author:"human",author_name:"Founder",content:n.trim()})})).ok&&(c(""),r.refresh())}catch(e){console.error("Failed to add comment:",e)}finally{o(!1)}}};return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h3",{className:"font-semibold text-slate-900",children:"Discussion"}),(0,a.jsx)("div",{className:"space-y-3",children:0===s.length?(0,a.jsx)("p",{className:"text-sm text-slate-400 italic",children:"No comments yet"}):s.map(e=>(0,a.jsxs)("div",{className:(0,I.Z)("comment-bubble",e.author),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:["ai"===e.author?(0,a.jsx)("div",{className:"w-6 h-6 bg-emerald-100 rounded-full flex items-center justify-center",children:(0,a.jsx)(G.Z,{className:"w-3.5 h-3.5 text-emerald-600"})}):(0,a.jsx)("div",{className:"w-6 h-6 bg-blue-100 rounded-full flex items-center justify-center",children:(0,a.jsx)(z.Z,{className:"w-3.5 h-3.5 text-blue-600"})}),(0,a.jsx)("span",{className:"text-sm font-medium text-slate-700",children:e.author_name}),(0,a.jsx)("span",{className:"text-xs text-slate-400",children:new Date(e.created_at).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})]}),(0,a.jsx)("p",{className:"text-sm text-slate-600 whitespace-pre-wrap",children:e.content})]},e.id))}),(0,a.jsxs)("form",{onSubmit:m,className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:n,onChange:e=>c(e.target.value),placeholder:"Add a comment...",className:"input flex-1",disabled:d}),(0,a.jsx)("button",{type:"submit",disabled:!n.trim()||d,className:"btn btn-primary",children:d?(0,a.jsx)(i.Z,{className:"w-4 h-4 animate-spin"}):(0,a.jsx)(B.Z,{className:"w-4 h-4"})})]})]})}var H=s(7168),W=s(401),X=s(8867);let J={cloning:{label:"Cloning repository...",color:"text-blue-600"},branching:{label:"Creating branch...",color:"text-blue-600"},decomposing:{label:"Decomposing into sub-tasks...",color:"text-amber-600"},implementing:{label:"Implementing changes...",color:"text-violet-600"},testing:{label:"Running tests...",color:"text-cyan-600"},creating_pr:{label:"Creating PR...",color:"text-cyan-600"},completed:{label:"Completed",color:"text-emerald-600"},failed:{label:"Failed",color:"text-red-600"}};function K(e){let{ideaId:t,onComplete:s}=e,[r,n]=(0,l.useState)(null),[c,o]=(0,l.useState)(!0),[m,x]=(0,l.useState)(!1),[h,u]=(0,l.useState)(!1),p=async()=>{try{let e=await fetch("/api/ideas/".concat(t,"/implement")),a=await e.json();a.success&&a.data?(n(a.data),("completed"===a.data.status||"failed"===a.data.status)&&(null==s||s())):n(null)}catch(e){console.error("Failed to fetch implementation status:",e)}finally{o(!1)}};if((0,l.useEffect)(()=>{p();let e=setInterval(()=>{r&&"completed"!==r.status&&"failed"!==r.status&&p()},3e3);return()=>clearInterval(e)},[t]),(0,l.useEffect)(()=>{if(r&&("completed"===r.status||"failed"===r.status))return;let e=setInterval(p,3e3);return()=>clearInterval(e)},[null==r?void 0:r.status]),c)return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-slate-500",children:[(0,a.jsx)(i.Z,{className:"w-4 h-4 animate-spin"}),(0,a.jsx)("span",{className:"text-sm",children:"Loading..."})]});if(!r)return null;let g=J[r.status]||{label:r.status,color:"text-slate-600"},j=!["completed","failed"].includes(r.status);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("h3",{className:"font-semibold text-slate-900 flex items-center gap-2",children:[(0,a.jsx)(b.Z,{className:"w-4 h-4"}),"Implementation Progress"]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[j?(0,a.jsx)(i.Z,{className:(0,I.Z)("w-5 h-5 animate-spin",g.color)}):"completed"===r.status?(0,a.jsx)(D.Z,{className:"w-5 h-5 text-emerald-600"}):(0,a.jsx)(d.Z,{className:"w-5 h-5 text-red-600"}),(0,a.jsx)("span",{className:(0,I.Z)("font-medium",g.color),children:g.label}),j&&(0,a.jsx)("button",{onClick:p,className:"p-1 text-slate-400 hover:text-slate-600",title:"Refresh",children:(0,a.jsx)(H.Z,{className:"w-4 h-4"})})]}),(0,a.jsxs)("div",{className:"p-3 bg-slate-50 rounded-lg border border-slate-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(S.Z,{className:"w-4 h-4 text-slate-500"}),(0,a.jsx)("code",{className:"flex-1 bg-slate-200 px-2 py-0.5 rounded font-mono text-xs",children:r.branch_name}),(0,a.jsx)("button",{onClick:()=>{(null==r?void 0:r.branch_name)&&(navigator.clipboard.writeText(r.branch_name),u(!0),setTimeout(()=>u(!1),2e3))},className:"p-1 text-slate-400 hover:text-slate-600",title:"Copy branch name",children:h?(0,a.jsx)(W.Z,{className:"w-4 h-4 text-emerald-600"}):(0,a.jsx)(X.Z,{className:"w-4 h-4"})})]}),(0,a.jsxs)("div",{className:"mt-2 text-xs text-slate-500",children:["Repo: ",r.repo_name," • Workspace: ",r.workspace_path]}),r.pr_url&&(0,a.jsxs)("a",{href:r.pr_url,target:"_blank",rel:"noopener noreferrer",className:"mt-2 flex items-center gap-1 text-sm text-blue-600 hover:underline",children:[(0,a.jsx)("span",{children:"View Pull Request"}),(0,a.jsx)(k.Z,{className:"w-3 h-3"})]})]}),r.error_message&&(0,a.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700",children:r.error_message}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:()=>x(!m),className:"text-sm text-slate-500 hover:text-slate-700",children:[m?"Hide":"Show"," logs (",r.logs.length,")"]}),m&&(0,a.jsx)("div",{className:"mt-2 p-3 bg-slate-900 rounded-lg max-h-64 overflow-y-auto",children:(0,a.jsx)("pre",{className:"text-xs text-slate-300 font-mono whitespace-pre-wrap",children:r.logs.join("\n")})})]})]})}function Q(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}function $(e){let{title:t,icon:s,children:r}=e;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 font-semibold text-slate-900",children:[s,(0,a.jsx)("span",{children:t})]}),(0,a.jsx)("div",{className:"text-sm text-slate-600",children:r})]})}function Y(e){let{status:t}=e;switch(t){case"pending":return(0,a.jsx)(n.Z,{className:"w-4 h-4 text-slate-400"});case"in_progress":return(0,a.jsx)(i.Z,{className:"w-4 h-4 text-violet-500 animate-spin"});case"completed":return(0,a.jsx)(c.Z,{className:"w-4 h-4 text-emerald-500"});case"failed":return(0,a.jsx)(d.Z,{className:"w-4 h-4 text-red-500"})}}function ee(e){return e?new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):""}function et(e){let{failureType:t}=e;if(!t)return null;let s={timeout:{text:"timeout",className:"bg-orange-100 text-orange-700"},error:{text:"error",className:"bg-red-100 text-red-700"},tests_failed:{text:"tests failed",className:"bg-amber-100 text-amber-700"}}[t];return(0,a.jsx)("span",{className:(0,I.Z)("text-xs px-1.5 py-0.5 rounded font-medium",s.className),children:s.text})}function es(e){let{subTasks:t}=e,[s,r]=(0,l.useState)(null);if(0===t.length)return null;let n=t.filter(e=>"completed"===e.status).length,i=t.filter(e=>"failed"===e.status).length,c=Math.round(n/t.length*100);return(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsxs)($,{title:"Sub-Tasks",icon:(0,a.jsx)(o.Z,{className:"w-4 h-4 text-violet-500"}),children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs mb-1",children:[(0,a.jsxs)("span",{className:"text-slate-500",children:[n,"/",t.length," done",i>0&&(0,a.jsxs)("span",{className:"text-red-500 ml-1",children:["(",i," failed)"]})]}),(0,a.jsxs)("span",{className:"text-slate-500",children:[c,"%"]})]}),(0,a.jsx)("div",{className:"w-full bg-slate-200 rounded-full h-2",children:(0,a.jsx)("div",{className:(0,I.Z)("h-2 rounded-full transition-all",i>0?"bg-red-500":"bg-emerald-500"),style:{width:"".concat(c,"%")}})})]}),(0,a.jsx)("ul",{className:"space-y-2",children:t.map(e=>{let t=s===e.id;return(0,a.jsxs)("li",{className:"border border-slate-100 rounded-lg",children:[(0,a.jsxs)("button",{onClick:()=>r(t?null:e.id),className:"w-full flex items-center gap-2 p-2 text-left hover:bg-slate-50 rounded-lg",children:[(0,a.jsx)(Y,{status:e.status}),(0,a.jsx)("span",{className:(0,I.Z)("flex-1 text-sm","completed"===e.status&&"line-through text-slate-400","failed"===e.status&&"text-red-600"),children:e.title}),"failed"===e.status&&e.failure_type&&(0,a.jsx)(et,{failureType:e.failure_type}),e.has_uncommitted_changes&&(0,a.jsx)("span",{title:"Uncommitted changes in workspace",children:(0,a.jsx)(m.Z,{className:"w-3.5 h-3.5 text-amber-500"})}),t?(0,a.jsx)(x.Z,{className:"w-3 h-3 text-slate-400"}):(0,a.jsx)(h.Z,{className:"w-3 h-3 text-slate-400"})]}),t&&(0,a.jsxs)("div",{className:"px-8 pb-3 space-y-3",children:[(0,a.jsx)("p",{className:"text-xs text-slate-600 whitespace-pre-wrap",children:e.description}),(e.duration_ms||e.lines_added||e.lines_removed)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-3 text-xs text-slate-500",children:[e.duration_ms&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(u.Z,{className:"w-3 h-3"}),function(e){if(!e)return"";let t=Math.floor(e/1e3),s=Math.floor(t/60),a=Math.floor(s/60);return a>0?"".concat(a,"h ").concat(s%60,"m"):s>0?"".concat(s,"m ").concat(t%60,"s"):"".concat(t,"s")}(e.duration_ms)]}),(e.lines_added||e.lines_removed)&&(0,a.jsxs)("span",{className:"flex items-center gap-1 font-mono",children:[(0,a.jsx)(p.Z,{className:"w-3 h-3"}),(0,a.jsxs)("span",{className:"text-emerald-600",children:["+",e.lines_added||0]}),(0,a.jsxs)("span",{className:"text-red-600",children:["-",e.lines_removed||0]})]})]}),e.files_changed&&e.files_changed.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-600 flex items-center gap-1",children:[(0,a.jsx)(p.Z,{className:"w-3 h-3"}),"Files Changed:"]}),(0,a.jsx)("ul",{className:"mt-1",children:e.files_changed.map(e=>(0,a.jsx)("li",{className:"text-xs text-slate-600 font-mono",children:e},e))})]}),e.files_to_modify.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-medium text-slate-500",children:"Planned Files:"}),(0,a.jsx)("ul",{className:"mt-1",children:e.files_to_modify.map(e=>(0,a.jsx)("li",{className:"text-xs text-slate-400 font-mono",children:e},e))})]}),e.error_message&&(0,a.jsx)("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-xs text-red-700 whitespace-pre-wrap",children:e.error_message}),e.output_snippet&&(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-slate-500 cursor-pointer flex items-center gap-1",children:[(0,a.jsx)(b.Z,{className:"w-3 h-3"}),"Output",(0,a.jsx)(h.Z,{className:"w-3 h-3 group-open:rotate-90 transition-transform"})]}),(0,a.jsx)("pre",{className:"mt-1 p-2 bg-slate-50 border border-slate-200 rounded text-xs text-slate-600 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:e.output_snippet})]}),e.has_uncommitted_changes&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-2 bg-amber-50 border border-amber-200 rounded text-xs text-amber-700",children:[(0,a.jsx)(m.Z,{className:"w-3.5 h-3.5"}),"Uncommitted changes in workspace"]}),e.commit_hash&&(0,a.jsxs)("div",{className:"text-xs text-slate-400",children:["Commit: ",(0,a.jsx)("code",{className:"bg-slate-100 px-1 rounded",children:e.commit_hash.slice(0,8)})]}),(e.started_at||e.completed_at)&&(0,a.jsxs)("div",{className:"text-xs text-slate-400",children:[e.started_at&&(0,a.jsxs)("span",{children:["Started: ",ee(e.started_at)]}),e.completed_at&&(0,a.jsxs)("span",{className:"ml-3",children:["Finished: ",ee(e.completed_at)]})]})]})]},e.id)})})]})})}function ea(e){let{status:t}=e;switch(t){case"met":return(0,a.jsx)(c.Z,{className:"w-4 h-4 text-emerald-500"});case"partially_met":return(0,a.jsx)(m.Z,{className:"w-4 h-4 text-amber-500"});case"not_met":return(0,a.jsx)(d.Z,{className:"w-4 h-4 text-red-500"});case"no_data":return(0,a.jsx)(g.Z,{className:"w-4 h-4 text-slate-400"});default:return(0,a.jsx)(j.Z,{className:"w-4 h-4 text-slate-400"})}}function er(e){let{verification:t}=e;return(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsxs)($,{title:"Post-Ship Verification",icon:(0,a.jsx)(f.Z,{className:"w-4 h-4 text-emerald-500"}),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,a.jsx)("span",{className:(0,I.Z)("text-xs font-medium px-2 py-1 rounded",T.aR[t.status]),children:T.Wb[t.status]}),t.confidence&&(0,a.jsxs)("span",{className:"text-xs text-slate-500",children:["Confidence: ",t.confidence]})]}),t.summary&&(0,a.jsx)("p",{className:"text-sm text-slate-700 mb-4",children:t.summary}),t.requires_human_review&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-2 mb-4 bg-amber-50 border border-amber-200 rounded text-xs text-amber-700",children:[(0,a.jsx)(N.Z,{className:"w-3.5 h-3.5 flex-shrink-0"}),(0,a.jsxs)("span",{children:["Requires human review: ",t.human_review_reason||"Review needed"]})]}),t.metric_evaluations.length>0&&(0,a.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-slate-500 uppercase",children:"Metric Results"}),(0,a.jsx)("ul",{className:"space-y-1.5",children:t.metric_evaluations.map((e,t)=>(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)(ea,{status:e.status}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-xs text-slate-700",children:e.metric}),(0,a.jsx)("p",{className:"text-xs text-slate-500 mt-0.5",children:e.evidence})]})]},t))})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-4 text-xs text-slate-400 pt-3 border-t border-slate-100",children:[t.first_evaluated_at&&(0,a.jsxs)("span",{children:["First evaluated: ",Q(t.first_evaluated_at)]}),t.evaluation_count>0&&(0,a.jsxs)("span",{children:["Evaluations: ",t.evaluation_count]}),t.next_evaluation_after&&(0,a.jsxs)("span",{children:["Next check: ",new Date(t.next_evaluation_after).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]}),t.follow_up_idea_ids.length>0&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-100",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-slate-500",children:"Follow-up ideas:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 mt-1",children:t.follow_up_idea_ids.map(e=>(0,a.jsx)(r.default,{href:"/ideas/".concat(e),className:"text-xs text-blue-600 hover:underline bg-blue-50 px-1.5 py-0.5 rounded",children:e},e))})]})]})})}function el(e){let{idea:t,linkedGoal:s}=e;return(0,a.jsxs)("div",{className:"max-w-4xl mx-auto p-6",children:[(0,a.jsxs)(r.default,{href:"/",className:"inline-flex items-center gap-2 text-sm text-slate-500 hover:text-slate-700 mb-6",children:[(0,a.jsx)(v.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Back to Dashboard"})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6 mb-6",children:[(0,a.jsx)("div",{className:"flex items-start justify-between mb-4",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:(0,I.Z)("priority-badge",T.Gs[t.priority]),children:T.rF[t.priority]}),(0,a.jsx)("span",{className:(0,I.Z)("category-badge",T.pG[t.category]),children:T.Hs[t.category]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:(0,I.Z)("stage-indicator",T.lv[t.stage])}),(0,a.jsx)("span",{className:"text-xs text-slate-500",children:T.yb[t.stage]})]})]}),(0,a.jsx)("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:t.title}),(0,a.jsx)("p",{className:"text-slate-600",children:t.summary})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-6 text-sm text-slate-500 pt-4 border-t border-slate-100",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(w.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Created ",Q(t.created_at)]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(_.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Effort: ",T.bi[t.effort]]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(y.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Impact: ",T.bi[t.impact]]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Z.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Source: ",T.Vr[t.source.type]]})]})]}),t.tags.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-4",children:t.tags.map(e=>(0,a.jsx)("span",{className:"px-2 py-1 bg-slate-100 text-slate-600 text-xs rounded",children:e},e))}),t.implementation.branch_name&&(0,a.jsx)("div",{className:"mt-4 p-3 bg-slate-50 rounded-lg border border-slate-200",children:(0,a.jsxs)("div",{className:"flex items-center gap-4 text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-slate-600",children:[(0,a.jsx)(S.Z,{className:"w-4 h-4"}),(0,a.jsx)("code",{className:"bg-slate-200 px-2 py-0.5 rounded",children:t.implementation.branch_name})]}),t.implementation.pr_url&&(0,a.jsxs)("a",{href:t.implementation.pr_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-blue-600 hover:underline",children:[(0,a.jsx)("span",{children:"View PR"}),(0,a.jsx)(k.Z,{className:"w-3 h-3"})]})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-6",children:[(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)($,{title:"Context",icon:(0,a.jsx)(C.Z,{className:"w-4 h-4 text-amber-500"}),children:(0,a.jsx)("p",{className:"whitespace-pre-wrap",children:t.context})})}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)($,{title:"Rationale",icon:(0,a.jsx)(R.Z,{className:"w-4 h-4 text-blue-500"}),children:(0,a.jsx)("p",{className:"whitespace-pre-wrap",children:t.rationale})})}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)($,{title:"Implementation Plan",icon:(0,a.jsx)(P.Z,{className:"w-4 h-4 text-emerald-500"}),children:(0,a.jsx)("div",{className:"whitespace-pre-wrap",children:t.implementation_plan})})}),t.implementation.sub_tasks&&t.implementation.sub_tasks.length>0&&(0,a.jsx)(es,{subTasks:t.implementation.sub_tasks}),"shipped"===t.stage&&t.verification&&(0,a.jsx)(er,{verification:t.verification}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)($,{title:"Success Metrics",icon:(0,a.jsx)(y.Z,{className:"w-4 h-4 text-violet-500"}),children:(0,a.jsx)("ul",{className:"list-disc list-inside space-y-1",children:t.success_metrics.map((e,t)=>(0,a.jsx)("li",{children:e},t))})})})]}),(0,a.jsxs)("div",{className:"space-y-6",children:[(s||t.expected_impact)&&(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 font-semibold text-slate-900 mb-3",children:[(0,a.jsx)(R.Z,{className:"w-4 h-4 text-emerald-500"}),(0,a.jsx)("span",{children:"Goal Alignment"})]}),s?(0,a.jsxs)(r.default,{href:"/goals/".concat(s.id),className:"block p-3 bg-emerald-50 border border-emerald-200 rounded-lg hover:border-emerald-300 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-emerald-800",children:s.title}),(0,a.jsx)(k.Z,{className:"w-3 h-3 text-emerald-600"})]}),(0,a.jsx)("p",{className:"text-xs text-emerald-600 line-clamp-2",children:s.description})]}):t.goal_id?(0,a.jsxs)("p",{className:"text-sm text-slate-500",children:["Linked to goal: ",(0,a.jsx)("code",{className:"text-xs bg-slate-100 px-1 rounded",children:t.goal_id})]}):null,t.expected_impact&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-100",children:[(0,a.jsx)("p",{className:"text-xs text-slate-500 uppercase font-medium mb-1",children:"Expected Impact"}),(0,a.jsx)("p",{className:"text-sm text-slate-700",children:t.expected_impact})]})]}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)(L,{ideaId:t.id,currentStage:t.stage})}),["in_progress","testing","shipped","rolled_back"].includes(t.stage)&&(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)(K,{ideaId:t.id})}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)(V,{ideaId:t.id,comments:t.comments})}),t.source.files_analyzed&&t.source.files_analyzed.length>0&&(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:[(0,a.jsx)("h3",{className:"font-semibold text-slate-900 mb-3",children:"Files Analyzed"}),(0,a.jsx)("ul",{className:"space-y-1",children:t.source.files_analyzed.map((e,t)=>(0,a.jsx)("li",{className:"text-xs text-slate-500 font-mono truncate",children:e},t))})]})]})]})]})}},6153:function(e,t,s){"use strict";s.d(t,{G:function(){return i},GK:function(){return Z},Gs:function(){return o},Hs:function(){return a},PN:function(){return u},PW:function(){return _},Q_:function(){return p},R$:function(){return v},Vr:function(){return m},Wb:function(){return h},aR:function(){return x},bi:function(){return c},en:function(){return N},i2:function(){return f},kT:function(){return b},l5:function(){return g},lE:function(){return w},lv:function(){return n},pG:function(){return r},rF:function(){return d},tV:function(){return j},tl:function(){return y},xP:function(){return S},yb:function(){return l}});let a={product:"Product",ux_design:"UX/Design",growth:"Growth",performance:"Performance",tech_debt:"Tech Debt",security:"Security",infrastructure:"Infrastructure",content:"Content",analytics:"Analytics",integration:"Integration"},r={product:"bg-blue-100 text-blue-800",ux_design:"bg-purple-100 text-purple-800",growth:"bg-green-100 text-green-800",performance:"bg-orange-100 text-orange-800",tech_debt:"bg-yellow-100 text-yellow-800",security:"bg-red-100 text-red-800",infrastructure:"bg-gray-100 text-gray-800",content:"bg-pink-100 text-pink-800",analytics:"bg-cyan-100 text-cyan-800",integration:"bg-indigo-100 text-indigo-800"},l={inbox:"Inbox",under_review:"Under Review",approved:"Approved",in_progress:"In Progress",testing:"Testing",shipped:"Shipped",deferred:"Deferred",rejected:"Rejected",rolled_back:"Rolled Back"},n={inbox:"bg-amber-500",under_review:"bg-blue-500",approved:"bg-emerald-500",in_progress:"bg-violet-500",testing:"bg-cyan-500",shipped:"bg-green-500",deferred:"bg-gray-500",rejected:"bg-red-500",rolled_back:"bg-orange-500"},i=["inbox","under_review","approved","in_progress","testing","shipped"],c={xs:"XS",s:"S",m:"M",l:"L",xl:"XL"},d={critical:"Critical",high:"High",medium:"Medium",low:"Low"},o={critical:"bg-red-100 text-red-800 border-red-300",high:"bg-orange-100 text-orange-800 border-orange-300",medium:"bg-yellow-100 text-yellow-800 border-yellow-300",low:"bg-gray-100 text-gray-800 border-gray-300"},m={codebase_analysis:"Codebase Analysis",metrics_review:"Metrics Review",market_research:"Market Research",seo_audit:"SEO Audit",manual:"Manual"},x={pending:"bg-slate-100 text-slate-700",validated:"bg-emerald-100 text-emerald-800",needs_investigation:"bg-amber-100 text-amber-800",inconclusive:"bg-slate-100 text-slate-600",invalidated:"bg-red-100 text-red-800"},h={pending:"Pending",validated:"Validated",needs_investigation:"Needs Investigation",inconclusive:"Inconclusive",invalidated:"Invalidated"},u={ship:"Ship",update:"Update",milestone:"Milestone",digest:"Digest",manual:"Manual"},p={ship:"bg-green-100 text-green-800",update:"bg-blue-100 text-blue-800",milestone:"bg-amber-100 text-amber-800",digest:"bg-purple-100 text-purple-800",manual:"bg-slate-100 text-slate-800"},b={acquisition:"Acquisition",activation:"Activation",retention:"Retention",revenue:"Revenue",referral:"Referral"},g={acquisition:"bg-blue-100 text-blue-800",activation:"bg-emerald-100 text-emerald-800",retention:"bg-purple-100 text-purple-800",revenue:"bg-amber-100 text-amber-800",referral:"bg-pink-100 text-pink-800"},j={on_track:"On Track",at_risk:"At Risk",behind:"Behind",achieved:"Achieved"},f={on_track:"bg-emerald-100 text-emerald-800 border-emerald-300",at_risk:"bg-amber-100 text-amber-800 border-amber-300",behind:"bg-red-100 text-red-800 border-red-300",achieved:"bg-blue-100 text-blue-800 border-blue-300"},N={manual:"Manual",rest_api:"REST API",posthog:"PostHog",firestore:"Firestore",stripe:"Stripe",whatsapp:"WhatsApp"},v={stated:"Stated",testing:"Testing",validated:"Validated",invalidated:"Invalidated",deferred:"Deferred"},w={stated:"bg-slate-100 text-slate-800 border-slate-300",testing:"bg-amber-100 text-amber-800 border-amber-300",validated:"bg-emerald-100 text-emerald-800 border-emerald-300",invalidated:"bg-red-100 text-red-800 border-red-300",deferred:"bg-slate-100 text-slate-500 border-slate-200"},_={acquisition:"Acquisition",engagement:"Engagement",conversion:"Conversion",monetization:"Monetization"},y={acquisition:"bg-blue-100 text-blue-800",engagement:"bg-purple-100 text-purple-800",conversion:"bg-amber-100 text-amber-800",monetization:"bg-emerald-100 text-emerald-800"},Z={planned:"Planned",active:"Active",completed:"Completed",paused:"Paused"},S={planned:"bg-slate-100 text-slate-700 border-slate-300",active:"bg-blue-100 text-blue-800 border-blue-300",completed:"bg-emerald-100 text-emerald-800 border-emerald-300",paused:"bg-amber-100 text-amber-800 border-amber-300"}}},function(e){e.O(0,[746,59,971,117,744],function(){return e(e.s=703)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[594],{703:function(e,t,s){Promise.resolve().then(s.bind(s,1259)),Promise.resolve().then(s.bind(s,9534))},1259:function(e,t,s){"use strict";s.d(t,{default:function(){return j}});var a=s(7437),r=s(7648),l=s(9376),n=s(5466),i=s(2048),c=s(8896),d=s(8220),o=s(2718),m=s(5621),x=s(8728),h=s(2222),u=s(2023),p=s(1994),b=s(257);let g=[{href:"/",label:"Dashboard",icon:(0,a.jsx)(n.Z,{className:"w-5 h-5"})},{href:"/roadmap",label:"Roadmap",icon:(0,a.jsx)(i.Z,{className:"w-5 h-5"})},{href:"/goals",label:"Goals",icon:(0,a.jsx)(c.Z,{className:"w-5 h-5"})},{href:"/hypotheses",label:"Hypotheses",icon:(0,a.jsx)(d.Z,{className:"w-5 h-5"})},{href:"/social",label:"Social",icon:(0,a.jsx)(o.Z,{className:"w-5 h-5"})},{href:"/sessions",label:"Sessions",icon:(0,a.jsx)(m.Z,{className:"w-5 h-5"})},{href:"/settings",label:"Settings",icon:(0,a.jsx)(x.Z,{className:"w-5 h-5"})}];function j(e){let{children:t}=e,s=(0,l.usePathname)();return(0,a.jsxs)("div",{className:"min-h-screen flex",children:[(0,a.jsxs)("aside",{className:"w-64 bg-slate-900 text-white flex flex-col",children:[(0,a.jsx)("div",{className:"p-4 border-b border-slate-700",children:(0,a.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-emerald-500 rounded-lg flex items-center justify-center",children:(0,a.jsx)(h.Z,{className:"w-6 h-6 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"font-bold text-lg leading-tight",children:"Analyst"}),(0,a.jsx)("p",{className:"text-xs text-slate-400",children:b.env.NEXT_PUBLIC_PRODUCT_NAME||"Business"})]})]})}),(0,a.jsx)("nav",{className:"flex-1 p-4",children:(0,a.jsx)("ul",{className:"space-y-1",children:g.map(e=>{let t="/"===e.href?"/"===s:s.startsWith(e.href);return(0,a.jsx)("li",{children:(0,a.jsxs)(r.default,{href:e.href,className:(0,p.Z)("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",t?"bg-slate-800 text-white":"text-slate-400 hover:text-white hover:bg-slate-800"),children:[e.icon,(0,a.jsx)("span",{children:e.label})]})},e.href)})})}),(0,a.jsx)("div",{className:"p-4 border-t border-slate-700",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,a.jsx)(u.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Powered by Claude"})]})})]}),(0,a.jsx)("main",{className:"flex-1 overflow-auto",children:t})]})}},9534:function(e,t,s){"use strict";s.d(t,{default:function(){return el}});var a=s(7437),r=s(7648),l=s(2265),n=s(519),i=s(1817),c=s(2934),d=s(9388),o=s(5554),m=s(6865),x=s(875),h=s(407),u=s(1723),p=s(1947),b=s(221),g=s(5368),j=s(1047),f=s(4286),N=s(1102),v=s(2660),w=s(505),_=s(1239),y=s(525),Z=s(8736),S=s(3781),k=s(6362),C=s(5846),R=s(8896),P=s(933),I=s(1994),T=s(6153),A=s(9376),D=s(1671),F=s(9227),M=s(3276),q=s(7829),E=s(9076),O=s(6076);let U={primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",warning:"bg-amber-500 text-white hover:bg-amber-600 focus:ring-amber-500"};function L(e){let{ideaId:t,currentStage:s}=e,r=(0,A.useRouter)(),[n,c]=(0,l.useState)(!1),[o,m]=(0,l.useState)(null),[x,h]=(0,l.useState)(null),[p,b]=(0,l.useState)(""),g=function(e){switch(e){case"inbox":return[{toStage:"under_review",label:"Start Review",icon:(0,a.jsx)(u.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"rejected",label:"Reject",icon:(0,a.jsx)(d.Z,{className:"w-4 h-4"}),variant:"danger",requiresComment:!0}];case"under_review":return[{toStage:"approved",label:"Approve",icon:(0,a.jsx)(D.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"deferred",label:"Defer",icon:(0,a.jsx)(F.Z,{className:"w-4 h-4"}),variant:"warning",requiresComment:!0},{toStage:"rejected",label:"Reject",icon:(0,a.jsx)(d.Z,{className:"w-4 h-4"}),variant:"danger",requiresComment:!0}];case"approved":return[{toStage:"in_progress",label:"Start Implementation",icon:(0,a.jsx)(M.Z,{className:"w-4 h-4"}),variant:"primary",triggerImplementation:!0},{toStage:"deferred",label:"Defer",icon:(0,a.jsx)(F.Z,{className:"w-4 h-4"}),variant:"warning",requiresComment:!0}];case"in_progress":return[{toStage:"testing",label:"Move to Testing",icon:(0,a.jsx)(q.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"approved",label:"Back to Approved",icon:(0,a.jsx)(E.Z,{className:"w-4 h-4"}),variant:"secondary"}];case"testing":return[{toStage:"shipped",label:"Ship It!",icon:(0,a.jsx)(O.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"in_progress",label:"Back to In Progress",icon:(0,a.jsx)(E.Z,{className:"w-4 h-4"}),variant:"secondary"}];case"shipped":return[{toStage:"rolled_back",label:"Roll Back",icon:(0,a.jsx)(E.Z,{className:"w-4 h-4"}),variant:"danger",requiresComment:!0}];case"deferred":return[{toStage:"under_review",label:"Reopen Review",icon:(0,a.jsx)(u.Z,{className:"w-4 h-4"}),variant:"primary"},{toStage:"rejected",label:"Reject",icon:(0,a.jsx)(d.Z,{className:"w-4 h-4"}),variant:"danger",requiresComment:!0}];case"rejected":case"rolled_back":return[{toStage:"inbox",label:"Reopen",icon:(0,a.jsx)(E.Z,{className:"w-4 h-4"}),variant:"secondary"}];default:return[]}}(s),j=async(e,s)=>{c(!0),m(e);try{(await fetch("/api/ideas/".concat(t,"/transition"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to_stage:e,comment:s})})).ok&&r.refresh()}catch(e){console.error("Failed to transition stage:",e)}finally{c(!1),m(null),h(null),b("")}},f=async()=>{c(!0),m("in_progress");try{let e=await fetch("/api/ideas/".concat(t,"/implement"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),s=await e.json();s.success?r.refresh():(console.error("Failed to start implementation:",s.error),alert(s.error||"Failed to start implementation"))}catch(e){console.error("Failed to start implementation:",e),alert("Failed to start implementation")}finally{c(!1),m(null)}},N=e=>{e.triggerImplementation?f():e.requiresComment?h(e):j(e.toStage)};return 0===g.length?null:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"text-sm text-slate-500",children:["Current stage: ",(0,a.jsx)("span",{className:"font-medium text-slate-700",children:T.yb[s]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:g.map(e=>(0,a.jsxs)("button",{onClick:()=>N(e),disabled:n,className:(0,I.Z)("btn gap-2",U[e.variant],n&&"opacity-75"),children:[o===e.toStage?(0,a.jsx)(i.Z,{className:"w-4 h-4 animate-spin"}):e.icon,(0,a.jsx)("span",{children:e.label})]},e.toStage))}),x&&(0,a.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-6 w-full max-w-md animate-slide-in",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-2",children:x.label}),(0,a.jsx)("p",{className:"text-sm text-slate-500 mb-4",children:"Please provide a reason for this action."}),(0,a.jsx)("textarea",{value:p,onChange:e=>b(e.target.value),placeholder:"Enter your comment...",className:"textarea h-24 mb-4",autoFocus:!0}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{onClick:()=>{h(null),b("")},className:"btn btn-secondary",disabled:n,children:"Cancel"}),(0,a.jsxs)("button",{onClick:()=>j(x.toStage,p),disabled:n||!p.trim(),className:(0,I.Z)("btn gap-2",U[x.variant]),children:[n?(0,a.jsx)(i.Z,{className:"w-4 h-4 animate-spin"}):x.icon,(0,a.jsx)("span",{children:"Confirm"})]})]})]})})]})}var G=s(2222),z=s(2369),B=s(4743);function V(e){let{ideaId:t,comments:s}=e,r=(0,A.useRouter)(),[n,c]=(0,l.useState)(""),[d,o]=(0,l.useState)(!1),m=async e=>{if(e.preventDefault(),n.trim()&&!d){o(!0);try{(await fetch("/api/ideas/".concat(t,"/comments"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({author:"human",author_name:"Founder",content:n.trim()})})).ok&&(c(""),r.refresh())}catch(e){console.error("Failed to add comment:",e)}finally{o(!1)}}};return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h3",{className:"font-semibold text-slate-900",children:"Discussion"}),(0,a.jsx)("div",{className:"space-y-3",children:0===s.length?(0,a.jsx)("p",{className:"text-sm text-slate-400 italic",children:"No comments yet"}):s.map(e=>(0,a.jsxs)("div",{className:(0,I.Z)("comment-bubble",e.author),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:["ai"===e.author?(0,a.jsx)("div",{className:"w-6 h-6 bg-emerald-100 rounded-full flex items-center justify-center",children:(0,a.jsx)(G.Z,{className:"w-3.5 h-3.5 text-emerald-600"})}):(0,a.jsx)("div",{className:"w-6 h-6 bg-blue-100 rounded-full flex items-center justify-center",children:(0,a.jsx)(z.Z,{className:"w-3.5 h-3.5 text-blue-600"})}),(0,a.jsx)("span",{className:"text-sm font-medium text-slate-700",children:e.author_name}),(0,a.jsx)("span",{className:"text-xs text-slate-400",children:new Date(e.created_at).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})]}),(0,a.jsx)("p",{className:"text-sm text-slate-600 whitespace-pre-wrap",children:e.content})]},e.id))}),(0,a.jsxs)("form",{onSubmit:m,className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:n,onChange:e=>c(e.target.value),placeholder:"Add a comment...",className:"input flex-1",disabled:d}),(0,a.jsx)("button",{type:"submit",disabled:!n.trim()||d,className:"btn btn-primary",children:d?(0,a.jsx)(i.Z,{className:"w-4 h-4 animate-spin"}):(0,a.jsx)(B.Z,{className:"w-4 h-4"})})]})]})}var H=s(7168),W=s(401),X=s(8867);let J={cloning:{label:"Cloning repository...",color:"text-blue-600"},branching:{label:"Creating branch...",color:"text-blue-600"},decomposing:{label:"Decomposing into sub-tasks...",color:"text-amber-600"},implementing:{label:"Implementing changes...",color:"text-violet-600"},testing:{label:"Running tests...",color:"text-cyan-600"},creating_pr:{label:"Creating PR...",color:"text-cyan-600"},completed:{label:"Completed",color:"text-emerald-600"},failed:{label:"Failed",color:"text-red-600"}};function K(e){let{ideaId:t,onComplete:s}=e,[r,n]=(0,l.useState)(null),[c,o]=(0,l.useState)(!0),[m,x]=(0,l.useState)(!1),[h,u]=(0,l.useState)(!1),p=async()=>{try{let e=await fetch("/api/ideas/".concat(t,"/implement")),a=await e.json();a.success&&a.data?(n(a.data),("completed"===a.data.status||"failed"===a.data.status)&&(null==s||s())):n(null)}catch(e){console.error("Failed to fetch implementation status:",e)}finally{o(!1)}};if((0,l.useEffect)(()=>{p();let e=setInterval(()=>{r&&"completed"!==r.status&&"failed"!==r.status&&p()},3e3);return()=>clearInterval(e)},[t]),(0,l.useEffect)(()=>{if(r&&("completed"===r.status||"failed"===r.status))return;let e=setInterval(p,3e3);return()=>clearInterval(e)},[null==r?void 0:r.status]),c)return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-slate-500",children:[(0,a.jsx)(i.Z,{className:"w-4 h-4 animate-spin"}),(0,a.jsx)("span",{className:"text-sm",children:"Loading..."})]});if(!r)return null;let g=J[r.status]||{label:r.status,color:"text-slate-600"},j=!["completed","failed"].includes(r.status);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("h3",{className:"font-semibold text-slate-900 flex items-center gap-2",children:[(0,a.jsx)(b.Z,{className:"w-4 h-4"}),"Implementation Progress"]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[j?(0,a.jsx)(i.Z,{className:(0,I.Z)("w-5 h-5 animate-spin",g.color)}):"completed"===r.status?(0,a.jsx)(D.Z,{className:"w-5 h-5 text-emerald-600"}):(0,a.jsx)(d.Z,{className:"w-5 h-5 text-red-600"}),(0,a.jsx)("span",{className:(0,I.Z)("font-medium",g.color),children:g.label}),j&&(0,a.jsx)("button",{onClick:p,className:"p-1 text-slate-400 hover:text-slate-600",title:"Refresh",children:(0,a.jsx)(H.Z,{className:"w-4 h-4"})})]}),(0,a.jsxs)("div",{className:"p-3 bg-slate-50 rounded-lg border border-slate-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(S.Z,{className:"w-4 h-4 text-slate-500"}),(0,a.jsx)("code",{className:"flex-1 bg-slate-200 px-2 py-0.5 rounded font-mono text-xs",children:r.branch_name}),(0,a.jsx)("button",{onClick:()=>{(null==r?void 0:r.branch_name)&&(navigator.clipboard.writeText(r.branch_name),u(!0),setTimeout(()=>u(!1),2e3))},className:"p-1 text-slate-400 hover:text-slate-600",title:"Copy branch name",children:h?(0,a.jsx)(W.Z,{className:"w-4 h-4 text-emerald-600"}):(0,a.jsx)(X.Z,{className:"w-4 h-4"})})]}),(0,a.jsxs)("div",{className:"mt-2 text-xs text-slate-500",children:["Repo: ",r.repo_name," • Workspace: ",r.workspace_path]}),r.pr_url&&(0,a.jsxs)("a",{href:r.pr_url,target:"_blank",rel:"noopener noreferrer",className:"mt-2 flex items-center gap-1 text-sm text-blue-600 hover:underline",children:[(0,a.jsx)("span",{children:"View Pull Request"}),(0,a.jsx)(k.Z,{className:"w-3 h-3"})]})]}),r.error_message&&(0,a.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700",children:r.error_message}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:()=>x(!m),className:"text-sm text-slate-500 hover:text-slate-700",children:[m?"Hide":"Show"," logs (",r.logs.length,")"]}),m&&(0,a.jsx)("div",{className:"mt-2 p-3 bg-slate-900 rounded-lg max-h-64 overflow-y-auto",children:(0,a.jsx)("pre",{className:"text-xs text-slate-300 font-mono whitespace-pre-wrap",children:r.logs.join("\n")})})]})]})}function Q(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}function $(e){let{title:t,icon:s,children:r}=e;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 font-semibold text-slate-900",children:[s,(0,a.jsx)("span",{children:t})]}),(0,a.jsx)("div",{className:"text-sm text-slate-600",children:r})]})}function Y(e){let{status:t}=e;switch(t){case"pending":return(0,a.jsx)(n.Z,{className:"w-4 h-4 text-slate-400"});case"in_progress":return(0,a.jsx)(i.Z,{className:"w-4 h-4 text-violet-500 animate-spin"});case"completed":return(0,a.jsx)(c.Z,{className:"w-4 h-4 text-emerald-500"});case"failed":return(0,a.jsx)(d.Z,{className:"w-4 h-4 text-red-500"})}}function ee(e){return e?new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):""}function et(e){let{failureType:t}=e;if(!t)return null;let s={timeout:{text:"timeout",className:"bg-orange-100 text-orange-700"},error:{text:"error",className:"bg-red-100 text-red-700"},tests_failed:{text:"tests failed",className:"bg-amber-100 text-amber-700"}}[t];return(0,a.jsx)("span",{className:(0,I.Z)("text-xs px-1.5 py-0.5 rounded font-medium",s.className),children:s.text})}function es(e){let{subTasks:t}=e,[s,r]=(0,l.useState)(null);if(0===t.length)return null;let n=t.filter(e=>"completed"===e.status).length,i=t.filter(e=>"failed"===e.status).length,c=Math.round(n/t.length*100);return(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsxs)($,{title:"Sub-Tasks",icon:(0,a.jsx)(o.Z,{className:"w-4 h-4 text-violet-500"}),children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs mb-1",children:[(0,a.jsxs)("span",{className:"text-slate-500",children:[n,"/",t.length," done",i>0&&(0,a.jsxs)("span",{className:"text-red-500 ml-1",children:["(",i," failed)"]})]}),(0,a.jsxs)("span",{className:"text-slate-500",children:[c,"%"]})]}),(0,a.jsx)("div",{className:"w-full bg-slate-200 rounded-full h-2",children:(0,a.jsx)("div",{className:(0,I.Z)("h-2 rounded-full transition-all",i>0?"bg-red-500":"bg-emerald-500"),style:{width:"".concat(c,"%")}})})]}),(0,a.jsx)("ul",{className:"space-y-2",children:t.map(e=>{let t=s===e.id;return(0,a.jsxs)("li",{className:"border border-slate-100 rounded-lg",children:[(0,a.jsxs)("button",{onClick:()=>r(t?null:e.id),className:"w-full flex items-center gap-2 p-2 text-left hover:bg-slate-50 rounded-lg",children:[(0,a.jsx)(Y,{status:e.status}),(0,a.jsx)("span",{className:(0,I.Z)("flex-1 text-sm","completed"===e.status&&"line-through text-slate-400","failed"===e.status&&"text-red-600"),children:e.title}),"failed"===e.status&&e.failure_type&&(0,a.jsx)(et,{failureType:e.failure_type}),e.has_uncommitted_changes&&(0,a.jsx)("span",{title:"Uncommitted changes in workspace",children:(0,a.jsx)(m.Z,{className:"w-3.5 h-3.5 text-amber-500"})}),t?(0,a.jsx)(x.Z,{className:"w-3 h-3 text-slate-400"}):(0,a.jsx)(h.Z,{className:"w-3 h-3 text-slate-400"})]}),t&&(0,a.jsxs)("div",{className:"px-8 pb-3 space-y-3",children:[(0,a.jsx)("p",{className:"text-xs text-slate-600 whitespace-pre-wrap",children:e.description}),(e.duration_ms||e.lines_added||e.lines_removed)&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-3 text-xs text-slate-500",children:[e.duration_ms&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(u.Z,{className:"w-3 h-3"}),function(e){if(!e)return"";let t=Math.floor(e/1e3),s=Math.floor(t/60),a=Math.floor(s/60);return a>0?"".concat(a,"h ").concat(s%60,"m"):s>0?"".concat(s,"m ").concat(t%60,"s"):"".concat(t,"s")}(e.duration_ms)]}),(e.lines_added||e.lines_removed)&&(0,a.jsxs)("span",{className:"flex items-center gap-1 font-mono",children:[(0,a.jsx)(p.Z,{className:"w-3 h-3"}),(0,a.jsxs)("span",{className:"text-emerald-600",children:["+",e.lines_added||0]}),(0,a.jsxs)("span",{className:"text-red-600",children:["-",e.lines_removed||0]})]})]}),e.files_changed&&e.files_changed.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"text-xs font-medium text-emerald-600 flex items-center gap-1",children:[(0,a.jsx)(p.Z,{className:"w-3 h-3"}),"Files Changed:"]}),(0,a.jsx)("ul",{className:"mt-1",children:e.files_changed.map(e=>(0,a.jsx)("li",{className:"text-xs text-slate-600 font-mono",children:e},e))})]}),e.files_to_modify.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-xs font-medium text-slate-500",children:"Planned Files:"}),(0,a.jsx)("ul",{className:"mt-1",children:e.files_to_modify.map(e=>(0,a.jsx)("li",{className:"text-xs text-slate-400 font-mono",children:e},e))})]}),e.error_message&&(0,a.jsx)("div",{className:"p-2 bg-red-50 border border-red-200 rounded text-xs text-red-700 whitespace-pre-wrap",children:e.error_message}),e.output_snippet&&(0,a.jsxs)("details",{className:"group",children:[(0,a.jsxs)("summary",{className:"text-xs font-medium text-slate-500 cursor-pointer flex items-center gap-1",children:[(0,a.jsx)(b.Z,{className:"w-3 h-3"}),"Output",(0,a.jsx)(h.Z,{className:"w-3 h-3 group-open:rotate-90 transition-transform"})]}),(0,a.jsx)("pre",{className:"mt-1 p-2 bg-slate-50 border border-slate-200 rounded text-xs text-slate-600 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:e.output_snippet})]}),e.has_uncommitted_changes&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-2 bg-amber-50 border border-amber-200 rounded text-xs text-amber-700",children:[(0,a.jsx)(m.Z,{className:"w-3.5 h-3.5"}),"Uncommitted changes in workspace"]}),e.commit_hash&&(0,a.jsxs)("div",{className:"text-xs text-slate-400",children:["Commit: ",(0,a.jsx)("code",{className:"bg-slate-100 px-1 rounded",children:e.commit_hash.slice(0,8)})]}),(e.started_at||e.completed_at)&&(0,a.jsxs)("div",{className:"text-xs text-slate-400",children:[e.started_at&&(0,a.jsxs)("span",{children:["Started: ",ee(e.started_at)]}),e.completed_at&&(0,a.jsxs)("span",{className:"ml-3",children:["Finished: ",ee(e.completed_at)]})]})]})]},e.id)})})]})})}function ea(e){let{status:t}=e;switch(t){case"met":return(0,a.jsx)(c.Z,{className:"w-4 h-4 text-emerald-500"});case"partially_met":return(0,a.jsx)(m.Z,{className:"w-4 h-4 text-amber-500"});case"not_met":return(0,a.jsx)(d.Z,{className:"w-4 h-4 text-red-500"});case"no_data":return(0,a.jsx)(g.Z,{className:"w-4 h-4 text-slate-400"});default:return(0,a.jsx)(j.Z,{className:"w-4 h-4 text-slate-400"})}}function er(e){let{verification:t}=e;return(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsxs)($,{title:"Post-Ship Verification",icon:(0,a.jsx)(f.Z,{className:"w-4 h-4 text-emerald-500"}),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,a.jsx)("span",{className:(0,I.Z)("text-xs font-medium px-2 py-1 rounded",T.aR[t.status]),children:T.Wb[t.status]}),t.confidence&&(0,a.jsxs)("span",{className:"text-xs text-slate-500",children:["Confidence: ",t.confidence]})]}),t.summary&&(0,a.jsx)("p",{className:"text-sm text-slate-700 mb-4",children:t.summary}),t.requires_human_review&&(0,a.jsxs)("div",{className:"flex items-center gap-2 p-2 mb-4 bg-amber-50 border border-amber-200 rounded text-xs text-amber-700",children:[(0,a.jsx)(N.Z,{className:"w-3.5 h-3.5 flex-shrink-0"}),(0,a.jsxs)("span",{children:["Requires human review: ",t.human_review_reason||"Review needed"]})]}),t.metric_evaluations.length>0&&(0,a.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-slate-500 uppercase",children:"Metric Results"}),(0,a.jsx)("ul",{className:"space-y-1.5",children:t.metric_evaluations.map((e,t)=>(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)(ea,{status:e.status}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-xs text-slate-700",children:e.metric}),(0,a.jsx)("p",{className:"text-xs text-slate-500 mt-0.5",children:e.evidence})]})]},t))})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-4 text-xs text-slate-400 pt-3 border-t border-slate-100",children:[t.first_evaluated_at&&(0,a.jsxs)("span",{children:["First evaluated: ",Q(t.first_evaluated_at)]}),t.evaluation_count>0&&(0,a.jsxs)("span",{children:["Evaluations: ",t.evaluation_count]}),t.next_evaluation_after&&(0,a.jsxs)("span",{children:["Next check: ",new Date(t.next_evaluation_after).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]}),t.follow_up_idea_ids.length>0&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-100",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-slate-500",children:"Follow-up ideas:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 mt-1",children:t.follow_up_idea_ids.map(e=>(0,a.jsx)(r.default,{href:"/ideas/".concat(e),className:"text-xs text-blue-600 hover:underline bg-blue-50 px-1.5 py-0.5 rounded",children:e},e))})]})]})})}function el(e){let{idea:t,linkedGoal:s}=e;return(0,a.jsxs)("div",{className:"max-w-4xl mx-auto p-6",children:[(0,a.jsxs)(r.default,{href:"/",className:"inline-flex items-center gap-2 text-sm text-slate-500 hover:text-slate-700 mb-6",children:[(0,a.jsx)(v.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Back to Dashboard"})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6 mb-6",children:[(0,a.jsx)("div",{className:"flex items-start justify-between mb-4",children:(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-3",children:[(0,a.jsx)("span",{className:(0,I.Z)("priority-badge",T.Gs[t.priority]),children:T.rF[t.priority]}),(0,a.jsx)("span",{className:(0,I.Z)("category-badge",T.pG[t.category]),children:T.Hs[t.category]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:(0,I.Z)("stage-indicator",T.lv[t.stage])}),(0,a.jsx)("span",{className:"text-xs text-slate-500",children:T.yb[t.stage]})]})]}),(0,a.jsx)("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:t.title}),(0,a.jsx)("p",{className:"text-slate-600",children:t.summary})]})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-6 text-sm text-slate-500 pt-4 border-t border-slate-100",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(w.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Created ",Q(t.created_at)]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(_.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Effort: ",T.bi[t.effort]]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(y.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Impact: ",T.bi[t.impact]]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(Z.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Source: ",T.Vr[t.source.type]]})]})]}),t.tags.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2 mt-4",children:t.tags.map(e=>(0,a.jsx)("span",{className:"px-2 py-1 bg-slate-100 text-slate-600 text-xs rounded",children:e},e))}),t.implementation.branch_name&&(0,a.jsx)("div",{className:"mt-4 p-3 bg-slate-50 rounded-lg border border-slate-200",children:(0,a.jsxs)("div",{className:"flex items-center gap-4 text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-slate-600",children:[(0,a.jsx)(S.Z,{className:"w-4 h-4"}),(0,a.jsx)("code",{className:"bg-slate-200 px-2 py-0.5 rounded",children:t.implementation.branch_name})]}),t.implementation.pr_url&&(0,a.jsxs)("a",{href:t.implementation.pr_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-blue-600 hover:underline",children:[(0,a.jsx)("span",{children:"View PR"}),(0,a.jsx)(k.Z,{className:"w-3 h-3"})]})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-6",children:[(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)($,{title:"Context",icon:(0,a.jsx)(C.Z,{className:"w-4 h-4 text-amber-500"}),children:(0,a.jsx)("p",{className:"whitespace-pre-wrap",children:t.context})})}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)($,{title:"Rationale",icon:(0,a.jsx)(R.Z,{className:"w-4 h-4 text-blue-500"}),children:(0,a.jsx)("p",{className:"whitespace-pre-wrap",children:t.rationale})})}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)($,{title:"Implementation Plan",icon:(0,a.jsx)(P.Z,{className:"w-4 h-4 text-emerald-500"}),children:(0,a.jsx)("div",{className:"whitespace-pre-wrap",children:t.implementation_plan})})}),t.implementation.sub_tasks&&t.implementation.sub_tasks.length>0&&(0,a.jsx)(es,{subTasks:t.implementation.sub_tasks}),"shipped"===t.stage&&t.verification&&(0,a.jsx)(er,{verification:t.verification}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)($,{title:"Success Metrics",icon:(0,a.jsx)(y.Z,{className:"w-4 h-4 text-violet-500"}),children:(0,a.jsx)("ul",{className:"list-disc list-inside space-y-1",children:t.success_metrics.map((e,t)=>(0,a.jsx)("li",{children:e},t))})})})]}),(0,a.jsxs)("div",{className:"space-y-6",children:[(s||t.expected_impact)&&(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 font-semibold text-slate-900 mb-3",children:[(0,a.jsx)(R.Z,{className:"w-4 h-4 text-emerald-500"}),(0,a.jsx)("span",{children:"Goal Alignment"})]}),s?(0,a.jsxs)(r.default,{href:"/goals/".concat(s.id),className:"block p-3 bg-emerald-50 border border-emerald-200 rounded-lg hover:border-emerald-300 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-emerald-800",children:s.title}),(0,a.jsx)(k.Z,{className:"w-3 h-3 text-emerald-600"})]}),(0,a.jsx)("p",{className:"text-xs text-emerald-600 line-clamp-2",children:s.description})]}):t.goal_id?(0,a.jsxs)("p",{className:"text-sm text-slate-500",children:["Linked to goal: ",(0,a.jsx)("code",{className:"text-xs bg-slate-100 px-1 rounded",children:t.goal_id})]}):null,t.expected_impact&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-100",children:[(0,a.jsx)("p",{className:"text-xs text-slate-500 uppercase font-medium mb-1",children:"Expected Impact"}),(0,a.jsx)("p",{className:"text-sm text-slate-700",children:t.expected_impact})]})]}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)(L,{ideaId:t.id,currentStage:t.stage})}),["in_progress","testing","shipped","rolled_back"].includes(t.stage)&&(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)(K,{ideaId:t.id})}),(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:(0,a.jsx)(V,{ideaId:t.id,comments:t.comments})}),t.source.files_analyzed&&t.source.files_analyzed.length>0&&(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-slate-200 p-6",children:[(0,a.jsx)("h3",{className:"font-semibold text-slate-900 mb-3",children:"Files Analyzed"}),(0,a.jsx)("ul",{className:"space-y-1",children:t.source.files_analyzed.map((e,t)=>(0,a.jsx)("li",{className:"text-xs text-slate-500 font-mono truncate",children:e},t))})]})]})]})]})}},6153:function(e,t,s){"use strict";s.d(t,{G:function(){return i},GK:function(){return Z},Gs:function(){return o},Hs:function(){return a},PN:function(){return u},PW:function(){return _},Q_:function(){return p},R$:function(){return v},Vr:function(){return m},Wb:function(){return h},aR:function(){return x},bi:function(){return c},en:function(){return N},i2:function(){return f},kT:function(){return b},l5:function(){return g},lE:function(){return w},lv:function(){return n},pG:function(){return r},rF:function(){return d},tV:function(){return j},tl:function(){return y},xP:function(){return S},yb:function(){return l}});let a={product:"Product",ux_design:"UX/Design",growth:"Growth",performance:"Performance",tech_debt:"Tech Debt",security:"Security",infrastructure:"Infrastructure",content:"Content",analytics:"Analytics",integration:"Integration"},r={product:"bg-blue-100 text-blue-800",ux_design:"bg-purple-100 text-purple-800",growth:"bg-green-100 text-green-800",performance:"bg-orange-100 text-orange-800",tech_debt:"bg-yellow-100 text-yellow-800",security:"bg-red-100 text-red-800",infrastructure:"bg-gray-100 text-gray-800",content:"bg-pink-100 text-pink-800",analytics:"bg-cyan-100 text-cyan-800",integration:"bg-indigo-100 text-indigo-800"},l={inbox:"Inbox",under_review:"Under Review",approved:"Approved",in_progress:"In Progress",testing:"Testing",shipped:"Shipped",deferred:"Deferred",rejected:"Rejected",rolled_back:"Rolled Back"},n={inbox:"bg-amber-500",under_review:"bg-blue-500",approved:"bg-emerald-500",in_progress:"bg-violet-500",testing:"bg-cyan-500",shipped:"bg-green-500",deferred:"bg-gray-500",rejected:"bg-red-500",rolled_back:"bg-orange-500"},i=["inbox","under_review","approved","in_progress","testing","shipped"],c={xs:"XS",s:"S",m:"M",l:"L",xl:"XL"},d={critical:"Critical",high:"High",medium:"Medium",low:"Low"},o={critical:"bg-red-100 text-red-800 border-red-300",high:"bg-orange-100 text-orange-800 border-orange-300",medium:"bg-yellow-100 text-yellow-800 border-yellow-300",low:"bg-gray-100 text-gray-800 border-gray-300"},m={codebase_analysis:"Codebase Analysis",metrics_review:"Metrics Review",market_research:"Market Research",seo_audit:"SEO Audit",manual:"Manual"},x={pending:"bg-slate-100 text-slate-700",validated:"bg-emerald-100 text-emerald-800",needs_investigation:"bg-amber-100 text-amber-800",inconclusive:"bg-slate-100 text-slate-600",invalidated:"bg-red-100 text-red-800"},h={pending:"Pending",validated:"Validated",needs_investigation:"Needs Investigation",inconclusive:"Inconclusive",invalidated:"Invalidated"},u={ship:"Ship",update:"Update",milestone:"Milestone",digest:"Digest",manual:"Manual",thread:"Thread",insight:"Insight"},p={ship:"bg-green-100 text-green-800",update:"bg-blue-100 text-blue-800",milestone:"bg-amber-100 text-amber-800",digest:"bg-purple-100 text-purple-800",manual:"bg-slate-100 text-slate-800",thread:"bg-indigo-100 text-indigo-800",insight:"bg-cyan-100 text-cyan-800"},b={acquisition:"Acquisition",activation:"Activation",retention:"Retention",revenue:"Revenue",referral:"Referral"},g={acquisition:"bg-blue-100 text-blue-800",activation:"bg-emerald-100 text-emerald-800",retention:"bg-purple-100 text-purple-800",revenue:"bg-amber-100 text-amber-800",referral:"bg-pink-100 text-pink-800"},j={on_track:"On Track",at_risk:"At Risk",behind:"Behind",achieved:"Achieved"},f={on_track:"bg-emerald-100 text-emerald-800 border-emerald-300",at_risk:"bg-amber-100 text-amber-800 border-amber-300",behind:"bg-red-100 text-red-800 border-red-300",achieved:"bg-blue-100 text-blue-800 border-blue-300"},N={manual:"Manual",rest_api:"REST API",posthog:"PostHog",firestore:"Firestore",stripe:"Stripe",whatsapp:"WhatsApp"},v={stated:"Stated",testing:"Testing",validated:"Validated",invalidated:"Invalidated",deferred:"Deferred"},w={stated:"bg-slate-100 text-slate-800 border-slate-300",testing:"bg-amber-100 text-amber-800 border-amber-300",validated:"bg-emerald-100 text-emerald-800 border-emerald-300",invalidated:"bg-red-100 text-red-800 border-red-300",deferred:"bg-slate-100 text-slate-500 border-slate-200"},_={acquisition:"Acquisition",engagement:"Engagement",conversion:"Conversion",monetization:"Monetization"},y={acquisition:"bg-blue-100 text-blue-800",engagement:"bg-purple-100 text-purple-800",conversion:"bg-amber-100 text-amber-800",monetization:"bg-emerald-100 text-emerald-800"},Z={planned:"Planned",active:"Active",completed:"Completed",paused:"Paused"},S={planned:"bg-slate-100 text-slate-700 border-slate-300",active:"bg-blue-100 text-blue-800 border-blue-300",completed:"bg-emerald-100 text-emerald-800 border-emerald-300",paused:"bg-amber-100 text-amber-800 border-amber-300"}}},function(e){e.O(0,[746,59,971,117,744],function(){return e(e.s=703)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{7075:function(e,t,s){Promise.resolve().then(s.bind(s,6435)),Promise.resolve().then(s.bind(s,1259)),Promise.resolve().then(s.bind(s,1214))},6221:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},9322:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},1671:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},1817:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3276:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},6076:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},3247:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},4286:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},2489:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},1239:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},6435:function(e,t,s){"use strict";s.d(t,{default:function(){return g}});var a=s(7437),r=s(9376),l=s(6221),i=s(9205);let n=(0,i.Z)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),c=(0,i.Z)("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);var d=s(6076),o=s(2265),x=s(1817),m=s(3276),u=s(1671),h=s(9322),p=s(1994);function b(e){let{onAnalysisComplete:t}=e,[s,r]=(0,o.useState)(!1),[l,i]=(0,o.useState)(!1),[n,c]=(0,o.useState)(null),d=async e=>{i(!0),c(null);try{let s=await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e})}),a=await s.json();a.success?(c({success:!0,message:"Generated ".concat(a.ideas_count," new ideas")}),null==t||t()):c({success:!1,message:a.error||"Analysis failed"})}catch(e){c({success:!1,message:"Failed to start analysis"})}finally{i(!1),setTimeout(()=>{c(null),r(!1)},3e3)}};return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("button",{onClick:()=>r(!s),disabled:l,className:(0,p.Z)("btn btn-primary gap-2",l&&"opacity-75 cursor-wait"),children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.Z,{className:"w-4 h-4 animate-spin"}),(0,a.jsx)("span",{children:"Analyzing..."})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Analyze Now"})]})}),s&&!l&&(0,a.jsxs)("div",{className:"absolute right-0 mt-2 w-56 bg-white rounded-lg shadow-lg border border-slate-200 py-2 z-10 animate-slide-in",children:[(0,a.jsxs)("button",{onClick:()=>d("quick"),className:"w-full px-4 py-2 text-left hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("div",{className:"font-medium text-slate-900",children:"Quick Scan"}),(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"Recent changes, TODOs, errors"})]}),(0,a.jsxs)("button",{onClick:()=>d("deep"),className:"w-full px-4 py-2 text-left hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("div",{className:"font-medium text-slate-900",children:"Deep Review"}),(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"Architecture, tech debt, security"})]}),(0,a.jsxs)("button",{onClick:()=>d("metrics"),className:"w-full px-4 py-2 text-left hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("div",{className:"font-medium text-slate-900",children:"Metrics Review"}),(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"Funnels, conversions, drop-offs"})]}),(0,a.jsxs)("button",{onClick:()=>d("seo"),className:"w-full px-4 py-2 text-left hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("div",{className:"font-medium text-slate-900",children:"SEO Audit"}),(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"Blog performance, technical SEO"})]})]}),n&&(0,a.jsx)("div",{className:(0,p.Z)("absolute right-0 mt-2 px-4 py-3 rounded-lg shadow-lg animate-slide-in",n.success?"bg-emerald-50 border border-emerald-200":"bg-red-50 border border-red-200"),children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n.success?(0,a.jsx)(u.Z,{className:"w-4 h-4 text-emerald-600"}):(0,a.jsx)(h.Z,{className:"w-4 h-4 text-red-600"}),(0,a.jsx)("span",{className:(0,p.Z)("text-sm font-medium",n.success?"text-emerald-800":"text-red-800"),children:n.message})]})})]})}function g(e){let{stats:t}=e,s=(0,r.useRouter)();return(0,a.jsx)("header",{className:"px-6 py-4 bg-white border-b border-slate-200",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-slate-900",children:"Idea Dashboard"}),(0,a.jsxs)("div",{className:"flex items-center gap-6 mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-slate-600",children:[(0,a.jsx)(l.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[t.total," total"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-amber-600",children:[(0,a.jsx)(n,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[t.inbox," in inbox"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-violet-600",children:[(0,a.jsx)(c,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[t.inProgress," in progress"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-emerald-600",children:[(0,a.jsx)(d.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[t.shipped," shipped"]})]})]})]}),(0,a.jsx)(b,{onAnalysisComplete:()=>{s.refresh()}})]})})}},1259:function(e,t,s){"use strict";s.d(t,{default:function(){return f}});var a=s(7437),r=s(7648),l=s(9376),i=s(5466),n=s(2048),c=s(8896),d=s(8220),o=s(2718),x=s(5621),m=s(8728),u=s(2222),h=s(2023),p=s(1994),b=s(257);let g=[{href:"/",label:"Dashboard",icon:(0,a.jsx)(i.Z,{className:"w-5 h-5"})},{href:"/roadmap",label:"Roadmap",icon:(0,a.jsx)(n.Z,{className:"w-5 h-5"})},{href:"/goals",label:"Goals",icon:(0,a.jsx)(c.Z,{className:"w-5 h-5"})},{href:"/hypotheses",label:"Hypotheses",icon:(0,a.jsx)(d.Z,{className:"w-5 h-5"})},{href:"/social",label:"Social",icon:(0,a.jsx)(o.Z,{className:"w-5 h-5"})},{href:"/sessions",label:"Sessions",icon:(0,a.jsx)(x.Z,{className:"w-5 h-5"})},{href:"/settings",label:"Settings",icon:(0,a.jsx)(m.Z,{className:"w-5 h-5"})}];function f(e){let{children:t}=e,s=(0,l.usePathname)();return(0,a.jsxs)("div",{className:"min-h-screen flex",children:[(0,a.jsxs)("aside",{className:"w-64 bg-slate-900 text-white flex flex-col",children:[(0,a.jsx)("div",{className:"p-4 border-b border-slate-700",children:(0,a.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-emerald-500 rounded-lg flex items-center justify-center",children:(0,a.jsx)(u.Z,{className:"w-6 h-6 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"font-bold text-lg leading-tight",children:"Analyst"}),(0,a.jsx)("p",{className:"text-xs text-slate-400",children:b.env.NEXT_PUBLIC_PRODUCT_NAME||"Business"})]})]})}),(0,a.jsx)("nav",{className:"flex-1 p-4",children:(0,a.jsx)("ul",{className:"space-y-1",children:g.map(e=>{let t="/"===e.href?"/"===s:s.startsWith(e.href);return(0,a.jsx)("li",{children:(0,a.jsxs)(r.default,{href:e.href,className:(0,p.Z)("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",t?"bg-slate-800 text-white":"text-slate-400 hover:text-white hover:bg-slate-800"),children:[e.icon,(0,a.jsx)("span",{children:e.label})]})},e.href)})})}),(0,a.jsx)("div",{className:"p-4 border-t border-slate-700",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,a.jsx)(h.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Powered by Claude"})]})})]}),(0,a.jsx)("main",{className:"flex-1 overflow-auto",children:t})]})}},1214:function(e,t,s){"use strict";s.d(t,{default:function(){return C}});var a=s(7437),r=s(2265),l=s(3247),i=s(9205);let n=(0,i.Z)("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);var c=s(2489),d=s(1994),o=s(7648),x=s(9322);let m=(0,i.Z)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),u=(0,i.Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),h=(0,i.Z)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var p=s(1239);let b=(0,i.Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);var g=s(8896),f=s(4286);let v=(0,i.Z)("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);var j=s(6153);function y(e){let{priority:t}=e;switch(t){case"critical":return(0,a.jsx)(x.Z,{className:"w-3 h-3"});case"high":return(0,a.jsx)(m,{className:"w-3 h-3"});case"medium":return(0,a.jsx)(u,{className:"w-3 h-3"});case"low":return(0,a.jsx)(h,{className:"w-3 h-3"})}}function N(e){let{size:t,label:s}=e;return(0,a.jsx)("span",{className:"size-badge",title:s,children:j.bi[t]})}function w(e){let{idea:t,compact:s=!1}=e,r=t.comments.length>0;return(0,a.jsx)(o.default,{href:"/ideas/".concat(t.id),children:(0,a.jsxs)("div",{className:"idea-card",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("span",{className:(0,d.Z)("priority-badge",j.Gs[t.priority]),children:[(0,a.jsx)(y,{priority:t.priority}),(0,a.jsx)("span",{className:"ml-1",children:j.rF[t.priority]})]}),(0,a.jsx)("span",{className:(0,d.Z)("category-badge",j.pG[t.category]),children:j.Hs[t.category]})]}),(0,a.jsx)("h3",{className:"font-medium text-slate-900 text-sm leading-snug mb-1",children:t.title}),!s&&(0,a.jsx)("p",{className:"text-xs text-slate-500 line-clamp-2 mb-2",children:t.summary}),(0,a.jsxs)("div",{className:"flex items-center justify-between mt-2 pt-2 border-t border-slate-100",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",title:"Effort",children:[(0,a.jsx)(p.Z,{className:"w-3 h-3 text-slate-400"}),(0,a.jsx)(N,{size:t.effort,label:"Effort"})]}),(0,a.jsx)("span",{className:"text-slate-300",children:"/"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",title:"Impact",children:[(0,a.jsx)(m,{className:"w-3 h-3 text-slate-400"}),(0,a.jsx)(N,{size:t.impact,label:"Impact"})]})]}),r&&(0,a.jsxs)("div",{className:"flex items-center gap-1 text-slate-400",children:[(0,a.jsx)(b,{className:"w-3 h-3"}),(0,a.jsx)("span",{className:"text-xs",children:t.comments.length})]})]}),t.goal_id&&(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-2 text-emerald-600",children:[(0,a.jsx)(g.Z,{className:"w-3 h-3"}),(0,a.jsx)("span",{className:"text-[10px]",children:"Goal aligned"})]}),"shipped"===t.stage&&t.verification&&"pending"!==t.verification.status&&(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)(f.Z,{className:"w-3 h-3"}),(0,a.jsx)("span",{className:(0,d.Z)("text-[10px] px-1 py-0.5 rounded",j.aR[t.verification.status]),children:j.Wb[t.verification.status]})]}),t.verification_status&&(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)(v,{className:"w-3 h-3"}),(0,a.jsx)("span",{className:(0,d.Z)("text-[10px] px-1 py-0.5 rounded","proceed"===t.verification_status&&"bg-green-100 text-green-700","extend"===t.verification_status&&"bg-blue-100 text-blue-700","investigate"===t.verification_status&&"bg-yellow-100 text-yellow-700","stop"===t.verification_status&&"bg-red-100 text-red-700"),children:t.verification_status.toUpperCase()})]}),!s&&t.tags.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[t.tags.slice(0,3).map(e=>(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 bg-slate-100 text-slate-500 rounded",children:e},e)),t.tags.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-slate-400",children:["+",t.tags.length-3]})]})]})})}let k=["product","ux_design","growth","performance","tech_debt","security","infrastructure","content","analytics","integration"],Z=["critical","high","medium","low"],_=["xs","s","m","l","xl"];function C(e){let{ideas:t}=e,[s,i]=(0,r.useState)({categories:[],priorities:[],efforts:[],search:""}),[o,x]=(0,r.useState)(!1),[m,u]=(0,r.useState)(null),h=(0,r.useMemo)(()=>{let e={all:t.length};return t.forEach(t=>{e[t.category]=(e[t.category]||0)+1}),e},[t]),p=(0,r.useMemo)(()=>t.filter(e=>{if(m&&e.category!==m)return!1;if(s.search){let t=s.search.toLowerCase();if(!(e.title.toLowerCase().includes(t)||e.summary.toLowerCase().includes(t)||e.tags.some(e=>e.toLowerCase().includes(t))))return!1}return(!(s.categories.length>0)||!!s.categories.includes(e.category))&&(!(s.priorities.length>0)||!!s.priorities.includes(e.priority))&&(!(s.efforts.length>0)||!!s.efforts.includes(e.effort))}),[t,s,m]),b=(0,r.useMemo)(()=>{let e={};return j.G.forEach(t=>{e[t]=[]}),p.forEach(t=>{j.G.includes(t.stage)&&e[t.stage].push(t)}),e},[p]),g=s.categories.length+s.priorities.length+s.efforts.length,f=(e,t)=>{i(s=>{let a=s[e],r=a.includes(t)?a.filter(e=>e!==t):[...a,t];return{...s,[e]:r}})};return(0,a.jsxs)("div",{className:"h-full flex flex-col",children:[(0,a.jsx)("div",{className:"px-6 py-3 bg-slate-50 border-b border-slate-200 overflow-x-auto",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("button",{onClick:()=>u(null),className:(0,d.Z)("px-3 py-1.5 text-sm font-medium rounded-full whitespace-nowrap transition-colors",null===m?"bg-slate-800 text-white":"bg-white text-slate-600 hover:bg-slate-100 border border-slate-200"),children:["All",(0,a.jsxs)("span",{className:"ml-1.5 text-xs opacity-70",children:["(",h.all,")"]})]}),k.map(e=>(0,a.jsxs)("button",{onClick:()=>u(e),className:(0,d.Z)("px-3 py-1.5 text-sm font-medium rounded-full whitespace-nowrap transition-colors",m===e?j.pG[e]:"bg-white text-slate-600 hover:bg-slate-100 border border-slate-200"),children:[j.Hs[e],h[e]>0&&(0,a.jsxs)("span",{className:"ml-1.5 text-xs opacity-70",children:["(",h[e],")"]})]},e))]})}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-white border-b border-slate-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsxs)("div",{className:"relative flex-1 max-w-md",children:[(0,a.jsx)(l.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),(0,a.jsx)("input",{type:"text",placeholder:"Search ideas...",value:s.search,onChange:e=>i(t=>({...t,search:e.target.value})),className:"input pl-10"})]}),(0,a.jsxs)("button",{onClick:()=>x(!o),className:(0,d.Z)("btn btn-secondary gap-2",o&&"bg-slate-200"),children:[(0,a.jsx)(n,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Filters"}),g>0&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-500 text-white text-xs rounded-full",children:g})]}),g>0&&(0,a.jsxs)("button",{onClick:()=>{i({categories:[],priorities:[],efforts:[],search:""})},className:"btn btn-ghost gap-1 text-sm",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4"}),"Clear"]})]}),o&&(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-6 animate-slide-in",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-2",children:"Category"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:k.map(e=>(0,a.jsx)("button",{onClick:()=>f("categories",e),className:(0,d.Z)("px-2 py-1 text-xs rounded border transition-colors",s.categories.includes(e)?"bg-emerald-100 border-emerald-300 text-emerald-800":"bg-white border-slate-200 text-slate-600 hover:border-slate-300"),children:j.Hs[e]},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-2",children:"Priority"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:Z.map(e=>(0,a.jsx)("button",{onClick:()=>f("priorities",e),className:(0,d.Z)("px-2 py-1 text-xs rounded border transition-colors",s.priorities.includes(e)?"bg-emerald-100 border-emerald-300 text-emerald-800":"bg-white border-slate-200 text-slate-600 hover:border-slate-300"),children:j.rF[e]},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-2",children:"Effort"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:_.map(e=>(0,a.jsx)("button",{onClick:()=>f("efforts",e),className:(0,d.Z)("px-2 py-1 text-xs rounded border transition-colors",s.efforts.includes(e)?"bg-emerald-100 border-emerald-300 text-emerald-800":"bg-white border-slate-200 text-slate-600 hover:border-slate-300"),children:j.bi[e]},e))})]})]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-x-auto p-6",children:(0,a.jsx)("div",{className:"flex gap-4 h-full min-w-max",children:j.G.map(e=>(0,a.jsxs)("div",{className:"w-72 flex flex-col",children:[(0,a.jsxs)("div",{className:"kanban-column-header",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:(0,d.Z)("stage-indicator",j.lv[e])}),(0,a.jsx)("span",{className:"font-medium text-slate-700",children:j.yb[e]})]}),(0,a.jsx)("span",{className:"text-sm text-slate-400",children:b[e].length})]}),(0,a.jsx)("div",{className:"kanban-column flex-1 overflow-y-auto",children:0===b[e].length?(0,a.jsx)("div",{className:"text-center py-8 text-slate-400 text-sm",children:"No ideas"}):b[e].map(e=>(0,a.jsx)(w,{idea:e},e.id))})]},e))})})]})}},6153:function(e,t,s){"use strict";s.d(t,{G:function(){return n},GK:function(){return Z},Gs:function(){return o},Hs:function(){return a},PN:function(){return h},PW:function(){return w},Q_:function(){return p},R$:function(){return y},Vr:function(){return x},Wb:function(){return u},aR:function(){return m},bi:function(){return c},en:function(){return j},i2:function(){return v},kT:function(){return b},l5:function(){return g},lE:function(){return N},lv:function(){return i},pG:function(){return r},rF:function(){return d},tV:function(){return f},tl:function(){return k},xP:function(){return _},yb:function(){return l}});let a={product:"Product",ux_design:"UX/Design",growth:"Growth",performance:"Performance",tech_debt:"Tech Debt",security:"Security",infrastructure:"Infrastructure",content:"Content",analytics:"Analytics",integration:"Integration"},r={product:"bg-blue-100 text-blue-800",ux_design:"bg-purple-100 text-purple-800",growth:"bg-green-100 text-green-800",performance:"bg-orange-100 text-orange-800",tech_debt:"bg-yellow-100 text-yellow-800",security:"bg-red-100 text-red-800",infrastructure:"bg-gray-100 text-gray-800",content:"bg-pink-100 text-pink-800",analytics:"bg-cyan-100 text-cyan-800",integration:"bg-indigo-100 text-indigo-800"},l={inbox:"Inbox",under_review:"Under Review",approved:"Approved",in_progress:"In Progress",testing:"Testing",shipped:"Shipped",deferred:"Deferred",rejected:"Rejected",rolled_back:"Rolled Back"},i={inbox:"bg-amber-500",under_review:"bg-blue-500",approved:"bg-emerald-500",in_progress:"bg-violet-500",testing:"bg-cyan-500",shipped:"bg-green-500",deferred:"bg-gray-500",rejected:"bg-red-500",rolled_back:"bg-orange-500"},n=["inbox","under_review","approved","in_progress","testing","shipped"],c={xs:"XS",s:"S",m:"M",l:"L",xl:"XL"},d={critical:"Critical",high:"High",medium:"Medium",low:"Low"},o={critical:"bg-red-100 text-red-800 border-red-300",high:"bg-orange-100 text-orange-800 border-orange-300",medium:"bg-yellow-100 text-yellow-800 border-yellow-300",low:"bg-gray-100 text-gray-800 border-gray-300"},x={codebase_analysis:"Codebase Analysis",metrics_review:"Metrics Review",market_research:"Market Research",seo_audit:"SEO Audit",manual:"Manual"},m={pending:"bg-slate-100 text-slate-700",validated:"bg-emerald-100 text-emerald-800",needs_investigation:"bg-amber-100 text-amber-800",inconclusive:"bg-slate-100 text-slate-600",invalidated:"bg-red-100 text-red-800"},u={pending:"Pending",validated:"Validated",needs_investigation:"Needs Investigation",inconclusive:"Inconclusive",invalidated:"Invalidated"},h={ship:"Ship",update:"Update",milestone:"Milestone",digest:"Digest",manual:"Manual"},p={ship:"bg-green-100 text-green-800",update:"bg-blue-100 text-blue-800",milestone:"bg-amber-100 text-amber-800",digest:"bg-purple-100 text-purple-800",manual:"bg-slate-100 text-slate-800"},b={acquisition:"Acquisition",activation:"Activation",retention:"Retention",revenue:"Revenue",referral:"Referral"},g={acquisition:"bg-blue-100 text-blue-800",activation:"bg-emerald-100 text-emerald-800",retention:"bg-purple-100 text-purple-800",revenue:"bg-amber-100 text-amber-800",referral:"bg-pink-100 text-pink-800"},f={on_track:"On Track",at_risk:"At Risk",behind:"Behind",achieved:"Achieved"},v={on_track:"bg-emerald-100 text-emerald-800 border-emerald-300",at_risk:"bg-amber-100 text-amber-800 border-amber-300",behind:"bg-red-100 text-red-800 border-red-300",achieved:"bg-blue-100 text-blue-800 border-blue-300"},j={manual:"Manual",rest_api:"REST API",posthog:"PostHog",firestore:"Firestore",stripe:"Stripe",whatsapp:"WhatsApp"},y={stated:"Stated",testing:"Testing",validated:"Validated",invalidated:"Invalidated",deferred:"Deferred"},N={stated:"bg-slate-100 text-slate-800 border-slate-300",testing:"bg-amber-100 text-amber-800 border-amber-300",validated:"bg-emerald-100 text-emerald-800 border-emerald-300",invalidated:"bg-red-100 text-red-800 border-red-300",deferred:"bg-slate-100 text-slate-500 border-slate-200"},w={acquisition:"Acquisition",engagement:"Engagement",conversion:"Conversion",monetization:"Monetization"},k={acquisition:"bg-blue-100 text-blue-800",engagement:"bg-purple-100 text-purple-800",conversion:"bg-amber-100 text-amber-800",monetization:"bg-emerald-100 text-emerald-800"},Z={planned:"Planned",active:"Active",completed:"Completed",paused:"Paused"},_={planned:"bg-slate-100 text-slate-700 border-slate-300",active:"bg-blue-100 text-blue-800 border-blue-300",completed:"bg-emerald-100 text-emerald-800 border-emerald-300",paused:"bg-amber-100 text-amber-800 border-amber-300"}}},function(e){e.O(0,[746,971,117,744],function(){return e(e.s=7075)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{7075:function(e,t,s){Promise.resolve().then(s.bind(s,6435)),Promise.resolve().then(s.bind(s,1259)),Promise.resolve().then(s.bind(s,1214))},6221:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},9322:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},1671:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},1817:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},3276:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},6076:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},3247:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},4286:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},2489:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},1239:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},6435:function(e,t,s){"use strict";s.d(t,{default:function(){return b}});var a=s(7437),r=s(9376),l=s(6221),i=s(9205);let n=(0,i.Z)("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),c=(0,i.Z)("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);var d=s(6076),o=s(2265),x=s(1817),m=s(3276),u=s(1671),h=s(9322),p=s(1994);function g(e){let{onAnalysisComplete:t}=e,[s,r]=(0,o.useState)(!1),[l,i]=(0,o.useState)(!1),[n,c]=(0,o.useState)(null),d=async e=>{i(!0),c(null);try{let s=await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e})}),a=await s.json();a.success?(c({success:!0,message:"Generated ".concat(a.ideas_count," new ideas")}),null==t||t()):c({success:!1,message:a.error||"Analysis failed"})}catch(e){c({success:!1,message:"Failed to start analysis"})}finally{i(!1),setTimeout(()=>{c(null),r(!1)},3e3)}};return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("button",{onClick:()=>r(!s),disabled:l,className:(0,p.Z)("btn btn-primary gap-2",l&&"opacity-75 cursor-wait"),children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.Z,{className:"w-4 h-4 animate-spin"}),(0,a.jsx)("span",{children:"Analyzing..."})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Analyze Now"})]})}),s&&!l&&(0,a.jsxs)("div",{className:"absolute right-0 mt-2 w-56 bg-white rounded-lg shadow-lg border border-slate-200 py-2 z-10 animate-slide-in",children:[(0,a.jsxs)("button",{onClick:()=>d("quick"),className:"w-full px-4 py-2 text-left hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("div",{className:"font-medium text-slate-900",children:"Quick Scan"}),(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"Recent changes, TODOs, errors"})]}),(0,a.jsxs)("button",{onClick:()=>d("deep"),className:"w-full px-4 py-2 text-left hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("div",{className:"font-medium text-slate-900",children:"Deep Review"}),(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"Architecture, tech debt, security"})]}),(0,a.jsxs)("button",{onClick:()=>d("metrics"),className:"w-full px-4 py-2 text-left hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("div",{className:"font-medium text-slate-900",children:"Metrics Review"}),(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"Funnels, conversions, drop-offs"})]}),(0,a.jsxs)("button",{onClick:()=>d("seo"),className:"w-full px-4 py-2 text-left hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("div",{className:"font-medium text-slate-900",children:"SEO Audit"}),(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"Blog performance, technical SEO"})]})]}),n&&(0,a.jsx)("div",{className:(0,p.Z)("absolute right-0 mt-2 px-4 py-3 rounded-lg shadow-lg animate-slide-in",n.success?"bg-emerald-50 border border-emerald-200":"bg-red-50 border border-red-200"),children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[n.success?(0,a.jsx)(u.Z,{className:"w-4 h-4 text-emerald-600"}):(0,a.jsx)(h.Z,{className:"w-4 h-4 text-red-600"}),(0,a.jsx)("span",{className:(0,p.Z)("text-sm font-medium",n.success?"text-emerald-800":"text-red-800"),children:n.message})]})})]})}function b(e){let{stats:t}=e,s=(0,r.useRouter)();return(0,a.jsx)("header",{className:"px-6 py-4 bg-white border-b border-slate-200",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-slate-900",children:"Idea Dashboard"}),(0,a.jsxs)("div",{className:"flex items-center gap-6 mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-slate-600",children:[(0,a.jsx)(l.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[t.total," total"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-amber-600",children:[(0,a.jsx)(n,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[t.inbox," in inbox"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-violet-600",children:[(0,a.jsx)(c,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[t.inProgress," in progress"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-emerald-600",children:[(0,a.jsx)(d.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[t.shipped," shipped"]})]})]})]}),(0,a.jsx)(g,{onAnalysisComplete:()=>{s.refresh()}})]})})}},1259:function(e,t,s){"use strict";s.d(t,{default:function(){return f}});var a=s(7437),r=s(7648),l=s(9376),i=s(5466),n=s(2048),c=s(8896),d=s(8220),o=s(2718),x=s(5621),m=s(8728),u=s(2222),h=s(2023),p=s(1994),g=s(257);let b=[{href:"/",label:"Dashboard",icon:(0,a.jsx)(i.Z,{className:"w-5 h-5"})},{href:"/roadmap",label:"Roadmap",icon:(0,a.jsx)(n.Z,{className:"w-5 h-5"})},{href:"/goals",label:"Goals",icon:(0,a.jsx)(c.Z,{className:"w-5 h-5"})},{href:"/hypotheses",label:"Hypotheses",icon:(0,a.jsx)(d.Z,{className:"w-5 h-5"})},{href:"/social",label:"Social",icon:(0,a.jsx)(o.Z,{className:"w-5 h-5"})},{href:"/sessions",label:"Sessions",icon:(0,a.jsx)(x.Z,{className:"w-5 h-5"})},{href:"/settings",label:"Settings",icon:(0,a.jsx)(m.Z,{className:"w-5 h-5"})}];function f(e){let{children:t}=e,s=(0,l.usePathname)();return(0,a.jsxs)("div",{className:"min-h-screen flex",children:[(0,a.jsxs)("aside",{className:"w-64 bg-slate-900 text-white flex flex-col",children:[(0,a.jsx)("div",{className:"p-4 border-b border-slate-700",children:(0,a.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-emerald-500 rounded-lg flex items-center justify-center",children:(0,a.jsx)(u.Z,{className:"w-6 h-6 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"font-bold text-lg leading-tight",children:"Analyst"}),(0,a.jsx)("p",{className:"text-xs text-slate-400",children:g.env.NEXT_PUBLIC_PRODUCT_NAME||"Business"})]})]})}),(0,a.jsx)("nav",{className:"flex-1 p-4",children:(0,a.jsx)("ul",{className:"space-y-1",children:b.map(e=>{let t="/"===e.href?"/"===s:s.startsWith(e.href);return(0,a.jsx)("li",{children:(0,a.jsxs)(r.default,{href:e.href,className:(0,p.Z)("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",t?"bg-slate-800 text-white":"text-slate-400 hover:text-white hover:bg-slate-800"),children:[e.icon,(0,a.jsx)("span",{children:e.label})]})},e.href)})})}),(0,a.jsx)("div",{className:"p-4 border-t border-slate-700",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,a.jsx)(h.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Powered by Claude"})]})})]}),(0,a.jsx)("main",{className:"flex-1 overflow-auto",children:t})]})}},1214:function(e,t,s){"use strict";s.d(t,{default:function(){return C}});var a=s(7437),r=s(2265),l=s(3247),i=s(9205);let n=(0,i.Z)("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);var c=s(2489),d=s(1994),o=s(7648),x=s(9322);let m=(0,i.Z)("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),u=(0,i.Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),h=(0,i.Z)("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);var p=s(1239);let g=(0,i.Z)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);var b=s(8896),f=s(4286);let v=(0,i.Z)("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);var j=s(6153);function y(e){let{priority:t}=e;switch(t){case"critical":return(0,a.jsx)(x.Z,{className:"w-3 h-3"});case"high":return(0,a.jsx)(m,{className:"w-3 h-3"});case"medium":return(0,a.jsx)(u,{className:"w-3 h-3"});case"low":return(0,a.jsx)(h,{className:"w-3 h-3"})}}function N(e){let{size:t,label:s}=e;return(0,a.jsx)("span",{className:"size-badge",title:s,children:j.bi[t]})}function w(e){let{idea:t,compact:s=!1}=e,r=t.comments.length>0;return(0,a.jsx)(o.default,{href:"/ideas/".concat(t.id),children:(0,a.jsxs)("div",{className:"idea-card",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,a.jsxs)("span",{className:(0,d.Z)("priority-badge",j.Gs[t.priority]),children:[(0,a.jsx)(y,{priority:t.priority}),(0,a.jsx)("span",{className:"ml-1",children:j.rF[t.priority]})]}),(0,a.jsx)("span",{className:(0,d.Z)("category-badge",j.pG[t.category]),children:j.Hs[t.category]})]}),(0,a.jsx)("h3",{className:"font-medium text-slate-900 text-sm leading-snug mb-1",children:t.title}),!s&&(0,a.jsx)("p",{className:"text-xs text-slate-500 line-clamp-2 mb-2",children:t.summary}),(0,a.jsxs)("div",{className:"flex items-center justify-between mt-2 pt-2 border-t border-slate-100",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",title:"Effort",children:[(0,a.jsx)(p.Z,{className:"w-3 h-3 text-slate-400"}),(0,a.jsx)(N,{size:t.effort,label:"Effort"})]}),(0,a.jsx)("span",{className:"text-slate-300",children:"/"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",title:"Impact",children:[(0,a.jsx)(m,{className:"w-3 h-3 text-slate-400"}),(0,a.jsx)(N,{size:t.impact,label:"Impact"})]})]}),r&&(0,a.jsxs)("div",{className:"flex items-center gap-1 text-slate-400",children:[(0,a.jsx)(g,{className:"w-3 h-3"}),(0,a.jsx)("span",{className:"text-xs",children:t.comments.length})]})]}),t.goal_id&&(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-2 text-emerald-600",children:[(0,a.jsx)(b.Z,{className:"w-3 h-3"}),(0,a.jsx)("span",{className:"text-[10px]",children:"Goal aligned"})]}),"shipped"===t.stage&&t.verification&&"pending"!==t.verification.status&&(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)(f.Z,{className:"w-3 h-3"}),(0,a.jsx)("span",{className:(0,d.Z)("text-[10px] px-1 py-0.5 rounded",j.aR[t.verification.status]),children:j.Wb[t.verification.status]})]}),t.verification_status&&(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)(v,{className:"w-3 h-3"}),(0,a.jsx)("span",{className:(0,d.Z)("text-[10px] px-1 py-0.5 rounded","proceed"===t.verification_status&&"bg-green-100 text-green-700","extend"===t.verification_status&&"bg-blue-100 text-blue-700","investigate"===t.verification_status&&"bg-yellow-100 text-yellow-700","stop"===t.verification_status&&"bg-red-100 text-red-700"),children:t.verification_status.toUpperCase()})]}),!s&&t.tags.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[t.tags.slice(0,3).map(e=>(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 bg-slate-100 text-slate-500 rounded",children:e},e)),t.tags.length>3&&(0,a.jsxs)("span",{className:"text-[10px] text-slate-400",children:["+",t.tags.length-3]})]})]})})}let k=["product","ux_design","growth","performance","tech_debt","security","infrastructure","content","analytics","integration"],Z=["critical","high","medium","low"],_=["xs","s","m","l","xl"];function C(e){let{ideas:t}=e,[s,i]=(0,r.useState)({categories:[],priorities:[],efforts:[],search:""}),[o,x]=(0,r.useState)(!1),[m,u]=(0,r.useState)(null),h=(0,r.useMemo)(()=>{let e={all:t.length};return t.forEach(t=>{e[t.category]=(e[t.category]||0)+1}),e},[t]),p=(0,r.useMemo)(()=>t.filter(e=>{if(m&&e.category!==m)return!1;if(s.search){let t=s.search.toLowerCase();if(!(e.title.toLowerCase().includes(t)||e.summary.toLowerCase().includes(t)||e.tags.some(e=>e.toLowerCase().includes(t))))return!1}return(!(s.categories.length>0)||!!s.categories.includes(e.category))&&(!(s.priorities.length>0)||!!s.priorities.includes(e.priority))&&(!(s.efforts.length>0)||!!s.efforts.includes(e.effort))}),[t,s,m]),g=(0,r.useMemo)(()=>{let e={};return j.G.forEach(t=>{e[t]=[]}),p.forEach(t=>{j.G.includes(t.stage)&&e[t.stage].push(t)}),e},[p]),b=s.categories.length+s.priorities.length+s.efforts.length,f=(e,t)=>{i(s=>{let a=s[e],r=a.includes(t)?a.filter(e=>e!==t):[...a,t];return{...s,[e]:r}})};return(0,a.jsxs)("div",{className:"h-full flex flex-col",children:[(0,a.jsx)("div",{className:"px-6 py-3 bg-slate-50 border-b border-slate-200 overflow-x-auto",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("button",{onClick:()=>u(null),className:(0,d.Z)("px-3 py-1.5 text-sm font-medium rounded-full whitespace-nowrap transition-colors",null===m?"bg-slate-800 text-white":"bg-white text-slate-600 hover:bg-slate-100 border border-slate-200"),children:["All",(0,a.jsxs)("span",{className:"ml-1.5 text-xs opacity-70",children:["(",h.all,")"]})]}),k.map(e=>(0,a.jsxs)("button",{onClick:()=>u(e),className:(0,d.Z)("px-3 py-1.5 text-sm font-medium rounded-full whitespace-nowrap transition-colors",m===e?j.pG[e]:"bg-white text-slate-600 hover:bg-slate-100 border border-slate-200"),children:[j.Hs[e],h[e]>0&&(0,a.jsxs)("span",{className:"ml-1.5 text-xs opacity-70",children:["(",h[e],")"]})]},e))]})}),(0,a.jsxs)("div",{className:"px-6 py-4 bg-white border-b border-slate-200",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsxs)("div",{className:"relative flex-1 max-w-md",children:[(0,a.jsx)(l.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),(0,a.jsx)("input",{type:"text",placeholder:"Search ideas...",value:s.search,onChange:e=>i(t=>({...t,search:e.target.value})),className:"input pl-10"})]}),(0,a.jsxs)("button",{onClick:()=>x(!o),className:(0,d.Z)("btn btn-secondary gap-2",o&&"bg-slate-200"),children:[(0,a.jsx)(n,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Filters"}),b>0&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 bg-emerald-500 text-white text-xs rounded-full",children:b})]}),b>0&&(0,a.jsxs)("button",{onClick:()=>{i({categories:[],priorities:[],efforts:[],search:""})},className:"btn btn-ghost gap-1 text-sm",children:[(0,a.jsx)(c.Z,{className:"w-4 h-4"}),"Clear"]})]}),o&&(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-6 animate-slide-in",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-2",children:"Category"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:k.map(e=>(0,a.jsx)("button",{onClick:()=>f("categories",e),className:(0,d.Z)("px-2 py-1 text-xs rounded border transition-colors",s.categories.includes(e)?"bg-emerald-100 border-emerald-300 text-emerald-800":"bg-white border-slate-200 text-slate-600 hover:border-slate-300"),children:j.Hs[e]},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-2",children:"Priority"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:Z.map(e=>(0,a.jsx)("button",{onClick:()=>f("priorities",e),className:(0,d.Z)("px-2 py-1 text-xs rounded border transition-colors",s.priorities.includes(e)?"bg-emerald-100 border-emerald-300 text-emerald-800":"bg-white border-slate-200 text-slate-600 hover:border-slate-300"),children:j.rF[e]},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-2",children:"Effort"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:_.map(e=>(0,a.jsx)("button",{onClick:()=>f("efforts",e),className:(0,d.Z)("px-2 py-1 text-xs rounded border transition-colors",s.efforts.includes(e)?"bg-emerald-100 border-emerald-300 text-emerald-800":"bg-white border-slate-200 text-slate-600 hover:border-slate-300"),children:j.bi[e]},e))})]})]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-x-auto p-6",children:(0,a.jsx)("div",{className:"flex gap-4 h-full min-w-max",children:j.G.map(e=>(0,a.jsxs)("div",{className:"w-72 flex flex-col",children:[(0,a.jsxs)("div",{className:"kanban-column-header",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:(0,d.Z)("stage-indicator",j.lv[e])}),(0,a.jsx)("span",{className:"font-medium text-slate-700",children:j.yb[e]})]}),(0,a.jsx)("span",{className:"text-sm text-slate-400",children:g[e].length})]}),(0,a.jsx)("div",{className:"kanban-column flex-1 overflow-y-auto",children:0===g[e].length?(0,a.jsx)("div",{className:"text-center py-8 text-slate-400 text-sm",children:"No ideas"}):g[e].map(e=>(0,a.jsx)(w,{idea:e},e.id))})]},e))})})]})}},6153:function(e,t,s){"use strict";s.d(t,{G:function(){return n},GK:function(){return Z},Gs:function(){return o},Hs:function(){return a},PN:function(){return h},PW:function(){return w},Q_:function(){return p},R$:function(){return y},Vr:function(){return x},Wb:function(){return u},aR:function(){return m},bi:function(){return c},en:function(){return j},i2:function(){return v},kT:function(){return g},l5:function(){return b},lE:function(){return N},lv:function(){return i},pG:function(){return r},rF:function(){return d},tV:function(){return f},tl:function(){return k},xP:function(){return _},yb:function(){return l}});let a={product:"Product",ux_design:"UX/Design",growth:"Growth",performance:"Performance",tech_debt:"Tech Debt",security:"Security",infrastructure:"Infrastructure",content:"Content",analytics:"Analytics",integration:"Integration"},r={product:"bg-blue-100 text-blue-800",ux_design:"bg-purple-100 text-purple-800",growth:"bg-green-100 text-green-800",performance:"bg-orange-100 text-orange-800",tech_debt:"bg-yellow-100 text-yellow-800",security:"bg-red-100 text-red-800",infrastructure:"bg-gray-100 text-gray-800",content:"bg-pink-100 text-pink-800",analytics:"bg-cyan-100 text-cyan-800",integration:"bg-indigo-100 text-indigo-800"},l={inbox:"Inbox",under_review:"Under Review",approved:"Approved",in_progress:"In Progress",testing:"Testing",shipped:"Shipped",deferred:"Deferred",rejected:"Rejected",rolled_back:"Rolled Back"},i={inbox:"bg-amber-500",under_review:"bg-blue-500",approved:"bg-emerald-500",in_progress:"bg-violet-500",testing:"bg-cyan-500",shipped:"bg-green-500",deferred:"bg-gray-500",rejected:"bg-red-500",rolled_back:"bg-orange-500"},n=["inbox","under_review","approved","in_progress","testing","shipped"],c={xs:"XS",s:"S",m:"M",l:"L",xl:"XL"},d={critical:"Critical",high:"High",medium:"Medium",low:"Low"},o={critical:"bg-red-100 text-red-800 border-red-300",high:"bg-orange-100 text-orange-800 border-orange-300",medium:"bg-yellow-100 text-yellow-800 border-yellow-300",low:"bg-gray-100 text-gray-800 border-gray-300"},x={codebase_analysis:"Codebase Analysis",metrics_review:"Metrics Review",market_research:"Market Research",seo_audit:"SEO Audit",manual:"Manual"},m={pending:"bg-slate-100 text-slate-700",validated:"bg-emerald-100 text-emerald-800",needs_investigation:"bg-amber-100 text-amber-800",inconclusive:"bg-slate-100 text-slate-600",invalidated:"bg-red-100 text-red-800"},u={pending:"Pending",validated:"Validated",needs_investigation:"Needs Investigation",inconclusive:"Inconclusive",invalidated:"Invalidated"},h={ship:"Ship",update:"Update",milestone:"Milestone",digest:"Digest",manual:"Manual",thread:"Thread",insight:"Insight"},p={ship:"bg-green-100 text-green-800",update:"bg-blue-100 text-blue-800",milestone:"bg-amber-100 text-amber-800",digest:"bg-purple-100 text-purple-800",manual:"bg-slate-100 text-slate-800",thread:"bg-indigo-100 text-indigo-800",insight:"bg-cyan-100 text-cyan-800"},g={acquisition:"Acquisition",activation:"Activation",retention:"Retention",revenue:"Revenue",referral:"Referral"},b={acquisition:"bg-blue-100 text-blue-800",activation:"bg-emerald-100 text-emerald-800",retention:"bg-purple-100 text-purple-800",revenue:"bg-amber-100 text-amber-800",referral:"bg-pink-100 text-pink-800"},f={on_track:"On Track",at_risk:"At Risk",behind:"Behind",achieved:"Achieved"},v={on_track:"bg-emerald-100 text-emerald-800 border-emerald-300",at_risk:"bg-amber-100 text-amber-800 border-amber-300",behind:"bg-red-100 text-red-800 border-red-300",achieved:"bg-blue-100 text-blue-800 border-blue-300"},j={manual:"Manual",rest_api:"REST API",posthog:"PostHog",firestore:"Firestore",stripe:"Stripe",whatsapp:"WhatsApp"},y={stated:"Stated",testing:"Testing",validated:"Validated",invalidated:"Invalidated",deferred:"Deferred"},N={stated:"bg-slate-100 text-slate-800 border-slate-300",testing:"bg-amber-100 text-amber-800 border-amber-300",validated:"bg-emerald-100 text-emerald-800 border-emerald-300",invalidated:"bg-red-100 text-red-800 border-red-300",deferred:"bg-slate-100 text-slate-500 border-slate-200"},w={acquisition:"Acquisition",engagement:"Engagement",conversion:"Conversion",monetization:"Monetization"},k={acquisition:"bg-blue-100 text-blue-800",engagement:"bg-purple-100 text-purple-800",conversion:"bg-amber-100 text-amber-800",monetization:"bg-emerald-100 text-emerald-800"},Z={planned:"Planned",active:"Active",completed:"Completed",paused:"Paused"},_={planned:"bg-slate-100 text-slate-700 border-slate-300",active:"bg-blue-100 text-blue-800 border-blue-300",completed:"bg-emerald-100 text-emerald-800 border-emerald-300",paused:"bg-amber-100 text-amber-800 border-amber-300"}}},function(e){e.O(0,[746,971,117,744],function(){return e(e.s=7075)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25],{9375:function(e,t,a){Promise.resolve().then(a.bind(a,47))},2660:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},505:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},6362:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},5846:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]])},47:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return m}});var s=a(7437),r=a(2265),l=a(7648),n=a(2660);let i=(0,a(9205).Z)("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);var d=a(5846),c=a(8896),o=a(505),x=a(6362),u=a(1994),h=a(1259),p=a(6153);function m(e){let{params:t}=e,{id:a}=t,[m,b]=(0,r.useState)(null),[g,f]=(0,r.useState)([]),[j,v]=(0,r.useState)(null),[N,y]=(0,r.useState)(!0),[w,_]=(0,r.useState)(null);(0,r.useEffect)(()=>{!async function(){try{let e=await fetch("/api/epics/".concat(a)),t=await e.json();if(!t.success){_(t.error||"Failed to load epic");return}if(b(t.data),t.data.idea_ids.length>0){let e=await fetch("/api/ideas"),a=await e.json();if(a.success){let e=t.data.idea_ids.map(e=>a.data.find(t=>t.id===e)).filter(Boolean);f(e)}}if(t.data.goal_id){let e=await fetch("/api/goals/".concat(t.data.goal_id)),a=await e.json();a.success&&v(a.data)}}catch(e){_("Failed to load epic"),console.error("Error fetching epic:",e)}finally{y(!1)}}()},[a]);let k=async e=>{try{let t=await fetch("/api/epics/".concat(a),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:e,status_override:!0})}),s=await t.json();s.success&&b(s.data)}catch(e){console.error("Failed to update status:",e)}};return N?(0,s.jsx)(h.default,{children:(0,s.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,s.jsx)("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-blue-500 rounded-full animate-spin"})})}):w||!m?(0,s.jsx)(h.default,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)(l.default,{href:"/roadmap",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[(0,s.jsx)(n.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Back to Roadmap"})]}),(0,s.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6 text-center",children:(0,s.jsx)("p",{className:"text-red-600",children:w||"Epic not found"})})]})}):(0,s.jsx)(h.default,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)(l.default,{href:"/roadmap",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[(0,s.jsx)(n.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Back to Roadmap"})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-6",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-start gap-4",children:[(0,s.jsx)("div",{className:"w-14 h-14 bg-blue-100 rounded-xl flex items-center justify-center flex-shrink-0",children:(0,s.jsx)(i,{className:"w-7 h-7 text-blue-600"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,s.jsx)("span",{className:(0,u.Z)("text-xs px-2 py-0.5 rounded-full",p.pG[m.category]),children:p.Hs[m.category]})}),(0,s.jsx)("h1",{className:"text-2xl font-bold text-slate-900 mb-1",children:m.title}),(0,s.jsx)("p",{className:"text-slate-500",children:m.description})]})]}),(0,s.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,s.jsx)("span",{className:(0,u.Z)("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-medium border",p.xP[m.status]),children:p.GK[m.status]}),(0,s.jsxs)("select",{value:m.status,onChange:e=>k(e.target.value),className:"text-xs border border-slate-200 rounded px-2 py-1 text-slate-600",children:[(0,s.jsx)("option",{value:"planned",children:"Planned"}),(0,s.jsx)("option",{value:"active",children:"Active"}),(0,s.jsx)("option",{value:"completed",children:"Completed"}),(0,s.jsx)("option",{value:"paused",children:"Paused"})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-6 text-sm text-slate-500 mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.Z,{className:"w-4 h-4"}),(0,s.jsxs)("span",{children:[m.idea_ids.length," ideas"]})]}),j&&(0,s.jsxs)(l.default,{href:"/goals/".concat(j.id),className:"flex items-center gap-2 text-emerald-600 hover:text-emerald-700",children:[(0,s.jsx)(c.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:j.title})]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-4 mb-4",children:[(0,s.jsx)(o.Z,{className:"w-4 h-4 text-slate-400 mt-2"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-slate-500 mb-1",children:"Target Start"}),(0,s.jsx)("input",{type:"date",value:m.target_start||"",onChange:async e=>{let t=e.target.value||null;try{let e=await fetch("/api/epics/".concat(a),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({target_start:t})}),s=await e.json();s.success&&b(s.data)}catch(e){console.error("Failed to update target_start:",e)}},className:"text-sm border border-slate-200 rounded px-2 py-1 text-slate-700"}),!m.target_start&&(0,s.jsx)("span",{className:"text-[10px] text-slate-400 block mt-0.5",children:"auto-estimated"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-slate-500 mb-1",children:"Target End"}),(0,s.jsx)("input",{type:"date",value:m.target_end||"",onChange:async e=>{let t=e.target.value||null;try{let e=await fetch("/api/epics/".concat(a),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({target_end:t})}),s=await e.json();s.success&&b(s.data)}catch(e){console.error("Failed to update target_end:",e)}},className:"text-sm border border-slate-200 rounded px-2 py-1 text-slate-700"}),!m.target_end&&(0,s.jsx)("span",{className:"text-[10px] text-slate-400 block mt-0.5",children:"auto-estimated"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("span",{className:"text-xs text-slate-500",children:[m.progress.shipped_count,"/",m.progress.total_ideas," ideas shipped"]}),(0,s.jsxs)("span",{className:"text-xs font-medium text-slate-700",children:[m.progress.progress_pct,"%"]})]}),(0,s.jsx)("div",{className:"relative h-2 bg-slate-100 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:(0,u.Z)("absolute left-0 top-0 h-full rounded-full transition-all duration-500","completed"===m.status?"bg-emerald-500":"active"===m.status?"bg-blue-500":"bg-slate-300"),style:{width:"".concat(m.progress.progress_pct,"%")}})}),m.progress.effort_total>0&&(0,s.jsxs)("p",{className:"text-xs text-slate-400 mt-1",children:["Effort: ",m.progress.effort_completed,"/",m.progress.effort_total," points completed"]})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200",children:[(0,s.jsx)("div",{className:"px-6 py-4 border-b border-slate-200",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold text-slate-900",children:["Ideas (",g.length,")"]})}),g.length>0?(0,s.jsx)("div",{className:"divide-y divide-slate-100",children:g.map((e,t)=>(0,s.jsxs)(l.default,{href:"/ideas/".concat(e.id),className:"flex items-center gap-4 px-6 py-3 hover:bg-slate-50 transition-colors",children:[(0,s.jsx)("span",{className:"text-xs text-slate-400 w-6 text-center",children:t+1}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-slate-900 truncate",children:e.title}),(0,s.jsx)("p",{className:"text-xs text-slate-500 truncate",children:e.summary})]}),(0,s.jsx)("span",{className:(0,u.Z)("text-xs px-2 py-0.5 rounded-full text-white",p.lv[e.stage]),children:p.yb[e.stage]}),(0,s.jsx)("span",{className:"text-xs text-slate-400 w-8 text-center",children:p.bi[e.effort]}),(0,s.jsx)(x.Z,{className:"w-4 h-4 text-slate-300 flex-shrink-0"})]},e.id))}):(0,s.jsxs)("div",{className:"p-8 text-center",children:[(0,s.jsx)(d.Z,{className:"w-8 h-8 text-slate-300 mx-auto mb-2"}),(0,s.jsx)("p",{className:"text-sm text-slate-500",children:"No ideas in this epic yet. Add ideas via the API."})]})]}),(0,s.jsxs)("div",{className:"mt-6 text-xs text-slate-400",children:[(0,s.jsxs)("p",{children:["Created: ",new Date(m.created_at).toLocaleString()]}),(0,s.jsxs)("p",{children:["Last updated: ",new Date(m.updated_at).toLocaleString()]})]})]})})}},1259:function(e,t,a){"use strict";a.d(t,{default:function(){return f}});var s=a(7437),r=a(7648),l=a(9376),n=a(5466),i=a(2048),d=a(8896),c=a(8220),o=a(2718),x=a(5621),u=a(8728),h=a(2222),p=a(2023),m=a(1994),b=a(257);let g=[{href:"/",label:"Dashboard",icon:(0,s.jsx)(n.Z,{className:"w-5 h-5"})},{href:"/roadmap",label:"Roadmap",icon:(0,s.jsx)(i.Z,{className:"w-5 h-5"})},{href:"/goals",label:"Goals",icon:(0,s.jsx)(d.Z,{className:"w-5 h-5"})},{href:"/hypotheses",label:"Hypotheses",icon:(0,s.jsx)(c.Z,{className:"w-5 h-5"})},{href:"/social",label:"Social",icon:(0,s.jsx)(o.Z,{className:"w-5 h-5"})},{href:"/sessions",label:"Sessions",icon:(0,s.jsx)(x.Z,{className:"w-5 h-5"})},{href:"/settings",label:"Settings",icon:(0,s.jsx)(u.Z,{className:"w-5 h-5"})}];function f(e){let{children:t}=e,a=(0,l.usePathname)();return(0,s.jsxs)("div",{className:"min-h-screen flex",children:[(0,s.jsxs)("aside",{className:"w-64 bg-slate-900 text-white flex flex-col",children:[(0,s.jsx)("div",{className:"p-4 border-b border-slate-700",children:(0,s.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-10 h-10 bg-emerald-500 rounded-lg flex items-center justify-center",children:(0,s.jsx)(h.Z,{className:"w-6 h-6 text-white"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"font-bold text-lg leading-tight",children:"Analyst"}),(0,s.jsx)("p",{className:"text-xs text-slate-400",children:b.env.NEXT_PUBLIC_PRODUCT_NAME||"Business"})]})]})}),(0,s.jsx)("nav",{className:"flex-1 p-4",children:(0,s.jsx)("ul",{className:"space-y-1",children:g.map(e=>{let t="/"===e.href?"/"===a:a.startsWith(e.href);return(0,s.jsx)("li",{children:(0,s.jsxs)(r.default,{href:e.href,className:(0,m.Z)("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",t?"bg-slate-800 text-white":"text-slate-400 hover:text-white hover:bg-slate-800"),children:[e.icon,(0,s.jsx)("span",{children:e.label})]})},e.href)})})}),(0,s.jsx)("div",{className:"p-4 border-t border-slate-700",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,s.jsx)(p.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Powered by Claude"})]})})]}),(0,s.jsx)("main",{className:"flex-1 overflow-auto",children:t})]})}},6153:function(e,t,a){"use strict";a.d(t,{G:function(){return i},GK:function(){return k},Gs:function(){return o},Hs:function(){return s},PN:function(){return p},PW:function(){return w},Q_:function(){return m},R$:function(){return N},Vr:function(){return x},Wb:function(){return h},aR:function(){return u},bi:function(){return d},en:function(){return v},i2:function(){return j},kT:function(){return b},l5:function(){return g},lE:function(){return y},lv:function(){return n},pG:function(){return r},rF:function(){return c},tV:function(){return f},tl:function(){return _},xP:function(){return Z},yb:function(){return l}});let s={product:"Product",ux_design:"UX/Design",growth:"Growth",performance:"Performance",tech_debt:"Tech Debt",security:"Security",infrastructure:"Infrastructure",content:"Content",analytics:"Analytics",integration:"Integration"},r={product:"bg-blue-100 text-blue-800",ux_design:"bg-purple-100 text-purple-800",growth:"bg-green-100 text-green-800",performance:"bg-orange-100 text-orange-800",tech_debt:"bg-yellow-100 text-yellow-800",security:"bg-red-100 text-red-800",infrastructure:"bg-gray-100 text-gray-800",content:"bg-pink-100 text-pink-800",analytics:"bg-cyan-100 text-cyan-800",integration:"bg-indigo-100 text-indigo-800"},l={inbox:"Inbox",under_review:"Under Review",approved:"Approved",in_progress:"In Progress",testing:"Testing",shipped:"Shipped",deferred:"Deferred",rejected:"Rejected",rolled_back:"Rolled Back"},n={inbox:"bg-amber-500",under_review:"bg-blue-500",approved:"bg-emerald-500",in_progress:"bg-violet-500",testing:"bg-cyan-500",shipped:"bg-green-500",deferred:"bg-gray-500",rejected:"bg-red-500",rolled_back:"bg-orange-500"},i=["inbox","under_review","approved","in_progress","testing","shipped"],d={xs:"XS",s:"S",m:"M",l:"L",xl:"XL"},c={critical:"Critical",high:"High",medium:"Medium",low:"Low"},o={critical:"bg-red-100 text-red-800 border-red-300",high:"bg-orange-100 text-orange-800 border-orange-300",medium:"bg-yellow-100 text-yellow-800 border-yellow-300",low:"bg-gray-100 text-gray-800 border-gray-300"},x={codebase_analysis:"Codebase Analysis",metrics_review:"Metrics Review",market_research:"Market Research",seo_audit:"SEO Audit",manual:"Manual"},u={pending:"bg-slate-100 text-slate-700",validated:"bg-emerald-100 text-emerald-800",needs_investigation:"bg-amber-100 text-amber-800",inconclusive:"bg-slate-100 text-slate-600",invalidated:"bg-red-100 text-red-800"},h={pending:"Pending",validated:"Validated",needs_investigation:"Needs Investigation",inconclusive:"Inconclusive",invalidated:"Invalidated"},p={ship:"Ship",update:"Update",milestone:"Milestone",digest:"Digest",manual:"Manual"},m={ship:"bg-green-100 text-green-800",update:"bg-blue-100 text-blue-800",milestone:"bg-amber-100 text-amber-800",digest:"bg-purple-100 text-purple-800",manual:"bg-slate-100 text-slate-800"},b={acquisition:"Acquisition",activation:"Activation",retention:"Retention",revenue:"Revenue",referral:"Referral"},g={acquisition:"bg-blue-100 text-blue-800",activation:"bg-emerald-100 text-emerald-800",retention:"bg-purple-100 text-purple-800",revenue:"bg-amber-100 text-amber-800",referral:"bg-pink-100 text-pink-800"},f={on_track:"On Track",at_risk:"At Risk",behind:"Behind",achieved:"Achieved"},j={on_track:"bg-emerald-100 text-emerald-800 border-emerald-300",at_risk:"bg-amber-100 text-amber-800 border-amber-300",behind:"bg-red-100 text-red-800 border-red-300",achieved:"bg-blue-100 text-blue-800 border-blue-300"},v={manual:"Manual",rest_api:"REST API",posthog:"PostHog",firestore:"Firestore",stripe:"Stripe",whatsapp:"WhatsApp"},N={stated:"Stated",testing:"Testing",validated:"Validated",invalidated:"Invalidated",deferred:"Deferred"},y={stated:"bg-slate-100 text-slate-800 border-slate-300",testing:"bg-amber-100 text-amber-800 border-amber-300",validated:"bg-emerald-100 text-emerald-800 border-emerald-300",invalidated:"bg-red-100 text-red-800 border-red-300",deferred:"bg-slate-100 text-slate-500 border-slate-200"},w={acquisition:"Acquisition",engagement:"Engagement",conversion:"Conversion",monetization:"Monetization"},_={acquisition:"bg-blue-100 text-blue-800",engagement:"bg-purple-100 text-purple-800",conversion:"bg-amber-100 text-amber-800",monetization:"bg-emerald-100 text-emerald-800"},k={planned:"Planned",active:"Active",completed:"Completed",paused:"Paused"},Z={planned:"bg-slate-100 text-slate-700 border-slate-300",active:"bg-blue-100 text-blue-800 border-blue-300",completed:"bg-emerald-100 text-emerald-800 border-emerald-300",paused:"bg-amber-100 text-amber-800 border-amber-300"}}},function(e){e.O(0,[746,971,117,744],function(){return e(e.s=9375)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25],{9375:function(e,t,a){Promise.resolve().then(a.bind(a,47))},2660:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},505:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},6362:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},5846:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(9205).Z)("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]])},47:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return m}});var s=a(7437),r=a(2265),n=a(7648),l=a(2660);let i=(0,a(9205).Z)("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);var d=a(5846),c=a(8896),o=a(505),x=a(6362),u=a(1994),h=a(1259),p=a(6153);function m(e){let{params:t}=e,{id:a}=t,[m,b]=(0,r.useState)(null),[g,f]=(0,r.useState)([]),[j,v]=(0,r.useState)(null),[N,y]=(0,r.useState)(!0),[w,_]=(0,r.useState)(null);(0,r.useEffect)(()=>{!async function(){try{let e=await fetch("/api/epics/".concat(a)),t=await e.json();if(!t.success){_(t.error||"Failed to load epic");return}if(b(t.data),t.data.idea_ids.length>0){let e=await fetch("/api/ideas"),a=await e.json();if(a.success){let e=t.data.idea_ids.map(e=>a.data.find(t=>t.id===e)).filter(Boolean);f(e)}}if(t.data.goal_id){let e=await fetch("/api/goals/".concat(t.data.goal_id)),a=await e.json();a.success&&v(a.data)}}catch(e){_("Failed to load epic"),console.error("Error fetching epic:",e)}finally{y(!1)}}()},[a]);let k=async e=>{try{let t=await fetch("/api/epics/".concat(a),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:e,status_override:!0})}),s=await t.json();s.success&&b(s.data)}catch(e){console.error("Failed to update status:",e)}};return N?(0,s.jsx)(h.default,{children:(0,s.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,s.jsx)("div",{className:"w-8 h-8 border-4 border-slate-200 border-t-blue-500 rounded-full animate-spin"})})}):w||!m?(0,s.jsx)(h.default,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)(n.default,{href:"/roadmap",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[(0,s.jsx)(l.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Back to Roadmap"})]}),(0,s.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6 text-center",children:(0,s.jsx)("p",{className:"text-red-600",children:w||"Epic not found"})})]})}):(0,s.jsx)(h.default,{children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsxs)(n.default,{href:"/roadmap",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[(0,s.jsx)(l.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Back to Roadmap"})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-6",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,s.jsxs)("div",{className:"flex items-start gap-4",children:[(0,s.jsx)("div",{className:"w-14 h-14 bg-blue-100 rounded-xl flex items-center justify-center flex-shrink-0",children:(0,s.jsx)(i,{className:"w-7 h-7 text-blue-600"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex items-center gap-2 mb-1",children:(0,s.jsx)("span",{className:(0,u.Z)("text-xs px-2 py-0.5 rounded-full",p.pG[m.category]),children:p.Hs[m.category]})}),(0,s.jsx)("h1",{className:"text-2xl font-bold text-slate-900 mb-1",children:m.title}),(0,s.jsx)("p",{className:"text-slate-500",children:m.description})]})]}),(0,s.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,s.jsx)("span",{className:(0,u.Z)("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-medium border",p.xP[m.status]),children:p.GK[m.status]}),(0,s.jsxs)("select",{value:m.status,onChange:e=>k(e.target.value),className:"text-xs border border-slate-200 rounded px-2 py-1 text-slate-600",children:[(0,s.jsx)("option",{value:"planned",children:"Planned"}),(0,s.jsx)("option",{value:"active",children:"Active"}),(0,s.jsx)("option",{value:"completed",children:"Completed"}),(0,s.jsx)("option",{value:"paused",children:"Paused"})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-6 text-sm text-slate-500 mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.Z,{className:"w-4 h-4"}),(0,s.jsxs)("span",{children:[m.idea_ids.length," ideas"]})]}),j&&(0,s.jsxs)(n.default,{href:"/goals/".concat(j.id),className:"flex items-center gap-2 text-emerald-600 hover:text-emerald-700",children:[(0,s.jsx)(c.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:j.title})]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-4 mb-4",children:[(0,s.jsx)(o.Z,{className:"w-4 h-4 text-slate-400 mt-2"}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-slate-500 mb-1",children:"Target Start"}),(0,s.jsx)("input",{type:"date",value:m.target_start||"",onChange:async e=>{let t=e.target.value||null;try{let e=await fetch("/api/epics/".concat(a),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({target_start:t})}),s=await e.json();s.success&&b(s.data)}catch(e){console.error("Failed to update target_start:",e)}},className:"text-sm border border-slate-200 rounded px-2 py-1 text-slate-700"}),!m.target_start&&(0,s.jsx)("span",{className:"text-[10px] text-slate-400 block mt-0.5",children:"auto-estimated"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-slate-500 mb-1",children:"Target End"}),(0,s.jsx)("input",{type:"date",value:m.target_end||"",onChange:async e=>{let t=e.target.value||null;try{let e=await fetch("/api/epics/".concat(a),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({target_end:t})}),s=await e.json();s.success&&b(s.data)}catch(e){console.error("Failed to update target_end:",e)}},className:"text-sm border border-slate-200 rounded px-2 py-1 text-slate-700"}),!m.target_end&&(0,s.jsx)("span",{className:"text-[10px] text-slate-400 block mt-0.5",children:"auto-estimated"})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,s.jsxs)("span",{className:"text-xs text-slate-500",children:[m.progress.shipped_count,"/",m.progress.total_ideas," ideas shipped"]}),(0,s.jsxs)("span",{className:"text-xs font-medium text-slate-700",children:[m.progress.progress_pct,"%"]})]}),(0,s.jsx)("div",{className:"relative h-2 bg-slate-100 rounded-full overflow-hidden",children:(0,s.jsx)("div",{className:(0,u.Z)("absolute left-0 top-0 h-full rounded-full transition-all duration-500","completed"===m.status?"bg-emerald-500":"active"===m.status?"bg-blue-500":"bg-slate-300"),style:{width:"".concat(m.progress.progress_pct,"%")}})}),m.progress.effort_total>0&&(0,s.jsxs)("p",{className:"text-xs text-slate-400 mt-1",children:["Effort: ",m.progress.effort_completed,"/",m.progress.effort_total," points completed"]})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200",children:[(0,s.jsx)("div",{className:"px-6 py-4 border-b border-slate-200",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold text-slate-900",children:["Ideas (",g.length,")"]})}),g.length>0?(0,s.jsx)("div",{className:"divide-y divide-slate-100",children:g.map((e,t)=>(0,s.jsxs)(n.default,{href:"/ideas/".concat(e.id),className:"flex items-center gap-4 px-6 py-3 hover:bg-slate-50 transition-colors",children:[(0,s.jsx)("span",{className:"text-xs text-slate-400 w-6 text-center",children:t+1}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-slate-900 truncate",children:e.title}),(0,s.jsx)("p",{className:"text-xs text-slate-500 truncate",children:e.summary})]}),(0,s.jsx)("span",{className:(0,u.Z)("text-xs px-2 py-0.5 rounded-full text-white",p.lv[e.stage]),children:p.yb[e.stage]}),(0,s.jsx)("span",{className:"text-xs text-slate-400 w-8 text-center",children:p.bi[e.effort]}),(0,s.jsx)(x.Z,{className:"w-4 h-4 text-slate-300 flex-shrink-0"})]},e.id))}):(0,s.jsxs)("div",{className:"p-8 text-center",children:[(0,s.jsx)(d.Z,{className:"w-8 h-8 text-slate-300 mx-auto mb-2"}),(0,s.jsx)("p",{className:"text-sm text-slate-500",children:"No ideas in this epic yet. Add ideas via the API."})]})]}),(0,s.jsxs)("div",{className:"mt-6 text-xs text-slate-400",children:[(0,s.jsxs)("p",{children:["Created: ",new Date(m.created_at).toLocaleString()]}),(0,s.jsxs)("p",{children:["Last updated: ",new Date(m.updated_at).toLocaleString()]})]})]})})}},1259:function(e,t,a){"use strict";a.d(t,{default:function(){return f}});var s=a(7437),r=a(7648),n=a(9376),l=a(5466),i=a(2048),d=a(8896),c=a(8220),o=a(2718),x=a(5621),u=a(8728),h=a(2222),p=a(2023),m=a(1994),b=a(257);let g=[{href:"/",label:"Dashboard",icon:(0,s.jsx)(l.Z,{className:"w-5 h-5"})},{href:"/roadmap",label:"Roadmap",icon:(0,s.jsx)(i.Z,{className:"w-5 h-5"})},{href:"/goals",label:"Goals",icon:(0,s.jsx)(d.Z,{className:"w-5 h-5"})},{href:"/hypotheses",label:"Hypotheses",icon:(0,s.jsx)(c.Z,{className:"w-5 h-5"})},{href:"/social",label:"Social",icon:(0,s.jsx)(o.Z,{className:"w-5 h-5"})},{href:"/sessions",label:"Sessions",icon:(0,s.jsx)(x.Z,{className:"w-5 h-5"})},{href:"/settings",label:"Settings",icon:(0,s.jsx)(u.Z,{className:"w-5 h-5"})}];function f(e){let{children:t}=e,a=(0,n.usePathname)();return(0,s.jsxs)("div",{className:"min-h-screen flex",children:[(0,s.jsxs)("aside",{className:"w-64 bg-slate-900 text-white flex flex-col",children:[(0,s.jsx)("div",{className:"p-4 border-b border-slate-700",children:(0,s.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"w-10 h-10 bg-emerald-500 rounded-lg flex items-center justify-center",children:(0,s.jsx)(h.Z,{className:"w-6 h-6 text-white"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"font-bold text-lg leading-tight",children:"Analyst"}),(0,s.jsx)("p",{className:"text-xs text-slate-400",children:b.env.NEXT_PUBLIC_PRODUCT_NAME||"Business"})]})]})}),(0,s.jsx)("nav",{className:"flex-1 p-4",children:(0,s.jsx)("ul",{className:"space-y-1",children:g.map(e=>{let t="/"===e.href?"/"===a:a.startsWith(e.href);return(0,s.jsx)("li",{children:(0,s.jsxs)(r.default,{href:e.href,className:(0,m.Z)("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",t?"bg-slate-800 text-white":"text-slate-400 hover:text-white hover:bg-slate-800"),children:[e.icon,(0,s.jsx)("span",{children:e.label})]})},e.href)})})}),(0,s.jsx)("div",{className:"p-4 border-t border-slate-700",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,s.jsx)(p.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:"Powered by Claude"})]})})]}),(0,s.jsx)("main",{className:"flex-1 overflow-auto",children:t})]})}},6153:function(e,t,a){"use strict";a.d(t,{G:function(){return i},GK:function(){return k},Gs:function(){return o},Hs:function(){return s},PN:function(){return p},PW:function(){return w},Q_:function(){return m},R$:function(){return N},Vr:function(){return x},Wb:function(){return h},aR:function(){return u},bi:function(){return d},en:function(){return v},i2:function(){return j},kT:function(){return b},l5:function(){return g},lE:function(){return y},lv:function(){return l},pG:function(){return r},rF:function(){return c},tV:function(){return f},tl:function(){return _},xP:function(){return Z},yb:function(){return n}});let s={product:"Product",ux_design:"UX/Design",growth:"Growth",performance:"Performance",tech_debt:"Tech Debt",security:"Security",infrastructure:"Infrastructure",content:"Content",analytics:"Analytics",integration:"Integration"},r={product:"bg-blue-100 text-blue-800",ux_design:"bg-purple-100 text-purple-800",growth:"bg-green-100 text-green-800",performance:"bg-orange-100 text-orange-800",tech_debt:"bg-yellow-100 text-yellow-800",security:"bg-red-100 text-red-800",infrastructure:"bg-gray-100 text-gray-800",content:"bg-pink-100 text-pink-800",analytics:"bg-cyan-100 text-cyan-800",integration:"bg-indigo-100 text-indigo-800"},n={inbox:"Inbox",under_review:"Under Review",approved:"Approved",in_progress:"In Progress",testing:"Testing",shipped:"Shipped",deferred:"Deferred",rejected:"Rejected",rolled_back:"Rolled Back"},l={inbox:"bg-amber-500",under_review:"bg-blue-500",approved:"bg-emerald-500",in_progress:"bg-violet-500",testing:"bg-cyan-500",shipped:"bg-green-500",deferred:"bg-gray-500",rejected:"bg-red-500",rolled_back:"bg-orange-500"},i=["inbox","under_review","approved","in_progress","testing","shipped"],d={xs:"XS",s:"S",m:"M",l:"L",xl:"XL"},c={critical:"Critical",high:"High",medium:"Medium",low:"Low"},o={critical:"bg-red-100 text-red-800 border-red-300",high:"bg-orange-100 text-orange-800 border-orange-300",medium:"bg-yellow-100 text-yellow-800 border-yellow-300",low:"bg-gray-100 text-gray-800 border-gray-300"},x={codebase_analysis:"Codebase Analysis",metrics_review:"Metrics Review",market_research:"Market Research",seo_audit:"SEO Audit",manual:"Manual"},u={pending:"bg-slate-100 text-slate-700",validated:"bg-emerald-100 text-emerald-800",needs_investigation:"bg-amber-100 text-amber-800",inconclusive:"bg-slate-100 text-slate-600",invalidated:"bg-red-100 text-red-800"},h={pending:"Pending",validated:"Validated",needs_investigation:"Needs Investigation",inconclusive:"Inconclusive",invalidated:"Invalidated"},p={ship:"Ship",update:"Update",milestone:"Milestone",digest:"Digest",manual:"Manual",thread:"Thread",insight:"Insight"},m={ship:"bg-green-100 text-green-800",update:"bg-blue-100 text-blue-800",milestone:"bg-amber-100 text-amber-800",digest:"bg-purple-100 text-purple-800",manual:"bg-slate-100 text-slate-800",thread:"bg-indigo-100 text-indigo-800",insight:"bg-cyan-100 text-cyan-800"},b={acquisition:"Acquisition",activation:"Activation",retention:"Retention",revenue:"Revenue",referral:"Referral"},g={acquisition:"bg-blue-100 text-blue-800",activation:"bg-emerald-100 text-emerald-800",retention:"bg-purple-100 text-purple-800",revenue:"bg-amber-100 text-amber-800",referral:"bg-pink-100 text-pink-800"},f={on_track:"On Track",at_risk:"At Risk",behind:"Behind",achieved:"Achieved"},j={on_track:"bg-emerald-100 text-emerald-800 border-emerald-300",at_risk:"bg-amber-100 text-amber-800 border-amber-300",behind:"bg-red-100 text-red-800 border-red-300",achieved:"bg-blue-100 text-blue-800 border-blue-300"},v={manual:"Manual",rest_api:"REST API",posthog:"PostHog",firestore:"Firestore",stripe:"Stripe",whatsapp:"WhatsApp"},N={stated:"Stated",testing:"Testing",validated:"Validated",invalidated:"Invalidated",deferred:"Deferred"},y={stated:"bg-slate-100 text-slate-800 border-slate-300",testing:"bg-amber-100 text-amber-800 border-amber-300",validated:"bg-emerald-100 text-emerald-800 border-emerald-300",invalidated:"bg-red-100 text-red-800 border-red-300",deferred:"bg-slate-100 text-slate-500 border-slate-200"},w={acquisition:"Acquisition",engagement:"Engagement",conversion:"Conversion",monetization:"Monetization"},_={acquisition:"bg-blue-100 text-blue-800",engagement:"bg-purple-100 text-purple-800",conversion:"bg-amber-100 text-amber-800",monetization:"bg-emerald-100 text-emerald-800"},k={planned:"Planned",active:"Active",completed:"Completed",paused:"Paused"},Z={planned:"bg-slate-100 text-slate-700 border-slate-300",active:"bg-blue-100 text-blue-800 border-blue-300",completed:"bg-emerald-100 text-emerald-800 border-emerald-300",paused:"bg-amber-100 text-amber-800 border-amber-300"}}},function(e){e.O(0,[746,971,117,744],function(){return e(e.s=9375)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[943],{7670:function(e,t,s){Promise.resolve().then(s.bind(s,1259)),Promise.resolve().then(s.bind(s,3032))},6221:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},1259:function(e,t,s){"use strict";s.d(t,{default:function(){return f}});var a=s(7437),r=s(7648),l=s(9376),n=s(5466),i=s(2048),d=s(8896),o=s(8220),c=s(2718),x=s(5621),u=s(8728),m=s(2222),b=s(2023),p=s(1994),g=s(257);let h=[{href:"/",label:"Dashboard",icon:(0,a.jsx)(n.Z,{className:"w-5 h-5"})},{href:"/roadmap",label:"Roadmap",icon:(0,a.jsx)(i.Z,{className:"w-5 h-5"})},{href:"/goals",label:"Goals",icon:(0,a.jsx)(d.Z,{className:"w-5 h-5"})},{href:"/hypotheses",label:"Hypotheses",icon:(0,a.jsx)(o.Z,{className:"w-5 h-5"})},{href:"/social",label:"Social",icon:(0,a.jsx)(c.Z,{className:"w-5 h-5"})},{href:"/sessions",label:"Sessions",icon:(0,a.jsx)(x.Z,{className:"w-5 h-5"})},{href:"/settings",label:"Settings",icon:(0,a.jsx)(u.Z,{className:"w-5 h-5"})}];function f(e){let{children:t}=e,s=(0,l.usePathname)();return(0,a.jsxs)("div",{className:"min-h-screen flex",children:[(0,a.jsxs)("aside",{className:"w-64 bg-slate-900 text-white flex flex-col",children:[(0,a.jsx)("div",{className:"p-4 border-b border-slate-700",children:(0,a.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-emerald-500 rounded-lg flex items-center justify-center",children:(0,a.jsx)(m.Z,{className:"w-6 h-6 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"font-bold text-lg leading-tight",children:"Analyst"}),(0,a.jsx)("p",{className:"text-xs text-slate-400",children:g.env.NEXT_PUBLIC_PRODUCT_NAME||"Business"})]})]})}),(0,a.jsx)("nav",{className:"flex-1 p-4",children:(0,a.jsx)("ul",{className:"space-y-1",children:h.map(e=>{let t="/"===e.href?"/"===s:s.startsWith(e.href);return(0,a.jsx)("li",{children:(0,a.jsxs)(r.default,{href:e.href,className:(0,p.Z)("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",t?"bg-slate-800 text-white":"text-slate-400 hover:text-white hover:bg-slate-800"),children:[e.icon,(0,a.jsx)("span",{children:e.label})]})},e.href)})})}),(0,a.jsx)("div",{className:"p-4 border-t border-slate-700",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,a.jsx)(b.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Powered by Claude"})]})})]}),(0,a.jsx)("main",{className:"flex-1 overflow-auto",children:t})]})}},3032:function(e,t,s){"use strict";s.d(t,{default:function(){return f}});var a=s(7437),r=s(2265);let l=(0,s(9205).Z)("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);var n=s(6221),i=s(1994),d=s(7648),o=s(6153);function c(e){let{progress:t,status:s}=e,r=Math.round(t.progress_pct/100*8),l="█".repeat(r)+"░".repeat(8-r);return(0,a.jsx)("span",{className:(0,i.Z)("font-mono text-xs tracking-tight","completed"===s?"text-emerald-500":"active"===s?"text-blue-500":"text-slate-400"),children:l})}function x(e){let{epic:t,index:s,progress:r}=e,l=t.tags.includes("needs-review");return(0,a.jsx)(d.default,{href:"/roadmap/".concat(t.id),children:(0,a.jsxs)("div",{className:(0,i.Z)("flex items-center gap-4 px-4 py-3 hover:bg-slate-50 transition-colors rounded-lg group",l&&"border border-dashed border-slate-300"),children:[(0,a.jsxs)("span",{className:"text-sm font-bold text-slate-400 w-8 text-right flex-shrink-0",children:["#",s]}),(0,a.jsxs)("span",{className:"text-sm font-medium text-slate-900 flex-1 min-w-0 truncate group-hover:text-blue-600",children:[t.title,l&&(0,a.jsx)("span",{className:"ml-2 text-xs text-slate-400 font-normal italic",children:"draft"})]}),(0,a.jsx)(c,{progress:r,status:t.status}),(0,a.jsxs)("span",{className:"text-xs text-slate-500 w-12 text-center flex-shrink-0",children:[r.shipped_count,"/",r.total_ideas]}),(0,a.jsx)("span",{className:(0,i.Z)("text-xs px-2 py-0.5 rounded-full border flex-shrink-0 w-20 text-center",o.xP[t.status]),children:o.GK[t.status]}),(0,a.jsx)("span",{className:(0,i.Z)("text-xs px-2 py-0.5 rounded-full flex-shrink-0 hidden sm:inline-block",o.pG[t.category]),children:o.Hs[t.category]})]})})}function u(e){let{goalGroups:t,progressMap:s}=e;if(0===t.length)return(0,a.jsx)("div",{className:"bg-white rounded-lg border border-slate-200 p-12 text-center",children:(0,a.jsx)("p",{className:"text-slate-500",children:"No epics to display."})});let r={total_ideas:0,by_stage:{},shipped_count:0,progress_pct:0,effort_total:0,effort_completed:0},l=0;return(0,a.jsx)("div",{className:"space-y-6",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-slate-100",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-slate-700",children:e.goalId?"Goal: ".concat(e.goalTitle):e.goalTitle}),(0,a.jsxs)("span",{className:"text-xs text-slate-400",children:[e.epics.length," epic",1!==e.epics.length?"s":""," \xb7 ",e.totalIdeas," idea",1!==e.totalIdeas?"s":""]})]}),(0,a.jsx)("div",{className:"divide-y divide-slate-50",children:e.epics.map(e=>(l++,(0,a.jsx)(x,{epic:e,index:l,progress:s[e.id]||r},e.id)))})]},null!==(t=e.goalId)&&void 0!==t?t:"orphan")})})}function m(e){return new Date(e+"T00:00:00")}function b(e,t){return Math.round((t.getTime()-e.getTime())/864e5)}let p={planned:{bg:"bg-slate-200",fill:"bg-slate-400"},active:{bg:"bg-blue-100",fill:"bg-blue-500"},completed:{bg:"bg-emerald-100",fill:"bg-emerald-500"},paused:{bg:"bg-amber-100",fill:"bg-amber-500"}};function g(e){let{epic:t,progress:s,dates:r,rangeStart:l,totalDays:n}=e,o=m(r.start),c=m(r.end),x=b(l,o),u=Math.max(1,b(o,c)),g=Math.max(0,x/n*100),h=p[t.status],f=null!==t.target_start||null!==t.target_end;return(0,a.jsx)(d.default,{href:"/roadmap/".concat(t.id),className:"group",children:(0,a.jsxs)("div",{className:"flex items-center h-10 relative",children:[(0,a.jsx)("div",{className:"w-48 flex-shrink-0 pr-3 text-right",children:(0,a.jsx)("span",{className:"text-xs font-medium text-slate-700 truncate block group-hover:text-blue-600",children:t.title})}),(0,a.jsx)("div",{className:"flex-1 relative h-7",children:(0,a.jsxs)("div",{className:(0,i.Z)("absolute top-0 h-full rounded transition-colors",h.bg,"group-hover:ring-2 group-hover:ring-blue-300"),style:{left:"".concat(g,"%"),width:"".concat(Math.max(Math.min(100-g,u/n*100),1),"%")},children:[s.progress_pct>0&&(0,a.jsx)("div",{className:(0,i.Z)("absolute left-0 top-0 h-full rounded",h.fill),style:{width:"".concat(s.progress_pct,"%")}}),(0,a.jsxs)("div",{className:"absolute inset-0 flex items-center justify-between px-2 text-[10px] leading-none z-10",children:[(0,a.jsxs)("span",{className:"font-medium text-slate-700 truncate",children:[s.shipped_count,"/",s.total_ideas]}),f&&(0,a.jsx)("span",{className:"text-slate-400",title:"Manual dates",children:"M"})]})]})})]})})}function h(e){let{goalGroups:t,progressMap:s,dateEstimates:r}=e,l=[];for(let e of Object.values(r))l.push(m(e.start)),l.push(m(e.end));if(0===l.length)return(0,a.jsx)("div",{className:"bg-white rounded-lg border border-slate-200 p-12 text-center",children:(0,a.jsx)("p",{className:"text-slate-500",children:"No date estimates available for Gantt view."})});let n=new Date(Math.min(...l.map(e=>e.getTime()))),i=new Date(Math.max(...l.map(e=>e.getTime()))),d=function(e){let t=new Date(e),s=t.getDay();return t.setDate(t.getDate()+(0===s?-6:1-s)),t}(new Date(n.getTime()-6048e5)),o=new Date(i.getTime()+6048e5),c=Math.max(1,b(d,o)),x=[],u=new Date(d);for(;u<=o;)x.push(new Date(u)),u.setDate(u.getDate()+7);let p=new Date;p.setHours(0,0,0,0);let h=b(d,p)/c*100,f=h>=0&&h<=100,v={total_ideas:0,by_stage:{},shipped_count:0,progress_pct:0,effort_total:0,effort_completed:0};return(0,a.jsx)("div",{className:"bg-white rounded-lg border border-slate-200 overflow-x-auto",children:(0,a.jsxs)("div",{className:"min-w-[700px]",children:[(0,a.jsxs)("div",{className:"flex items-center border-b border-slate-100 sticky top-0 bg-white z-20",children:[(0,a.jsx)("div",{className:"w-48 flex-shrink-0 px-4 py-2",children:(0,a.jsx)("span",{className:"text-xs font-medium text-slate-400 uppercase",children:"Epic"})}),(0,a.jsx)("div",{className:"flex-1 relative h-8 flex",children:x.map((e,t)=>{let s=b(d,e)/c*100;return(0,a.jsx)("div",{className:"absolute top-0 h-full border-l border-slate-100 px-1 flex items-center",style:{left:"".concat(s,"%")},children:(0,a.jsx)("span",{className:"text-[10px] text-slate-400 whitespace-nowrap",children:e.toLocaleDateString("en-US",{month:"short",day:"numeric"})})},t)})})]}),t.map(e=>{var t;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center border-b border-slate-100 bg-slate-50",children:(0,a.jsx)("div",{className:"px-4 py-2",children:(0,a.jsx)("span",{className:"text-xs font-semibold text-slate-600",children:e.goalId?"Goal: ".concat(e.goalTitle):e.goalTitle})})}),(0,a.jsxs)("div",{className:"relative",children:[x.map((e,t)=>{let s=b(d,e)/c*100;return(0,a.jsx)("div",{className:"absolute top-0 bottom-0 border-l border-slate-50",style:{left:"calc(".concat(s,"% + 192px)")}},t)}),f&&(0,a.jsx)("div",{className:"absolute top-0 bottom-0 border-l-2 border-dashed border-red-400 z-10",style:{left:"calc(".concat(h,"% + 192px)")},title:"Today"}),e.epics.map(e=>{let t=r[e.id];return t?(0,a.jsx)(g,{epic:e,progress:s[e.id]||v,dates:t,rangeStart:d,totalDays:c},e.id):null})]})]},null!==(t=e.goalId)&&void 0!==t?t:"orphan")}),(0,a.jsxs)("div",{className:"flex items-center gap-4 px-4 py-3 border-t border-slate-100 text-[10px] text-slate-500",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-3 h-2 bg-slate-200 rounded inline-block"})," Planned"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-3 h-2 bg-blue-100 rounded inline-block"})," Active"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-3 h-2 bg-emerald-100 rounded inline-block"})," Completed"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-3 h-2 bg-amber-100 rounded inline-block"})," Paused"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1 ml-2",children:[(0,a.jsx)("span",{className:"border-l-2 border-dashed border-red-400 h-3 inline-block"})," Today"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1 ml-2",children:[(0,a.jsx)("span",{className:"text-slate-400 font-medium",children:"M"})," = Manual dates"]})]})]})})}function f(e){let{goalGroups:t,progressMap:s,dateEstimates:d}=e,[o,c]=(0,r.useState)("list");return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 mb-4 bg-slate-100 rounded-lg p-1 w-fit",children:[(0,a.jsxs)("button",{onClick:()=>c("list"),className:(0,i.Z)("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors","list"===o?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"),children:[(0,a.jsx)(l,{className:"w-4 h-4"}),"List"]}),(0,a.jsxs)("button",{onClick:()=>c("gantt"),className:(0,i.Z)("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors","gantt"===o?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"),children:[(0,a.jsx)(n.Z,{className:"w-4 h-4"}),"Gantt"]})]}),"list"===o?(0,a.jsx)(u,{goalGroups:t,progressMap:s}):(0,a.jsx)(h,{goalGroups:t,progressMap:s,dateEstimates:d})]})}},6153:function(e,t,s){"use strict";s.d(t,{G:function(){return i},GK:function(){return k},Gs:function(){return c},Hs:function(){return a},PN:function(){return b},PW:function(){return w},Q_:function(){return p},R$:function(){return N},Vr:function(){return x},Wb:function(){return m},aR:function(){return u},bi:function(){return d},en:function(){return j},i2:function(){return v},kT:function(){return g},l5:function(){return h},lE:function(){return y},lv:function(){return n},pG:function(){return r},rF:function(){return o},tV:function(){return f},tl:function(){return _},xP:function(){return M},yb:function(){return l}});let a={product:"Product",ux_design:"UX/Design",growth:"Growth",performance:"Performance",tech_debt:"Tech Debt",security:"Security",infrastructure:"Infrastructure",content:"Content",analytics:"Analytics",integration:"Integration"},r={product:"bg-blue-100 text-blue-800",ux_design:"bg-purple-100 text-purple-800",growth:"bg-green-100 text-green-800",performance:"bg-orange-100 text-orange-800",tech_debt:"bg-yellow-100 text-yellow-800",security:"bg-red-100 text-red-800",infrastructure:"bg-gray-100 text-gray-800",content:"bg-pink-100 text-pink-800",analytics:"bg-cyan-100 text-cyan-800",integration:"bg-indigo-100 text-indigo-800"},l={inbox:"Inbox",under_review:"Under Review",approved:"Approved",in_progress:"In Progress",testing:"Testing",shipped:"Shipped",deferred:"Deferred",rejected:"Rejected",rolled_back:"Rolled Back"},n={inbox:"bg-amber-500",under_review:"bg-blue-500",approved:"bg-emerald-500",in_progress:"bg-violet-500",testing:"bg-cyan-500",shipped:"bg-green-500",deferred:"bg-gray-500",rejected:"bg-red-500",rolled_back:"bg-orange-500"},i=["inbox","under_review","approved","in_progress","testing","shipped"],d={xs:"XS",s:"S",m:"M",l:"L",xl:"XL"},o={critical:"Critical",high:"High",medium:"Medium",low:"Low"},c={critical:"bg-red-100 text-red-800 border-red-300",high:"bg-orange-100 text-orange-800 border-orange-300",medium:"bg-yellow-100 text-yellow-800 border-yellow-300",low:"bg-gray-100 text-gray-800 border-gray-300"},x={codebase_analysis:"Codebase Analysis",metrics_review:"Metrics Review",market_research:"Market Research",seo_audit:"SEO Audit",manual:"Manual"},u={pending:"bg-slate-100 text-slate-700",validated:"bg-emerald-100 text-emerald-800",needs_investigation:"bg-amber-100 text-amber-800",inconclusive:"bg-slate-100 text-slate-600",invalidated:"bg-red-100 text-red-800"},m={pending:"Pending",validated:"Validated",needs_investigation:"Needs Investigation",inconclusive:"Inconclusive",invalidated:"Invalidated"},b={ship:"Ship",update:"Update",milestone:"Milestone",digest:"Digest",manual:"Manual"},p={ship:"bg-green-100 text-green-800",update:"bg-blue-100 text-blue-800",milestone:"bg-amber-100 text-amber-800",digest:"bg-purple-100 text-purple-800",manual:"bg-slate-100 text-slate-800"},g={acquisition:"Acquisition",activation:"Activation",retention:"Retention",revenue:"Revenue",referral:"Referral"},h={acquisition:"bg-blue-100 text-blue-800",activation:"bg-emerald-100 text-emerald-800",retention:"bg-purple-100 text-purple-800",revenue:"bg-amber-100 text-amber-800",referral:"bg-pink-100 text-pink-800"},f={on_track:"On Track",at_risk:"At Risk",behind:"Behind",achieved:"Achieved"},v={on_track:"bg-emerald-100 text-emerald-800 border-emerald-300",at_risk:"bg-amber-100 text-amber-800 border-amber-300",behind:"bg-red-100 text-red-800 border-red-300",achieved:"bg-blue-100 text-blue-800 border-blue-300"},j={manual:"Manual",rest_api:"REST API",posthog:"PostHog",firestore:"Firestore",stripe:"Stripe",whatsapp:"WhatsApp"},N={stated:"Stated",testing:"Testing",validated:"Validated",invalidated:"Invalidated",deferred:"Deferred"},y={stated:"bg-slate-100 text-slate-800 border-slate-300",testing:"bg-amber-100 text-amber-800 border-amber-300",validated:"bg-emerald-100 text-emerald-800 border-emerald-300",invalidated:"bg-red-100 text-red-800 border-red-300",deferred:"bg-slate-100 text-slate-500 border-slate-200"},w={acquisition:"Acquisition",engagement:"Engagement",conversion:"Conversion",monetization:"Monetization"},_={acquisition:"bg-blue-100 text-blue-800",engagement:"bg-purple-100 text-purple-800",conversion:"bg-amber-100 text-amber-800",monetization:"bg-emerald-100 text-emerald-800"},k={planned:"Planned",active:"Active",completed:"Completed",paused:"Paused"},M={planned:"bg-slate-100 text-slate-700 border-slate-300",active:"bg-blue-100 text-blue-800 border-blue-300",completed:"bg-emerald-100 text-emerald-800 border-emerald-300",paused:"bg-amber-100 text-amber-800 border-amber-300"}}},function(e){e.O(0,[746,971,117,744],function(){return e(e.s=7670)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[943],{7670:function(e,t,s){Promise.resolve().then(s.bind(s,1259)),Promise.resolve().then(s.bind(s,3032))},6221:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(9205).Z)("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},1259:function(e,t,s){"use strict";s.d(t,{default:function(){return f}});var a=s(7437),r=s(7648),n=s(9376),l=s(5466),i=s(2048),d=s(8896),o=s(8220),c=s(2718),x=s(5621),u=s(8728),m=s(2222),b=s(2023),p=s(1994),g=s(257);let h=[{href:"/",label:"Dashboard",icon:(0,a.jsx)(l.Z,{className:"w-5 h-5"})},{href:"/roadmap",label:"Roadmap",icon:(0,a.jsx)(i.Z,{className:"w-5 h-5"})},{href:"/goals",label:"Goals",icon:(0,a.jsx)(d.Z,{className:"w-5 h-5"})},{href:"/hypotheses",label:"Hypotheses",icon:(0,a.jsx)(o.Z,{className:"w-5 h-5"})},{href:"/social",label:"Social",icon:(0,a.jsx)(c.Z,{className:"w-5 h-5"})},{href:"/sessions",label:"Sessions",icon:(0,a.jsx)(x.Z,{className:"w-5 h-5"})},{href:"/settings",label:"Settings",icon:(0,a.jsx)(u.Z,{className:"w-5 h-5"})}];function f(e){let{children:t}=e,s=(0,n.usePathname)();return(0,a.jsxs)("div",{className:"min-h-screen flex",children:[(0,a.jsxs)("aside",{className:"w-64 bg-slate-900 text-white flex flex-col",children:[(0,a.jsx)("div",{className:"p-4 border-b border-slate-700",children:(0,a.jsxs)(r.default,{href:"/",className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-emerald-500 rounded-lg flex items-center justify-center",children:(0,a.jsx)(m.Z,{className:"w-6 h-6 text-white"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"font-bold text-lg leading-tight",children:"Analyst"}),(0,a.jsx)("p",{className:"text-xs text-slate-400",children:g.env.NEXT_PUBLIC_PRODUCT_NAME||"Business"})]})]})}),(0,a.jsx)("nav",{className:"flex-1 p-4",children:(0,a.jsx)("ul",{className:"space-y-1",children:h.map(e=>{let t="/"===e.href?"/"===s:s.startsWith(e.href);return(0,a.jsx)("li",{children:(0,a.jsxs)(r.default,{href:e.href,className:(0,p.Z)("flex items-center gap-3 px-3 py-2 rounded-lg transition-colors",t?"bg-slate-800 text-white":"text-slate-400 hover:text-white hover:bg-slate-800"),children:[e.icon,(0,a.jsx)("span",{children:e.label})]})},e.href)})})}),(0,a.jsx)("div",{className:"p-4 border-t border-slate-700",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,a.jsx)(b.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Powered by Claude"})]})})]}),(0,a.jsx)("main",{className:"flex-1 overflow-auto",children:t})]})}},3032:function(e,t,s){"use strict";s.d(t,{default:function(){return f}});var a=s(7437),r=s(2265);let n=(0,s(9205).Z)("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);var l=s(6221),i=s(1994),d=s(7648),o=s(6153);function c(e){let{progress:t,status:s}=e,r=Math.round(t.progress_pct/100*8),n="█".repeat(r)+"░".repeat(8-r);return(0,a.jsx)("span",{className:(0,i.Z)("font-mono text-xs tracking-tight","completed"===s?"text-emerald-500":"active"===s?"text-blue-500":"text-slate-400"),children:n})}function x(e){let{epic:t,index:s,progress:r}=e,n=t.tags.includes("needs-review");return(0,a.jsx)(d.default,{href:"/roadmap/".concat(t.id),children:(0,a.jsxs)("div",{className:(0,i.Z)("flex items-center gap-4 px-4 py-3 hover:bg-slate-50 transition-colors rounded-lg group",n&&"border border-dashed border-slate-300"),children:[(0,a.jsxs)("span",{className:"text-sm font-bold text-slate-400 w-8 text-right flex-shrink-0",children:["#",s]}),(0,a.jsxs)("span",{className:"text-sm font-medium text-slate-900 flex-1 min-w-0 truncate group-hover:text-blue-600",children:[t.title,n&&(0,a.jsx)("span",{className:"ml-2 text-xs text-slate-400 font-normal italic",children:"draft"})]}),(0,a.jsx)(c,{progress:r,status:t.status}),(0,a.jsxs)("span",{className:"text-xs text-slate-500 w-12 text-center flex-shrink-0",children:[r.shipped_count,"/",r.total_ideas]}),(0,a.jsx)("span",{className:(0,i.Z)("text-xs px-2 py-0.5 rounded-full border flex-shrink-0 w-20 text-center",o.xP[t.status]),children:o.GK[t.status]}),(0,a.jsx)("span",{className:(0,i.Z)("text-xs px-2 py-0.5 rounded-full flex-shrink-0 hidden sm:inline-block",o.pG[t.category]),children:o.Hs[t.category]})]})})}function u(e){let{goalGroups:t,progressMap:s}=e;if(0===t.length)return(0,a.jsx)("div",{className:"bg-white rounded-lg border border-slate-200 p-12 text-center",children:(0,a.jsx)("p",{className:"text-slate-500",children:"No epics to display."})});let r={total_ideas:0,by_stage:{},shipped_count:0,progress_pct:0,effort_total:0,effort_completed:0},n=0;return(0,a.jsx)("div",{className:"space-y-6",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-slate-100",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-slate-700",children:e.goalId?"Goal: ".concat(e.goalTitle):e.goalTitle}),(0,a.jsxs)("span",{className:"text-xs text-slate-400",children:[e.epics.length," epic",1!==e.epics.length?"s":""," \xb7 ",e.totalIdeas," idea",1!==e.totalIdeas?"s":""]})]}),(0,a.jsx)("div",{className:"divide-y divide-slate-50",children:e.epics.map(e=>(n++,(0,a.jsx)(x,{epic:e,index:n,progress:s[e.id]||r},e.id)))})]},null!==(t=e.goalId)&&void 0!==t?t:"orphan")})})}function m(e){return new Date(e+"T00:00:00")}function b(e,t){return Math.round((t.getTime()-e.getTime())/864e5)}let p={planned:{bg:"bg-slate-200",fill:"bg-slate-400"},active:{bg:"bg-blue-100",fill:"bg-blue-500"},completed:{bg:"bg-emerald-100",fill:"bg-emerald-500"},paused:{bg:"bg-amber-100",fill:"bg-amber-500"}};function g(e){let{epic:t,progress:s,dates:r,rangeStart:n,totalDays:l}=e,o=m(r.start),c=m(r.end),x=b(n,o),u=Math.max(1,b(o,c)),g=Math.max(0,x/l*100),h=p[t.status],f=null!==t.target_start||null!==t.target_end;return(0,a.jsx)(d.default,{href:"/roadmap/".concat(t.id),className:"group",children:(0,a.jsxs)("div",{className:"flex items-center h-10 relative",children:[(0,a.jsx)("div",{className:"w-48 flex-shrink-0 pr-3 text-right",children:(0,a.jsx)("span",{className:"text-xs font-medium text-slate-700 truncate block group-hover:text-blue-600",children:t.title})}),(0,a.jsx)("div",{className:"flex-1 relative h-7",children:(0,a.jsxs)("div",{className:(0,i.Z)("absolute top-0 h-full rounded transition-colors",h.bg,"group-hover:ring-2 group-hover:ring-blue-300"),style:{left:"".concat(g,"%"),width:"".concat(Math.max(Math.min(100-g,u/l*100),1),"%")},children:[s.progress_pct>0&&(0,a.jsx)("div",{className:(0,i.Z)("absolute left-0 top-0 h-full rounded",h.fill),style:{width:"".concat(s.progress_pct,"%")}}),(0,a.jsxs)("div",{className:"absolute inset-0 flex items-center justify-between px-2 text-[10px] leading-none z-10",children:[(0,a.jsxs)("span",{className:"font-medium text-slate-700 truncate",children:[s.shipped_count,"/",s.total_ideas]}),f&&(0,a.jsx)("span",{className:"text-slate-400",title:"Manual dates",children:"M"})]})]})})]})})}function h(e){let{goalGroups:t,progressMap:s,dateEstimates:r}=e,n=[];for(let e of Object.values(r))n.push(m(e.start)),n.push(m(e.end));if(0===n.length)return(0,a.jsx)("div",{className:"bg-white rounded-lg border border-slate-200 p-12 text-center",children:(0,a.jsx)("p",{className:"text-slate-500",children:"No date estimates available for Gantt view."})});let l=new Date(Math.min(...n.map(e=>e.getTime()))),i=new Date(Math.max(...n.map(e=>e.getTime()))),d=function(e){let t=new Date(e),s=t.getDay();return t.setDate(t.getDate()+(0===s?-6:1-s)),t}(new Date(l.getTime()-6048e5)),o=new Date(i.getTime()+6048e5),c=Math.max(1,b(d,o)),x=[],u=new Date(d);for(;u<=o;)x.push(new Date(u)),u.setDate(u.getDate()+7);let p=new Date;p.setHours(0,0,0,0);let h=b(d,p)/c*100,f=h>=0&&h<=100,v={total_ideas:0,by_stage:{},shipped_count:0,progress_pct:0,effort_total:0,effort_completed:0};return(0,a.jsx)("div",{className:"bg-white rounded-lg border border-slate-200 overflow-x-auto",children:(0,a.jsxs)("div",{className:"min-w-[700px]",children:[(0,a.jsxs)("div",{className:"flex items-center border-b border-slate-100 sticky top-0 bg-white z-20",children:[(0,a.jsx)("div",{className:"w-48 flex-shrink-0 px-4 py-2",children:(0,a.jsx)("span",{className:"text-xs font-medium text-slate-400 uppercase",children:"Epic"})}),(0,a.jsx)("div",{className:"flex-1 relative h-8 flex",children:x.map((e,t)=>{let s=b(d,e)/c*100;return(0,a.jsx)("div",{className:"absolute top-0 h-full border-l border-slate-100 px-1 flex items-center",style:{left:"".concat(s,"%")},children:(0,a.jsx)("span",{className:"text-[10px] text-slate-400 whitespace-nowrap",children:e.toLocaleDateString("en-US",{month:"short",day:"numeric"})})},t)})})]}),t.map(e=>{var t;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center border-b border-slate-100 bg-slate-50",children:(0,a.jsx)("div",{className:"px-4 py-2",children:(0,a.jsx)("span",{className:"text-xs font-semibold text-slate-600",children:e.goalId?"Goal: ".concat(e.goalTitle):e.goalTitle})})}),(0,a.jsxs)("div",{className:"relative",children:[x.map((e,t)=>{let s=b(d,e)/c*100;return(0,a.jsx)("div",{className:"absolute top-0 bottom-0 border-l border-slate-50",style:{left:"calc(".concat(s,"% + 192px)")}},t)}),f&&(0,a.jsx)("div",{className:"absolute top-0 bottom-0 border-l-2 border-dashed border-red-400 z-10",style:{left:"calc(".concat(h,"% + 192px)")},title:"Today"}),e.epics.map(e=>{let t=r[e.id];return t?(0,a.jsx)(g,{epic:e,progress:s[e.id]||v,dates:t,rangeStart:d,totalDays:c},e.id):null})]})]},null!==(t=e.goalId)&&void 0!==t?t:"orphan")}),(0,a.jsxs)("div",{className:"flex items-center gap-4 px-4 py-3 border-t border-slate-100 text-[10px] text-slate-500",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-3 h-2 bg-slate-200 rounded inline-block"})," Planned"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-3 h-2 bg-blue-100 rounded inline-block"})," Active"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-3 h-2 bg-emerald-100 rounded inline-block"})," Completed"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-3 h-2 bg-amber-100 rounded inline-block"})," Paused"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1 ml-2",children:[(0,a.jsx)("span",{className:"border-l-2 border-dashed border-red-400 h-3 inline-block"})," Today"]}),(0,a.jsxs)("span",{className:"flex items-center gap-1 ml-2",children:[(0,a.jsx)("span",{className:"text-slate-400 font-medium",children:"M"})," = Manual dates"]})]})]})})}function f(e){let{goalGroups:t,progressMap:s,dateEstimates:d}=e,[o,c]=(0,r.useState)("list");return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 mb-4 bg-slate-100 rounded-lg p-1 w-fit",children:[(0,a.jsxs)("button",{onClick:()=>c("list"),className:(0,i.Z)("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors","list"===o?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"),children:[(0,a.jsx)(n,{className:"w-4 h-4"}),"List"]}),(0,a.jsxs)("button",{onClick:()=>c("gantt"),className:(0,i.Z)("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors","gantt"===o?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"),children:[(0,a.jsx)(l.Z,{className:"w-4 h-4"}),"Gantt"]})]}),"list"===o?(0,a.jsx)(u,{goalGroups:t,progressMap:s}):(0,a.jsx)(h,{goalGroups:t,progressMap:s,dateEstimates:d})]})}},6153:function(e,t,s){"use strict";s.d(t,{G:function(){return i},GK:function(){return k},Gs:function(){return c},Hs:function(){return a},PN:function(){return b},PW:function(){return w},Q_:function(){return p},R$:function(){return N},Vr:function(){return x},Wb:function(){return m},aR:function(){return u},bi:function(){return d},en:function(){return j},i2:function(){return v},kT:function(){return g},l5:function(){return h},lE:function(){return y},lv:function(){return l},pG:function(){return r},rF:function(){return o},tV:function(){return f},tl:function(){return _},xP:function(){return M},yb:function(){return n}});let a={product:"Product",ux_design:"UX/Design",growth:"Growth",performance:"Performance",tech_debt:"Tech Debt",security:"Security",infrastructure:"Infrastructure",content:"Content",analytics:"Analytics",integration:"Integration"},r={product:"bg-blue-100 text-blue-800",ux_design:"bg-purple-100 text-purple-800",growth:"bg-green-100 text-green-800",performance:"bg-orange-100 text-orange-800",tech_debt:"bg-yellow-100 text-yellow-800",security:"bg-red-100 text-red-800",infrastructure:"bg-gray-100 text-gray-800",content:"bg-pink-100 text-pink-800",analytics:"bg-cyan-100 text-cyan-800",integration:"bg-indigo-100 text-indigo-800"},n={inbox:"Inbox",under_review:"Under Review",approved:"Approved",in_progress:"In Progress",testing:"Testing",shipped:"Shipped",deferred:"Deferred",rejected:"Rejected",rolled_back:"Rolled Back"},l={inbox:"bg-amber-500",under_review:"bg-blue-500",approved:"bg-emerald-500",in_progress:"bg-violet-500",testing:"bg-cyan-500",shipped:"bg-green-500",deferred:"bg-gray-500",rejected:"bg-red-500",rolled_back:"bg-orange-500"},i=["inbox","under_review","approved","in_progress","testing","shipped"],d={xs:"XS",s:"S",m:"M",l:"L",xl:"XL"},o={critical:"Critical",high:"High",medium:"Medium",low:"Low"},c={critical:"bg-red-100 text-red-800 border-red-300",high:"bg-orange-100 text-orange-800 border-orange-300",medium:"bg-yellow-100 text-yellow-800 border-yellow-300",low:"bg-gray-100 text-gray-800 border-gray-300"},x={codebase_analysis:"Codebase Analysis",metrics_review:"Metrics Review",market_research:"Market Research",seo_audit:"SEO Audit",manual:"Manual"},u={pending:"bg-slate-100 text-slate-700",validated:"bg-emerald-100 text-emerald-800",needs_investigation:"bg-amber-100 text-amber-800",inconclusive:"bg-slate-100 text-slate-600",invalidated:"bg-red-100 text-red-800"},m={pending:"Pending",validated:"Validated",needs_investigation:"Needs Investigation",inconclusive:"Inconclusive",invalidated:"Invalidated"},b={ship:"Ship",update:"Update",milestone:"Milestone",digest:"Digest",manual:"Manual",thread:"Thread",insight:"Insight"},p={ship:"bg-green-100 text-green-800",update:"bg-blue-100 text-blue-800",milestone:"bg-amber-100 text-amber-800",digest:"bg-purple-100 text-purple-800",manual:"bg-slate-100 text-slate-800",thread:"bg-indigo-100 text-indigo-800",insight:"bg-cyan-100 text-cyan-800"},g={acquisition:"Acquisition",activation:"Activation",retention:"Retention",revenue:"Revenue",referral:"Referral"},h={acquisition:"bg-blue-100 text-blue-800",activation:"bg-emerald-100 text-emerald-800",retention:"bg-purple-100 text-purple-800",revenue:"bg-amber-100 text-amber-800",referral:"bg-pink-100 text-pink-800"},f={on_track:"On Track",at_risk:"At Risk",behind:"Behind",achieved:"Achieved"},v={on_track:"bg-emerald-100 text-emerald-800 border-emerald-300",at_risk:"bg-amber-100 text-amber-800 border-amber-300",behind:"bg-red-100 text-red-800 border-red-300",achieved:"bg-blue-100 text-blue-800 border-blue-300"},j={manual:"Manual",rest_api:"REST API",posthog:"PostHog",firestore:"Firestore",stripe:"Stripe",whatsapp:"WhatsApp"},N={stated:"Stated",testing:"Testing",validated:"Validated",invalidated:"Invalidated",deferred:"Deferred"},y={stated:"bg-slate-100 text-slate-800 border-slate-300",testing:"bg-amber-100 text-amber-800 border-amber-300",validated:"bg-emerald-100 text-emerald-800 border-emerald-300",invalidated:"bg-red-100 text-red-800 border-red-300",deferred:"bg-slate-100 text-slate-500 border-slate-200"},w={acquisition:"Acquisition",engagement:"Engagement",conversion:"Conversion",monetization:"Monetization"},_={acquisition:"bg-blue-100 text-blue-800",engagement:"bg-purple-100 text-purple-800",conversion:"bg-amber-100 text-amber-800",monetization:"bg-emerald-100 text-emerald-800"},k={planned:"Planned",active:"Active",completed:"Completed",paused:"Paused"},M={planned:"bg-slate-100 text-slate-700 border-slate-300",active:"bg-blue-100 text-blue-800 border-blue-300",completed:"bg-emerald-100 text-emerald-800 border-emerald-300",paused:"bg-amber-100 text-amber-800 border-amber-300"}}},function(e){e.O(0,[746,971,117,744],function(){return e(e.s=7670)}),_N_E=e.O()}]);