antigravity-mobile-proxy 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +21 -15
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +36 -0
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/artifacts/[convId]/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/artifacts/[convId]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/artifacts/active/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/artifacts/active/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/artifacts/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/changes/accept-all/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/changes/active/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/changes/diff/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/changes/reject-all/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/action/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/agent/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/approve/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/history/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/mode/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/monitor/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/new/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/reject/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/state/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/stop/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/chat/stream/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/conversations/active/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/conversations/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/conversations/select/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/debug/dom/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/debug/scrape/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/git/commit/route.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/commit/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/commit/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/diff/route.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/diff/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/diff/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/push/route.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/push/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/push/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/status/route.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/status/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/git/status/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/health/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/cdp-start/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/cdp-status/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/close/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/open/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/recent/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/windows/select/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/v1/workspace/content/route.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/workspace/content/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/workspace/content/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/workspace/files/route.js +1 -0
- package/.next/standalone/.next/server/app/api/v1/workspace/files/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/v1/workspace/files/route_client-reference-manifest.js +1 -0
- package/.next/standalone/.next/server/app/debug/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page.js +3 -3
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/~offline/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +21 -15
- package/.next/standalone/.next/server/chunks/1565.js +1 -1
- package/.next/standalone/.next/server/chunks/8107.js +1 -1
- package/.next/standalone/.next/server/chunks/948.js +1 -1
- package/.next/standalone/.next/server/instrumentation.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/static/chunks/app/_global-error/page-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/_not-found/page-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/artifacts/[convId]/[filename]/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/artifacts/[convId]/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/artifacts/active/[filename]/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/artifacts/active/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/artifacts/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/changes/accept-all/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/changes/active/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/changes/diff/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/changes/reject-all/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/action/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/agent/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/approve/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/history/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/mode/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/monitor/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/new/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/reject/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/state/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/stop/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/chat/stream/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/conversations/active/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/conversations/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/conversations/select/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/debug/dom/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/debug/scrape/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/git/commit/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/git/diff/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/git/push/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/git/status/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/health/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/windows/cdp-start/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/windows/cdp-status/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/windows/close/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/windows/open/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/windows/recent/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/windows/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/windows/select/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/workspace/content/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/api/v1/workspace/files/route-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/{layout-cc611f198bd594a0.js → layout-7757590e84032b92.js} +1 -1
- package/.next/static/chunks/app/not-found-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/app/page-b59642b4851f2952.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-cc79d4c747fe87b0.js +1 -0
- package/.next/static/chunks/{webpack-a8bd1bf5f31e6ddd.js → webpack-503a6513e11f0c2a.js} +1 -1
- package/.next/static/css/742a8e5707969683.css +1 -0
- package/.next/static/css/a9fb7d1761d6ce7a.css +1 -0
- package/.next/static/v1.1.4/_buildManifest.js +1 -0
- package/package.json +9 -3
- package/public/sw.js +1 -1
- package/.next/package.json +0 -1
- package/.next/standalone/.next/package.json +0 -1
- package/.next/standalone/package.json +0 -82
- package/.next/static/chunks/app/_global-error/page-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/_not-found/page-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/artifacts/[convId]/[filename]/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/artifacts/[convId]/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/artifacts/active/[filename]/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/artifacts/active/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/artifacts/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/changes/accept-all/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/changes/active/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/changes/diff/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/changes/reject-all/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/action/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/agent/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/approve/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/history/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/mode/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/monitor/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/new/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/reject/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/state/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/stop/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/chat/stream/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/conversations/active/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/conversations/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/conversations/select/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/debug/dom/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/debug/scrape/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/health/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/windows/cdp-start/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/windows/cdp-status/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/windows/close/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/windows/open/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/windows/recent/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/windows/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/api/v1/windows/select/route-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/not-found-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/app/page-08b53f22073517a9.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-691720a1ac05c31e.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-691720a1ac05c31e.js +0 -1
- package/.next/static/css/5bd02429b9414cd4.css +0 -1
- package/.next/static/v1.1.2/_buildManifest.js +0 -1
- /package/.next/static/{v1.1.2 → v1.1.4}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(()=>{var a={};a.id=8974,a.ids=[8974],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},380:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23)),Promise.resolve().then(c.t.bind(c,440,23)),Promise.resolve().then(c.t.bind(c,4342,23)),Promise.resolve().then(c.t.bind(c,2265,23)),Promise.resolve().then(c.t.bind(c,5421,23)),Promise.resolve().then(c.t.bind(c,1335,23)),Promise.resolve().then(c.t.bind(c,664,23)),Promise.resolve().then(c.bind(c,4661))},722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},985:(a,b,c)=>{Promise.resolve().then(c.bind(c,7728))},1025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},1245:(a,b,c)=>{Promise.resolve().then(c.bind(c,6187))},2056:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>m,dynamic:()=>j,metadata:()=>k,viewport:()=>l});var d=c(5735),e=c(7014),f=c.n(e),g=c(9345),h=c.n(g);c(2704);var i=c(5026);let j="force-dynamic",k={title:"Antigravity Agent",description:"Chat with the Antigravity AI Agent from any browser",applicationName:"Antigravity Agent",manifest:"/manifest.json",appleWebApp:{capable:!0,statusBarStyle:"black-translucent",title:"Antigravity Agent"},formatDetection:{telephone:!1}},l={width:"device-width",initialScale:1,maximumScale:1,viewportFit:"cover",themeColor:"#0a0a0f"};function m({children:a}){return(0,d.jsx)("html",{lang:"en",className:`${f().variable} ${h().variable}`,children:(0,d.jsxs)("body",{children:[a,(0,d.jsx)(i.default,{})]})})}},2237:(a,b,c)=>{"use strict";a.exports=c(6862)},2654:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23))},2704:()=>{},2918:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23))},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3502:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>D.a,__next_app__:()=>L,handler:()=>N,routeModule:()=>M});var d=c(7553),e=c(4006),f=c(7798),g=c(4775),h=c(9373),i=c(3461),j=c(1020),k=c(6349),l=c(4365),m=c(6023),n=c(3747),o=c(4235),p=c(3938),q=c(261),r=c(6758),s=c(7243),t=c(6713),u=c(7527),v=c(2820),w=c(8216),x=c(7929),y=c(9551),z=c(9125),A=c(6439),B=c(7068),C=c(5547),D=c.n(C),E=c(1287),F=c(1494),G=c(722),H=c(753),I=c(3954),J={};for(let a in E)0>["default","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(J[a]=()=>E[a]);c.d(b,J);let K={children:["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,9647)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/page.tsx"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,6055))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(c.bind(c,2056)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,5547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.bind(c,7548)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/not-found.tsx"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,5270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,8193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,6055))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]}.children,L={require:c,loadChunk:()=>Promise.resolve()},M=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:K},distDir:".next",relativeProjectDir:""});async function N(a,b,d){var C;M.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let J=!!(0,h.getRequestMeta)(a,"minimalMode"),O="/page";"/index"===O&&(O="/");let P=await M.prepare(a,b,{srcPage:O,multiZoneDraftMode:!1});if(!P)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Q,query:R,params:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:$,isDraftMode:_,resolvedPathname:aa,revalidateOnlyGenerated:ab,routerServerContext:ac,nextConfig:ad,parsedUrl:ae,interceptionRoutePatterns:af,deploymentId:ag}=P,ah=(0,q.normalizeAppPath)(O),{isOnDemandRevalidate:ai}=P,aj=ad.experimental.ppr&&!ad.cacheComponents&&(0,I.isInterceptionRouteAppPath)(aa)?null:M.match(aa,$),ak=!!$.routes[aa],al=a.headers["user-agent"]||"",am=(0,t.getBotType)(al),an=(0,p.isHtmlBotRequest)(a),ao=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[s.NEXT_ROUTER_PREFETCH_HEADER],ap=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[s.RSC_HEADER],aq=(0,r.getIsPossibleServerAction)(a),ar=(0,m.checkIsAppPPREnabled)(ad.experimental.ppr);if(!(0,h.getRequestMeta)(a,"postponed")&&ar&&"1"===a.headers[x.NEXT_RESUME_HEADER]&&"POST"===a.method){let b=[];for await(let c of a)b.push(c);let c=Buffer.concat(b).toString("utf8");(0,h.addRequestMeta)(a,"postponed",c)}let as=ar&&(null==(C=$.routes[ah]??$.dynamicRoutes[ah])?void 0:C.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?(0,h.getRequestMeta)(a,"postponed"):void 0,aw=as&&ap&&!ao;J&&(aw=aw&&!!av);let ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=(!an||!as)&&(!al||(0,p.shouldServeStreamingMetadata)(al,ad.htmlLimitedBots)),az=!!((aj||ak||$.routes[ah])&&!(an&&as)),aA=as&&!0===ad.cacheComponents,aB=!0===M.isDev||!az||"string"==typeof av||(aA&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aw&&!J:aw),aC=an&&as,aD=null;_||!az||aB||aq||av||aw||(aD=aa);let aE=aD;!aE&&M.isDev&&(aE=aa),M.isDev||_||!az||!ap||aw||(0,k.d)(a.headers);let aF={...E,tree:K,GlobalError:D(),handler:N,routeModule:M,__next_app__:L};X&&Y&&(0,o.setManifestsSingleton)({page:O,clientReferenceManifest:Y,serverActionsManifest:X});let aG=a.method||"GET",aH=(0,g.getTracer)(),aI=aH.getActiveScopeSpan(),aJ=async()=>((null==ac?void 0:ac.render404)?await ac.render404(a,b,ae,!1):b.end("This page could not be found"),null);try{let f=M.getVaryHeader(aa,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return M.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aH.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aG} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aG} ${O}`)})},m=(0,h.getRequestMeta)(a,"incrementalCache"),o=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let l={query:R,params:S,page:ah,sharedContext:{buildId:Q},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aF,Component:(0,j.T)(aF),params:S,routeModule:M,page:O,postponed:f,shouldWaitOnAllReady:aC,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||aB,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,setCacheStatus:null==ac?void 0:ac.setCacheStatus,setIsrStatus:null==ac?void 0:ac.setIsrStatus,setReactDebugChannel:null==ac?void 0:ac.setReactDebugChannel,sendErrorsToBrowser:null==ac?void 0:ac.sendErrorsToBrowser,dir:c(3873).join(process.cwd(),M.relativeProjectDir),isDraftMode:_,botType:am,isOnDemandRevalidate:ai,isPossibleServerAction:aq,assetPrefix:ad.assetPrefix,nextConfigOutput:ad.output,crossOrigin:ad.crossOrigin,trailingSlash:ad.trailingSlash,images:ad.images,previewProps:$.preview,deploymentId:ag,enableTainting:ad.experimental.taint,htmlLimitedBots:ad.htmlLimitedBots,reactMaxHeadersLength:ad.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:m,cacheLifeProfiles:ad.cacheLife,basePath:ad.basePath,serverActions:ad.experimental.serverActions,...at||au?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:at}:{},cacheComponents:!!ad.cacheComponents,experimental:{isRoutePPREnabled:as,expireTime:ad.expireTime,staleTimes:ad.experimental.staleTimes,dynamicOnHover:!!ad.experimental.dynamicOnHover,inlineCss:!!ad.experimental.inlineCss,authInterrupts:!!ad.experimental.authInterrupts,clientTraceMetadata:ad.experimental.clientTraceMetadata||[],clientParamParsingOrigins:ad.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,B.parseMaxPostponedStateSize)(ad.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>M.onRequestError(a,b,d,e,ac),err:(0,h.getRequestMeta)(a,"invokeError"),dev:M.isDev}};at&&(l.renderOpts.nextExport=!0,l.renderOpts.supportsDynamicResponse=!1,l.renderOpts.isDebugDynamicAccesses=at),i&&(l.renderOpts.supportsDynamicResponse=!1);let n=await k(e,l),{metadata:o}=n,{cacheControl:p,headers:q={},fetchTags:r,fetchMetrics:s}=o;if(r&&(q[x.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,az&&(null==p?void 0:p.revalidate)===0&&!M.isDev&&!as){let a=o.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${aa}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
|
|
2
|
-
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:u.CachedRouteKind.APP_PAGE,html:n,headers:q,rscData:o.flightData,postponed:o.postponed,status:o.statusCode,segmentData:o.segmentData},cacheControl:p}},p=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i,forceStaticRender:j=!1})=>{let k,l=!1===M.isDev,q=c||b.writableEnded;if(ai&&ab&&!f&&!J)return(null==ac?void 0:ac.render404)?await ac.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(aj&&(k=(0,v.parseFallbackField)(aj.fallback)),k===v.FallbackMode.PRERENDER&&(0,t.isBot)(al)&&(!as||an)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ai=!0),ai&&(k!==v.FallbackMode.NOT_FOUND||f)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),!J&&k!==v.FallbackMode.BLOCKING_STATIC_RENDER&&aE&&!q&&!_&&T&&(l||!ak)){if((l||aj)&&k===v.FallbackMode.NOT_FOUND){if(ad.experimental.adapterPath)return await aJ();throw new A.NoFallbackError}if(as&&(ad.cacheComponents?!aw:!ap)){let b=l&&"string"==typeof(null==aj?void 0:aj.fallback)?aj.fallback:ah,c=l&&(null==aj?void 0:aj.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(aj.fallbackRouteParams):au?(0,n.getFallbackRouteParams)(ah,M):null,f=await M.handleResponse({cacheKey:b,req:a,nextConfig:ad,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:$,isRoutePPREnabled:as,responseGenerator:async()=>o({span:i,postponed:void 0,fallbackRouteParams:c,forceStaticRender:!1}),waitUntil:d.waitUntil,isMinimalMode:J});if(null===f)return null;if(f)return delete f.cacheControl,f}}let r=ai||g||!av?void 0:av;if(aA&&!J&&m&&aw&&!j){let b=await m.get(aa,{kind:u.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===u.CachedRouteKind.APP_PAGE&&(r=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,H.scheduleOnNextTick)(async()=>{let b=M.getResponseCache(a);try{await b.revalidate(aa,m,as,!1,a=>p({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if(at&&void 0!==r)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:u.CachedRouteKind.PAGES,html:w.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let s=l&&(null==aj?void 0:aj.fallbackRouteParams)&&(0,h.getRequestMeta)(a,"renderFallbackShell")?(0,n.createOpaqueFallbackRouteParams)(aj.fallbackRouteParams):au?(0,n.getFallbackRouteParams)(ah,M):null;return o({span:i,postponed:r,fallbackRouteParams:s,forceStaticRender:j})},q=async c=>{var f,g,i,j,k;let l,m=await M.handleResponse({cacheKey:aD,responseGenerator:a=>p({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ai,isRoutePPREnabled:as,req:a,nextConfig:ad,prerenderManifest:$,waitUntil:d.waitUntil,isMinimalMode:J});if(_&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),M.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!m){if(aD)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=m.value)?void 0:f.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=m.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let n="string"==typeof m.value.postponed;az&&!aw&&(!n||ao)&&(J||b.setHeader("x-nextjs-cache",ai?"REVALIDATED":m.isMiss?"MISS":m.isStale?"STALE":"HIT"),b.setHeader(s.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=m;if(av)l={revalidate:0,expire:void 0};else if(aw)l={revalidate:0,expire:void 0};else if(!M.isDev)if(_)l={revalidate:0,expire:void 0};else if(az){if(m.cacheControl)if("number"==typeof m.cacheControl.revalidate){if(m.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${m.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:m.cacheControl.revalidate,expire:(null==(j=m.cacheControl)?void 0:j.expire)??ad.expireTime}}else l={revalidate:x.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(m.cacheControl=l,"string"==typeof ax&&(null==q?void 0:q.kind)===u.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[x.NEXT_CACHE_TAGS_HEADER];J&&az&&c&&"string"==typeof c&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ax);return void 0!==d?(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.fromStatic(d,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl}):(b.statusCode=204,(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl}))}let r=aA?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r(m,{url:(0,h.getRequestMeta)(a,"initURL")??a.url}))return null;if(q.headers){let a={...q.headers};for(let[c,d]of(J&&az||delete a[x.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let t=null==(g=q.headers)?void 0:g[x.NEXT_CACHE_TAGS_HEADER];if(J&&az&&t&&"string"==typeof t&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,t),!q.status||ap&&as||(b.statusCode=q.status),!J&&q.status&&F.RedirectStatusCode[q.status]&&ap&&(b.statusCode=200),n&&!aw&&b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"1"),ap&&!_){if(void 0===q.rscData){if(q.html.contentType!==s.RSC_CONTENT_TYPE_HEADER)if(ad.cacheComponents)return b.statusCode=404,(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl});else throw Object.defineProperty(new G.InvariantError(`Expected RSC response, got ${q.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:q.html,cacheControl:m.cacheControl})}return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.fromStatic(q.rscData,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl})}let v=q.html;if(!n||J||ap)return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:m.cacheControl});if(at)return v.push(new ReadableStream({start(a){a.enqueue(y.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}});let A=new TransformStream;return v.push(A.readable),o({span:c,postponed:q.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(A.writable)}).catch(a=>{A.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})};if(!aI)return await aH.withPropagatedContext(a.headers,()=>aH.trace(i.BaseServerSpan.handleRequest,{spanName:`${aG} ${O}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aG,"http.target":a.url}},q));await q(aI)}catch(b){throw b instanceof A.NoFallbackError||await M.onRequestError(a,b,{routerKind:"App Router",routePath:O,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:az,isOnDemandRevalidate:ai})},!1,ac),b}}},3873:a=>{"use strict";a.exports=require("path")},3948:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23)),Promise.resolve().then(c.t.bind(c,5098,23)),Promise.resolve().then(c.t.bind(c,7644,23)),Promise.resolve().then(c.t.bind(c,3859,23)),Promise.resolve().then(c.t.bind(c,8099,23)),Promise.resolve().then(c.t.bind(c,6237,23)),Promise.resolve().then(c.t.bind(c,8562,23)),Promise.resolve().then(c.t.bind(c,6675,23))},3954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},4776:(a,b,c)=>{"use strict";let d;c.d(b,{default:()=>av});var e=c(8249),f=c(7484),g=Object.prototype.hasOwnProperty;let h=new WeakMap,i=()=>{},j=i(),k=Object,l=a=>a===j,m=(a,b)=>({...a,...b}),n={},o={},p="undefined",q=typeof document!=p,r=!1,s=(a,b)=>{let c=h.get(a);return[()=>!l(b)&&a.get(b)||n,d=>{if(!l(b)){let e=a.get(b);b in o||(o[b]=e),c[5](b,m(e,d),e||n)}},c[6],()=>!l(b)&&b in o?o[b]:!l(b)&&a.get(b)||n]},t=!0,[u,v]=[i,i],w={initFocus:a=>(q&&document.addEventListener("visibilitychange",a),u("focus",a),()=>{q&&document.removeEventListener("visibilitychange",a),v("focus",a)}),initReconnect:a=>{let b=()=>{t=!0,a()},c=()=>{t=!1};return u("online",b),u("offline",c),()=>{v("online",b),v("offline",c)}}},x=!f.useId,y=!0,z=y?f.useEffect:f.useLayoutEffect,A="u">typeof navigator&&navigator.connection,B=!y&&A&&(["slow-2g","2g"].includes(A.effectiveType)||A.saveData),C=new WeakMap,D=(a,b)=>a===`[object ${b}]`,E=0,F=a=>{let b,c,d=typeof a,e=k.prototype.toString.call(a),f=D(e,"Date"),g=D(e,"RegExp"),h=D(e,"Object");if(k(a)!==a||f||g)b=f?a.toJSON():"symbol"==d?a.toString():"string"==d?JSON.stringify(a):""+a;else{if(b=C.get(a))return b;if(b=++E+"~",C.set(a,b),Array.isArray(a)){for(c=0,b="@";c<a.length;c++)b+=F(a[c])+",";C.set(a,b)}if(h){b="#";let d=k.keys(a).sort();for(;!l(c=d.pop());)l(a[c])||(b+=c+":"+F(a[c])+",");C.set(a,b)}}return b},G=a=>{if("function"==typeof a)try{a=a()}catch(b){a=""}let b=a;return[a="string"==typeof a?a:(Array.isArray(a)?a.length:a)?F(a):"",b]},H=0,I=()=>++H;async function J(...a){let[b,c,d,e]=a,f=m({populateCache:!0,throwOnError:!0},"boolean"==typeof e?{revalidate:e}:e||{}),g=f.populateCache,i=f.rollbackOnError,k=f.optimisticData,n=f.throwOnError;if("function"==typeof c){let a=[];for(let d of b.keys())!/^\$(inf|sub)\$/.test(d)&&c(b.get(d)._k)&&a.push(d);return Promise.all(a.map(o))}return o(c);async function o(c){let e,[m]=G(c);if(!m)return;let[o,p]=s(b,m),[q,r,t,u]=h.get(b),v=()=>{let a=q[m];return("function"==typeof f.revalidate?f.revalidate(o().data,c):!1!==f.revalidate)&&(delete t[m],delete u[m],a&&a[0])?a[0](2).then(()=>o().data):o().data};if(a.length<3)return v();let w=d,x=!1,y=I();r[m]=[y,0];let z=!l(k),A=o(),B=A.data,C=A._c,D=l(C)?B:C;if(z&&p({data:k="function"==typeof k?k(D,B):k,_c:D}),"function"==typeof w)try{w=w(D)}catch(a){e=a,x=!0}if(w&&"function"==typeof w.then){let a;if(w=await w.catch(a=>{e=a,x=!0}),y!==r[m][0]){if(x)throw e;return w}x&&z&&(a=e,"function"==typeof i?i(a):!1!==i)&&(g=!0,p({data:D,_c:j}))}if(g&&!x&&("function"==typeof g?p({data:g(w,D),error:j,_c:j}):p({data:w,error:j,_c:j})),r[m][1]=I(),Promise.resolve(v()).then(()=>{p({_c:j})}),x){if(n)throw e;return}return w}}let K=(a,b)=>{for(let c in a)a[c][0]&&a[c][0](b)},L=(a,b)=>{if(!h.has(a)){let c=m(w,b),d=Object.create(null),e=J.bind(j,a),f=i,g=Object.create(null),k=(a,b)=>{let c=g[a]||[];return g[a]=c,c.push(b),()=>c.splice(c.indexOf(b),1)},l=(b,c,d)=>{a.set(b,c);let e=g[b];if(e)for(let a of e)a(c,d)},n=()=>{if(!h.has(a)&&(h.set(a,[d,Object.create(null),Object.create(null),Object.create(null),e,l,k]),!y)){let b=c.initFocus(setTimeout.bind(j,K.bind(j,d,0))),e=c.initReconnect(setTimeout.bind(j,K.bind(j,d,1)));f=()=>{b&&b(),e&&e(),h.delete(a)}}};return n(),[a,e,n,f]}return[a,h.get(a)[4]]},[M,N]=L(new Map),O=m({onLoadingSlow:i,onSuccess:i,onError:i,onErrorRetry:(a,b,c,d,e)=>{let f=c.errorRetryCount,g=e.retryCount,h=~~((Math.random()+.5)*(1<<(g<8?g:8)))*c.errorRetryInterval;(l(f)||!(g>f))&&setTimeout(d,h,e)},onDiscarded:i,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:B?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:B?5e3:3e3,compare:function a(b,c){var d,e;if(b===c)return!0;if(b&&c&&(d=b.constructor)===c.constructor){if(d===Date)return b.getTime()===c.getTime();if(d===RegExp)return b.toString()===c.toString();if(d===Array){if((e=b.length)===c.length)for(;e--&&a(b[e],c[e]););return -1===e}if(!d||"object"==typeof b){for(d in e=0,b)if(g.call(b,d)&&++e&&!g.call(c,d)||!(d in c)||!a(b[d],c[d]))return!1;return Object.keys(c).length===e}}return b!=b&&c!=c},isPaused:()=>!1,cache:M,mutate:N,fallback:{}},{isOnline:()=>t,isVisible:()=>{let a=q&&document.visibilityState;return l(a)||"hidden"!==a}}),P=(a,b)=>{let c=m(a,b);if(b){let{use:d,fallback:e}=a,{use:f,fallback:g}=b;d&&f&&(c.use=d.concat(f)),e&&g&&(c.fallback=m(e,g))}return c},Q=(0,f.createContext)({}),R=!1,S=R?window.__SWR_DEVTOOLS_USE__:[],T=()=>{let a=(0,f.useContext)(Q);return(0,f.useMemo)(()=>m(O,a),[a])},U=S.concat(a=>(b,c,d)=>{let e=c&&((...a)=>{let[d]=G(b),[,,,e]=h.get(M);if(d.startsWith("$inf$"))return c(...a);let f=e[d];return l(f)?c(...a):(delete e[d],f)});return a(b,e,d)});R&&(window.__SWR_DEVTOOLS_REACT__=f);var V=c(2237);let W=()=>{},X=W(),Y=(new WeakMap,f.use||(a=>{switch(a.status){case"pending":throw a;case"fulfilled":return a.value;case"rejected":throw a.reason;default:throw a.status="pending",a.then(b=>{a.status="fulfilled",a.value=b},b=>{a.status="rejected",a.reason=b}),a}})),Z={dedupe:!0},$=Promise.resolve(j),_=()=>i;k.defineProperty(a=>{let{value:b}=a,c=(0,f.useContext)(Q),d="function"==typeof b,e=(0,f.useMemo)(()=>d?b(c):b,[d,c,b]),g=(0,f.useMemo)(()=>d?e:P(c,e),[d,c,e]),h=e&&e.provider,i=(0,f.useRef)(j);h&&!i.current&&(i.current=L(h(g.cache||M),e));let k=i.current;return k&&(g.cache=k[0],g.mutate=k[1]),z(()=>{if(k)return k[2]&&k[2](),k[3]},[]),(0,f.createElement)(Q.Provider,m(a,{value:g}))},"defaultValue",{value:O});let aa=(d=(a,b,c)=>{let{cache:d,compare:e,suspense:g,fallbackData:i,revalidateOnMount:k,revalidateIfStale:n,refreshInterval:o,refreshWhenHidden:p,refreshWhenOffline:q,keepPreviousData:r,strictServerPrefetchWarning:t}=c,[u,v,w,A]=h.get(d),[B,C]=G(a),D=(0,f.useRef)(!1),E=(0,f.useRef)(!1),F=(0,f.useRef)(B),H=(0,f.useRef)(b),K=(0,f.useRef)(c),L=()=>K.current.isVisible()&&K.current.isOnline(),[M,N,O,P]=s(d,B),Q=(0,f.useRef)({}).current,R=l(i)?l(c.fallback)?j:c.fallback[B]:i,S=(a,b)=>{for(let c in Q)if("data"===c){if(!e(a[c],b[c])&&(!l(a[c])||!e(ae,b[c])))return!1}else if(b[c]!==a[c])return!1;return!0},T=!D.current,U=(0,f.useMemo)(()=>{let a=M(),c=P(),d=a=>{let c=m(a);return(delete c._k,(()=>{if(!B||!b||K.current.isPaused())return!1;if(T&&!l(k))return k;let a=l(R)?c.data:R;return l(a)||n})())?{isValidating:!0,isLoading:!0,...c}:c},e=d(a),f=a===c?e:d(c),g=e;return[()=>{let a=d(M());return S(a,g)?(g.data=a.data,g.isLoading=a.isLoading,g.isValidating=a.isValidating,g.error=a.error,g):(g=a,a)},()=>f]},[d,B]),W=(0,V.useSyncExternalStore)((0,f.useCallback)(a=>O(B,(b,c)=>{S(c,b)||a()}),[d,B]),U[0],U[1]),X=u[B]&&u[B].length>0,aa=W.data,ab=l(aa)?R&&"function"==typeof R.then?Y(R):R:aa,ac=W.error,ad=(0,f.useRef)(ab),ae=r?l(aa)?l(ad.current)?ab:ad.current:aa:ab,af=B&&l(ab),ag=(0,f.useRef)(null);y||(0,V.useSyncExternalStore)(_,()=>(ag.current=!1,ag),()=>(ag.current=!0,ag));let ah=ag.current;t&&ah&&!g&&af&&console.warn(`Missing pre-initiated data for serialized key "${B}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let ai=!(!B||!b||K.current.isPaused())&&(!X||!!l(ac))&&(T&&!l(k)?k:g?!l(ab)&&n:l(ab)||n),aj=T&&ai,ak=l(W.isValidating)?aj:W.isValidating,al=l(W.isLoading)?aj:W.isLoading,am=(0,f.useCallback)(async a=>{let b,d,f=H.current;if(!B||!f||E.current||K.current.isPaused())return!1;let g=!0,h=a||{},i=!w[B]||!h.dedupe,k=()=>x?!E.current&&B===F.current&&D.current:B===F.current,m={isValidating:!1,isLoading:!1},n=()=>{N(m)},o=()=>{let a=w[B];a&&a[1]===d&&delete w[B]},p={isValidating:!0};l(M().data)&&(p.isLoading=!0);try{if(i&&(N(p),c.loadingTimeout&&l(M().data)&&setTimeout(()=>{g&&k()&&K.current.onLoadingSlow(B,c)},c.loadingTimeout),w[B]=[f(C),I()]),[b,d]=w[B],b=await b,i&&setTimeout(o,c.dedupingInterval),!w[B]||w[B][1]!==d)return i&&k()&&K.current.onDiscarded(B),!1;m.error=j;let a=v[B];if(!l(a)&&(d<=a[0]||d<=a[1]||0===a[1]))return n(),i&&k()&&K.current.onDiscarded(B),!1;let h=M().data;m.data=e(h,b)?h:b,i&&k()&&K.current.onSuccess(b,B,c)}catch(c){o();let a=K.current,{shouldRetryOnError:b}=a;!a.isPaused()&&(m.error=c,i&&k())&&(a.onError(c,B,a),(!0===b||"function"==typeof b&&b(c))&&(!K.current.revalidateOnFocus||!K.current.revalidateOnReconnect||L())&&a.onErrorRetry(c,B,a,a=>{let b=u[B];b&&b[0]&&b[0](3,a)},{retryCount:(h.retryCount||0)+1,dedupe:!0}))}return g=!1,n(),!0},[B,d]),an=(0,f.useCallback)((...a)=>J(d,F.current,...a),[]);if(z(()=>{H.current=b,K.current=c,l(aa)||(ad.current=aa)}),z(()=>{var a;let b;if(!B)return;let c=am.bind(j,Z),d=0;K.current.revalidateOnFocus&&(d=Date.now()+K.current.focusThrottleInterval);let e=(a=(a,b={})=>{if(0==a){let a=Date.now();K.current.revalidateOnFocus&&a>d&&L()&&(d=a+K.current.focusThrottleInterval,c())}else if(1==a)K.current.revalidateOnReconnect&&L()&&c();else if(2==a)return am();else if(3==a)return am(b)},(b=u[B]||(u[B]=[])).push(a),()=>{let c=b.indexOf(a);c>=0&&(b[c]=b[b.length-1],b.pop())});if(E.current=!1,F.current=B,D.current=!0,N({_k:C}),ai&&!w[B])if(l(ab)||y)c();else setTimeout(c,1);return()=>{E.current=!0,e()}},[B]),z(()=>{let a;function b(){let b="function"==typeof o?o(M().data):o;b&&-1!==a&&(a=setTimeout(c,b))}function c(){!M().error&&(p||K.current.isVisible())&&(q||K.current.isOnline())?am(Z).then(b):b()}return b(),()=>{a&&(clearTimeout(a),a=-1)}},[o,p,q,B]),(0,f.useDebugValue)(ae),g){if(!x&&y&&af)throw Error("Fallback data is required when using Suspense in SSR.");af&&(H.current=b,K.current=c,E.current=!1);let a=A[B];if(Y(!l(a)&&af?an(a):$),!l(ac)&&af)throw ac;let d=af?am(Z):$;!l(ae)&&af&&(d.status="fulfilled",d.value=!0),Y(d)}return{mutate:an,get data(){return Q.data=!0,ae},get error(){return Q.error=!0,ac},get isValidating(){return Q.isValidating=!0,ak},get isLoading(){return Q.isLoading=!0,al}}},function(...a){let b=T(),[c,e,f]="function"==typeof a[1]?[a[0],a[1],a[2]||{}]:[a[0],null,(null===a[1]?a[2]:a[1])||{}],g=P(b,f),h=d,{use:i}=g,j=(i||[]).concat(U);for(let a=j.length;a--;)h=j[a](h);return h(c,e||g.fetcher||null,g)}),ab="/api/v1",ac=a=>fetch(a).then(a=>a.json()),ad={windows:`${ab}/windows`,cdpStatus:`${ab}/windows/cdp-status`,conversations:`${ab}/conversations`,recentProjects:`${ab}/windows/recent`,artifacts:`${ab}/artifacts/active`,changes:`${ab}/changes/active`,history:`${ab}/chat/history`,mode:`${ab}/chat/mode`,agent:`${ab}/chat/agent`,health:`${ab}/health`},ae="/api/v1",af="/api/v1";function ag(a){if(!a)return"";let b=new Date(a),c=Math.floor((Date.now()-b.getTime())/6e4);if(c<1)return"now";if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d} hr${1!==d?"s":""} ago`;let e=Math.floor(d/24);if(e<7)return`${e} day${1!==e?"s":""} ago`;let f=Math.floor(e/7);return`${f} wk${1!==f?"s":""} ago`}function ah({conversations:a,activeConversation:b,onSelect:c}){let[d,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)(!1),j=(0,f.useRef)(null),k=(0,f.useCallback)(()=>{g(!1),i(!1)},[]),l=a.find(a=>a.active)||null,m=[...a.filter(a=>!a.active)].sort((a,b)=>a.mtime||b.mtime?a.mtime?b.mtime?new Date(b.mtime).getTime()-new Date(a.mtime).getTime():-1:1:0),n=h?m:m.slice(0,5),o=m.length-5;return(0,e.jsxs)("div",{ref:j,className:`conv-selector-wrapper ${d?"open":""}`,children:[(0,e.jsxs)("button",{className:"conv-selector-btn",onClick:()=>g(!d),title:"Switch conversation",children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),(0,e.jsx)("span",{children:b?.title?.substring(0,22)||"Select a conversation"}),(0,e.jsx)("svg",{className:"chevron",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`conv-dropdown ${d?"open":""}`,children:[(0,e.jsx)("div",{className:"conv-dropdown-header",children:"Select a conversation"}),(0,e.jsxs)("div",{className:"conv-dropdown-list",children:[l&&(0,e.jsxs)("div",{className:"conv-section",children:[(0,e.jsx)("div",{className:"conv-section-label",children:"Current"}),(0,e.jsx)("button",{className:"conv-item active",onClick:()=>{-1!==l.index&&c(l.title),k()},children:(0,e.jsxs)("div",{className:"conv-item-header",children:[(0,e.jsx)("span",{className:"conv-item-title",children:l.title||"Untitled"}),l.mtime&&(0,e.jsx)("span",{className:"conv-item-time",children:ag(l.mtime)}),(0,e.jsx)("span",{role:"button",tabIndex:0,className:"conv-item-action",title:"Current conversation",onClick:a=>a.stopPropagation(),onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&a.stopPropagation()},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,e.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,e.jsx)("path",{d:"M10 11v6M14 11v6"}),(0,e.jsx)("path",{d:"M9 6V4h6v2"})]})})]})})]}),n.length>0&&(0,e.jsxs)("div",{className:"conv-section",children:[(0,e.jsxs)("div",{className:"conv-section-label",children:["Recent",m.length>0&&(0,e.jsx)("span",{className:"conv-section-count",children:m.length})]}),n.map((a,b)=>{let d=a.title||a.id.substring(0,20)+"…";return(0,e.jsx)("button",{className:"conv-item",onClick:()=>{c(a.title),k()},children:(0,e.jsxs)("div",{className:"conv-item-header",children:[a.active&&(0,e.jsx)("span",{className:"conv-item-dot active"}),(0,e.jsx)("span",{className:"conv-item-title",children:d}),a.mtime&&(0,e.jsx)("span",{className:"conv-item-time",children:ag(a.mtime)})]})},`conv-${b}`)}),!h&&o>0&&(0,e.jsxs)("button",{className:"conv-show-more",onClick:a=>{a.stopPropagation(),i(!0)},children:["Show ",o," more…"]})]}),0===a.length&&(0,e.jsx)("div",{className:"conv-dropdown-empty",children:"No conversations found"})]})]})]})}function ai({statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,onSelectWindow:j,onSelectConversation:k,onNewChat:l,onStartCdp:m,onOpenWindow:n,onCloseWindow:o}){let[p,q]=(0,f.useState)(!1),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)(!1),[v,w]=(0,f.useState)(!1),[x,y]=(0,f.useState)(null),z=(0,f.useRef)(null),A=(0,f.useRef)(null),B=async()=>{let a=i.length>0?i[0].path:".";w(!0),y(null);try{let b=await m(a,!0);y({text:b.message||(b.success?"CDP started!":"Failed to start CDP"),type:b.success?"success":"error"})}catch{y({text:"Failed to start CDP server",type:"error"})}finally{w(!1)}},C=async a=>{a.preventDefault();let b=r.trim();if(b&&!t){u(!0),y(null);try{let a=await n(b);y({text:a.message||(a.success?"Window opened!":"Failed to open"),type:a.success?"success":"error"}),a.success&&s("")}catch{y({text:"Failed to open window",type:"error"})}finally{u(!1)}}},D=async(a,b,d)=>{if(d.stopPropagation(),!window.confirm(`Close window "${c[a]?.title||a}"?`))return;let e=await o(a,b);y({text:e.message||(e.success?"Closed!":"Failed to close"),type:e.success?"success":"error"})};return(0,e.jsxs)("header",{className:"header",children:[(0,e.jsx)("div",{className:"header-left",children:(0,e.jsx)("div",{className:"logo",children:(0,e.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"url(#header-gradient)",strokeWidth:"1.5",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"header-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,e.jsx)("stop",{offset:"0%",style:{stopColor:"#6366f1"}}),(0,e.jsx)("stop",{offset:"100%",style:{stopColor:"#a855f7"}})]})}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,e.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})})}),(0,e.jsxs)("div",{className:"header-right",children:[(0,e.jsx)(ah,{conversations:d,activeConversation:g,onSelect:k}),(0,e.jsxs)("div",{ref:z,className:`window-selector-wrapper ${p?"open":""}`,children:[(0,e.jsxs)("button",{className:"window-selector-btn",onClick:()=>q(!p),title:"Manage Antigravity windows",children:[(0,e.jsx)("span",{className:`cdp-indicator ${h.active?"active":"inactive"}`}),(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,e.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,e.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),(0,e.jsx)("span",{style:{maxWidth:"120px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"bottom"},children:c.find(a=>a.active)?.title||"Windows"}),(0,e.jsx)("svg",{className:"chevron",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`window-dropdown ${p?"open":""}`,children:[(0,e.jsxs)("div",{className:"wm-cdp-status",children:[(0,e.jsxs)("div",{className:"wm-cdp-info",children:[(0,e.jsx)("span",{className:`wm-cdp-dot ${h.active?"active":"inactive"}`}),(0,e.jsx)("span",{children:h.active?`CDP Active \xb7 ${h.windowCount} window${1!==h.windowCount?"s":""}`:"CDP Inactive"})]}),!h.active&&(0,e.jsxs)("button",{className:"wm-cdp-start-btn",onClick:B,disabled:v,title:"Start Antigravity with CDP",children:[v?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})}),v?"Starting...":"Start CDP"]})]}),(0,e.jsx)("div",{className:"window-dropdown-header",children:"Open Windows"}),c.map(a=>(0,e.jsxs)("div",{className:`window-item ${a.active?"active":""}`,children:[(0,e.jsxs)("button",{className:"window-item-select",onClick:()=>{j(a.index),q(!1)},children:[(0,e.jsx)("span",{className:"window-dot"}),(0,e.jsx)("span",{className:"window-item-title",children:a.title})]}),(0,e.jsx)("button",{className:"window-item-close",onClick:b=>D(a.index,a.targetId,b),title:`Close "${a.title}"`,children:(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},a.index)),0===c.length&&(0,e.jsx)("div",{style:{padding:"12px",color:"var(--text-muted)",fontSize:"12px"},children:"No windows detected"}),i.length>0&&(0,e.jsxs)("div",{className:"wm-recent-section",children:[(0,e.jsx)("div",{className:"wm-recent-header",children:"Recent Projects"}),i.map(a=>(0,e.jsxs)("button",{className:"wm-recent-item",onClick:async()=>{u(!0),y(null);try{let b=await n(a.path);y({text:b.message||(b.success?"Opened!":"Failed"),type:b.success?"success":"error"})}catch{y({text:"Failed to open",type:"error"})}finally{u(!1)}},disabled:t,title:a.path,children:[(0,e.jsx)("svg",{className:"wm-recent-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsxs)("div",{className:"wm-recent-info",children:[(0,e.jsx)("span",{className:"wm-recent-name",children:a.name}),(0,e.jsx)("span",{className:"wm-recent-path",children:a.path})]})]},a.path))]}),(0,e.jsxs)("div",{className:"wm-open-section",children:[(0,e.jsx)("div",{className:"wm-open-label",children:"Open New Window"}),(0,e.jsxs)("form",{className:"wm-open-form",onSubmit:C,children:[(0,e.jsx)("input",{ref:A,type:"text",className:"wm-open-input",value:r,onChange:a=>s(a.target.value),placeholder:"/path/to/project",disabled:t}),(0,e.jsx)("button",{type:"submit",className:"wm-open-btn",disabled:t||!r.trim(),title:"Open directory in Antigravity",children:t?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,e.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]}),x&&(0,e.jsx)("div",{className:`wm-action-message ${x.type}`,children:x.text})]})]}),(0,e.jsx)("button",{className:"icon-btn",onClick:l,title:"New Chat","aria-label":"New Chat",children:(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,e.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]})}function aj({onQuickPrompt:a}){return(0,e.jsxs)("div",{className:"welcome-screen",children:[(0,e.jsx)("div",{className:"welcome-icon",children:(0,e.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"url(#gradient)",strokeWidth:"1.5",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,e.jsx)("stop",{offset:"0%",style:{stopColor:"#6366f1"}}),(0,e.jsx)("stop",{offset:"100%",style:{stopColor:"#a855f7"}})]})}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,e.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})}),(0,e.jsx)("h2",{children:"Antigravity Agent"}),(0,e.jsx)("p",{children:"Ask anything. The agent has access to your IDE — files, terminal, search, and more."}),(0,e.jsxs)("div",{className:"quick-prompts",children:[(0,e.jsx)("button",{className:"quick-prompt",onClick:()=>a("What files are in the current workspace?"),children:"\uD83D\uDCC1 List workspace files"}),(0,e.jsx)("button",{className:"quick-prompt",onClick:()=>a("Explain the architecture of this project"),children:"\uD83C\uDFD7️ Explain architecture"}),(0,e.jsx)("button",{className:"quick-prompt",onClick:()=>a("Help me debug the most recent error"),children:"\uD83D\uDC1B Debug last error"})]})]})}function ak({content:a}){return(0,e.jsx)("div",{className:"user-message",children:(0,e.jsx)("div",{className:"message-content",children:a})})}let al={command:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',file:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',search:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',read:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',browser:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',mcp:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v6M12 22v-6M4.93 4.93l4.24 4.24M14.83 14.83l4.24 4.24M2 12h6M22 12h-6M4.93 19.07l4.24-4.24M14.83 9.17l4.24-4.24"/><circle cx="12" cy="12" r="4"/></svg>'};function am({data:a}){let b,c=(b=(a.status||"").toLowerCase()).startsWith("running")||b.startsWith("editing")||b.startsWith("creating")||b.startsWith("search")?"running":b.startsWith("ran")||b.startsWith("edited")||b.startsWith("created")||b.startsWith("read")||b.startsWith("viewed")||b.startsWith("analyzed")||b.startsWith("wrote")||b.startsWith("replaced")||b.startsWith("deleted")?"done":b.includes("error")||b.includes("fail")?"error":b.startsWith("mcp")?"mcp":"running",d=al[a.type]||al.file;return(0,e.jsxs)("div",{className:`tool-call-card ${c}`,"data-tool-index":a.index,children:[(0,e.jsxs)("div",{className:"tool-header",children:[(0,e.jsx)("span",{className:"tool-icon",dangerouslySetInnerHTML:{__html:d}}),(0,e.jsx)("span",{className:"tool-status-text",children:a.status}),a.path&&(0,e.jsx)("span",{className:"tool-path",title:a.path,children:a.path})]}),a.command&&(0,e.jsx)("div",{className:"tool-command",children:(0,e.jsx)("code",{children:a.command})}),(a.additions||a.deletions)&&(0,e.jsxs)("div",{className:"tool-file-changes",children:[a.additions&&(0,e.jsx)("span",{className:"tool-additions",children:a.additions}),a.deletions&&(0,e.jsx)("span",{className:"tool-deletions",children:a.deletions})]}),a.exitCode&&(0,e.jsx)("div",{className:"tool-exit-code",children:a.exitCode}),a.terminalOutput&&(0,e.jsx)("div",{className:"tool-terminal",children:a.terminalOutput}),a.footerButtons&&a.footerButtons.length>0&&(0,e.jsx)("div",{className:"tool-footer-actions",children:a.footerButtons.map((b,c)=>(0,e.jsx)("button",{className:"tool-footer-btn",onClick:async()=>{try{await fetch("/api/v1/chat/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolId:a.id,buttonText:b})})}catch{}},children:b},c))})]})}function an({time:a}){return(0,e.jsxs)("div",{className:"thinking-block",children:[(0,e.jsx)("span",{className:"thinking-icon",children:"\uD83D\uDCAD"}),(0,e.jsx)("span",{children:a})]})}function ao(){return(0,e.jsxs)("div",{className:"typing-indicator",children:[(0,e.jsx)("div",{className:"typing-dot"}),(0,e.jsx)("div",{className:"typing-dot"}),(0,e.jsx)("div",{className:"typing-dot"})]})}function ap({content:a,steps:b,isStreaming:c,onRetry:d}){return(0,e.jsxs)("div",{className:`agent-message ${c?"streaming":""}`,children:[(0,e.jsxs)("div",{className:"agent-steps",children:[b.map((a,b)=>{switch(a.type){case"thinking":return(0,e.jsx)(an,{time:a.data.time},`step-${b}`);case"tool_call":return(0,e.jsx)(am,{data:a.data},`step-${b}`);case"hitl":case"notification":default:return null;case"file_change":return(0,e.jsxs)("div",{className:"file-change-indicator",children:[(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("polyline",{points:"14 2 14 8 20 8"})]}),(0,e.jsx)("span",{className:"file-change-name",children:a.data.fileName})]},`step-${b}`);case"error":return(0,e.jsxs)("div",{className:"error-banner",children:[(0,e.jsxs)("div",{style:{marginBottom:!c&&d?"8px":"0"},children:["⚠️ ",String(a.data.message)]}),!c&&d&&(0,e.jsx)("button",{className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 transition-colors text-sm font-medium",onClick:d,children:"Try Again"})]},`step-${b}`)}}),c&&(0,e.jsx)(ao,{})]}),a&&(0,e.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:a}})]})}function aq({messages:a,currentSteps:b,currentResponse:c,isStreaming:d,onRetry:f}){return(0,e.jsxs)(e.Fragment,{children:[a.map((a,b)=>"user"===a.role?(0,e.jsx)(ak,{content:a.content},`msg-${b}`):(0,e.jsx)(ap,{content:a.content,steps:a.steps||[],isStreaming:!1,onRetry:f},`msg-${b}`)),d&&(0,e.jsx)(ap,{content:c,steps:b,isStreaming:!0,onRetry:f})]})}function ar({onSend:a,onStop:b,isStreaming:c,currentMode:d,onToggleMode:g,currentAgent:h,agents:i,isLoadingAgents:j,onFetchAgents:k,onSwitchAgent:l,onToggleArtifacts:m,artifactCount:n,artifactPanelOpen:o,onToggleChanges:p,changesCount:q,changesPanelOpen:r}){let[s,t]=(0,f.useState)(""),[u,v]=(0,f.useState)(!1),w=(0,f.useRef)(null),x=(0,f.useRef)(null),y=h?h.replace(/^(Claude\s+|Google\s+|OpenAI\s+)/i,"").substring(0,20):"Agent";return(0,e.jsxs)("footer",{className:"input-area",children:[(0,e.jsxs)("div",{className:"input-toolbar",children:[(0,e.jsxs)("div",{ref:x,className:"agent-selector-wrapper",children:[(0,e.jsxs)("button",{className:"agent-selector-btn",onClick:()=>{u||k(),v(!u)},title:h?`Agent: ${h} — Click to switch`:"Select AI agent","aria-label":`Switch agent (currently ${h||"unknown"})`,type:"button",children:[(0,e.jsx)("span",{className:"agent-icon",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M12 2a4 4 0 0 1 4 4v2a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4z"}),(0,e.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-3-3.87"}),(0,e.jsx)("path",{d:"M4 21v-2a4 4 0 0 1 3-3.87"}),(0,e.jsx)("circle",{cx:"12",cy:"17",r:"1"}),(0,e.jsx)("path",{d:"M9 17h6"})]})}),(0,e.jsx)("span",{className:"agent-label",children:y}),(0,e.jsx)("svg",{className:`agent-chevron ${u?"open":""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`agent-dropdown ${u?"open":""}`,children:[(0,e.jsx)("div",{className:"agent-dropdown-header",children:"Select Agent"}),j?(0,e.jsxs)("div",{className:"agent-dropdown-loading",children:[(0,e.jsx)("span",{className:"wm-spinner"}),(0,e.jsx)("span",{children:"Loading agents..."})]}):0===i.length?(0,e.jsx)("div",{className:"agent-dropdown-empty",children:"No agents detected. Make sure the IDE has a workbench open."}):(0,e.jsx)("div",{className:"agent-dropdown-list",children:i.map((a,b)=>(0,e.jsxs)("button",{className:`agent-option ${a.active?"active":""} ${h===a.name?"current":""}`,onClick:()=>{l(a.name),v(!1)},type:"button",children:[(0,e.jsx)("span",{className:"agent-option-name",children:a.name}),a.description&&(0,e.jsx)("span",{className:"agent-option-desc",children:a.description}),(a.active||h===a.name)&&(0,e.jsx)("svg",{className:"agent-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})})]},b))})]})]}),(0,e.jsxs)("button",{className:`mode-toggle ${d}`,onClick:g,title:`Mode: ${"planning"===d?"Planning":"Fast"} — Click to switch`,"aria-label":`Switch mode (currently ${d})`,type:"button",children:[(0,e.jsx)("span",{className:"mode-icon",children:"planning"===d?"\uD83D\uDCCB":"⚡"}),(0,e.jsx)("span",{className:"mode-label",children:"planning"===d?"Plan":"Fast"})]}),(0,e.jsxs)("button",{className:`artifact-toggle-btn ${o?"active":""}`,onClick:m,title:`Artifacts${n>0?` (${n})`:""}`,"aria-label":"Toggle artifacts panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,e.jsx)("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),(0,e.jsx)("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),n>0&&(0,e.jsx)("span",{className:"artifact-badge",children:n})]}),(0,e.jsxs)("button",{className:`changes-toggle-btn ${r?"active":""}`,onClick:p,title:`Changes${q>0?` (${q})`:""}`,"aria-label":"Toggle changes panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M12 20h9"}),(0,e.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]}),q>0&&(0,e.jsx)("span",{className:"changes-badge",children:q})]}),(0,e.jsx)("span",{className:"toolbar-agent-name",id:"model-info",children:h||""})]}),(0,e.jsxs)("div",{className:"input-wrapper",children:[(0,e.jsx)("textarea",{ref:w,value:s,onChange:a=>{t(a.target.value);let b=a.target;b.style.height="auto",b.style.height=Math.min(b.scrollHeight,150)+"px"},onKeyDown:d=>{if("Escape"===d.key&&c){d.preventDefault(),b();return}"Enter"===d.key&&(!d.shiftKey||d.ctrlKey||d.metaKey)&&(d.preventDefault(),s.trim()?(a(s),t(""),w.current&&(w.current.style.height="auto")):c&&b())},placeholder:"Ask the Antigravity agent...",rows:1,"aria-label":"Chat message input",enterKeyHint:"send",autoComplete:"off"}),(0,e.jsx)("button",{className:`send-btn${c&&s.trim()?" send-btn--interrupt":c?" send-btn--stop":""}`,onClick:()=>{s.trim()?(a(s),t(""),w.current&&(w.current.style.height="auto")):c&&b()},disabled:!c&&!s.trim(),"aria-label":c&&s.trim()?"Interrupt and send new message":c?"Stop generation":"Send message",title:c&&s.trim()?"Interrupt agent and send new message":c?"Stop generation (Esc)":"Send message",children:c&&!s.trim()?(0,e.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:(0,e.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})}):(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,e.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),(0,e.jsx)("div",{className:"input-hint",children:(0,e.jsx)("span",{children:"Enter to send \xb7 Shift+Enter for new line \xb7 Ctrl+N for new chat \xb7 Esc to stop"})})]})}function as({open:a,onClose:b,activeConversation:c,files:d}){let[g,h]=(0,f.useState)(null),[i,j]=(0,f.useState)(""),[k,l]=(0,f.useState)(!1),m=async a=>{l(!0),h(a);try{let b=await fetch(`/api/v1/artifacts/active/${encodeURIComponent(a)}`);if(!b.ok){let a=await b.json().catch(()=>({error:"Unknown error"}));j(`Error: ${a.error||b.statusText}`);return}let c=await b.text();j(c)}catch(a){j(`Error loading file: ${a.message}`)}finally{l(!1)}},n=a=>!1!==a.isFile&&/\.\w{1,5}$/.test(a.name);return(0,e.jsxs)("div",{className:`artifact-panel ${a?"open":""}`,children:[(0,e.jsxs)("div",{className:"artifact-panel-header",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsx)("h3",{children:"Artifacts"})]}),c?(0,e.jsxs)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:[(0,e.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.title||"Untitled"}),(0,e.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[d.length," artifact",1!==d.length?"s":""]})]}):d.length>0?(0,e.jsx)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:(0,e.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[d.length," artifact",1!==d.length?"s":""]})}):(0,e.jsx)("div",{style:{padding:"24px 16px",textAlign:"center",color:"var(--text-muted)",fontSize:"13px"},children:"No active conversation"}),g?(0,e.jsxs)("div",{className:"artifact-viewer",children:[(0,e.jsxs)("div",{className:"artifact-viewer-header",children:[(0,e.jsx)("button",{className:"artifact-back-btn",onClick:()=>{h(null),j("")},children:"← Back"}),(0,e.jsx)("span",{className:"artifact-viewer-title",children:g})]}),(0,e.jsx)("div",{className:"artifact-viewer-body",children:k?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"Loading..."}):g.endsWith(".md")?(0,e.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:i.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.*$)/gim,"<li>$1</li>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br/>")}}):(0,e.jsx)("pre",{style:{margin:0,fontSize:"12px",lineHeight:1.6,color:"var(--text-secondary)",fontFamily:"'JetBrains Mono', monospace",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:i})})]}):(0,e.jsxs)("div",{className:"artifact-file-list",children:[d.map(a=>{var b;return(0,e.jsxs)("button",{className:`artifact-file-item ${!n(a)?"non-file":""}`,onClick:()=>{n(a)&&m(a.name)},disabled:!n(a),title:n(a)?`Open ${a.name}`:`${a.name} (IDE artifact — view in Antigravity)`,children:[(0,e.jsx)("span",{className:"artifact-file-icon",children:(a=>{if(n(a)){let b=a.name;return b.endsWith(".md")?"\uD83D\uDCC4":b.endsWith(".json")?"\uD83D\uDCCB":b.endsWith(".ts")||b.endsWith(".tsx")?"\uD83D\uDCD8":b.endsWith(".css")?"\uD83C\uDFA8":b.endsWith(".js")||b.endsWith(".jsx")?"\uD83D\uDCDC":"\uD83D\uDCC4"}return"\uD83D\uDDBC️"})(a)}),(0,e.jsxs)("div",{style:{flex:1,overflow:"hidden"},children:[(0,e.jsx)("div",{className:"artifact-file-name",children:a.name}),(0,e.jsx)("div",{style:{fontSize:"10px",color:"var(--text-muted)"},children:(a=>{if(a.includes("T")||a.includes("-")){let b=new Date(a);if(!isNaN(b.getTime()))return b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})+" \xb7 "+b.toLocaleDateString()}return a})(a.mtime)})]}),(0,e.jsx)("span",{className:"artifact-file-size",children:(b=a.size)<=0?"":b<1024?`${b}B`:b<1048576?`${(b/1024).toFixed(1)}KB`:`${(b/1048576).toFixed(1)}MB`})]},a.name)}),0===d.length&&(0,e.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No artifacts in this conversation"})]})]})}function at({open:a,onClose:b,changes:c,onAcceptAll:d,onRejectAll:g,isAccepting:h,isRejecting:i}){let[j,k]=(0,f.useState)(null),[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(null),t=c.reduce((a,b)=>a+b.additions,0),u=c.reduce((a,b)=>a+b.deletions,0),v=async a=>{o(!0),k(a.filepath),q(a.filename),m([]);try{let b=await fetch(`/api/v1/changes/diff?filepath=${encodeURIComponent(a.filepath)}`),c=await b.json();c.diff?m(function(a){let b=[],c=0,d=0;for(let e of a.split("\n"))if(e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("new file")||e.startsWith("deleted file"))b.push({type:"meta",content:e});else if(e.startsWith("---")||e.startsWith("+++"))b.push({type:"meta",content:e});else if(e.startsWith("@@")){let a=e.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(d=parseInt(a[1]),c=parseInt(a[2])),b.push({type:"header",content:e})}else e.startsWith("+")?b.push({type:"add",content:e.substring(1),lineNum:c++}):e.startsWith("-")?b.push({type:"del",content:e.substring(1),lineNum:d++}):e.startsWith(" ")&&(b.push({type:"context",content:e.substring(1),lineNum:c}),c++,d++);return b}(c.diff)):m([{type:"meta",content:c.message||"No diff available"}])}catch(a){m([{type:"meta",content:`Error: ${a.message}`}])}finally{o(!1)}},w=async()=>{s(null);let a=await d();a?.success?s({type:"success",text:"All changes accepted ✓"}):s({type:"error",text:a?.error||"Failed to accept changes"}),setTimeout(()=>s(null),3e3)},x=async()=>{s(null);let a=await g();a?.success?s({type:"success",text:"All changes rejected ✓"}):s({type:"error",text:a?.error||"Failed to reject changes"}),setTimeout(()=>s(null),3e3)},y=h||i;return(0,e.jsxs)("div",{className:`changes-panel ${a?"open":""}`,children:[(0,e.jsxs)("div",{className:"changes-panel-header",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsx)("h3",{children:"Changes Overview"})]}),j?(0,e.jsxs)("div",{className:"diff-viewer",children:[(0,e.jsxs)("div",{className:"diff-viewer-header",children:[(0,e.jsx)("button",{className:"diff-back-btn",onClick:()=>{k(null),m([]),q("")},children:"← Back"}),(0,e.jsx)("span",{className:"diff-viewer-title",children:p}),(0,e.jsx)("span",{className:"diff-viewer-path",children:j})]}),(0,e.jsx)("div",{className:"diff-viewer-body",children:n?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px",fontStyle:"italic"},children:"Loading diff..."}):0===l.length?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"No changes found"}):(0,e.jsx)("div",{className:"diff-lines",children:l.map((a,b)=>(0,e.jsxs)("div",{className:`diff-line diff-line-${a.type}`,children:[(0,e.jsx)("span",{className:"diff-line-num",children:void 0!==a.lineNum?a.lineNum:""}),(0,e.jsx)("span",{className:"diff-line-indicator",children:"add"===a.type?"+":"del"===a.type?"-":"header"===a.type?"@@":""}),(0,e.jsx)("span",{className:"diff-line-content",children:a.content})]},b))})})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"changes-summary",children:[(0,e.jsxs)("span",{className:"changes-count",children:[c.length," file",1!==c.length?"s":""," changed"]}),(0,e.jsxs)("div",{className:"changes-stats",children:[t>0&&(0,e.jsxs)("span",{className:"changes-additions",children:["+",t]}),u>0&&(0,e.jsxs)("span",{className:"changes-deletions",children:["-",u]})]})]}),c.length>0&&(0,e.jsxs)("div",{className:"changes-action-bar",children:[(0,e.jsx)("button",{className:"changes-reject-all-btn",onClick:x,disabled:y,title:"Reject all file changes",children:i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{className:"changes-action-spinner",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 12a9 9 0 11-6.219-8.56"})}),"Rejecting…"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),"Reject All"]})}),(0,e.jsx)("button",{className:"changes-accept-all-btn",onClick:w,disabled:y,title:"Accept all file changes",children:h?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{className:"changes-action-spinner",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 12a9 9 0 11-6.219-8.56"})}),"Accepting…"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),"Accept All"]})})]}),r&&(0,e.jsx)("div",{className:`changes-action-message changes-action-message--${r.type}`,children:r.text}),(0,e.jsxs)("div",{className:"changes-file-list",children:[c.map(a=>{var b;return(0,e.jsxs)("button",{className:"changes-file-item",onClick:()=>v(a),title:`View diff: ${a.filepath}`,children:[(0,e.jsx)("span",{className:"changes-file-icon",children:(b=a.filename).endsWith(".tsx")||b.endsWith(".jsx")?"⚛️":b.endsWith(".ts")||b.endsWith(".js")?"\uD83D\uDCD8":b.endsWith(".css")?"\uD83C\uDFA8":b.endsWith(".md")?"\uD83D\uDCC4":b.endsWith(".json")?"\uD83D\uDCCB":"\uD83D\uDCDD"}),(0,e.jsxs)("div",{className:"changes-file-info",children:[(0,e.jsx)("div",{className:"changes-file-name",children:a.filename}),(0,e.jsx)("div",{className:"changes-file-path",children:a.filepath})]}),(0,e.jsxs)("div",{className:"changes-file-diff",children:[a.additions>0&&(0,e.jsxs)("span",{className:"changes-additions",children:["+",a.additions]}),a.deletions>0&&(0,e.jsxs)("span",{className:"changes-deletions",children:["-",a.deletions]})]})]},a.filepath)}),0===c.length&&(0,e.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No file changes in this conversation"})]})]})]})}function au({networkOnline:a,isConnected:b}){let[c,d]=(0,f.useState)(!1),[g,h]=(0,f.useState)(!1);return c?(0,e.jsxs)("div",{className:`network-banner ${g?"recovered":"offline"}`,role:"status","aria-live":"polite",children:[(0,e.jsx)("span",{className:"network-banner-pulse"}),g?"✅ Connection restored":a?"\uD83D\uDD04 Reconnecting to server…":"\uD83D\uDCE1 No network — waiting for connection…"]}):null}function av(){let{statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,selectWindow:j,selectConversation:k,startNewChat:l,startCdpServer:m,openNewWindow:n,closeWindowByIndex:o,networkOnline:p,isConnected:q,isLoadingHistory:r,showWelcome:s,messages:t,currentSteps:u,currentResponse:v,isStreaming:w,sendMessage:x,stopStreaming:y,currentMode:z,toggleMode:A,currentAgent:B,agents:C,isLoadingAgents:D,fetchAgentList:E,switchAgent:F,toggleArtifactPanel:G,artifactFiles:H,artifactPanelOpen:I,toggleChangesPanel:J,changeFiles:K,changesPanelOpen:L,acceptAllChanges:M,rejectAllChanges:N,isAccepting:O,isRejecting:P,messagesEndRef:Q}=function(){let[a,b]=(0,f.useState)([]),[c,d]=(0,f.useState)(!1),[e,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)("Agent"),[j,k]=(0,f.useState)("connected"),[l,m]=(0,f.useState)(!0),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)([]),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)("planning"),[v,w]=(0,f.useState)(null),[x,y]=(0,f.useState)([]),[z,A]=(0,f.useState)(!1),[B,C]=(0,f.useState)(!1),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(!0),H=(0,f.useRef)(null),I=(0,f.useRef)(null),J=(0,f.useRef)(null),K=(0,f.useRef)(""),L=(0,f.useRef)([]),{mutate:M}=T(),N=(0,f.useCallback)(()=>{requestAnimationFrame(()=>{J.current?.scrollIntoView({behavior:"smooth"})})},[]),O=(0,f.useCallback)((a,b)=>{k(a),i(b)},[]),{data:P,mutate:Q}=aa(ad.health,ac,{refreshInterval:F?3e4:5e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,onSuccess:a=>{g(a.connected),F||G(!0),O(a.connected?"connected":"disconnected",a.connected?"Agent":!1===a.network?"Offline":"Reconnecting…")},onError:()=>{g(!1),O("disconnected",F?"Reconnecting…":"Offline")}}),{mutate:R}=aa(ad.mode,ac,{revalidateOnFocus:!1,onSuccess:a=>{a.mode&&u(a.mode)}}),{mutate:S}=aa(ad.agent,ac,{revalidateOnFocus:!1,onSuccess:a=>{a.agent&&w(a.agent)}}),{mutate:U}=aa(ad.history,ac,{revalidateOnFocus:!1,revalidateOnMount:!0,onSuccess:a=>{o(!1),a.turns&&a.turns.length>0?(m(!1),b(a.turns.map(a=>({role:a.role,content:a.content})))):m(!0)},onError:()=>{o(!1)}}),V=(0,f.useCallback)(()=>{o(!0),b([]),U()},[U]),{artifactFiles:W,artifactPanelOpen:X,toggleArtifactPanel:Y,openArtifactPanel:Z,loadArtifacts:$}=function(a){let[b,c]=(0,f.useState)(!1),{data:d,mutate:e}=aa(ad.artifacts,ac,{refreshInterval:b?3e3:8e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),g=d?.files||[];return{artifactFiles:g,artifactPanelOpen:b,toggleArtifactPanel:(0,f.useCallback)(()=>{c(a=>!a)},[]),openArtifactPanel:(0,f.useCallback)(()=>{c(!0)},[]),loadArtifacts:e}}(),{changeFiles:_,changesPanelOpen:ab,toggleChangesPanel:ag,loadChanges:ah,acceptAllChanges:ai,rejectAllChanges:aj,isAccepting:ak,isRejecting:al}=function(){let[a,b]=(0,f.useState)(!1),[c,d]=(0,f.useState)(!1),[e,g]=(0,f.useState)(!1),{data:h,mutate:i}=aa(ad.changes,ac,{refreshInterval:a?3e3:8e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),j=h?.changes||[],k=(0,f.useCallback)(()=>{b(a=>!a)},[]),l=(0,f.useCallback)(async()=>{d(!0);try{let a=await fetch("/api/v1/changes/accept-all",{method:"POST"}),b=await a.json();return await new Promise(a=>setTimeout(a,500)),await i(),b}catch(a){return{success:!1,error:a.message}}finally{d(!1)}},[i]),m=(0,f.useCallback)(async()=>{g(!0);try{let a=await fetch("/api/v1/changes/reject-all",{method:"POST"}),b=await a.json();return await new Promise(a=>setTimeout(a,500)),await i(),b}catch(a){return{success:!1,error:a.message}}finally{g(!1)}},[i]);return{changeFiles:j,changesPanelOpen:a,toggleChangesPanel:k,loadChanges:i,acceptAllChanges:l,rejectAllChanges:m,isAccepting:c,isRejecting:e}}(),{windows:am,conversations:an,activeConversation:ao,cdpStatus:ap,recentProjects:aq,loadWindows:ar,selectWindow:as,loadConversations:at,selectConversation:au,checkCdpStatus:av,startCdpServer:aw,openNewWindow:ax,closeWindowByIndex:ay,loadRecentProjects:az}=function(a,b,c){let{data:d,mutate:e}=aa(ad.windows,ac,{revalidateOnFocus:!0}),g=d?.windows||[],{data:h,mutate:i}=aa(ad.cdpStatus,ac,{refreshInterval:15e3,revalidateOnFocus:!0}),j={active:h?.active??!1,windowCount:h?.windowCount??0,error:h?.error??null},{data:k,mutate:l}=aa(ad.conversations,ac,{revalidateOnFocus:!0}),m=k?.conversations||[],n=m.find(a=>a.active)||null,{data:o,mutate:p}=aa(ad.recentProjects,ac,{revalidateOnFocus:!0}),q=o?.recentProjects||[],r=(0,f.useCallback)(async(a,b)=>{try{let c=await fetch(`${ae}/windows/cdp-start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:a||".",killExisting:b||!1})}),d=await c.json();return d.success&&(i(),e()),d}catch(a){return{success:!1,message:a.message||"Failed to start CDP server"}}},[i,e]),s=(0,f.useCallback)(async a=>{try{let b=await fetch(`${ae}/windows/open`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:a})}),c=await b.json();return c.success&&(e(),i()),c}catch(a){return{success:!1,message:a.message||"Failed to open window"}}},[e,i]),t=(0,f.useCallback)(async(a,b)=>{try{let c=await fetch(`${ae}/windows/close`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b?{targetId:b}:{index:a})}),d=await c.json();return d.success&&(e(),i()),d}catch(a){return{success:!1,message:a.message||"Failed to close window"}}},[e,i]),u=(0,f.useCallback)(async d=>{try{b(!0),await fetch(`${ae}/windows/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:d})}),e(),a(),setTimeout(()=>l(),300),setTimeout(()=>l(),1500),c?.()}catch{}},[e,a,b,l,c]),v=(0,f.useCallback)(async d=>{try{let e=await fetch(`${ae}/conversations/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:d})});if((await e.json()).success){b(!1);let e=0,f=async()=>{e++;try{let b=await fetch(`${ae}/conversations`),f=(await b.json()).conversations||[],g=f.find(a=>a.active);if(g&&g.title===d||e>10){l({conversations:f},{revalidate:!1}),a(),c?.();return}}catch{}setTimeout(f,500)};f()}}catch{}},[a,b,l,c]);return{windows:g,conversations:m,activeConversation:n,cdpStatus:j,recentProjects:q,loadWindows:e,selectWindow:u,loadConversations:l,selectConversation:v,checkCdpStatus:i,startCdpServer:r,openNewWindow:s,closeWindowByIndex:t,loadRecentProjects:p}}(V,m,(0,f.useCallback)(()=>{$(),ah()},[$,ah])),aA=(0,f.useCallback)(async()=>{let a="planning"===t?"fast":"planning";u(a);try{let b=await fetch(`${af}/chat/mode`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:a})}),c=await b.json();c.mode&&u(c.mode),R()}catch{u(t)}},[t,R]),aB=(0,f.useCallback)(async()=>{A(!0);try{let a=await fetch(`${af}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"list"})}),b=await a.json();b.agents&&y(b.agents),b.currentAgent&&w(b.currentAgent)}catch{}A(!1)},[]),aC=(0,f.useCallback)(async a=>{w(a);try{let b=await fetch(`${af}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"switch",agent:a})}),c=await b.json();c.agent?w(c.agent):c.success||w(v),S()}catch{w(v)}},[v,S]),aD=(0,f.useCallback)(a=>{let{type:b,...c}=a;switch(b){case"tool_call":q(a=>{let d,e=a.findIndex(a=>"tool_call"===a.type&&a.data?.id===c.id);return e>=0?(d=[...a])[e]={type:b,data:c}:d=[...a,{type:b,data:c}],L.current=d,d});break;case"thinking":case"hitl":case"error":case"notification":q(a=>{let d=[...a,{type:b,data:c}];return L.current=d,d});break;case"file_change":q(a=>{let d=[...a,{type:b,data:c}];return L.current=d,d}),$(),ah();break;case"response":s(c.content||""),K.current=c.content||"";break;case"status":O(c.isRunning?"streaming":"connected",c.isRunning?"Agent working...":"Agent");break;case"done":c.finalResponse&&(s(c.finalResponse),K.current=c.finalResponse),O("connected","Agent"),d(!1),$(),ah()}N()},[O,N,$,ah]),aE=(0,f.useCallback)(async a=>{if(!a.trim())return;H.current&&(H.current.abort(),H.current=null,fetch(`${af}/chat/stop`,{method:"POST"}).catch(()=>{})),I.current&&(await I.current,I.current=null),m(!1);let c=a.trim();b(a=>[...a,{role:"user",content:c}]),d(!0),q([]),s(""),K.current="",L.current=[],O("streaming","Agent typing...");let e=new AbortController;H.current=e,I.current=(async()=>{try{let a="",b=0;for(;b<=5;){let d=!1;try{let f={"Content-Type":"application/json"};a&&(f["Last-Event-ID"]=a);let g=(await fetch(`${af}/chat/stream`,{method:"POST",headers:f,body:JSON.stringify({message:c}),signal:e.signal})).body.getReader(),h=new TextDecoder,i="",j=!1;for(;;){let{done:b,value:c}=await g.read();if(b){d=!0;break}let e=(i+=h.decode(c,{stream:!0})).split("\n");for(let b of(i=e.pop(),e)){if(!b.startsWith(":")){if(b.startsWith("id: ")){a=b.slice(4).trim();continue}if(!b.startsWith("retry:")&&b.startsWith("data: "))try{let a=JSON.parse(b.slice(6));aD(a),"done"===a.type&&(j=!0)}catch{}}}if(j)break}if(j||!d||++b>5)break;console.warn(`[SSE] Stream dropped (attempt ${b}/5), reconnecting in 2000ms...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if("AbortError"===a.name||++b>5)throw a;console.warn(`[SSE] Fetch error (attempt ${b}/5):`,a.message),await new Promise(a=>setTimeout(a,2e3))}}}catch(a){"AbortError"!==a.name&&(q(b=>[...b,{type:"error",data:{message:a.message}}]),O("error","Error"))}finally{let a=K.current,c=[...L.current];d(!1),H.current===e&&(H.current=null),(a||c.length>0)&&b(b=>[...b,{role:"agent",content:a,steps:c}]),O("connected","Agent")}})(),await I.current},[aD,O]),aF=(0,f.useCallback)(async()=>{H.current&&H.current.abort(),b([]),q([]),s(""),m(!0);try{let a=await fetch(`${af}/chat/new`,{method:"POST"});(await a.json()).success&&O("connected","New Chat")}catch{}},[O]),aG=(0,f.useCallback)(()=>{H.current&&(H.current.abort(),H.current=null),fetch(`${af}/chat/stop`,{method:"POST"}).catch(()=>{})},[]),aH=(0,f.useCallback)(async()=>{try{await fetch(`${af}/chat/approve`,{method:"POST"}),O("streaming","Agent")}catch{}},[O]),aI=(0,f.useCallback)(async()=>{try{await fetch(`${af}/chat/reject`,{method:"POST"})}catch{}},[]),aJ=(0,f.useRef)(c);aJ.current=c;let{isMonitoring:aK}=function(a={}){let{onEvent:b,onActivityStart:c,onActivityEnd:d,onTurnChange:e,onModeChange:g,onSync:h,autoConnect:i=!0}=a,[j,k]=(0,f.useState)(!1),[l,m]=(0,f.useState)(null),n=(0,f.useRef)(null),o=(0,f.useRef)(null),p=(0,f.useRef)(!1),q=(0,f.useRef)(b),r=(0,f.useRef)(c),s=(0,f.useRef)(d),t=(0,f.useRef)(e),u=(0,f.useRef)(g),v=(0,f.useRef)(h);q.current=b,r.current=c,s.current=d,t.current=e,u.current=g,v.current=h;let w=(0,f.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null),n.current&&(n.current.abort(),n.current=null),k(!1),p.current=!1},[]),x=(0,f.useCallback)(async()=>{if(p.current||n.current)return;p.current=!0;let a=new AbortController;n.current=a;try{let b=await fetch("/api/v1/chat/monitor",{signal:a.signal});if(!b.ok||!b.body)throw Error(`Monitor connection failed: ${b.status}`);k(!0),p.current=!1;let c=b.body.getReader(),d=new TextDecoder,e="";for(;;){let{done:a,value:b}=await c.read();if(a)break;let f=(e+=d.decode(b,{stream:!0})).split("\n");for(let a of(e=f.pop(),f))if(!(a.startsWith(":")||a.startsWith("retry:")||a.startsWith("id:"))&&a.startsWith("data: "))try{let{type:b,...c}=JSON.parse(a.slice(6));switch(q.current?.({type:b,...c}),b){case"activity_start":r.current?.();break;case"activity_end":s.current?.(c);break;case"turn_change":t.current?.(c);break;case"mode_change":u.current?.(c);break;case"sync":m(Date.now()),v.current?.(c)}}catch{}}}catch(a){if("AbortError"===a.name)return;console.warn("[Monitor] Connection lost:",a.message)}finally{n.current=null,p.current=!1,k(!1),a.signal.aborted||(o.current=setTimeout(()=>{o.current=null,x()},3e3))}},[]);return{isMonitoring:j,lastSyncTime:l,connect:x,disconnect:w}}({autoConnect:!0,onActivityStart:()=>{C(!0),aJ.current||(k("streaming"),i("Agent working..."))},onActivityEnd:()=>{C(!1),aJ.current||(k("connected"),i("Agent"),U(),$(),ah())},onTurnChange:()=>{aJ.current||(m(!1),U())},onModeChange:({newMode:a})=>{u(a)},onSync:a=>{"boolean"==typeof a.isRunning&&C(a.isRunning)},onEvent:a=>{aJ.current||"tool_call"!==a.type&&"response"!==a.type&&"thinking"!==a.type&&"hitl"!==a.type&&"notification"!==a.type||aD(a)}});return{messages:a,isStreaming:c,isConnected:e,statusText:h,statusState:j,showWelcome:l,isLoadingHistory:n,currentSteps:p,currentResponse:r,windows:am,conversations:an,activeConversation:ao,artifactFiles:W,artifactPanelOpen:X,changeFiles:_,changesPanelOpen:ab,acceptAllChanges:ai,rejectAllChanges:aj,isAccepting:ak,isRejecting:al,currentMode:t,currentAgent:v,agents:x,isLoadingAgents:z,cdpStatus:ap,recentProjects:aq,isAgentBusy:B,isMonitorConnected:D,networkOnline:F,sendMessage:aE,stopStreaming:aG,startNewChat:aF,approve:aH,reject:aI,selectWindow:as,selectConversation:au,toggleArtifactPanel:Y,openArtifactPanel:Z,toggleChangesPanel:ag,toggleMode:aA,fetchAgentList:aB,switchAgent:aC,startCdpServer:aw,openNewWindow:ax,closeWindowByIndex:ay,messagesEndRef:J,setShowWelcome:m}}(),R=(0,f.useCallback)(async()=>{try{await fetch("/api/v1/health"),window.location.reload()}catch{}},[]);return(0,e.jsxs)("div",{className:"app-container",children:[(0,e.jsx)(ai,{statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,onSelectWindow:j,onSelectConversation:k,onNewChat:l,onStartCdp:m,onOpenWindow:n,onCloseWindow:o}),(0,e.jsx)(au,{networkOnline:p,isConnected:q}),(0,e.jsxs)("main",{className:"messages-area",role:"log","aria-live":"polite",children:[r?(0,e.jsxs)("div",{className:"history-loading",children:[(0,e.jsxs)("div",{className:"history-loading-header",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"45%"}})]}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"80%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"65%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"72%"}})]}),(0,e.jsx)("div",{className:"history-loading-header right",children:(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"35%"}})}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"90%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"55%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"68%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"40%"}})]}),(0,e.jsxs)("div",{className:"history-loading-header",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"50%"}})]}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"75%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"60%"}})]}),(0,e.jsx)("p",{className:"history-loading-text",children:"Loading conversation history…"})]}):s?(0,e.jsx)(aj,{onQuickPrompt:x}):(0,e.jsx)(aq,{messages:t,currentSteps:u,currentResponse:v,isStreaming:w,onRetry:R}),(0,e.jsx)("div",{ref:Q})]}),(0,e.jsx)(ar,{onSend:x,onStop:y,isStreaming:w,currentMode:z,onToggleMode:A,currentAgent:B,agents:C,isLoadingAgents:D,onFetchAgents:E,onSwitchAgent:F,onToggleArtifacts:G,artifactCount:H.length,artifactPanelOpen:I,onToggleChanges:J,changesCount:K.length,changesPanelOpen:L}),(0,e.jsx)(as,{open:I,onClose:G,activeConversation:g,files:H}),(0,e.jsx)(at,{open:L,onClose:J,changes:K,onAcceptAll:M,onRejectAll:N,isAccepting:O,isRejecting:P})]})}},5026:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/pwa-install-prompt.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/pwa-install-prompt.tsx","default")},6055:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(8868);let e=async a=>[{type:"image/x-icon",sizes:"16x16",url:(0,d.fillMetadataSegment)(".",await a.params,"favicon.ico")+"?603d046c9a6fdfbb"}]},6187:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/chat-container.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/chat-container.tsx","default")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},6862:(a,b,c)=>{"use strict";var d=c(7484),e="function"==typeof Object.is?Object.is:function(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},f=d.useState,g=d.useEffect,h=d.useLayoutEffect,i=d.useDebugValue;function j(a){var b=a.getSnapshot;a=a.value;try{var c=b();return!e(a,c)}catch(a){return!0}}var k="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(a,b){return b()}:function(a,b){var c=b(),d=f({inst:{value:c,getSnapshot:b}}),e=d[0].inst,k=d[1];return h(function(){e.value=c,e.getSnapshot=b,j(e)&&k({inst:e})},[a,c,b]),g(function(){return j(e)&&k({inst:e}),a(function(){j(e)&&k({inst:e})})},[a]),i(c),c};b.useSyncExternalStore=void 0!==d.useSyncExternalStore?d.useSyncExternalStore:k},7068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},7548:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",backgroundColor:"#0a0a0f",color:"#888",fontFamily:"system-ui, sans-serif",margin:0},children:[(0,d.jsx)("h1",{style:{fontSize:"3rem",margin:0,color:"#fff"},children:"404"}),(0,d.jsx)("p",{style:{fontSize:"1.1rem",marginTop:"0.5rem"},children:"Page not found"})]})}},7728:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(8249),e=c(7484),f=c(1220);function g(){let[a,b]=(0,e.useState)(null),[c,g]=(0,e.useState)(!1),[h]=(0,e.useState)(()=>!1),[i]=(0,e.useState)(()=>!1),j=(0,e.useCallback)(async()=>{if(a){try{await a.prompt();let b=await a.userChoice;"accepted"===b.outcome&&g(!1)}catch(a){console.error("PWA install error:",a)}b(null)}},[a]),k=(0,e.useCallback)(()=>{g(!1),localStorage.setItem("pwa-install-dismissed",Date.now().toString())},[]);return!c||i?null:(0,d.jsxs)("div",{style:{position:"fixed",bottom:0,left:0,right:0,zIndex:9999,padding:"12px 16px",background:"linear-gradient(135deg, rgba(20, 20, 35, 0.98), rgba(30, 25, 50, 0.98))",backdropFilter:"blur(20px)",borderTop:"1px solid rgba(139, 92, 246, 0.3)",display:"flex",alignItems:"center",gap:"12px",animation:"slideUp 0.3s ease-out",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.4)"},children:[(0,d.jsx)("style",{children:`
|
|
1
|
+
(()=>{var a={};a.id=8974,a.ids=[8974],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},293:(a,b,c)=>{"use strict";let d;c.d(b,{default:()=>aF});var e=c(8249),f=c(7484),g=Object.prototype.hasOwnProperty;let h=new WeakMap,i=()=>{},j=i(),k=Object,l=a=>a===j,m=(a,b)=>({...a,...b}),n={},o={},p="undefined",q=typeof document!=p,r=!1,s=(a,b)=>{let c=h.get(a);return[()=>!l(b)&&a.get(b)||n,d=>{if(!l(b)){let e=a.get(b);b in o||(o[b]=e),c[5](b,m(e,d),e||n)}},c[6],()=>!l(b)&&b in o?o[b]:!l(b)&&a.get(b)||n]},t=!0,[u,v]=[i,i],w={initFocus:a=>(q&&document.addEventListener("visibilitychange",a),u("focus",a),()=>{q&&document.removeEventListener("visibilitychange",a),v("focus",a)}),initReconnect:a=>{let b=()=>{t=!0,a()},c=()=>{t=!1};return u("online",b),u("offline",c),()=>{v("online",b),v("offline",c)}}},x=!f.useId,y=!0,z=y?f.useEffect:f.useLayoutEffect,A="u">typeof navigator&&navigator.connection,B=!y&&A&&(["slow-2g","2g"].includes(A.effectiveType)||A.saveData),C=new WeakMap,D=(a,b)=>a===`[object ${b}]`,E=0,F=a=>{let b,c,d=typeof a,e=k.prototype.toString.call(a),f=D(e,"Date"),g=D(e,"RegExp"),h=D(e,"Object");if(k(a)!==a||f||g)b=f?a.toJSON():"symbol"==d?a.toString():"string"==d?JSON.stringify(a):""+a;else{if(b=C.get(a))return b;if(b=++E+"~",C.set(a,b),Array.isArray(a)){for(c=0,b="@";c<a.length;c++)b+=F(a[c])+",";C.set(a,b)}if(h){b="#";let d=k.keys(a).sort();for(;!l(c=d.pop());)l(a[c])||(b+=c+":"+F(a[c])+",");C.set(a,b)}}return b},G=a=>{if("function"==typeof a)try{a=a()}catch(b){a=""}let b=a;return[a="string"==typeof a?a:(Array.isArray(a)?a.length:a)?F(a):"",b]},H=0,I=()=>++H;async function J(...a){let[b,c,d,e]=a,f=m({populateCache:!0,throwOnError:!0},"boolean"==typeof e?{revalidate:e}:e||{}),g=f.populateCache,i=f.rollbackOnError,k=f.optimisticData,n=f.throwOnError;if("function"==typeof c){let a=[];for(let d of b.keys())!/^\$(inf|sub)\$/.test(d)&&c(b.get(d)._k)&&a.push(d);return Promise.all(a.map(o))}return o(c);async function o(c){let e,[m]=G(c);if(!m)return;let[o,p]=s(b,m),[q,r,t,u]=h.get(b),v=()=>{let a=q[m];return("function"==typeof f.revalidate?f.revalidate(o().data,c):!1!==f.revalidate)&&(delete t[m],delete u[m],a&&a[0])?a[0](2).then(()=>o().data):o().data};if(a.length<3)return v();let w=d,x=!1,y=I();r[m]=[y,0];let z=!l(k),A=o(),B=A.data,C=A._c,D=l(C)?B:C;if(z&&p({data:k="function"==typeof k?k(D,B):k,_c:D}),"function"==typeof w)try{w=w(D)}catch(a){e=a,x=!0}if(w&&"function"==typeof w.then){let a;if(w=await w.catch(a=>{e=a,x=!0}),y!==r[m][0]){if(x)throw e;return w}x&&z&&(a=e,"function"==typeof i?i(a):!1!==i)&&(g=!0,p({data:D,_c:j}))}if(g&&!x&&("function"==typeof g?p({data:g(w,D),error:j,_c:j}):p({data:w,error:j,_c:j})),r[m][1]=I(),Promise.resolve(v()).then(()=>{p({_c:j})}),x){if(n)throw e;return}return w}}let K=(a,b)=>{for(let c in a)a[c][0]&&a[c][0](b)},L=(a,b)=>{if(!h.has(a)){let c=m(w,b),d=Object.create(null),e=J.bind(j,a),f=i,g=Object.create(null),k=(a,b)=>{let c=g[a]||[];return g[a]=c,c.push(b),()=>c.splice(c.indexOf(b),1)},l=(b,c,d)=>{a.set(b,c);let e=g[b];if(e)for(let a of e)a(c,d)},n=()=>{if(!h.has(a)&&(h.set(a,[d,Object.create(null),Object.create(null),Object.create(null),e,l,k]),!y)){let b=c.initFocus(setTimeout.bind(j,K.bind(j,d,0))),e=c.initReconnect(setTimeout.bind(j,K.bind(j,d,1)));f=()=>{b&&b(),e&&e(),h.delete(a)}}};return n(),[a,e,n,f]}return[a,h.get(a)[4]]},[M,N]=L(new Map),O=m({onLoadingSlow:i,onSuccess:i,onError:i,onErrorRetry:(a,b,c,d,e)=>{let f=c.errorRetryCount,g=e.retryCount,h=~~((Math.random()+.5)*(1<<(g<8?g:8)))*c.errorRetryInterval;(l(f)||!(g>f))&&setTimeout(d,h,e)},onDiscarded:i,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:B?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:B?5e3:3e3,compare:function a(b,c){var d,e;if(b===c)return!0;if(b&&c&&(d=b.constructor)===c.constructor){if(d===Date)return b.getTime()===c.getTime();if(d===RegExp)return b.toString()===c.toString();if(d===Array){if((e=b.length)===c.length)for(;e--&&a(b[e],c[e]););return -1===e}if(!d||"object"==typeof b){for(d in e=0,b)if(g.call(b,d)&&++e&&!g.call(c,d)||!(d in c)||!a(b[d],c[d]))return!1;return Object.keys(c).length===e}}return b!=b&&c!=c},isPaused:()=>!1,cache:M,mutate:N,fallback:{}},{isOnline:()=>t,isVisible:()=>{let a=q&&document.visibilityState;return l(a)||"hidden"!==a}}),P=(a,b)=>{let c=m(a,b);if(b){let{use:d,fallback:e}=a,{use:f,fallback:g}=b;d&&f&&(c.use=d.concat(f)),e&&g&&(c.fallback=m(e,g))}return c},Q=(0,f.createContext)({}),R=!1,S=R?window.__SWR_DEVTOOLS_USE__:[],T=()=>{let a=(0,f.useContext)(Q);return(0,f.useMemo)(()=>m(O,a),[a])},U=S.concat(a=>(b,c,d)=>{let e=c&&((...a)=>{let[d]=G(b),[,,,e]=h.get(M);if(d.startsWith("$inf$"))return c(...a);let f=e[d];return l(f)?c(...a):(delete e[d],f)});return a(b,e,d)});R&&(window.__SWR_DEVTOOLS_REACT__=f);var V=c(2237);let W=()=>{},X=W(),Y=(new WeakMap,f.use||(a=>{switch(a.status){case"pending":throw a;case"fulfilled":return a.value;case"rejected":throw a.reason;default:throw a.status="pending",a.then(b=>{a.status="fulfilled",a.value=b},b=>{a.status="rejected",a.reason=b}),a}})),Z={dedupe:!0},$=Promise.resolve(j),_=()=>i;k.defineProperty(a=>{let{value:b}=a,c=(0,f.useContext)(Q),d="function"==typeof b,e=(0,f.useMemo)(()=>d?b(c):b,[d,c,b]),g=(0,f.useMemo)(()=>d?e:P(c,e),[d,c,e]),h=e&&e.provider,i=(0,f.useRef)(j);h&&!i.current&&(i.current=L(h(g.cache||M),e));let k=i.current;return k&&(g.cache=k[0],g.mutate=k[1]),z(()=>{if(k)return k[2]&&k[2](),k[3]},[]),(0,f.createElement)(Q.Provider,m(a,{value:g}))},"defaultValue",{value:O});let aa=(d=(a,b,c)=>{let{cache:d,compare:e,suspense:g,fallbackData:i,revalidateOnMount:k,revalidateIfStale:n,refreshInterval:o,refreshWhenHidden:p,refreshWhenOffline:q,keepPreviousData:r,strictServerPrefetchWarning:t}=c,[u,v,w,A]=h.get(d),[B,C]=G(a),D=(0,f.useRef)(!1),E=(0,f.useRef)(!1),F=(0,f.useRef)(B),H=(0,f.useRef)(b),K=(0,f.useRef)(c),L=()=>K.current.isVisible()&&K.current.isOnline(),[M,N,O,P]=s(d,B),Q=(0,f.useRef)({}).current,R=l(i)?l(c.fallback)?j:c.fallback[B]:i,S=(a,b)=>{for(let c in Q)if("data"===c){if(!e(a[c],b[c])&&(!l(a[c])||!e(ae,b[c])))return!1}else if(b[c]!==a[c])return!1;return!0},T=!D.current,U=(0,f.useMemo)(()=>{let a=M(),c=P(),d=a=>{let c=m(a);return(delete c._k,(()=>{if(!B||!b||K.current.isPaused())return!1;if(T&&!l(k))return k;let a=l(R)?c.data:R;return l(a)||n})())?{isValidating:!0,isLoading:!0,...c}:c},e=d(a),f=a===c?e:d(c),g=e;return[()=>{let a=d(M());return S(a,g)?(g.data=a.data,g.isLoading=a.isLoading,g.isValidating=a.isValidating,g.error=a.error,g):(g=a,a)},()=>f]},[d,B]),W=(0,V.useSyncExternalStore)((0,f.useCallback)(a=>O(B,(b,c)=>{S(c,b)||a()}),[d,B]),U[0],U[1]),X=u[B]&&u[B].length>0,aa=W.data,ab=l(aa)?R&&"function"==typeof R.then?Y(R):R:aa,ac=W.error,ad=(0,f.useRef)(ab),ae=r?l(aa)?l(ad.current)?ab:ad.current:aa:ab,af=B&&l(ab),ag=(0,f.useRef)(null);y||(0,V.useSyncExternalStore)(_,()=>(ag.current=!1,ag),()=>(ag.current=!0,ag));let ah=ag.current;t&&ah&&!g&&af&&console.warn(`Missing pre-initiated data for serialized key "${B}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let ai=!(!B||!b||K.current.isPaused())&&(!X||!!l(ac))&&(T&&!l(k)?k:g?!l(ab)&&n:l(ab)||n),aj=T&&ai,ak=l(W.isValidating)?aj:W.isValidating,al=l(W.isLoading)?aj:W.isLoading,am=(0,f.useCallback)(async a=>{let b,d,f=H.current;if(!B||!f||E.current||K.current.isPaused())return!1;let g=!0,h=a||{},i=!w[B]||!h.dedupe,k=()=>x?!E.current&&B===F.current&&D.current:B===F.current,m={isValidating:!1,isLoading:!1},n=()=>{N(m)},o=()=>{let a=w[B];a&&a[1]===d&&delete w[B]},p={isValidating:!0};l(M().data)&&(p.isLoading=!0);try{if(i&&(N(p),c.loadingTimeout&&l(M().data)&&setTimeout(()=>{g&&k()&&K.current.onLoadingSlow(B,c)},c.loadingTimeout),w[B]=[f(C),I()]),[b,d]=w[B],b=await b,i&&setTimeout(o,c.dedupingInterval),!w[B]||w[B][1]!==d)return i&&k()&&K.current.onDiscarded(B),!1;m.error=j;let a=v[B];if(!l(a)&&(d<=a[0]||d<=a[1]||0===a[1]))return n(),i&&k()&&K.current.onDiscarded(B),!1;let h=M().data;m.data=e(h,b)?h:b,i&&k()&&K.current.onSuccess(b,B,c)}catch(c){o();let a=K.current,{shouldRetryOnError:b}=a;!a.isPaused()&&(m.error=c,i&&k())&&(a.onError(c,B,a),(!0===b||"function"==typeof b&&b(c))&&(!K.current.revalidateOnFocus||!K.current.revalidateOnReconnect||L())&&a.onErrorRetry(c,B,a,a=>{let b=u[B];b&&b[0]&&b[0](3,a)},{retryCount:(h.retryCount||0)+1,dedupe:!0}))}return g=!1,n(),!0},[B,d]),an=(0,f.useCallback)((...a)=>J(d,F.current,...a),[]);if(z(()=>{H.current=b,K.current=c,l(aa)||(ad.current=aa)}),z(()=>{var a;let b;if(!B)return;let c=am.bind(j,Z),d=0;K.current.revalidateOnFocus&&(d=Date.now()+K.current.focusThrottleInterval);let e=(a=(a,b={})=>{if(0==a){let a=Date.now();K.current.revalidateOnFocus&&a>d&&L()&&(d=a+K.current.focusThrottleInterval,c())}else if(1==a)K.current.revalidateOnReconnect&&L()&&c();else if(2==a)return am();else if(3==a)return am(b)},(b=u[B]||(u[B]=[])).push(a),()=>{let c=b.indexOf(a);c>=0&&(b[c]=b[b.length-1],b.pop())});if(E.current=!1,F.current=B,D.current=!0,N({_k:C}),ai&&!w[B])if(l(ab)||y)c();else setTimeout(c,1);return()=>{E.current=!0,e()}},[B]),z(()=>{let a;function b(){let b="function"==typeof o?o(M().data):o;b&&-1!==a&&(a=setTimeout(c,b))}function c(){!M().error&&(p||K.current.isVisible())&&(q||K.current.isOnline())?am(Z).then(b):b()}return b(),()=>{a&&(clearTimeout(a),a=-1)}},[o,p,q,B]),(0,f.useDebugValue)(ae),g){if(!x&&y&&af)throw Error("Fallback data is required when using Suspense in SSR.");af&&(H.current=b,K.current=c,E.current=!1);let a=A[B];if(Y(!l(a)&&af?an(a):$),!l(ac)&&af)throw ac;let d=af?am(Z):$;!l(ae)&&af&&(d.status="fulfilled",d.value=!0),Y(d)}return{mutate:an,get data(){return Q.data=!0,ae},get error(){return Q.error=!0,ac},get isValidating(){return Q.isValidating=!0,ak},get isLoading(){return Q.isLoading=!0,al}}},function(...a){let b=T(),[c,e,f]="function"==typeof a[1]?[a[0],a[1],a[2]||{}]:[a[0],null,(null===a[1]?a[2]:a[1])||{}],g=P(b,f),h=d,{use:i}=g,j=(i||[]).concat(U);for(let a=j.length;a--;)h=j[a](h);return h(c,e||g.fetcher||null,g)}),ab="/api/v1",ac=a=>fetch(a).then(a=>a.json()),ad={windows:`${ab}/windows`,cdpStatus:`${ab}/windows/cdp-status`,conversations:`${ab}/conversations`,recentProjects:`${ab}/windows/recent`,artifacts:`${ab}/artifacts/active`,changes:`${ab}/changes/active`,git:`${ab}/git/status`,workspace:`${ab}/workspace/files`,history:`${ab}/chat/history`,mode:`${ab}/chat/mode`,agent:`${ab}/chat/agent`,health:`${ab}/health`},ae="/api/v1",af="/api/v1";function ag(a){if(!a)return"";let b=new Date(a),c=Math.floor((Date.now()-b.getTime())/6e4);if(c<1)return"now";if(c<60)return`${c}m ago`;let d=Math.floor(c/60);if(d<24)return`${d} hr${1!==d?"s":""} ago`;let e=Math.floor(d/24);if(e<7)return`${e} day${1!==e?"s":""} ago`;let f=Math.floor(e/7);return`${f} wk${1!==f?"s":""} ago`}function ah({conversations:a,activeConversation:b,onSelect:c}){let[d,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)(!1),j=(0,f.useRef)(null),k=(0,f.useCallback)(()=>{g(!1),i(!1)},[]),l=a.find(a=>a.active)||null,m=[...a.filter(a=>!a.active)].sort((a,b)=>a.mtime||b.mtime?a.mtime?b.mtime?new Date(b.mtime).getTime()-new Date(a.mtime).getTime():-1:1:0),n=h?m:m.slice(0,5),o=m.length-5;return(0,e.jsxs)("div",{ref:j,className:`conv-selector-wrapper ${d?"open":""}`,children:[(0,e.jsxs)("button",{className:"conv-selector-btn",onClick:()=>g(!d),title:"Switch conversation",children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),(0,e.jsx)("span",{children:b?.title?.substring(0,22)||"Select a conversation"}),(0,e.jsx)("svg",{className:"chevron",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`conv-dropdown ${d?"open":""}`,children:[(0,e.jsx)("div",{className:"conv-dropdown-header",children:"Select a conversation"}),(0,e.jsxs)("div",{className:"conv-dropdown-list",children:[l&&(0,e.jsxs)("div",{className:"conv-section",children:[(0,e.jsx)("div",{className:"conv-section-label",children:"Current"}),(0,e.jsx)("button",{className:"conv-item active",onClick:()=>{-1!==l.index&&c(l.title),k()},children:(0,e.jsxs)("div",{className:"conv-item-header",children:[(0,e.jsx)("span",{className:"conv-item-title",children:l.title||"Untitled"}),l.mtime&&(0,e.jsx)("span",{className:"conv-item-time",children:ag(l.mtime)}),(0,e.jsx)("span",{role:"button",tabIndex:0,className:"conv-item-action",title:"Current conversation",onClick:a=>a.stopPropagation(),onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&a.stopPropagation()},children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,e.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,e.jsx)("path",{d:"M10 11v6M14 11v6"}),(0,e.jsx)("path",{d:"M9 6V4h6v2"})]})})]})})]}),n.length>0&&(0,e.jsxs)("div",{className:"conv-section",children:[(0,e.jsxs)("div",{className:"conv-section-label",children:["Recent",m.length>0&&(0,e.jsx)("span",{className:"conv-section-count",children:m.length})]}),n.map((a,b)=>{let d=a.title||a.id.substring(0,20)+"…";return(0,e.jsx)("button",{className:"conv-item",onClick:()=>{c(a.title),k()},children:(0,e.jsxs)("div",{className:"conv-item-header",children:[a.active&&(0,e.jsx)("span",{className:"conv-item-dot active"}),(0,e.jsx)("span",{className:"conv-item-title",children:d}),a.mtime&&(0,e.jsx)("span",{className:"conv-item-time",children:ag(a.mtime)})]})},`conv-${b}`)}),!h&&o>0&&(0,e.jsxs)("button",{className:"conv-show-more",onClick:a=>{a.stopPropagation(),i(!0)},children:["Show ",o," more…"]})]}),0===a.length&&(0,e.jsx)("div",{className:"conv-dropdown-empty",children:"No conversations found"})]})]})]})}function ai({statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,onSelectWindow:j,onSelectConversation:k,onNewChat:l,onStartCdp:m,onOpenWindow:n,onCloseWindow:o}){let[p,q]=(0,f.useState)(!1),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)(!1),[v,w]=(0,f.useState)(!1),[x,y]=(0,f.useState)(null),z=(0,f.useRef)(null),A=(0,f.useRef)(null),B=async()=>{let a=i.length>0?i[0].path:".";w(!0),y(null);try{let b=await m(a,!0);y({text:b.message||(b.success?"CDP started!":"Failed to start CDP"),type:b.success?"success":"error"})}catch{y({text:"Failed to start CDP server",type:"error"})}finally{w(!1)}},C=async a=>{a.preventDefault();let b=r.trim();if(b&&!t){u(!0),y(null);try{let a=await n(b);y({text:a.message||(a.success?"Window opened!":"Failed to open"),type:a.success?"success":"error"}),a.success&&s("")}catch{y({text:"Failed to open window",type:"error"})}finally{u(!1)}}},D=async(a,b,d)=>{if(d.stopPropagation(),!window.confirm(`Close window "${c[a]?.title||a}"?`))return;let e=await o(a,b);y({text:e.message||(e.success?"Closed!":"Failed to close"),type:e.success?"success":"error"})};return(0,e.jsxs)("header",{className:"header",children:[(0,e.jsx)("div",{className:"header-left",children:(0,e.jsx)("div",{className:"logo",children:(0,e.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"url(#header-gradient)",strokeWidth:"1.5",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"header-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,e.jsx)("stop",{offset:"0%",style:{stopColor:"#6366f1"}}),(0,e.jsx)("stop",{offset:"100%",style:{stopColor:"#a855f7"}})]})}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,e.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})})}),(0,e.jsxs)("div",{className:"header-right",children:[(0,e.jsx)(ah,{conversations:d,activeConversation:g,onSelect:k}),(0,e.jsxs)("div",{ref:z,className:`window-selector-wrapper ${p?"open":""}`,children:[(0,e.jsxs)("button",{className:"window-selector-btn",onClick:()=>q(!p),title:"Manage Antigravity windows",children:[(0,e.jsx)("span",{className:`cdp-indicator ${h.active?"active":"inactive"}`}),(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,e.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,e.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),(0,e.jsx)("span",{style:{maxWidth:"120px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"inline-block",verticalAlign:"bottom"},children:c.find(a=>a.active)?.title||"Windows"}),(0,e.jsx)("svg",{className:"chevron",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`window-dropdown ${p?"open":""}`,children:[(0,e.jsxs)("div",{className:"wm-cdp-status",children:[(0,e.jsxs)("div",{className:"wm-cdp-info",children:[(0,e.jsx)("span",{className:`wm-cdp-dot ${h.active?"active":"inactive"}`}),(0,e.jsx)("span",{children:h.active?`CDP Active \xb7 ${h.windowCount} window${1!==h.windowCount?"s":""}`:"CDP Inactive"})]}),!h.active&&(0,e.jsxs)("button",{className:"wm-cdp-start-btn",onClick:B,disabled:v,title:"Start Antigravity with CDP",children:[v?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})}),v?"Starting...":"Start CDP"]})]}),(0,e.jsx)("div",{className:"window-dropdown-header",children:"Open Windows"}),c.map(a=>(0,e.jsxs)("div",{className:`window-item ${a.active?"active":""}`,children:[(0,e.jsxs)("button",{className:"window-item-select",onClick:()=>{j(a.index),q(!1)},children:[(0,e.jsx)("span",{className:"window-dot"}),(0,e.jsx)("span",{className:"window-item-title",children:a.title})]}),(0,e.jsx)("button",{className:"window-item-close",onClick:b=>D(a.index,a.targetId,b),title:`Close "${a.title}"`,children:(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},a.index)),0===c.length&&(0,e.jsx)("div",{style:{padding:"12px",color:"var(--text-muted)",fontSize:"12px"},children:"No windows detected"}),i.length>0&&(0,e.jsxs)("div",{className:"wm-recent-section",children:[(0,e.jsx)("div",{className:"wm-recent-header",children:"Recent Projects"}),i.map(a=>(0,e.jsxs)("button",{className:"wm-recent-item",onClick:async()=>{u(!0),y(null);try{let b=await n(a.path);y({text:b.message||(b.success?"Opened!":"Failed"),type:b.success?"success":"error"})}catch{y({text:"Failed to open",type:"error"})}finally{u(!1)}},disabled:t,title:a.path,children:[(0,e.jsx)("svg",{className:"wm-recent-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsxs)("div",{className:"wm-recent-info",children:[(0,e.jsx)("span",{className:"wm-recent-name",children:a.name}),(0,e.jsx)("span",{className:"wm-recent-path",children:a.path})]})]},a.path))]}),(0,e.jsxs)("div",{className:"wm-open-section",children:[(0,e.jsx)("div",{className:"wm-open-label",children:"Open New Window"}),(0,e.jsxs)("form",{className:"wm-open-form",onSubmit:C,children:[(0,e.jsx)("input",{ref:A,type:"text",className:"wm-open-input",value:r,onChange:a=>s(a.target.value),placeholder:"/path/to/project",disabled:t}),(0,e.jsx)("button",{type:"submit",className:"wm-open-btn",disabled:t||!r.trim(),title:"Open directory in Antigravity",children:t?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,e.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]}),x&&(0,e.jsx)("div",{className:`wm-action-message ${x.type}`,children:x.text})]})]}),(0,e.jsx)("button",{className:"icon-btn",onClick:l,title:"New Chat","aria-label":"New Chat",children:(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,e.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})]})}function aj({onQuickPrompt:a}){return(0,e.jsxs)("div",{className:"welcome-screen",children:[(0,e.jsx)("div",{className:"welcome-icon",children:(0,e.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 24 24",fill:"none",stroke:"url(#gradient)",strokeWidth:"1.5",children:[(0,e.jsx)("defs",{children:(0,e.jsxs)("linearGradient",{id:"gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[(0,e.jsx)("stop",{offset:"0%",style:{stopColor:"#6366f1"}}),(0,e.jsx)("stop",{offset:"100%",style:{stopColor:"#a855f7"}})]})}),(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"}),(0,e.jsx)("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})}),(0,e.jsx)("h2",{children:"Antigravity Agent"}),(0,e.jsx)("p",{children:"Ask anything. The agent has access to your IDE — files, terminal, search, and more."}),(0,e.jsxs)("div",{className:"quick-prompts",children:[(0,e.jsx)("button",{className:"quick-prompt",onClick:()=>a("What files are in the current workspace?"),children:"\uD83D\uDCC1 List workspace files"}),(0,e.jsx)("button",{className:"quick-prompt",onClick:()=>a("Explain the architecture of this project"),children:"\uD83C\uDFD7️ Explain architecture"}),(0,e.jsx)("button",{className:"quick-prompt",onClick:()=>a("Help me debug the most recent error"),children:"\uD83D\uDC1B Debug last error"})]})]})}function ak({content:a}){return(0,e.jsx)("div",{className:"user-message",children:(0,e.jsx)("div",{className:"message-content",children:a})})}let al={command:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>',file:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',search:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>',read:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>',browser:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>',mcp:'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2v6M12 22v-6M4.93 4.93l4.24 4.24M14.83 14.83l4.24 4.24M2 12h6M22 12h-6M4.93 19.07l4.24-4.24M14.83 9.17l4.24-4.24"/><circle cx="12" cy="12" r="4"/></svg>'},am='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>';function an(a){let b=a.toLowerCase();return"deny"===b||"block"===b||"reject"===b?"permission-btn deny":"allow"===b||"allow once"===b||"allow this conversation"===b?"permission-btn allow":"tool-footer-btn"}function ao({data:a,onAction:b}){let c,d="permission required"===(c=(a.status||"").toLowerCase())?"permission":c.startsWith("running")||c.startsWith("editing")||c.startsWith("creating")||c.startsWith("search")?"running":c.startsWith("ran")||c.startsWith("edited")||c.startsWith("created")||c.startsWith("read")||c.startsWith("viewed")||c.startsWith("analyzed")||c.startsWith("wrote")||c.startsWith("replaced")||c.startsWith("deleted")?"done":c.includes("error")||c.includes("fail")?"error":c.startsWith("mcp")?"mcp":"running",f="permission"===d,g=f?am:al[a.type]||al.file,h=async c=>{if(b)return void b(a.id,c);try{await fetch("/api/v1/chat/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolId:a.id,buttonText:c})})}catch{}};return f?(0,e.jsxs)("div",{className:"permission-card","data-tool-index":a.index,children:[(0,e.jsxs)("div",{className:"permission-header",children:[(0,e.jsx)("span",{className:"permission-icon",dangerouslySetInnerHTML:{__html:am}}),(0,e.jsx)("span",{className:"permission-title",children:"Permission Required"})]}),a.path?(0,e.jsxs)("div",{className:"permission-description",children:["The agent needs access to: ",(0,e.jsx)("code",{className:"permission-path",children:a.path})]}):(0,e.jsx)("div",{className:"permission-description",children:"The agent is requesting your approval to proceed."}),a.footerButtons&&a.footerButtons.length>0&&(0,e.jsx)("div",{className:"permission-actions",children:a.footerButtons.map((a,b)=>(0,e.jsx)("button",{className:an(a),onClick:()=>h(a),children:a},b))})]}):(0,e.jsxs)("div",{className:`tool-call-card ${d}`,"data-tool-index":a.index,children:[(0,e.jsxs)("div",{className:"tool-header",children:[(0,e.jsx)("span",{className:"tool-icon",dangerouslySetInnerHTML:{__html:g}}),(0,e.jsx)("span",{className:"tool-status-text",children:a.status}),a.path&&(0,e.jsx)("span",{className:"tool-path",title:a.path,children:a.path})]}),a.command&&(0,e.jsx)("div",{className:"tool-command",children:(0,e.jsx)("code",{children:a.command})}),(a.additions||a.deletions)&&(0,e.jsxs)("div",{className:"tool-file-changes",children:[a.additions&&(0,e.jsx)("span",{className:"tool-additions",children:a.additions}),a.deletions&&(0,e.jsx)("span",{className:"tool-deletions",children:a.deletions})]}),a.exitCode&&(0,e.jsx)("div",{className:"tool-exit-code",children:a.exitCode}),a.terminalOutput&&(0,e.jsx)("div",{className:"tool-terminal",children:a.terminalOutput}),a.footerButtons&&a.footerButtons.length>0&&(0,e.jsx)("div",{className:"tool-footer-actions",children:a.footerButtons.map((a,b)=>(0,e.jsx)("button",{className:an(a),onClick:()=>h(a),children:a},b))})]})}function ap({time:a}){return(0,e.jsxs)("div",{className:"thinking-block",children:[(0,e.jsx)("span",{className:"thinking-icon",children:"\uD83D\uDCAD"}),(0,e.jsx)("span",{children:a})]})}function aq(){return(0,e.jsxs)("div",{className:"typing-indicator",children:[(0,e.jsx)("div",{className:"typing-dot"}),(0,e.jsx)("div",{className:"typing-dot"}),(0,e.jsx)("div",{className:"typing-dot"})]})}function ar({content:a,steps:b,isStreaming:c,onRetry:d}){return(0,e.jsxs)("div",{className:`agent-message ${c?"streaming":""}`,children:[(0,e.jsxs)("div",{className:"agent-steps",children:[b.map((a,b)=>{switch(a.type){case"thinking":return(0,e.jsx)(ap,{time:a.data.time},`step-${b}`);case"tool_call":return(0,e.jsx)(ao,{data:a.data},`step-${b}`);case"hitl":case"notification":default:return null;case"file_change":return(0,e.jsxs)("div",{className:"file-change-indicator",children:[(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("polyline",{points:"14 2 14 8 20 8"})]}),(0,e.jsx)("span",{className:"file-change-name",children:a.data.fileName})]},`step-${b}`);case"error":return(0,e.jsxs)("div",{className:"error-banner",children:[(0,e.jsxs)("div",{style:{marginBottom:!c&&d?"8px":"0"},children:["⚠️ ",String(a.data.message)]}),!c&&d&&(0,e.jsx)("button",{className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 transition-colors text-sm font-medium",onClick:d,children:"Try Again"})]},`step-${b}`)}}),c&&(0,e.jsx)(aq,{})]}),a&&(0,e.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:a}})]})}function as({messages:a,currentSteps:b,currentResponse:c,isStreaming:d,onRetry:f}){return(0,e.jsxs)(e.Fragment,{children:[a.map((a,b)=>"user"===a.role?(0,e.jsx)(ak,{content:a.content},`msg-${b}`):(0,e.jsx)(ar,{content:a.content,steps:a.steps||[],isStreaming:!1,onRetry:f},`msg-${b}`)),d&&(0,e.jsx)(ar,{content:c,steps:b,isStreaming:!0,onRetry:f})]})}function at({onSend:a,onStop:b,isStreaming:c,currentMode:d,onToggleMode:g,currentAgent:h,agents:i,isLoadingAgents:j,onFetchAgents:k,onSwitchAgent:l,onToggleArtifacts:m,artifactCount:n,artifactPanelOpen:o,onToggleChanges:p,changesCount:q,changesPanelOpen:r,onToggleGit:s,gitChangedCount:t,gitPanelOpen:u,onToggleWorkspace:v,workspacePanelOpen:w}){let[x,y]=(0,f.useState)(""),[z,A]=(0,f.useState)(!1),B=(0,f.useRef)(null),C=(0,f.useRef)(null),D=h?h.replace(/^(Claude\s+|Google\s+|OpenAI\s+)/i,"").substring(0,20):"Agent";return(0,e.jsxs)("footer",{className:"input-area",children:[(0,e.jsxs)("div",{className:"input-toolbar",children:[(0,e.jsxs)("div",{ref:C,className:"agent-selector-wrapper",children:[(0,e.jsxs)("button",{className:"agent-selector-btn",onClick:()=>{z||k(),A(!z)},title:h?`Agent: ${h} — Click to switch`:"Select AI agent","aria-label":`Switch agent (currently ${h||"unknown"})`,type:"button",children:[(0,e.jsx)("span",{className:"agent-icon",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M12 2a4 4 0 0 1 4 4v2a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4z"}),(0,e.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-3-3.87"}),(0,e.jsx)("path",{d:"M4 21v-2a4 4 0 0 1 3-3.87"}),(0,e.jsx)("circle",{cx:"12",cy:"17",r:"1"}),(0,e.jsx)("path",{d:"M9 17h6"})]})}),(0,e.jsx)("span",{className:"agent-label",children:D}),(0,e.jsx)("svg",{className:`agent-chevron ${z?"open":""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),(0,e.jsxs)("div",{className:`agent-dropdown ${z?"open":""}`,children:[(0,e.jsx)("div",{className:"agent-dropdown-header",children:"Select Agent"}),j?(0,e.jsxs)("div",{className:"agent-dropdown-loading",children:[(0,e.jsx)("span",{className:"wm-spinner"}),(0,e.jsx)("span",{children:"Loading agents..."})]}):0===i.length?(0,e.jsx)("div",{className:"agent-dropdown-empty",children:"No agents detected. Make sure the IDE has a workbench open."}):(0,e.jsx)("div",{className:"agent-dropdown-list",children:i.map((a,b)=>(0,e.jsxs)("button",{className:`agent-option ${a.active?"active":""} ${h===a.name?"current":""}`,onClick:()=>{l(a.name),A(!1)},type:"button",children:[(0,e.jsx)("span",{className:"agent-option-name",children:a.name}),a.description&&(0,e.jsx)("span",{className:"agent-option-desc",children:a.description}),(a.active||h===a.name)&&(0,e.jsx)("svg",{className:"agent-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})})]},b))})]})]}),(0,e.jsxs)("button",{className:`mode-toggle ${d}`,onClick:g,title:`Mode: ${"planning"===d?"Planning":"Fast"} — Click to switch`,"aria-label":`Switch mode (currently ${d})`,type:"button",children:[(0,e.jsx)("span",{className:"mode-icon",children:"planning"===d?"\uD83D\uDCCB":"⚡"}),(0,e.jsx)("span",{className:"mode-label",children:"planning"===d?"Plan":"Fast"})]}),(0,e.jsxs)("button",{className:`artifact-toggle-btn ${o?"active":""}`,onClick:m,title:`Artifacts${n>0?` (${n})`:""}`,"aria-label":"Toggle artifacts panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,e.jsx)("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),(0,e.jsx)("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),n>0&&(0,e.jsx)("span",{className:"artifact-badge",children:n})]}),(0,e.jsxs)("button",{className:`changes-toggle-btn ${r?"active":""}`,onClick:p,title:`Changes${q>0?` (${q})`:""}`,"aria-label":"Toggle changes panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M12 20h9"}),(0,e.jsx)("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]}),q>0&&(0,e.jsx)("span",{className:"changes-badge",children:q})]}),(0,e.jsxs)("button",{className:`git-toggle-btn ${u?"active":""}`,onClick:s,title:`Git${t>0?` (${t} changed)`:""}`,"aria-label":"Toggle git panel",type:"button",children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,e.jsx)("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,e.jsx)("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),"Git",t>0&&(0,e.jsx)("span",{className:"git-badge",children:t})]}),(0,e.jsxs)("button",{className:`workspace-toggle-btn ${w?"active":""}`,onClick:v,title:"Working Directory","aria-label":"Toggle working directory panel",type:"button",children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),"Dir"]})]}),(0,e.jsxs)("div",{className:"input-wrapper",children:[(0,e.jsx)("textarea",{ref:B,value:x,onChange:a=>{y(a.target.value);let b=a.target;b.style.height="auto",b.style.height=Math.min(b.scrollHeight,150)+"px"},onKeyDown:d=>{if("Escape"===d.key&&c){d.preventDefault(),b();return}"Enter"===d.key&&(d.shiftKey||d.ctrlKey||d.metaKey)&&(d.preventDefault(),x.trim()?(a(x),y(""),B.current&&(B.current.style.height="auto")):c&&b())},placeholder:"Ask the Antigravity agent...",rows:1,"aria-label":"Chat message input",enterKeyHint:"enter",autoComplete:"off"}),(0,e.jsx)("button",{className:`send-btn${c&&x.trim()?" send-btn--interrupt":c?" send-btn--stop":""}`,onClick:()=>{x.trim()?(a(x),y(""),B.current&&(B.current.style.height="auto")):c&&b()},disabled:!c&&!x.trim(),"aria-label":c&&x.trim()?"Interrupt and send new message":c?"Stop generation":"Send message",title:c&&x.trim()?"Interrupt agent and send new message":c?"Stop generation (Esc)":"Send message",children:c&&!x.trim()?(0,e.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor",children:(0,e.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"3"})}):(0,e.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),(0,e.jsx)("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),(0,e.jsx)("div",{className:"input-hint",children:(0,e.jsx)("span",{children:"Shift+Enter to send \xb7 Enter for new line \xb7 Ctrl+N for new chat \xb7 Esc to stop"})})]})}function au({open:a,onClose:b,activeConversation:c,files:d}){let[g,h]=(0,f.useState)(null),[i,j]=(0,f.useState)(""),[k,l]=(0,f.useState)(!1),m=async a=>{l(!0),h(a);try{let b=await fetch(`/api/v1/artifacts/active/${encodeURIComponent(a)}`);if(!b.ok){let a=await b.json().catch(()=>({error:"Unknown error"}));j(`Error: ${a.error||b.statusText}`);return}let c=await b.text();j(c)}catch(a){j(`Error loading file: ${a.message}`)}finally{l(!1)}},n=a=>!1!==a.isFile&&/\.\w{1,5}$/.test(a.name);return(0,e.jsxs)("div",{className:`artifact-panel ${a?"open":""}`,children:[(0,e.jsxs)("div",{className:"artifact-panel-header",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsx)("h3",{children:"Artifacts"})]}),c?(0,e.jsxs)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:[(0,e.jsx)("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.title||"Untitled"}),(0,e.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[d.length," artifact",1!==d.length?"s":""]})]}):d.length>0?(0,e.jsx)("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-subtle)",background:"rgba(99,102,241,0.04)"},children:(0,e.jsxs)("div",{style:{fontSize:"10px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-muted)"},children:[d.length," artifact",1!==d.length?"s":""]})}):(0,e.jsx)("div",{style:{padding:"24px 16px",textAlign:"center",color:"var(--text-muted)",fontSize:"13px"},children:"No active conversation"}),g?(0,e.jsxs)("div",{className:"artifact-viewer",children:[(0,e.jsxs)("div",{className:"artifact-viewer-header",children:[(0,e.jsx)("button",{className:"artifact-back-btn",onClick:()=>{h(null),j("")},children:"← Back"}),(0,e.jsx)("span",{className:"artifact-viewer-title",children:g})]}),(0,e.jsx)("div",{className:"artifact-viewer-body",children:k?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"Loading..."}):g.endsWith(".md")?(0,e.jsx)("div",{className:"agent-response",dangerouslySetInnerHTML:{__html:i.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.*$)/gim,"<li>$1</li>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br/>")}}):(0,e.jsx)("pre",{style:{margin:0,fontSize:"12px",lineHeight:1.6,color:"var(--text-secondary)",fontFamily:"'JetBrains Mono', monospace",whiteSpace:"pre-wrap",wordBreak:"break-all"},children:i})})]}):(0,e.jsxs)("div",{className:"artifact-file-list",children:[d.map(a=>{var b;return(0,e.jsxs)("button",{className:`artifact-file-item ${!n(a)?"non-file":""}`,onClick:()=>{n(a)&&m(a.name)},disabled:!n(a),title:n(a)?`Open ${a.name}`:`${a.name} (IDE artifact — view in Antigravity)`,children:[(0,e.jsx)("span",{className:"artifact-file-icon",children:(a=>{if(n(a)){let b=a.name;return b.endsWith(".md")?"\uD83D\uDCC4":b.endsWith(".json")?"\uD83D\uDCCB":b.endsWith(".ts")||b.endsWith(".tsx")?"\uD83D\uDCD8":b.endsWith(".css")?"\uD83C\uDFA8":b.endsWith(".js")||b.endsWith(".jsx")?"\uD83D\uDCDC":"\uD83D\uDCC4"}return"\uD83D\uDDBC️"})(a)}),(0,e.jsxs)("div",{style:{flex:1,overflow:"hidden"},children:[(0,e.jsx)("div",{className:"artifact-file-name",children:a.name}),(0,e.jsx)("div",{style:{fontSize:"10px",color:"var(--text-muted)"},children:(a=>{if(a.includes("T")||a.includes("-")){let b=new Date(a);if(!isNaN(b.getTime()))return b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})+" \xb7 "+b.toLocaleDateString()}return a})(a.mtime)})]}),(0,e.jsx)("span",{className:"artifact-file-size",children:(b=a.size)<=0?"":b<1024?`${b}B`:b<1048576?`${(b/1024).toFixed(1)}KB`:`${(b/1048576).toFixed(1)}MB`})]},a.name)}),0===d.length&&(0,e.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No artifacts in this conversation"})]})]})}function av({open:a,onClose:b,changes:c,onAcceptAll:d,onRejectAll:g,isAccepting:h,isRejecting:i}){let[j,k]=(0,f.useState)(null),[l,m]=(0,f.useState)([]),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)(""),[r,s]=(0,f.useState)(null),t=c.reduce((a,b)=>a+b.additions,0),u=c.reduce((a,b)=>a+b.deletions,0),v=async a=>{o(!0),k(a.filepath),q(a.filename),m([]);try{let b=await fetch(`/api/v1/changes/diff?filepath=${encodeURIComponent(a.filepath)}`),c=await b.json();c.diff?m(function(a){let b=[],c=0,d=0;for(let e of a.split("\n"))if(e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("new file")||e.startsWith("deleted file"))b.push({type:"meta",content:e});else if(e.startsWith("---")||e.startsWith("+++"))b.push({type:"meta",content:e});else if(e.startsWith("@@")){let a=e.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(d=parseInt(a[1]),c=parseInt(a[2])),b.push({type:"header",content:e})}else e.startsWith("+")?b.push({type:"add",content:e.substring(1),lineNum:c++}):e.startsWith("-")?b.push({type:"del",content:e.substring(1),lineNum:d++}):e.startsWith(" ")&&(b.push({type:"context",content:e.substring(1),lineNum:c}),c++,d++);return b}(c.diff)):m([{type:"meta",content:c.message||"No diff available"}])}catch(a){m([{type:"meta",content:`Error: ${a.message}`}])}finally{o(!1)}},w=async()=>{s(null);let a=await d();a?.success?s({type:"success",text:"All changes accepted ✓"}):s({type:"error",text:a?.error||"Failed to accept changes"}),setTimeout(()=>s(null),3e3)},x=async()=>{s(null);let a=await g();a?.success?s({type:"success",text:"All changes rejected ✓"}):s({type:"error",text:a?.error||"Failed to reject changes"}),setTimeout(()=>s(null),3e3)},y=h||i;return(0,e.jsxs)("div",{className:`changes-panel ${a?"open":""}`,children:[(0,e.jsxs)("div",{className:"changes-panel-header",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsx)("h3",{children:"Changes Overview"})]}),j?(0,e.jsxs)("div",{className:"diff-viewer",children:[(0,e.jsxs)("div",{className:"diff-viewer-header",children:[(0,e.jsx)("button",{className:"diff-back-btn",onClick:()=>{k(null),m([]),q("")},children:"← Back"}),(0,e.jsx)("span",{className:"diff-viewer-title",children:p}),(0,e.jsx)("span",{className:"diff-viewer-path",children:j})]}),(0,e.jsx)("div",{className:"diff-viewer-body",children:n?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px",fontStyle:"italic"},children:"Loading diff..."}):0===l.length?(0,e.jsx)("div",{style:{color:"var(--text-muted)",padding:"16px"},children:"No changes found"}):(0,e.jsx)("div",{className:"diff-lines",children:l.map((a,b)=>(0,e.jsxs)("div",{className:`diff-line diff-line-${a.type}`,children:[(0,e.jsx)("span",{className:"diff-line-num",children:void 0!==a.lineNum?a.lineNum:""}),(0,e.jsx)("span",{className:"diff-line-indicator",children:"add"===a.type?"+":"del"===a.type?"-":"header"===a.type?"@@":""}),(0,e.jsx)("span",{className:"diff-line-content",children:a.content})]},b))})})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"changes-summary",children:[(0,e.jsxs)("span",{className:"changes-count",children:[c.length," file",1!==c.length?"s":""," changed"]}),(0,e.jsxs)("div",{className:"changes-stats",children:[t>0&&(0,e.jsxs)("span",{className:"changes-additions",children:["+",t]}),u>0&&(0,e.jsxs)("span",{className:"changes-deletions",children:["-",u]})]})]}),c.length>0&&(0,e.jsxs)("div",{className:"changes-action-bar",children:[(0,e.jsx)("button",{className:"changes-reject-all-btn",onClick:x,disabled:y,title:"Reject all file changes",children:i?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{className:"changes-action-spinner",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 12a9 9 0 11-6.219-8.56"})}),"Rejecting…"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),"Reject All"]})}),(0,e.jsx)("button",{className:"changes-accept-all-btn",onClick:w,disabled:y,title:"Accept all file changes",children:h?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{className:"changes-action-spinner",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M21 12a9 9 0 11-6.219-8.56"})}),"Accepting…"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),"Accept All"]})})]}),r&&(0,e.jsx)("div",{className:`changes-action-message changes-action-message--${r.type}`,children:r.text}),(0,e.jsxs)("div",{className:"changes-file-list",children:[c.map(a=>{var b;return(0,e.jsxs)("button",{className:"changes-file-item",onClick:()=>v(a),title:`View diff: ${a.filepath}`,children:[(0,e.jsx)("span",{className:"changes-file-icon",children:(b=a.filename).endsWith(".tsx")||b.endsWith(".jsx")?"⚛️":b.endsWith(".ts")||b.endsWith(".js")?"\uD83D\uDCD8":b.endsWith(".css")?"\uD83C\uDFA8":b.endsWith(".md")?"\uD83D\uDCC4":b.endsWith(".json")?"\uD83D\uDCCB":"\uD83D\uDCDD"}),(0,e.jsxs)("div",{className:"changes-file-info",children:[(0,e.jsx)("div",{className:"changes-file-name",children:a.filename}),(0,e.jsx)("div",{className:"changes-file-path",children:a.filepath})]}),(0,e.jsxs)("div",{className:"changes-file-diff",children:[a.additions>0&&(0,e.jsxs)("span",{className:"changes-additions",children:["+",a.additions]}),a.deletions>0&&(0,e.jsxs)("span",{className:"changes-deletions",children:["-",a.deletions]})]})]},a.filepath)}),0===c.length&&(0,e.jsx)("div",{style:{textAlign:"center",padding:"24px",color:"var(--text-muted)",fontSize:"13px"},children:"No file changes in this conversation"})]})]})]})}let aw={modified:{label:"M",color:"#fbbf24"},added:{label:"A",color:"#34d399"},deleted:{label:"D",color:"#ef4444"},renamed:{label:"R",color:"#a78bfa"},copied:{label:"C",color:"#60a5fa"},untracked:{label:"U",color:"#94a3b8"},unmerged:{label:"!",color:"#f97316"}};function ax({status:a}){let{label:b,color:c}=aw[a]||{label:"?",color:"#94a3b8"};return(0,e.jsx)("span",{className:"git-file-status-badge",style:{color:c,borderColor:`${c}44`,background:`${c}18`},children:b})}function ay({open:a,onClose:b,gitStatus:c,onRefresh:d}){let[g,h]=(0,f.useState)("changes"),[i,j]=(0,f.useState)(null),[k,l]=(0,f.useState)([]),[m,n]=(0,f.useState)(!1),[o,p]=(0,f.useState)(!1),[q,r]=(0,f.useState)(""),[s,t]=(0,f.useState)(!1),[u,v]=(0,f.useState)(!1),[w,x]=(0,f.useState)(null),y=(a,b)=>{x({text:a,type:b}),setTimeout(()=>x(null),4e3)},z=async()=>{if(q.trim()&&!s){t(!0);try{let a=await fetch("/api/v1/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:q.trim(),stageAll:!0})}),b=await a.json();b.success?(r(""),y("Committed successfully","success"),d()):y(b.error||"Commit failed","error")}catch(a){y(`Error: ${a.message}`,"error")}finally{t(!1)}}},A=async()=>{if(!u){v(!0);try{let a=await fetch("/api/v1/git/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),b=await a.json();b.success?(y("Pushed to origin","success"),d()):y(b.error||"Push failed","error")}catch(a){y(`Error: ${a.message}`,"error")}finally{v(!1)}}},B=async(a,b)=>{n(!0),j({path:a.path,staged:b,untracked:"untracked"===a.status}),l([]);try{let c=new URLSearchParams({filepath:a.path,staged:String(b),untracked:String("untracked"===a.status)}),d=await fetch(`/api/v1/git/diff?${c}`),e=await d.json();e.diff?l(function(a){let b=[],c=0,d=0;for(let e of a.split("\n"))if(e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("new file")||e.startsWith("deleted file"))b.push({type:"meta",content:e});else if(e.startsWith("---")||e.startsWith("+++"))b.push({type:"meta",content:e});else if(e.startsWith("@@")){let a=e.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);a&&(d=parseInt(a[1]),c=parseInt(a[2])),b.push({type:"header",content:e})}else e.startsWith("+")?b.push({type:"add",content:e.substring(1),lineNum:c++}):e.startsWith("-")?b.push({type:"del",content:e.substring(1),lineNum:d++}):e.startsWith(" ")&&(b.push({type:"context",content:e.substring(1),lineNum:c}),c++,d++);return b}(e.diff)):l([{type:"meta",content:e.error||"No diff available"}])}catch(a){l([{type:"meta",content:`Error: ${a.message}`}])}finally{n(!1)}},C=async()=>{p(!0),d(),await new Promise(a=>setTimeout(a,600)),p(!1)},D=a=>a.endsWith(".tsx")||a.endsWith(".jsx")?"⚛️":a.endsWith(".ts")||a.endsWith(".js")?"\uD83D\uDCD8":a.endsWith(".css")||a.endsWith(".scss")?"\uD83C\uDFA8":a.endsWith(".md")?"\uD83D\uDCC4":a.endsWith(".json")?"\uD83D\uDCCB":a.endsWith(".py")?"\uD83D\uDC0D":a.endsWith(".go")?"\uD83D\uDD39":a.endsWith(".sh")?"⚙️":"\uD83D\uDCDD",E=a=>{let b=a.split("/");return b.length<=2?a:`…/${b.slice(-2).join("/")}`},F=c?(c.staged?.length||0)+(c.unstaged?.length||0)+(c.untracked?.length||0):0;return(0,e.jsxs)("div",{className:`git-panel ${a?"open":""}`,role:"complementary","aria-label":"Git Panel",children:[(0,e.jsxs)("div",{className:"git-panel-header",children:[(0,e.jsxs)("div",{className:"git-panel-title-row",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close git panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsxs)("div",{className:"git-panel-title",children:[(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,e.jsx)("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,e.jsx)("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),(0,e.jsx)("span",{children:"Git"})]}),(0,e.jsx)("button",{className:`git-refresh-btn ${o?"spinning":""}`,onClick:C,title:"Refresh git status",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,e.jsx)("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})]}),c?.isGitRepo&&(0,e.jsxs)("div",{className:"git-branch-bar",children:[(0,e.jsxs)("div",{className:"git-branch-badge",children:[(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),(0,e.jsx)("circle",{cx:"18",cy:"6",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"18",r:"3"}),(0,e.jsx)("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),(0,e.jsx)("span",{children:c.branch})]}),c.remoteBranch&&(0,e.jsxs)("div",{className:"git-sync-badges",children:[c.ahead>0&&(0,e.jsxs)("span",{className:"git-sync-badge git-sync-badge--ahead",children:["↑",c.ahead]}),c.behind>0&&(0,e.jsxs)("span",{className:"git-sync-badge git-sync-badge--behind",children:["↓",c.behind]}),0===c.ahead&&0===c.behind&&(0,e.jsx)("span",{className:"git-sync-badge git-sync-badge--synced",children:"✓ synced"})]}),c.stashCount>0&&(0,e.jsxs)("span",{className:"git-stash-badge",title:`${c.stashCount} stash entries`,children:["\uD83D\uDCE6 ",c.stashCount]})]})]}),c?.isGitRepo&&!i&&(0,e.jsxs)("div",{className:"git-commit-bar",children:[(0,e.jsx)("div",{className:"git-commit-input-row",children:(0,e.jsx)("textarea",{className:"git-commit-textarea",placeholder:"Commit message…",value:q,onChange:a=>r(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.ctrlKey||a.metaKey)&&(a.preventDefault(),z())},rows:2,disabled:s})}),(0,e.jsxs)("div",{className:"git-commit-actions",children:[(0,e.jsxs)("button",{className:"git-commit-btn",onClick:z,disabled:!q.trim()||s,title:"Stage all & commit (Ctrl+Enter)",children:[s?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,e.jsx)("path",{d:"M12 2v7M12 15v7M2 12h7M15 12h7"})]}),s?"Committing…":"Commit All"]}),(0,e.jsxs)("button",{className:"git-push-btn",onClick:A,disabled:u||!c?.branch,title:c?.ahead>0?`Push ${c.ahead} commit(s)`:"Push to remote",children:[u?(0,e.jsx)("span",{className:"wm-spinner"}):(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"5"}),(0,e.jsx)("polyline",{points:"5 12 12 5 19 12"})]}),u?"Pushing…":c?.ahead>0?`Push (${c.ahead})`:"Push"]})]}),w&&(0,e.jsxs)("div",{className:`git-action-feedback git-action-feedback--${w.type}`,children:["success"===w.type?(0,e.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,e.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,e.jsx)("span",{children:w.text})]})]}),c&&!c.isGitRepo&&(0,e.jsxs)("div",{className:"git-not-repo",children:[(0,e.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,e.jsx)("circle",{cx:"18",cy:"18",r:"3"}),(0,e.jsx)("circle",{cx:"6",cy:"6",r:"3"}),(0,e.jsx)("path",{d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,e.jsx)("line",{x1:"6",y1:"9",x2:"6",y2:"21"})]}),(0,e.jsx)("p",{children:"No git repository detected"}),(0,e.jsx)("span",{children:"Open a git project in the IDE"})]}),!c&&(0,e.jsxs)("div",{className:"git-loading",children:[(0,e.jsx)("div",{className:"git-loading-dot"}),(0,e.jsx)("span",{children:"Loading git status…"})]}),i&&c?.isGitRepo&&(0,e.jsxs)("div",{className:"diff-viewer",children:[(0,e.jsxs)("div",{className:"diff-viewer-header",children:[(0,e.jsx)("button",{className:"diff-back-btn",onClick:()=>{j(null),l([])},children:"← Back"}),(0,e.jsx)("span",{className:"diff-viewer-title",children:i.path.split("/").pop()}),(0,e.jsx)("span",{className:"diff-viewer-path",title:i.path,children:E(i.path)}),(0,e.jsx)("span",{className:`diff-viewer-badge ${i.staged?"staged":"unstaged"}`,children:i.staged?"staged":i.untracked?"untracked":"unstaged"})]}),(0,e.jsx)("div",{className:"diff-viewer-body",children:m?(0,e.jsx)("div",{className:"diff-loading",children:"Loading diff…"}):0===k.length?(0,e.jsx)("div",{className:"diff-empty",children:"No diff available"}):(0,e.jsx)("div",{className:"diff-lines",children:k.map((a,b)=>(0,e.jsxs)("div",{className:`diff-line diff-line-${a.type}`,children:[(0,e.jsx)("span",{className:"diff-line-num",children:void 0!==a.lineNum?a.lineNum:""}),(0,e.jsx)("span",{className:"diff-line-indicator",children:"add"===a.type?"+":"del"===a.type?"-":"header"===a.type?"@@":""}),(0,e.jsx)("span",{className:"diff-line-content",children:a.content})]},b))})})]}),c?.isGitRepo&&!i&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"git-summary-bar",children:[(0,e.jsxs)("span",{className:"git-summary-stat",children:[(0,e.jsx)("span",{className:"git-summary-dot git-summary-dot--changed"}),F," changed"]}),c.staged.length>0&&(0,e.jsxs)("span",{className:"git-summary-stat",children:[(0,e.jsx)("span",{className:"git-summary-dot git-summary-dot--staged"}),c.staged.length," staged"]})]}),(0,e.jsxs)("div",{className:"git-tabs",children:[(0,e.jsxs)("button",{className:`git-tab ${"changes"===g?"active":""}`,onClick:()=>h("changes"),children:["Changes",F>0&&(0,e.jsx)("span",{className:"git-tab-badge",children:F})]}),(0,e.jsxs)("button",{className:`git-tab ${"commits"===g?"active":""}`,onClick:()=>h("commits"),children:["Commits",c.commits.length>0&&(0,e.jsx)("span",{className:"git-tab-badge git-tab-badge--neutral",children:c.commits.length})]})]}),"changes"===g&&(0,e.jsxs)("div",{className:"git-file-list",children:[c.staged.length>0&&(0,e.jsxs)("div",{className:"git-section",children:[(0,e.jsxs)("div",{className:"git-section-header",children:[(0,e.jsx)("span",{className:"git-section-dot git-section-dot--staged"}),(0,e.jsx)("span",{children:"Staged Changes"}),(0,e.jsx)("span",{className:"git-section-count",children:c.staged.length})]}),c.staged.map((a,b)=>(0,e.jsxs)("button",{className:"git-file-item git-file-item--staged",onClick:()=>B(a,!0),title:`View staged diff: ${a.path}`,children:[(0,e.jsx)("span",{className:"git-file-icon",children:D(a.path)}),(0,e.jsxs)("div",{className:"git-file-info",children:[(0,e.jsx)("div",{className:"git-file-name",children:a.path.split("/").pop()}),(0,e.jsx)("div",{className:"git-file-path",children:E(a.path)})]}),(0,e.jsx)(ax,{status:a.status})]},`staged-${b}`))]}),c.unstaged.length>0&&(0,e.jsxs)("div",{className:"git-section",children:[(0,e.jsxs)("div",{className:"git-section-header",children:[(0,e.jsx)("span",{className:"git-section-dot git-section-dot--unstaged"}),(0,e.jsx)("span",{children:"Changes"}),(0,e.jsx)("span",{className:"git-section-count",children:c.unstaged.length})]}),c.unstaged.map((a,b)=>(0,e.jsxs)("button",{className:"git-file-item",onClick:()=>B(a,!1),title:`View diff: ${a.path}`,children:[(0,e.jsx)("span",{className:"git-file-icon",children:D(a.path)}),(0,e.jsxs)("div",{className:"git-file-info",children:[(0,e.jsx)("div",{className:"git-file-name",children:a.path.split("/").pop()}),(0,e.jsx)("div",{className:"git-file-path",children:E(a.path)})]}),(0,e.jsx)(ax,{status:a.status})]},`unstaged-${b}`))]}),c.untracked.length>0&&(0,e.jsxs)("div",{className:"git-section",children:[(0,e.jsxs)("div",{className:"git-section-header",children:[(0,e.jsx)("span",{className:"git-section-dot git-section-dot--untracked"}),(0,e.jsx)("span",{children:"Untracked"}),(0,e.jsx)("span",{className:"git-section-count",children:c.untracked.length})]}),c.untracked.map((a,b)=>(0,e.jsxs)("button",{className:"git-file-item git-file-item--untracked",onClick:()=>B(a,!1),title:`View file: ${a.path}`,children:[(0,e.jsx)("span",{className:"git-file-icon",children:D(a.path)}),(0,e.jsxs)("div",{className:"git-file-info",children:[(0,e.jsx)("div",{className:"git-file-name",children:a.path.split("/").pop()}),(0,e.jsx)("div",{className:"git-file-path",children:E(a.path)})]}),(0,e.jsx)(ax,{status:"untracked"})]},`untracked-${b}`))]}),0===F&&(0,e.jsxs)("div",{className:"git-empty",children:[(0,e.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),(0,e.jsx)("p",{children:"Working tree clean"}),(0,e.jsx)("span",{children:"No uncommitted changes"})]})]}),"commits"===g&&(0,e.jsx)("div",{className:"git-commit-list",children:0===c.commits.length?(0,e.jsx)("div",{className:"git-empty",children:(0,e.jsx)("p",{children:"No commits yet"})}):c.commits.map((a,b)=>(0,e.jsxs)("div",{className:"git-commit-item",children:[(0,e.jsx)("div",{className:"git-commit-hash",children:a.shortHash}),(0,e.jsxs)("div",{className:"git-commit-info",children:[(0,e.jsx)("div",{className:"git-commit-subject",children:a.subject}),(0,e.jsxs)("div",{className:"git-commit-meta",children:[(0,e.jsx)("span",{className:"git-commit-author",children:a.author}),(0,e.jsx)("span",{className:"git-commit-dot",children:"\xb7"}),(0,e.jsx)("span",{className:"git-commit-date",children:a.relativeDate})]})]})]},b))})]})]})}let az={ts:"\uD83D\uDCD8",tsx:"⚛️",js:"\uD83D\uDCDC",jsx:"⚛️",json:"\uD83D\uDCCB",md:"\uD83D\uDCC4",mdx:"\uD83D\uDCC4",css:"\uD83C\uDFA8",scss:"\uD83C\uDFA8",sass:"\uD83C\uDFA8",py:"\uD83D\uDC0D",go:"\uD83D\uDD39",rs:"\uD83E\uDD80",sh:"⚙️",bash:"⚙️",zsh:"⚙️",sql:"\uD83D\uDDC4️",graphql:"\uD83D\uDD37",gql:"\uD83D\uDD37",yaml:"\uD83D\uDCD0",yml:"\uD83D\uDCD0",toml:"\uD83D\uDCD0",env:"\uD83D\uDD11",svg:"\uD83D\uDDBC️",png:"\uD83D\uDDBC️",jpg:"\uD83D\uDDBC️",jpeg:"\uD83D\uDDBC️",gif:"\uD83D\uDDBC️",webp:"\uD83D\uDDBC️",lock:"\uD83D\uDD12",gitignore:"\uD83D\uDC41️"};function aA(a){return void 0===a?"":a<1024?`${a}B`:a<1048576?`${(a/1024).toFixed(1)}K`:`${(a/1048576).toFixed(1)}M`}function aB({node:a,depth:b,expandedPaths:c,onToggle:d,onFileOpen:g,selectedPath:h}){let i=c.has(a.path),j="dir"===a.type,k=h===a.path,l=12+14*b,m=(0,f.useCallback)(()=>{j?d(a.path):g(a)},[j,a,d,g]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{className:`workspace-tree-node ${j?"is-dir":"is-file"} ${k?"selected":""}`,style:{paddingLeft:l},onClick:m,title:j?i?"Collapse":"Expand":a.path,children:[j?(0,e.jsx)("svg",{className:`workspace-arrow ${i?"open":""}`,width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"6 9 12 15 18 9"})}):(0,e.jsx)("span",{className:"workspace-arrow-spacer"}),(0,e.jsx)("span",{className:"workspace-node-icon",children:"dir"===a.type?"\uD83D\uDCC1":az[a.ext||""]||"\uD83D\uDCDD"}),(0,e.jsx)("span",{className:"workspace-node-name",children:a.name}),!j&&void 0!==a.size&&(0,e.jsx)("span",{className:"workspace-node-size",children:aA(a.size)}),j&&void 0!==a.children&&(0,e.jsx)("span",{className:"workspace-node-count",children:a.children.length})]}),j&&i&&a.children&&(0,e.jsx)("div",{className:"workspace-tree-children",children:0===a.children.length?(0,e.jsx)("div",{className:"workspace-empty-dir",style:{paddingLeft:l+14},children:"empty"}):a.children.map(a=>(0,e.jsx)(aB,{node:a,depth:b+1,expandedPaths:c,onToggle:d,onFileOpen:g,selectedPath:h},a.path))})]})}function aC({view:a,onClose:b,onCopyPath:c,workspacePath:d}){let[g,h]=(0,f.useState)(!1),i=a.content?a.content.split("\n").map((a,b)=>({num:b+1,text:a})):[];return(0,e.jsxs)("div",{className:"workspace-file-viewer",children:[(0,e.jsxs)("div",{className:"workspace-viewer-header",children:[(0,e.jsxs)("button",{className:"workspace-viewer-back",onClick:b,title:"Back to file tree",children:[(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"15 18 9 12 15 6"})}),(0,e.jsx)("span",{children:"Back"})]}),(0,e.jsxs)("div",{className:"workspace-viewer-title",children:[(0,e.jsx)("span",{className:"workspace-viewer-name",children:a.name}),a.lang&&"plaintext"!==a.lang&&(0,e.jsx)("span",{className:"workspace-viewer-lang",children:a.lang})]}),(0,e.jsxs)("div",{className:"workspace-viewer-actions",children:[a.content&&(0,e.jsx)("button",{className:"workspace-viewer-action-btn",onClick:()=>{a.content&&(navigator.clipboard.writeText(a.content).catch(()=>{}),h(!0),setTimeout(()=>h(!1),2e3))},title:"Copy file content",children:g?(0,e.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,e.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),(0,e.jsx)("button",{className:"workspace-viewer-action-btn",onClick:()=>{c(a.path)},title:"Copy file path",children:(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),(0,e.jsx)("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]})})]})]}),(0,e.jsxs)("div",{className:"workspace-viewer-meta",children:[(0,e.jsx)("span",{className:"workspace-viewer-path",title:`${d}/${a.path}`,children:a.path}),!a.loading&&!a.error&&a.content&&(0,e.jsxs)("span",{className:"workspace-viewer-stats",children:[a.lines," lines \xb7 ",aA(a.size)]})]}),(0,e.jsxs)("div",{className:"workspace-viewer-body",children:[a.loading&&(0,e.jsxs)("div",{className:"git-loading",children:[(0,e.jsx)("div",{className:"git-loading-dot"}),(0,e.jsx)("span",{children:"Loading…"})]}),!a.loading&&a.error&&(0,e.jsxs)("div",{className:"workspace-viewer-error",children:[(0,e.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,e.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,e.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,e.jsx)("p",{children:a.error}),a.binary&&(0,e.jsx)("span",{children:"Binary files cannot be displayed as text."}),a.tooLarge&&(0,e.jsx)("span",{children:"Try opening the file directly in the IDE."})]}),!a.loading&&!a.error&&null!==a.content&&(0,e.jsx)("div",{className:"workspace-code-scroll",children:(0,e.jsx)("table",{className:"workspace-code-table",children:(0,e.jsx)("tbody",{children:i.map(({num:a,text:b})=>(0,e.jsxs)("tr",{className:"workspace-code-row",children:[(0,e.jsx)("td",{className:"workspace-line-num",children:a}),(0,e.jsx)("td",{className:"workspace-line-code",children:(0,e.jsx)("span",{children:b||"\xa0"})})]},a))})})})]})]})}function aD({open:a,onClose:b,workspaceTree:c,workspaceLoading:d,onRefresh:g}){let[h,i]=(0,f.useState)(new Set),[j,k]=(0,f.useState)(!1),[l,m]=(0,f.useState)(""),[n,o]=(0,f.useState)(null),[p,q]=(0,f.useState)(null),r=(0,f.useCallback)(a=>{i(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},[]),s=(0,f.useCallback)(a=>{let b=c?`${c.workspacePath}/${a}`:a;navigator.clipboard.writeText(b).catch(()=>{}),o(a),setTimeout(()=>o(null),2e3)},[c]),t=(0,f.useCallback)(async a=>{q({path:a.path,name:a.name,content:null,lang:"",lines:0,size:a.size||0,error:null,loading:!0});try{let b=await fetch(`/api/v1/workspace/content?path=${encodeURIComponent(a.path)}`),c=await b.json();!b.ok||c.error?q(a=>a?{...a,loading:!1,error:c.error||"Failed to load file",binary:c.binary,tooLarge:c.tooLarge}:null):q({path:a.path,name:c.name,content:c.content,lang:c.lang,lines:c.lines,size:c.size,error:null,loading:!1})}catch(a){q(b=>b?{...b,loading:!1,error:`Network error: ${a.message}`}:null)}},[]),u=async()=>{k(!0),g(),await new Promise(a=>setTimeout(a,700)),k(!1)},v=(0,f.useMemo)(()=>{if(!c)return[];var a=c.tree;if(!l)return a;let b=l.toLowerCase(),d=a=>{if(a.name.toLowerCase().includes(b))return a;if("dir"===a.type&&a.children){let b=a.children.map(d).filter(Boolean);if(b.length>0)return{...a,children:b}}return null};return a.map(d).filter(Boolean)},[c,l]),w=c?.rootLabel||c?.workspacePath?.split("/").pop()||"Workspace",x=c?.workspacePath||"",y=p?p.path:null;return(0,e.jsxs)("div",{className:`workspace-panel ${a?"open":""}`,role:"complementary","aria-label":"Workspace Panel",children:[p&&(0,e.jsx)(aC,{view:p,onClose:()=>q(null),onCopyPath:s,workspacePath:x}),!p&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"workspace-panel-header",children:[(0,e.jsxs)("div",{className:"workspace-panel-title-row",children:[(0,e.jsx)("button",{className:"icon-btn",onClick:b,title:"Close workspace panel",children:(0,e.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,e.jsxs)("div",{className:"workspace-panel-title",children:[(0,e.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsx)("span",{children:"Working Directory"})]}),(0,e.jsx)("button",{className:`git-refresh-btn ${j?"spinning":""}`,onClick:u,title:"Refresh file tree",children:(0,e.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,e.jsx)("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})})]}),x&&(0,e.jsxs)("div",{className:"workspace-path-bar",title:x,children:[(0,e.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,e.jsx)("path",{d:"M12 2v4M12 18v4M4.22 4.22l2.83 2.83M16.95 16.95l2.83 2.83M2 12h4M18 12h4M4.22 19.78l2.83-2.83M16.95 7.05l2.83-2.83"})]}),(0,e.jsx)("span",{className:"workspace-path-text",children:x})]})]}),c&&(0,e.jsxs)("div",{className:"workspace-search-bar",children:[(0,e.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,e.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,e.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,e.jsx)("input",{className:"workspace-search-input",type:"text",placeholder:`Filter in ${w}…`,value:l,onChange:a=>m(a.target.value)}),l&&(0,e.jsx)("button",{className:"workspace-search-clear",onClick:()=>m(""),title:"Clear filter",children:(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,e.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,e.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),d&&!c&&(0,e.jsxs)("div",{className:"git-loading",children:[(0,e.jsx)("div",{className:"git-loading-dot"}),(0,e.jsx)("span",{children:"Loading workspace…"})]}),!d&&!c&&(0,e.jsxs)("div",{className:"git-not-repo",children:[(0,e.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,e.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),(0,e.jsx)("p",{children:"No workspace detected"}),(0,e.jsx)("span",{children:"Open a project in the IDE"})]}),n&&(0,e.jsxs)("div",{className:"workspace-copy-toast",children:[(0,e.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,e.jsx)("polyline",{points:"20 6 9 17 4 12"})}),"Path copied!"]}),c&&(0,e.jsxs)("div",{className:"workspace-tree",children:[(0,e.jsxs)("div",{className:"workspace-root-label",children:[(0,e.jsx)("span",{className:"workspace-root-icon",children:"\uD83D\uDDC2️"}),(0,e.jsx)("span",{className:"workspace-root-name",children:w}),(0,e.jsx)("span",{className:"workspace-node-count",children:c.tree.length})]}),0===v.length?(0,e.jsx)("div",{className:"git-empty",children:(0,e.jsx)("p",{children:l?"No matches":"Directory is empty"})}):(0,e.jsx)("div",{className:"workspace-tree-list",children:v.map(a=>{let b,c;return(0,e.jsx)(aB,{node:a,depth:0,expandedPaths:l?new Set((b=[],c=a=>{"dir"===a.type&&(b.push(a.path),a.children?.forEach(c))},v.forEach(c),b)):h,onToggle:r,onFileOpen:t,selectedPath:y},a.path)})})]})]})]})}function aE({networkOnline:a,isConnected:b}){let[c,d]=(0,f.useState)(!1),[g,h]=(0,f.useState)(!1);return c?(0,e.jsxs)("div",{className:`network-banner ${g?"recovered":"offline"}`,role:"status","aria-live":"polite",children:[(0,e.jsx)("span",{className:"network-banner-pulse"}),g?"✅ Connection restored":a?"\uD83D\uDD04 Reconnecting to server…":"\uD83D\uDCE1 No network — waiting for connection…"]}):null}function aF(){let{statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,selectWindow:j,selectConversation:k,startNewChat:l,startCdpServer:m,openNewWindow:n,closeWindowByIndex:o,networkOnline:p,isConnected:q,isLoadingHistory:r,showWelcome:s,messages:t,currentSteps:u,currentResponse:v,isStreaming:w,sendMessage:x,stopStreaming:y,currentMode:z,toggleMode:A,currentAgent:B,agents:C,isLoadingAgents:D,fetchAgentList:E,switchAgent:F,toggleArtifactPanel:G,artifactFiles:H,artifactPanelOpen:I,toggleChangesPanel:J,changeFiles:K,changesPanelOpen:L,acceptAllChanges:M,rejectAllChanges:N,isAccepting:O,isRejecting:P,gitStatus:Q,gitPanelOpen:R,gitChangedCount:S,toggleGitPanel:U,refreshGit:V,workspaceTree:W,workspacePanelOpen:X,workspaceLoading:Y,toggleWorkspacePanel:Z,refreshWorkspace:$,messagesEndRef:_}=function(){let[a,b]=(0,f.useState)([]),[c,d]=(0,f.useState)(!1),[e,g]=(0,f.useState)(!1),[h,i]=(0,f.useState)("Agent"),[j,k]=(0,f.useState)("connected"),[l,m]=(0,f.useState)(!0),[n,o]=(0,f.useState)(!1),[p,q]=(0,f.useState)([]),[r,s]=(0,f.useState)(""),[t,u]=(0,f.useState)("planning"),[v,w]=(0,f.useState)(null),[x,y]=(0,f.useState)([]),[z,A]=(0,f.useState)(!1),[B,C]=(0,f.useState)(!1),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(!0),H=(0,f.useRef)(null),I=(0,f.useRef)(null),J=(0,f.useRef)(null),K=(0,f.useRef)(""),L=(0,f.useRef)([]),{mutate:M}=T(),N=(0,f.useCallback)(()=>{requestAnimationFrame(()=>{J.current?.scrollIntoView({behavior:"smooth"})})},[]),O=(0,f.useCallback)((a,b)=>{k(a),i(b)},[]),{data:P,mutate:Q}=aa(ad.health,ac,{refreshInterval:F?3e4:5e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,onSuccess:a=>{g(a.connected),F||G(!0),O(a.connected?"connected":"disconnected",a.connected?"Agent":!1===a.network?"Offline":"Reconnecting…")},onError:()=>{g(!1),O("disconnected",F?"Reconnecting…":"Offline")}}),{mutate:R}=aa(ad.mode,ac,{revalidateOnFocus:!1,onSuccess:a=>{a.mode&&u(a.mode)}}),{mutate:S}=aa(ad.agent,ac,{revalidateOnFocus:!1,onSuccess:a=>{a.agent&&w(a.agent)}}),{mutate:U}=aa(ad.history,ac,{revalidateOnFocus:!1,revalidateOnMount:!0,onSuccess:a=>{o(!1),a.turns&&a.turns.length>0?(m(!1),b(a.turns.map(a=>({role:a.role,content:a.content})))):m(!0)},onError:()=>{o(!1)}}),V=(0,f.useCallback)(()=>{o(!0),b([]),U()},[U]),{artifactFiles:W,artifactPanelOpen:X,toggleArtifactPanel:Y,openArtifactPanel:Z,loadArtifacts:$}=function(a){let[b,c]=(0,f.useState)(!1),{data:d,mutate:e}=aa(ad.artifacts,ac,{refreshInterval:b?3e3:8e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),g=d?.files||[];return{artifactFiles:g,artifactPanelOpen:b,toggleArtifactPanel:(0,f.useCallback)(()=>{c(a=>!a)},[]),openArtifactPanel:(0,f.useCallback)(()=>{c(!0)},[]),loadArtifacts:e}}(),{changeFiles:_,changesPanelOpen:ab,toggleChangesPanel:ag,loadChanges:ah,acceptAllChanges:ai,rejectAllChanges:aj,isAccepting:ak,isRejecting:al}=function(){let[a,b]=(0,f.useState)(!1),[c,d]=(0,f.useState)(!1),[e,g]=(0,f.useState)(!1),{data:h,mutate:i}=aa(ad.changes,ac,{refreshInterval:a?3e3:8e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),j=h?.changes||[],k=(0,f.useCallback)(()=>{b(a=>!a)},[]),l=(0,f.useCallback)(async()=>{d(!0);try{let a=await fetch("/api/v1/changes/accept-all",{method:"POST"}),b=await a.json();return await new Promise(a=>setTimeout(a,500)),await i(),b}catch(a){return{success:!1,error:a.message}}finally{d(!1)}},[i]),m=(0,f.useCallback)(async()=>{g(!0);try{let a=await fetch("/api/v1/changes/reject-all",{method:"POST"}),b=await a.json();return await new Promise(a=>setTimeout(a,500)),await i(),b}catch(a){return{success:!1,error:a.message}}finally{g(!1)}},[i]);return{changeFiles:j,changesPanelOpen:a,toggleChangesPanel:k,loadChanges:i,acceptAllChanges:l,rejectAllChanges:m,isAccepting:c,isRejecting:e}}(),{gitStatus:am,gitPanelOpen:an,gitChangedCount:ao,toggleGitPanel:ap,refreshGit:aq}=function(){let[a,b]=(0,f.useState)(!1),{data:c,mutate:d}=aa(ad.git,ac,{refreshInterval:a?4e3:15e3,revalidateOnFocus:!0,revalidateOnReconnect:!0,dedupingInterval:2e3}),e=c?.isGitRepo!==void 0?c:null,g=e?(e.staged?.length||0)+(e.unstaged?.length||0)+(e.untracked?.length||0):0;return{gitStatus:e,gitPanelOpen:a,gitChangedCount:g,toggleGitPanel:(0,f.useCallback)(()=>{b(a=>!a)},[]),refreshGit:(0,f.useCallback)(()=>{d()},[d])}}(),{workspaceTree:ar,workspacePanelOpen:as,workspaceLoading:at,toggleWorkspacePanel:au,refreshWorkspace:av}=function(){let[a,b]=(0,f.useState)(!1),{data:c,mutate:d,isLoading:e}=aa(ad.workspace,ac,{refreshInterval:a?5e3:6e4,revalidateOnFocus:a,revalidateOnReconnect:!0,dedupingInterval:3e3}),g=c?.workspacePath?c:null;return{workspaceTree:g,workspacePanelOpen:a,workspaceLoading:e,toggleWorkspacePanel:(0,f.useCallback)(()=>{b(a=>!a)},[]),refreshWorkspace:(0,f.useCallback)(()=>{d()},[d])}}(),{windows:aw,conversations:ax,activeConversation:ay,cdpStatus:az,recentProjects:aA,loadWindows:aB,selectWindow:aC,loadConversations:aD,selectConversation:aE,checkCdpStatus:aF,startCdpServer:aG,openNewWindow:aH,closeWindowByIndex:aI,loadRecentProjects:aJ}=function(a,b,c){let{data:d,mutate:e}=aa(ad.windows,ac,{revalidateOnFocus:!0}),g=d?.windows||[],{data:h,mutate:i}=aa(ad.cdpStatus,ac,{refreshInterval:15e3,revalidateOnFocus:!0}),j={active:h?.active??!1,windowCount:h?.windowCount??0,error:h?.error??null},{data:k,mutate:l}=aa(ad.conversations,ac,{revalidateOnFocus:!0}),m=k?.conversations||[],n=m.find(a=>a.active)||null,{data:o,mutate:p}=aa(ad.recentProjects,ac,{revalidateOnFocus:!0}),q=o?.recentProjects||[],r=(0,f.useCallback)(async(a,b)=>{try{let c=await fetch(`${ae}/windows/cdp-start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:a||".",killExisting:b||!1})}),d=await c.json();return d.success&&(i(),e()),d}catch(a){return{success:!1,message:a.message||"Failed to start CDP server"}}},[i,e]),s=(0,f.useCallback)(async a=>{try{let b=await fetch(`${ae}/windows/open`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectDir:a})}),c=await b.json();return c.success&&(e(),i()),c}catch(a){return{success:!1,message:a.message||"Failed to open window"}}},[e,i]),t=(0,f.useCallback)(async(a,b)=>{try{let c=await fetch(`${ae}/windows/close`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(b?{targetId:b}:{index:a})}),d=await c.json();return d.success&&(e(),i()),d}catch(a){return{success:!1,message:a.message||"Failed to close window"}}},[e,i]),u=(0,f.useCallback)(async d=>{try{b(!0),await fetch(`${ae}/windows/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:d})}),e(),a(),setTimeout(()=>l(),300),setTimeout(()=>l(),1500),c?.()}catch{}},[e,a,b,l,c]),v=(0,f.useCallback)(async d=>{try{let e=await fetch(`${ae}/conversations/select`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:d})});if((await e.json()).success){b(!1);let e=0,f=async()=>{e++;try{let b=await fetch(`${ae}/conversations`),f=(await b.json()).conversations||[],g=f.find(a=>a.active);if(g&&g.title===d||e>10){l({conversations:f},{revalidate:!1}),a(),c?.();return}}catch{}setTimeout(f,500)};f()}}catch{}},[a,b,l,c]);return{windows:g,conversations:m,activeConversation:n,cdpStatus:j,recentProjects:q,loadWindows:e,selectWindow:u,loadConversations:l,selectConversation:v,checkCdpStatus:i,startCdpServer:r,openNewWindow:s,closeWindowByIndex:t,loadRecentProjects:p}}(V,m,(0,f.useCallback)(()=>{$(),ah()},[$,ah])),aK=(0,f.useCallback)(async()=>{let a="planning"===t?"fast":"planning";u(a);try{let b=await fetch(`${af}/chat/mode`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:a})}),c=await b.json();c.mode&&u(c.mode),R()}catch{u(t)}},[t,R]),aL=(0,f.useCallback)(async()=>{A(!0);try{let a=await fetch(`${af}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"list"})}),b=await a.json();b.agents&&y(b.agents),b.currentAgent&&w(b.currentAgent)}catch{}A(!1)},[]),aM=(0,f.useCallback)(async a=>{w(a);try{let b=await fetch(`${af}/chat/agent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"switch",agent:a})}),c=await b.json();c.agent?w(c.agent):c.success||w(v),S()}catch{w(v)}},[v,S]),aN=(0,f.useCallback)(a=>{let{type:b,...c}=a;switch(b){case"tool_call":q(a=>{let d,e=a.findIndex(a=>"tool_call"===a.type&&a.data?.id===c.id);return e>=0?(d=[...a])[e]={type:b,data:c}:d=[...a,{type:b,data:c}],L.current=d,d});break;case"thinking":case"hitl":case"error":case"notification":q(a=>{let d=[...a,{type:b,data:c}];return L.current=d,d});break;case"file_change":q(a=>{let d=[...a,{type:b,data:c}];return L.current=d,d}),$(),ah();break;case"response":s(c.content||""),K.current=c.content||"";break;case"status":O(c.isRunning?"streaming":"connected",c.isRunning?"Agent working...":"Agent");break;case"done":c.finalResponse&&(s(c.finalResponse),K.current=c.finalResponse),O("connected","Agent"),d(!1),$(),ah()}N()},[O,N,$,ah]),aO=(0,f.useCallback)(async a=>{if(!a.trim())return;H.current&&(H.current.abort(),H.current=null,fetch(`${af}/chat/stop`,{method:"POST"}).catch(()=>{})),I.current&&(await I.current,I.current=null),m(!1);let c=a.trim();b(a=>[...a,{role:"user",content:c}]),d(!0),q([]),s(""),K.current="",L.current=[],O("streaming","Agent typing...");let e=new AbortController;H.current=e,I.current=(async()=>{try{let a="",b=0;for(;b<=5;){let d=!1;try{let f={"Content-Type":"application/json"};a&&(f["Last-Event-ID"]=a);let g=(await fetch(`${af}/chat/stream`,{method:"POST",headers:f,body:JSON.stringify({message:c}),signal:e.signal})).body.getReader(),h=new TextDecoder,i="",j=!1;for(;;){let{done:b,value:c}=await g.read();if(b){d=!0;break}let e=(i+=h.decode(c,{stream:!0})).split("\n");for(let b of(i=e.pop(),e)){if(!b.startsWith(":")){if(b.startsWith("id: ")){a=b.slice(4).trim();continue}if(!b.startsWith("retry:")&&b.startsWith("data: "))try{let a=JSON.parse(b.slice(6));aN(a),"done"===a.type&&(j=!0)}catch{}}}if(j)break}if(j||!d||++b>5)break;console.warn(`[SSE] Stream dropped (attempt ${b}/5), reconnecting in 2000ms...`),await new Promise(a=>setTimeout(a,2e3))}catch(a){if("AbortError"===a.name||++b>5)throw a;console.warn(`[SSE] Fetch error (attempt ${b}/5):`,a.message),await new Promise(a=>setTimeout(a,2e3))}}}catch(a){"AbortError"!==a.name&&(q(b=>[...b,{type:"error",data:{message:a.message}}]),O("error","Error"))}finally{let a=K.current,c=[...L.current];d(!1),H.current===e&&(H.current=null),(a||c.length>0)&&b(b=>[...b,{role:"agent",content:a,steps:c}]),O("connected","Agent")}})(),await I.current},[aN,O]),aP=(0,f.useCallback)(async()=>{H.current&&H.current.abort(),b([]),q([]),s(""),m(!0);try{let a=await fetch(`${af}/chat/new`,{method:"POST"});(await a.json()).success&&O("connected","New Chat")}catch{}},[O]),aQ=(0,f.useCallback)(()=>{H.current&&(H.current.abort(),H.current=null),fetch(`${af}/chat/stop`,{method:"POST"}).catch(()=>{})},[]),aR=(0,f.useCallback)(async()=>{try{await fetch(`${af}/chat/approve`,{method:"POST"}),O("streaming","Agent")}catch{}},[O]),aS=(0,f.useCallback)(async()=>{try{await fetch(`${af}/chat/reject`,{method:"POST"})}catch{}},[]),aT=(0,f.useRef)(c);aT.current=c;let{isMonitoring:aU}=function(a={}){let{onEvent:b,onActivityStart:c,onActivityEnd:d,onTurnChange:e,onModeChange:g,onSync:h,autoConnect:i=!0}=a,[j,k]=(0,f.useState)(!1),[l,m]=(0,f.useState)(null),n=(0,f.useRef)(null),o=(0,f.useRef)(null),p=(0,f.useRef)(!1),q=(0,f.useRef)(b),r=(0,f.useRef)(c),s=(0,f.useRef)(d),t=(0,f.useRef)(e),u=(0,f.useRef)(g),v=(0,f.useRef)(h);q.current=b,r.current=c,s.current=d,t.current=e,u.current=g,v.current=h;let w=(0,f.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null),n.current&&(n.current.abort(),n.current=null),k(!1),p.current=!1},[]),x=(0,f.useCallback)(async()=>{if(p.current||n.current)return;p.current=!0;let a=new AbortController;n.current=a;try{let b=await fetch("/api/v1/chat/monitor",{signal:a.signal});if(!b.ok||!b.body)throw Error(`Monitor connection failed: ${b.status}`);k(!0),p.current=!1;let c=b.body.getReader(),d=new TextDecoder,e="";for(;;){let{done:a,value:b}=await c.read();if(a)break;let f=(e+=d.decode(b,{stream:!0})).split("\n");for(let a of(e=f.pop(),f))if(!(a.startsWith(":")||a.startsWith("retry:")||a.startsWith("id:"))&&a.startsWith("data: "))try{let{type:b,...c}=JSON.parse(a.slice(6));switch(q.current?.({type:b,...c}),b){case"activity_start":r.current?.();break;case"activity_end":s.current?.(c);break;case"turn_change":t.current?.(c);break;case"mode_change":u.current?.(c);break;case"sync":m(Date.now()),v.current?.(c)}}catch{}}}catch(a){if("AbortError"===a.name)return;console.warn("[Monitor] Connection lost:",a.message)}finally{n.current=null,p.current=!1,k(!1),a.signal.aborted||(o.current=setTimeout(()=>{o.current=null,x()},3e3))}},[]);return{isMonitoring:j,lastSyncTime:l,connect:x,disconnect:w}}({autoConnect:!0,onActivityStart:()=>{C(!0),aT.current||(k("streaming"),i("Agent working..."))},onActivityEnd:()=>{C(!1),aT.current||(k("connected"),i("Agent"),U(),$(),ah())},onTurnChange:()=>{aT.current||(m(!1),U())},onModeChange:({newMode:a})=>{u(a)},onSync:a=>{"boolean"==typeof a.isRunning&&C(a.isRunning)},onEvent:a=>{aT.current||"tool_call"!==a.type&&"response"!==a.type&&"thinking"!==a.type&&"hitl"!==a.type&&"notification"!==a.type||aN(a)}});return{messages:a,isStreaming:c,isConnected:e,statusText:h,statusState:j,showWelcome:l,isLoadingHistory:n,currentSteps:p,currentResponse:r,windows:aw,conversations:ax,activeConversation:ay,artifactFiles:W,artifactPanelOpen:X,changeFiles:_,changesPanelOpen:ab,acceptAllChanges:ai,rejectAllChanges:aj,isAccepting:ak,isRejecting:al,gitStatus:am,gitPanelOpen:an,gitChangedCount:ao,toggleGitPanel:ap,refreshGit:aq,workspaceTree:ar,workspacePanelOpen:as,workspaceLoading:at,toggleWorkspacePanel:au,refreshWorkspace:av,currentMode:t,currentAgent:v,agents:x,isLoadingAgents:z,cdpStatus:az,recentProjects:aA,isAgentBusy:B,isMonitorConnected:D,networkOnline:F,sendMessage:aO,stopStreaming:aQ,startNewChat:aP,approve:aR,reject:aS,selectWindow:aC,selectConversation:aE,toggleArtifactPanel:Y,openArtifactPanel:Z,toggleChangesPanel:ag,toggleMode:aK,fetchAgentList:aL,switchAgent:aM,startCdpServer:aG,openNewWindow:aH,closeWindowByIndex:aI,messagesEndRef:J,setShowWelcome:m}}(),ab=(0,f.useCallback)(async()=>{try{await fetch("/api/v1/health"),window.location.reload()}catch{}},[]);return(0,e.jsxs)("div",{className:"app-container",children:[(0,e.jsx)(ai,{statusState:a,statusText:b,windows:c,conversations:d,activeConversation:g,cdpStatus:h,recentProjects:i,onSelectWindow:j,onSelectConversation:k,onNewChat:l,onStartCdp:m,onOpenWindow:n,onCloseWindow:o}),(0,e.jsx)(aE,{networkOnline:p,isConnected:q}),(0,e.jsxs)("main",{className:"messages-area",role:"log","aria-live":"polite",children:[r?(0,e.jsxs)("div",{className:"history-loading",children:[(0,e.jsxs)("div",{className:"history-loading-header",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"45%"}})]}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"80%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"65%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"72%"}})]}),(0,e.jsx)("div",{className:"history-loading-header right",children:(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"35%"}})}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"90%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"55%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"68%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"40%"}})]}),(0,e.jsxs)("div",{className:"history-loading-header",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-avatar"}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"50%"}})]}),(0,e.jsxs)("div",{className:"history-loading-block",children:[(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"75%"}}),(0,e.jsx)("div",{className:"skeleton-shimmer skeleton-line",style:{width:"60%"}})]}),(0,e.jsx)("p",{className:"history-loading-text",children:"Loading conversation history…"})]}):s?(0,e.jsx)(aj,{onQuickPrompt:x}):(0,e.jsx)(as,{messages:t,currentSteps:u,currentResponse:v,isStreaming:w,onRetry:ab}),(0,e.jsx)("div",{ref:_})]}),(0,e.jsx)(at,{onSend:x,onStop:y,isStreaming:w,currentMode:z,onToggleMode:A,currentAgent:B,agents:C,isLoadingAgents:D,onFetchAgents:E,onSwitchAgent:F,onToggleArtifacts:G,artifactCount:H.length,artifactPanelOpen:I,onToggleChanges:J,changesCount:K.length,changesPanelOpen:L,onToggleGit:U,gitChangedCount:S,gitPanelOpen:R,onToggleWorkspace:Z,workspacePanelOpen:X}),(0,e.jsx)(au,{open:I,onClose:G,activeConversation:g,files:H}),(0,e.jsx)(av,{open:L,onClose:J,changes:K,onAcceptAll:M,onRejectAll:N,isAccepting:O,isRejecting:P}),(0,e.jsx)(ay,{open:R,onClose:U,gitStatus:Q,onRefresh:V}),(0,e.jsx)(aD,{open:X,onClose:Z,workspaceTree:W,workspaceLoading:Y,onRefresh:$})]})}},380:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23)),Promise.resolve().then(c.t.bind(c,440,23)),Promise.resolve().then(c.t.bind(c,4342,23)),Promise.resolve().then(c.t.bind(c,2265,23)),Promise.resolve().then(c.t.bind(c,5421,23)),Promise.resolve().then(c.t.bind(c,1335,23)),Promise.resolve().then(c.t.bind(c,664,23)),Promise.resolve().then(c.bind(c,4661))},722:a=>{"use strict";a.exports=require("next/dist/shared/lib/invariant-error")},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},985:(a,b,c)=>{Promise.resolve().then(c.bind(c,7728))},1025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},1245:(a,b,c)=>{Promise.resolve().then(c.bind(c,6187))},2056:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>m,dynamic:()=>j,metadata:()=>k,viewport:()=>l});var d=c(5735),e=c(7014),f=c.n(e),g=c(9345),h=c.n(g);c(2704);var i=c(5026);let j="force-dynamic",k={title:"Antigravity Agent",description:"Chat with the Antigravity AI Agent from any browser",applicationName:"Antigravity Agent",manifest:"/manifest.json",appleWebApp:{capable:!0,statusBarStyle:"black-translucent",title:"Antigravity Agent"},formatDetection:{telephone:!1}},l={width:"device-width",initialScale:1,maximumScale:1,viewportFit:"cover",themeColor:"#0a0a0f"};function m({children:a}){return(0,d.jsx)("html",{lang:"en",className:`${f().variable} ${h().variable}`,children:(0,d.jsxs)("body",{children:[a,(0,d.jsx)(i.default,{})]})})}},2237:(a,b,c)=>{"use strict";a.exports=c(6862)},2654:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23))},2704:()=>{},2918:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23))},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3502:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>D.a,__next_app__:()=>L,handler:()=>N,routeModule:()=>M});var d=c(7553),e=c(4006),f=c(7798),g=c(4775),h=c(9373),i=c(3461),j=c(1020),k=c(6349),l=c(4365),m=c(6023),n=c(3747),o=c(4235),p=c(3938),q=c(261),r=c(6758),s=c(7243),t=c(6713),u=c(7527),v=c(2820),w=c(8216),x=c(7929),y=c(9551),z=c(9125),A=c(6439),B=c(7068),C=c(5547),D=c.n(C),E=c(1287),F=c(1494),G=c(722),H=c(753),I=c(3954),J={};for(let a in E)0>["default","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(J[a]=()=>E[a]);c.d(b,J);let K={children:["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,9647)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/page.tsx"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,6055))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]},{layout:[()=>Promise.resolve().then(c.bind(c,2056)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,5547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.bind(c,7548)),"/home/belal/repos/ide_agent/antigravity-chat-proxy/app/not-found.tsx"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,5270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,8193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,6055))).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}}]}.children,L={require:c,loadChunk:()=>Promise.resolve()},M=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:K},distDir:".next",relativeProjectDir:""});async function N(a,b,d){var C;M.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let J=!!(0,h.getRequestMeta)(a,"minimalMode"),O="/page";"/index"===O&&(O="/");let P=await M.prepare(a,b,{srcPage:O,multiZoneDraftMode:!1});if(!P)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Q,query:R,params:S,pageIsDynamic:T,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,serverActionsManifest:X,clientReferenceManifest:Y,subresourceIntegrityManifest:Z,prerenderManifest:$,isDraftMode:_,resolvedPathname:aa,revalidateOnlyGenerated:ab,routerServerContext:ac,nextConfig:ad,parsedUrl:ae,interceptionRoutePatterns:af,deploymentId:ag}=P,ah=(0,q.normalizeAppPath)(O),{isOnDemandRevalidate:ai}=P,aj=ad.experimental.ppr&&!ad.cacheComponents&&(0,I.isInterceptionRouteAppPath)(aa)?null:M.match(aa,$),ak=!!$.routes[aa],al=a.headers["user-agent"]||"",am=(0,t.getBotType)(al),an=(0,p.isHtmlBotRequest)(a),ao=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[s.NEXT_ROUTER_PREFETCH_HEADER],ap=(0,h.getRequestMeta)(a,"isRSCRequest")??!!a.headers[s.RSC_HEADER],aq=(0,r.getIsPossibleServerAction)(a),ar=(0,m.checkIsAppPPREnabled)(ad.experimental.ppr);if(!(0,h.getRequestMeta)(a,"postponed")&&ar&&"1"===a.headers[x.NEXT_RESUME_HEADER]&&"POST"===a.method){let b=[];for await(let c of a)b.push(c);let c=Buffer.concat(b).toString("utf8");(0,h.addRequestMeta)(a,"postponed",c)}let as=ar&&(null==(C=$.routes[ah]??$.dynamicRoutes[ah])?void 0:C.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?(0,h.getRequestMeta)(a,"postponed"):void 0,aw=as&&ap&&!ao;J&&(aw=aw&&!!av);let ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=(!an||!as)&&(!al||(0,p.shouldServeStreamingMetadata)(al,ad.htmlLimitedBots)),az=!!((aj||ak||$.routes[ah])&&!(an&&as)),aA=as&&!0===ad.cacheComponents,aB=!0===M.isDev||!az||"string"==typeof av||(aA&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aw&&!J:aw),aC=an&&as,aD=null;_||!az||aB||aq||av||aw||(aD=aa);let aE=aD;!aE&&M.isDev&&(aE=aa),M.isDev||_||!az||!ap||aw||(0,k.d)(a.headers);let aF={...E,tree:K,GlobalError:D(),handler:N,routeModule:M,__next_app__:L};X&&Y&&(0,o.setManifestsSingleton)({page:O,clientReferenceManifest:Y,serverActionsManifest:X});let aG=a.method||"GET",aH=(0,g.getTracer)(),aI=aH.getActiveScopeSpan(),aJ=async()=>((null==ac?void 0:ac.render404)?await ac.render404(a,b,ae,!1):b.end("This page could not be found"),null);try{let f=M.getVaryHeader(aa,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return M.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aH.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aG} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aG} ${O}`)})},m=(0,h.getRequestMeta)(a,"incrementalCache"),o=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let l={query:R,params:S,page:ah,sharedContext:{buildId:Q},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aF,Component:(0,j.T)(aF),params:S,routeModule:M,page:O,postponed:f,shouldWaitOnAllReady:aC,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||aB,buildManifest:U,nextFontManifest:V,reactLoadableManifest:W,subresourceIntegrityManifest:Z,setCacheStatus:null==ac?void 0:ac.setCacheStatus,setIsrStatus:null==ac?void 0:ac.setIsrStatus,setReactDebugChannel:null==ac?void 0:ac.setReactDebugChannel,sendErrorsToBrowser:null==ac?void 0:ac.sendErrorsToBrowser,dir:c(3873).join(process.cwd(),M.relativeProjectDir),isDraftMode:_,botType:am,isOnDemandRevalidate:ai,isPossibleServerAction:aq,assetPrefix:ad.assetPrefix,nextConfigOutput:ad.output,crossOrigin:ad.crossOrigin,trailingSlash:ad.trailingSlash,images:ad.images,previewProps:$.preview,deploymentId:ag,enableTainting:ad.experimental.taint,htmlLimitedBots:ad.htmlLimitedBots,reactMaxHeadersLength:ad.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:m,cacheLifeProfiles:ad.cacheLife,basePath:ad.basePath,serverActions:ad.experimental.serverActions,...at||au?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:at}:{},cacheComponents:!!ad.cacheComponents,experimental:{isRoutePPREnabled:as,expireTime:ad.expireTime,staleTimes:ad.experimental.staleTimes,dynamicOnHover:!!ad.experimental.dynamicOnHover,inlineCss:!!ad.experimental.inlineCss,authInterrupts:!!ad.experimental.authInterrupts,clientTraceMetadata:ad.experimental.clientTraceMetadata||[],clientParamParsingOrigins:ad.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,B.parseMaxPostponedStateSize)(ad.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>M.onRequestError(a,b,d,e,ac),err:(0,h.getRequestMeta)(a,"invokeError"),dev:M.isDev}};at&&(l.renderOpts.nextExport=!0,l.renderOpts.supportsDynamicResponse=!1,l.renderOpts.isDebugDynamicAccesses=at),i&&(l.renderOpts.supportsDynamicResponse=!1);let n=await k(e,l),{metadata:o}=n,{cacheControl:p,headers:q={},fetchTags:r,fetchMetrics:s}=o;if(r&&(q[x.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,az&&(null==p?void 0:p.revalidate)===0&&!M.isDev&&!as){let a=o.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${aa}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
|
|
2
|
+
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:u.CachedRouteKind.APP_PAGE,html:n,headers:q,rscData:o.flightData,postponed:o.postponed,status:o.statusCode,segmentData:o.segmentData},cacheControl:p}},p=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i,forceStaticRender:j=!1})=>{let k,l=!1===M.isDev,q=c||b.writableEnded;if(ai&&ab&&!f&&!J)return(null==ac?void 0:ac.render404)?await ac.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(aj&&(k=(0,v.parseFallbackField)(aj.fallback)),k===v.FallbackMode.PRERENDER&&(0,t.isBot)(al)&&(!as||an)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ai=!0),ai&&(k!==v.FallbackMode.NOT_FOUND||f)&&(k=v.FallbackMode.BLOCKING_STATIC_RENDER),!J&&k!==v.FallbackMode.BLOCKING_STATIC_RENDER&&aE&&!q&&!_&&T&&(l||!ak)){if((l||aj)&&k===v.FallbackMode.NOT_FOUND){if(ad.experimental.adapterPath)return await aJ();throw new A.NoFallbackError}if(as&&(ad.cacheComponents?!aw:!ap)){let b=l&&"string"==typeof(null==aj?void 0:aj.fallback)?aj.fallback:ah,c=l&&(null==aj?void 0:aj.fallbackRouteParams)?(0,n.createOpaqueFallbackRouteParams)(aj.fallbackRouteParams):au?(0,n.getFallbackRouteParams)(ah,M):null,f=await M.handleResponse({cacheKey:b,req:a,nextConfig:ad,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:$,isRoutePPREnabled:as,responseGenerator:async()=>o({span:i,postponed:void 0,fallbackRouteParams:c,forceStaticRender:!1}),waitUntil:d.waitUntil,isMinimalMode:J});if(null===f)return null;if(f)return delete f.cacheControl,f}}let r=ai||g||!av?void 0:av;if(aA&&!J&&m&&aw&&!j){let b=await m.get(aa,{kind:u.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===u.CachedRouteKind.APP_PAGE&&(r=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,H.scheduleOnNextTick)(async()=>{let b=M.getResponseCache(a);try{await b.revalidate(aa,m,as,!1,a=>p({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if(at&&void 0!==r)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:u.CachedRouteKind.PAGES,html:w.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let s=l&&(null==aj?void 0:aj.fallbackRouteParams)&&(0,h.getRequestMeta)(a,"renderFallbackShell")?(0,n.createOpaqueFallbackRouteParams)(aj.fallbackRouteParams):au?(0,n.getFallbackRouteParams)(ah,M):null;return o({span:i,postponed:r,fallbackRouteParams:s,forceStaticRender:j})},q=async c=>{var f,g,i,j,k;let l,m=await M.handleResponse({cacheKey:aD,responseGenerator:a=>p({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ai,isRoutePPREnabled:as,req:a,nextConfig:ad,prerenderManifest:$,waitUntil:d.waitUntil,isMinimalMode:J});if(_&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),M.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!m){if(aD)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=m.value)?void 0:f.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=m.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let n="string"==typeof m.value.postponed;az&&!aw&&(!n||ao)&&(J||b.setHeader("x-nextjs-cache",ai?"REVALIDATED":m.isMiss?"MISS":m.isStale?"STALE":"HIT"),b.setHeader(s.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=m;if(av)l={revalidate:0,expire:void 0};else if(aw)l={revalidate:0,expire:void 0};else if(!M.isDev)if(_)l={revalidate:0,expire:void 0};else if(az){if(m.cacheControl)if("number"==typeof m.cacheControl.revalidate){if(m.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${m.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:m.cacheControl.revalidate,expire:(null==(j=m.cacheControl)?void 0:j.expire)??ad.expireTime}}else l={revalidate:x.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(m.cacheControl=l,"string"==typeof ax&&(null==q?void 0:q.kind)===u.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[x.NEXT_CACHE_TAGS_HEADER];J&&az&&c&&"string"==typeof c&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ax);return void 0!==d?(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.fromStatic(d,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl}):(b.statusCode=204,(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl}))}let r=aA?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r(m,{url:(0,h.getRequestMeta)(a,"initURL")??a.url}))return null;if(q.headers){let a={...q.headers};for(let[c,d]of(J&&az||delete a[x.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let t=null==(g=q.headers)?void 0:g[x.NEXT_CACHE_TAGS_HEADER];if(J&&az&&t&&"string"==typeof t&&b.setHeader(x.NEXT_CACHE_TAGS_HEADER,t),!q.status||ap&&as||(b.statusCode=q.status),!J&&q.status&&F.RedirectStatusCode[q.status]&&ap&&(b.statusCode=200),n&&!aw&&b.setHeader(s.NEXT_DID_POSTPONE_HEADER,"1"),ap&&!_){if(void 0===q.rscData){if(q.html.contentType!==s.RSC_CONTENT_TYPE_HEADER)if(ad.cacheComponents)return b.statusCode=404,(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.EMPTY,cacheControl:m.cacheControl});else throw Object.defineProperty(new G.InvariantError(`Expected RSC response, got ${q.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:q.html,cacheControl:m.cacheControl})}return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:w.default.fromStatic(q.rscData,s.RSC_CONTENT_TYPE_HEADER),cacheControl:m.cacheControl})}let v=q.html;if(!n||J||ap)return(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:m.cacheControl});if(at)return v.push(new ReadableStream({start(a){a.enqueue(y.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}});let A=new TransformStream;return v.push(A.readable),o({span:c,postponed:q.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==u.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(A.writable)}).catch(a=>{A.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,z.sendRenderResult)({req:a,res:b,generateEtags:ad.generateEtags,poweredByHeader:ad.poweredByHeader,result:v,cacheControl:{revalidate:0,expire:void 0}})};if(!aI)return await aH.withPropagatedContext(a.headers,()=>aH.trace(i.BaseServerSpan.handleRequest,{spanName:`${aG} ${O}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aG,"http.target":a.url}},q));await q(aI)}catch(b){throw b instanceof A.NoFallbackError||await M.onRequestError(a,b,{routerKind:"App Router",routePath:O,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:az,isOnDemandRevalidate:ai})},!1,ac),b}}},3873:a=>{"use strict";a.exports=require("path")},3948:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23)),Promise.resolve().then(c.t.bind(c,5098,23)),Promise.resolve().then(c.t.bind(c,7644,23)),Promise.resolve().then(c.t.bind(c,3859,23)),Promise.resolve().then(c.t.bind(c,8099,23)),Promise.resolve().then(c.t.bind(c,6237,23)),Promise.resolve().then(c.t.bind(c,8562,23)),Promise.resolve().then(c.t.bind(c,6675,23))},3954:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/interception-routes")},5026:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/pwa-install-prompt.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/pwa-install-prompt.tsx","default")},6055:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(8868);let e=async a=>[{type:"image/x-icon",sizes:"16x16",url:(0,d.fillMetadataSegment)(".",await a.params,"favicon.ico")+"?603d046c9a6fdfbb"}]},6187:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/chat-container.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/belal/repos/ide_agent/antigravity-chat-proxy/components/chat-container.tsx","default")},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6487:()=>{},6713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},6862:(a,b,c)=>{"use strict";var d=c(7484),e="function"==typeof Object.is?Object.is:function(a,b){return a===b&&(0!==a||1/a==1/b)||a!=a&&b!=b},f=d.useState,g=d.useEffect,h=d.useLayoutEffect,i=d.useDebugValue;function j(a){var b=a.getSnapshot;a=a.value;try{var c=b();return!e(a,c)}catch(a){return!0}}var k="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(a,b){return b()}:function(a,b){var c=b(),d=f({inst:{value:c,getSnapshot:b}}),e=d[0].inst,k=d[1];return h(function(){e.value=c,e.getSnapshot=b,j(e)&&k({inst:e})},[a,c,b]),g(function(){return j(e)&&k({inst:e}),a(function(){j(e)&&k({inst:e})})},[a]),i(c),c};b.useSyncExternalStore=void 0!==d.useSyncExternalStore?d.useSyncExternalStore:k},7068:a=>{"use strict";a.exports=require("next/dist/shared/lib/size-limit")},7548:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",backgroundColor:"#0a0a0f",color:"#888",fontFamily:"system-ui, sans-serif",margin:0},children:[(0,d.jsx)("h1",{style:{fontSize:"3rem",margin:0,color:"#fff"},children:"404"}),(0,d.jsx)("p",{style:{fontSize:"1.1rem",marginTop:"0.5rem"},children:"Page not found"})]})}},7728:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(8249),e=c(7484),f=c(1220);function g(){let[a,b]=(0,e.useState)(null),[c,g]=(0,e.useState)(!1),[h]=(0,e.useState)(()=>!1),[i]=(0,e.useState)(()=>!1),j=(0,e.useCallback)(async()=>{if(a){try{await a.prompt();let b=await a.userChoice;"accepted"===b.outcome&&g(!1)}catch(a){console.error("PWA install error:",a)}b(null)}},[a]),k=(0,e.useCallback)(()=>{g(!1),localStorage.setItem("pwa-install-dismissed",Date.now().toString())},[]);return!c||i?null:(0,d.jsxs)("div",{style:{position:"fixed",bottom:0,left:0,right:0,zIndex:9999,padding:"12px 16px",background:"linear-gradient(135deg, rgba(20, 20, 35, 0.98), rgba(30, 25, 50, 0.98))",backdropFilter:"blur(20px)",borderTop:"1px solid rgba(139, 92, 246, 0.3)",display:"flex",alignItems:"center",gap:"12px",animation:"slideUp 0.3s ease-out",boxShadow:"0 -4px 20px rgba(0, 0, 0, 0.4)"},children:[(0,d.jsx)("style",{children:`
|
|
3
3
|
@keyframes slideUp {
|
|
4
4
|
from { transform: translateY(100%); opacity: 0; }
|
|
5
5
|
to { transform: translateY(0); opacity: 1; }
|
|
6
6
|
}
|
|
7
|
-
`}),(0,d.jsx)("div",{style:{width:44,height:44,borderRadius:10,overflow:"hidden",flexShrink:0,border:"1px solid rgba(139, 92, 246, 0.2)"},children:(0,d.jsx)(f.default,{src:"/icons/icon-192.png",alt:"Antigravity",width:44,height:44,style:{display:"block"}})}),(0,d.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,d.jsx)("div",{style:{color:"#f0f0f5",fontSize:"14px",fontWeight:600,fontFamily:"Inter, system-ui, sans-serif"},children:"Install Antigravity"}),(0,d.jsx)("div",{style:{color:"#9ca3af",fontSize:"12px",fontFamily:"Inter, system-ui, sans-serif",marginTop:2},children:h?'Tap the Share button, then "Add to Home Screen"':"Add to home screen for quick access"})]}),!h&&(0,d.jsx)("button",{onClick:j,style:{padding:"8px 16px",borderRadius:8,border:"none",background:"linear-gradient(135deg, #8b5cf6, #6d28d9)",color:"#fff",fontSize:"13px",fontWeight:600,fontFamily:"Inter, system-ui, sans-serif",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"},children:"Install"}),(0,d.jsx)("button",{onClick:k,style:{background:"none",border:"none",color:"#6b7280",fontSize:"18px",cursor:"pointer",padding:"4px",lineHeight:1,flexShrink:0},"aria-label":"Dismiss install prompt",children:"✕"})]})}},8335:()=>{},8354:a=>{"use strict";a.exports=require("util")},8509:(a,b,c)=>{Promise.resolve().then(c.bind(c,
|
|
7
|
+
`}),(0,d.jsx)("div",{style:{width:44,height:44,borderRadius:10,overflow:"hidden",flexShrink:0,border:"1px solid rgba(139, 92, 246, 0.2)"},children:(0,d.jsx)(f.default,{src:"/icons/icon-192.png",alt:"Antigravity",width:44,height:44,style:{display:"block"}})}),(0,d.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,d.jsx)("div",{style:{color:"#f0f0f5",fontSize:"14px",fontWeight:600,fontFamily:"Inter, system-ui, sans-serif"},children:"Install Antigravity"}),(0,d.jsx)("div",{style:{color:"#9ca3af",fontSize:"12px",fontFamily:"Inter, system-ui, sans-serif",marginTop:2},children:h?'Tap the Share button, then "Add to Home Screen"':"Add to home screen for quick access"})]}),!h&&(0,d.jsx)("button",{onClick:j,style:{padding:"8px 16px",borderRadius:8,border:"none",background:"linear-gradient(135deg, #8b5cf6, #6d28d9)",color:"#fff",fontSize:"13px",fontWeight:600,fontFamily:"Inter, system-ui, sans-serif",cursor:"pointer",flexShrink:0,whiteSpace:"nowrap"},children:"Install"}),(0,d.jsx)("button",{onClick:k,style:{background:"none",border:"none",color:"#6b7280",fontSize:"18px",cursor:"pointer",padding:"4px",lineHeight:1,flexShrink:0},"aria-label":"Dismiss install prompt",children:"✕"})]})}},8335:()=>{},8354:a=>{"use strict";a.exports=require("util")},8509:(a,b,c)=>{Promise.resolve().then(c.bind(c,293))},9121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},9129:(a,b,c)=>{Promise.resolve().then(c.bind(c,5026))},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9647:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>h,dynamic:()=>g});var d=c(5735),e=c(6187),f=c(1986);let g="force-dynamic";function h(){return(0,d.jsx)(f.Suspense,{fallback:(0,d.jsx)("div",{className:"p-8 text-center text-gray-500",children:"Loading Chat Interface..."}),children:(0,d.jsx)(e.default,{})})}}};var b=require("../webpack-runtime.js");b.C(a);var c=b.X(0,[4741,7471,6368],()=>b(b.s=3502));module.exports=c})();
|