claudeship 0.2.15 → 0.2.17
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/apps/server/package.json +1 -1
- package/apps/server/prisma/dev.db +0 -0
- package/apps/web/.env.local +1 -0
- package/apps/web/.next/BUILD_ID +1 -1
- package/apps/web/.next/app-build-manifest.json +3 -3
- package/apps/web/.next/build-manifest.json +2 -2
- package/apps/web/.next/cache/.previewinfo +1 -1
- package/apps/web/.next/cache/.rscinfo +1 -1
- package/apps/web/.next/cache/config.json +3 -3
- package/apps/web/.next/cache/eslint/.cache_j3uhuz +1 -1
- package/apps/web/.next/cache/webpack/client-production/0.pack +0 -0
- package/apps/web/.next/cache/webpack/client-production/index.pack +0 -0
- package/apps/web/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/apps/web/.next/cache/webpack/server-production/0.pack +0 -0
- package/apps/web/.next/cache/webpack/server-production/index.pack +0 -0
- package/apps/web/.next/prerender-manifest.json +10 -10
- package/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/_not-found.html +1 -1
- package/apps/web/.next/server/app/_not-found.rsc +1 -1
- package/apps/web/.next/server/app/index.html +1 -1
- package/apps/web/.next/server/app/index.rsc +2 -2
- package/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/project/[id]/page.js +1 -1
- package/apps/web/.next/server/app/project/[id]/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/settings.html +1 -1
- package/apps/web/.next/server/app/settings.rsc +2 -2
- package/apps/web/.next/server/chunks/392.js +1 -1
- package/apps/web/.next/server/pages/404.html +1 -1
- package/apps/web/.next/server/pages/500.html +1 -1
- package/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/apps/web/.next/static/chunks/app/page-8310956d8eae9762.js +1 -0
- package/apps/web/.next/static/chunks/app/project/[id]/page-c28098a9b8a94336.js +1 -0
- package/apps/web/.next/static/chunks/app/settings/page-3532fad509d55b77.js +1 -0
- package/apps/web/.next/trace +18 -18
- package/apps/web/package.json +1 -1
- package/package.json +2 -2
- package/scripts/setup.sh +126 -0
- package/apps/web/.next/static/chunks/app/page-f19cfa58541ca83d.js +0 -1
- package/apps/web/.next/static/chunks/app/project/[id]/page-dffaa1d02f012216.js +0 -1
- package/apps/web/.next/static/chunks/app/settings/page-d1318c2fd58729a5.js +0 -1
- package/scripts/setup-hooks.sh +0 -26
- /package/apps/web/.next/static/{mkY_TTl_ho_ehDKiX10AN → 64f6wJ9i280wH8tny9WCd}/_buildManifest.js +0 -0
- /package/apps/web/.next/static/{mkY_TTl_ho_ehDKiX10AN → 64f6wJ9i280wH8tny9WCd}/_ssgManifest.js +0 -0
package/apps/web/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudeship",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.17",
|
|
4
4
|
"description": "AI-Powered App Builder using Claude Code CLI",
|
|
5
5
|
"bin": {
|
|
6
6
|
"claudeship": "./bin/claudeship.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"prepare": "bash scripts/setup
|
|
9
|
+
"prepare": "bash scripts/setup.sh || true",
|
|
10
10
|
"dev": "node scripts/dev.js",
|
|
11
11
|
"dev:parallel": "pnpm run --parallel dev",
|
|
12
12
|
"dev:web": "pnpm --filter @claudeship/web dev",
|
package/scripts/setup.sh
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# 프로젝트 초기 설정 스크립트
|
|
4
|
+
# - Git hooks 설치
|
|
5
|
+
# - .env 파일 생성
|
|
6
|
+
# - Prisma 데이터베이스 설정
|
|
7
|
+
|
|
8
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
|
+
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
10
|
+
HOOKS_DIR="$SCRIPT_DIR/hooks"
|
|
11
|
+
|
|
12
|
+
echo "=========================================="
|
|
13
|
+
echo " Claudeship 프로젝트 초기 설정"
|
|
14
|
+
echo "=========================================="
|
|
15
|
+
echo ""
|
|
16
|
+
|
|
17
|
+
# ===========================================
|
|
18
|
+
# 1. Git hooks 설치
|
|
19
|
+
# ===========================================
|
|
20
|
+
setup_git_hooks() {
|
|
21
|
+
GIT_HOOKS_DIR="$(git rev-parse --git-dir 2>/dev/null)/hooks"
|
|
22
|
+
|
|
23
|
+
if [ ! -d "$GIT_HOOKS_DIR" ]; then
|
|
24
|
+
echo "⚠️ Git 저장소가 아닙니다. Git hooks 설치를 건너뜁니다."
|
|
25
|
+
return
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
echo "📌 Git hooks 설치 중..."
|
|
29
|
+
|
|
30
|
+
for hook in "$HOOKS_DIR"/*; do
|
|
31
|
+
if [ -f "$hook" ]; then
|
|
32
|
+
hook_name=$(basename "$hook")
|
|
33
|
+
cp "$hook" "$GIT_HOOKS_DIR/$hook_name"
|
|
34
|
+
chmod +x "$GIT_HOOKS_DIR/$hook_name"
|
|
35
|
+
echo " ✓ $hook_name"
|
|
36
|
+
fi
|
|
37
|
+
done
|
|
38
|
+
|
|
39
|
+
echo " 완료!"
|
|
40
|
+
echo ""
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# ===========================================
|
|
44
|
+
# 2. .env 파일 생성
|
|
45
|
+
# ===========================================
|
|
46
|
+
setup_env_files() {
|
|
47
|
+
echo "📌 환경 설정 파일(.env) 확인 중..."
|
|
48
|
+
|
|
49
|
+
local env_created=false
|
|
50
|
+
|
|
51
|
+
# apps/server/.env
|
|
52
|
+
if [ ! -f "$ROOT_DIR/apps/server/.env" ]; then
|
|
53
|
+
if [ -f "$ROOT_DIR/apps/server/.env.example" ]; then
|
|
54
|
+
cp "$ROOT_DIR/apps/server/.env.example" "$ROOT_DIR/apps/server/.env"
|
|
55
|
+
echo " ✓ apps/server/.env 생성됨"
|
|
56
|
+
env_created=true
|
|
57
|
+
fi
|
|
58
|
+
else
|
|
59
|
+
echo " - apps/server/.env 이미 존재함"
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
# apps/web/.env.local (있으면)
|
|
63
|
+
if [ ! -f "$ROOT_DIR/apps/web/.env.local" ]; then
|
|
64
|
+
if [ -f "$ROOT_DIR/apps/web/.env.local.example" ]; then
|
|
65
|
+
cp "$ROOT_DIR/apps/web/.env.local.example" "$ROOT_DIR/apps/web/.env.local"
|
|
66
|
+
echo " ✓ apps/web/.env.local 생성됨"
|
|
67
|
+
env_created=true
|
|
68
|
+
fi
|
|
69
|
+
else
|
|
70
|
+
echo " - apps/web/.env.local 이미 존재함"
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
if [ "$env_created" = true ]; then
|
|
74
|
+
echo ""
|
|
75
|
+
echo " 💡 생성된 .env 파일을 확인하고 필요한 값을 설정하세요."
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
echo " 완료!"
|
|
79
|
+
echo ""
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# ===========================================
|
|
83
|
+
# 3. Prisma 데이터베이스 설정
|
|
84
|
+
# ===========================================
|
|
85
|
+
setup_database() {
|
|
86
|
+
echo "📌 데이터베이스 설정 중..."
|
|
87
|
+
|
|
88
|
+
local server_dir="$ROOT_DIR/apps/server"
|
|
89
|
+
|
|
90
|
+
if [ ! -f "$server_dir/.env" ]; then
|
|
91
|
+
echo " ⚠️ .env 파일이 없습니다. 데이터베이스 설정을 건너뜁니다."
|
|
92
|
+
return
|
|
93
|
+
fi
|
|
94
|
+
|
|
95
|
+
# pnpm이 설치되어 있는지 확인
|
|
96
|
+
if ! command -v pnpm &> /dev/null; then
|
|
97
|
+
echo " ⚠️ pnpm이 설치되어 있지 않습니다. 데이터베이스 설정을 건너뜁니다."
|
|
98
|
+
return
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# Prisma 클라이언트 생성 및 DB 푸시
|
|
102
|
+
cd "$server_dir"
|
|
103
|
+
pnpm prisma generate > /dev/null 2>&1
|
|
104
|
+
pnpm prisma db push > /dev/null 2>&1
|
|
105
|
+
|
|
106
|
+
if [ $? -eq 0 ]; then
|
|
107
|
+
echo " ✓ 데이터베이스 스키마 적용됨"
|
|
108
|
+
else
|
|
109
|
+
echo " ⚠️ 데이터베이스 설정 실패. 수동으로 'pnpm prisma db push'를 실행하세요."
|
|
110
|
+
fi
|
|
111
|
+
|
|
112
|
+
cd "$ROOT_DIR"
|
|
113
|
+
echo " 완료!"
|
|
114
|
+
echo ""
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
# ===========================================
|
|
118
|
+
# 실행
|
|
119
|
+
# ===========================================
|
|
120
|
+
setup_git_hooks
|
|
121
|
+
setup_env_files
|
|
122
|
+
setup_database
|
|
123
|
+
|
|
124
|
+
echo "=========================================="
|
|
125
|
+
echo " ✅ 초기 설정 완료!"
|
|
126
|
+
echo "=========================================="
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{559:(e,t,r)=>{Promise.resolve().then(r.bind(r,8028))},660:(e,t,r)=>{"use strict";r.d(t,{F:()=>o});let a=r(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api";async function s(e,t){let r="".concat(a).concat(e),s=await fetch(r,{...t,headers:{"Content-Type":"application/json",...null==t?void 0:t.headers}});if(!s.ok)throw Error((await s.json().catch(()=>({message:"Request failed"}))).message||"HTTP error! status: ".concat(s.status));if(204!==s.status)return s.json()}let o={get:e=>s(e),post:(e,t)=>s(e,{method:"POST",body:t?JSON.stringify(t):void 0}),put:(e,t)=>s(e,{method:"PUT",body:t?JSON.stringify(t):void 0}),delete:(e,t)=>s(e,{method:"DELETE",body:t?JSON.stringify(t):void 0}),uploadFiles:async(e,t)=>{let r=new FormData;t.forEach(e=>r.append("files",e));let s="".concat(a,"/projects/").concat(e,"/files/upload"),o=await fetch(s,{method:"POST",body:r});if(!o.ok)throw Error((await o.json().catch(()=>({message:"Upload failed"}))).message||"HTTP error! status: ".concat(o.status));return o.json()}}},3300:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(8964).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},3792:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(8964).A)("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]])},3973:(e,t,r)=>{"use strict";var a=r(6145);r.o(a,"useParams")&&r.d(t,{useParams:function(){return a.useParams}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}})},4264:(e,t,r)=>{"use strict";r.d(t,{I:()=>o});var a=r(4876),s=r(660);let o=(0,a.v)((e,t)=>({projects:[],currentProject:null,isLoading:!1,error:null,fetchProjects:async()=>{e({isLoading:!0,error:null});try{let t=await s.F.get("/projects");e({projects:t,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch projects",isLoading:!1})}},createProject:async t=>{e({isLoading:!0,error:null});try{let r=await s.F.post("/projects",t);return e(e=>({projects:[{id:r.id,name:r.name,projectType:r.projectType,backendFramework:r.backendFramework,updatedAt:r.updatedAt},...e.projects],isLoading:!1})),r}catch(t){throw e({error:t instanceof Error?t.message:"Failed to create project",isLoading:!1}),t}},deleteProject:async t=>{e({isLoading:!0,error:null});try{await s.F.delete("/projects/".concat(t)),e(e=>({projects:e.projects.filter(e=>e.id!==t),isLoading:!1}))}catch(t){throw e({error:t instanceof Error?t.message:"Failed to delete project",isLoading:!1}),t}},fetchProject:async t=>{e({isLoading:!0,error:null});try{let r=await s.F.get("/projects/".concat(t));e({currentProject:r,isLoading:!1})}catch(t){e({error:t instanceof Error?t.message:"Failed to fetch project",isLoading:!1})}},setCurrentProject:t=>e({currentProject:t}),clearError:()=>e({error:null})}))},4539:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(8964).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},4859:(e,t,r)=>{"use strict";r.d(t,{V_:()=>s,gM:()=>a,Xh:()=>o});var a=function(e){return e.WEB="WEB",e.NATIVE="NATIVE",e}({}),s=function(e){return e.NONE="NONE",e.EXPRESS="EXPRESS",e.FASTAPI="FASTAPI",e}({}),o=function(e){return e.USER="USER",e.ASSISTANT="ASSISTANT",e.SYSTEM="SYSTEM",e}({})},5338:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var a=r(8481),s=r(8526),o=r(9049);let n=s.forwardRef((e,t)=>{let{className:r,type:s,...n}=e;return(0,a.jsx)("input",{type:s,className:(0,o.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...n})});n.displayName="Input"},5594:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var a=r(8481),s=r(8526),o=r(4176),n=r(9049);let i=(0,o.F)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),l=s.forwardRef((e,t)=>{let{className:r,variant:s,size:o,...l}=e;return(0,a.jsx)("button",{className:(0,n.cn)(i({variant:s,size:o,className:r})),ref:t,...l})});l.displayName="Button"},6224:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});let a=(0,r(8964).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},7176:(e,t,r)=>{"use strict";r.d(t,{Y:()=>u});var a=r(8481),s=r(4816),o=r.n(s),n=r(9432),i=r(9150),l=r(7746),c=r(5594),d=r(9426);function p(){let{locale:e,setLocale:t,t:r}=(0,d.B)();return(0,a.jsx)(c.$,{variant:"ghost",size:"icon",onClick:()=>{t("en"===e?"ko":"en")},className:"h-9 w-9 text-xs font-medium",title:r("language.select"),children:"en"===e?"EN":"KO"})}function u(e){let{title:t,showBack:r,backHref:s="/"}=e,{t:u}=(0,d.B)(),m=t||u("common.appName");return(0,a.jsx)("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:(0,a.jsxs)("div",{className:"flex h-14 w-full items-center justify-between px-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[r?(0,a.jsx)(o(),{href:s,children:(0,a.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",children:(0,a.jsx)(i.A,{className:"h-5 w-5"})})}):(0,a.jsx)(n.default,{src:"/logo.svg",alt:"ClaudeShip",width:36,height:36,className:"rounded-lg"}),(0,a.jsx)("h1",{className:"text-lg font-semibold",children:m})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(p,{}),(0,a.jsx)(o(),{href:"/settings",children:(0,a.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",title:u("header.settings"),children:(0,a.jsx)(l.A,{className:"h-5 w-5"})})})]})]})})}},8028:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>R});var a=r(8481),s=r(8526),o=r(3973),n=r(7176),i=r(4816),l=r.n(i),c=r(6224),d=r(3792),p=r(3300),u=r(8964);let m=(0,u.A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var h=r(9049);let g=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("rounded-xl border bg-card text-card-foreground shadow",r),...s})});g.displayName="Card",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("flex flex-col space-y-1.5 p-6",r),...s})}).displayName="CardHeader",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("h3",{ref:t,className:(0,h.cn)("font-semibold leading-none tracking-tight",r),...s})}).displayName="CardTitle",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("p",{ref:t,className:(0,h.cn)("text-sm text-muted-foreground",r),...s})}).displayName="CardDescription",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("p-6 pt-0",r),...s})}).displayName="CardContent",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("flex items-center p-6 pt-0",r),...s})}).displayName="CardFooter";var x=r(5594),f=r(4859),j=r(9426);function y(e){var t;let{project:r,onDelete:s}=e,{locale:o}=(0,j.B)(),n=(r.projectType,(t=r.backendFramework)===f.V_.EXPRESS?"from-green-500/20 to-emerald-500/5":t===f.V_.FASTAPI?"from-teal-500/20 to-cyan-500/5":"from-blue-500/20 to-indigo-500/5");return(0,a.jsx)(l(),{href:"/project/".concat(r.id),children:(0,a.jsxs)(g,{className:"group relative cursor-pointer overflow-hidden border transition-all hover:border-primary/50 hover:shadow-lg",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br ".concat(n," opacity-0 transition-opacity group-hover:opacity-100")}),(0,a.jsxs)("div",{className:"relative p-4",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary",children:function(e){switch(e){case f.gM.WEB:return(0,a.jsx)(c.A,{className:"h-5 w-5"});case f.gM.NATIVE:return(0,a.jsx)(d.A,{className:"h-5 w-5"});default:return(0,a.jsx)(c.A,{className:"h-5 w-5"})}}(r.projectType)}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h3",{className:"truncate font-semibold",children:r.name}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:function(e,t){let r=new Date().getTime()-new Date(e).getTime(),a=Math.floor(r/6e4),s=Math.floor(r/36e5),o=Math.floor(r/864e5);return"ko"===t?a<1?"방금 전":a<60?"".concat(a,"분 전"):s<24?"".concat(s,"시간 전"):o<7?"".concat(o,"일 전"):new Date(e).toLocaleDateString("ko-KR"):a<1?"Just now":a<60?"".concat(a,"m ago"):s<24?"".concat(s,"h ago"):o<7?"".concat(o,"d ago"):new Date(e).toLocaleDateString("en-US")}(r.updatedAt,o)})]})]}),s&&(0,a.jsx)(x.$,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 opacity-0 transition-opacity group-hover:opacity-100",onClick:e=>{e.preventDefault(),e.stopPropagation(),s(r.id)},children:(0,a.jsx)(p.A,{className:"h-4 w-4 text-destructive"})})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.backendFramework!==f.V_.NONE&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium",children:[(0,a.jsx)(m,{className:"h-3 w-3"}),r.backendFramework===f.V_.EXPRESS?"Express":"FastAPI"]}),(0,a.jsx)("span",{className:"rounded-full bg-secondary px-2.5 py-0.5 text-xs text-muted-foreground",children:r.projectType===f.gM.WEB?"Web":"Native"})]})]})]})})}var N=r(4539);let v=(0,u.A)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);function b(e){let{onClick:t}=e,{t:r}=(0,j.B)();return(0,a.jsxs)(g,{className:"group relative cursor-pointer overflow-hidden border-2 border-dashed transition-all hover:border-primary hover:shadow-lg",onClick:t,children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/10 to-primary/5 opacity-0 transition-opacity group-hover:opacity-100"}),(0,a.jsxs)("div",{className:"relative flex h-full min-h-[140px] flex-col items-center justify-center gap-3 p-6",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-xl bg-primary/10 transition-colors group-hover:bg-primary/20",children:(0,a.jsx)(N.A,{className:"h-6 w-6 text-primary transition-transform group-hover:scale-110"})}),(0,a.jsx)(v,{className:"absolute -right-1 -top-1 h-4 w-4 text-primary opacity-0 transition-opacity group-hover:opacity-100"})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("span",{className:"font-medium text-muted-foreground transition-colors group-hover:text-foreground",children:r("project.create")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground/70",children:r("project.createDescription")})]})]})]})}function w(e){let{projects:t,onCreateClick:r,onDelete:s}=e;return(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[t.map(e=>(0,a.jsx)(y,{project:e,onDelete:s},e.id)),(0,a.jsx)(b,{onClick:r})]})}let k=e=>{let{open:t,onOpenChange:r,children:s}=e;return t?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"fixed inset-0 bg-black/80",onClick:()=>null==r?void 0:r(!1)}),s]}):null},E=s.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,a.jsx)("div",{ref:t,className:(0,h.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:rounded-lg",r),onClick:e=>e.stopPropagation(),...o,children:s})});E.displayName="DialogContent";let S=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,h.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};S.displayName="DialogHeader";let A=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,h.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};A.displayName="DialogFooter";let P=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("h2",{ref:t,className:(0,h.cn)("text-lg font-semibold leading-none tracking-tight",r),...s})});P.displayName="DialogTitle";let C=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("p",{ref:t,className:(0,h.cn)("text-sm text-muted-foreground",r),...s})});C.displayName="DialogDescription";var F=r(5338);function T(e){let{open:t,onOpenChange:r,onSubmit:o,isLoading:n}=e,{t:i}=(0,j.B)(),[l,c]=(0,s.useState)(""),[d,p]=(0,s.useState)(f.gM.WEB),[u,m]=(0,s.useState)(f.V_.NONE);return(0,a.jsx)(k,{open:t,onOpenChange:r,children:(0,a.jsx)(E,{className:"max-w-lg",children:(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),l.trim()&&(o({name:l.trim(),projectType:d,backendFramework:u}),c(""),p(f.gM.WEB),m(f.V_.NONE))},children:[(0,a.jsxs)(S,{children:[(0,a.jsx)(P,{children:i("project.createTitle")}),(0,a.jsx)(C,{children:i("project.name")})]}),(0,a.jsxs)("div",{className:"grid gap-4 py-4",children:[(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)("label",{htmlFor:"name",className:"text-sm font-medium",children:i("project.name")}),(0,a.jsx)(F.p,{id:"name",value:l,onChange:e=>c(e.target.value),placeholder:i("project.namePlaceholder"),autoFocus:!0})]}),(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:i("project.type")}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsxs)(x.$,{type:"button",variant:d===f.gM.WEB?"default":"outline",className:"h-16 flex-col gap-1",onClick:()=>p(f.gM.WEB),children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83C\uDF10"}),(0,a.jsx)("span",{className:"text-xs",children:i("project.typeWeb")})]}),(0,a.jsxs)(x.$,{type:"button",variant:d===f.gM.NATIVE?"default":"outline",className:"h-16 flex-col gap-1",onClick:()=>p(f.gM.NATIVE),children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83D\uDCF1"}),(0,a.jsx)("span",{className:"text-xs",children:i("project.typeNative")})]})]})]}),d===f.gM.WEB&&(0,a.jsxs)("div",{className:"grid gap-2",children:[(0,a.jsx)("label",{className:"text-sm font-medium",children:i("project.backendStack")}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,a.jsxs)(x.$,{type:"button",variant:u===f.V_.NONE?"default":"outline",className:"h-20 flex-col gap-1",onClick:()=>m(f.V_.NONE),children:[(0,a.jsx)("span",{className:"text-lg",children:"⚡"}),(0,a.jsx)("span",{className:"text-xs text-center leading-tight",children:i("project.backendNone")})]}),(0,a.jsxs)(x.$,{type:"button",variant:u===f.V_.EXPRESS?"default":"outline",className:"h-20 flex-col gap-1",onClick:()=>m(f.V_.EXPRESS),children:[(0,a.jsx)("span",{className:"text-lg",children:"\uD83D\uDFE2"}),(0,a.jsxs)("span",{className:"text-xs text-center leading-tight",children:["Express",(0,a.jsx)("br",{}),"(Node.js)"]})]}),(0,a.jsxs)(x.$,{type:"button",variant:u===f.V_.FASTAPI?"default":"outline",className:"h-20 flex-col gap-1",onClick:()=>m(f.V_.FASTAPI),children:[(0,a.jsx)("span",{className:"text-lg",children:"\uD83D\uDC0D"}),(0,a.jsxs)("span",{className:"text-xs text-center leading-tight",children:["FastAPI",(0,a.jsx)("br",{}),"(Python)"]})]})]})]})]}),(0,a.jsxs)(A,{children:[(0,a.jsx)(x.$,{type:"button",variant:"outline",onClick:()=>r(!1),children:i("common.cancel")}),(0,a.jsx)(x.$,{type:"submit",disabled:!l.trim()||n,children:i(n?"common.loading":"common.create")})]})]})})})}var D=r(4264);function R(){let e=(0,o.useRouter)(),{t}=(0,j.B)(),[r,i]=(0,s.useState)(!1),{projects:l,isLoading:c,fetchProjects:d,createProject:p,deleteProject:u}=(0,D.I)();(0,s.useEffect)(()=>{d()},[d]);let m=async t=>{try{let r=await p(t);i(!1),e.push("/project/".concat(r.id))}catch(e){console.error("Failed to create project:",e)}},h=async e=>{if(confirm(t("project.deleteConfirm")))try{await u(e)}catch(e){console.error("Failed to delete project:",e)}};return(0,a.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,a.jsx)(n.Y,{}),(0,a.jsxs)("main",{className:"container px-4 py-8",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold",children:t("home.title")}),(0,a.jsx)("p",{className:"mt-1 text-muted-foreground",children:0===l.length?t("home.createFirst"):"".concat(l.length," ").concat(1===l.length?"project":"projects")})]}),c&&0===l.length?(0,a.jsx)("div",{className:"flex h-40 items-center justify-center text-muted-foreground",children:t("common.loading")}):(0,a.jsx)(w,{projects:l,onCreateClick:()=>i(!0),onDelete:h})]}),(0,a.jsx)(T,{open:r,onOpenChange:i,onSubmit:m,isLoading:c})]})}},9049:(e,t,r)=>{"use strict";r.d(t,{cn:()=>o});var a=r(5806),s=r(4159);function o(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.QP)((0,a.$)(t))}},9426:(e,t,r)=>{"use strict";r.d(t,{B:()=>i});var a=r(4876),s=r(1203);let o={en:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"Loading...","error":"Error","save":"Save","cancel":"Cancel","delete":"Delete","create":"Create","close":"Close","refresh":"Refresh","settings":"Settings"},"header":{"home":"Home","settings":"Settings"},"home":{"title":"My Projects","noProjects":"No projects yet","createFirst":"Create your first project to get started"},"project":{"create":"New Project","createDescription":"Build with AI","createTitle":"Create New Project","name":"Project Name","namePlaceholder":"my-awesome-app","type":"Project Type","typeWeb":"Web App","typeNative":"Native App","backendStack":"Backend Stack","backendNone":"Frontend Only","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"Delete Project","deleteConfirm":"Are you sure you want to delete this project?","updated":"Updated"},"chat":{"title":"Chat","placeholder":"Describe what you want to build...","askPlaceholder":"Ask a question about your project...","queuePlaceholder":"Queue another message...","send":"Send","thinking":"AI is thinking...","uploading":"Uploading files...","queueCount":"{count} message(s) queued","toolRunning":"Running","toolCompleted":"Completed","newConversation":"New Chat","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"Preview","start":"Start Preview","stop":"Stop Preview","starting":"Starting...","notReady":"Project not ready for preview","waitForAI":"Wait for AI to create the project files","openInNewTab":"Open in New Tab"},"fileExplorer":{"title":"Files","empty":"No files yet","loading":"Loading files...","error":"Failed to load files","open":"Open File Explorer","close":"Close File Explorer"},"language":{"select":"Language","en":"English","ko":"한국어"},"settings":{"title":"Settings","projectsPath":{"title":"Projects Folder","description":"Location where your projects are stored","saved":"Settings saved successfully","note":"New projects will be created in this folder. Existing projects are not affected."}}}'),ko:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"로딩 중...","error":"오류","save":"저장","cancel":"취소","delete":"삭제","create":"생성","close":"닫기","refresh":"새로고침","settings":"설정"},"header":{"home":"홈","settings":"설정"},"home":{"title":"내 프로젝트","noProjects":"프로젝트가 없습니다","createFirst":"첫 번째 프로젝트를 만들어 시작하세요"},"project":{"create":"새 프로젝트","createDescription":"AI와 함께 만들기","createTitle":"새 프로젝트 생성","name":"프로젝트 이름","namePlaceholder":"my-awesome-app","type":"프로젝트 유형","typeWeb":"웹 앱","typeNative":"네이티브 앱","backendStack":"백엔드 스택","backendNone":"프론트엔드 전용","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"프로젝트 삭제","deleteConfirm":"이 프로젝트를 삭제하시겠습니까?","updated":"업데이트"},"chat":{"title":"채팅","placeholder":"만들고 싶은 것을 설명하세요...","askPlaceholder":"프로젝트에 대해 질문하세요...","queuePlaceholder":"다음 메시지를 입력하세요...","send":"전송","thinking":"AI가 생각 중...","uploading":"파일 업로드 중...","queueCount":"{count}개의 메시지가 대기 중","toolRunning":"실행 중","toolCompleted":"완료","newConversation":"새 대화","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"미리보기","start":"미리보기 시작","stop":"미리보기 중지","starting":"시작 중...","notReady":"프로젝트가 미리보기 준비가 되지 않았습니다","waitForAI":"AI가 프로젝트 파일을 생성할 때까지 기다려주세요","openInNewTab":"새 탭에서 열기"},"fileExplorer":{"title":"파일","empty":"파일이 없습니다","loading":"파일 로딩 중...","error":"파일 로드 실패","open":"파일 탐색기 열기","close":"파일 탐색기 닫기"},"language":{"select":"언어","en":"English","ko":"한국어"},"settings":{"title":"설정","projectsPath":{"title":"프로젝트 폴더","description":"프로젝트가 저장되는 위치","saved":"설정이 저장되었습니다","note":"새 프로젝트는 이 폴더에 생성됩니다. 기존 프로젝트에는 영향을 주지 않습니다."}}}')},n=(0,a.v)()((0,s.Zr)(e=>({locale:"ko",setLocale:t=>e({locale:t})}),{name:"claudeship-locale"}));function i(){let e=n(e=>e.locale);return{t:(t,r)=>(function(e,t,r){let a=t||n.getState().locale,s=e.split("."),i=o[a];for(let t of s)if(i&&"object"==typeof i&&t in i)i=i[t];else{for(let t of(i=o.en,s))if(!i||"object"!=typeof i||!(t in i))return e;else i=i[t];break}let l="string"==typeof i?i:e;if(r)for(let[e,t]of Object.entries(r))l=l.replace(RegExp("\\{".concat(e,"\\}"),"g"),String(t));return l})(t,e,r),locale:e,setLocale:n(e=>e.setLocale)}}}},e=>{e.O(0,[992,59,498,358],()=>e(e.s=559)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[78],{660:(e,s,t)=>{"use strict";t.d(s,{F:()=>l});let a=t(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api";async function r(e,s){let t="".concat(a).concat(e),r=await fetch(t,{...s,headers:{"Content-Type":"application/json",...null==s?void 0:s.headers}});if(!r.ok)throw Error((await r.json().catch(()=>({message:"Request failed"}))).message||"HTTP error! status: ".concat(r.status));if(204!==r.status)return r.json()}let l={get:e=>r(e),post:(e,s)=>r(e,{method:"POST",body:s?JSON.stringify(s):void 0}),put:(e,s)=>r(e,{method:"PUT",body:s?JSON.stringify(s):void 0}),delete:(e,s)=>r(e,{method:"DELETE",body:s?JSON.stringify(s):void 0}),uploadFiles:async(e,s)=>{let t=new FormData;s.forEach(e=>t.append("files",e));let r="".concat(a,"/projects/").concat(e,"/files/upload"),l=await fetch(r,{method:"POST",body:t});if(!l.ok)throw Error((await l.json().catch(()=>({message:"Upload failed"}))).message||"HTTP error! status: ".concat(l.status));return l.json()}}},959:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>st});var a=t(8481),r=t(8526),l=t(3973),n=t(7176),c=t(9049),i=t(5119),o=t(8630),d=t(4415),m=t(2839),u=t(4779),x=t(6224),h=t(6230),p=t(7060),f=t(9358),g=t(1627),j=t(4739),N=t(8756);function v(e){let{children:s,className:t}=e,r=(null==t?void 0:t.replace(/language-/,""))||"text";return(0,a.jsx)(N.f4,{theme:N.Zj.vsDark,code:s.trim(),language:r,children:e=>{let{className:s,style:t,tokens:r,getLineProps:l,getTokenProps:n}=e;return(0,a.jsx)("pre",{className:(0,c.cn)("rounded-lg p-4 overflow-x-auto text-sm my-3",s),style:t,children:(0,a.jsx)("code",{children:r.map((e,s)=>(0,a.jsxs)("div",{...l({line:e}),children:[(0,a.jsx)("span",{className:"inline-block w-8 text-right mr-4 text-gray-500 select-none text-xs",children:s+1}),e.map((e,s)=>(0,a.jsx)("span",{...n({token:e})},s))]},s))})})}})}function b(e){let{content:s,className:t}=e;return(0,a.jsx)("div",{className:(0,c.cn)("markdown-body",t),children:(0,a.jsx)(g.oz,{remarkPlugins:[j.A],components:{h1:e=>{let{children:s}=e;return(0,a.jsx)("h1",{className:"text-2xl font-bold mt-6 mb-4 pb-2 border-b border-border first:mt-0",children:s})},h2:e=>{let{children:s}=e;return(0,a.jsx)("h2",{className:"text-xl font-semibold mt-5 mb-3 pb-1.5 border-b border-border/50",children:s})},h3:e=>{let{children:s}=e;return(0,a.jsx)("h3",{className:"text-lg font-semibold mt-4 mb-2",children:s})},h4:e=>{let{children:s}=e;return(0,a.jsx)("h4",{className:"text-base font-semibold mt-3 mb-2",children:s})},p:e=>{let{children:s}=e;return(0,a.jsx)("p",{className:"my-2 leading-7",children:s})},ul:e=>{let{children:s}=e;return(0,a.jsx)("ul",{className:"my-3 ml-6 list-disc space-y-1.5",children:s})},ol:e=>{let{children:s}=e;return(0,a.jsx)("ol",{className:"my-3 ml-6 list-decimal space-y-1.5",children:s})},li:e=>{let{children:s}=e;return(0,a.jsx)("li",{className:"leading-7",children:s})},table:e=>{let{children:s}=e;return(0,a.jsx)("div",{className:"my-4 overflow-x-auto rounded-lg border border-border",children:(0,a.jsx)("table",{className:"w-full border-collapse text-sm",children:s})})},thead:e=>{let{children:s}=e;return(0,a.jsx)("thead",{className:"bg-muted/50",children:s})},tbody:e=>{let{children:s}=e;return(0,a.jsx)("tbody",{className:"divide-y divide-border",children:s})},tr:e=>{let{children:s}=e;return(0,a.jsx)("tr",{className:"border-b border-border last:border-0",children:s})},th:e=>{let{children:s}=e;return(0,a.jsx)("th",{className:"px-4 py-2.5 text-left font-semibold text-foreground",children:s})},td:e=>{let{children:s}=e;return(0,a.jsx)("td",{className:"px-4 py-2.5 text-muted-foreground",children:s})},pre:e=>{let{children:s}=e;return(0,a.jsx)(a.Fragment,{children:s})},code:e=>{let{className:s,children:t,...r}=e,l=null==s?void 0:s.includes("language-"),n=String(t).replace(/\n$/,"");return l?(0,a.jsx)(v,{className:s,children:n}):(0,a.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded text-sm font-mono text-primary",...r,children:t})},blockquote:e=>{let{children:s}=e;return(0,a.jsx)("blockquote",{className:"my-4 pl-4 border-l-4 border-primary/30 italic text-muted-foreground",children:s})},hr:()=>(0,a.jsx)("hr",{className:"my-6 border-border"}),a:e=>{let{href:s,children:t}=e;return(0,a.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 hover:text-primary/80",children:t})},strong:e=>{let{children:s}=e;return(0,a.jsx)("strong",{className:"font-semibold text-foreground",children:s})},em:e=>{let{children:s}=e;return(0,a.jsx)("em",{className:"italic",children:s})},img:e=>{let{src:s,alt:t}=e;return(0,a.jsx)("img",{src:s,alt:t,className:"my-4 max-w-full rounded-lg border border-border"})}},children:s})})}let w={Read:(0,a.jsx)(i.A,{className:"h-3 w-3"}),Glob:(0,a.jsx)(o.A,{className:"h-3 w-3"}),Grep:(0,a.jsx)(d.A,{className:"h-3 w-3"}),Bash:(0,a.jsx)(m.A,{className:"h-3 w-3"}),Edit:(0,a.jsx)(u.A,{className:"h-3 w-3"}),Write:(0,a.jsx)(u.A,{className:"h-3 w-3"}),WebFetch:(0,a.jsx)(x.A,{className:"h-3 w-3"}),WebSearch:(0,a.jsx)(x.A,{className:"h-3 w-3"}),TodoWrite:(0,a.jsx)(h.A,{className:"h-3 w-3"}),Task:(0,a.jsx)(p.A,{className:"h-3 w-3"})},y={Read:"파일 읽기",Glob:"파일 검색",Grep:"내용 검색",Bash:"명령어 실행",Edit:"파일 수정",Write:"파일 생성",WebFetch:"웹 페이지",WebSearch:"웹 검색",Task:"에이전트",TodoWrite:"작업 목록"};function k(e){let{message:s}=e,t="USER"===s.role,r=[];if(!t&&s.metadata)try{r=("string"==typeof s.metadata?JSON.parse(s.metadata):s.metadata).toolActivities||[]}catch(e){}return(0,a.jsxs)("div",{className:(0,c.cn)("flex gap-3 p-4 rounded-lg",t?"bg-muted/50":"bg-background"),children:[(0,a.jsx)("div",{className:(0,c.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm font-medium",t?"bg-primary text-primary-foreground":"bg-secondary text-secondary-foreground"),children:t?"U":"AI"}),(0,a.jsxs)("div",{className:"flex-1 space-y-2 overflow-hidden",children:[r.length>0&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mb-2",children:[r.slice(0,10).map((e,s)=>(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-muted text-xs text-muted-foreground",children:[(0,a.jsx)(f.A,{className:"h-3 w-3 text-green-600"}),w[e.name]||(0,a.jsx)(m.A,{className:"h-3 w-3"}),y[e.name]||e.name]},s)),r.length>10&&(0,a.jsxs)("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-xs text-muted-foreground",children:["+",r.length-10,"개"]})]}),(0,a.jsx)("div",{className:"max-w-none",children:t?(0,a.jsx)("div",{className:"whitespace-pre-wrap break-words leading-7",children:s.content}):(0,a.jsx)(b,{content:s.content})})]})]})}var A=t(4876),S=t(660),C=t(4859);let E=(0,A.v)((e,s)=>({status:"stopped",url:null,error:null,isLoading:!1,projectReady:{ready:!1,isFullstack:!1,frontend:{hasPackageJson:!1,hasNodeModules:!1,hasDevScript:!1}},startPreview:async s=>{e({isLoading:!0,error:null,status:"starting"});try{let t=await S.F.post("/projects/".concat(s,"/preview/start"));e({status:t.status,url:t.url||null,isLoading:!1})}catch(s){e({error:s instanceof Error?s.message:"Failed to start preview",status:"error",isLoading:!1})}},stopPreview:async s=>{e({isLoading:!0,error:null});try{await S.F.post("/projects/".concat(s,"/preview/stop")),e({status:"stopped",url:null,isLoading:!1})}catch(s){e({error:s instanceof Error?s.message:"Failed to stop preview",isLoading:!1})}},restartPreview:async s=>{e({isLoading:!0,error:null,status:"starting"});try{let t=await S.F.post("/projects/".concat(s,"/preview/restart"));e({status:t.status,url:t.url||null,isLoading:!1})}catch(s){e({error:s instanceof Error?s.message:"Failed to restart preview",status:"error",isLoading:!1})}},refreshPreview:()=>{let t=s().url;t&&e({url:"".concat(t.split("?")[0],"?t=").concat(Date.now())})},fetchStatus:async s=>{try{let t=await S.F.get("/projects/".concat(s,"/preview/status"));e({status:t.status,url:t.url||null})}catch(s){e({status:"stopped",url:null})}},checkProjectReady:async s=>{try{let t=await S.F.get("/projects/".concat(s,"/preview/ready"));e({projectReady:t})}catch(s){e({projectReady:{ready:!1,isFullstack:!1,frontend:{hasPackageJson:!1,hasNodeModules:!1,hasDevScript:!1}}})}},clearError:()=>e({error:null})}));var F=t(5603);let P=/<restart-preview\s*\/>/g,T=0,R=(0,A.v)((e,s)=>({messages:[],isStreaming:!1,streamingBlocks:[],error:null,messageQueue:[],isProcessingQueue:!1,mode:"build",pendingQuestion:null,attachedFiles:[],isUploading:!1,setMode:s=>e({mode:s}),addFiles:s=>{let t=s.map(e=>({id:"file-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),file:e,preview:e.type.startsWith("image/")?URL.createObjectURL(e):void 0,status:"pending"}));e(e=>({attachedFiles:[...e.attachedFiles,...t]}))},removeFile:s=>{e(e=>{let t=e.attachedFiles.find(e=>e.id===s);return(null==t?void 0:t.preview)&&URL.revokeObjectURL(t.preview),{attachedFiles:e.attachedFiles.filter(e=>e.id!==s)}})},clearFiles:()=>{s().attachedFiles.forEach(e=>{e.preview&&URL.revokeObjectURL(e.preview)}),e({attachedFiles:[]})},uploadFiles:async t=>{let a=s().attachedFiles.filter(e=>"pending"===e.status);if(0===a.length)return s().attachedFiles.filter(e=>"uploaded"===e.status&&e.uploadedPath).map(e=>e.uploadedPath);e({isUploading:!0});try{e(e=>({attachedFiles:e.attachedFiles.map(e=>"pending"===e.status?{...e,status:"uploading"}:e)}));let r=await S.F.uploadFiles(t,a.map(e=>e.file)),l=[];return e(e=>({attachedFiles:e.attachedFiles.map(e=>{if("uploading"===e.status){let s=r.files.find(s=>s.originalName===e.file.name);if(s)return l.push(s.path),{...e,status:"uploaded",uploadedPath:s.path}}return e})})),[...s().attachedFiles.filter(e=>"uploaded"===e.status&&e.uploadedPath).map(e=>e.uploadedPath)]}catch(s){return e(e=>({attachedFiles:e.attachedFiles.map(e=>"uploading"===e.status?{...e,status:"error",error:s.message}:e),error:s instanceof Error?s.message:"Failed to upload files"})),[]}finally{e({isUploading:!1})}},fetchMessages:async s=>{try{let t=await S.F.get("/projects/".concat(s,"/messages"));e({messages:t,error:null})}catch(s){e({error:s instanceof Error?s.message:"Failed to fetch messages"})}},fetchActiveSession:async t=>{try{let r=await S.F.get("/projects/".concat(t,"/chat/status")),l=s();if(r.isStreaming){if(!l.isStreaming){var a;e({isStreaming:!0,streamingBlocks:[]});let r=await fetch("".concat(F.env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api","/projects/").concat(t,"/chat/subscribe"));if(!r.ok)throw Error("Failed to subscribe to session");let l=null==(a=r.body)?void 0:a.getReader();if(!l)throw Error("No response body");let n=new TextDecoder,c="";(async()=>{try{for(;;){let{done:s,value:t}=await l.read();if(s)break;let a=(c+=n.decode(t,{stream:!0})).split("\n");for(let s of(c=a.pop()||"",a))if(s.startsWith("data: "))try{let t=JSON.parse(s.slice(6));if(console.log("[SSE Subscribe Event]",t.type,t),"no_active_session"===t.type)break;if("text"===t.type&&t.content){let s={id:"text-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"text",content:t.content};e(e=>({streamingBlocks:[...e.streamingBlocks,s]}))}else if("tool_use"===t.type&&t.tool){let s={id:"tool-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"tool_use",tool:{name:t.tool.name,input:t.tool.input},status:"running"};e(e=>({streamingBlocks:[...e.streamingBlocks,s]}))}else"tool_result"===t.type?e(e=>{let s=[...e.streamingBlocks];for(let e=s.length-1;e>=0;e--)if("tool_use"===s[e].type&&"running"===s[e].status){s[e]={...s[e],status:"completed",result:t.content};break}return{streamingBlocks:s}}):"error"===t.type&&e({error:t.error})}catch(e){}}}finally{await s().fetchMessages(t),e({isStreaming:!1})}})()}}else l.isStreaming&&(await s().fetchMessages(t),e({isStreaming:!1,streamingBlocks:[]}))}catch(e){console.error("Failed to fetch active session:",e)}},queueMessage:(s,t)=>{let a={id:"queue-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),content:t,status:"queued"},r={id:"temp-".concat(Date.now()),projectId:s,role:C.Xh.USER,content:t,createdAt:new Date};e(e=>({messageQueue:[...e.messageQueue,a],messages:[...e.messages,r]}))},processQueue:async t=>{let a=s();if(!a.isProcessingQueue&&0!==a.messageQueue.length){for(e({isProcessingQueue:!0});s().messageQueue.length>0;){let a=s().messageQueue[0];e(e=>({messageQueue:e.messageQueue.map((e,s)=>0===s?{...e,status:"processing"}:e)})),await s().sendMessage(t,a.content,!0),e(e=>({messageQueue:e.messageQueue.slice(1)}))}e({isProcessingQueue:!1})}},sendMessage:async function(t,a){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(s().isStreaming&&!r)return void s().queueMessage(t,a);if(!r){let s={id:"temp-".concat(Date.now()),projectId:t,role:C.Xh.USER,content:a,createdAt:new Date};e(e=>({messages:[...e.messages,s]}))}e({isStreaming:!0,streamingBlocks:[],error:null});try{var l;let r=s().mode,n=s().attachedFiles.filter(e=>"uploaded"===e.status&&e.uploadedPath).map(e=>e.uploadedPath),c=await fetch("".concat(F.env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api","/projects/").concat(t,"/chat"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:a,mode:r,attachments:n.length>0?n:void 0})});if(n.length>0&&s().clearFiles(),!c.ok)throw Error("Failed to send message");let i=null==(l=c.body)?void 0:l.getReader();if(!i)throw Error("No response body");let o=new TextDecoder,d="";for(;;){let{done:s,value:a}=await i.read();if(s)break;let r=(d+=o.decode(a,{stream:!0})).split("\n");for(let s of(d=r.pop()||"",r))if(s.startsWith("data: "))try{let a=JSON.parse(s.slice(6));if(console.log("[SSE Event]",a.type,a),"text"===a.type&&a.content){let s=P.test(a.content);P.lastIndex=0;let r=a.content.replace(P,"").trim();if(s){let e=Date.now();e-T>3e3&&(T=e,E.getState().restartPreview(t))}if(r){let s={id:"text-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"text",content:r};e(e=>({streamingBlocks:[...e.streamingBlocks,s]}))}}else if("tool_use"===a.type&&a.tool){let s={id:"tool-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"tool_use",tool:{name:a.tool.name,input:a.tool.input},status:"running"};e(e=>({streamingBlocks:[...e.streamingBlocks,s]}))}else if("tool_result"===a.type)e(e=>{let s=[...e.streamingBlocks];for(let e=s.length-1;e>=0;e--)if("tool_use"===s[e].type&&"running"===s[e].status){s[e]={...s[e],status:"completed",result:a.content};break}return{streamingBlocks:s}});else if("ask_user_question"===a.type&&a.askUserQuestion){let s={id:"question-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),type:"ask_user_question",askUserQuestion:a.askUserQuestion,status:"waiting"};e(e=>({streamingBlocks:[...e.streamingBlocks,s],pendingQuestion:a.askUserQuestion}))}else"error"===a.type&&e({error:a.error})}catch(e){}}await s().fetchMessages(t)}catch(s){e({error:s instanceof Error?s.message:"Failed to send message"})}finally{e({isStreaming:!1}),s().messageQueue.length>0&&setTimeout(()=>s().processQueue(t),100)}},addMessage:s=>{e(e=>({messages:[...e.messages,s]}))},clearMessages:()=>{e({messages:[],streamingBlocks:[],messageQueue:[]})},clearError:()=>{e({error:null})},respondToQuestion:async(t,a)=>{if(!s().pendingQuestion)return;let r=Object.entries(a).map(e=>{let[s,t]=e;return"".concat(s,": ").concat(t)}).join("\n");e(e=>{let s=[...e.streamingBlocks];for(let e=s.length-1;e>=0;e--)if("ask_user_question"===s[e].type&&"waiting"===s[e].status){s[e]={...s[e],status:"completed"};break}return{streamingBlocks:s,pendingQuestion:null}}),await s().sendMessage(t,r)}}));var z=t(8031),L=t(6569),I=t(6776),B=t(5594),_=t(4660),D=t(3527);let $=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(_.bL,{className:(0,c.cn)("grid gap-2",t),...r,ref:s})});$.displayName=_.bL.displayName;let U=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(_.q7,{ref:s,className:(0,c.cn)("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:(0,a.jsx)(_.C1,{className:"flex items-center justify-center",children:(0,a.jsx)(D.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})});U.displayName=_.q7.displayName;var q=t(8367);let O=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(q.bL,{ref:s,className:(0,c.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...r,children:(0,a.jsx)(q.C1,{className:(0,c.cn)("flex items-center justify-center text-current"),children:(0,a.jsx)(L.A,{className:"h-4 w-4"})})})});O.displayName=q.bL.displayName;var M=t(2731);let W=(0,t(4176).F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Q=r.forwardRef((e,s)=>{let{className:t,...r}=e;return(0,a.jsx)(M.b,{ref:s,className:(0,c.cn)(W(),t),...r})});Q.displayName=M.b.displayName;var J=t(5338);function K(e){let{data:s,isWaiting:t,onSubmit:l}=e,[n,c]=(0,r.useState)({}),[i,o]=(0,r.useState)({}),d=s.questions.every((e,s)=>n[s]||i[s]);return t?(0,a.jsxs)("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-primary",children:[(0,a.jsx)(I.A,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"font-medium",children:"AI의 질문"})]}),s.questions.map((e,s)=>(0,a.jsxs)("div",{className:"space-y-3",children:[e.header&&(0,a.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs font-medium bg-primary/10 text-primary rounded",children:e.header}),(0,a.jsx)("p",{className:"text-sm font-medium",children:e.question}),e.multiSelect?(0,a.jsx)("div",{className:"space-y-2",children:e.options.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,a.jsx)(O,{id:"q".concat(s,"-o").concat(t),checked:(n[s]||[]).includes(e.label),onCheckedChange:t=>{var a,r;return a=e.label,r=!0===t,void c(e=>{let t=e[s]||[];return r?{...e,[s]:[...t,a]}:{...e,[s]:t.filter(e=>e!==a)}})}}),(0,a.jsxs)("div",{className:"grid gap-0.5 leading-none",children:[(0,a.jsx)(Q,{htmlFor:"q".concat(s,"-o").concat(t),className:"text-sm cursor-pointer",children:e.label}),e.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description})]})]},t))}):(0,a.jsx)($,{value:n[s],onValueChange:e=>{c(t=>({...t,[s]:e}))},className:"space-y-2",children:e.options.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,a.jsx)(U,{value:e.label,id:"q".concat(s,"-o").concat(t)}),(0,a.jsxs)("div",{className:"grid gap-0.5 leading-none",children:[(0,a.jsx)(Q,{htmlFor:"q".concat(s,"-o").concat(t),className:"text-sm cursor-pointer",children:e.label}),e.description&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description})]})]},t))}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"또는 직접 입력:"}),(0,a.jsx)(J.p,{placeholder:"다른 답변...",value:i[s]||"",onChange:e=>{var t;return t=e.target.value,void o(e=>({...e,[s]:t}))},className:"h-8 text-sm flex-1"})]})]},s)),(0,a.jsx)(B.$,{onClick:()=>{let e={};s.questions.forEach((s,t)=>{let a=n[t],r=i[t];r?e[s.question]=r:Array.isArray(a)?e[s.question]=a.join(", "):a&&(e[s.question]=a)}),l(e)},disabled:!d,className:"w-full",size:"sm",children:"답변 제출"})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md text-sm bg-muted border border-border",children:[(0,a.jsx)(L.A,{className:"h-4 w-4 text-green-600"}),(0,a.jsxs)("span",{className:"text-muted-foreground",children:[(0,a.jsx)(I.A,{className:"h-4 w-4 inline mr-1"}),"질문 응답 완료"]})]})}let V={Read:(0,a.jsx)(i.A,{className:"h-4 w-4"}),Glob:(0,a.jsx)(o.A,{className:"h-4 w-4"}),Grep:(0,a.jsx)(d.A,{className:"h-4 w-4"}),Bash:(0,a.jsx)(m.A,{className:"h-4 w-4"}),Edit:(0,a.jsx)(u.A,{className:"h-4 w-4"}),Write:(0,a.jsx)(u.A,{className:"h-4 w-4"}),WebFetch:(0,a.jsx)(x.A,{className:"h-4 w-4"}),WebSearch:(0,a.jsx)(x.A,{className:"h-4 w-4"}),TodoWrite:(0,a.jsx)(h.A,{className:"h-4 w-4"}),Task:(0,a.jsx)(p.A,{className:"h-4 w-4"})};function X(e){var s,t;let a=null==(s=e.tool)?void 0:s.input,r=null==(t=e.tool)?void 0:t.name;if(!a||!r)return"";if("Read"===r&&a.file_path)return a.file_path.split("/").pop()||"";if("Glob"===r&&a.pattern||"Grep"===r&&a.pattern)return a.pattern;if("Bash"===r&&a.command){let e=a.command;return e.length>50?e.substring(0,50)+"...":e}return("Edit"===r||"Write"===r)&&a.file_path&&a.file_path.split("/").pop()||""}function G(e){let{content:s}=e;return(0,a.jsx)(b,{content:s})}function H(e){var s;let{block:t}=e,r="running"===t.status,l=(null==(s=t.tool)?void 0:s.name)||"Unknown";return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-md text-sm ".concat(r?"bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800":"bg-muted border border-border"),children:[r?(0,a.jsx)(z.A,{className:"h-4 w-4 animate-spin text-blue-600 dark:text-blue-400"}):(0,a.jsx)(f.A,{className:"h-4 w-4 text-green-600"}),(0,a.jsx)("span",{className:r?"text-blue-700 dark:text-blue-300":"text-muted-foreground",children:V[l]||(0,a.jsx)(m.A,{className:"h-4 w-4"})}),(0,a.jsx)("span",{className:"font-medium ".concat(r?"text-blue-800 dark:text-blue-200":""),children:{Read:"파일 읽기",Glob:"파일 검색",Grep:"내용 검색",Bash:"명령어 실행",Edit:"파일 수정",Write:"파일 생성",WebFetch:"웹 페이지 가져오기",WebSearch:"웹 검색",Task:"에이전트 실행",TodoWrite:"작업 목록 업데이트"}[l]||l}),X(t)&&(0,a.jsx)("span",{className:"truncate ".concat(r?"text-blue-600 dark:text-blue-400":"text-muted-foreground"),children:X(t)})]})}function Y(e){let{blocks:s,isStreaming:t=!0,projectId:r}=e,l=s.length>0,{respondToQuestion:n,pendingQuestion:c}=R(),i=e=>{n(r,e)};return(0,a.jsxs)("div",{className:"flex gap-3 p-4 rounded-lg bg-background",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-secondary text-secondary-foreground text-sm font-medium",children:"AI"}),(0,a.jsxs)("div",{className:"flex-1 space-y-2 overflow-hidden",children:[s.map(e=>"text"===e.type?(0,a.jsx)(G,{content:e.content||""},e.id):"tool_use"===e.type?(0,a.jsx)(H,{block:e},e.id):"ask_user_question"===e.type&&e.askUserQuestion?(0,a.jsx)(K,{data:e.askUserQuestion,isWaiting:"waiting"===e.status,onSubmit:i},e.id):null),t&&!l&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,a.jsx)(z.A,{className:"h-4 w-4 animate-spin"}),(0,a.jsx)("span",{className:"text-sm",children:"AI가 생각 중..."})]}),t&&l&&(0,a.jsx)("span",{className:"inline-block w-2 h-4 bg-primary animate-pulse"})]})]})}function Z(e){let{messages:s,streamingBlocks:t=[],isStreaming:l,projectId:n}=e,c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{var e;null==(e=c.current)||e.scrollIntoView({behavior:"smooth"})},[s,t]),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[0===s.length&&!l&&(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-lg font-medium",children:"안녕하세요!"}),(0,a.jsx)("p",{className:"text-sm",children:"무엇을 만들어 드릴까요?"})]})}),s.map(e=>(0,a.jsx)(k,{message:e},e.id)),t.length>0&&(0,a.jsx)(Y,{blocks:t,isStreaming:l,projectId:n}),(0,a.jsx)("div",{ref:c})]})}var ee=t(7793),es=t(3113),et=t(219),ea=t(9426),er=t(2881);function el(){let{t:e}=(0,ea.B)(),{mode:s,setMode:t,isStreaming:r}=R();return(0,a.jsxs)("div",{className:"flex gap-1 p-1 bg-muted rounded-lg w-fit",children:[(0,a.jsxs)("button",{onClick:()=>t("ask"),disabled:r,className:(0,c.cn)("flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-colors","ask"===s?"bg-blue-500 text-white":"text-muted-foreground hover:text-foreground hover:bg-muted-foreground/10",r&&"opacity-50 cursor-not-allowed"),children:[(0,a.jsx)(I.A,{className:"h-4 w-4"}),e("chat.modeAsk")]}),(0,a.jsxs)("button",{onClick:()=>t("build"),disabled:r,className:(0,c.cn)("flex items-center gap-1.5 px-3 py-1.5 text-sm rounded-md transition-colors","build"===s?"bg-green-500 text-white":"text-muted-foreground hover:text-foreground hover:bg-muted-foreground/10",r&&"opacity-50 cursor-not-allowed"),children:[(0,a.jsx)(er.A,{className:"h-4 w-4"}),e("chat.modeBuild")]})]})}var en=t(6241);function ec(e){let{files:s,onRemove:t}=e;return 0===s.length?null:(0,a.jsx)("div",{className:"flex flex-wrap gap-2 px-4 pb-2",children:s.map(e=>{var s;return(0,a.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-lg border bg-muted/50 p-2",children:[e.preview?(0,a.jsx)("img",{src:e.preview,alt:e.file.name,className:"h-12 w-12 rounded object-cover"}):(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded bg-muted",children:(0,a.jsx)(i.A,{className:"h-6 w-6 text-muted-foreground"})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"max-w-[120px] truncate text-xs font-medium",children:e.file.name}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:(s=e.file.size)<1024?"".concat(s," B"):s<1048576?"".concat((s/1024).toFixed(1)," KB"):"".concat((s/1048576).toFixed(1)," MB")})]}),"uploading"===e.status&&(0,a.jsx)(z.A,{className:"h-4 w-4 animate-spin text-muted-foreground"}),"error"===e.status&&(0,a.jsx)("span",{className:"text-xs text-destructive",children:e.error}),(0,a.jsx)("button",{onClick:()=>t(e.id),className:"absolute -right-2 -top-2 flex h-5 w-5 items-center justify-center rounded-full bg-destructive text-destructive-foreground opacity-0 transition-opacity group-hover:opacity-100",children:(0,a.jsx)(en.A,{className:"h-3 w-3"})})]},e.id)})})}let ei=["image/png","image/jpeg","image/gif","image/webp","application/pdf","text/plain","text/markdown","text/csv","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function eo(e){let{onSend:s,projectId:t,disabled:l,isStreaming:n,queueCount:c=0}=e,{t:i}=(0,ea.B)(),{mode:o,attachedFiles:d,addFiles:m,removeFile:u,uploadFiles:x,isUploading:h}=R(),[p,f]=(0,r.useState)(""),[g,j]=(0,r.useState)(!1),N=(0,r.useRef)(null),v=(0,r.useRef)(null),b=e=>{let s=e.filter(e=>ei.includes(e.type)?!(e.size>0x6400000)||(console.warn("File too large: ".concat(e.name)),!1):(console.warn("File type not allowed: ".concat(e.type)),!1)),t=5-d.length;t<=0||m(s.slice(0,t))},w=async()=>{if(!p.trim()&&0===d.length||l||h)return;let e=[];d.length>0&&(e=await x(t)),s(p.trim(),e.length>0?e:void 0),f(""),N.current&&(N.current.style.height="auto")};return(0,a.jsxs)("div",{className:"border-t bg-background ".concat(g?"ring-2 ring-ring ring-offset-2":""),onDragOver:e=>{e.preventDefault(),j(!0)},onDragLeave:e=>{e.preventDefault(),j(!1)},onDrop:e=>{e.preventDefault(),j(!1),e.dataTransfer.files&&b(Array.from(e.dataTransfer.files))},children:[(0,a.jsx)("div",{className:"p-4 pb-2",children:(0,a.jsx)(el,{})}),(0,a.jsx)(ec,{files:d,onRemove:u}),(0,a.jsxs)("div",{className:"flex items-end gap-2 px-4 pb-4",children:[(0,a.jsx)("input",{ref:v,type:"file",multiple:!0,accept:ei.join(","),onChange:e=>{e.target.files&&(b(Array.from(e.target.files)),e.target.value="")},className:"hidden"}),(0,a.jsx)(B.$,{type:"button",variant:"ghost",size:"icon",onClick:()=>{var e;return null==(e=v.current)?void 0:e.click()},disabled:l||d.length>=5,className:"h-10 w-10 shrink-0",children:(0,a.jsx)(ee.A,{className:"h-4 w-4"})}),(0,a.jsx)("div",{className:"relative flex-1",children:(0,a.jsx)("textarea",{ref:N,value:p,onChange:e=>f(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),w())},onInput:()=>{let e=N.current;e&&(e.style.height="auto",e.style.height="".concat(Math.min(e.scrollHeight,200),"px"))},placeholder:i(n?"chat.queuePlaceholder":"ask"===o?"chat.askPlaceholder":"chat.placeholder"),disabled:l,rows:1,className:"w-full resize-none rounded-lg border border-input bg-background px-4 py-3 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"})}),(0,a.jsx)(B.$,{onClick:w,disabled:!p.trim()&&0===d.length||l||h,size:"icon",className:"h-10 w-10 shrink-0",children:(0,a.jsx)(es.A,{className:"h-4 w-4"})})]}),(n||h)&&(0,a.jsxs)("div",{className:"px-4 pb-4 flex items-center gap-2 text-xs text-muted-foreground",children:[h?(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-blue-500"}),i("chat.uploading")]}):(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-yellow-500"}),i("chat.thinking")]}),c>0&&(0,a.jsxs)("span",{className:"flex items-center gap-1 text-blue-500",children:[(0,a.jsx)(et.A,{className:"h-3 w-3"}),i("chat.queueCount",{count:c})]})]})]})}var ed=t(4025);function em(e){let{projectId:s}=e,{t}=(0,ea.B)(),[l,n]=(0,r.useState)(!1),{messages:c,isStreaming:i,streamingBlocks:o,messageQueue:d,fetchMessages:m,fetchActiveSession:u,sendMessage:x,clearMessages:h}=R();(0,r.useEffect)(()=>{h(),m(s),u(s)},[s,m,u,h]);let p=async()=>{if(!l&&!i){n(!0);try{await S.F.post("/projects/".concat(s,"/chat/reset"))}catch(e){console.error("Failed to reset session:",e)}finally{n(!1)}}};return(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsxs)("div",{className:"flex h-12 items-center justify-between border-b px-4",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:t("chat.title")}),(0,a.jsxs)(B.$,{variant:"ghost",size:"sm",onClick:p,disabled:l||i,title:t("chat.newConversation"),className:"gap-1.5",children:[(0,a.jsx)(ed.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:t("chat.newConversation")})]})]}),(0,a.jsx)(Z,{messages:c,streamingBlocks:o,isStreaming:i,projectId:s}),(0,a.jsx)(eo,{onSend:e=>{x(s,e)},projectId:s,isStreaming:i,queueCount:d.length})]})}var eu=t(5732),ex=t(5631),eh=t(3792),ep=t(3774),ef=t(3787),eg=t(4246),ej=t(5471),eN=t(7604),ev=t(6021),eb=t(9085),ew=t(9696),ey=t(943),ek=t(3300);let eA=t(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000";function eS(e){let{projectId:s,isRunning:t}=e,[l,n]=(0,r.useState)([]),[c,i]=(0,r.useState)("all"),[o,d]=(0,r.useState)(!0),u=(0,r.useRef)(null),x=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!t)return void n([]);(async()=>{try{let e=await fetch("".concat(eA,"/projects/").concat(s,"/preview/logs"));if(e.ok){let s=await e.json();n(s)}}catch(e){console.error("Failed to fetch logs:",e)}})()},[s,t]),(0,r.useEffect)(()=>{if(!t){x.current&&(x.current.close(),x.current=null);return}let e=new EventSource("".concat(eA,"/projects/").concat(s,"/preview/logs/stream"));return e.onmessage=e=>{try{let s=JSON.parse(e.data);"log"===s.type&&s.entry&&n(e=>{let t=[...e,s.entry];return t.length>1e3?t.slice(-1e3):t})}catch(e){}},e.onerror=()=>{e.close(),x.current=null},x.current=e,()=>{e.close(),x.current=null}},[s,t]),(0,r.useEffect)(()=>{o&&u.current&&(u.current.scrollTop=u.current.scrollHeight)},[l,o]);let h=(0,r.useCallback)(()=>{if(!u.current)return;let{scrollTop:e,scrollHeight:s,clientHeight:t}=u.current;d(s-e-t<50)},[]),p=async()=>{try{await fetch("".concat(eA,"/projects/").concat(s,"/preview/logs"),{method:"DELETE"}),n([])}catch(e){console.error("Failed to clear logs:",e)}},f=l.filter(e=>{switch(c){case"frontend":return"frontend"===e.source;case"backend":return"backend"===e.source;case"error":return"stderr"===e.level;default:return!0}});return t?(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsxs)("div",{className:"flex h-10 items-center justify-between border-b px-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(B.$,{variant:"all"===c?"secondary":"ghost",size:"sm",onClick:()=>i("all"),className:"h-7 px-2 text-xs",children:"All"}),(0,a.jsx)(B.$,{variant:"frontend"===c?"secondary":"ghost",size:"sm",onClick:()=>i("frontend"),className:"h-7 px-2 text-xs",children:"Frontend"}),(0,a.jsx)(B.$,{variant:"backend"===c?"secondary":"ghost",size:"sm",onClick:()=>i("backend"),className:"h-7 px-2 text-xs",children:"Backend"}),(0,a.jsxs)(B.$,{variant:"error"===c?"secondary":"ghost",size:"sm",onClick:()=>i("error"),className:"h-7 px-2 text-xs text-red-500",children:[(0,a.jsx)(ew.A,{className:"h-3 w-3 mr-1"}),"Errors"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>{let e=new Blob([f.map(e=>{let s=new Date(e.timestamp).toISOString();return"[".concat(s,"] [").concat(e.source,"] [").concat(e.level,"] ").concat(e.message)}).join("\n")],{type:"text/plain"}),t=URL.createObjectURL(e),a=document.createElement("a");a.href=t,a.download="console-".concat(s,"-").concat(Date.now(),".log"),a.click(),URL.revokeObjectURL(t)},className:"h-7 w-7 p-0",title:"Download logs",children:(0,a.jsx)(ey.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:p,className:"h-7 w-7 p-0",title:"Clear logs",children:(0,a.jsx)(ek.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{ref:u,onScroll:h,className:"flex-1 overflow-auto bg-zinc-950 p-2 font-mono text-xs",children:0===f.length?(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-zinc-500",children:(0,a.jsx)("span",{children:"No logs yet..."})}):(0,a.jsx)("div",{className:"space-y-0.5",children:f.map(e=>(0,a.jsxs)("div",{className:"flex gap-2 ".concat("stderr"===e.level?"text-red-400":"text-zinc-300"),children:[(0,a.jsx)("span",{className:"text-zinc-600 shrink-0",children:new Date(e.timestamp).toLocaleTimeString()}),(0,a.jsx)("span",{className:"shrink-0 px-1 rounded text-[10px] ".concat("frontend"===e.source?"bg-blue-500/20 text-blue-400":"bg-green-500/20 text-green-400"),children:"frontend"===e.source?"FE":"BE"}),(0,a.jsx)("span",{className:"whitespace-pre-wrap break-all",children:e.message})]},e.id))})})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(m.A,{className:"mx-auto h-8 w-8 mb-2 opacity-50"}),(0,a.jsx)("p",{className:"text-sm",children:"Start the preview to see console output"})]})})}var eC=t(262);function eE(e){let{error:s,onDismiss:t}=e,[l,n]=(0,r.useState)(!1),c=async()=>{let e=[s.message,s.location?"at ".concat(s.location.file,":").concat(s.location.line,":").concat(s.location.column):"",s.stack||""].filter(Boolean).join("\n\n");await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)};return(0,a.jsx)("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm z-50 overflow-auto",children:(0,a.jsx)("div",{className:"min-h-full p-6",children:(0,a.jsxs)("div",{className:"max-w-2xl mx-auto bg-zinc-900 rounded-lg border border-red-500/50 overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-red-500/10 border-b border-red-500/30",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-3 h-3 rounded-full bg-red-500"}),(0,a.jsx)("span",{className:"font-medium ".concat({compile:"text-red-500",runtime:"text-orange-500",network:"text-yellow-500"}[s.type]),children:{compile:"Compilation Error",runtime:"Runtime Error",network:"Network Error"}[s.type]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:c,className:"h-7 px-2 text-zinc-400 hover:text-white",children:l?(0,a.jsx)(L.A,{className:"h-4 w-4"}):(0,a.jsx)(eC.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:t,className:"h-7 px-2 text-zinc-400 hover:text-white",children:(0,a.jsx)(en.A,{className:"h-4 w-4"})})]})]}),(0,a.jsxs)("div",{className:"p-4 space-y-4",children:[(0,a.jsx)("p",{className:"text-lg font-mono text-red-400 whitespace-pre-wrap",children:s.message}),s.location&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-zinc-400",children:[(0,a.jsx)(ej.A,{className:"h-4 w-4"}),(0,a.jsxs)("code",{className:"bg-zinc-800 px-2 py-0.5 rounded",children:[s.location.file,":",s.location.line,":",s.location.column]})]}),s.stack&&(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("p",{className:"text-xs text-zinc-500 mb-2 uppercase tracking-wide",children:"Stack Trace"}),(0,a.jsx)("pre",{className:"bg-zinc-950 p-3 rounded-lg text-xs text-zinc-400 overflow-x-auto font-mono",children:s.stack})]})]}),(0,a.jsx)("div",{className:"px-4 py-3 bg-zinc-800/50 border-t border-zinc-700 flex justify-end",children:(0,a.jsx)(B.$,{variant:"outline",size:"sm",onClick:t,className:"text-zinc-300",children:"Dismiss"})})]})})})}let eF=t(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000",eP={desktop:{width:"100%",height:"100%",label:"Desktop"},tablet:{width:"768px",height:"1024px",label:"Tablet"},mobile:{width:"375px",height:"667px",label:"Mobile"}};function eT(e){let{projectId:s}=e,{t}=(0,ea.B)(),[l,n]=(0,r.useState)(!1),[c,i]=(0,r.useState)(!0),[o,d]=(0,r.useState)(null),u=(0,r.useRef)(null),x=(0,r.useRef)(null),{status:h,url:p,error:f,isLoading:g,projectReady:j,startPreview:N,stopPreview:v,restartPreview:b,refreshPreview:w,fetchStatus:y,checkProjectReady:k,clearError:A}=E(),S=(0,r.useRef)(!1),C=(0,r.useRef)(0);(0,r.useRef)(h).current=h;let F=(0,r.useCallback)(e=>{c&&"running"===h&&(d(e.split("/").pop()||e),setTimeout(()=>d(null),2e3),x.current&&(x.current.src=x.current.src))},[c,h]);(0,r.useEffect)(()=>{if(!l||"running"!==h){u.current&&(u.current.close(),u.current=null);return}let e=new EventSource("".concat(eF,"/projects/").concat(s,"/preview/watch"));return e.onmessage=e=>{try{let s=JSON.parse(e.data);"file-change"===s.type&&F(s.path)}catch(e){}},e.onerror=()=>{e.close(),u.current=null},u.current=e,()=>{e.close(),u.current=null}},[l,h,s,F]),(0,r.useEffect)(()=>{n(!0)},[]),(0,r.useEffect)(()=>{let e=()=>{let e="".concat(eF,"/projects/").concat(s,"/preview/stop");navigator.sendBeacon(e)};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[s]),(0,r.useEffect)(()=>{S.current=!1,C.current=0,A()},[s,A]),(0,r.useEffect)(()=>{if(!l)return;y(s),k(s);let e=setInterval(()=>{y(s),"running"!==h&&"starting"!==h&&k(s)},2e3);return()=>clearInterval(e)},[s,y,k,h,l]),(0,r.useEffect)(()=>{if(!l||g||"starting"===h)return;let e=S.current,t=j.ready;if(!e&&t&&(C.current=0),S.current=t,t&&"stopped"===h&&C.current<3&&(C.current++,N(s)),t&&"error"===h&&C.current<3){let e=setTimeout(()=>{j.ready&&C.current<3&&(C.current++,A(),N(s))},3e3);return()=>clearTimeout(e)}},[l,j.ready,h,g,s,N,A]);let P=()=>N(s),[T,R]=(0,r.useState)("preview"),[L,I]=(0,r.useState)("desktop"),[_,D]=(0,r.useState)(null),$=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!l||"running"!==h){$.current&&($.current.close(),$.current=null);return}let e=new EventSource("".concat(eF,"/projects/").concat(s,"/preview/logs/stream"));return e.onmessage=e=>{try{let s=JSON.parse(e.data);if("log"===s.type&&s.entry&&"stderr"===s.entry.level){let e=function(e){if(e.includes("Compiling...")||e.includes("Ready in")||e.includes("Compiled successfully")||e.includes("Fast Refresh")||e.includes("○ Compiling")||e.includes("✓ Compiled"))return null;let s=/(?:\.\/)?([^:]+):(\d+):(\d+)/,t=e.match(/(?:Error|TypeError|SyntaxError|ReferenceError):\s*(.+)/);if(t){let a=e.match(s);return{type:"compile",message:t[1],stack:e,location:a?{file:a[1],line:parseInt(a[2],10),column:parseInt(a[3],10)}:void 0}}if(e.includes("Failed to compile")||e.includes("Compilation failed"))return{type:"compile",message:"Failed to compile. Check the console for more details.",stack:e};let a=e.match(/Module not found:\s*(.+)/);if(a){let t=e.match(s);return{type:"compile",message:a[1],stack:e,location:t?{file:t[1],line:parseInt(t[2],10),column:parseInt(t[3],10)}:void 0}}return null}(s.entry.message);e&&D(e)}}catch(e){}},e.onerror=()=>{e.close(),$.current=null},$.current=e,()=>{e.close(),$.current=null}},[l,h,s]),(0,r.useEffect)(()=>{"starting"===h&&D(null)},[h]);let U=(0,r.useCallback)(()=>{D(null)},[]);return(0,a.jsxs)("div",{className:"flex h-full flex-col border-l",children:[(0,a.jsxs)("div",{className:"flex h-12 items-center justify-between border-b px-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(l?"running"===h?"bg-green-500":"starting"===h?"bg-yellow-500 animate-pulse":"error"===h?"bg-red-500":"bg-gray-400":"bg-gray-400")}),(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:t(l?"running"===h?"preview.title":"starting"===h?"preview.starting":"error"===h?"common.error":"preview.stop":"common.loading")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:["preview"===T&&"running"===h&&(0,a.jsxs)("div",{className:"flex items-center gap-0.5 mr-2 border-r pr-2",children:[(0,a.jsx)(B.$,{variant:"desktop"===L?"secondary":"ghost",size:"sm",onClick:()=>I("desktop"),className:"h-7 px-2",title:"Desktop",children:(0,a.jsx)(eu.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"tablet"===L?"secondary":"ghost",size:"sm",onClick:()=>I("tablet"),className:"h-7 px-2",title:"Tablet (768x1024)",children:(0,a.jsx)(ex.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"mobile"===L?"secondary":"ghost",size:"sm",onClick:()=>I("mobile"),className:"h-7 px-2",title:"Mobile (375x667)",children:(0,a.jsx)(eh.A,{className:"h-4 w-4"})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5 mr-2 border-r pr-2",children:[(0,a.jsx)(B.$,{variant:"preview"===T?"secondary":"ghost",size:"sm",onClick:()=>R("preview"),className:"h-7 px-2",title:"Preview",children:(0,a.jsx)(eu.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"console"===T?"secondary":"ghost",size:"sm",onClick:()=>R("console"),className:"h-7 px-2",title:"Console",children:(0,a.jsx)(m.A,{className:"h-4 w-4"})})]}),"running"===h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>i(!c),className:"h-8 w-8 p-0 ".concat(c?"text-green-500":"text-muted-foreground"),title:c?"Auto-refresh ON":"Auto-refresh OFF",children:(0,a.jsx)(ep.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>w(),disabled:g,className:"h-8 w-8 p-0",title:"Refresh",children:(0,a.jsx)(ef.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>b(s),disabled:g,className:"h-8 w-8 p-0",title:"Restart server",children:(0,a.jsx)(eg.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>{p&&window.open(p,"_blank")},className:"h-8 w-8 p-0",title:"Open in new tab",children:(0,a.jsx)(ej.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>v(s),disabled:g,className:"h-8 w-8 p-0",title:"Stop",children:(0,a.jsx)(eN.A,{className:"h-4 w-4"})})]}):(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:P,disabled:!l||g||"starting"===h||!j.ready,title:t(j.ready?"preview.start":"preview.notReady"),className:"h-8 w-8 p-0",children:(0,a.jsx)(ev.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"flex-1 bg-muted/30 overflow-hidden",children:"console"===T?(0,a.jsx)(eS,{projectId:s,isRunning:"running"===h}):l?"running"===h&&p?(0,a.jsxs)("div",{className:"relative h-full w-full ".concat("desktop"!==L?"flex items-center justify-center bg-muted/50 p-4":""),children:[(0,a.jsx)("iframe",{ref:x,src:p,style:{width:eP[L].width,height:eP[L].height,maxWidth:"100%",maxHeight:"100%"},className:"border-0 ".concat("desktop"!==L?"border rounded-lg shadow-lg bg-white":"")},p),_&&(0,a.jsx)(eE,{error:_,onDismiss:U}),"desktop"!==L&&(0,a.jsxs)("div",{className:"absolute bottom-4 left-4 px-2 py-1 bg-black/70 text-white text-xs rounded",children:[eP[L].label," (",eP[L].width," x ",eP[L].height,")"]}),o&&(0,a.jsxs)("div",{className:"absolute bottom-4 right-4 flex items-center gap-2 px-3 py-2 bg-green-500/90 text-white text-xs rounded-lg shadow-lg animate-pulse",children:[(0,a.jsx)(ep.A,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:o})]})]}):"starting"===h?(0,a.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center text-muted-foreground",children:[(0,a.jsx)(ef.A,{className:"mx-auto h-8 w-8 animate-spin mb-2"}),(0,a.jsx)("p",{children:t("preview.starting")})]})}):f?(0,a.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center text-destructive",children:[(0,a.jsx)("p",{className:"font-medium",children:t("common.error")}),(0,a.jsx)("p",{className:"text-sm",children:f}),(0,a.jsx)(B.$,{variant:"outline",size:"sm",onClick:P,className:"mt-4",children:t("common.refresh")})]})}):j.ready?(0,a.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center text-muted-foreground",children:[(0,a.jsx)(ev.A,{className:"mx-auto h-8 w-8 mb-2"}),(0,a.jsx)("p",{children:t("preview.start")})]})}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center text-muted-foreground max-w-sm",children:[(0,a.jsx)(eb.A,{className:"mx-auto h-8 w-8 mb-3 text-muted-foreground/50"}),(0,a.jsx)("p",{className:"font-medium mb-3",children:t("preview.notReady")}),(0,a.jsxs)("div",{className:"text-xs space-y-3",children:[(0,a.jsxs)("div",{className:"border rounded-lg p-2",children:[(0,a.jsx)("p",{className:"font-medium mb-1.5 text-foreground",children:j.isFullstack?"Frontend":"Project"}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(j.frontend.hasPackageJson?"bg-green-500":"bg-gray-300 animate-pulse")}),(0,a.jsx)("span",{children:"package.json"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(j.frontend.hasDevScript?"bg-green-500":"bg-gray-300")}),(0,a.jsx)("span",{children:"dev script"})]})]})]}),j.isFullstack&&j.backend&&(0,a.jsxs)("div",{className:"border rounded-lg p-2",children:[(0,a.jsxs)("p",{className:"font-medium mb-1.5 text-foreground",children:["Backend ","FASTAPI"===j.backendFramework?"(Python)":"(Node.js)"]}),(0,a.jsx)("div",{className:"space-y-1",children:"FASTAPI"===j.backendFramework?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(j.backend.hasRequirementsTxt?"bg-green-500":"bg-gray-300 animate-pulse")}),(0,a.jsx)("span",{children:"requirements.txt"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(j.backend.hasMainPy?"bg-green-500":"bg-gray-300")}),(0,a.jsx)("span",{children:"main.py"})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(j.backend.hasPackageJson?"bg-green-500":"bg-gray-300 animate-pulse")}),(0,a.jsx)("span",{children:"package.json"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(j.backend.hasDevScript?"bg-green-500":"bg-gray-300")}),(0,a.jsx)("span",{children:"dev script"})]})]})})]})]}),(0,a.jsx)("p",{className:"text-xs mt-4",children:t("preview.waitForAI")})]})}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,a.jsx)(z.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})})})]})}var eR=t(794),ez=t(2475),eL=t(4373),eI=t(4309),eB=t(6925);let e_=t(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:3000";function eD(e){let{projectId:s,onFileSelect:t}=e,{t:l}=(0,ea.B)(),[n,c]=(0,r.useState)([]),[i,o]=(0,r.useState)(!0),[d,m]=(0,r.useState)(!1),u=(0,r.useCallback)(async()=>{try{o(!0),m(!1);let e=await fetch("".concat(e_,"/projects/").concat(s,"/files"));if(!e.ok)throw Error("Failed to load files");let t=await e.json();c(t)}catch(e){m(!0)}finally{o(!1)}},[s]);(0,r.useEffect)(()=>{u()},[u]);let x=async e=>{if(t)try{let a=await fetch("".concat(e_,"/projects/").concat(s,"/files/content?path=").concat(encodeURIComponent(e)));if(!a.ok)throw Error("Failed to load file");let r=await a.json();t(e,r.content)}catch(e){}};return i?(0,a.jsx)("div",{className:"p-4 text-sm text-muted-foreground",children:l("fileExplorer.loading")}):d?(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("p",{className:"text-sm text-destructive mb-2",children:l("fileExplorer.error")}),(0,a.jsxs)(B.$,{variant:"outline",size:"sm",onClick:u,children:[(0,a.jsx)(ef.A,{className:"h-3 w-3 mr-1"}),l("common.refresh")]})]}):(0,a.jsxs)("div",{className:"h-full flex flex-col",children:[(0,a.jsxs)("div",{className:"flex h-12 items-center justify-between px-4 border-b",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:l("fileExplorer.title")}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:u,title:l("common.refresh"),children:(0,a.jsx)(ef.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto p-2",children:0===n.length?(0,a.jsx)("div",{className:"text-sm text-muted-foreground px-2 py-4 text-center",children:l("fileExplorer.empty")}):(0,a.jsx)(e$,{nodes:n,onFileClick:x})})]})}function e$(e){let{nodes:s,onFileClick:t,level:r=0}=e;return(0,a.jsx)("ul",{className:"space-y-0.5",children:s.map(e=>(0,a.jsx)(eU,{node:e,onFileClick:t,level:r},e.path))})}function eU(e){let{node:s,onFileClick:t,level:l}=e,[n,i]=(0,r.useState)(l<1),o="directory"===s.type;return(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:(0,c.cn)("flex items-center gap-1 px-2 py-1 rounded-sm cursor-pointer","hover:bg-accent text-sm"),style:{paddingLeft:"".concat(12*l+8,"px")},onClick:()=>{o?i(!n):t(s.path)},children:[o&&(0,a.jsx)("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:n?(0,a.jsx)(eI.A,{className:"h-3 w-3"}):(0,a.jsx)(eB.A,{className:"h-3 w-3"})}),!o&&(0,a.jsx)("span",{className:"w-4 flex-shrink-0"}),(()=>{if(o)return n?(0,a.jsx)(eR.A,{className:"h-4 w-4 text-blue-400 flex-shrink-0"}):(0,a.jsx)(ez.A,{className:"h-4 w-4 text-blue-400 flex-shrink-0"});let e={ts:"text-blue-400",tsx:"text-blue-400",js:"text-yellow-400",jsx:"text-yellow-400",py:"text-green-400",json:"text-yellow-600",md:"text-gray-400",css:"text-purple-400",scss:"text-pink-400",html:"text-orange-400",prisma:"text-teal-400"}[s.extension||""]||"text-muted-foreground";return(0,a.jsx)(eL.A,{className:(0,c.cn)("h-4 w-4 flex-shrink-0",e)})})(),(0,a.jsx)("span",{className:"truncate",children:s.name})]}),o&&n&&s.children&&(0,a.jsx)(e$,{nodes:s.children,onFileClick:t,level:l+1})]})}let eq={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",json:"json",md:"markdown",css:"css",scss:"scss",html:"markup",prisma:"graphql",sql:"sql",sh:"bash",bash:"bash",yml:"yaml",yaml:"yaml",env:"bash",gitignore:"bash"};function eO(e){let{path:s,content:t,language:l,onClose:n}=e,{t:c}=(0,ea.B)(),[i,o]=(0,r.useState)(!1),d=s.split("/").pop()||s,m=eq[l]||"typescript",u=t.split("\n"),x=async()=>{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),2e3)};return(0,a.jsx)("div",{className:"fixed inset-0 z-50 bg-background/80 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"fixed inset-4 z-50 flex flex-col rounded-lg border bg-background shadow-lg md:inset-8 lg:inset-16",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-sm font-medium",children:d}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:s})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsxs)("span",{className:"text-xs text-muted-foreground mr-2",children:[u.length," lines"]}),(0,a.jsx)(B.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:x,title:i?"Copied!":"Copy",children:i?(0,a.jsx)(L.A,{className:"h-4 w-4 text-green-500"}):(0,a.jsx)(eC.A,{className:"h-4 w-4"})}),(0,a.jsx)(B.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:n,title:c("common.close"),children:(0,a.jsx)(en.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-auto bg-[#1e1e1e]",children:(0,a.jsx)(N.f4,{theme:N.Zj.vsDark,code:t,language:m,children:e=>{let{className:s,style:t,tokens:r,getLineProps:l,getTokenProps:n}=e;return(0,a.jsx)("pre",{className:"text-sm leading-relaxed",style:{...t,margin:0,padding:"1rem",background:"#1e1e1e",minHeight:"100%"},children:(0,a.jsx)("code",{className:s,children:r.map((e,s)=>{let{key:t,...r}=l({line:e});return(0,a.jsxs)("div",{...r,className:"table-row hover:bg-white/5",children:[(0,a.jsx)("span",{className:"table-cell select-none pr-4 text-right text-gray-500 w-12",children:s+1}),(0,a.jsx)("span",{className:"table-cell",children:e.map((e,s)=>{let{key:t,...r}=n({token:e});return(0,a.jsx)("span",{...r},s)})})]},s)})})})}})})]})})}var eM=t(1858),eW=t(4593),eQ=t(3028);function eJ(e){let{projectId:s}=e,[t,l]=(0,r.useState)([]),[n,c]=(0,r.useState)(null),[i,o]=(0,r.useState)(null),[d,m]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null),[h,p]=(0,r.useState)(1),[f,g]=(0,r.useState)(!1),[j,N]=(0,r.useState)(""),[v,b]=(0,r.useState)(null),w=(0,r.useCallback)(async()=>{m(!0),x(null);try{let e=await S.F.get("/projects/".concat(s,"/database/tables"));l(e),e.length>0&&!n&&c(e[0].name)}catch(e){x(e instanceof Error?e.message:"Failed to load tables")}finally{m(!1)}},[s,n]),y=(0,r.useCallback)(async()=>{if(n){m(!0),x(null);try{let e=await S.F.get("/projects/".concat(s,"/database/tables/").concat(n,"/data?page=").concat(h,"&pageSize=").concat(50));o(e)}catch(e){x(e instanceof Error?e.message:"Failed to load table data")}finally{m(!1)}}},[s,n,h]);(0,r.useEffect)(()=>{w()},[w]),(0,r.useEffect)(()=>{n&&(p(1),y())},[n]),(0,r.useEffect)(()=>{n&&y()},[h,y]);let k=async e=>{if(!n||!i)return;let t=i.columns.find(e=>e.primaryKey);if(!t)return void x("No primary key found for this table");if(confirm("Are you sure you want to delete this row?"))try{await S.F.delete("/projects/".concat(s,"/database/tables/").concat(n,"/rows"),{primaryKey:t.name,primaryKeyValue:e[t.name]}),await y()}catch(e){x(e instanceof Error?e.message:"Failed to delete row")}},A=async()=>{if(j.trim()){m(!0),x(null);try{let e=await S.F.post("/projects/".concat(s,"/database/query"),{query:j});b(e)}catch(e){x(e instanceof Error?e.message:"Query execution failed")}finally{m(!1)}}},C=i?Math.ceil(i.total/50):0;return d&&0===t.length?(0,a.jsxs)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[(0,a.jsx)(ef.A,{className:"h-5 w-5 animate-spin mr-2"}),"Loading database..."]}):u&&0===t.length?(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(eM.A,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,a.jsx)("p",{className:"text-sm",children:u}),(0,a.jsx)(B.$,{variant:"outline",size:"sm",onClick:w,className:"mt-2",children:"Retry"})]})}):(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[(0,a.jsxs)("h3",{className:"font-medium flex items-center gap-2",children:[(0,a.jsx)(eM.A,{className:"h-4 w-4"}),"Database"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(B.$,{variant:f?"secondary":"outline",size:"sm",onClick:()=>g(!f),className:"h-8",children:"SQL"}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:w,disabled:d,className:"h-8 w-8 p-0",children:(0,a.jsx)(ef.A,{className:"h-4 w-4 ".concat(d?"animate-spin":"")})})]})]}),u&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 bg-destructive/10 text-destructive text-sm",children:[(0,a.jsx)(ew.A,{className:"h-4 w-4"}),u]}),f&&(0,a.jsxs)("div",{className:"border-b p-4 space-y-2",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(J.p,{value:j,onChange:e=>N(e.target.value),placeholder:"SELECT * FROM users LIMIT 10",className:"font-mono text-sm",onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&A()}}),(0,a.jsxs)(B.$,{onClick:A,disabled:d,size:"sm",children:[(0,a.jsx)(ev.A,{className:"h-4 w-4 mr-1"}),"Run"]})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Press Cmd+Enter to execute"})]}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,a.jsx)("div",{className:"w-48 border-r overflow-auto",children:(0,a.jsxs)("div",{className:"p-2 space-y-1",children:[t.map(e=>(0,a.jsxs)("button",{onClick:()=>{c(e.name),g(!1),b(null)},className:"w-full flex items-center justify-between px-3 py-2 text-sm rounded-md transition-colors ".concat(n===e.name?"bg-primary/10 text-primary":"hover:bg-muted"),children:[(0,a.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,a.jsx)(eW.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.name})]}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:e.rowCount})]},e.name)),0===t.length&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground px-3 py-2",children:"No tables found"})]})}),(0,a.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden",children:f&&v?(0,a.jsx)("div",{className:"flex-1 overflow-auto",children:v.length>0?(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-muted/50 sticky top-0",children:(0,a.jsx)("tr",{children:Object.keys(v[0]).map(e=>(0,a.jsx)("th",{className:"px-3 py-2 text-left font-medium text-muted-foreground border-b",children:e},e))})}),(0,a.jsx)("tbody",{children:v.map((e,s)=>(0,a.jsx)("tr",{className:"border-b hover:bg-muted/30",children:Object.values(e).map((e,s)=>(0,a.jsx)("td",{className:"px-3 py-2 font-mono",children:null===e?(0,a.jsx)("span",{className:"text-muted-foreground",children:"NULL"}):String(e)},s))},s))})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:"Query returned no results"})}):i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex-1 overflow-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-muted/50 sticky top-0",children:(0,a.jsxs)("tr",{children:[i.columns.map(e=>(0,a.jsxs)("th",{className:"px-3 py-2 text-left font-medium text-muted-foreground border-b",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[e.name,e.primaryKey&&(0,a.jsx)("span",{className:"text-xs text-primary",children:"PK"})]}),(0,a.jsx)("span",{className:"text-xs font-normal",children:e.type})]},e.name)),(0,a.jsx)("th",{className:"w-10 border-b"})]})}),(0,a.jsx)("tbody",{children:i.rows.map((e,s)=>(0,a.jsxs)("tr",{className:"border-b hover:bg-muted/30",children:[i.columns.map(s=>(0,a.jsx)("td",{className:"px-3 py-2 font-mono",children:null===e[s.name]?(0,a.jsx)("span",{className:"text-muted-foreground",children:"NULL"}):String(e[s.name])},s.name)),(0,a.jsx)("td",{className:"px-2",children:(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>k(e),className:"h-6 w-6 p-0 text-muted-foreground hover:text-destructive",children:(0,a.jsx)(ek.A,{className:"h-3 w-3"})})})]},s))})]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between border-t px-4 py-2",children:[(0,a.jsxs)("span",{className:"text-sm text-muted-foreground",children:[i.total," rows total"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(B.$,{variant:"outline",size:"sm",onClick:()=>p(e=>Math.max(1,e-1)),disabled:1===h,className:"h-8 w-8 p-0",children:(0,a.jsx)(eQ.A,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"text-sm",children:[h," / ",C||1]}),(0,a.jsx)(B.$,{variant:"outline",size:"sm",onClick:()=>p(e=>Math.min(C,e+1)),disabled:h>=C,className:"h-8 w-8 p-0",children:(0,a.jsx)(eB.A,{className:"h-4 w-4"})})]})]})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:"Select a table to view data"})})]})]})}var eK=t(8234),eV=t(4539),eX=t(6029),eG=t(1278);let eH={navigate:"Navigate to URL",click:"Click element",fill:"Fill input",waitFor:"Wait for element",screenshot:"Take screenshot",assert:"Assert visible"};function eY(e){let{projectId:s}=e,[t,l]=(0,r.useState)([]),[n,c]=(0,r.useState)(null),[i,o]=(0,r.useState)(!1),[d,m]=(0,r.useState)(!1),[u,x]=(0,r.useState)(null),[h,p]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),[j,N]=(0,r.useState)(""),[v,b]=(0,r.useState)([]),w=(0,r.useCallback)(async()=>{o(!0),x(null);try{let e=await S.F.get("/projects/".concat(s,"/testing/scenarios"));l(e)}catch(e){x(e instanceof Error?e.message:"Failed to load scenarios")}finally{o(!1)}},[s]);(0,r.useEffect)(()=>{w()},[w]);let y=async()=>{if(!j.trim()||0===v.length)return void x("Name and at least one step are required");o(!0),x(null);try{n?await S.F.put("/projects/".concat(s,"/testing/scenarios/").concat(n.id),{name:j,steps:v}):await S.F.post("/projects/".concat(s,"/testing/scenarios"),{name:j,steps:v}),await w(),g(!1)}catch(e){x(e instanceof Error?e.message:"Failed to save scenario")}finally{o(!1)}},k=async()=>{if(n&&confirm("Delete this test scenario?"))try{await S.F.delete("/projects/".concat(s,"/testing/scenarios/").concat(n.id)),c(null),await w()}catch(e){x(e instanceof Error?e.message:"Failed to delete scenario")}},A=async()=>{if(n){m(!0),x(null),p(null);try{let e=await S.F.post("/projects/".concat(s,"/testing/scenarios/").concat(n.id,"/run"));p(e)}catch(e){x(e instanceof Error?e.message:"Test execution failed")}finally{m(!1)}}},C=(e,s)=>{let t=[...v];t[e]={...t[e],...s},b(t)};return i&&0===t.length?(0,a.jsxs)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[(0,a.jsx)(ef.A,{className:"h-5 w-5 animate-spin mr-2"}),"Loading..."]}):(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[(0,a.jsxs)("h3",{className:"font-medium flex items-center gap-2",children:[(0,a.jsx)(eK.A,{className:"h-4 w-4"}),"Browser Testing"]}),(0,a.jsxs)(B.$,{variant:"outline",size:"sm",onClick:()=>{c(null),g(!0),N("New Test"),b([{action:"navigate",url:"/"}])},children:[(0,a.jsx)(eV.A,{className:"h-4 w-4 mr-1"}),"New Test"]})]}),u&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 bg-destructive/10 text-destructive text-sm",children:[(0,a.jsx)(ew.A,{className:"h-4 w-4"}),u]}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,a.jsx)("div",{className:"w-56 border-r overflow-auto",children:(0,a.jsxs)("div",{className:"p-2 space-y-1",children:[t.map(e=>(0,a.jsxs)("button",{onClick:()=>{c(e),p(null),g(!1)},className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md transition-colors ".concat((null==n?void 0:n.id)===e.id?"bg-primary/10 text-primary":"hover:bg-muted"),children:[(0,a.jsx)(eK.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.name})]},e.id)),0===t.length&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground px-3 py-2",children:"No test scenarios yet"})]})}),(0,a.jsx)("div",{className:"flex-1 overflow-auto",children:f?(0,a.jsxs)("div",{className:"p-4 space-y-4",children:[(0,a.jsx)(J.p,{value:j,onChange:e=>N(e.target.value),placeholder:"Test name",className:"font-medium"}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-muted-foreground",children:"Steps"}),v.map((e,s)=>(0,a.jsxs)("div",{className:"flex gap-2 items-start p-3 border rounded-lg",children:[(0,a.jsx)("select",{value:e.action,onChange:e=>C(s,{action:e.target.value}),className:"h-9 px-2 border rounded-md bg-background text-sm",children:Object.entries(eH).map(e=>{let[s,t]=e;return(0,a.jsx)("option",{value:s,children:t},s)})}),"navigate"===e.action&&(0,a.jsx)(J.p,{value:e.url||"",onChange:e=>C(s,{url:e.target.value}),placeholder:"/path or full URL",className:"flex-1"}),("click"===e.action||"waitFor"===e.action||"assert"===e.action)&&(0,a.jsx)(J.p,{value:e.selector||"",onChange:e=>C(s,{selector:e.target.value}),placeholder:"CSS selector",className:"flex-1 font-mono text-sm"}),"fill"===e.action&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(J.p,{value:e.selector||"",onChange:e=>C(s,{selector:e.target.value}),placeholder:"CSS selector",className:"flex-1 font-mono text-sm"}),(0,a.jsx)(J.p,{value:e.value||"",onChange:e=>C(s,{value:e.target.value}),placeholder:"Value",className:"flex-1"})]}),"screenshot"===e.action&&(0,a.jsx)(J.p,{value:e.name||"",onChange:e=>C(s,{name:e.target.value}),placeholder:"Screenshot name",className:"flex-1"}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>{b(v.filter((e,t)=>t!==s))},className:"h-9 w-9 p-0 text-muted-foreground hover:text-destructive",children:(0,a.jsx)(ek.A,{className:"h-4 w-4"})})]},s)),(0,a.jsxs)(B.$,{variant:"outline",size:"sm",onClick:()=>{b([...v,{action:"click",selector:""}])},children:[(0,a.jsx)(eV.A,{className:"h-4 w-4 mr-1"}),"Add Step"]})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-4 border-t",children:[(0,a.jsx)(B.$,{onClick:y,disabled:i,children:"Save"}),(0,a.jsx)(B.$,{variant:"outline",onClick:()=>g(!1),children:"Cancel"})]})]}):n?(0,a.jsxs)("div",{className:"p-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h4",{className:"text-lg font-medium",children:n.name}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(B.$,{variant:"outline",size:"sm",onClick:()=>{n&&(g(!0),N(n.name),b([...n.steps]))},children:"Edit"}),(0,a.jsx)(B.$,{variant:"outline",size:"sm",onClick:k,className:"text-destructive",children:(0,a.jsx)(ek.A,{className:"h-4 w-4"})}),(0,a.jsxs)(B.$,{onClick:A,disabled:d,size:"sm",children:[d?(0,a.jsx)(ef.A,{className:"h-4 w-4 animate-spin mr-1"}):(0,a.jsx)(ev.A,{className:"h-4 w-4 mr-1"}),"Run Test"]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-muted-foreground",children:[n.steps.length," steps"]}),n.steps.map((e,s)=>{let t=null==h?void 0:h.steps[s];return(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 border rounded-lg ".concat((null==t?void 0:t.status)==="passed"?"border-green-500/50 bg-green-500/5":(null==t?void 0:t.status)==="failed"?"border-red-500/50 bg-red-500/5":""),children:[t?"passed"===t.status?(0,a.jsx)(eX.A,{className:"h-4 w-4 text-green-500"}):"failed"===t.status?(0,a.jsx)(eG.A,{className:"h-4 w-4 text-red-500"}):(0,a.jsx)(et.A,{className:"h-4 w-4 text-muted-foreground"}):(0,a.jsx)("div",{className:"h-4 w-4 rounded-full border-2"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("span",{className:"font-medium",children:eH[e.action]}),e.selector&&(0,a.jsx)("code",{className:"ml-2 text-xs bg-muted px-1.5 py-0.5 rounded",children:e.selector}),e.url&&(0,a.jsx)("code",{className:"ml-2 text-xs bg-muted px-1.5 py-0.5 rounded",children:e.url}),e.value&&(0,a.jsxs)("span",{className:"ml-2 text-sm text-muted-foreground",children:['= "',e.value,'"']})]})]},s)})]}),h&&(0,a.jsxs)("div",{className:"p-4 rounded-lg ".concat("passed"===h.status?"bg-green-500/10 text-green-700 dark:text-green-400":"bg-red-500/10 text-red-700 dark:text-red-400"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:["passed"===h.status?(0,a.jsx)(eX.A,{className:"h-5 w-5"}):(0,a.jsx)(eG.A,{className:"h-5 w-5"}),(0,a.jsxs)("span",{className:"font-medium",children:["Test ","passed"===h.status?"Passed":"Failed"]})]}),h.error&&(0,a.jsx)("p",{className:"mt-2 text-sm",children:h.error}),h.endTime&&h.startTime&&(0,a.jsxs)("p",{className:"mt-1 text-sm opacity-70",children:["Duration: ",h.endTime-h.startTime,"ms"]})]})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(eK.A,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,a.jsx)("p",{children:"Select a test or create a new one"})]})})})]})]})}var eZ=t(5552);function e0(e){let{projectId:s}=e,[t,l]=(0,r.useState)([]),[n,c]=(0,r.useState)(null),[o,d]=(0,r.useState)(null),[m,u]=(0,r.useState)(new Set),[x,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)(null),[g,j]=(0,r.useState)(""),[N,v]=(0,r.useState)(!1),b=(0,r.useCallback)(async()=>{h(!0),f(null);try{let e=await S.F.get("/projects/".concat(s,"/checkpoints"));l(e)}catch(e){f(e instanceof Error?e.message:"Failed to load checkpoints")}finally{h(!1)}},[s]),w=(0,r.useCallback)(async()=>{try{let e=await S.F.get("/projects/".concat(s,"/checkpoints/status"));v(e.hasChanges)}catch(e){}},[s]);(0,r.useEffect)(()=>{b(),w()},[b,w]),(0,r.useEffect)(()=>{let e=setInterval(w,5e3);return()=>clearInterval(e)},[w]);let y=async e=>{c(e),u(new Set);try{let t=await S.F.get("/projects/".concat(s,"/checkpoints/diff?from=").concat(e.hash));d(t.files)}catch(e){d(null)}},k=async()=>{if(!g.trim())return void f("Please enter a checkpoint message");h(!0),f(null);try{await S.F.post("/projects/".concat(s,"/checkpoints"),{message:g}),j(""),await b(),await w()}catch(e){f(e instanceof Error?e.message:"Failed to create checkpoint")}finally{h(!1)}},A=async e=>{if(confirm('Restore to "'.concat(e.message,'"? This will discard current changes.'))){h(!0),f(null);try{await S.F.post("/projects/".concat(s,"/checkpoints/").concat(e.hash,"/restore")),await b(),await w(),c(null),d(null)}catch(e){f(e instanceof Error?e.message:"Failed to restore checkpoint")}finally{h(!1)}}};return x&&0===t.length?(0,a.jsxs)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[(0,a.jsx)(ef.A,{className:"h-5 w-5 animate-spin mr-2"}),"Loading..."]}):(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[(0,a.jsxs)("h3",{className:"font-medium flex items-center gap-2",children:[(0,a.jsx)(eZ.A,{className:"h-4 w-4"}),"Checkpoints"]}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:b,disabled:x,className:"h-8 w-8 p-0",children:(0,a.jsx)(ef.A,{className:"h-4 w-4 ".concat(x?"animate-spin":"")})})]}),p&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 bg-destructive/10 text-destructive text-sm",children:[(0,a.jsx)(ew.A,{className:"h-4 w-4"}),p]}),N&&(0,a.jsxs)("div",{className:"border-b p-4 space-y-2",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(J.p,{value:g,onChange:e=>j(e.target.value),placeholder:"Checkpoint message...",className:"flex-1",onKeyDown:e=>{"Enter"===e.key&&k()}}),(0,a.jsxs)(B.$,{onClick:k,disabled:x,size:"sm",children:[(0,a.jsx)(eV.A,{className:"h-4 w-4 mr-1"}),"Save"]})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"You have unsaved changes"})]}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,a.jsx)("div",{className:"w-72 border-r overflow-auto",children:(0,a.jsxs)("div",{className:"p-2 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-primary/5 border border-primary/20",children:[(0,a.jsx)("div",{className:"w-3 h-3 rounded-full bg-primary mt-1"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Current State"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:N?"Unsaved changes":"No changes"})]})]}),t.map((e,s)=>(0,a.jsxs)("button",{onClick:()=>y(e),className:"w-full flex items-start gap-3 p-3 rounded-lg text-left transition-colors ".concat((null==n?void 0:n.hash)===e.hash?"bg-muted":"hover:bg-muted/50"),children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"w-3 h-3 rounded-full bg-muted-foreground/30 mt-1"}),s<t.length-1&&(0,a.jsx)("div",{className:"absolute top-4 left-1.5 w-px h-full bg-muted-foreground/20"})]}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-sm truncate",children:e.message}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-1",children:[(0,a.jsx)(et.A,{className:"h-3 w-3"}),(e=>{let s=new Date(e),t=new Date().getTime()-s.getTime();return t<6e4?"Just now":t<36e5?"".concat(Math.floor(t/6e4),"m ago"):t<864e5?"".concat(Math.floor(t/36e5),"h ago"):s.toLocaleDateString()})(e.timestamp)]}),e.filesChanged>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs mt-1",children:[(0,a.jsxs)("span",{className:"text-green-500",children:["+",e.insertions]}),(0,a.jsxs)("span",{className:"text-red-500",children:["-",e.deletions]}),(0,a.jsxs)("span",{className:"text-muted-foreground",children:[e.filesChanged," files"]})]})]})]},e.hash)),0===t.length&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground px-3 py-2",children:"No checkpoints yet"})]})}),(0,a.jsx)("div",{className:"flex-1 overflow-auto",children:n&&o?(0,a.jsxs)("div",{className:"p-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-medium",children:n.message}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:new Date(n.timestamp).toLocaleString()})]}),(0,a.jsxs)(B.$,{variant:"outline",size:"sm",onClick:()=>A(n),children:[(0,a.jsx)(eg.A,{className:"h-4 w-4 mr-1"}),"Restore"]})]}),0===o.length?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No differences from current state"}):(0,a.jsx)("div",{className:"space-y-2",children:o.map(e=>(0,a.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{onClick:()=>(e=>{let s=new Set(m);s.has(e)?s.delete(e):s.add(e),u(s)})(e.path),className:"w-full flex items-center gap-2 p-3 hover:bg-muted/50 text-left",children:[m.has(e.path)?(0,a.jsx)(eI.A,{className:"h-4 w-4"}):(0,a.jsx)(eB.A,{className:"h-4 w-4"}),(0,a.jsx)(i.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"flex-1 font-mono text-sm truncate",children:e.path}),(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded ".concat("added"===e.status?"bg-green-500/20 text-green-500":"deleted"===e.status?"bg-red-500/20 text-red-500":"bg-yellow-500/20 text-yellow-500"),children:e.status}),(0,a.jsxs)("span",{className:"text-xs text-green-500",children:["+",e.additions]}),(0,a.jsxs)("span",{className:"text-xs text-red-500",children:["-",e.deletions]})]}),m.has(e.path)&&(0,a.jsx)("pre",{className:"bg-zinc-950 p-4 text-xs font-mono overflow-x-auto max-h-96",children:e.diff.split("\n").map((e,s)=>(0,a.jsx)("div",{className:e.startsWith("+")&&!e.startsWith("+++")?"text-green-400 bg-green-500/10":e.startsWith("-")&&!e.startsWith("---")?"text-red-400 bg-red-500/10":e.startsWith("@@")?"text-blue-400":"text-zinc-400",children:e},s))})]},e.path))})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(eZ.A,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,a.jsx)("p",{children:"Select a checkpoint to view changes"})]})})})]})]})}var e4=t(6282),e1=t(9176),e2=t(3512);let e5=["SECRET","PASSWORD","KEY","TOKEN","API_KEY","PRIVATE","CREDENTIAL"];function e3(e){let s=e.toUpperCase();return e5.some(e=>s.includes(e))}function e8(e){let{projectId:s}=e,[t,l]=(0,r.useState)([]),[n,c]=(0,r.useState)(null),[o,d]=(0,r.useState)([]),[m,u]=(0,r.useState)(new Set),[x,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)(!1),[g,j]=(0,r.useState)(null),[N,v]=(0,r.useState)(!1),b=(0,r.useCallback)(async()=>{h(!0),j(null);try{let e=await S.F.get("/projects/".concat(s,"/env"));l(e),e.length>0&&!n&&(c(e[0].path),d(e[0].variables))}catch(e){j("Failed to load environment files")}finally{h(!1)}},[s,n]),w=(0,r.useCallback)(async e=>{h(!0),j(null);try{let t=await S.F.get("/projects/".concat(s,"/env/file?path=").concat(encodeURIComponent(e)));d(t.variables),v(!1)}catch(s){j("Failed to load ".concat(e))}finally{h(!1)}},[s]);(0,r.useEffect)(()=>{b()},[b]),(0,r.useEffect)(()=>{n&&w(n)},[n,w]);let y=(e,s,t)=>{let a=[...o];a[e]={...a[e],[s]:t},d(a),v(!0)},k=async()=>{if(!n)return;if(o.filter(e=>!e.key.trim()).length>0)return void j("Variable names cannot be empty");let e=o.map(e=>e.key.trim()),t=e.filter((s,t)=>e.indexOf(s)!==t);if(t.length>0)return void j("Duplicate variable name: ".concat(t[0]));f(!0),j(null);try{await S.F.put("/projects/".concat(s,"/env/file?path=").concat(encodeURIComponent(n)),{variables:o}),v(!1)}catch(e){j("Failed to save environment variables")}finally{f(!1)}},A=async()=>{let e=prompt("Enter .env file name (e.g., .env.local):");if(e){if(!e.startsWith(".env"))return void j("File name must start with .env");try{await S.F.post("/projects/".concat(s,"/env/file?path=").concat(encodeURIComponent(e)),{variables:[]}),await b(),c(e)}catch(e){j("Failed to create environment file")}}};return x&&0===t.length?(0,a.jsxs)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[(0,a.jsx)(ef.A,{className:"h-5 w-5 animate-spin mr-2"}),"Loading..."]}):(0,a.jsxs)("div",{className:"flex h-full flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b px-4 py-3",children:[(0,a.jsx)("h3",{className:"font-medium",children:"Environment Variables"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(B.$,{variant:"outline",size:"sm",onClick:A,className:"h-8",children:[(0,a.jsx)(eV.A,{className:"h-4 w-4 mr-1"}),"New File"]}),(0,a.jsxs)(B.$,{variant:"default",size:"sm",onClick:k,disabled:!N||p,className:"h-8",children:[p?(0,a.jsx)(ef.A,{className:"h-4 w-4 animate-spin mr-1"}):(0,a.jsx)(e4.A,{className:"h-4 w-4 mr-1"}),"Save"]})]})]}),g&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 bg-destructive/10 text-destructive text-sm",children:[(0,a.jsx)(ew.A,{className:"h-4 w-4"}),g]}),(0,a.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,a.jsx)("div",{className:"w-48 border-r overflow-auto",children:(0,a.jsxs)("div",{className:"p-2 space-y-1",children:[t.map(e=>(0,a.jsxs)("button",{onClick:()=>{var s;return s=e.path,void((!N||confirm("You have unsaved changes. Discard them?"))&&(c(s),u(new Set)))},className:"w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md transition-colors ".concat(n===e.path?"bg-primary/10 text-primary":"hover:bg-muted"),children:[(0,a.jsx)(i.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.path})]},e.path)),0===t.length&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground px-3 py-2",children:"No .env files found"})]})}),(0,a.jsx)("div",{className:"flex-1 overflow-auto",children:n?(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-2 px-2 text-xs font-medium text-muted-foreground uppercase tracking-wide",children:[(0,a.jsx)("div",{children:"Key"}),(0,a.jsx)("div",{children:"Value"}),(0,a.jsx)("div",{className:"w-16"})]}),o.map((e,s)=>(0,a.jsxs)("div",{className:"grid grid-cols-[1fr_1fr_auto] gap-2 items-center",children:[(0,a.jsx)(J.p,{value:e.key,onChange:e=>y(s,"key",e.target.value),placeholder:"VARIABLE_NAME",className:"font-mono text-sm"}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(J.p,{type:e3(e.key)&&!m.has(e.key)?"password":"text",value:e.value,onChange:e=>y(s,"value",e.target.value),placeholder:"value",className:"font-mono text-sm pr-10"}),e3(e.key)&&(0,a.jsx)("button",{onClick:()=>(e=>{let s=new Set(m);s.has(e)?s.delete(e):s.add(e),u(s)})(e.key),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:m.has(e.key)?(0,a.jsx)(e1.A,{className:"h-4 w-4"}):(0,a.jsx)(e2.A,{className:"h-4 w-4"})})]}),(0,a.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>{d(o.filter((e,t)=>t!==s)),v(!0)},className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",children:(0,a.jsx)(ek.A,{className:"h-4 w-4"})})]},s)),(0,a.jsxs)(B.$,{variant:"outline",size:"sm",onClick:()=>{d([...o,{key:"",value:""}]),v(!0)},className:"w-full mt-4",children:[(0,a.jsx)(eV.A,{className:"h-4 w-4 mr-1"}),"Add Variable"]}),o.some(e=>e.key.startsWith("NEXT_PUBLIC_"))&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-4",children:"Variables starting with NEXT_PUBLIC_ will be exposed to the browser."})]}):(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:(0,a.jsx)("p",{children:"Select a file or create a new one"})})})]})]})}var e6=t(2425),e7=t(2858);let e9=[{id:"preview",icon:(0,a.jsx)(e2.A,{className:"h-4 w-4"}),label:"Preview"},{id:"database",icon:(0,a.jsx)(eM.A,{className:"h-4 w-4"}),label:"Database"},{id:"testing",icon:(0,a.jsx)(eK.A,{className:"h-4 w-4"}),label:"Testing"},{id:"checkpoint",icon:(0,a.jsx)(eZ.A,{className:"h-4 w-4"}),label:"Checkpoint"},{id:"env",icon:(0,a.jsx)(e6.A,{className:"h-4 w-4"}),label:"Env"}];function se(e){let{projectId:s}=e,{t}=(0,ea.B)(),[l,n]=(0,r.useState)(!1),[c,i]=(0,r.useState)(null),[o,d]=(0,r.useState)("preview");return(0,a.jsxs)("div",{className:"flex h-[calc(100vh-3.5rem)]",children:[(0,a.jsx)(B.$,{variant:"outline",size:"sm",onClick:()=>n(!l),className:"absolute left-4 top-16 z-10 h-8 w-8 p-0",title:t(l?"fileExplorer.close":"fileExplorer.open"),children:l?(0,a.jsx)(en.A,{className:"h-4 w-4"}):(0,a.jsx)(e7.A,{className:"h-4 w-4"})}),l&&(0,a.jsx)("div",{className:"w-64 border-r bg-muted/30 flex-shrink-0",children:(0,a.jsx)(eD,{projectId:s,onFileSelect:(e,s)=>{let t=e.split(".").pop()||"";i({path:e,content:s,extension:t})}})}),(0,a.jsx)("div",{className:"border-r flex-shrink-0",style:{width:l?"calc(30% - 8rem)":"30%"},children:(0,a.jsx)(em,{projectId:s})}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col",style:{width:l?"calc(70%)":"70%"},children:[(0,a.jsx)("div",{className:"flex items-center border-b bg-muted/30 px-2",children:e9.map(e=>(0,a.jsxs)("button",{onClick:()=>d(e.id),className:"flex items-center gap-1.5 px-3 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ".concat(o===e.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),title:e.label,children:[e.icon,(0,a.jsx)("span",{className:"hidden lg:inline",children:e.label})]},e.id))}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden",children:(()=>{switch(o){case"preview":default:return(0,a.jsx)(eT,{projectId:s});case"database":return(0,a.jsx)(eJ,{projectId:s});case"testing":return(0,a.jsx)(eY,{projectId:s});case"checkpoint":return(0,a.jsx)(e0,{projectId:s});case"env":return(0,a.jsx)(e8,{projectId:s})}})()})]}),c&&(0,a.jsx)(eO,{path:c.path,content:c.content,language:c.extension,onClose:()=>{i(null)}})]})}var ss=t(4264);function st(){let e=(0,l.useParams)(),s=(0,l.useRouter)(),t=e.id,{currentProject:c,fetchProject:i,isLoading:o,error:d}=(0,ss.I)();return((0,r.useEffect)(()=>{t&&i(t)},[t,i]),o&&!c)?(0,a.jsx)("div",{className:"flex h-screen items-center justify-center",children:(0,a.jsx)("p",{className:"text-muted-foreground",children:"로딩 중..."})}):d||!c?(0,a.jsxs)("div",{className:"flex h-screen flex-col items-center justify-center gap-4",children:[(0,a.jsx)(ew.A,{className:"h-12 w-12 text-destructive"}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-lg font-medium",children:"프로젝트를 찾을 수 없습니다"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:d||"프로젝트가 삭제되었거나 존재하지 않습니다."})]}),(0,a.jsx)(B.$,{onClick:()=>s.push("/"),variant:"outline",children:"홈으로 돌아가기"})]}):(0,a.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,a.jsx)(n.Y,{title:c.name,showBack:!0,backHref:"/"}),(0,a.jsx)(se,{projectId:t})]})}},4264:(e,s,t)=>{"use strict";t.d(s,{I:()=>l});var a=t(4876),r=t(660);let l=(0,a.v)((e,s)=>({projects:[],currentProject:null,isLoading:!1,error:null,fetchProjects:async()=>{e({isLoading:!0,error:null});try{let s=await r.F.get("/projects");e({projects:s,isLoading:!1})}catch(s){e({error:s instanceof Error?s.message:"Failed to fetch projects",isLoading:!1})}},createProject:async s=>{e({isLoading:!0,error:null});try{let t=await r.F.post("/projects",s);return e(e=>({projects:[{id:t.id,name:t.name,projectType:t.projectType,backendFramework:t.backendFramework,updatedAt:t.updatedAt},...e.projects],isLoading:!1})),t}catch(s){throw e({error:s instanceof Error?s.message:"Failed to create project",isLoading:!1}),s}},deleteProject:async s=>{e({isLoading:!0,error:null});try{await r.F.delete("/projects/".concat(s)),e(e=>({projects:e.projects.filter(e=>e.id!==s),isLoading:!1}))}catch(s){throw e({error:s instanceof Error?s.message:"Failed to delete project",isLoading:!1}),s}},fetchProject:async s=>{e({isLoading:!0,error:null});try{let t=await r.F.get("/projects/".concat(s));e({currentProject:t,isLoading:!1})}catch(s){e({error:s instanceof Error?s.message:"Failed to fetch project",isLoading:!1})}},setCurrentProject:s=>e({currentProject:s}),clearError:()=>e({error:null})}))},4859:(e,s,t)=>{"use strict";t.d(s,{V_:()=>r,gM:()=>a,Xh:()=>l});var a=function(e){return e.WEB="WEB",e.NATIVE="NATIVE",e}({}),r=function(e){return e.NONE="NONE",e.EXPRESS="EXPRESS",e.FASTAPI="FASTAPI",e}({}),l=function(e){return e.USER="USER",e.ASSISTANT="ASSISTANT",e.SYSTEM="SYSTEM",e}({})},5006:(e,s,t)=>{Promise.resolve().then(t.bind(t,959))},5338:(e,s,t)=>{"use strict";t.d(s,{p:()=>n});var a=t(8481),r=t(8526),l=t(9049);let n=r.forwardRef((e,s)=>{let{className:t,type:r,...n}=e;return(0,a.jsx)("input",{type:r,className:(0,l.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:s,...n})});n.displayName="Input"},5594:(e,s,t)=>{"use strict";t.d(s,{$:()=>i});var a=t(8481),r=t(8526),l=t(4176),n=t(9049);let c=(0,l.F)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),i=r.forwardRef((e,s)=>{let{className:t,variant:r,size:l,...i}=e;return(0,a.jsx)("button",{className:(0,n.cn)(c({variant:r,size:l,className:t})),ref:s,...i})});i.displayName="Button"},7176:(e,s,t)=>{"use strict";t.d(s,{Y:()=>u});var a=t(8481),r=t(4816),l=t.n(r),n=t(9432),c=t(9150),i=t(7746),o=t(5594),d=t(9426);function m(){let{locale:e,setLocale:s,t}=(0,d.B)();return(0,a.jsx)(o.$,{variant:"ghost",size:"icon",onClick:()=>{s("en"===e?"ko":"en")},className:"h-9 w-9 text-xs font-medium",title:t("language.select"),children:"en"===e?"EN":"KO"})}function u(e){let{title:s,showBack:t,backHref:r="/"}=e,{t:u}=(0,d.B)(),x=s||u("common.appName");return(0,a.jsx)("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:(0,a.jsxs)("div",{className:"flex h-14 w-full items-center justify-between px-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[t?(0,a.jsx)(l(),{href:r,children:(0,a.jsx)(o.$,{variant:"ghost",size:"icon",className:"h-9 w-9",children:(0,a.jsx)(c.A,{className:"h-5 w-5"})})}):(0,a.jsx)(n.default,{src:"/logo.svg",alt:"ClaudeShip",width:36,height:36,className:"rounded-lg"}),(0,a.jsx)("h1",{className:"text-lg font-semibold",children:x})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(m,{}),(0,a.jsx)(l(),{href:"/settings",children:(0,a.jsx)(o.$,{variant:"ghost",size:"icon",className:"h-9 w-9",title:u("header.settings"),children:(0,a.jsx)(i.A,{className:"h-5 w-5"})})})]})]})})}},9049:(e,s,t)=>{"use strict";t.d(s,{cn:()=>l});var a=t(5806),r=t(4159);function l(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return(0,r.QP)((0,a.$)(s))}},9426:(e,s,t)=>{"use strict";t.d(s,{B:()=>c});var a=t(4876),r=t(1203);let l={en:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"Loading...","error":"Error","save":"Save","cancel":"Cancel","delete":"Delete","create":"Create","close":"Close","refresh":"Refresh","settings":"Settings"},"header":{"home":"Home","settings":"Settings"},"home":{"title":"My Projects","noProjects":"No projects yet","createFirst":"Create your first project to get started"},"project":{"create":"New Project","createDescription":"Build with AI","createTitle":"Create New Project","name":"Project Name","namePlaceholder":"my-awesome-app","type":"Project Type","typeWeb":"Web App","typeNative":"Native App","backendStack":"Backend Stack","backendNone":"Frontend Only","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"Delete Project","deleteConfirm":"Are you sure you want to delete this project?","updated":"Updated"},"chat":{"title":"Chat","placeholder":"Describe what you want to build...","askPlaceholder":"Ask a question about your project...","queuePlaceholder":"Queue another message...","send":"Send","thinking":"AI is thinking...","uploading":"Uploading files...","queueCount":"{count} message(s) queued","toolRunning":"Running","toolCompleted":"Completed","newConversation":"New Chat","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"Preview","start":"Start Preview","stop":"Stop Preview","starting":"Starting...","notReady":"Project not ready for preview","waitForAI":"Wait for AI to create the project files","openInNewTab":"Open in New Tab"},"fileExplorer":{"title":"Files","empty":"No files yet","loading":"Loading files...","error":"Failed to load files","open":"Open File Explorer","close":"Close File Explorer"},"language":{"select":"Language","en":"English","ko":"한국어"},"settings":{"title":"Settings","projectsPath":{"title":"Projects Folder","description":"Location where your projects are stored","saved":"Settings saved successfully","note":"New projects will be created in this folder. Existing projects are not affected."}}}'),ko:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"로딩 중...","error":"오류","save":"저장","cancel":"취소","delete":"삭제","create":"생성","close":"닫기","refresh":"새로고침","settings":"설정"},"header":{"home":"홈","settings":"설정"},"home":{"title":"내 프로젝트","noProjects":"프로젝트가 없습니다","createFirst":"첫 번째 프로젝트를 만들어 시작하세요"},"project":{"create":"새 프로젝트","createDescription":"AI와 함께 만들기","createTitle":"새 프로젝트 생성","name":"프로젝트 이름","namePlaceholder":"my-awesome-app","type":"프로젝트 유형","typeWeb":"웹 앱","typeNative":"네이티브 앱","backendStack":"백엔드 스택","backendNone":"프론트엔드 전용","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"프로젝트 삭제","deleteConfirm":"이 프로젝트를 삭제하시겠습니까?","updated":"업데이트"},"chat":{"title":"채팅","placeholder":"만들고 싶은 것을 설명하세요...","askPlaceholder":"프로젝트에 대해 질문하세요...","queuePlaceholder":"다음 메시지를 입력하세요...","send":"전송","thinking":"AI가 생각 중...","uploading":"파일 업로드 중...","queueCount":"{count}개의 메시지가 대기 중","toolRunning":"실행 중","toolCompleted":"완료","newConversation":"새 대화","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"미리보기","start":"미리보기 시작","stop":"미리보기 중지","starting":"시작 중...","notReady":"프로젝트가 미리보기 준비가 되지 않았습니다","waitForAI":"AI가 프로젝트 파일을 생성할 때까지 기다려주세요","openInNewTab":"새 탭에서 열기"},"fileExplorer":{"title":"파일","empty":"파일이 없습니다","loading":"파일 로딩 중...","error":"파일 로드 실패","open":"파일 탐색기 열기","close":"파일 탐색기 닫기"},"language":{"select":"언어","en":"English","ko":"한국어"},"settings":{"title":"설정","projectsPath":{"title":"프로젝트 폴더","description":"프로젝트가 저장되는 위치","saved":"설정이 저장되었습니다","note":"새 프로젝트는 이 폴더에 생성됩니다. 기존 프로젝트에는 영향을 주지 않습니다."}}}')},n=(0,a.v)()((0,r.Zr)(e=>({locale:"ko",setLocale:s=>e({locale:s})}),{name:"claudeship-locale"}));function c(){let e=n(e=>e.locale);return{t:(s,t)=>(function(e,s,t){let a=s||n.getState().locale,r=e.split("."),c=l[a];for(let s of r)if(c&&"object"==typeof c&&s in c)c=c[s];else{for(let s of(c=l.en,r))if(!c||"object"!=typeof c||!(s in c))return e;else c=c[s];break}let i="string"==typeof c?c:e;if(t)for(let[e,s]of Object.entries(t))i=i.replace(RegExp("\\{".concat(e,"\\}"),"g"),String(s));return i})(s,e,t),locale:e,setLocale:n(e=>e.setLocale)}}}},e=>{e.O(0,[992,574,59,498,358],()=>e(e.s=5006)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{660:(e,t,s)=>{"use strict";s.d(t,{F:()=>o});let a=s(5603).env.NEXT_PUBLIC_API_URL||"http://localhost:14000/api";async function r(e,t){let s="".concat(a).concat(e),r=await fetch(s,{...t,headers:{"Content-Type":"application/json",...null==t?void 0:t.headers}});if(!r.ok)throw Error((await r.json().catch(()=>({message:"Request failed"}))).message||"HTTP error! status: ".concat(r.status));if(204!==r.status)return r.json()}let o={get:e=>r(e),post:(e,t)=>r(e,{method:"POST",body:t?JSON.stringify(t):void 0}),put:(e,t)=>r(e,{method:"PUT",body:t?JSON.stringify(t):void 0}),delete:(e,t)=>r(e,{method:"DELETE",body:t?JSON.stringify(t):void 0}),uploadFiles:async(e,t)=>{let s=new FormData;t.forEach(e=>s.append("files",e));let r="".concat(a,"/projects/").concat(e,"/files/upload"),o=await fetch(r,{method:"POST",body:s});if(!o.ok)throw Error((await o.json().catch(()=>({message:"Upload failed"}))).message||"HTTP error! status: ".concat(o.status));return o.json()}}},794:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8964).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},2718:(e,t,s)=>{Promise.resolve().then(s.bind(s,3701))},3701:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(8481),r=s(8526),o=s(7176),n=s(5594),i=s(5338),l=s(794),c=s(8031),d=s(9696),u=s(6569),p=s(660),h=s(9426);function m(){let{t:e}=(0,h.B)(),[t,s]=(0,r.useState)(null),[m,f]=(0,r.useState)(""),[g,x]=(0,r.useState)(!0),[j,y]=(0,r.useState)(!1),[v,b]=(0,r.useState)(null),[N,w]=(0,r.useState)(!1);(0,r.useEffect)(()=>{k()},[]);let k=async()=>{try{let e=await p.F.get("/settings");s(e),f(e.projectsBasePath)}catch(e){b("Failed to load settings")}finally{x(!1)}},P=async()=>{y(!0),b(null),w(!1);try{let e=await p.F.put("/settings/projects-path",{path:m});e.success?(w(!0),f(e.path||m),setTimeout(()=>w(!1),3e3)):b(e.error||"Failed to save")}catch(e){b(e instanceof Error?e.message:"Failed to save")}finally{y(!1)}},A=t&&m!==t.projectsBasePath;return(0,a.jsxs)("div",{className:"flex min-h-screen flex-col",children:[(0,a.jsx)(o.Y,{title:e("settings.title"),showBack:!0,backHref:"/"}),(0,a.jsx)("main",{className:"flex-1 p-6",children:(0,a.jsx)("div",{className:"mx-auto max-w-2xl space-y-8",children:(0,a.jsxs)("section",{className:"rounded-lg border bg-card p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:(0,a.jsx)(l.A,{className:"h-5 w-5 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:e("settings.projectsPath.title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:e("settings.projectsPath.description")})]})]}),g?(0,a.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,a.jsx)(c.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.p,{value:m,onChange:e=>f(e.target.value),placeholder:"~/claudeship-projects",className:"font-mono text-sm"}),(0,a.jsx)(n.$,{onClick:P,disabled:j||!A,children:j?(0,a.jsx)(c.A,{className:"h-4 w-4 animate-spin"}):e("common.save")})]}),v&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),v]}),N&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)(u.A,{className:"h-4 w-4"}),e("settings.projectsPath.saved")]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:e("settings.projectsPath.note")})]})]})})})]})}},5338:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var a=s(8481),r=s(8526),o=s(9049);let n=r.forwardRef((e,t)=>{let{className:s,type:r,...n}=e;return(0,a.jsx)("input",{type:r,className:(0,o.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...n})});n.displayName="Input"},5594:(e,t,s)=>{"use strict";s.d(t,{$:()=>l});var a=s(8481),r=s(8526),o=s(4176),n=s(9049);let i=(0,o.F)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),l=r.forwardRef((e,t)=>{let{className:s,variant:r,size:o,...l}=e;return(0,a.jsx)("button",{className:(0,n.cn)(i({variant:r,size:o,className:s})),ref:t,...l})});l.displayName="Button"},6569:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8964).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},7176:(e,t,s)=>{"use strict";s.d(t,{Y:()=>p});var a=s(8481),r=s(4816),o=s.n(r),n=s(9432),i=s(9150),l=s(7746),c=s(5594),d=s(9426);function u(){let{locale:e,setLocale:t,t:s}=(0,d.B)();return(0,a.jsx)(c.$,{variant:"ghost",size:"icon",onClick:()=>{t("en"===e?"ko":"en")},className:"h-9 w-9 text-xs font-medium",title:s("language.select"),children:"en"===e?"EN":"KO"})}function p(e){let{title:t,showBack:s,backHref:r="/"}=e,{t:p}=(0,d.B)(),h=t||p("common.appName");return(0,a.jsx)("header",{className:"sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:(0,a.jsxs)("div",{className:"flex h-14 w-full items-center justify-between px-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[s?(0,a.jsx)(o(),{href:r,children:(0,a.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",children:(0,a.jsx)(i.A,{className:"h-5 w-5"})})}):(0,a.jsx)(n.default,{src:"/logo.svg",alt:"ClaudeShip",width:36,height:36,className:"rounded-lg"}),(0,a.jsx)("h1",{className:"text-lg font-semibold",children:h})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(u,{}),(0,a.jsx)(o(),{href:"/settings",children:(0,a.jsx)(c.$,{variant:"ghost",size:"icon",className:"h-9 w-9",title:p("header.settings"),children:(0,a.jsx)(l.A,{className:"h-5 w-5"})})})]})]})})}},8031:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8964).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9049:(e,t,s)=>{"use strict";s.d(t,{cn:()=>o});var a=s(5806),r=s(4159);function o(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,r.QP)((0,a.$)(t))}},9426:(e,t,s)=>{"use strict";s.d(t,{B:()=>i});var a=s(4876),r=s(1203);let o={en:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"Loading...","error":"Error","save":"Save","cancel":"Cancel","delete":"Delete","create":"Create","close":"Close","refresh":"Refresh","settings":"Settings"},"header":{"home":"Home","settings":"Settings"},"home":{"title":"My Projects","noProjects":"No projects yet","createFirst":"Create your first project to get started"},"project":{"create":"New Project","createDescription":"Build with AI","createTitle":"Create New Project","name":"Project Name","namePlaceholder":"my-awesome-app","type":"Project Type","typeWeb":"Web App","typeNative":"Native App","backendStack":"Backend Stack","backendNone":"Frontend Only","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"Delete Project","deleteConfirm":"Are you sure you want to delete this project?","updated":"Updated"},"chat":{"title":"Chat","placeholder":"Describe what you want to build...","askPlaceholder":"Ask a question about your project...","queuePlaceholder":"Queue another message...","send":"Send","thinking":"AI is thinking...","uploading":"Uploading files...","queueCount":"{count} message(s) queued","toolRunning":"Running","toolCompleted":"Completed","newConversation":"New Chat","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"Preview","start":"Start Preview","stop":"Stop Preview","starting":"Starting...","notReady":"Project not ready for preview","waitForAI":"Wait for AI to create the project files","openInNewTab":"Open in New Tab"},"fileExplorer":{"title":"Files","empty":"No files yet","loading":"Loading files...","error":"Failed to load files","open":"Open File Explorer","close":"Close File Explorer"},"language":{"select":"Language","en":"English","ko":"한국어"},"settings":{"title":"Settings","projectsPath":{"title":"Projects Folder","description":"Location where your projects are stored","saved":"Settings saved successfully","note":"New projects will be created in this folder. Existing projects are not affected."}}}'),ko:JSON.parse('{"common":{"appName":"ClaudeShip","loading":"로딩 중...","error":"오류","save":"저장","cancel":"취소","delete":"삭제","create":"생성","close":"닫기","refresh":"새로고침","settings":"설정"},"header":{"home":"홈","settings":"설정"},"home":{"title":"내 프로젝트","noProjects":"프로젝트가 없습니다","createFirst":"첫 번째 프로젝트를 만들어 시작하세요"},"project":{"create":"새 프로젝트","createDescription":"AI와 함께 만들기","createTitle":"새 프로젝트 생성","name":"프로젝트 이름","namePlaceholder":"my-awesome-app","type":"프로젝트 유형","typeWeb":"웹 앱","typeNative":"네이티브 앱","backendStack":"백엔드 스택","backendNone":"프론트엔드 전용","backendExpress":"Express (Node.js)","backendFastapi":"FastAPI (Python)","delete":"프로젝트 삭제","deleteConfirm":"이 프로젝트를 삭제하시겠습니까?","updated":"업데이트"},"chat":{"title":"채팅","placeholder":"만들고 싶은 것을 설명하세요...","askPlaceholder":"프로젝트에 대해 질문하세요...","queuePlaceholder":"다음 메시지를 입력하세요...","send":"전송","thinking":"AI가 생각 중...","uploading":"파일 업로드 중...","queueCount":"{count}개의 메시지가 대기 중","toolRunning":"실행 중","toolCompleted":"완료","newConversation":"새 대화","modeAsk":"Ask","modeBuild":"Build"},"preview":{"title":"미리보기","start":"미리보기 시작","stop":"미리보기 중지","starting":"시작 중...","notReady":"프로젝트가 미리보기 준비가 되지 않았습니다","waitForAI":"AI가 프로젝트 파일을 생성할 때까지 기다려주세요","openInNewTab":"새 탭에서 열기"},"fileExplorer":{"title":"파일","empty":"파일이 없습니다","loading":"파일 로딩 중...","error":"파일 로드 실패","open":"파일 탐색기 열기","close":"파일 탐색기 닫기"},"language":{"select":"언어","en":"English","ko":"한국어"},"settings":{"title":"설정","projectsPath":{"title":"프로젝트 폴더","description":"프로젝트가 저장되는 위치","saved":"설정이 저장되었습니다","note":"새 프로젝트는 이 폴더에 생성됩니다. 기존 프로젝트에는 영향을 주지 않습니다."}}}')},n=(0,a.v)()((0,r.Zr)(e=>({locale:"ko",setLocale:t=>e({locale:t})}),{name:"claudeship-locale"}));function i(){let e=n(e=>e.locale);return{t:(t,s)=>(function(e,t,s){let a=t||n.getState().locale,r=e.split("."),i=o[a];for(let t of r)if(i&&"object"==typeof i&&t in i)i=i[t];else{for(let t of(i=o.en,r))if(!i||"object"!=typeof i||!(t in i))return e;else i=i[t];break}let l="string"==typeof i?i:e;if(s)for(let[e,t]of Object.entries(s))l=l.replace(RegExp("\\{".concat(e,"\\}"),"g"),String(t));return l})(t,e,s),locale:e,setLocale:n(e=>e.setLocale)}}},9696:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(8964).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])}},e=>{e.O(0,[992,59,498,358],()=>e(e.s=2718)),_N_E=e.O()}]);
|
package/scripts/setup-hooks.sh
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Git hooks 설치 스크립트
|
|
4
|
-
|
|
5
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
-
HOOKS_DIR="$SCRIPT_DIR/hooks"
|
|
7
|
-
GIT_HOOKS_DIR="$(git rev-parse --git-dir)/hooks"
|
|
8
|
-
|
|
9
|
-
if [ ! -d "$GIT_HOOKS_DIR" ]; then
|
|
10
|
-
echo "❌ Git 저장소가 아닙니다."
|
|
11
|
-
exit 1
|
|
12
|
-
fi
|
|
13
|
-
|
|
14
|
-
echo "Git hooks 설치 중..."
|
|
15
|
-
|
|
16
|
-
for hook in "$HOOKS_DIR"/*; do
|
|
17
|
-
if [ -f "$hook" ]; then
|
|
18
|
-
hook_name=$(basename "$hook")
|
|
19
|
-
cp "$hook" "$GIT_HOOKS_DIR/$hook_name"
|
|
20
|
-
chmod +x "$GIT_HOOKS_DIR/$hook_name"
|
|
21
|
-
echo " ✓ $hook_name 설치됨"
|
|
22
|
-
fi
|
|
23
|
-
done
|
|
24
|
-
|
|
25
|
-
echo ""
|
|
26
|
-
echo "✅ Git hooks 설치 완료!"
|
/package/apps/web/.next/static/{mkY_TTl_ho_ehDKiX10AN → 64f6wJ9i280wH8tny9WCd}/_buildManifest.js
RENAMED
|
File without changes
|
/package/apps/web/.next/static/{mkY_TTl_ho_ehDKiX10AN → 64f6wJ9i280wH8tny9WCd}/_ssgManifest.js
RENAMED
|
File without changes
|