vibebusiness 1.2.39 → 1.2.41
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.
- package/.next/standalone/.env +7 -0
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-build-manifest.json +68 -60
- package/.next/standalone/.next/app-path-routes-manifest.json +1 -1
- package/.next/standalone/.next/build-manifest.json +6 -6
- package/.next/standalone/.next/prerender-manifest.json +1 -1
- package/.next/standalone/.next/routes-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/.next/server/app/api/analyze/route.js +1 -1
- package/.next/standalone/.next/server/app/api/analyze/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/checkout/route.js +1 -0
- package/.next/standalone/.next/server/app/api/checkout/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/config/detect-repos/route.js +1 -1
- package/.next/standalone/.next/server/app/api/config/detect-repos/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/config/route.js +1 -1
- package/.next/standalone/.next/server/app/api/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/epics/[id]/ideas/route.js +1 -1
- package/.next/standalone/.next/server/app/api/epics/[id]/ideas/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/epics/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/epics/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/epics/route.js +1 -1
- package/.next/standalone/.next/server/app/api/epics/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/goals/[id]/kpis/route.js +1 -1
- package/.next/standalone/.next/server/app/api/goals/[id]/kpis/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/goals/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/goals/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/goals/route.js +1 -1
- package/.next/standalone/.next/server/app/api/goals/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/health/route.js +1 -1
- package/.next/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/hypotheses/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/hypotheses/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/hypotheses/route.js +1 -1
- package/.next/standalone/.next/server/app/api/hypotheses/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[id]/comments/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[id]/comments/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[id]/implement/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[id]/implement/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[id]/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[id]/transition/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[id]/transition/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/ideas/route.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/implementations/route.js +1 -1
- package/.next/standalone/.next/server/app/api/implementations/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/kpis/refresh/route.js +1 -1
- package/.next/standalone/.next/server/app/api/kpis/refresh/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/license/route.js +1 -0
- package/.next/standalone/.next/server/app/api/license/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/portal/route.js +1 -0
- package/.next/standalone/.next/server/app/api/portal/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/social/[id]/publish/route.js +1 -0
- package/.next/standalone/.next/server/app/api/social/[id]/publish/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/social/[id]/route.js +1 -0
- package/.next/standalone/.next/server/app/api/social/[id]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/social/route.js +1 -0
- package/.next/standalone/.next/server/app/api/social/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/webhook/route.js +1 -0
- package/.next/standalone/.next/server/app/api/webhook/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/goals/[id]/page.js +1 -1
- package/.next/standalone/.next/server/app/goals/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/goals/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/goals/page.js +1 -1
- package/.next/standalone/.next/server/app/goals/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/goals/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/hypotheses/[id]/page.js +1 -1
- package/.next/standalone/.next/server/app/hypotheses/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/hypotheses/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/hypotheses/page.js +1 -1
- package/.next/standalone/.next/server/app/hypotheses/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/hypotheses/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/ideas/[id]/page.js +1 -1
- package/.next/standalone/.next/server/app/ideas/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/ideas/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/landing/page.js +1 -1
- package/.next/standalone/.next/server/app/landing/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/landing/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/landing.html +1 -1
- package/.next/standalone/.next/server/app/landing.rsc +1 -1
- package/.next/standalone/.next/server/app/page.js +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/roadmap/[id]/page.js +1 -1
- package/.next/standalone/.next/server/app/roadmap/[id]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/roadmap/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/roadmap/page.js +1 -1
- package/.next/standalone/.next/server/app/roadmap/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/roadmap/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/sessions/page.js +1 -1
- package/.next/standalone/.next/server/app/sessions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page.js +1 -1
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +2 -2
- package/.next/standalone/.next/server/app/social/page.js +1 -0
- package/.next/standalone/.next/server/app/social/page.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/social/page_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/social.html +1 -0
- package/.next/standalone/.next/server/app/social.meta +5 -0
- package/.next/standalone/.next/server/app/social.rsc +7 -0
- package/.next/standalone/.next/server/app-paths-manifest.json +15 -7
- package/.next/standalone/.next/server/chunks/{682.js → 1682.js} +1 -1
- package/.next/standalone/.next/server/chunks/3644.js +1 -0
- package/.next/standalone/.next/server/chunks/4376.js +1 -0
- package/.next/standalone/.next/server/chunks/4471.js +2 -0
- package/.next/standalone/.next/server/chunks/534.js +1 -0
- package/.next/standalone/.next/server/chunks/5972.js +12 -0
- package/.next/standalone/.next/server/chunks/7809.js +2 -0
- package/.next/standalone/.next/server/chunks/9276.js +2 -0
- package/.next/standalone/.next/server/chunks/9777.js +1 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/pages/_app.js +1 -1
- package/.next/standalone/.next/server/pages/_document.js +1 -1
- package/.next/standalone/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/standalone/.next/server/pages/_error.js +1 -1
- package/.next/standalone/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/webpack-runtime.js +1 -1
- package/.next/standalone/data/email-campaigns/welcome-2026-02-20.md +13 -32
- package/.next/standalone/data/payments.json +33 -0
- package/.next/standalone/data/social.json +13 -0
- package/.next/standalone/package.json +5 -1
- package/.next/standalone/scripts/skills/social-media.ts +456 -0
- package/.next/static/chunks/444-125b7b0fa8cbdb81.js +1 -0
- package/.next/static/chunks/746-ea7c3e4e69c14385.js +1 -0
- package/.next/static/chunks/app/goals/[id]/{page-91b8382d44e93925.js → page-8dbeab5cc8cf0988.js} +1 -1
- package/.next/static/chunks/app/goals/{page-ecaa4a2761757014.js → page-794526d1e1a0856a.js} +1 -1
- package/.next/static/chunks/app/hypotheses/[id]/{page-894b08de47a73af9.js → page-65032da79ae146c5.js} +1 -1
- package/.next/static/chunks/app/hypotheses/page-8314da4be7c533bd.js +1 -0
- package/.next/static/chunks/app/ideas/[id]/page-dc9746061e58eea5.js +1 -0
- package/.next/static/chunks/app/layout-eeef7928298d2198.js +1 -0
- package/.next/static/chunks/app/page-fb66ff080390f20a.js +1 -0
- package/.next/static/chunks/app/roadmap/[id]/{page-3848fd96de497d11.js → page-c8c4baf233e0d480.js} +1 -1
- package/.next/static/chunks/app/roadmap/page-b15554a207ed2813.js +1 -0
- package/.next/static/chunks/app/sessions/page-42fb8edb15b9da1c.js +1 -0
- package/.next/static/chunks/app/settings/page-d2d630a799b6b495.js +1 -0
- package/.next/static/chunks/app/social/page-6c61fb0c2546313e.js +1 -0
- package/.next/static/chunks/{main-c0637f9544446589.js → main-98052d4291bccc96.js} +1 -1
- package/.next/static/css/02298496de89e16e.css +3 -0
- package/README.md +18 -0
- package/dist/bin/vibebusiness.js +307 -26
- package/dist/scripts/analyze.js +1 -0
- package/dist/scripts/chat.js +1 -0
- package/dist/scripts/generate-idea.js +1 -0
- package/dist/scripts/heartbeat.js +7343 -192
- package/dist/scripts/implement.js +1 -0
- package/dist/scripts/init.js +46 -6
- package/dist/scripts/scan.js +1 -0
- package/package.json +5 -1
- package/templates/commands/email-marketing.md +148 -10
- package/.next/standalone/.next/server/chunks/276.js +0 -2
- package/.next/standalone/.next/server/chunks/416.js +0 -1
- package/.next/standalone/.next/server/chunks/471.js +0 -2
- package/.next/standalone/.next/server/chunks/617.js +0 -1
- package/.next/standalone/.next/server/chunks/644.js +0 -1
- package/.next/standalone/.next/server/chunks/972.js +0 -12
- package/.next/static/chunks/444-6c0edb23956d018d.js +0 -1
- package/.next/static/chunks/783-3af6dbdb6afb55f4.js +0 -1
- package/.next/static/chunks/app/hypotheses/page-2cf90570526c76d3.js +0 -1
- package/.next/static/chunks/app/ideas/[id]/page-e0cca1557b59f7e0.js +0 -1
- package/.next/static/chunks/app/layout-ae8acf4955ee5472.js +0 -1
- package/.next/static/chunks/app/page-6a52a6950963129a.js +0 -1
- package/.next/static/chunks/app/roadmap/page-94d002cf0e37260f.js +0 -1
- package/.next/static/chunks/app/sessions/page-8085e6da5e28c7e4.js +0 -1
- package/.next/static/chunks/app/settings/page-34f70eef4a23eb4c.js +0 -1
- package/.next/static/css/501d0ac30341ebbe.css +0 -3
- /package/.next/static/{k40DKimnEdAtBs_zywSQ4 → VNI-b7vAR8FWLaaVytLYx}/_buildManifest.js +0 -0
- /package/.next/static/{k40DKimnEdAtBs_zywSQ4 → VNI-b7vAR8FWLaaVytLYx}/_ssgManifest.js +0 -0
- /package/.next/static/chunks/{117-b74c3899e29d85d7.js → 117-23260fd0b5f0bd9a.js} +0 -0
- /package/.next/static/chunks/app/_not-found/{page-2573b25f318b094f.js → page-a7be1c556b396c8e.js} +0 -0
- /package/.next/static/chunks/{fd9d1056-2182e078483b259b.js → fd9d1056-8c714984d5b17b60.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{var e={};e.id=
|
|
1
|
+
"use strict";(()=>{var e={};e.id=3201,e.ids=[3201],e.modules={399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},4770:e=>{e.exports=require("crypto")},2048:e=>{e.exports=require("fs")},5315:e=>{e.exports=require("path")},1142:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>P,patchFetch:()=>O,requestAsyncStorage:()=>S,routeModule:()=>j,serverHooks:()=>b,staticGenerationAsyncStorage:()=>x});var a={};r.r(a),r.d(a,{POST:()=>k});var s=r(9303),n=r(8716),i=r(670),o=r(7070),l=r(534);function u(e){let t;if(null===e.current_value||null===e.target_value)return"on_track";let r=e.current_value,a=e.target_value;return"lower_is_better"===e.direction?(t=0===a?0:r/a)<=1?"on_track":t<=1.5?"at_risk":"behind":(t=0===a?0:r/a)>=1?"on_track":t>=.7?"at_risk":"behind"}class c{constructor(e){this.type="rest_api",this.id=e.id;let t=e.config?.url_env||"BACKEND_URL";if(this.baseUrl=process.env[t]||process.env.NEXT_PUBLIC_API_URL||"http://localhost:8001",this.path=e.config?.path||"",this.headers={},e.config?.headers)for(let[t,r]of Object.entries(e.config.headers))this.headers[t]=this.interpolateEnvVars(r);this.fieldMapping=e.field_mapping||{},this.transforms=e.transforms||{}}interpolateEnvVars(e){return e.replace(/\$\{(\w+)\}/g,(e,t)=>process.env[t]||"")}async fetch(e,t){let r=new URLSearchParams;e&&r.set("start_date",e),t&&r.set("end_date",t);let a=r.toString(),s=`${this.baseUrl}${this.path}${a?`?${a}`:""}`,n=await fetch(s,{headers:{"Content-Type":"application/json",...this.headers}});if(!n.ok){let e=await n.text();throw Error(`REST API adapter "${this.id}" failed: ${n.status} ${e}`)}let i=await n.json(),o={};for(let[e,t]of Object.entries(this.fieldMapping)){let r=i[t];if(null==r){o[e]=null;continue}o[e]=this.applyTransform(e,r)}let l=new Set(Object.values(this.fieldMapping)),u={};for(let[e,t]of Object.entries(i))l.has(e)||(u[e]=t);return{values:o,metadata:u,fetched_at:new Date().toISOString()}}applyTransform(e,t){return"percentage"===this.transforms[e]?Math.round(1e3*t)/10:t}async healthCheck(){try{return(await fetch(`${this.baseUrl}/health`,{method:"GET"})).ok}catch{return!1}}}class p{constructor(e){this.type="manual",this.id=e.id}async fetch(){return{values:{},fetched_at:new Date().toISOString()}}async healthCheck(){return!0}}let h="https://app.loops.so/api/v1";function f(){return{Authorization:`Bearer ${function(){let e=process.env.LOOPS_API_KEY;if(!e)throw Error("LOOPS_API_KEY environment variable is not set");return e}()}`,"Content-Type":"application/json"}}async function d(){let e=await fetch(`${h}/api-key`,{method:"GET",headers:f()});return e.ok?{success:!0,teamName:(await e.json()).teamName}:{success:!1}}async function _(e){let t=new URLSearchParams;e?.limit&&t.set("limit",String(e.limit));let r=await fetch(`${h}/contacts?${t.toString()}`,{method:"GET",headers:f()});if(!r.ok)throw Error(`Loops API error: ${r.status} ${await r.text()}`);let a=await r.json();return{contacts:a,count:Array.isArray(a)?a.length:0}}async function g(){let e=await fetch(`${h}/lists`,{method:"GET",headers:f()});if(!e.ok)throw Error(`Loops API error: ${e.status} ${await e.text()}`);return e.json()}class m{constructor(e){this.type="loops",this.id=e.id,this.fieldMapping=e.field_mapping||{}}async fetch(){let e={},t={},r=Object.values(this.fieldMapping).some(e=>"total_contacts"===e),a=Object.values(this.fieldMapping).some(e=>e.startsWith("list:")),s=null,n=[];for(let[i,o]of(r&&(s=(await _({limit:1})).count,t.total_contacts=s),a&&(n=await g(),t.mailing_lists=n.map(e=>({id:e.id,name:e.name}))),Object.entries(this.fieldMapping)))"total_contacts"===o?e[i]=s:o.startsWith("list:")?e[i]=n.length:e[i]=null;return{values:e,metadata:t,fetched_at:new Date().toISOString()}}async healthCheck(){try{return(await d()).success}catch{return!1}}}async function w(e,t,r){let a={},s={};for(let n of e)try{let e=function(e){switch(e.type){case"rest_api":return new c(e);case"manual":return new p(e);case"loops":return new m(e);default:throw Error(`Unknown KPI adapter type: ${e.type}`)}}(n),i=await e.fetch(t,r);Object.assign(a,i.values),i.metadata&&(s[n.id]=i.metadata)}catch(e){console.error(`KPI adapter "${n.id}" failed:`,e)}return{values:a,metadata:s,fetched_at:new Date().toISOString()}}var v=r(2048),y=r(5315);async function k(e){try{let t;let{goal_id:r}=await e.json();if(!r)return o.NextResponse.json({success:!1,error:"goal_id is required"},{status:400});let a=await (0,l.a9)(r);if(!a)return o.NextResponse.json({success:!1,error:"Goal not found"},{status:404});let s=function(){let e=(0,l.uQ)(),t=y.join(e,"business-context.json");try{if(v.existsSync(t))return JSON.parse(v.readFileSync(t,"utf-8"))}catch{}return null}(),n=s?.kpi_adapters||[];if(0===n.length)return o.NextResponse.json({success:!1,error:"No KPI adapters configured in business-context.json"},{status:400});let i=a.kpis.filter(e=>"manual"!==e.source&&null!==function(e,t){for(let r of t)if(r.field_mapping&&e in r.field_mapping)return r;return null}(e.id,n));if(0===i.length)return o.NextResponse.json({success:!1,error:"No auto-refreshable KPIs found for this goal. Check adapter field_mapping."},{status:400});try{t=await w(n)}catch(e){return console.error("Failed to fetch KPIs from adapters:",e),o.NextResponse.json({success:!1,error:e instanceof Error?e.message:"Failed to fetch KPIs from adapters"},{status:502})}let c=0,p=new Date().toISOString().split("T")[0];for(let e of i){let a=t.values[e.id];null!=a&&(await (0,l.QV)(r,e.id,{value:a,date:p}),c++)}let h=await (0,l.a9)(r);if(h){let e=function(e){let t=e.kpis.filter(e=>null!==e.current_value&&null!==e.target_value);if(0===t.length)return e.status;let r=t.map(u),a=r.filter(e=>"behind"===e).length,s=r.filter(e=>"at_risk"===e).length;return(r.filter(e=>"on_track"===e).length,0===a&&0===s&&null!==e.current_value&&e.current_value>=e.target_value)?"achieved":a>0?"behind":s>0?"at_risk":"on_track"}(h);for(let t of(e!==h.status&&await (0,l.LB)(r,{status:e}),h.kpis))if(null!==t.current_value){await (0,l.LB)(r,{current_value:t.current_value});break}return o.NextResponse.json({success:!0,refreshed_at:new Date().toISOString(),kpis_updated:c,new_status:e,adapter_metadata:t.metadata})}return o.NextResponse.json({success:!0,refreshed_at:new Date().toISOString(),kpis_updated:c})}catch(e){return console.error("Error refreshing KPIs:",e),o.NextResponse.json({success:!1,error:e instanceof Error?e.message:"Internal server error"},{status:500})}}let j=new s.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/kpis/refresh/route",pathname:"/api/kpis/refresh",filename:"route",bundlePath:"app/api/kpis/refresh/route"},resolvedPagePath:"/Users/luismey/Code/vibebusiness/src/app/api/kpis/refresh/route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:S,staticGenerationAsyncStorage:x,serverHooks:b}=j,P="/api/kpis/refresh/route";function O(){return(0,i.patchFetch)({serverHooks:b,staticGenerationAsyncStorage:x})}}};var t=require("../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[9276,5972,534],()=>r(1142));module.exports=a})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../../../data/.analysis-prompt.txt","../../../../../../data/.gitkeep","../../../../../../data/business-context.json","../../../../../../data/codebase-snapshot.json","../../../../../../data/competitors.json","../../../../../../data/config.json","../../../../../../data/email-campaigns/sequences/onboarding.md","../../../../../../data/email-campaigns/welcome-2026-02-20.md","../../../../../../data/goals.json","../../../../../../data/heartbeat-sessions.json","../../../../../../data/hypotheses.json","../../../../../../data/ideas.json","../../../../../../data/implementations.json","../../../../../../data/pages.json","../../../../../../data/positioning.json","../../../../../../data/roadmap.json","../../../../../../data/sessions.json","../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/package.json","../../../../../../package.json","../../../../../package.json","../../../../chunks/
|
|
1
|
+
{"version":1,"files":["../../../../../../data/.DS_Store","../../../../../../data/.analysis-prompt.txt","../../../../../../data/.gitkeep","../../../../../../data/business-context.json","../../../../../../data/codebase-snapshot.json","../../../../../../data/competitors.json","../../../../../../data/config.json","../../../../../../data/email-campaigns/sequences/onboarding.md","../../../../../../data/email-campaigns/welcome-2026-02-20.md","../../../../../../data/goals.json","../../../../../../data/heartbeat-sessions.json","../../../../../../data/hypotheses.json","../../../../../../data/ideas.json","../../../../../../data/implementations.json","../../../../../../data/pages.json","../../../../../../data/payments.json","../../../../../../data/positioning.json","../../../../../../data/roadmap.json","../../../../../../data/sessions.json","../../../../../../data/social.json","../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/package.json","../../../../../../package.json","../../../../../package.json","../../../../chunks/534.js","../../../../chunks/5972.js","../../../../chunks/9276.js","../../../../webpack-runtime.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var e={};e.id=5661,e.ids=[5661],e.modules={399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},2048:e=>{e.exports=require("fs")},9801:e=>{e.exports=require("os")},5315:e=>{e.exports=require("path")},1302:(e,t,s)=>{s.r(t),s.d(t,{originalPathname:()=>b,patchFetch:()=>T,requestAsyncStorage:()=>S,routeModule:()=>A,serverHooks:()=>w,staticGenerationAsyncStorage:()=>V});var a={};s.r(a),s.d(a,{GET:()=>h,POST:()=>R,dynamic:()=>v});var i=s(9303),r=s(8716),n=s(670),l=s(7070),o=s(2048),u=s(5315);let d=u.join(process.env.HOME||"",".vibebusiness"),c=u.join(d,"license.json"),p={trial:{maxRepos:999},solo:{maxRepos:3},pro:{maxRepos:999},team:{maxRepos:999},enterprise:{maxRepos:999}};function m(e){o.existsSync(d)||o.mkdirSync(d,{recursive:!0}),o.writeFileSync(c,JSON.stringify(e,null,2))}function x(e){return e.length<=8?"****":e.slice(0,4)+"****"+e.slice(-4)}async function y(e){try{let t=new AbortController,s=setTimeout(()=>t.abort(),1e4),a=await fetch("https://vibebusiness.com/api/license/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e}),signal:t.signal});if(clearTimeout(s),!a.ok)return{valid:!1};return await a.json()}catch{return null}}async function f(e,t){let a,i;if(!e||0===e.trim().length)return{status:"invalid",tier:"trial",keyMasked:"",lastValidated:null,expiresAt:null,maxRepos:0,message:"License key cannot be empty."};let r=await y(e),n=t;if(null===r)a=g(e),i="valid";else{if(!r.valid)return{status:"invalid",tier:"trial",keyMasked:x(e),lastValidated:null,expiresAt:null,maxRepos:0,message:"Invalid license key. Please check your key and try again."};a=r.tier||g(e),i="valid",n=r.email||t}let l=new Date,o={key:e,tier:a,status:i,email:n,lastValidated:l.toISOString(),expiresAt:null,activatedAt:l.toISOString(),instanceId:function(){let e=s(9801),t=e.hostname(),a=e.userInfo().username;return`${a}@${t}`}()};return m(o),{status:"valid",tier:a,keyMasked:x(e),lastValidated:o.lastValidated,expiresAt:null,maxRepos:p[a].maxRepos,email:n,message:`License activated (${a} tier). Key: ${x(e)}${null===r?" (validated offline — will re-check when connected)":""}`}}function g(e){let t=e.toUpperCase();return t.startsWith("PRO-")?"pro":t.startsWith("TEAM-")?"team":t.startsWith("ENT-")||t.startsWith("ENTERPRISE-")?"enterprise":"solo"}async function k(){let e=function(){try{if(o.existsSync(c))return JSON.parse(o.readFileSync(c,"utf-8"))}catch{}return null}();if(!e)return{status:"unknown",tier:"trial",keyMasked:"",lastValidated:null,expiresAt:null,maxRepos:0,message:"No license found. Run `vibebusiness init` to start a trial or enter a license key."};let t=new Date;if("trial"===e.status||"trial"===e.tier){if(e.expiresAt&&new Date(e.expiresAt)<t)return{status:"expired",tier:"trial",keyMasked:"(trial)",lastValidated:e.lastValidated,expiresAt:e.expiresAt,maxRepos:0,message:"Trial expired. Enter a license key to continue using VibeBusiness."};let s=e.expiresAt?Math.ceil((new Date(e.expiresAt).getTime()-t.getTime())/864e5):0;return{status:"trial",tier:"trial",keyMasked:"(trial)",lastValidated:e.lastValidated,expiresAt:e.expiresAt,maxRepos:p.trial.maxRepos,message:`Trial active. ${s} days remaining.`}}let s=e.lastValidated?new Date(e.lastValidated):null,a=s?(t.getTime()-s.getTime())/864e5:1/0;if(a>7&&e.key){let s=await y(e.key);if(null===s){if(a>30)return{status:"expired",tier:e.tier,keyMasked:x(e.key),lastValidated:e.lastValidated,expiresAt:e.expiresAt,maxRepos:0,message:`License validation expired (last checked ${Math.floor(a)} days ago). Connect to the internet to re-validate.`}}else{if(!s.valid)return e.status="expired",e.lastValidated=t.toISOString(),m(e),{status:"expired",tier:e.tier,keyMasked:x(e.key),lastValidated:e.lastValidated,expiresAt:e.expiresAt,maxRepos:0,message:"Subscription expired. Renew at https://vibebusiness.com/pricing to continue."};e.lastValidated=t.toISOString(),e.status="valid",s.email&&(e.email=s.email),s.tier&&(e.tier=s.tier),m(e)}}return{status:"valid",tier:e.tier,keyMasked:x(e.key),lastValidated:e.lastValidated,expiresAt:e.expiresAt,maxRepos:p[e.tier].maxRepos,email:e.email,message:`License valid (${e.tier} tier).`}}let v="force-dynamic";async function h(){try{let e=await k();return l.NextResponse.json({success:!0,data:e})}catch(e){return console.error("Failed to get license info:",e),l.NextResponse.json({success:!1,error:"Failed to get license info"},{status:500})}}async function R(e){try{let{key:t}=await e.json();if(!t||"string"!=typeof t)return l.NextResponse.json({success:!1,error:"License key is required"},{status:400});let s=await f(t);if("invalid"===s.status)return l.NextResponse.json({success:!1,error:s.message},{status:400});return l.NextResponse.json({success:!0,data:s})}catch(e){return console.error("Failed to activate license:",e),l.NextResponse.json({success:!1,error:"Failed to activate license"},{status:500})}}let A=new i.AppRouteRouteModule({definition:{kind:r.x.APP_ROUTE,page:"/api/license/route",pathname:"/api/license",filename:"route",bundlePath:"app/api/license/route"},resolvedPagePath:"/Users/luismey/Code/vibebusiness/src/app/api/license/route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:S,staticGenerationAsyncStorage:V,serverHooks:w}=A,b="/api/license/route";function T(){return(0,n.patchFetch)({serverHooks:w,staticGenerationAsyncStorage:V})}}};var t=require("../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[9276,5972],()=>s(1302));module.exports=a})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":1,"files":["../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/5972.js","../../../chunks/9276.js","../../../webpack-runtime.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var e={};e.id=7949,e.ids=[7949],e.modules={399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},4770:e=>{e.exports=require("crypto")},7702:e=>{e.exports=require("events")},2615:e=>{e.exports=require("http")},8791:e=>{e.exports=require("https")},2827:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>m,patchFetch:()=>E,requestAsyncStorage:()=>d,routeModule:()=>l,serverHooks:()=>v,staticGenerationAsyncStorage:()=>x});var s={};t.r(s),t.d(s,{POST:()=>c,dynamic:()=>u});var o=t(9303),i=t(8716),n=t(670),a=t(7070),p=t(6029);let u="force-dynamic";async function c(e){try{let{customerId:r,returnUrl:t}=await e.json();if(!r)return a.NextResponse.json({success:!1,error:"customerId is required"},{status:400});let s=await p.A.billingPortal.sessions.create({customer:r,return_url:t||e.nextUrl.origin});return a.NextResponse.json({success:!0,url:s.url})}catch(e){return console.error("Portal session error:",e),a.NextResponse.json({success:!1,error:"Failed to create portal session"},{status:500})}}let l=new o.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/portal/route",pathname:"/api/portal",filename:"route",bundlePath:"app/api/portal/route"},resolvedPagePath:"/Users/luismey/Code/vibebusiness/src/app/api/portal/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:d,staticGenerationAsyncStorage:x,serverHooks:v}=l,m="/api/portal/route";function E(){return(0,n.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:x})}},6029:(e,r,t)=>{t.d(r,{A:()=>o});var s=t(9777);if(!process.env.STRIPE_SECRET_KEY)throw Error("STRIPE_SECRET_KEY is not set in environment variables");let o=new s.Z(process.env.STRIPE_SECRET_KEY,{apiVersion:"2026-01-28.clover",typescript:!0})}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[9276,5972,9777],()=>t(2827));module.exports=s})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":1,"files":["../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/5972.js","../../../chunks/9276.js","../../../chunks/9777.js","../../../webpack-runtime.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var t={};t.id=1369,t.ids=[1369],t.modules={399:t=>{t.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:t=>{t.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},4770:t=>{t.exports=require("crypto")},7702:t=>{t.exports=require("events")},2048:t=>{t.exports=require("fs")},8791:t=>{t.exports=require("https")},5315:t=>{t.exports=require("path")},1568:t=>{t.exports=require("zlib")},2663:(t,e,r)=>{r.r(e),r.d(e,{originalPathname:()=>m,patchFetch:()=>w,requestAsyncStorage:()=>d,routeModule:()=>c,serverHooks:()=>f,staticGenerationAsyncStorage:()=>p});var s={};r.r(s),r.d(s,{POST:()=>l});var a=r(9303),n=r(8716),i=r(670),u=r(7070),o=r(3418);async function l(t,e){try{let t;let{id:s}=await e.params,a=await (0,o.pw)(s);if(!a)return u.NextResponse.json({success:!1,error:"Draft not found"},{status:404});if("draft"!==a.status)return u.NextResponse.json({success:!1,error:`Draft is already ${a.status}`},{status:400});try{t=(await r.e(7809).then(r.bind(r,7809))).executeSocialTask}catch{return u.NextResponse.json({success:!1,error:"Social media skill not available"},{status:500})}let n=await t(`social-publish-${s}`,`Publish draft ${s}`);if(!n.success)return u.NextResponse.json({success:!1,error:n.output},{status:500});let i=await (0,o.pw)(s);return u.NextResponse.json({success:!0,data:i,message:n.output})}catch(t){return console.error("Failed to publish social draft:",t),u.NextResponse.json({success:!1,error:"Failed to publish social draft"},{status:500})}}let c=new a.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/social/[id]/publish/route",pathname:"/api/social/[id]/publish",filename:"route",bundlePath:"app/api/social/[id]/publish/route"},resolvedPagePath:"/Users/luismey/Code/vibebusiness/src/app/api/social/[id]/publish/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:d,staticGenerationAsyncStorage:p,serverHooks:f}=c,m="/api/social/[id]/publish/route";function w(){return(0,i.patchFetch)({serverHooks:f,staticGenerationAsyncStorage:p})}},9576:(t,e,r)=>{r.d(e,{Z:()=>l});var s=r(4770),a=r.n(s);let n={randomUUID:a().randomUUID},i=new Uint8Array(256),u=i.length,o=[];for(let t=0;t<256;++t)o.push((t+256).toString(16).slice(1));let l=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();let s=(t=t||{}).random||(t.rng||function(){return u>i.length-16&&(a().randomFillSync(i),u=0),i.slice(u,u+=16)})();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=s[t];return e}return function(t,e=0){return o[t[e+0]]+o[t[e+1]]+o[t[e+2]]+o[t[e+3]]+"-"+o[t[e+4]]+o[t[e+5]]+"-"+o[t[e+6]]+o[t[e+7]]+"-"+o[t[e+8]]+o[t[e+9]]+"-"+o[t[e+10]]+o[t[e+11]]+o[t[e+12]]+o[t[e+13]]+o[t[e+14]]+o[t[e+15]]}(s)}},3418:(t,e,r)=>{r.d(e,{FH:()=>h,PV:()=>m,SN:()=>x,ZT:()=>p,nQ:()=>w,pw:()=>f});var s=r(2048),a=r(5315),n=r.n(a),i=r(9576);function u(){return process.env.AI_ANALYST_DATA_DIR||n().join(process.cwd(),"data")}function o(){return n().join(u(),"social.json")}let l={last_updated:new Date().toISOString(),platform:"x",username:null,credentials_valid:!1,drafts:[],metrics:{followers_count:null,post_streak_days:0,total_posts:0,last_post_date:null}};async function c(){try{let t=await s.promises.readFile(o(),"utf-8");return JSON.parse(t)}catch{return{...l,drafts:[],metrics:{...l.metrics}}}}async function d(t){t.last_updated=new Date().toISOString();let e=u();try{await s.promises.access(e)}catch{await s.promises.mkdir(e,{recursive:!0})}await s.promises.writeFile(o(),JSON.stringify(t,null,2),"utf-8")}async function p(){return(await c()).drafts}async function f(t){return(await c()).drafts.find(e=>e.id===t)||null}async function m(t){let e=await c(),r={id:`draft-${(0,i.Z)().slice(0,8)}`,text:t,source:"manual",source_ref:null,status:"draft",created_at:new Date().toISOString(),published_at:null,tweet_id:null,tweet_url:null};return e.drafts.push(r),await d(e),r}async function w(t,e){let r=await c(),s=r.drafts.find(e=>e.id===t);return s&&"draft"===s.status?(void 0!==e.text&&(s.text=e.text),await d(r),s):null}async function h(t){let e=await c(),r=e.drafts.findIndex(e=>e.id===t);return -1!==r&&(e.drafts[r].status="discarded",await d(e),!0)}async function x(){let t=await c();return{...t.metrics,username:t.username,credentials_valid:t.credentials_valid}}}};var e=require("../../../../../webpack-runtime.js");e.C(t);var r=t=>e(e.s=t),s=e.X(0,[9276,5972],()=>r(2663));module.exports=s})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":1,"files":["../../../../../../../data/.DS_Store","../../../../../../../data/.analysis-prompt.txt","../../../../../../../data/.gitkeep","../../../../../../../data/business-context.json","../../../../../../../data/codebase-snapshot.json","../../../../../../../data/competitors.json","../../../../../../../data/config.json","../../../../../../../data/email-campaigns/sequences/onboarding.md","../../../../../../../data/email-campaigns/welcome-2026-02-20.md","../../../../../../../data/goals.json","../../../../../../../data/heartbeat-sessions.json","../../../../../../../data/hypotheses.json","../../../../../../../data/ideas.json","../../../../../../../data/implementations.json","../../../../../../../data/pages.json","../../../../../../../data/payments.json","../../../../../../../data/positioning.json","../../../../../../../data/roadmap.json","../../../../../../../data/sessions.json","../../../../../../../data/social.json","../../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../../node_modules/next/package.json","../../../../../../../package.json","../../../../../../../scripts/skills/social-media.ts","../../../../../../package.json","../../../../../chunks/5972.js","../../../../../chunks/7809.js","../../../../../chunks/9276.js","../../../../../webpack-runtime.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var t={};t.id=7122,t.ids=[7122],t.modules={399:t=>{t.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:t=>{t.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},4770:t=>{t.exports=require("crypto")},2048:t=>{t.exports=require("fs")},5315:t=>{t.exports=require("path")},5154:(t,e,r)=>{r.r(e),r.d(e,{originalPathname:()=>m,patchFetch:()=>w,requestAsyncStorage:()=>p,routeModule:()=>l,serverHooks:()=>x,staticGenerationAsyncStorage:()=>f});var s={};r.r(s),r.d(s,{DELETE:()=>d,PATCH:()=>c});var a=r(9303),n=r(8716),i=r(670),o=r(7070),u=r(3418);async function c(t,e){try{let{id:r}=await e.params,s=await t.json();if(void 0!==s.text&&"string"!=typeof s.text)return o.NextResponse.json({success:!1,error:"Invalid text field"},{status:400});if(s.text&&s.text.length>280)return o.NextResponse.json({success:!1,error:"Tweet text exceeds 280 characters"},{status:400});let a=await (0,u.nQ)(r,{text:s.text});if(!a)return o.NextResponse.json({success:!1,error:"Draft not found or not editable"},{status:404});return o.NextResponse.json({success:!0,data:a})}catch(t){return console.error("Failed to update social draft:",t),o.NextResponse.json({success:!1,error:"Failed to update social draft"},{status:500})}}async function d(t,e){try{let{id:t}=await e.params;if(!await (0,u.FH)(t))return o.NextResponse.json({success:!1,error:"Draft not found"},{status:404});return o.NextResponse.json({success:!0})}catch(t){return console.error("Failed to delete social draft:",t),o.NextResponse.json({success:!1,error:"Failed to delete social draft"},{status:500})}}let l=new a.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/social/[id]/route",pathname:"/api/social/[id]",filename:"route",bundlePath:"app/api/social/[id]/route"},resolvedPagePath:"/Users/luismey/Code/vibebusiness/src/app/api/social/[id]/route.ts",nextConfigOutput:"standalone",userland:s}),{requestAsyncStorage:p,staticGenerationAsyncStorage:f,serverHooks:x}=l,m="/api/social/[id]/route";function w(){return(0,i.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:f})}},9576:(t,e,r)=>{r.d(e,{Z:()=>c});var s=r(4770),a=r.n(s);let n={randomUUID:a().randomUUID},i=new Uint8Array(256),o=i.length,u=[];for(let t=0;t<256;++t)u.push((t+256).toString(16).slice(1));let c=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();let s=(t=t||{}).random||(t.rng||function(){return o>i.length-16&&(a().randomFillSync(i),o=0),i.slice(o,o+=16)})();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=s[t];return e}return function(t,e=0){return u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]}(s)}},3418:(t,e,r)=>{r.d(e,{FH:()=>w,PV:()=>x,SN:()=>y,ZT:()=>p,nQ:()=>m,pw:()=>f});var s=r(2048),a=r(5315),n=r.n(a),i=r(9576);function o(){return process.env.AI_ANALYST_DATA_DIR||n().join(process.cwd(),"data")}function u(){return n().join(o(),"social.json")}let c={last_updated:new Date().toISOString(),platform:"x",username:null,credentials_valid:!1,drafts:[],metrics:{followers_count:null,post_streak_days:0,total_posts:0,last_post_date:null}};async function d(){try{let t=await s.promises.readFile(u(),"utf-8");return JSON.parse(t)}catch{return{...c,drafts:[],metrics:{...c.metrics}}}}async function l(t){t.last_updated=new Date().toISOString();let e=o();try{await s.promises.access(e)}catch{await s.promises.mkdir(e,{recursive:!0})}await s.promises.writeFile(u(),JSON.stringify(t,null,2),"utf-8")}async function p(){return(await d()).drafts}async function f(t){return(await d()).drafts.find(e=>e.id===t)||null}async function x(t){let e=await d(),r={id:`draft-${(0,i.Z)().slice(0,8)}`,text:t,source:"manual",source_ref:null,status:"draft",created_at:new Date().toISOString(),published_at:null,tweet_id:null,tweet_url:null};return e.drafts.push(r),await l(e),r}async function m(t,e){let r=await d(),s=r.drafts.find(e=>e.id===t);return s&&"draft"===s.status?(void 0!==e.text&&(s.text=e.text),await l(r),s):null}async function w(t){let e=await d(),r=e.drafts.findIndex(e=>e.id===t);return -1!==r&&(e.drafts[r].status="discarded",await l(e),!0)}async function y(){let t=await d();return{...t.metrics,username:t.username,credentials_valid:t.credentials_valid}}}};var e=require("../../../../webpack-runtime.js");e.C(t);var r=t=>e(e.s=t),s=e.X(0,[9276,5972],()=>r(5154));module.exports=s})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":1,"files":["../../../../../../data/.DS_Store","../../../../../../data/.analysis-prompt.txt","../../../../../../data/.gitkeep","../../../../../../data/business-context.json","../../../../../../data/codebase-snapshot.json","../../../../../../data/competitors.json","../../../../../../data/config.json","../../../../../../data/email-campaigns/sequences/onboarding.md","../../../../../../data/email-campaigns/welcome-2026-02-20.md","../../../../../../data/goals.json","../../../../../../data/heartbeat-sessions.json","../../../../../../data/hypotheses.json","../../../../../../data/ideas.json","../../../../../../data/implementations.json","../../../../../../data/pages.json","../../../../../../data/payments.json","../../../../../../data/positioning.json","../../../../../../data/roadmap.json","../../../../../../data/sessions.json","../../../../../../data/social.json","../../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../../node_modules/next/package.json","../../../../../../package.json","../../../../../package.json","../../../../chunks/5972.js","../../../../chunks/9276.js","../../../../webpack-runtime.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var t={};t.id=1453,t.ids=[1453],t.modules={399:t=>{t.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:t=>{t.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},4770:t=>{t.exports=require("crypto")},2048:t=>{t.exports=require("fs")},5315:t=>{t.exports=require("path")},9514:(t,e,r)=>{r.r(e),r.d(e,{originalPathname:()=>w,patchFetch:()=>y,requestAsyncStorage:()=>f,routeModule:()=>p,serverHooks:()=>x,staticGenerationAsyncStorage:()=>m});var a={};r.r(a),r.d(a,{GET:()=>l,POST:()=>d,dynamic:()=>c});var s=r(9303),n=r(8716),i=r(670),o=r(7070),u=r(3418);let c="force-dynamic";async function l(){try{let[t,e]=await Promise.all([(0,u.ZT)(),(0,u.SN)()]);return o.NextResponse.json({success:!0,data:{drafts:t,metrics:e}})}catch(t){return console.error("Failed to get social data:",t),o.NextResponse.json({success:!1,error:"Failed to get social data"},{status:500})}}async function d(t){try{let e=await t.json();if(!e.text||"string"!=typeof e.text)return o.NextResponse.json({success:!1,error:"Missing required field: text"},{status:400});if(e.text.length>280)return o.NextResponse.json({success:!1,error:"Tweet text exceeds 280 characters"},{status:400});let r=await (0,u.PV)(e.text);return o.NextResponse.json({success:!0,data:r},{status:201})}catch(t){return console.error("Failed to create social draft:",t),o.NextResponse.json({success:!1,error:"Failed to create social draft"},{status:500})}}let p=new s.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/social/route",pathname:"/api/social",filename:"route",bundlePath:"app/api/social/route"},resolvedPagePath:"/Users/luismey/Code/vibebusiness/src/app/api/social/route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:f,staticGenerationAsyncStorage:m,serverHooks:x}=p,w="/api/social/route";function y(){return(0,i.patchFetch)({serverHooks:x,staticGenerationAsyncStorage:m})}},9576:(t,e,r)=>{r.d(e,{Z:()=>c});var a=r(4770),s=r.n(a);let n={randomUUID:s().randomUUID},i=new Uint8Array(256),o=i.length,u=[];for(let t=0;t<256;++t)u.push((t+256).toString(16).slice(1));let c=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();let a=(t=t||{}).random||(t.rng||function(){return o>i.length-16&&(s().randomFillSync(i),o=0),i.slice(o,o+=16)})();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=a[t];return e}return function(t,e=0){return u[t[e+0]]+u[t[e+1]]+u[t[e+2]]+u[t[e+3]]+"-"+u[t[e+4]]+u[t[e+5]]+"-"+u[t[e+6]]+u[t[e+7]]+"-"+u[t[e+8]]+u[t[e+9]]+"-"+u[t[e+10]]+u[t[e+11]]+u[t[e+12]]+u[t[e+13]]+u[t[e+14]]+u[t[e+15]]}(a)}},3418:(t,e,r)=>{r.d(e,{FH:()=>w,PV:()=>m,SN:()=>y,ZT:()=>p,nQ:()=>x,pw:()=>f});var a=r(2048),s=r(5315),n=r.n(s),i=r(9576);function o(){return process.env.AI_ANALYST_DATA_DIR||n().join(process.cwd(),"data")}function u(){return n().join(o(),"social.json")}let c={last_updated:new Date().toISOString(),platform:"x",username:null,credentials_valid:!1,drafts:[],metrics:{followers_count:null,post_streak_days:0,total_posts:0,last_post_date:null}};async function l(){try{let t=await a.promises.readFile(u(),"utf-8");return JSON.parse(t)}catch{return{...c,drafts:[],metrics:{...c.metrics}}}}async function d(t){t.last_updated=new Date().toISOString();let e=o();try{await a.promises.access(e)}catch{await a.promises.mkdir(e,{recursive:!0})}await a.promises.writeFile(u(),JSON.stringify(t,null,2),"utf-8")}async function p(){return(await l()).drafts}async function f(t){return(await l()).drafts.find(e=>e.id===t)||null}async function m(t){let e=await l(),r={id:`draft-${(0,i.Z)().slice(0,8)}`,text:t,source:"manual",source_ref:null,status:"draft",created_at:new Date().toISOString(),published_at:null,tweet_id:null,tweet_url:null};return e.drafts.push(r),await d(e),r}async function x(t,e){let r=await l(),a=r.drafts.find(e=>e.id===t);return a&&"draft"===a.status?(void 0!==e.text&&(a.text=e.text),await d(r),a):null}async function w(t){let e=await l(),r=e.drafts.findIndex(e=>e.id===t);return -1!==r&&(e.drafts[r].status="discarded",await d(e),!0)}async function y(){let t=await l();return{...t.metrics,username:t.username,credentials_valid:t.credentials_valid}}}};var e=require("../../../webpack-runtime.js");e.C(t);var r=t=>e(e.s=t),a=e.X(0,[9276,5972],()=>r(9514));module.exports=a})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":1,"files":["../../../../../data/.DS_Store","../../../../../data/.analysis-prompt.txt","../../../../../data/.gitkeep","../../../../../data/business-context.json","../../../../../data/codebase-snapshot.json","../../../../../data/competitors.json","../../../../../data/config.json","../../../../../data/email-campaigns/sequences/onboarding.md","../../../../../data/email-campaigns/welcome-2026-02-20.md","../../../../../data/goals.json","../../../../../data/heartbeat-sessions.json","../../../../../data/hypotheses.json","../../../../../data/ideas.json","../../../../../data/implementations.json","../../../../../data/pages.json","../../../../../data/payments.json","../../../../../data/positioning.json","../../../../../data/roadmap.json","../../../../../data/sessions.json","../../../../../data/social.json","../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/5972.js","../../../chunks/9276.js","../../../webpack-runtime.js"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{var e={};e.id=7570,e.ids=[7570],e.modules={399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},1282:e=>{e.exports=require("child_process")},4770:e=>{e.exports=require("crypto")},7702:e=>{e.exports=require("events")},2615:e=>{e.exports=require("http")},8791:e=>{e.exports=require("https")},3258:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>m,patchFetch:()=>v,requestAsyncStorage:()=>l,routeModule:()=>u,serverHooks:()=>b,staticGenerationAsyncStorage:()=>h});var o={};r.r(o),r.d(o,{POST:()=>d,dynamic:()=>p});var s=r(9303),a=r(8716),n=r(670),i=r(7070),c=r(6029);let p="force-dynamic";async function d(e){let t;let r=await e.text(),o=e.headers.get("stripe-signature");if(!o)return i.NextResponse.json({error:"Missing stripe-signature header"},{status:400});try{t=c.A.webhooks.constructEvent(r,o,process.env.STRIPE_WEBHOOK_SECRET)}catch(t){let e=t instanceof Error?t.message:"Unknown error";return console.error("Webhook signature verification failed:",e),i.NextResponse.json({error:`Webhook Error: ${e}`},{status:400})}try{switch(t.type){case"checkout.session.completed":{let e=t.data.object;console.log("Checkout completed:",e.id);break}case"customer.subscription.updated":{let e=t.data.object;console.log("Subscription updated:",e.id,e.status);break}case"customer.subscription.deleted":{let e=t.data.object;console.log("Subscription cancelled:",e.id);break}case"invoice.paid":{let e=t.data.object;console.log("Payment confirmed:",e.id,e.amount_paid);break}case"invoice.payment_failed":{let e=t.data.object;console.log("Payment failed:",e.id);break}default:console.log("Unhandled event type:",t.type)}return i.NextResponse.json({received:!0})}catch(e){return console.error("Webhook handler error:",e),i.NextResponse.json({error:"Webhook handler failed"},{status:500})}}let u=new s.AppRouteRouteModule({definition:{kind:a.x.APP_ROUTE,page:"/api/webhook/route",pathname:"/api/webhook",filename:"route",bundlePath:"app/api/webhook/route"},resolvedPagePath:"/Users/luismey/Code/vibebusiness/src/app/api/webhook/route.ts",nextConfigOutput:"standalone",userland:o}),{requestAsyncStorage:l,staticGenerationAsyncStorage:h,serverHooks:b}=u,m="/api/webhook/route";function v(){return(0,n.patchFetch)({serverHooks:b,staticGenerationAsyncStorage:h})}},6029:(e,t,r)=>{r.d(t,{A:()=>s});var o=r(9777);if(!process.env.STRIPE_SECRET_KEY)throw Error("STRIPE_SECRET_KEY is not set in environment variables");let s=new o.Z(process.env.STRIPE_SECRET_KEY,{apiVersion:"2026-01-28.clover",typescript:!0})}};var t=require("../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),o=t.X(0,[9276,5972,9777],()=>r(3258));module.exports=o})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":1,"files":["../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/5972.js","../../../chunks/9276.js","../../../chunks/9777.js","../../../webpack-runtime.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={};e.id=945,e.ids=[945],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},9278:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>i.a,__next_app__:()=>h,originalPathname:()=>o,pages:()=>x,routeModule:()=>m,tree:()=>c}),s(2139),s(2029),s(5866);var a=s(3191),l=s(8716),r=s(7922),i=s.n(r),d=s(5231),n={};for(let e in d)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(n[e]=()=>d[e]);s.d(t,n);let c=["",{children:["goals",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,2139)),"/Users/luismey/Code/vibebusiness/src/app/goals/[id]/page.tsx"]}]},{}]},{}]},{layout:[()=>Promise.resolve().then(s.bind(s,2029)),"/Users/luismey/Code/vibebusiness/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,5866,23)),"next/dist/client/components/not-found-error"]}],x=["/Users/luismey/Code/vibebusiness/src/app/goals/[id]/page.tsx"],o="/goals/[id]/page",h={require:s,loadChunk:()=>Promise.resolve()},m=new a.AppPageRouteModule({definition:{kind:l.x.APP_PAGE,page:"/goals/[id]/page",pathname:"/goals/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},1168:(e,t,s)=>{Promise.resolve().then(s.bind(s,1358))},6333:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7358:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).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"}]])},7027:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).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"}]])},4802:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).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"}]])},1019:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).Z)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},3855:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},1358:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>Z});var a=s(326),l=s(7577),r=s(5047),i=s(434),d=s(7069),n=s(949),c=s(9163),x=s(6307),o=s(1405),h=s(6333),m=s(3468),p=s(7358),u=s(4802),j=s(7027),g=s(1135),b=s(3818),f=s(6087),N=s(1019),v=s(3855),y=s(9526),w=s(2728);function k({kpis:e,goalId:t,onUpdateKPI:s}){let[r,i]=(0,l.useState)(null),[n,x]=(0,l.useState)(null),[o,h]=(0,l.useState)(""),[m,p]=(0,l.useState)(!1),u=async e=>{if(!s||!o.trim())return;let t=parseFloat(o);if(!isNaN(t)){p(!0);try{await s(e,t),x(null),h("")}catch(e){console.error("Failed to update KPI:",e)}finally{p(!1)}}};return a.jsx("div",{className:"bg-white rounded-lg border border-slate-200 overflow-hidden",children:(0,a.jsxs)("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-slate-50 border-b border-slate-200",children:(0,a.jsxs)("tr",{children:[a.jsx("th",{className:"text-left text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3",children:"KPI"}),a.jsx("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-24",children:"Trend"}),a.jsx("th",{className:"text-right text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-24",children:"Current"}),a.jsx("th",{className:"text-right text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-24",children:"Target"}),a.jsx("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-20",children:"Progress"}),a.jsx("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-16",children:"Source"}),s&&a.jsx("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-16",children:"Action"})]})}),a.jsx("tbody",{className:"divide-y divide-slate-100",children:e.map(e=>{let t=function(e){if(e.history.length<2)return{icon:N.Z,color:"text-slate-400",label:"No trend"};let t=e.history[0].value,s=e.history[e.history.length-1].value,a="higher_is_better"===e.direction?s>t:s<t;return t===s?{icon:N.Z,color:"text-slate-400",label:"Stable"}:a?{icon:d.Z,color:"text-emerald-500",label:"Improving"}:{icon:c.Z,color:"text-red-500",label:"Declining"}}(e),l=null===e.current_value||null===e.target_value?null:"higher_is_better"===e.direction?e.current_value/e.target_value*100:e.current_value<=e.target_value?100:e.target_value/e.current_value*100,p=t.icon,j=r===e.id,b=n===e.id;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("tr",{className:(0,g.Z)("hover:bg-slate-50 cursor-pointer transition-colors",j&&"bg-slate-50"),onClick:()=>i(j?null:e.id),children:[a.jsx("td",{className:"px-4 py-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-16 h-8",children:a.jsx(w.Z,{kpi:e,height:32,width:64})}),(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-sm font-medium text-slate-900",children:e.name}),a.jsx("p",{className:"text-xs text-slate-500 line-clamp-1",children:e.description})]})]})}),a.jsx("td",{className:"px-4 py-3 text-center",children:a.jsx("span",{className:(0,g.Z)("inline-flex items-center gap-1",t.color),title:t.label,children:a.jsx(p,{className:"w-4 h-4"})})}),a.jsx("td",{className:"px-4 py-3 text-right",children:a.jsx("span",{className:"text-sm font-medium text-slate-900",children:null!==e.current_value?`${e.current_value}${e.unit}`:"--"})}),a.jsx("td",{className:"px-4 py-3 text-right",children:a.jsx("span",{className:"text-sm text-slate-500",children:null!==e.target_value?`${e.target_value}${e.unit}`:"--"})}),a.jsx("td",{className:"px-4 py-3",children:null!==l?a.jsx("div",{className:"flex items-center justify-center",children:a.jsx("div",{className:"w-12 h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:(0,g.Z)("h-full rounded-full",l>=100?"bg-emerald-500":l>=70?"bg-amber-500":"bg-red-500"),style:{width:`${Math.min(l,100)}%`}})})}):a.jsx("span",{className:"text-xs text-slate-400 text-center block",children:"--"})}),a.jsx("td",{className:"px-4 py-3 text-center",children:a.jsx("span",{className:(0,g.Z)("text-xs px-1.5 py-0.5 rounded","manual"===e.source?"bg-slate-100 text-slate-600":"bg-blue-50 text-blue-600"),children:y.en[e.source]})}),s&&a.jsx("td",{className:"px-4 py-3 text-center",onClick:e=>e.stopPropagation(),children:"manual"===e.source&&a.jsx("button",{onClick:t=>{t.stopPropagation(),x(e.id),h(e.current_value?.toString()||"")},className:"p-1 text-slate-400 hover:text-emerald-600 transition-colors",title:"Add value",children:a.jsx(v.Z,{className:"w-4 h-4"})})})]},e.id),j&&a.jsx("tr",{children:(0,a.jsxs)("td",{colSpan:s?7:6,className:"px-4 py-4 bg-slate-50",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"text-xs font-medium text-slate-500 uppercase mb-2",children:"History"}),e.history.length>0?a.jsx("div",{className:"h-32 bg-white rounded border border-slate-200 p-2",children:a.jsx(w.Z,{kpi:e,height:112,showTarget:!0})}):a.jsx("div",{className:"h-32 bg-white rounded border border-slate-200 flex items-center justify-center text-sm text-slate-400",children:"No historical data"})]}),(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"text-xs font-medium text-slate-500 uppercase mb-2",children:"Details"}),(0,a.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[a.jsx("dt",{className:"text-slate-500",children:"Direction"}),a.jsx("dd",{className:"text-slate-900",children:"higher_is_better"===e.direction?"Higher is better":"Lower is better"})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[a.jsx("dt",{className:"text-slate-500",children:"Data points"}),a.jsx("dd",{className:"text-slate-900",children:e.history.length})]}),e.history.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[a.jsx("dt",{className:"text-slate-500",children:"First recorded"}),a.jsx("dd",{className:"text-slate-900",children:e.history[0].date})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[a.jsx("dt",{className:"text-slate-500",children:"Last updated"}),a.jsx("dd",{className:"text-slate-900",children:e.history[e.history.length-1].date})]})]})]}),(0,a.jsxs)("div",{className:"mt-4",children:[a.jsx("h4",{className:"text-xs font-medium text-slate-500 uppercase mb-1",children:"Query"}),a.jsx("pre",{className:"text-xs text-slate-600 bg-white p-2 rounded border border-slate-200 overflow-x-auto",children:e.query})]})]})]}),b&&"manual"===e.source&&s&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-slate-200 flex items-center gap-3",children:[a.jsx("label",{className:"text-sm text-slate-600",children:"Add new value:"}),a.jsx("input",{type:"number",value:o,onChange:e=>h(e.target.value),className:"w-24 px-2 py-1 text-sm border border-slate-300 rounded focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",placeholder:"Value",step:"any"}),a.jsx("span",{className:"text-sm text-slate-500",children:e.unit}),a.jsx("button",{onClick:()=>u(e.id),disabled:m||!o.trim(),className:"px-3 py-1 text-sm bg-emerald-600 text-white rounded hover:bg-emerald-700 disabled:opacity-50 disabled:cursor-not-allowed",children:m?"Saving...":"Save"}),a.jsx("button",{onClick:()=>{x(null),h("")},className:"px-3 py-1 text-sm text-slate-600 hover:text-slate-900",children:"Cancel"})]})]})},`${e.id}-expanded`)]})})})]})})}function _({status:e}){switch(e){case"on_track":return a.jsx(d.Z,{className:"w-5 h-5"});case"at_risk":return a.jsx(n.Z,{className:"w-5 h-5"});case"behind":return a.jsx(c.Z,{className:"w-5 h-5"});case"achieved":return a.jsx(x.Z,{className:"w-5 h-5"})}}function Z({params:e}){(0,r.useRouter)();let{id:t}=e,[s,d]=(0,l.useState)(null),[n,c]=(0,l.useState)([]),[x,N]=(0,l.useState)(!0),[v,w]=(0,l.useState)(!1),[Z,P]=(0,l.useState)(null),S=async()=>{try{let e=await fetch(`/api/goals/${t}`),s=await e.json();if(!s.success){P(s.error||"Failed to load goal");return}if(d(s.data),s.data.related_ideas.length>0){let e=await fetch("/api/ideas"),t=await e.json();if(t.success){let e=t.data.filter(e=>s.data.related_ideas.includes(e.id));c(e)}}}catch(e){P("Failed to load goal"),console.error("Error fetching goal:",e)}finally{N(!1)}},C=async(e,s)=>{try{let a=await fetch(`/api/goals/${t}/kpis`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kpi_id:e,action:"add_history",value:s})}),l=await a.json();if(l.success)await S();else throw Error(l.error)}catch(e){throw console.error("Failed to update KPI:",e),e}},M=async e=>{try{let s=await fetch(`/api/goals/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:e})}),a=await s.json();a.success&&d(a.data)}catch(e){console.error("Failed to update status:",e)}},I=async()=>{w(!0);try{let e=await fetch("/api/kpis/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal_id:t})}),s=await e.json();s.success||console.error("KPI refresh failed:",s.error),await S()}catch(e){console.error("Error refreshing KPIs:",e)}finally{w(!1)}};return x?a.jsx(b.default,{children:a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx(o.Z,{className:"w-8 h-8 text-slate-400 animate-spin"})})}):Z||!s?a.jsx(b.default,{children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)(i.default,{href:"/goals",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[a.jsx(h.Z,{className:"w-4 h-4"}),a.jsx("span",{children:"Back to Goals"})]}),a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6 text-center",children:a.jsx("p",{className:"text-red-600",children:Z||"Goal not found"})})]})}):a.jsx(b.default,{children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)(i.default,{href:"/goals",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[a.jsx(h.Z,{className:"w-4 h-4"}),a.jsx("span",{children:"Back to Goals"})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-14 h-14 bg-emerald-100 rounded-xl flex items-center justify-center flex-shrink-0",children:a.jsx(m.Z,{className:"w-7 h-7 text-emerald-600"})}),(0,a.jsxs)("div",{children:[a.jsx("div",{className:"flex items-center gap-2 mb-1",children:a.jsx("span",{className:(0,g.Z)("text-xs px-2 py-0.5 rounded-full",y.l5[s.category]),children:y.kT[s.category]})}),a.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-1",children:s.title}),a.jsx("p",{className:"text-slate-500",children:s.description})]})]}),(0,a.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,a.jsxs)("span",{className:(0,g.Z)("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-medium border",y.i2[s.status]),children:[a.jsx(_,{status:s.status}),a.jsx("span",{children:y.tV[s.status]})]}),(0,a.jsxs)("select",{value:s.status,onChange:e=>M(e.target.value),className:"text-xs border border-slate-200 rounded px-2 py-1 text-slate-600",children:[a.jsx("option",{value:"on_track",children:"On Track"}),a.jsx("option",{value:"at_risk",children:"At Risk"}),a.jsx("option",{value:"behind",children:"Behind"}),a.jsx("option",{value:"achieved",children:"Achieved"})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-6 text-sm text-slate-500 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx(p.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Deadline: ",a.jsx("span",{className:"font-medium text-slate-700",children:s.deadline})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx(u.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[s.related_ideas.length," linked ideas"]})]})]}),a.jsx(f.Z,{current:s.current_value,target:s.target_value,unit:s.target_unit,status:s.status})]}),(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",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-slate-900",children:["Key Performance Indicators (",s.kpis.length,")"]}),(0,a.jsxs)("button",{onClick:I,disabled:v,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm text-slate-600 hover:text-slate-900 border border-slate-200 rounded-lg hover:bg-slate-50 disabled:opacity-50",children:[a.jsx(o.Z,{className:(0,g.Z)("w-4 h-4",v&&"animate-spin")}),a.jsx("span",{children:v?"Refreshing...":"Refresh KPIs"})]})]}),s.kpis.length>0?a.jsx(k,{kpis:s.kpis,goalId:s.id,onUpdateKPI:C}):a.jsx("div",{className:"bg-white rounded-lg border border-slate-200 p-8 text-center",children:a.jsx("p",{className:"text-slate-500",children:"No KPIs defined for this goal."})})]}),(0,a.jsxs)("div",{children:[a.jsx("h2",{className:"text-lg font-semibold text-slate-900 mb-4",children:"Related Ideas"}),n.length>0?a.jsx("div",{className:"space-y-3",children:n.map(e=>(0,a.jsxs)(i.default,{href:`/ideas/${e.id}`,className:"block bg-white rounded-lg border border-slate-200 p-4 hover:border-emerald-300 hover:shadow-sm transition-all",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-slate-900 mb-1",children:e.title}),a.jsx("p",{className:"text-xs text-slate-500 line-clamp-2",children:e.summary})]}),a.jsx(j.Z,{className:"w-4 h-4 text-slate-400 flex-shrink-0"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx("span",{className:(0,g.Z)("text-xs px-1.5 py-0.5 rounded","shipped"===e.stage?"bg-green-100 text-green-700":"in_progress"===e.stage?"bg-violet-100 text-violet-700":"bg-slate-100 text-slate-600"),children:e.stage.replace("_"," ")}),e.expected_impact&&a.jsx("span",{className:"text-xs text-slate-400",children:e.expected_impact})]})]},e.id))}):(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-6 text-center",children:[a.jsx(u.Z,{className:"w-8 h-8 text-slate-300 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-slate-500 mb-3",children:"No ideas linked to this goal yet."}),a.jsx(i.default,{href:"/",className:"text-sm text-emerald-600 hover:text-emerald-700",children:"Browse Ideas"})]}),(0,a.jsxs)("div",{className:"mt-6 bg-slate-50 rounded-lg border border-slate-200 p-4",children:[a.jsx("h3",{className:"text-sm font-medium text-slate-700 mb-2",children:"Tip: Link Ideas to Goals"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When approving ideas, link them to this goal to track which improvements support your business objectives. Ideas linked to goals are prioritized in the analysis process."})]})]})]}),(0,a.jsxs)("div",{className:"mt-6 text-xs text-slate-400",children:[(0,a.jsxs)("p",{children:["Created: ",new Date(s.created_at).toLocaleString()]}),(0,a.jsxs)("p",{children:["Last updated: ",new Date(s.updated_at).toLocaleString()]})]})]})})}},2139:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(8570).createProxy)(String.raw`/Users/luismey/Code/vibebusiness/src/app/goals/[id]/page.tsx#default`)}};var t=require("../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[276,471,617,644],()=>s(9278));module.exports=a})();
|
|
1
|
+
(()=>{var e={};e.id=6945,e.ids=[6945],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},9278:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>i.a,__next_app__:()=>h,originalPathname:()=>o,pages:()=>x,routeModule:()=>m,tree:()=>c}),s(2139),s(2029),s(5866);var a=s(3191),l=s(8716),r=s(7922),i=s.n(r),d=s(5231),n={};for(let e in d)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(n[e]=()=>d[e]);s.d(t,n);let c=["",{children:["goals",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,2139)),"/Users/luismey/Code/vibebusiness/src/app/goals/[id]/page.tsx"]}]},{}]},{}]},{layout:[()=>Promise.resolve().then(s.bind(s,2029)),"/Users/luismey/Code/vibebusiness/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(s.t.bind(s,5866,23)),"next/dist/client/components/not-found-error"]}],x=["/Users/luismey/Code/vibebusiness/src/app/goals/[id]/page.tsx"],o="/goals/[id]/page",h={require:s,loadChunk:()=>Promise.resolve()},m=new a.AppPageRouteModule({definition:{kind:l.x.APP_PAGE,page:"/goals/[id]/page",pathname:"/goals/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},1168:(e,t,s)=>{Promise.resolve().then(s.bind(s,1358))},6333:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7358:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).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"}]])},7027:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).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"}]])},4802:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).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"}]])},1019:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).Z)("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},3855:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});let a=(0,s(2881).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},1358:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>Z});var a=s(326),l=s(7577),r=s(5047),i=s(434),d=s(7069),n=s(949),c=s(9163),x=s(6307),o=s(1405),h=s(6333),m=s(3468),p=s(7358),u=s(4802),j=s(7027),g=s(1135),b=s(3818),f=s(6087),N=s(1019),v=s(3855),y=s(9526),w=s(2728);function k({kpis:e,goalId:t,onUpdateKPI:s}){let[r,i]=(0,l.useState)(null),[n,x]=(0,l.useState)(null),[o,h]=(0,l.useState)(""),[m,p]=(0,l.useState)(!1),u=async e=>{if(!s||!o.trim())return;let t=parseFloat(o);if(!isNaN(t)){p(!0);try{await s(e,t),x(null),h("")}catch(e){console.error("Failed to update KPI:",e)}finally{p(!1)}}};return a.jsx("div",{className:"bg-white rounded-lg border border-slate-200 overflow-hidden",children:(0,a.jsxs)("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-slate-50 border-b border-slate-200",children:(0,a.jsxs)("tr",{children:[a.jsx("th",{className:"text-left text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3",children:"KPI"}),a.jsx("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-24",children:"Trend"}),a.jsx("th",{className:"text-right text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-24",children:"Current"}),a.jsx("th",{className:"text-right text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-24",children:"Target"}),a.jsx("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-20",children:"Progress"}),a.jsx("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-16",children:"Source"}),s&&a.jsx("th",{className:"text-center text-xs font-medium text-slate-500 uppercase tracking-wider px-4 py-3 w-16",children:"Action"})]})}),a.jsx("tbody",{className:"divide-y divide-slate-100",children:e.map(e=>{let t=function(e){if(e.history.length<2)return{icon:N.Z,color:"text-slate-400",label:"No trend"};let t=e.history[0].value,s=e.history[e.history.length-1].value,a="higher_is_better"===e.direction?s>t:s<t;return t===s?{icon:N.Z,color:"text-slate-400",label:"Stable"}:a?{icon:d.Z,color:"text-emerald-500",label:"Improving"}:{icon:c.Z,color:"text-red-500",label:"Declining"}}(e),l=null===e.current_value||null===e.target_value?null:"higher_is_better"===e.direction?e.current_value/e.target_value*100:e.current_value<=e.target_value?100:e.target_value/e.current_value*100,p=t.icon,j=r===e.id,b=n===e.id;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("tr",{className:(0,g.Z)("hover:bg-slate-50 cursor-pointer transition-colors",j&&"bg-slate-50"),onClick:()=>i(j?null:e.id),children:[a.jsx("td",{className:"px-4 py-3",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-16 h-8",children:a.jsx(w.Z,{kpi:e,height:32,width:64})}),(0,a.jsxs)("div",{children:[a.jsx("p",{className:"text-sm font-medium text-slate-900",children:e.name}),a.jsx("p",{className:"text-xs text-slate-500 line-clamp-1",children:e.description})]})]})}),a.jsx("td",{className:"px-4 py-3 text-center",children:a.jsx("span",{className:(0,g.Z)("inline-flex items-center gap-1",t.color),title:t.label,children:a.jsx(p,{className:"w-4 h-4"})})}),a.jsx("td",{className:"px-4 py-3 text-right",children:a.jsx("span",{className:"text-sm font-medium text-slate-900",children:null!==e.current_value?`${e.current_value}${e.unit}`:"--"})}),a.jsx("td",{className:"px-4 py-3 text-right",children:a.jsx("span",{className:"text-sm text-slate-500",children:null!==e.target_value?`${e.target_value}${e.unit}`:"--"})}),a.jsx("td",{className:"px-4 py-3",children:null!==l?a.jsx("div",{className:"flex items-center justify-center",children:a.jsx("div",{className:"w-12 h-1.5 bg-slate-100 rounded-full overflow-hidden",children:a.jsx("div",{className:(0,g.Z)("h-full rounded-full",l>=100?"bg-emerald-500":l>=70?"bg-amber-500":"bg-red-500"),style:{width:`${Math.min(l,100)}%`}})})}):a.jsx("span",{className:"text-xs text-slate-400 text-center block",children:"--"})}),a.jsx("td",{className:"px-4 py-3 text-center",children:a.jsx("span",{className:(0,g.Z)("text-xs px-1.5 py-0.5 rounded","manual"===e.source?"bg-slate-100 text-slate-600":"bg-blue-50 text-blue-600"),children:y.en[e.source]})}),s&&a.jsx("td",{className:"px-4 py-3 text-center",onClick:e=>e.stopPropagation(),children:"manual"===e.source&&a.jsx("button",{onClick:t=>{t.stopPropagation(),x(e.id),h(e.current_value?.toString()||"")},className:"p-1 text-slate-400 hover:text-emerald-600 transition-colors",title:"Add value",children:a.jsx(v.Z,{className:"w-4 h-4"})})})]},e.id),j&&a.jsx("tr",{children:(0,a.jsxs)("td",{colSpan:s?7:6,className:"px-4 py-4 bg-slate-50",children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"text-xs font-medium text-slate-500 uppercase mb-2",children:"History"}),e.history.length>0?a.jsx("div",{className:"h-32 bg-white rounded border border-slate-200 p-2",children:a.jsx(w.Z,{kpi:e,height:112,showTarget:!0})}):a.jsx("div",{className:"h-32 bg-white rounded border border-slate-200 flex items-center justify-center text-sm text-slate-400",children:"No historical data"})]}),(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"text-xs font-medium text-slate-500 uppercase mb-2",children:"Details"}),(0,a.jsxs)("dl",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[a.jsx("dt",{className:"text-slate-500",children:"Direction"}),a.jsx("dd",{className:"text-slate-900",children:"higher_is_better"===e.direction?"Higher is better":"Lower is better"})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[a.jsx("dt",{className:"text-slate-500",children:"Data points"}),a.jsx("dd",{className:"text-slate-900",children:e.history.length})]}),e.history.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[a.jsx("dt",{className:"text-slate-500",children:"First recorded"}),a.jsx("dd",{className:"text-slate-900",children:e.history[0].date})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[a.jsx("dt",{className:"text-slate-500",children:"Last updated"}),a.jsx("dd",{className:"text-slate-900",children:e.history[e.history.length-1].date})]})]})]}),(0,a.jsxs)("div",{className:"mt-4",children:[a.jsx("h4",{className:"text-xs font-medium text-slate-500 uppercase mb-1",children:"Query"}),a.jsx("pre",{className:"text-xs text-slate-600 bg-white p-2 rounded border border-slate-200 overflow-x-auto",children:e.query})]})]})]}),b&&"manual"===e.source&&s&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-slate-200 flex items-center gap-3",children:[a.jsx("label",{className:"text-sm text-slate-600",children:"Add new value:"}),a.jsx("input",{type:"number",value:o,onChange:e=>h(e.target.value),className:"w-24 px-2 py-1 text-sm border border-slate-300 rounded focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",placeholder:"Value",step:"any"}),a.jsx("span",{className:"text-sm text-slate-500",children:e.unit}),a.jsx("button",{onClick:()=>u(e.id),disabled:m||!o.trim(),className:"px-3 py-1 text-sm bg-emerald-600 text-white rounded hover:bg-emerald-700 disabled:opacity-50 disabled:cursor-not-allowed",children:m?"Saving...":"Save"}),a.jsx("button",{onClick:()=>{x(null),h("")},className:"px-3 py-1 text-sm text-slate-600 hover:text-slate-900",children:"Cancel"})]})]})},`${e.id}-expanded`)]})})})]})})}function _({status:e}){switch(e){case"on_track":return a.jsx(d.Z,{className:"w-5 h-5"});case"at_risk":return a.jsx(n.Z,{className:"w-5 h-5"});case"behind":return a.jsx(c.Z,{className:"w-5 h-5"});case"achieved":return a.jsx(x.Z,{className:"w-5 h-5"})}}function Z({params:e}){(0,r.useRouter)();let{id:t}=e,[s,d]=(0,l.useState)(null),[n,c]=(0,l.useState)([]),[x,N]=(0,l.useState)(!0),[v,w]=(0,l.useState)(!1),[Z,P]=(0,l.useState)(null),S=async()=>{try{let e=await fetch(`/api/goals/${t}`),s=await e.json();if(!s.success){P(s.error||"Failed to load goal");return}if(d(s.data),s.data.related_ideas.length>0){let e=await fetch("/api/ideas"),t=await e.json();if(t.success){let e=t.data.filter(e=>s.data.related_ideas.includes(e.id));c(e)}}}catch(e){P("Failed to load goal"),console.error("Error fetching goal:",e)}finally{N(!1)}},C=async(e,s)=>{try{let a=await fetch(`/api/goals/${t}/kpis`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kpi_id:e,action:"add_history",value:s})}),l=await a.json();if(l.success)await S();else throw Error(l.error)}catch(e){throw console.error("Failed to update KPI:",e),e}},M=async e=>{try{let s=await fetch(`/api/goals/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:e})}),a=await s.json();a.success&&d(a.data)}catch(e){console.error("Failed to update status:",e)}},I=async()=>{w(!0);try{let e=await fetch("/api/kpis/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal_id:t})}),s=await e.json();s.success||console.error("KPI refresh failed:",s.error),await S()}catch(e){console.error("Error refreshing KPIs:",e)}finally{w(!1)}};return x?a.jsx(b.default,{children:a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx(o.Z,{className:"w-8 h-8 text-slate-400 animate-spin"})})}):Z||!s?a.jsx(b.default,{children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)(i.default,{href:"/goals",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[a.jsx(h.Z,{className:"w-4 h-4"}),a.jsx("span",{children:"Back to Goals"})]}),a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6 text-center",children:a.jsx("p",{className:"text-red-600",children:Z||"Goal not found"})})]})}):a.jsx(b.default,{children:(0,a.jsxs)("div",{className:"p-6",children:[(0,a.jsxs)(i.default,{href:"/goals",className:"inline-flex items-center gap-2 text-slate-600 hover:text-slate-900 mb-6",children:[a.jsx(h.Z,{className:"w-4 h-4"}),a.jsx("span",{children:"Back to Goals"})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-6 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-14 h-14 bg-emerald-100 rounded-xl flex items-center justify-center flex-shrink-0",children:a.jsx(m.Z,{className:"w-7 h-7 text-emerald-600"})}),(0,a.jsxs)("div",{children:[a.jsx("div",{className:"flex items-center gap-2 mb-1",children:a.jsx("span",{className:(0,g.Z)("text-xs px-2 py-0.5 rounded-full",y.l5[s.category]),children:y.kT[s.category]})}),a.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-1",children:s.title}),a.jsx("p",{className:"text-slate-500",children:s.description})]})]}),(0,a.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,a.jsxs)("span",{className:(0,g.Z)("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-sm font-medium border",y.i2[s.status]),children:[a.jsx(_,{status:s.status}),a.jsx("span",{children:y.tV[s.status]})]}),(0,a.jsxs)("select",{value:s.status,onChange:e=>M(e.target.value),className:"text-xs border border-slate-200 rounded px-2 py-1 text-slate-600",children:[a.jsx("option",{value:"on_track",children:"On Track"}),a.jsx("option",{value:"at_risk",children:"At Risk"}),a.jsx("option",{value:"behind",children:"Behind"}),a.jsx("option",{value:"achieved",children:"Achieved"})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-6 text-sm text-slate-500 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx(p.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:["Deadline: ",a.jsx("span",{className:"font-medium text-slate-700",children:s.deadline})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx(u.Z,{className:"w-4 h-4"}),(0,a.jsxs)("span",{children:[s.related_ideas.length," linked ideas"]})]})]}),a.jsx(f.Z,{current:s.current_value,target:s.target_value,unit:s.target_unit,status:s.status})]}),(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",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-slate-900",children:["Key Performance Indicators (",s.kpis.length,")"]}),(0,a.jsxs)("button",{onClick:I,disabled:v,className:"inline-flex items-center gap-2 px-3 py-1.5 text-sm text-slate-600 hover:text-slate-900 border border-slate-200 rounded-lg hover:bg-slate-50 disabled:opacity-50",children:[a.jsx(o.Z,{className:(0,g.Z)("w-4 h-4",v&&"animate-spin")}),a.jsx("span",{children:v?"Refreshing...":"Refresh KPIs"})]})]}),s.kpis.length>0?a.jsx(k,{kpis:s.kpis,goalId:s.id,onUpdateKPI:C}):a.jsx("div",{className:"bg-white rounded-lg border border-slate-200 p-8 text-center",children:a.jsx("p",{className:"text-slate-500",children:"No KPIs defined for this goal."})})]}),(0,a.jsxs)("div",{children:[a.jsx("h2",{className:"text-lg font-semibold text-slate-900 mb-4",children:"Related Ideas"}),n.length>0?a.jsx("div",{className:"space-y-3",children:n.map(e=>(0,a.jsxs)(i.default,{href:`/ideas/${e.id}`,className:"block bg-white rounded-lg border border-slate-200 p-4 hover:border-emerald-300 hover:shadow-sm transition-all",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-slate-900 mb-1",children:e.title}),a.jsx("p",{className:"text-xs text-slate-500 line-clamp-2",children:e.summary})]}),a.jsx(j.Z,{className:"w-4 h-4 text-slate-400 flex-shrink-0"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[a.jsx("span",{className:(0,g.Z)("text-xs px-1.5 py-0.5 rounded","shipped"===e.stage?"bg-green-100 text-green-700":"in_progress"===e.stage?"bg-violet-100 text-violet-700":"bg-slate-100 text-slate-600"),children:e.stage.replace("_"," ")}),e.expected_impact&&a.jsx("span",{className:"text-xs text-slate-400",children:e.expected_impact})]})]},e.id))}):(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-6 text-center",children:[a.jsx(u.Z,{className:"w-8 h-8 text-slate-300 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-slate-500 mb-3",children:"No ideas linked to this goal yet."}),a.jsx(i.default,{href:"/",className:"text-sm text-emerald-600 hover:text-emerald-700",children:"Browse Ideas"})]}),(0,a.jsxs)("div",{className:"mt-6 bg-slate-50 rounded-lg border border-slate-200 p-4",children:[a.jsx("h3",{className:"text-sm font-medium text-slate-700 mb-2",children:"Tip: Link Ideas to Goals"}),a.jsx("p",{className:"text-xs text-slate-500",children:"When approving ideas, link them to this goal to track which improvements support your business objectives. Ideas linked to goals are prioritized in the analysis process."})]})]})]}),(0,a.jsxs)("div",{className:"mt-6 text-xs text-slate-400",children:[(0,a.jsxs)("p",{children:["Created: ",new Date(s.created_at).toLocaleString()]}),(0,a.jsxs)("p",{children:["Last updated: ",new Date(s.updated_at).toLocaleString()]})]})]})})}},2139:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>a});let a=(0,s(8570).createProxy)(String.raw`/Users/luismey/Code/vibebusiness/src/app/goals/[id]/page.tsx#default`)}};var t=require("../../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[9276,4471,4376,3644],()=>s(9278));module.exports=a})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/
|
|
1
|
+
{"version":1,"files":["../../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/package.json","../../../../../package.json","../../../../package.json","../../../chunks/3644.js","../../../chunks/4376.js","../../../chunks/4471.js","../../../chunks/9276.js","../../../webpack-runtime.js","page_client-reference-manifest.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/goals/[id]/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"47":{"*":{"id":"4812","name":"*","chunks":[],"async":false}},"80":{"*":{"id":"1868","name":"*","chunks":[],"async":false}},"
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/goals/[id]/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"47":{"*":{"id":"4812","name":"*","chunks":[],"async":false}},"80":{"*":{"id":"1868","name":"*","chunks":[],"async":false}},"786":{"*":{"id":"1855","name":"*","chunks":[],"async":false}},"1060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"1214":{"*":{"id":"4663","name":"*","chunks":[],"async":false}},"1259":{"*":{"id":"3818","name":"*","chunks":[],"async":false}},"2612":{"*":{"id":"3305","name":"*","chunks":[],"async":false}},"2674":{"*":{"id":"9973","name":"*","chunks":[],"async":false}},"2846":{"*":{"id":"2994","name":"*","chunks":[],"async":false}},"3032":{"*":{"id":"1828","name":"*","chunks":[],"async":false}},"4553":{"*":{"id":"8022","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"9671","name":"*","chunks":[],"async":false}},"6423":{"*":{"id":"4759","name":"*","chunks":[],"async":false}},"6435":{"*":{"id":"6663","name":"*","chunks":[],"async":false}},"8619":{"*":{"id":"5467","name":"*","chunks":[],"async":false}},"8935":{"*":{"id":"1358","name":"*","chunks":[],"async":false}},"9107":{"*":{"id":"6114","name":"*","chunks":[],"async":false}},"9534":{"*":{"id":"9616","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/app-router.js":{"id":2846,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/app-router.js":{"id":2846,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/client-page.js":{"id":9107,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/client-page.js":{"id":9107,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/error-boundary.js":{"id":1060,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":1060,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/render-from-template-context.js":{"id":6423,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":6423,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/app/globals.css":{"id":2778,"name":"*","chunks":["185","static/chunks/app/layout-eeef7928298d2198.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/app/hypotheses/[id]/page.tsx":{"id":4553,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/app/goals/[id]/page.tsx":{"id":8935,"name":"*","chunks":["746","static/chunks/746-ea7c3e4e69c14385.js","444","static/chunks/444-125b7b0fa8cbdb81.js","945","static/chunks/app/goals/%5Bid%5D/page-8dbeab5cc8cf0988.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/app/roadmap/[id]/page.tsx":{"id":47,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/components/AnalystLayout.tsx":{"id":1259,"name":"*","chunks":["746","static/chunks/746-ea7c3e4e69c14385.js","444","static/chunks/444-125b7b0fa8cbdb81.js","639","static/chunks/app/goals/page-794526d1e1a0856a.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/components/IdeaDetail.tsx":{"id":9534,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/components/GoalCard.tsx":{"id":2674,"name":"*","chunks":["746","static/chunks/746-ea7c3e4e69c14385.js","444","static/chunks/444-125b7b0fa8cbdb81.js","639","static/chunks/app/goals/page-794526d1e1a0856a.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/components/HypothesisCard.tsx":{"id":786,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/app/DashboardHeader.tsx":{"id":6435,"name":"*","chunks":["746","static/chunks/746-ea7c3e4e69c14385.js","931","static/chunks/app/page-fb66ff080390f20a.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/components/IdeaKanban.tsx":{"id":1214,"name":"*","chunks":["746","static/chunks/746-ea7c3e4e69c14385.js","931","static/chunks/app/page-fb66ff080390f20a.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/app/social/page.tsx":{"id":2612,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/app/settings/page.tsx":{"id":8619,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/components/RoadmapViewToggle.tsx":{"id":3032,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/luismey/Code/vibebusiness/src/":[],"/Users/luismey/Code/vibebusiness/src/app/layout":["static/css/02298496de89e16e.css"],"/Users/luismey/Code/vibebusiness/src/app/page":[],"/Users/luismey/Code/vibebusiness/src/app/goals/page":[],"/Users/luismey/Code/vibebusiness/src/app/goals/[id]/page":[]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={};e.id=639,e.ids=[639],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},4770:e=>{"use strict";e.exports=require("crypto")},2048:e=>{"use strict";e.exports=require("fs")},5315:e=>{"use strict";e.exports=require("path")},2861:(e,s,t)=>{"use strict";t.r(s),t.d(s,{GlobalError:()=>i.a,__next_app__:()=>m,originalPathname:()=>x,pages:()=>o,routeModule:()=>h,tree:()=>c}),t(6851),t(2029),t(5866);var a=t(3191),r=t(8716),l=t(7922),i=t.n(l),n=t(5231),d={};for(let e in n)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(d[e]=()=>n[e]);t.d(s,d);let c=["",{children:["goals",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(t.bind(t,6851)),"/Users/luismey/Code/vibebusiness/src/app/goals/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(t.bind(t,2029)),"/Users/luismey/Code/vibebusiness/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(t.t.bind(t,5866,23)),"next/dist/client/components/not-found-error"]}],o=["/Users/luismey/Code/vibebusiness/src/app/goals/page.tsx"],x="/goals/page",m={require:t,loadChunk:()=>Promise.resolve()},h=new a.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/goals/page",pathname:"/goals",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},8508:(e,s,t)=>{Promise.resolve().then(t.bind(t,3818)),Promise.resolve().then(t.bind(t,9973))},9973:(e,s,t)=>{"use strict";t.d(s,{default:()=>g});var a=t(326),r=t(434),l=t(7069),i=t(949),n=t(9163),d=t(6307),c=t(3468),o=t(1405),x=t(1135),m=t(9526),h=t(6087),u=t(2728);function p({status:e}){switch(e){case"on_track":return a.jsx(l.Z,{className:"w-4 h-4"});case"at_risk":return a.jsx(i.Z,{className:"w-4 h-4"});case"behind":return a.jsx(n.Z,{className:"w-4 h-4"});case"achieved":return a.jsx(d.Z,{className:"w-4 h-4"})}}function g({goal:e,compact:s=!1}){null!==e.current_value&&(e.current_value,e.target_value);let t=e.kpis.filter(e=>null!==e.current_value).length,l=e.kpis.length,i=function(e){let s=null;for(let t of e.kpis)if(t.history.length>0){let e=t.history[t.history.length-1];(!s||e.date>s)&&(s=e.date)}return s}(e);return a.jsx(r.default,{href:`/goals/${e.id}`,children:(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4 hover:border-emerald-300 hover:shadow-md transition-all cursor-pointer",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("span",{className:(0,x.Z)("inline-flex items-center gap-1.5 px-2 py-1 rounded-full text-xs font-medium border",m.i2[e.status]),children:[a.jsx(p,{status:e.status}),a.jsx("span",{children:m.tV[e.status]})]}),a.jsx("span",{className:(0,x.Z)("text-xs px-2 py-0.5 rounded-full",m.l5[e.category]),children:m.kT[e.category]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3 mb-3",children:[a.jsx("div",{className:"w-10 h-10 bg-emerald-100 rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(c.Z,{className:"w-5 h-5 text-emerald-600"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-semibold text-slate-900 text-base leading-tight mb-1",children:e.title}),!s&&a.jsx("p",{className:"text-sm text-slate-500 line-clamp-2",children:e.description})]})]}),a.jsx("div",{className:"mb-3",children:a.jsx(h.Z,{current:e.current_value,target:e.target_value,unit:e.target_unit,status:e.status})}),!s&&e.kpis.length>0&&(0,a.jsxs)("div",{className:"mb-3 space-y-2",children:[e.kpis.slice(0,2).map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-slate-500 w-28 truncate",title:e.name,children:e.name}),a.jsx("div",{className:"flex-1 h-6",children:a.jsx(u.Z,{kpi:e,height:24})}),a.jsx("span",{className:"text-xs font-medium text-slate-700 w-12 text-right",children:null!==e.current_value?`${e.current_value}${e.unit}`:"--"})]},e.id)),e.kpis.length>2&&(0,a.jsxs)("p",{className:"text-xs text-slate-400",children:["+",e.kpis.length-2," more KPIs"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-slate-100",children:[(0,a.jsxs)("span",{className:"text-xs text-slate-500",children:["Deadline: ",a.jsx("span",{className:"font-medium text-slate-700",children:e.deadline})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,a.jsxs)("span",{className:"text-xs text-slate-400 flex items-center gap-1",children:[a.jsx(o.Z,{className:"w-3 h-3"}),function(e){let s=new Date(e),t=Math.floor((new Date().getTime()-s.getTime())/6e4),a=Math.floor(t/60),r=Math.floor(a/24);return t<1?"just now":t<60?`${t} min${t>1?"s":""} ago`:a<24?`${a} hour${a>1?"s":""} ago`:r<7?`${r} day${r>1?"s":""} ago`:s.toLocaleDateString()}(i)]}),(0,a.jsxs)("span",{className:"text-xs text-slate-500",children:[t,"/",l," KPIs"]})]})]}),e.related_ideas.length>0&&a.jsx("div",{className:"mt-2 pt-2 border-t border-slate-100",children:(0,a.jsxs)("span",{className:"text-xs text-emerald-600",children:[e.related_ideas.length," linked idea",1!==e.related_ideas.length?"s":""]})})]})})}},7162:(e,s,t)=>{"use strict";t.d(s,{Z:()=>d});var a=t(1159);let r=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l=(...e)=>e.filter((e,s,t)=>!!e&&t.indexOf(e)===s).join(" ");var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,a.forwardRef)(({color:e="currentColor",size:s=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:n="",children:d,iconNode:c,...o},x)=>(0,a.createElement)("svg",{ref:x,...i,width:s,height:s,stroke:e,strokeWidth:r?24*Number(t)/Number(s):t,className:l("lucide",n),...o},[...c.map(([e,s])=>(0,a.createElement)(e,s)),...Array.isArray(d)?d:[d]])),d=(e,s)=>{let t=(0,a.forwardRef)(({className:t,...i},d)=>(0,a.createElement)(n,{ref:d,iconNode:s,className:l(`lucide-${r(e)}`,t),...i}));return t.displayName=`${e}`,t}},8648:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(7162).Z)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},9987:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(7162).Z)("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},6851:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>p,dynamic:()=>h});var a=t(9510),r=t(9987),l=t(7162);let i=(0,l.Z)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),n=(0,l.Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),d=(0,l.Z)("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);var c=t(8648),o=t(2548);let x=(0,t(8570).createProxy)(String.raw`/Users/luismey/Code/vibebusiness/src/components/GoalCard.tsx#default`);var m=t(1416);let h="force-dynamic";function u({goals:e}){let s={on_track:0,at_risk:0,behind:0,achieved:0};return e.forEach(e=>{s[e.status]++}),e.reduce((e,s)=>e+s.kpis.length,0),e.reduce((e,s)=>e+s.kpis.filter(e=>null!==e.current_value).length,0),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 mb-6",children:[(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(r.Z,{className:"w-4 h-4 text-slate-400"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"Total Goals"})]}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:e.length})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(i,{className:"w-4 h-4 text-emerald-500"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"On Track"})]}),a.jsx("p",{className:"text-2xl font-bold text-emerald-600",children:s.on_track})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(n,{className:"w-4 h-4 text-amber-500"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"At Risk"})]}),a.jsx("p",{className:"text-2xl font-bold text-amber-600",children:s.at_risk})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(d,{className:"w-4 h-4 text-red-500"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"Behind"})]}),a.jsx("p",{className:"text-2xl font-bold text-red-600",children:s.behind})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(c.Z,{className:"w-4 h-4 text-blue-500"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"Achieved"})]}),a.jsx("p",{className:"text-2xl font-bold text-blue-600",children:s.achieved})]})]})}async function p(){let e=await (0,m.M6)(),s={behind:0,at_risk:1,on_track:2,achieved:3},t=[...e].sort((e,t)=>s[e.status]-s[t.status]);return a.jsx(o.Z,{children:(0,a.jsxs)("div",{className:"p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-6",children:(0,a.jsxs)("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Business Goals"}),a.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Track OKRs and KPIs aligned with your business objectives"})]})}),a.jsx(u,{goals:e}),0===e.length?(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-12 text-center",children:[a.jsx(r.Z,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),a.jsx("h2",{className:"text-lg font-medium text-slate-900 mb-2",children:"No goals yet"}),a.jsx("p",{className:"text-sm text-slate-500 mb-4",children:"Start by creating your first business goal to track progress and align ideas."})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(e=>a.jsx(x,{goal:e},e.id))}),(0,a.jsxs)("div",{className:"mt-8 bg-slate-50 rounded-lg border border-slate-200 p-6",children:[a.jsx("h3",{className:"text-sm font-medium text-slate-900 mb-2",children:"About Business Goals"}),a.jsx("p",{className:"text-sm text-slate-600 mb-4",children:"Goals are the foundation of your improvement strategy. Each goal is tracked through Key Performance Indicators (KPIs) and linked to ideas that support its achievement."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"font-medium text-slate-700 mb-1",children:"Goals First"}),a.jsx("p",{className:"text-slate-500",children:"Define what success looks like before tracking metrics."})]}),(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"font-medium text-slate-700 mb-1",children:"KPIs Second"}),a.jsx("p",{className:"text-slate-500",children:"Choose measurable indicators that reflect goal progress."})]}),(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"font-medium text-slate-700 mb-1",children:"Ideas Aligned"}),a.jsx("p",{className:"text-slate-500",children:"Link improvement ideas to goals for focused execution."})]})]})]})]})})}},2548:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(8570).createProxy)(String.raw`/Users/luismey/Code/vibebusiness/src/components/AnalystLayout.tsx#default`)}};var s=require("../../webpack-runtime.js");s.C(e);var t=e=>s(s.s=e),a=s.X(0,[276,471,617,416,644],()=>t(2861));module.exports=a})();
|
|
1
|
+
(()=>{var e={};e.id=9639,e.ids=[9639],e.modules={2934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},4580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},5869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},4770:e=>{"use strict";e.exports=require("crypto")},2048:e=>{"use strict";e.exports=require("fs")},5315:e=>{"use strict";e.exports=require("path")},2861:(e,s,t)=>{"use strict";t.r(s),t.d(s,{GlobalError:()=>i.a,__next_app__:()=>m,originalPathname:()=>x,pages:()=>o,routeModule:()=>h,tree:()=>c}),t(6851),t(2029),t(5866);var a=t(3191),r=t(8716),l=t(7922),i=t.n(l),n=t(5231),d={};for(let e in n)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(d[e]=()=>n[e]);t.d(s,d);let c=["",{children:["goals",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(t.bind(t,6851)),"/Users/luismey/Code/vibebusiness/src/app/goals/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(t.bind(t,2029)),"/Users/luismey/Code/vibebusiness/src/app/layout.tsx"],"not-found":[()=>Promise.resolve().then(t.t.bind(t,5866,23)),"next/dist/client/components/not-found-error"]}],o=["/Users/luismey/Code/vibebusiness/src/app/goals/page.tsx"],x="/goals/page",m={require:t,loadChunk:()=>Promise.resolve()},h=new a.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/goals/page",pathname:"/goals",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:c}})},8508:(e,s,t)=>{Promise.resolve().then(t.bind(t,3818)),Promise.resolve().then(t.bind(t,9973))},9973:(e,s,t)=>{"use strict";t.d(s,{default:()=>g});var a=t(326),r=t(434),l=t(7069),i=t(949),n=t(9163),d=t(6307),c=t(3468),o=t(1405),x=t(1135),m=t(9526),h=t(6087),u=t(2728);function p({status:e}){switch(e){case"on_track":return a.jsx(l.Z,{className:"w-4 h-4"});case"at_risk":return a.jsx(i.Z,{className:"w-4 h-4"});case"behind":return a.jsx(n.Z,{className:"w-4 h-4"});case"achieved":return a.jsx(d.Z,{className:"w-4 h-4"})}}function g({goal:e,compact:s=!1}){null!==e.current_value&&(e.current_value,e.target_value);let t=e.kpis.filter(e=>null!==e.current_value).length,l=e.kpis.length,i=function(e){let s=null;for(let t of e.kpis)if(t.history.length>0){let e=t.history[t.history.length-1];(!s||e.date>s)&&(s=e.date)}return s}(e);return a.jsx(r.default,{href:`/goals/${e.id}`,children:(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4 hover:border-emerald-300 hover:shadow-md transition-all cursor-pointer",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("span",{className:(0,x.Z)("inline-flex items-center gap-1.5 px-2 py-1 rounded-full text-xs font-medium border",m.i2[e.status]),children:[a.jsx(p,{status:e.status}),a.jsx("span",{children:m.tV[e.status]})]}),a.jsx("span",{className:(0,x.Z)("text-xs px-2 py-0.5 rounded-full",m.l5[e.category]),children:m.kT[e.category]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3 mb-3",children:[a.jsx("div",{className:"w-10 h-10 bg-emerald-100 rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(c.Z,{className:"w-5 h-5 text-emerald-600"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[a.jsx("h3",{className:"font-semibold text-slate-900 text-base leading-tight mb-1",children:e.title}),!s&&a.jsx("p",{className:"text-sm text-slate-500 line-clamp-2",children:e.description})]})]}),a.jsx("div",{className:"mb-3",children:a.jsx(h.Z,{current:e.current_value,target:e.target_value,unit:e.target_unit,status:e.status})}),!s&&e.kpis.length>0&&(0,a.jsxs)("div",{className:"mb-3 space-y-2",children:[e.kpis.slice(0,2).map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-slate-500 w-28 truncate",title:e.name,children:e.name}),a.jsx("div",{className:"flex-1 h-6",children:a.jsx(u.Z,{kpi:e,height:24})}),a.jsx("span",{className:"text-xs font-medium text-slate-700 w-12 text-right",children:null!==e.current_value?`${e.current_value}${e.unit}`:"--"})]},e.id)),e.kpis.length>2&&(0,a.jsxs)("p",{className:"text-xs text-slate-400",children:["+",e.kpis.length-2," more KPIs"]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-slate-100",children:[(0,a.jsxs)("span",{className:"text-xs text-slate-500",children:["Deadline: ",a.jsx("span",{className:"font-medium text-slate-700",children:e.deadline})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[i&&(0,a.jsxs)("span",{className:"text-xs text-slate-400 flex items-center gap-1",children:[a.jsx(o.Z,{className:"w-3 h-3"}),function(e){let s=new Date(e),t=Math.floor((new Date().getTime()-s.getTime())/6e4),a=Math.floor(t/60),r=Math.floor(a/24);return t<1?"just now":t<60?`${t} min${t>1?"s":""} ago`:a<24?`${a} hour${a>1?"s":""} ago`:r<7?`${r} day${r>1?"s":""} ago`:s.toLocaleDateString()}(i)]}),(0,a.jsxs)("span",{className:"text-xs text-slate-500",children:[t,"/",l," KPIs"]})]})]}),e.related_ideas.length>0&&a.jsx("div",{className:"mt-2 pt-2 border-t border-slate-100",children:(0,a.jsxs)("span",{className:"text-xs text-emerald-600",children:[e.related_ideas.length," linked idea",1!==e.related_ideas.length?"s":""]})})]})})}},7162:(e,s,t)=>{"use strict";t.d(s,{Z:()=>d});var a=t(1159);let r=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l=(...e)=>e.filter((e,s,t)=>!!e&&t.indexOf(e)===s).join(" ");var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let n=(0,a.forwardRef)(({color:e="currentColor",size:s=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:n="",children:d,iconNode:c,...o},x)=>(0,a.createElement)("svg",{ref:x,...i,width:s,height:s,stroke:e,strokeWidth:r?24*Number(t)/Number(s):t,className:l("lucide",n),...o},[...c.map(([e,s])=>(0,a.createElement)(e,s)),...Array.isArray(d)?d:[d]])),d=(e,s)=>{let t=(0,a.forwardRef)(({className:t,...i},d)=>(0,a.createElement)(n,{ref:d,iconNode:s,className:l(`lucide-${r(e)}`,t),...i}));return t.displayName=`${e}`,t}},8648:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(7162).Z)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},9987:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(7162).Z)("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},6851:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>p,dynamic:()=>h});var a=t(9510),r=t(9987),l=t(7162);let i=(0,l.Z)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),n=(0,l.Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),d=(0,l.Z)("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);var c=t(8648),o=t(2548);let x=(0,t(8570).createProxy)(String.raw`/Users/luismey/Code/vibebusiness/src/components/GoalCard.tsx#default`);var m=t(534);let h="force-dynamic";function u({goals:e}){let s={on_track:0,at_risk:0,behind:0,achieved:0};return e.forEach(e=>{s[e.status]++}),e.reduce((e,s)=>e+s.kpis.length,0),e.reduce((e,s)=>e+s.kpis.filter(e=>null!==e.current_value).length,0),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 mb-6",children:[(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(r.Z,{className:"w-4 h-4 text-slate-400"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"Total Goals"})]}),a.jsx("p",{className:"text-2xl font-bold text-slate-900",children:e.length})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(i,{className:"w-4 h-4 text-emerald-500"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"On Track"})]}),a.jsx("p",{className:"text-2xl font-bold text-emerald-600",children:s.on_track})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(n,{className:"w-4 h-4 text-amber-500"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"At Risk"})]}),a.jsx("p",{className:"text-2xl font-bold text-amber-600",children:s.at_risk})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(d,{className:"w-4 h-4 text-red-500"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"Behind"})]}),a.jsx("p",{className:"text-2xl font-bold text-red-600",children:s.behind})]}),(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx(c.Z,{className:"w-4 h-4 text-blue-500"}),a.jsx("span",{className:"text-xs text-slate-500 uppercase font-medium",children:"Achieved"})]}),a.jsx("p",{className:"text-2xl font-bold text-blue-600",children:s.achieved})]})]})}async function p(){let e=await (0,m.M6)(),s={behind:0,at_risk:1,on_track:2,achieved:3},t=[...e].sort((e,t)=>s[e.status]-s[t.status]);return a.jsx(o.Z,{children:(0,a.jsxs)("div",{className:"p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-6",children:(0,a.jsxs)("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-slate-900",children:"Business Goals"}),a.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Track OKRs and KPIs aligned with your business objectives"})]})}),a.jsx(u,{goals:e}),0===e.length?(0,a.jsxs)("div",{className:"bg-white rounded-lg border border-slate-200 p-12 text-center",children:[a.jsx(r.Z,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),a.jsx("h2",{className:"text-lg font-medium text-slate-900 mb-2",children:"No goals yet"}),a.jsx("p",{className:"text-sm text-slate-500 mb-4",children:"Start by creating your first business goal to track progress and align ideas."})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(e=>a.jsx(x,{goal:e},e.id))}),(0,a.jsxs)("div",{className:"mt-8 bg-slate-50 rounded-lg border border-slate-200 p-6",children:[a.jsx("h3",{className:"text-sm font-medium text-slate-900 mb-2",children:"About Business Goals"}),a.jsx("p",{className:"text-sm text-slate-600 mb-4",children:"Goals are the foundation of your improvement strategy. Each goal is tracked through Key Performance Indicators (KPIs) and linked to ideas that support its achievement."}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"font-medium text-slate-700 mb-1",children:"Goals First"}),a.jsx("p",{className:"text-slate-500",children:"Define what success looks like before tracking metrics."})]}),(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"font-medium text-slate-700 mb-1",children:"KPIs Second"}),a.jsx("p",{className:"text-slate-500",children:"Choose measurable indicators that reflect goal progress."})]}),(0,a.jsxs)("div",{children:[a.jsx("h4",{className:"font-medium text-slate-700 mb-1",children:"Ideas Aligned"}),a.jsx("p",{className:"text-slate-500",children:"Link improvement ideas to goals for focused execution."})]})]})]})]})})}},2548:(e,s,t)=>{"use strict";t.d(s,{Z:()=>a});let a=(0,t(8570).createProxy)(String.raw`/Users/luismey/Code/vibebusiness/src/components/AnalystLayout.tsx#default`)}};var s=require("../../webpack-runtime.js");s.C(e);var t=e=>s(s.s=e),a=s.X(0,[9276,4471,4376,534,3644],()=>t(2861));module.exports=a})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"files":["../../../../data/.analysis-prompt.txt","../../../../data/.gitkeep","../../../../data/business-context.json","../../../../data/codebase-snapshot.json","../../../../data/competitors.json","../../../../data/config.json","../../../../data/email-campaigns/sequences/onboarding.md","../../../../data/email-campaigns/welcome-2026-02-20.md","../../../../data/goals.json","../../../../data/heartbeat-sessions.json","../../../../data/hypotheses.json","../../../../data/ideas.json","../../../../data/implementations.json","../../../../data/pages.json","../../../../data/positioning.json","../../../../data/roadmap.json","../../../../data/sessions.json","../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../node_modules/next/package.json","../../../../package.json","../../../package.json","../../chunks/
|
|
1
|
+
{"version":1,"files":["../../../../data/.DS_Store","../../../../data/.analysis-prompt.txt","../../../../data/.gitkeep","../../../../data/business-context.json","../../../../data/codebase-snapshot.json","../../../../data/competitors.json","../../../../data/config.json","../../../../data/email-campaigns/sequences/onboarding.md","../../../../data/email-campaigns/welcome-2026-02-20.md","../../../../data/goals.json","../../../../data/heartbeat-sessions.json","../../../../data/hypotheses.json","../../../../data/ideas.json","../../../../data/implementations.json","../../../../data/pages.json","../../../../data/payments.json","../../../../data/positioning.json","../../../../data/roadmap.json","../../../../data/sessions.json","../../../../data/social.json","../../../../node_modules/next/dist/client/components/action-async-storage-instance.js","../../../../node_modules/next/dist/client/components/action-async-storage.external.js","../../../../node_modules/next/dist/client/components/async-local-storage.js","../../../../node_modules/next/dist/client/components/request-async-storage-instance.js","../../../../node_modules/next/dist/client/components/request-async-storage.external.js","../../../../node_modules/next/dist/client/components/static-generation-async-storage-instance.js","../../../../node_modules/next/dist/client/components/static-generation-async-storage.external.js","../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../node_modules/next/package.json","../../../../package.json","../../../package.json","../../chunks/3644.js","../../chunks/4376.js","../../chunks/4471.js","../../chunks/534.js","../../chunks/9276.js","../../webpack-runtime.js","page_client-reference-manifest.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/goals/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"47":{"*":{"id":"4812","name":"*","chunks":[],"async":false}},"80":{"*":{"id":"1868","name":"*","chunks":[],"async":false}},"
|
|
1
|
+
globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/goals/page"]={"moduleLoading":{"prefix":"/_next/","crossOrigin":null},"ssrModuleMapping":{"47":{"*":{"id":"4812","name":"*","chunks":[],"async":false}},"80":{"*":{"id":"1868","name":"*","chunks":[],"async":false}},"786":{"*":{"id":"1855","name":"*","chunks":[],"async":false}},"1060":{"*":{"id":"9727","name":"*","chunks":[],"async":false}},"1214":{"*":{"id":"4663","name":"*","chunks":[],"async":false}},"1259":{"*":{"id":"3818","name":"*","chunks":[],"async":false}},"2612":{"*":{"id":"3305","name":"*","chunks":[],"async":false}},"2674":{"*":{"id":"9973","name":"*","chunks":[],"async":false}},"2846":{"*":{"id":"2994","name":"*","chunks":[],"async":false}},"3032":{"*":{"id":"1828","name":"*","chunks":[],"async":false}},"4553":{"*":{"id":"8022","name":"*","chunks":[],"async":false}},"4707":{"*":{"id":"9671","name":"*","chunks":[],"async":false}},"6423":{"*":{"id":"4759","name":"*","chunks":[],"async":false}},"6435":{"*":{"id":"6663","name":"*","chunks":[],"async":false}},"8619":{"*":{"id":"5467","name":"*","chunks":[],"async":false}},"8935":{"*":{"id":"1358","name":"*","chunks":[],"async":false}},"9107":{"*":{"id":"6114","name":"*","chunks":[],"async":false}},"9534":{"*":{"id":"9616","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/app-router.js":{"id":2846,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/app-router.js":{"id":2846,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/client-page.js":{"id":9107,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/client-page.js":{"id":9107,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/error-boundary.js":{"id":1060,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/error-boundary.js":{"id":1060,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/layout-router.js":{"id":4707,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/not-found-boundary.js":{"id":80,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/client/components/render-from-template-context.js":{"id":6423,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":6423,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/app/globals.css":{"id":2778,"name":"*","chunks":["185","static/chunks/app/layout-eeef7928298d2198.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/app/hypotheses/[id]/page.tsx":{"id":4553,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/app/goals/[id]/page.tsx":{"id":8935,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/app/roadmap/[id]/page.tsx":{"id":47,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/components/AnalystLayout.tsx":{"id":1259,"name":"*","chunks":["746","static/chunks/746-ea7c3e4e69c14385.js","444","static/chunks/444-125b7b0fa8cbdb81.js","639","static/chunks/app/goals/page-794526d1e1a0856a.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/components/IdeaDetail.tsx":{"id":9534,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/components/GoalCard.tsx":{"id":2674,"name":"*","chunks":["746","static/chunks/746-ea7c3e4e69c14385.js","444","static/chunks/444-125b7b0fa8cbdb81.js","639","static/chunks/app/goals/page-794526d1e1a0856a.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/components/HypothesisCard.tsx":{"id":786,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/app/DashboardHeader.tsx":{"id":6435,"name":"*","chunks":["746","static/chunks/746-ea7c3e4e69c14385.js","931","static/chunks/app/page-fb66ff080390f20a.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/components/IdeaKanban.tsx":{"id":1214,"name":"*","chunks":["746","static/chunks/746-ea7c3e4e69c14385.js","931","static/chunks/app/page-fb66ff080390f20a.js"],"async":false},"/Users/luismey/Code/vibebusiness/src/app/social/page.tsx":{"id":2612,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/app/settings/page.tsx":{"id":8619,"name":"*","chunks":[],"async":false},"/Users/luismey/Code/vibebusiness/src/components/RoadmapViewToggle.tsx":{"id":3032,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/luismey/Code/vibebusiness/src/":[],"/Users/luismey/Code/vibebusiness/src/app/layout":["static/css/02298496de89e16e.css"],"/Users/luismey/Code/vibebusiness/src/app/page":[],"/Users/luismey/Code/vibebusiness/src/app/goals/page":[]}}
|