trident-git 0.4.0 → 0.5.1
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/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +12 -9
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +27 -3
- package/.next/routes-manifest.json +18 -0
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +3 -3
- package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/credentials/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/custom-scripts/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/open/route.js +1 -0
- package/.next/server/app/api/fs/open/route.js.nft.json +1 -0
- package/.next/server/app/api/fs/open/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/fs/open-terminal/route.js +1 -0
- package/.next/server/app/api/fs/open-terminal/route.js.nft.json +1 -0
- package/.next/server/app/api/fs/open-terminal/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/fs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/action/route.js +1 -1
- package/.next/server/app/api/git/action/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/diff/route.js +1 -1
- package/.next/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repos/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repos/route.js +1 -1
- package/.next/server/app/api/repos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next/server/app/credentials/page_client-reference-manifest.js +1 -1
- package/.next/server/app/credentials.html +1 -1
- package/.next/server/app/credentials.rsc +3 -3
- package/.next/server/app/credentials.segments/_full.segment.rsc +3 -3
- package/.next/server/app/credentials.segments/_head.segment.rsc +1 -1
- package/.next/server/app/credentials.segments/_index.segment.rsc +3 -3
- package/.next/server/app/credentials.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/credentials.segments/credentials/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/credentials.segments/credentials.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +5 -5
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/.next/server/app/index.segments/_full.segment.rsc +5 -5
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace/changes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace/changes.html +1 -1
- package/.next/server/app/workspace/changes.rsc +6 -6
- package/.next/server/app/workspace/changes.segments/_full.segment.rsc +6 -6
- package/.next/server/app/workspace/changes.segments/_head.segment.rsc +1 -1
- package/.next/server/app/workspace/changes.segments/_index.segment.rsc +3 -3
- package/.next/server/app/workspace/changes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/workspace/changes.segments/workspace/changes/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/workspace/changes.segments/workspace/changes.segment.rsc +1 -1
- package/.next/server/app/workspace/changes.segments/workspace.segment.rsc +3 -3
- package/.next/server/app/workspace/conflicts/page.js +2 -0
- package/.next/server/app/workspace/conflicts/page.js.nft.json +1 -0
- package/.next/server/app/workspace/conflicts/page_client-reference-manifest.js +1 -0
- package/.next/server/app/workspace/conflicts.html +1 -0
- package/.next/server/app/workspace/conflicts.meta +16 -0
- package/.next/server/app/workspace/conflicts.rsc +26 -0
- package/.next/server/app/workspace/conflicts.segments/_full.segment.rsc +26 -0
- package/.next/server/app/workspace/conflicts.segments/_head.segment.rsc +6 -0
- package/.next/server/app/workspace/conflicts.segments/_index.segment.rsc +8 -0
- package/.next/server/app/workspace/conflicts.segments/_tree.segment.rsc +7 -0
- package/.next/server/app/workspace/conflicts.segments/workspace/conflicts/__PAGE__.segment.rsc +10 -0
- package/.next/server/app/workspace/conflicts.segments/workspace/conflicts.segment.rsc +4 -0
- package/.next/server/app/workspace/conflicts.segments/workspace.segment.rsc +7 -0
- package/.next/server/app/workspace/custom-scripts/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace/custom-scripts.html +1 -1
- package/.next/server/app/workspace/custom-scripts.rsc +6 -6
- package/.next/server/app/workspace/custom-scripts.segments/_full.segment.rsc +6 -6
- package/.next/server/app/workspace/custom-scripts.segments/_head.segment.rsc +1 -1
- package/.next/server/app/workspace/custom-scripts.segments/_index.segment.rsc +3 -3
- package/.next/server/app/workspace/custom-scripts.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/workspace/custom-scripts.segments/workspace/custom-scripts.segment.rsc +1 -1
- package/.next/server/app/workspace/custom-scripts.segments/workspace.segment.rsc +3 -3
- package/.next/server/app/workspace/history/page.js +2 -2
- package/.next/server/app/workspace/history/page.js.nft.json +1 -1
- package/.next/server/app/workspace/history/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace/history.html +1 -1
- package/.next/server/app/workspace/history.rsc +6 -6
- package/.next/server/app/workspace/history.segments/_full.segment.rsc +6 -6
- package/.next/server/app/workspace/history.segments/_head.segment.rsc +1 -1
- package/.next/server/app/workspace/history.segments/_index.segment.rsc +3 -3
- package/.next/server/app/workspace/history.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/workspace/history.segments/workspace/history/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/workspace/history.segments/workspace/history.segment.rsc +1 -1
- package/.next/server/app/workspace/history.segments/workspace.segment.rsc +3 -3
- package/.next/server/app/workspace/page.js +1 -1
- package/.next/server/app/workspace/page.js.nft.json +1 -1
- package/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace/settings.html +1 -1
- package/.next/server/app/workspace/settings.rsc +6 -6
- package/.next/server/app/workspace/settings.segments/_full.segment.rsc +6 -6
- package/.next/server/app/workspace/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/workspace/settings.segments/_index.segment.rsc +3 -3
- package/.next/server/app/workspace/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/workspace/settings.segments/workspace/settings/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/workspace/settings.segments/workspace/settings.segment.rsc +1 -1
- package/.next/server/app/workspace/settings.segments/workspace.segment.rsc +3 -3
- package/.next/server/app/workspace/stashes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace/stashes.html +1 -1
- package/.next/server/app/workspace/stashes.rsc +6 -6
- package/.next/server/app/workspace/stashes.segments/_full.segment.rsc +6 -6
- package/.next/server/app/workspace/stashes.segments/_head.segment.rsc +1 -1
- package/.next/server/app/workspace/stashes.segments/_index.segment.rsc +3 -3
- package/.next/server/app/workspace/stashes.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/workspace/stashes.segments/workspace/stashes/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/workspace/stashes.segments/workspace/stashes.segment.rsc +1 -1
- package/.next/server/app/workspace/stashes.segments/workspace.segment.rsc +3 -3
- package/.next/server/app/workspace.html +1 -1
- package/.next/server/app/workspace.rsc +6 -6
- package/.next/server/app/workspace.segments/_full.segment.rsc +6 -6
- package/.next/server/app/workspace.segments/_head.segment.rsc +1 -1
- package/.next/server/app/workspace.segments/_index.segment.rsc +3 -3
- package/.next/server/app/workspace.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/workspace.segments/workspace.segment.rsc +3 -3
- package/.next/server/app-paths-manifest.json +12 -9
- package/.next/server/chunks/309.js +1 -1
- package/.next/server/chunks/386.js +1 -1
- package/.next/server/chunks/392.js +1 -1
- package/.next/server/chunks/471.js +4 -4
- package/.next/server/chunks/557.js +4 -4
- package/.next/server/chunks/725.js +7 -0
- package/.next/server/chunks/946.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/26-a76b3447d31c0f53.js +1 -0
- package/.next/static/chunks/446-93c95576ca9e5b50.js +8 -0
- package/.next/static/chunks/{790-3e8fa6e595d97940.js → 790-8b6ef3e713ecba06.js} +1 -1
- package/.next/static/chunks/app/_global-error/page-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/credentials/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/custom-scripts/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/fs/open/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/fs/open-terminal/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/fs/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/git/action/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/git/branches/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/git/log/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/repos/clone/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/repos/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/api/settings/route-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/app/workspace/conflicts/page-18af9ad0cb7d82fc.js +1 -0
- package/.next/static/chunks/app/workspace/history/{page-89bfc9747faed53b.js → page-023ae7cc39ee9664.js} +1 -1
- package/.next/static/chunks/app/workspace/layout-586ee7be4f6abf20.js +1 -0
- package/.next/static/chunks/app/workspace/{page-2b043ff528917d81.js → page-f7b05714b4e0eb2a.js} +1 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-2c17ff49390f8b16.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-2c17ff49390f8b16.js +1 -0
- package/.next/static/css/{c4117eb58c7d0642.css → c4d257db89c36a31.css} +1 -1
- package/.next/static/m-UCD7bYHUI6k3svPwOgO/_buildManifest.js +1 -0
- package/README.md +2 -0
- package/package.json +1 -1
- package/.next/server/chunks/739.js +0 -7
- package/.next/static/IsI_X7X1cKXUpjpCKYBiv/_buildManifest.js +0 -1
- package/.next/static/chunks/147-64f7ae9eceb783be.js +0 -8
- package/.next/static/chunks/26-71a5a763fed8540a.js +0 -1
- package/.next/static/chunks/app/_global-error/page-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/credentials/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/custom-scripts/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/fs/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/git/action/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/git/branches/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/git/log/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/repos/clone/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/repos/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/api/settings/route-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/app/workspace/layout-75643230bfa68574.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-10b66af9ca2c453f.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-10b66af9ca2c453f.js +0 -1
- /package/.next/static/{IsI_X7X1cKXUpjpCKYBiv → m-UCD7bYHUI6k3svPwOgO}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--m_UCD7bYHUI6k3svPwOgO--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/4cf2300e9c8272f7-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/93f479601ee12b01-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/de70bee13400563f.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/c4d257db89c36a31.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-7dec27dc3bfe207a.js"/><script src="/_next/static/chunks/4bd1b696-096d35a2bd1da3af.js" async=""></script><script src="/_next/static/chunks/794-37dad9bbc14b04b8.js" async=""></script><script src="/_next/static/chunks/main-app-9697367bdd1cd307.js" async=""></script><script src="/_next/static/chunks/176-b068120641913226.js" async=""></script><script src="/_next/static/chunks/785-e6d755147ff87934.js" async=""></script><script src="/_next/static/chunks/200-3664e65687e716a2.js" async=""></script><script src="/_next/static/chunks/26-a76b3447d31c0f53.js" async=""></script><script src="/_next/static/chunks/app/layout-dda593914e513c38.js" async=""></script><link rel="preload" href="https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css" as="style"/><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Trident</title><meta name="description" content="Git repository management tool"/><link rel="icon" href="/icon.png?91e8b75214a43d69" type="image/png" sizes="256x256"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_188709 __variable_9a8899 antialiased"><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("data-theme","theme","system",null,["light","dark"],null,true,true)</script><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-7dec27dc3bfe207a.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[2246,[\"176\",\"static/chunks/176-b068120641913226.js\",\"785\",\"static/chunks/785-e6d755147ff87934.js\",\"200\",\"static/chunks/200-3664e65687e716a2.js\",\"26\",\"static/chunks/26-a76b3447d31c0f53.js\",\"558\",\"static/chunks/app/layout-dda593914e513c38.js\"],\"Providers\"]\n3:I[7121,[],\"\"]\n4:I[4581,[],\"\"]\n5:I[484,[],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[484,[],\"ViewportBoundary\"]\na:I[484,[],\"MetadataBoundary\"]\nc:I[7123,[],\"\"]\n:HL[\"/_next/static/media/4cf2300e9c8272f7-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/93f479601ee12b01-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/de70bee13400563f.css\",\"style\"]\n:HL[\"/_next/static/css/c4d257db89c36a31.css\",\"style\"]\n:HL[\"https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"m-UCD7bYHUI6k3svPwOgO\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/de70bee13400563f.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/c4d257db89c36a31.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"link\",null,{\"rel\":\"stylesheet\",\"href\":\"https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css\"}]}],[\"$\",\"body\",null,{\"className\":\"__variable_188709 __variable_9a8899 antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[6869,[],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Trident\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Git repository management tool\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.png?91e8b75214a43d69\",\"type\":\"image/png\",\"sizes\":\"256x256\"}],[\"$\",\"$Ld\",\"3\",{}]]\n"])</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-7dec27dc3bfe207a.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[484,[],\"ViewportBoundary\"]\n9:I[484,[],\"MetadataBoundary\"]\nb:I[7123,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
1
|
+
<!DOCTYPE html><!--m_UCD7bYHUI6k3svPwOgO--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-7dec27dc3bfe207a.js"/><script src="/_next/static/chunks/4bd1b696-096d35a2bd1da3af.js" async=""></script><script src="/_next/static/chunks/794-37dad9bbc14b04b8.js" async=""></script><script src="/_next/static/chunks/main-app-9697367bdd1cd307.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-7dec27dc3bfe207a.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[484,[],\"ViewportBoundary\"]\n9:I[484,[],\"MetadataBoundary\"]\nb:I[7123,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"m-UCD7bYHUI6k3svPwOgO\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"Ce9ObcujrjfFTJpc/qu7s1/0UbkfLwmQA3Hi24IMR2o="}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[26],{696:(t,e,r)=>{r.d(e,{F3:()=>p,F7:()=>b,GK:()=>h,Jy:()=>C,Lp:()=>m,Ud:()=>T,X0:()=>y,Y5:()=>u,_6:()=>j,_X:()=>k,a3:()=>I,b5:()=>w,cT:()=>F,en:()=>g,fr:()=>d,gg:()=>x,st:()=>v,t0:()=>l,uG:()=>f,xV:()=>S});var n=r(2115),a=r(4109),s=r(5625),o=r(8934),i=r(6695);let c="/api";function l(){return(0,a.I)({queryKey:["settings"],queryFn:async()=>{let t=await fetch(`${c}/settings`);if(!t.ok)throw Error("Failed to fetch settings");return t.json()}})}function u(){let t=(0,s.jE)();return(0,o.n)({mutationFn:async t=>{let e=await fetch(`${c}/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok)throw Error("Failed to update settings");return e.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["settings"]})}})}function f(){return(0,a.I)({queryKey:["repos"],queryFn:async()=>{let t=await fetch(`${c}/repos`);if(!t.ok)throw Error("Failed to fetch repositories");return t.json()}})}function h(t){let{data:e}=f();return(0,n.useMemo)(()=>e?.find(e=>e.path===t)||null,[e,t])}function p(){let t=(0,s.jE)();return(0,o.n)({mutationFn:async({path:t,name:e,initializeIfNeeded:r})=>{let n=await fetch(`${c}/repos`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,name:e,initializeIfNeeded:r})});if(!n.ok)throw Error((await n.json().catch(()=>({}))).error||"Failed to add repository");return n.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["repos"]})}})}function d(){let t=(0,s.jE)();return(0,o.n)({mutationFn:async t=>{let e=await fetch(`${c}/repos/clone`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await e.json().catch(()=>({}));if(!e.ok)throw Error(r.error||"Failed to clone repository");return r},onSuccess:()=>{t.invalidateQueries({queryKey:["repos"]})}})}function m(){let t=(0,s.jE)();return(0,o.n)({mutationFn:async({path:t,updates:e})=>{let r=await fetch(`${c}/repos`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,updates:e})});if(!r.ok)throw Error(await r.text());return r.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["repos"]})}})}function y(){let t=(0,s.jE)();return(0,o.n)({mutationFn:async({path:t,deleteLocalFolder:e=!1})=>{let r=await fetch(`${c}/repos`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,deleteLocalFolder:e})});if(!r.ok)throw Error(await r.text());return r.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["repos"]})}})}function g(t){return(0,a.I)({queryKey:["git",t,"status"],queryFn:async()=>{if(!t)return null;let e=await fetch(`${c}/git/status?path=${encodeURIComponent(t)}`);if(!e.ok){let t=Error((await e.json().catch(()=>({}))).error||"Failed to fetch status");throw t.status=e.status,t}return e.json()},enabled:!!t,refetchOnWindowFocus:!0,refetchOnReconnect:!0,retry:(t,e)=>404!==e.status&&400!==e.status&&t<3})}function b(t){return(0,a.I)({queryKey:["git",t,"conflict-state"],queryFn:async()=>{if(!t)return{operation:null,conflictedFiles:[],hasConflicts:!1,canContinue:!1};let e=await fetch(`${c}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:t,action:"get-conflict-state"})});if(!e.ok){let t=Error((await e.json().catch(()=>({}))).error||"Failed to fetch conflict state");throw t.status=e.status,t}let r=await e.json();return{operation:r.operation??null,conflictedFiles:r.conflictedFiles??[],hasConflicts:!!r.hasConflicts,canContinue:!!r.canContinue}},enabled:!!t,refetchOnWindowFocus:!0,refetchOnReconnect:!0,retry:(t,e)=>404!==e.status&&400!==e.status&&t<3})}function w(t,e){return(0,a.I)({queryKey:["git",t,"conflict-file-versions",e],queryFn:async()=>{if(!t||!e)return{ours:"",theirs:"",current:""};let r=await fetch(`${c}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:t,action:"get-conflict-file-versions",data:{path:e}})});if(!r.ok){let t=Error((await r.json().catch(()=>({}))).error||"Failed to fetch conflict file versions");throw t.status=r.status,t}let n=await r.json();return{ours:"string"==typeof n.ours?n.ours:"",theirs:"string"==typeof n.theirs?n.theirs:"",current:"string"==typeof n.current?n.current:""}},enabled:!!t&&!!e,refetchOnWindowFocus:!0,refetchOnReconnect:!0,retry:(t,e)=>404!==e.status&&400!==e.status&&t<3})}function k(t,e=50){return(0,a.I)({queryKey:["git",t,"log",e],queryFn:async()=>{if(!t)return null;let r=await fetch(`${c}/git/log?path=${encodeURIComponent(t)}&limit=${e}`);if(!r.ok){let t=Error((await r.json().catch(()=>({}))).error||"Failed to fetch log");throw t.status=r.status,t}return r.json()},enabled:!!t,placeholderData:t=>t,retry:(t,e)=>404!==e.status&&400!==e.status&&t<3})}function j(t){return(0,a.I)({queryKey:["git",t,"branches"],queryFn:async()=>{if(!t)return null;let e=await fetch(`${c}/git/branches?path=${encodeURIComponent(t)}`);if(!e.ok)throw Error("Failed to fetch branches");return e.json()},enabled:!!t})}function S(t,e){return(0,a.I)({queryKey:["git",t,"diff",e],queryFn:async()=>{if(!t||!e)return null;let r=await fetch(`${c}/git/diff?path=${encodeURIComponent(t)}&file=${encodeURIComponent(e)}`);if(!r.ok){let t=Error((await r.json().catch(()=>({}))).error||"Failed to fetch diff");throw t.status=r.status,t}return r.json()},enabled:!!t&&!!e,retry:(t,e)=>404!==e.status&&400!==e.status&&t<3})}function x(t,e){let r=e.commitHash??null,n=e.fromCommitHash??null,s=e.toCommitHash??null,o=!!n&&!!s,i=!!r;return(0,a.I)({queryKey:["git",t,"commit-diff",r,n,s],queryFn:async()=>{if(!t||!i&&!o)return null;let e=new URLSearchParams({path:t});i?e.set("commit",r):o&&(e.set("from",n),e.set("to",s));let a=await fetch(`${c}/git/diff?${e.toString()}`);if(!a.ok){let t=Error((await a.json().catch(()=>({}))).error||"Failed to fetch commit diff");throw t.status=a.status,t}return a.json()},enabled:!!t&&(i||o),retry:(t,e)=>404!==e.status&&400!==e.status&&t<3})}function v(t,e,r){let n=r.commitHash??null,s=r.fromCommitHash??null,o=r.toCommitHash??null,i=!!s&&!!o,l=!!n;return(0,a.I)({queryKey:["git",t,"commit-file-diff",e,n,s,o],queryFn:async()=>{if(!t||!e||!l&&!i)return null;let r=new URLSearchParams({path:t,file:e});l?r.set("commit",n):i&&(r.set("from",s),r.set("to",o));let a=await fetch(`${c}/git/diff?${r.toString()}`);if(!a.ok){let t=Error((await a.json().catch(()=>({}))).error||"Failed to fetch file diff");throw t.status=a.status,t}return a.json()},enabled:!!t&&!!e&&(l||i),retry:(t,e)=>404!==e.status&&400!==e.status&&t<3})}function C(t){return(0,a.I)({queryKey:["git",t,"stashes"],queryFn:async()=>{if(!t)return[];let e=await fetch(`${c}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:t,action:"stash-list"})});if(!e.ok)throw Error("Failed to fetch stashes");return(await e.json()).stashes||[]},enabled:!!t})}function F(t,e){return(0,a.I)({queryKey:["git",t,"stash-files",e],queryFn:async()=>{if(!t||null===e)return[];let r=await fetch(`${c}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:t,action:"stash-files",data:{index:e}})});if(!r.ok)throw Error("Failed to fetch stash files");return(await r.json()).files||[]},enabled:!!t&&null!==e})}function T(t,e,r){return(0,a.I)({queryKey:["git",t,"stash-file-diff",e,r],queryFn:async()=>{if(!t||null===e||!r)return{left:"",right:"",diff:""};let n=await fetch(`${c}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:t,action:"stash-file-diff",data:{index:e,file:r}})});if(!n.ok)throw Error("Failed to fetch stash file diff");return n.json()},enabled:!!t&&null!==e&&!!r})}let E={commit:"Commit",push:"Push",pull:"Pull",fetch:"Fetch",stage:"Stage",unstage:"Unstage",checkout:"Checkout","checkout-to-local":"Checkout",branch:"Create Branch","create-tag":"Create Tag","delete-branch":"Delete Branch","delete-worktree":"Delete Worktree","delete-remote-branch":"Delete Remote Branch","delete-remote":"Delete Remote","delete-tag":"Delete Tag","delete-remote-tag":"Delete Remote Tag","rename-branch":"Rename Branch","rename-remote-branch":"Rename Remote Branch","rename-remote":"Rename Remote","add-remote":"Add Remote",reset:"Reset",revert:"Revert Commit","cherry-pick":"Cherry Pick","cherry-pick-multiple":"Cherry Pick","cherry-pick-abort":"Cherry Pick",rebase:"Rebase",merge:"Merge","check-merge-conflicts":"Check Merge Conflicts","check-rebase-conflicts":"Check Rebase Conflicts","get-conflict-state":"Get Conflict State","get-conflict-file-versions":"Get Conflict File Versions","resolve-conflict-file":"Resolve Conflict File","continue-merge":"Continue Merge","abort-merge":"Abort Merge","continue-rebase":"Continue Rebase","abort-rebase":"Abort Rebase","get-remotes":"Get Remotes","get-remote-branches":"Get Remote Branches","get-tracking-branch":"Get Tracking Branch","get-latest-commit-message":"Get Latest Commit Message","push-to-remote":"Push","pull-from-remote":"Pull",stash:"Stash","stash-apply":"Apply Stash","stash-drop":"Drop Stash","stash-pop":"Pop Stash",reword:"Reword Commit",discard:"Discard Changes","cleanup-lock-file":"Cleanup Lock File"},q=["check-merge-conflicts","check-rebase-conflicts","get-conflict-state","get-conflict-file-versions","get-remotes","get-remote-branches","get-tracking-branch","get-latest-commit-message"];async function O(t){let e=await fetch(`${c}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:t,action:"cleanup-lock-file"})});if(!e.ok)throw Error("Failed to cleanup lock file");return e.json()}function I(){let t=(0,s.jE)();return(0,o.n)({mutationFn:async({repoPath:t,action:e,data:r})=>{let n=await fetch(`${c}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:t,action:e,data:r})});if(!n.ok)throw Error((await n.json()).error||"Failed to execute action");return n.json()},onSuccess:(e,r)=>{q.includes(r.action)||t.invalidateQueries({queryKey:["git",r.repoPath]})},onError:(e,r)=>{if(!q.includes(r.action)&&!r.suppressErrorToast){let n=E[r.action]||r.action;e.message.includes("Unable to create")&&e.message.includes(".git/index.lock")?(0,i.tk)(e,{operation:n,fixLabel:"Remove Lock File",onFix:async()=>{await O(r.repoPath),t.invalidateQueries({queryKey:["git",r.repoPath]})}}):(0,i.tk)(e,{operation:n})}}})}},6695:(t,e,r)=>{r.d(e,{dj:()=>d,oR:()=>p,tk:()=>m});var n=r(2115);let a=5e3;async function s(t){try{return await navigator.clipboard.writeText(t),!0}catch{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",e.style.left="-9999px",document.body.appendChild(e),e.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(e)}}}let o=0;function i(){return(o=(o+1)%Number.MAX_SAFE_INTEGER).toString()}let c=new Map,l=(t,e=a)=>{if(c.has(t))return;let r=setTimeout(()=>{c.delete(t),h({type:"REMOVE_TOAST",toastId:t})},e);c.set(t,r)},u=[],f={toasts:[]};function h(t){f=((t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,5)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(t=>t.id===e.toast.id?{...t,...e.toast}:t)};case"DISMISS_TOAST":{let{toastId:r}=e;return r?l(r,0):t.toasts.forEach(t=>{l(t.id,0)}),{...t,toasts:t.toasts.filter(t=>t.id!==r&&void 0!==r)}}case"REMOVE_TOAST":if(void 0===e.toastId)return{...t,toasts:[]};return{...t,toasts:t.toasts.filter(t=>t.id!==e.toastId)}}})(f,t),u.forEach(t=>{t(f)})}function p(t){let e=i();return h({type:"ADD_TOAST",toast:{...t,id:e}}),l(e,t.duration||a),{id:e,dismiss:()=>h({type:"DISMISS_TOAST",toastId:e}),update:t=>h({type:"UPDATE_TOAST",toast:{...t,id:e}})}}function d(){let[t,e]=n.useState(f);return n.useEffect(()=>(u.push(e),()=>{let t=u.indexOf(e);t>-1&&u.splice(t,1)}),[t]),{...t,toast:p,dismiss:t=>h({type:"DISMISS_TOAST",toastId:t})}}function m(t,e={}){let r="string"==typeof t?t:t.message,a=e.title||(e.operation?`${e.operation} Failed`:"Git Operation Failed"),o=i();return p({type:"error",title:a,description:n.createElement(()=>{let[t,a]=n.useState(!1),[i,c]=n.useState(!1),l=async t=>{t.stopPropagation(),await s(r)&&(a(!0),setTimeout(()=>a(!1),2e3))},u=async t=>{if(t.stopPropagation(),e.onFix){c(!0);try{await e.onFix(),h({type:"DISMISS_TOAST",toastId:o})}catch(t){console.error("Fix failed",t),c(!1)}}};return n.createElement("div",{className:"mt-2 space-y-3"},n.createElement("div",{className:"max-h-[120px] overflow-y-auto whitespace-pre-wrap font-mono text-[11px] leading-relaxed bg-black/20 p-3 rounded-md break-all text-error-content/90 border border-error-content/20"},r),n.createElement("div",{className:"flex gap-2"},n.createElement("button",{onClick:l,type:"button",className:`btn btn-xs ${t?"btn-success text-white":"bg-white/20 hover:bg-white/30 text-white border-white/20"}`},t?"Copied!":"Copy Error"),e.onFix?n.createElement("button",{onClick:u,type:"button",disabled:i,className:"btn btn-xs btn-warning text-white"},i?"Fixing...":e.fixLabel||"Fix Issue"):null))}),duration:1e4}),{id:o,dismiss:()=>h({type:"DISMISS_TOAST",toastId:o})}}},8599:(t,e,r)=>{r.d(e,{L9:()=>y,cn:()=>s,iu:()=>i,kO:()=>p,kj:()=>o,tq:()=>m,u:()=>d});var n=r(9722),a=r(622);function s(...t){return(0,a.QP)((0,n.$)(t))}function o(t){let e=t.replace(/[\\/]+$/,"").split(/[/\\]/).filter(Boolean);return e[e.length-1]||t}function i(t){let e=t.displayName?.trim();return e||(t.name?.trim()?t.name:o(t.path))}function c(t){if(!t)return"";let e=t.split("/").pop()||"",r=e.lastIndexOf(".");return -1===r||0===r?e.toLowerCase():e.slice(r+1).toLowerCase()}let l=new Set(["js","jsx","ts","tsx","mjs","cjs","mts","cts","py","pyw","pyi","pyx","rb","rake","gemspec","java","kt","kts","scala","sc","groovy","gradle","c","h","cpp","cc","cxx","hpp","hh","hxx","c++","h++","cs","fs","fsx","fsi","go","rs","swift","dart","zig","nim","v","odin","php","phtml","php3","php4","php5","php7","phps","pl","pm","pod","t","psgi","lua","tcl","r","R","jl","ex","exs","erl","hrl","clj","cljs","cljc","edn","lisp","lsp","el","scm","ss","rkt","hs","lhs","elm","purs","ml","mli","f90","f95","f03","f08","for","asm","s","S","vhd","vhdl","v","sv","svh","bas","vb","vbs","vba","pas","pp","inc","dpr","dpk","sh","bash","zsh","fish","ksh","csh","tcsh","ps1","psm1","psd1","bat","cmd","html","htm","xhtml","shtml","css","scss","sass","less","styl","stylus","pcss","postcss","svg","xml","xsl","xslt","xsd","dtd","rss","atom","rdf","wsdl","soap","vue","svelte","astro","mdx","hbs","handlebars","mustache","ejs","pug","jade","haml","slim","erb","graphql","gql","json","json5","jsonc","jsonl","ndjson","geojson","yaml","yml","toml","ini","cfg","conf","config","properties","env","csv","tsv","psv","txt","text","log","out","md","markdown","mdown","mkd","mkdn","mdwn","rst","rest","adoc","asciidoc","asc","org","tex","latex","ltx","bib","sty","cls","rtf","diff","patch","gitignore","gitattributes","gitmodules","gitconfig","dockerignore","dockerfile","containerfile","editorconfig","prettierrc","eslintrc","babelrc","stylelintrc","browserslistrc","npmrc","nvmrc","yarnrc","pnpmfile","makefile","mk","cmake","make","mak","rake","podfile","gemfile","fastfile","sql","plsql","pgsql","mysql","sqlite","hql","cql","proto","protobuf","thrift","avro","capnp","fbs","flatc","tf","tfvars","hcl","nomad","sentinel","prisma","graphqls","lock"]),u=new Set(["jpg","jpeg","png","gif","bmp","ico","icns","tiff","tif","webp","avif","heic","heif","psd","ai","eps","raw","cr2","nef","orf","sr2","dng","mp4","avi","mov","wmv","flv","mkv","webm","m4v","mpeg","mpg","3gp","3g2","ogv","mp3","wav","ogg","oga","flac","aac","m4a","wma","aiff","aif","mid","midi","opus","zip","rar","7z","tar","gz","bz2","xz","lz","lzma","lz4","zst","cab","iso","dmg","exe","dll","so","dylib","a","lib","obj","o","app","msi","deb","rpm","apk","ipa","pkg","snap","flatpak","appimage","class","jar","war","ear","pyc","pyo","pyd","beam","wasm","wat","pdf","doc","docx","xls","xlsx","ppt","pptx","odt","ods","odp","pages","numbers","key","ttf","otf","woff","woff2","eot","fon","fnt","db","sqlite","sqlite3","mdb","accdb","frm","myd","myi","ibd","bin","dat","data","sav","bak","swf","fla","blend","fbx","obj","stl","gltf","glb","3ds","dae","ply","sketch","fig","xd","unity","unitypackage","asset","prefab","meta"]),f=new Set(["png","jpg","jpeg","gif","bmp","ico","icns","tiff","tif","webp","avif","heic","heif","svg"]);function h(t){if(!t)return!1;if(t.includes("\0"))return!0;let e=t.slice(0,8192),r=0;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);n<32&&9!==n&&10!==n&&13!==n&&r++}return e.length>0&&r/e.length>.1}function p(t,e,r){let n=function(t){if(!t)return"unknown";let e=c(t);return l.has(e)?"text":u.has(e)?"binary":"unknown"}(t);return"binary"===n||"text"!==n&&(h(e||"")||h(r||""))}function d(t){return f.has(c(t))}function m(t){return t?t.split("\n").reduce((t,e)=>e.startsWith("+++ ")||e.startsWith("--- ")?t:e.startsWith("+")||e.startsWith("-")?t+1:t,0):0}function y(t){return t.replace(/[\s~^:?*\[\]\\@{}<>|"'`!#$%&()+=;,]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-")}}}]);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[446],{302:(e,t,a)=>{a.d(t,{v:()=>o});var s=a(2115);let l=[],n=0,r=!1;function i(e){if("Escape"!==e.key)return;let t=l[l.length-1];t&&(e.preventDefault(),t.onEscape())}function o(e,t){let a=(0,s.useRef)(t);(0,s.useEffect)(()=>{a.current=t},[t]),(0,s.useEffect)(()=>{if(!e)return;let t=++n;return l.push({id:t,onEscape:()=>a.current()}),!r&&"u">typeof document&&(document.addEventListener("keydown",i),r=!0),()=>{let e=l.findIndex(e=>e.id===t);e>=0&&l.splice(e,1),r&&"u">typeof document&&!(l.length>0)&&(document.removeEventListener("keydown",i),r=!1)}},[e])}},9446:(e,t,a)=>{a.d(t,{u:()=>D});var s=a(5155),l=a(696),n=a(5625),r=a(2115);function i(e){let t=0x811c9dc5;for(let a=0;a<e.length;a++)t^=e.charCodeAt(a),t=Math.imul(t,0x1000193);return t>>>0}var o=a(8599);function c({children:e,items:t,containerClassName:a="w-full"}){let[l,n]=(0,r.useState)(!1),[i,c]=(0,r.useState)({x:0,y:0}),d=(0,r.useRef)(null),h=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!l)return;let e=e=>{d.current&&!d.current.contains(e.target)&&h.current&&!h.current.contains(e.target)&&n(!1)},t=e=>{"Escape"===e.key&&n(!1)};return setTimeout(()=>{document.addEventListener("click",e),document.addEventListener("contextmenu",e),document.addEventListener("keydown",t)},0),()=>{document.removeEventListener("click",e),document.removeEventListener("contextmenu",e),document.removeEventListener("keydown",t)}},[l]),(0,r.useEffect)(()=>{if(!l||!d.current)return;let e=d.current;requestAnimationFrame(()=>{let a=document.createElement("div");a.style.position="absolute",a.style.visibility="hidden",a.style.whiteSpace="nowrap",a.style.pointerEvents="none";let s=window.getComputedStyle(e);a.style.fontSize=s.fontSize,a.style.fontFamily=s.fontFamily,a.style.fontWeight=s.fontWeight,a.style.padding="0.5rem 0.75rem",a.style.boxSizing="border-box",document.body.appendChild(a);let l=0;t.forEach(e=>{a.textContent=e.label;let t=a.getBoundingClientRect().width;t>l&&(l=t)}),document.body.removeChild(a);let n=Math.max(l+32,280);e.style.width=`${n}px`,e.style.minWidth=`${n}px`;let r=e.getBoundingClientRect(),o=window.innerWidth,c=window.innerHeight,d=i.x,h=i.y;r.right>o&&(d=o-r.width-10),d<10&&(d=10),r.bottom>c&&(h=c-r.height-10),h<10&&(h=10),(d!==i.x||h!==i.y)&&(e.style.left=`${d}px`,e.style.top=`${h}px`)})},[l,i,t]);let m=(e,t)=>{let a=!!e.children?.length;return(0,s.jsxs)("li",{className:(0,o.cn)(a&&"relative group/submenu"),children:[(0,s.jsxs)("a",{onClick:t=>{t.stopPropagation(),e.disabled||a||(e.onClick?.(),n(!1))},className:(0,o.cn)("whitespace-nowrap",e.danger&&"text-error",e.disabled&&"opacity-40 pointer-events-none",a&&"flex items-center justify-between gap-3"),children:[(0,s.jsx)("span",{children:e.labelNode??e.label}),a&&(0,s.jsx)("i",{className:"iconoir-nav-arrow-right text-[12px]","aria-hidden":"true"})]}),a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"hidden group-hover/submenu:block absolute left-full top-0 h-full w-3"}),(0,s.jsx)("ul",{className:"hidden group-hover/submenu:block absolute left-[calc(100%-1px)] top-0 menu !m-0 p-2 shadow-lg bg-base-100 rounded-box border border-base-200 min-w-[220px] z-[10000] [&:before]:hidden",children:e.children.map((e,a)=>m(e,`${t}-${a}`))})]})]},t)};return(0,s.jsxs)("div",{ref:h,className:a,onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),c({x:e.clientX,y:e.clientY}),n(!0)},children:[e,l&&(0,s.jsx)("ul",{ref:d,className:"fixed z-[9999] menu p-2 shadow-lg bg-base-100 rounded-box border border-base-200",style:{left:`${i.x}px`,top:`${i.y}px`},children:t.map((e,t)=>m(e,`menu-${t}`))})]})}function d({text:e,searchQuery:t}){if(!t||!e)return(0,s.jsx)(s.Fragment,{children:e});let a=t.toLowerCase(),l=e.toLowerCase(),n=[],r=0,i=l.indexOf(a);for(;-1!==i;)i>r&&n.push({text:e.slice(r,i),highlighted:!1}),n.push({text:e.slice(i,i+a.length),highlighted:!0}),r=i+a.length,i=l.indexOf(a,r);return(r<e.length&&n.push({text:e.slice(r),highlighted:!1}),0===n.length)?(0,s.jsx)(s.Fragment,{children:e}):(0,s.jsx)(s.Fragment,{children:n.map((e,t)=>e.highlighted?(0,s.jsx)("mark",{className:"bg-warning text-warning-content rounded-sm px-0.5",children:e.text},t):(0,s.jsx)("span",{children:e.text},t))})}let h=(0,r.forwardRef)(function({commits:e,onSelectCommit:t,onResetToCommit:a,onRevertCommit:l,onCreateTag:n,onCherryPickCommit:h,onCherryPickSelectedCommits:m,onRewordCommit:u,selectedHash:x,selectedHashes:p,onEndReached:b,isLoadingMore:f,currentBranch:g,hiddenBranches:j,localBranches:N=[],trackingInfo:y,getBranchTagContextMenuItems:k},v){let w=(0,r.useCallback)(e=>e.startsWith("refs/heads/")?e.slice(11):e.startsWith("refs/remotes/")?e.slice(13):e.startsWith("remotes/")?e.slice(8):e,[]),C=(0,r.useCallback)(e=>e.startsWith("tag:")?e.replace(/^tag:\s*/,"").trim():e,[]),S=(0,r.useMemo)(()=>(function(e,t={}){let a=[],s=new Set(t.localBranches??[]),l=[],n=[],r=[];function o(){for(let e=0;e<l.length;e++)if(null===l[e])return e;return l.length}function c(e){let t,a=r[e],s=a?(t=i(a),`hsl(${t%360} 82% 52%)`):n[e]??`hsl(${47*e%360} 78% 56%)`;return n[e]=s,s}return e.forEach((e,t)=>{var i;let d=l.indexOf(e.hash);for(-1===d&&(d=o());l.length<=d;)l.push(null),r.push(null),n.push(void 0);let h=function(e,t){if(0===e.length)return null;let a=e.find(e=>t.has(e));return a||e[0]}((i=e.refs)?i.replace(/^\s*\((.*)\)\s*$/,"$1").split(",").map(e=>e.trim()).filter(Boolean).map(e=>e.replace(/^HEAD\s*->\s*/,"").trim()).map(e=>e.startsWith("refs/heads/")?e.slice(11):e.startsWith("refs/remotes/")?e.slice(13):e.startsWith("remotes/")?e.slice(8):e).filter(e=>!e.startsWith("tag:")).filter(e=>"HEAD"!==e).filter(e=>!/\/HEAD$/.test(e)):[],s);if(h){let e=function(e,t){let a,s;if(t.has(e))return e;let l=-1===(s=(a=e.startsWith("remotes/")?e.slice(8):e).indexOf("/"))?null:a.slice(s+1);return l&&t.has(l)?l:e}(h,s);(function(e,t,a){return!t||a.has(e)&&!a.has(t)})(e,r[d],s)&&(r[d]=e)}let m=c(d),u={...e,x:d,y:t,color:m,paths:[],isMerge:e.parents.length>1};for(let e=0;e<l.length;e++)e!==d&&null!==l[e]&&u.paths.push({x1:e,y1:t,x2:e,y2:t+1,color:c(e),type:"straight"});l[d]=null;let x=e.parents;if(x.length>0){let e=x[0],a=l.indexOf(e);-1!==a?u.paths.push({x1:d,y1:t,x2:a,y2:t+1,color:m,type:"merge"}):(l[d]=e,u.paths.push({x1:d,y1:t,x2:d,y2:t+1,color:m,type:"straight"}));for(let e=1;e<x.length;e++){let a=x[e],s=l.indexOf(a);if(-1!==s)u.paths.push({x1:d,y1:t,x2:s,y2:t+1,color:c(s),type:"fork"});else{let e=o();for(;l.length<=e;)l.push(null),r.push(null),n.push(void 0);l[e]=a,u.paths.push({x1:d,y1:t,x2:e,y2:t+1,color:c(e),type:"fork"})}}}null===l[d]&&(r[d]=null,n[d]=void 0),a.push(u)}),a})(e,{localBranches:N}),[e,N]),R=(0,r.useRef)(null),E=(0,r.useRef)(null),[$,B]=(0,r.useState)(!1),[M,F]=(0,r.useState)("");(0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"f"===e.key&&(e.preventDefault(),B(!0),setTimeout(()=>E.current?.focus(),0)),"Escape"===e.key&&$&&(B(!1),F(""))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[$]);let P=(0,r.useCallback)(()=>{B(!1),F("")},[]);if((0,r.useImperativeHandle)(v,()=>({scrollToCommit:e=>{if(!S||0===S.length)return!1;let t=S.findIndex(t=>t.hash===e);if(-1===t)return!1;if(R.current){let e=24*t-R.current.clientHeight/2+12;R.current.scrollTop=Math.max(0,e)}return!0}}),[S]),!S||0===S.length)return null;let T=(Math.max(...S.map(e=>e.x),0)+1)*12+20,D=24*S.length;return(0,s.jsxs)("div",{className:"flex flex-col h-full bg-base-100 overflow-hidden font-mono text-sm select-none",children:[$&&(0,s.jsxs)("div",{className:"sticky top-0 z-30 bg-base-100 border-b border-base-300 px-2 py-2 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"opacity-50",children:"\uD83D\uDD0D"}),(0,s.jsx)("input",{ref:E,type:"text",placeholder:"Search in commits...",value:M,onChange:e=>F(e.target.value),className:"input input-bordered input-sm flex-1 text-sm",autoFocus:!0}),(0,s.jsx)("div",{className:"tooltip tooltip-left z-50","data-tip":"Close search (Esc)",children:(0,s.jsx)("button",{onClick:P,className:"btn btn-ghost btn-sm btn-square",children:"✖️"})})]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto h-full max-w-full px-2",onScroll:e=>{let{scrollTop:t,clientHeight:a,scrollHeight:s}=e.currentTarget;s-t-a<100&&b?.()},ref:R,children:(0,s.jsxs)("div",{className:"relative min-w-full",style:{height:D},children:[(0,s.jsxs)("svg",{width:T,height:D,className:"absolute top-0 left-0 pointer-events-none z-10",children:[S.map(e=>(0,s.jsx)("g",{children:e.paths.map((e,t)=>{let a=12*e.x1+6,l=24*e.y1+12,n=12*e.x2+6,r=24*e.y2+12,i="";if("straight"===e.type)i=`M ${a} ${l} L ${n} ${r}`;else{let e=l+12,t=r-12;i=`M ${a} ${l} C ${a} ${e}, ${n} ${t}, ${n} ${r}`}return(0,s.jsx)("path",{d:i,stroke:e.color,strokeWidth:2,fill:"none",strokeLinecap:"round"},t)})},e.hash)),S.map(e=>(0,s.jsx)("circle",{cx:12*e.x+6,cy:24*e.y+12,r:3,fill:e.color,stroke:e.color,strokeWidth:2},`dot-${e.hash}`))]}),(0,s.jsxs)("div",{style:{width:"100%"},children:[S.map(e=>{let r=p?p.has(e.hash):x===e.hash,b=p?.size??+!!x,f=[{label:"Reset to here",onClick:()=>a?.(e.hash)}];if(l&&f.push({label:"Revert commit",onClick:()=>l(e.hash,e.message)}),n&&f.push({label:"Create tag",onClick:()=>n(e.hash)}),h&&f.push({label:"Cherry-pick commit",onClick:()=>h(e.hash,e.message)}),m&&b>1&&r&&f.push({label:`Cherry-pick ${b} selected commits`,onClick:m}),u&&N&&N.length>0){let t=e.refs?e.refs.replace(/[()]/g,"").split(",").map(e=>e.trim()):[],a=null;for(let e of t){let t=e.replace(/^HEAD\s*->\s*/,"");if(N.includes(t)&&(a=t,g&&t===g))break}a&&f.push({label:"Reword commit",onClick:()=>u(e.hash,e.message,e.body??"",a)})}let v=(()=>{if(!e.refs)return[];let t=e.refs.replace(/^\s*\((.*)\)\s*$/,"$1").split(",").map(e=>{let t=e.startsWith("HEAD -> "),a=w(e.replace(/^HEAD\s*->\s*/,"").trim());return{raw:e,name:a,isHead:t}}),a=[],s=new Set,l=e=>j&&(j.has(e)||j.has(`remotes/${e}`));return t.forEach((e,n)=>{if(!s.has(n)&&N.includes(e.name)&&!l(e.name)){let l=y?.[e.name];if(l&&l.upstream){let r=w(l.upstream.trim()),i=new Set([r,w(`remotes/${r}`),w(`refs/remotes/${r}`)]),o=t.findIndex((e,t)=>t!==n&&!s.has(t)&&i.has(e.name));if(-1!==o){let l=t[o],i=r.split("/")[0];a.push({displayName:`${e.name} (${i})`,primaryRef:e.name,secondaryRef:l.name,isHead:e.isHead}),s.add(n),s.add(o);return}}}}),t.forEach((e,t)=>{!s.has(t)&&(l(e.name)||a.push({displayName:C(e.name),primaryRef:e.name,isHead:e.isHead}))}),a})();return(0,s.jsx)(c,{items:f,children:(0,s.jsxs)("div",{className:(0,o.cn)("flex items-center hover:bg-base-200 border-b border-base-200 last:border-0 cursor-pointer transition-colors text-xs",r&&"bg-primary/10"),style:{height:24},onClick:a=>t?.(e.hash,{isMultiSelect:a.metaKey||a.ctrlKey,isRangeSelect:a.shiftKey}),children:[(0,s.jsx)("div",{style:{width:T,flexShrink:0}}),(0,s.jsxs)("div",{className:"flex flex-1 gap-4 overflow-hidden pr-4 items-center",children:[(0,s.jsxs)("div",{className:"flex-1 truncate flex items-center gap-2",children:[v.map((e,t)=>{let a=g&&(e.primaryRef===g||e.isHead&&e.primaryRef===g),l=e.primaryRef.startsWith("tag:")?{textColor:"#374151",backgroundColor:"#e5e7eb"}:function(e){let t,a,s,l,n,r,o,c,d,h=i(e),m=h%360,u=72+(h>>>9)%20,x=84+(h>>>17)%8,p=1.05/((d=function({r:e,g:t,b:a}){let s=e=>{let t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)};return .2126*s(e)+.7152*s(t)+.0722*s(a)}((a=u/100*(1-Math.abs(2*(t=x/100)-1)),l=a*(1-Math.abs((s=m/60)%2-1)),n=0,r=0,o=0,s>=0&&s<1?(n=a,r=l):s>=1&&s<2?(n=l,r=a):s>=2&&s<3?(r=a,o=l):s>=3&&s<4?(r=l,o=a):s>=4&&s<5?(n=l,o=a):(n=a,o=l),{r:Math.round((n+(c=t-a/2))*255),g:Math.round((r+c)*255),b:Math.round((o+c)*255)})))+.05)>=(d+.05)/.05?"#ffffff":"#111827";return{backgroundColor:`hsl(${m} ${u}% ${x}%)`,textColor:p}}(e.primaryRef),n=(0,s.jsx)("span",{className:(0,o.cn)("text-[10px] px-1.5 rounded-full whitespace-nowrap shrink-0",a&&"font-bold"),style:{color:l.textColor,backgroundColor:l.backgroundColor},title:e.displayName,children:(0,s.jsx)(d,{text:e.displayName,searchQuery:M})}),r=k?.(e.primaryRef)||[];return 0===r.length?(0,s.jsx)("span",{className:"shrink-0",children:n},t):(0,s.jsx)(c,{items:r,containerClassName:"inline-flex shrink-0",children:n},t)}),(0,s.jsx)("span",{className:(0,o.cn)("truncate min-w-0 max-w-[600px]",r?"font-semibold":""),title:e.message,children:(0,s.jsx)(d,{text:e.message,searchQuery:M})})]}),(0,s.jsx)("div",{className:"w-32 truncate opacity-70 text-right",children:(0,s.jsx)(d,{text:e.author_name,searchQuery:M})}),(0,s.jsx)("div",{className:"w-20 truncate opacity-50 font-mono text-right",children:(0,s.jsx)(d,{text:e.hash.substring(0,7),searchQuery:M})}),(0,s.jsx)("div",{className:"w-32 truncate opacity-70 text-right",children:new Date(e.date).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})]})]})},e.hash)}),f&&(0,s.jsxs)("div",{className:"flex items-center justify-center py-8 border-b border-base-300",children:[(0,s.jsx)("span",{className:"loading loading-spinner text-base-content/50"}),(0,s.jsx)("span",{className:"ml-2 text-sm opacity-70",children:"Loading more commits..."})]})]})]})})]})});var m=a(302),u=a(6695),x=a(460),p=a(6162),b=a(4254);function f({status:e}){switch(e){case"A":return(0,s.jsx)("i",{className:"iconoir-plus-circle text-[16px] text-success","aria-hidden":"true"});case"D":return(0,s.jsx)("i",{className:"iconoir-minus-circle text-[16px] text-error","aria-hidden":"true"});case"M":return(0,s.jsx)("i",{className:"iconoir-edit-pencil text-[16px] text-warning","aria-hidden":"true"});default:return(0,s.jsx)("i",{className:"iconoir-page text-[16px] opacity-50","aria-hidden":"true"})}}function g({node:e,selectedFile:t,expandedFolders:a,onToggleFolder:l,onSelectFile:n,depth:r=0}){let i=Array.from(e.children.values()).sort((e,t)=>{let a=e.children.size>0,s=t.children.size>0;return a&&!s?-1:!a&&s?1:e.name.localeCompare(t.name)});return(0,s.jsx)(s.Fragment,{children:i.map(e=>{if(e.children.size>0){let i=a.has(e.path);return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 text-xs rounded cursor-pointer hover:bg-base-200 transition-colors opacity-80",style:{paddingLeft:`${12*r+8}px`},onClick:()=>l(e.path),title:e.path,children:[(0,s.jsx)("span",{className:"text-[10px] opacity-70",children:i?"▼":"▶"}),(0,s.jsx)("i",{className:"iconoir-folder text-[14px] opacity-70","aria-hidden":"true"}),(0,s.jsx)("span",{className:"truncate flex-1",children:e.name})]}),i&&(0,s.jsx)(g,{node:e,selectedFile:t,expandedFolders:a,onToggleFolder:l,onSelectFile:n,depth:r+1})]},e.path)}if(!e.file)return null;let i=e.file;return(0,s.jsxs)("div",{className:(0,o.cn)("flex items-center gap-2 px-2 py-1.5 text-xs rounded cursor-pointer hover:bg-base-200 transition-colors",t===i.path&&"bg-base-200 font-medium"),style:{paddingLeft:`${12*r+8}px`},onClick:()=>n(i.path),title:i.path,children:[(0,s.jsx)(f,{status:i.status}),(0,s.jsx)("span",{className:"truncate flex-1 font-mono",children:e.name})]},e.path)})})}function j({repoPath:e,commitHash:t,fromCommitHash:a,toCommitHash:n,filePath:i,splitView:c}){let{data:d,isLoading:h}=(0,l.st)(e,i,{commitHash:t,fromCommitHash:a,toCommitHash:n}),{resolvedTheme:m}=(0,x.D)(),[u,f]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{f(!1)},[i,t,a,n]),h)return(0,s.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,s.jsx)("span",{className:"loading loading-spinner text-base-content/50"})});if(!d)return(0,s.jsx)("div",{className:"flex items-center justify-center p-8 opacity-50",children:"No diff available"});if((0,o.u)(i))return(0,s.jsx)(b.K,{filePath:i,imageDiff:d.imageDiff});if((0,o.kO)(i,d.left,d.right))return(0,s.jsx)("div",{className:"flex items-center justify-center p-8 opacity-50",children:"Binary file - diff not available"});let g=d.diff||"",j=g.length,N=(0,o.tq)(g);return(j>102400||N>3e3)&&!u?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-4 text-center p-8",children:[(0,s.jsx)("i",{className:"iconoir-warning-triangle text-[32px] text-warning","aria-hidden":"true"}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Large Diff Detected"}),(0,s.jsxs)("p",{className:"opacity-70",children:["This diff is large (",Math.round(j/1024),"KB, ~",N," changed lines) and may freeze your browser if rendered."]})]}),(0,s.jsx)("button",{className:"btn btn-outline",onClick:()=>f(!0),children:"Show Diff Anyway"})]}):(0,s.jsx)("div",{className:"overflow-auto h-full",children:(0,s.jsx)(p.O,{oldValue:d.left||"",newValue:d.right||"",splitView:c,useDarkTheme:"dark"===m})})}function N({repoPath:e,commitHash:t=null,fromCommitHash:a=null,toCommitHash:n=null}){let i=!!a&&!!n,c=i?`${a}..${n}`:t??"none",{data:d,isLoading:h}=(0,l.gg)(e,{commitHash:t,fromCommitHash:a,toCommitHash:n}),[u,x]=(0,r.useState)(null),[p,b]=(0,r.useState)(!1),[f,N]=(0,r.useState)({}),y=(0,r.useMemo)(()=>(function(e){let t={name:"",path:"",children:new Map};for(let a of e){let e=a.path.split("/").filter(Boolean),s=t,l="";for(let t=0;t<e.length;t++){let n=e[t];l=l?`${l}/${n}`:n,s.children.has(n)||s.children.set(n,{name:n,path:l,children:new Map}),s=s.children.get(n),t===e.length-1&&(s.file=a)}}return t})(d?.files??[]),[d?.files]),k=(0,r.useMemo)(()=>(function e(t){let a=[];return Array.from(t.children.values()).forEach(t=>{t.children.size>0&&(a.push(t.path),a.push(...e(t)))}),a})(y),[y]),v=(0,r.useMemo)(()=>f[c]??new Set,[f,c]),w="git-web:diff-view-split",[C,S]=(0,r.useState)(()=>{try{let e=localStorage.getItem(w);return null===e||JSON.parse(e)}catch(e){return console.error("Failed to load split view preference:",e),!0}});(0,r.useEffect)(()=>{try{localStorage.setItem(w,JSON.stringify(C))}catch(e){console.error("Failed to save split view preference:",e)}},[C]),(0,r.useEffect)(()=>{x(null)},[c]),(0,r.useEffect)(()=>{!u&&d?.files&&d.files.length>0&&x(d.files[0].path)},[d?.files,u]),(0,m.v)(p,()=>b(!1)),(0,r.useEffect)(()=>{if(!p)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[p]);let R=(0,r.useMemo)(()=>{let e=new Set;return k.forEach(t=>{v.has(t)||e.add(t)}),u&&(function(e){let t=e.split("/").filter(Boolean),a=[];for(let e=1;e<t.length;e++)a.push(t.slice(0,e).join("/"));return a})(u).forEach(t=>e.add(t)),e},[k,v,u]),E=(0,r.useCallback)(e=>{N(t=>{let a=new Set(t[c]??new Set);return a.has(e)?a.delete(e):a.add(e),{...t,[c]:a}})},[c]);return h?(0,s.jsx)("div",{className:"flex items-center justify-center p-8 h-full",children:(0,s.jsx)("span",{className:"loading loading-spinner text-base-content/50"})}):d&&0!==d.files.length?(0,s.jsxs)("div",{className:(0,o.cn)("flex h-full",p&&"fixed inset-0 z-[80] h-auto bg-base-100 shadow-2xl"),children:[(0,s.jsxs)("div",{className:"w-64 border-r border-base-300 flex flex-col bg-base-200/30 shrink-0",children:[(0,s.jsxs)("div",{className:"px-3 py-2 text-xs font-bold opacity-70 border-b border-base-300 bg-base-100",children:[d.files.length," file",1!==d.files.length?"s":""," changed"]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:(0,s.jsx)("div",{className:"p-1",children:(0,s.jsx)(g,{node:y,selectedFile:u,expandedFolders:R,onToggleFolder:E,onSelectFile:x})})})]}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden",children:u?(0,s.jsxs)("div",{className:"h-full flex flex-col",children:[(0,s.jsxs)("div",{className:"px-4 py-2 text-xs font-mono opacity-70 border-b border-base-300 bg-base-100 shrink-0 truncate flex items-center justify-between",children:[(0,s.jsx)("span",{className:"truncate",children:u}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0 ml-4",children:[(0,s.jsx)("label",{htmlFor:"commit-diff-split-view",className:"text-[10px] uppercase tracking-wider font-bold cursor-pointer opacity-70",children:"Split View"}),(0,s.jsx)("input",{type:"checkbox",id:"commit-diff-split-view",checked:C,onChange:e=>S(e.target.checked),className:"toggle toggle-xs toggle-primary"}),(0,s.jsx)("button",{type:"button",className:"btn btn-ghost btn-xs btn-square",onClick:()=>b(e=>!e),"aria-label":p?"Exit full-page diff view":"Expand diff viewer to full page",title:p?"Exit full-page diff view":"Expand diff viewer to full page",children:(0,s.jsx)("i",{className:(0,o.cn)(p?"iconoir-collapse":"iconoir-maximize","text-[14px]"),"aria-hidden":"true"})})]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto diff-viewer-wrapper",children:(0,s.jsx)(j,{repoPath:e,commitHash:t,fromCommitHash:a,toCommitHash:n,filePath:u,splitView:C})})]}):(0,s.jsx)("div",{className:"flex items-center justify-center h-full opacity-70 text-sm",children:"Select a file to view changes"})})]}):(0,s.jsx)("div",{className:"flex items-center justify-center p-8 h-full opacity-50",children:i?"No changes in selected commit range":"No changes in this commit"})}function y(e,t=""){let a={name:"",children:new Map};for(let s of e){let e=s.split("/"),l=a;for(let a=0;a<e.length;a++){let n=e[a];l.children.has(n)||l.children.set(n,{name:n,children:new Map}),l=l.children.get(n),a===e.length-1&&(l.fullPath=t?`${t}/${s}`:s)}}return a}function k(e,t,a){if(t[e])return t[e];let s=e.split("/");for(let e=s.length-1;e>0;e--){let a=s.slice(0,e).join("/");if(t[a])return t[a]}if(a){let e=a.split("/");for(let a=e.length;a>0;a--){let s=e.slice(0,a).join("/");if(t[s])return t[s]}}return null}function v(e){return Array.from(e.children.values()).sort((e,t)=>{let a=e.children.size>0&&!e.fullPath,s=t.children.size>0&&!t.fullPath;return a&&!s?-1:!a&&s?1:e.name.localeCompare(t.name)})}function w(e,t,a=""){let s=[];for(let l of v(e)){if(void 0!==l.fullPath){s.push(l.fullPath);continue}let e=a?`${a}/${l.name}`:l.name;t.has(e)&&s.push(...w(l,t,e))}return s}function C(e){let t=[];for(let a of v(e)){if(a.fullPath){t.push(a.fullPath);continue}t.push(...C(a))}return t}function S({type:e,isActive:t,isInherited:a,onClick:l,showOnHover:n}){return(0,s.jsx)("button",{className:(0,o.cn)("p-0.5 rounded hover:bg-base-300 transition-colors shrink-0 cursor-pointer text-xs",t&&"bg-primary/10",a&&"opacity-50",!t&&!n&&"opacity-0 group-hover:opacity-100"),onClick:l,title:"visible"===e?t?"Remove visible filter":"Show only this branch":t?"Remove hide filter":"Hide this branch",children:"visible"===e?(0,s.jsx)("i",{className:"iconoir-eye text-[14px]","aria-hidden":"true"}):(0,s.jsx)("i",{className:"iconoir-eye-closed text-[14px]","aria-hidden":"true"})})}function R({name:e,groupPath:t,icon:a,isExpanded:l,onToggle:n,visibilityMap:r,onToggleVisibility:i,depth:c=0}){let d=r[t],h=t.includes("/")?t.split("/").slice(0,-1).join("/"):void 0,m=h?r[h]:null,u=d||m,x=!d&&null!==m;return(0,s.jsxs)("div",{className:(0,o.cn)("group flex items-center gap-1 px-2 py-1.5 text-sm rounded-md cursor-pointer hover:bg-base-200 transition-colors font-medium"),style:{paddingLeft:`${12*c+8}px`},children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",onClick:n,children:[(0,s.jsx)("span",{className:"text-xs opacity-70",children:l?"▼":"▶"}),(0,s.jsx)("span",{className:"shrink-0",children:a}),(0,s.jsx)("span",{className:"truncate min-w-0 flex-1",children:e})]}),(0,s.jsxs)("div",{className:"flex items-center gap-0.5 ml-auto",children:[(0,s.jsx)(S,{type:"visible",isActive:"visible"===d||x&&"visible"===u,isInherited:x&&"visible"===u,onClick:e=>{e.stopPropagation(),i(t,"visible")},showOnHover:"visible"===d||x&&"visible"===u}),(0,s.jsx)(S,{type:"hidden",isActive:"hidden"===d||x&&"hidden"===u,isInherited:x&&"hidden"===u,onClick:e=>{e.stopPropagation(),i(t,"hidden")},showOnHover:"hidden"===d||x&&"hidden"===u})]})]})}function E({node:e,currentBranch:t,expandedFolders:a,onToggleFolder:l,onCheckout:n,onCheckoutToLocal:r,onCreateBranch:i,onDeleteBranch:d,onRenameBranch:h,onRenameRemoteBranch:m,onRebase:u,onMerge:x,onPushToRemote:p,onPullFromRemote:b,getBranchContextMenuItems:f,onBranchClick:g,onBranchContextMenu:j,onDeleteBranchGroup:N,selectedBranches:y,visibilityMap:v,onToggleVisibility:w,parentPath:R="",depth:$=0,groupPath:B,isRemote:M=!1,trackingInfo:F}){let P=Array.from(e.children.values()).sort((e,t)=>{let a=e.children.size>0&&!e.fullPath,s=t.children.size>0&&!t.fullPath;return a&&!s?-1:!a&&s?1:e.name.localeCompare(t.name)});return(0,s.jsx)(s.Fragment,{children:P.map(e=>{let P=void 0!==e.fullPath,T=e.children.size>0&&!P,D=e.fullPath||(R?`${R}/${e.name}`:e.name),L=a.has(D),A=P&&e.fullPath===t,O=v[D],I=k(D,v,B),H=!O&&null!==I;if(T){let k=C(e).filter(e=>e!==t);return(0,s.jsxs)("div",{children:[(0,s.jsx)(c,{items:[{label:"Delete",onClick:()=>N(k),danger:!0,disabled:0===k.length}],children:(0,s.jsxs)("div",{className:(0,o.cn)("group flex items-center gap-1 px-2 py-1.5 text-sm rounded-md cursor-pointer hover:bg-base-200 transition-colors opacity-70 select-none"),style:{paddingLeft:`${12*$+8}px`},children:[(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-1 min-w-0",onClick:()=>l(D),children:[(0,s.jsx)("span",{className:"text-xs opacity-70",children:L?"▼":"▶"}),(0,s.jsx)("i",{className:"iconoir-folder text-[16px] shrink-0","aria-hidden":"true"}),(0,s.jsx)("span",{className:"truncate min-w-0 flex-1",children:e.name})]}),(0,s.jsxs)("div",{className:"flex items-center gap-0.5 ml-auto",children:[(0,s.jsx)(S,{type:"visible",isActive:"visible"===O||H&&"visible"===I,isInherited:H&&"visible"===I,onClick:e=>{e.stopPropagation(),w(D,"visible")},showOnHover:"visible"===O||H&&"visible"===I}),(0,s.jsx)(S,{type:"hidden",isActive:"hidden"===O||H&&"hidden"===I,isInherited:H&&"hidden"===I,onClick:e=>{e.stopPropagation(),w(D,"hidden")},showOnHover:"hidden"===O||H&&"hidden"===I})]})]})}),L&&(0,s.jsx)(E,{node:e,currentBranch:t,expandedFolders:a,onToggleFolder:l,onCheckout:n,onCheckoutToLocal:r,onCreateBranch:i,onDeleteBranch:d,onRenameBranch:h,onRenameRemoteBranch:m,onRebase:u,onMerge:x,onPushToRemote:p,onPullFromRemote:b,getBranchContextMenuItems:f,onBranchClick:g,onBranchContextMenu:j,onDeleteBranchGroup:N,selectedBranches:y,visibilityMap:v,onToggleVisibility:w,parentPath:D,depth:$+1,groupPath:B,isRemote:M,trackingInfo:F})]},D)}let _=!M&&e.fullPath?F?.[e.fullPath]:void 0,K=_&&(_.ahead>0||_.behind>0),W=f({branchRef:e.fullPath,branchLeafName:e.name,currentBranch:t,isRemote:M,selectedBranchRefs:y.has(e.fullPath)?Array.from(y):[e.fullPath]}),z=y.has(e.fullPath);return(0,s.jsx)(c,{items:W,children:(0,s.jsxs)("div",{className:(0,o.cn)("group flex items-center gap-2 px-2 py-1.5 text-sm rounded-md cursor-pointer transition-colors select-none",!z&&"hover:bg-base-200",z&&"bg-primary/10 hover:bg-primary/20",A&&"bg-base-200 font-medium text-primary"),style:{paddingLeft:`${12*$+8}px`},onContextMenu:()=>j?.(e.fullPath),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",onClick:t=>g?.(e.fullPath,{isMultiSelect:t.metaKey||t.ctrlKey,isRangeSelect:t.shiftKey}),onDoubleClick:()=>!A&&n(e.fullPath),children:[A?(0,s.jsx)("span",{className:"w-3 h-3 flex items-center justify-center shrink-0",children:(0,s.jsx)("span",{className:"w-2 h-2 rounded-full bg-primary"})}):M?(0,s.jsx)("i",{className:"iconoir-globe text-[14px] opacity-50 shrink-0","aria-hidden":"true"}):(0,s.jsx)("i",{className:"iconoir-git-branch text-[14px] opacity-50 shrink-0","aria-hidden":"true"}),(0,s.jsx)("span",{className:"truncate min-w-0 flex-1",title:e.fullPath,children:e.name}),K&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-xs opacity-70 shrink-0",title:`${_.ahead} ahead, ${_.behind} behind ${_.upstream}`,children:[_.ahead>0&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-xs",children:[(0,s.jsx)("i",{className:"iconoir-arrow-up text-[12px]","aria-hidden":"true"}),(0,s.jsx)("span",{children:_.ahead})]}),_.behind>0&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5 text-xs",children:[(0,s.jsx)("i",{className:"iconoir-arrow-down text-[12px]","aria-hidden":"true"}),(0,s.jsx)("span",{children:_.behind})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-0.5 ml-auto",children:[(0,s.jsx)(S,{type:"visible",isActive:"visible"===O||H&&"visible"===I,isInherited:H&&"visible"===I,onClick:e=>{e.stopPropagation(),w(D,"visible")},showOnHover:"visible"===O||H&&"visible"===I}),(0,s.jsx)(S,{type:"hidden",isActive:"hidden"===O||H&&"hidden"===I,isInherited:H&&"hidden"===I,onClick:e=>{e.stopPropagation(),w(D,"hidden")},showOnHover:"hidden"===O||H&&"hidden"===I})]})]})},e.fullPath)})})}var $=a(3321);let B=!1;function M(e){return Math.min(Math.max(e,100),900)}function F(e){return Math.min(Math.max(e,.15),.75)}async function P(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(t)}}}let T={isOpen:!1,executionId:null,scriptName:"",branchRef:"",output:"",status:"idle",error:null};function D({repoPath:e}){let t,a=(0,n.jE)(),{data:i}=(0,l.t0)(),d=(0,l.Y5)(),x=(0,$.useRouter)(),p=(0,$.usePathname)(),b=(0,$.useSearchParams)(),f=(0,r.useRef)((t=window.performance.getEntriesByType("navigation").at(0),t?.type==="reload"&&!B&&(B=!0,!0))),g=(b.get("branch")??"").trim(),j=(0,r.useRef)(null),v=(0,r.useRef)(f.current&&b.has("branch")),S=(0,r.useRef)(f.current&&g||null),D=(0,r.useRef)(null),L=(0,r.useRef)(null),A=(0,r.useRef)(!1),[O,I]=(0,r.useState)(100),{data:H,isLoading:_,isError:K,error:W,refetch:z,isFetching:q}=(0,l._X)(e,O),{data:G,isLoading:V}=(0,l._6)(e),U=G?.current?.trim()??"",{data:J}=(0,l.en)(e),[Y,Q]=(0,r.useState)(null),[X,Z]=(0,r.useState)([]),[ee,et]=(0,r.useState)(null),ea=(0,r.useCallback)(e=>{Q(e),Z(e?[e]:[]),et(e)},[]);(0,r.useEffect)(()=>{ea(null),sS([]),sE(null)},[e,ea]);let{mutateAsync:es}=(0,l.a3)(),el=(0,r.useCallback)(()=>{let e=new URLSearchParams(b.toString()).toString();x.push(e?`/workspace/conflicts?${e}`:"/workspace/conflicts")},[x,b]),en=(0,r.useCallback)(e=>{if(!(e instanceof Error))return!1;let t=e.message.toLowerCase();return t.includes("conflict")||t.includes("could not apply")||t.includes("fix conflicts")||t.includes("resolve all conflicts")||t.includes("merge --continue")||t.includes("rebase --continue")},[]);(0,r.useEffect)(()=>{if(j.current===e)return;j.current=e;let t=f.current&&b.has("branch");v.current=t,S.current=t&&g||null,D.current=null,L.current=null,A.current=!1},[e,g,b]),(0,r.useEffect)(()=>{if(!f.current||!g||!G)return;let t=`${e}:${g}`;if(D.current!==t){if(G.current===g){D.current=t;return}if(!G.branches.includes(g)){D.current=t,(0,u.oR)({type:"error",title:"Branch Not Found",description:`Branch "${g}" does not exist in this repository.`});return}D.current=t,A.current=!0,(async()=>{try{await es({repoPath:e,action:"checkout",data:{branch:g}})}catch(e){console.error(e)}finally{A.current=!1}})()}},[G,e,g,es]),(0,r.useEffect)(()=>{if(!U||A.current)return;let t=`${e}:${g}`;if(f.current&&g&&g!==U&&D.current!==t||(b.get("branch")??"").trim()===U)return;let a=new URLSearchParams(b.toString());a.set("branch",U);let s=a.toString();x.replace(s?`${p}?${s}`:p,{scroll:!1})},[U,p,e,g,x,b]);let[er,ei]=(0,r.useState)(!1),[eo,ec]=(0,r.useState)(""),[ed,eh]=(0,r.useState)(null),[em,eu]=(0,r.useState)(!1),[ex,ep]=(0,r.useState)(!1),[eb,ef]=(0,r.useState)(null),[eg,ej]=(0,r.useState)(""),[eN,ey]=(0,r.useState)(!1),[ek,ev]=(0,r.useState)(!1),[ew,eC]=(0,r.useState)(!1),[eS,eR]=(0,r.useState)([]),[eE,e$]=(0,r.useState)(!1),[eB,eM]=(0,r.useState)(!1),[eF,eP]=(0,r.useState)(!1),[eT,eD]=(0,r.useState)(null),[eL,eA]=(0,r.useState)(!1),[eO,eI]=(0,r.useState)(!1),[eH,e_]=(0,r.useState)(null),[eK,eW]=(0,r.useState)(!1),[ez,eq]=(0,r.useState)(!1),[eG,eV]=(0,r.useState)(!1),[eU,eJ]=(0,r.useState)([]),[eY,eQ]=(0,r.useState)(!1),[eX,eZ]=(0,r.useState)(!1),[e0,e1]=(0,r.useState)(!1),[e2,e4]=(0,r.useState)(!1),[e3,e5]=(0,r.useState)(null),[e7,e6]=(0,r.useState)(null),[e8,e9]=(0,r.useState)(""),[te,tt]=(0,r.useState)(!1),[ta,ts]=(0,r.useState)(!1),[tl,tn]=(0,r.useState)(!1),[tr,ti]=(0,r.useState)(null),[to,tc]=(0,r.useState)(""),[td,th]=(0,r.useState)(!1),[tm,tu]=(0,r.useState)(!1),[tx,tp]=(0,r.useState)(null),[tb,tf]=(0,r.useState)(!1),[tg,tj]=(0,r.useState)(!1),[tN,ty]=(0,r.useState)("origin"),[tk,tv]=(0,r.useState)(""),[tw,tC]=(0,r.useState)(!1),[tS,tR]=(0,r.useState)(!1),[tE,t$]=(0,r.useState)(null),[tB,tM]=(0,r.useState)(null),[tF,tP]=(0,r.useState)(!0),[tT,tD]=(0,r.useState)(!1),[tL,tA]=(0,r.useState)("checking"),tO=(0,r.useCallback)(()=>{tR(!1),t$(null),tM(null),tA("checking")},[]),[tI,tH]=(0,r.useState)(!1),[t_,tK]=(0,r.useState)(null),[tW,tz]=(0,r.useState)(null),[tq,tG]=(0,r.useState)(!1),[tV,tU]=(0,r.useState)(!1),[tJ,tY]=(0,r.useState)(!1),[tQ,tX]=(0,r.useState)(""),[tZ,t0]=(0,r.useState)(!1),[t1,t2]=(0,r.useState)("checking"),t4=(0,r.useCallback)(()=>{tH(!1),tK(null),tz(null),t2("checking")},[]),[t3,t5]=(0,r.useState)(!1),[t7,t6]=(0,r.useState)(null),[t8,t9]=(0,r.useState)([]),[ae,at]=(0,r.useState)(""),[aa,as]=(0,r.useState)([]),[al,an]=(0,r.useState)(""),[ar,ai]=(0,r.useState)(null),[ao,ac]=(0,r.useState)(!1),[ad,ah]=(0,r.useState)(!1),[am,au]=(0,r.useState)(!0),[ax,ap]=(0,r.useState)(!1),[ab,af]=(0,r.useState)(""),[ag,aj]=(0,r.useState)(!1),[aN,ay]=(0,r.useState)(null),[ak,av]=(0,r.useState)(!1),[aw,aC]=(0,r.useState)(!1),[aS,aR]=(0,r.useState)(!1),[aE,a$]=(0,r.useState)(null),[aB,aM]=(0,r.useState)([]),[aF,aP]=(0,r.useState)(""),[aT,aD]=(0,r.useState)([]),[aL,aA]=(0,r.useState)(""),[aO,aI]=(0,r.useState)(null),[aH,a_]=(0,r.useState)(!0),[aK,aW]=(0,r.useState)(!1),[az,aq]=(0,r.useState)(null),[aG,aV]=(0,r.useState)(!1),[aU,aJ]=(0,r.useState)(!1),[aY,aQ]=(0,r.useState)(!1),[aX,aZ]=(0,r.useState)(!1),[a0,a1]=(0,r.useState)(!1),[a2,a4]=(0,r.useState)(!1),[a3,a5]=(0,r.useState)(null),[a7,a6]=(0,r.useState)(""),[a8,a9]=(0,r.useState)(!1),[se,st]=(0,r.useState)(!1),[sa,ss]=(0,r.useState)(null),[sl,sn]=(0,r.useState)(!1),[sr,si]=(0,r.useState)(!1),[so,sc]=(0,r.useState)(null),[sd,sh]=(0,r.useState)(!1),[sm,su]=(0,r.useState)(!1),[sx,sp]=(0,r.useState)(null),[sb,sf]=(0,r.useState)(""),[sg,sj]=(0,r.useState)(""),[sN,sy]=(0,r.useState)(!1),sk=(0,r.useRef)(null),[sv,sw]=(0,r.useState)(null),[sC,sS]=(0,r.useState)([]),[sR,sE]=(0,r.useState)(null),[s$,sB]=(0,r.useState)(!1),sM=(0,r.useRef)(null),[sF,sP]=(0,r.useState)(T),[sT,sD]=(0,r.useState)(!1),[sL,sA]=(0,r.useState)(!1),[sO,sI]=(0,r.useState)(!1),sH="starting"===sF.status||"running"===sF.status,s_="completed"===sF.status||"failed"===sF.status||"canceled"===sF.status;(0,r.useEffect)(()=>{s_&&sF.executionId&&a.invalidateQueries({queryKey:["git",e]})},[s_,sF.executionId,a,e]);let sK=(0,r.useCallback)(()=>{e4(!1),e5(null),e6(null),e9(""),tt(!1)},[]),sW=(0,r.useCallback)(()=>{tn(!1),ti(null),tc("")},[]),sz=(0,r.useCallback)(()=>{tu(!1),tp(null)},[]),sq=(0,r.useCallback)(()=>{tj(!1),ty("origin"),tv("")},[]),sG=(0,r.useCallback)(()=>{su(!1),sp(null),sf(""),sj("")},[]),sV=(0,r.useCallback)(()=>{if(eX){eZ(!1),eJ([]);return}if(a2)return void a4(!1);if(er){ei(!1),eh(null);return}if(ex){ep(!1),ef(null),ej(""),ey(!1);return}if(aS)return void aR(!1);if(t3)return void t5(!1);if(tI)return void t4();if(tS)return void tO();if(e2)return void sK();if(tl)return void sW();if(tm)return void sz();if(tg)return void sq();if(eG){eV(!1),eJ([]);return}if(ew){eC(!1),eR([]),e$(!1);return}if(eF){eP(!1),eD(null);return}if(eO){eI(!1),e_(null),eW(!1);return}if(sm)return void sG();if(se)return void st(!1);if(sr){si(!1),sc(null);return}s$?sB(!1):sF.isOpen&&s_&&(sP(T),sI(!1),sD(!1))},[eX,a2,er,ex,aS,t3,t4,tI,tO,tS,e2,sK,tl,sW,tm,sz,tg,sq,eG,ew,eF,eO,sm,sG,se,sr,s$,sF.isOpen,s_]),sU=se||sr||sm||ew||eF||eO||eX||eG||e2||tl||tm||tg||tS||tI||t3||aS||er||ex||a2||s$||sF.isOpen;(0,m.v)(sU,sV);let sJ="git-web:history-panel-height",sY="git-web:history-commit-details-message-ratio",[sQ,sX]=(0,r.useState)(300),[sZ,s0]=(0,r.useState)(!1),s1=(0,r.useRef)(null),[s2,s4]=(0,r.useState)(.28),[s3,s5]=(0,r.useState)(!1),s7=(0,r.useRef)(null),s6=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(i?.historyPanelHeight)sX(M(i.historyPanelHeight));else try{let e=localStorage.getItem(sJ);if(e){let t=parseInt(e,10);!isNaN(t)&&t>=100&&t<=900&&sX(t)}}catch(e){console.error("Failed to load panel height from localStorage:",e)}},[i?.historyPanelHeight]),(0,r.useEffect)(()=>{try{localStorage.setItem(sJ,String(sQ))}catch(e){console.error("Failed to save panel height to localStorage:",e)}},[sQ]),(0,r.useEffect)(()=>{try{let e=localStorage.getItem(sY);if(!e)return;let t=parseFloat(e);Number.isNaN(t)||s4(F(t))}catch(e){console.error("Failed to load commit details ratio from localStorage:",e)}},[]),(0,r.useEffect)(()=>{try{localStorage.setItem(sY,String(s2))}catch(e){console.error("Failed to save commit details ratio to localStorage:",e)}},[s2]),(0,r.useEffect)(()=>{!sZ&&s6.current&&(d.mutate({historyPanelHeight:sQ}),s6.current=!1)},[sZ,sQ,d]);let s8=(0,r.useCallback)(e=>{e.preventDefault(),s0(!0),s1.current={startY:e.clientY,startHeight:sQ}},[sQ]);(0,r.useEffect)(()=>{if(!sZ)return;let e=e=>{if(!s1.current)return;let t=s1.current.startY-e.clientY;sX(M(s1.current.startHeight+t)),s6.current=!0},t=()=>{s0(!1),s1.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[sZ]);let s9=(0,r.useCallback)(e=>{e.preventDefault(),s5(!0)},[]);(0,r.useEffect)(()=>{if(!s3)return;let e=e=>{let t=s7.current;if(!t)return;let a=t.getBoundingClientRect();a.height<=0||s4(F((e.clientY-a.top)/a.height))},t=()=>{s5(!1)};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),document.body.style.cursor="ns-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t),document.body.style.cursor="",document.body.style.userSelect=""}},[s3]),(0,r.useEffect)(()=>{if(!s$)return;let e=e=>{sM.current&&!sM.current.contains(e.target)&&sB(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[s$]);let le=(0,r.useMemo)(()=>G?.branches?y(G.branches):null,[G?.branches]),lt=(0,r.useMemo)(()=>{if(!G?.remotes)return null;var e=G.remotes;let t=new Map;for(let[a,s]of Object.entries(e))t.set(a,y(s,`remotes/${a}`));return t},[G?.remotes]),la=(0,r.useMemo)(()=>{let e=new Set;for(let t of G?.branches??[])e.add(t);for(let[t,a]of Object.entries(G?.remotes??{}))for(let s of a)e.add(`remotes/${t}/${s}`);return e},[G?.branches,G?.remotes]),ls=(0,r.useMemo)(()=>new Set(sC),[sC]),ll=(0,l.GK)(e),ln=(0,l.Lp)(),lr=(0,r.useMemo)(()=>(ll?.customScripts??[]).filter(e=>"branch"===e.target&&"run-bash-script"===e.action&&e.name.trim().length>0&&e.content.trim().length>0),[ll?.customScripts]),[li,lo]=(0,r.useState)(!0),[lc,ld]=(0,r.useState)(!0),[lh,lm]=(0,r.useState)(!0),[lu,lx]=(0,r.useState)({}),[lp,lb]=(0,r.useState)(new Set),lf=(0,r.useMemo)(()=>{let e=[];if(li&&le&&e.push(...w(le,lp)),lc&<)for(let[t,a]of Array.from(lt.entries())){let s=`__remotes__/${t}`;lp.has(s)&&e.push(...w(a,lp,`remotes/${t}`))}return e},[lp,le,li,lt,lc]);(0,r.useEffect)(()=>{if(0===sC.length)return;let e=sC.filter(e=>la.has(e));e.length!==sC.length&&sS(e),sR&&!la.has(sR)&&sE(e.length>0?e[e.length-1]:null)},[la,sR,sC]);let lg=(0,r.useRef)(null);(0,r.useEffect)(()=>{ll&&ll.path!==lg.current&&(lg.current=ll.path,void 0!==ll.localGroupExpanded&&lo(ll.localGroupExpanded),void 0!==ll.remotesGroupExpanded&&ld(ll.remotesGroupExpanded),void 0!==ll.worktreesGroupExpanded&&lm(ll.worktreesGroupExpanded),ll.expandedFolders&&lb(new Set(ll.expandedFolders)),ll.visibilityMap&&lx(ll.visibilityMap))},[ll]);let lj=(0,r.useCallback)(t=>{ln.mutate({path:e,updates:t})},[e,ln]),lN=(0,r.useCallback)(()=>{let e=!li;lo(e),lj({localGroupExpanded:e})},[li,lj]),ly=(0,r.useCallback)(()=>{let e=!lc;ld(e),lj({remotesGroupExpanded:e})},[lc,lj]),lk=(0,r.useCallback)(()=>{let e=!lh;lm(e),lj({worktreesGroupExpanded:e})},[lj,lh]),lv=(0,r.useCallback)(e=>{lb(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),lj({expandedFolders:Array.from(a)}),a})},[lj]),lw=(0,r.useCallback)((e,t)=>{lx(a=>{let s={...a};s[e]===t?delete s[e]:s[e]=t;let l={};return Object.entries(s).forEach(([e,t])=>{("visible"===t||"hidden"===t)&&(l[e]=t)}),lj({visibilityMap:l}),s})},[lj]),lC=(0,r.useCallback)(()=>{lx({}),lj({visibilityMap:{}})},[lj]),lS=(0,r.useCallback)((e,t)=>{let a=k(e,lu);if(a)return a;if(t){let t=e.split("/");if(t.length>=2&&"remotes"===t[0]){let e=t[1],a=lu[`__remotes__/${e}`];if(a)return a;let s=lu.__remotes__;if(s)return s}}else{let e=lu.__local__;if(e)return e}return null},[lu]),lR=(0,r.useMemo)(()=>{if(!H?.all||!G?.branches||!G?.branchCommits)return H?.all||[];let e=Object.values(lu).some(e=>"visible"===e),t=Object.values(lu).some(e=>"hidden"===e);if(!e&&!t)return H.all;let a=[...G.branches.map(e=>({branch:e,isRemote:!1}))];if(G.remotes)for(let[e,t]of Object.entries(G.remotes))for(let s of t)a.push({branch:`remotes/${e}/${s}`,isRemote:!0});let s=new Set,l=new Set,n=new Set;for(let{branch:e,isRemote:t}of a){let a=lS(e,t);"visible"===a?s.add(e):"hidden"===a?l.add(e):n.add(e)}let r=new Map(H.all.map(e=>[e.hash,e])),i=(e,t)=>{let a=[e];for(;a.length>0;){let e=a.pop();if(t.has(e))continue;let s=r.get(e);if(s)for(let l of(t.add(e),s.parents||[]))t.has(l)||a.push(l)}},o=new Set;for(let e of s){let t=G.branchCommits[e];t&&i(t,o)}if(e)return H.all.filter(e=>o.has(e.hash));if(t){let e=new Set;for(let t of n){let a=G.branchCommits[t];a&&i(a,e)}return H.all.filter(t=>e.has(t.hash))}return H.all},[H?.all,G?.branches,G?.branchCommits,G?.remotes,lu,lS]),lE=(0,r.useMemo)(()=>new Set(X),[X]),l$=(0,r.useMemo)(()=>lR.map(e=>e.hash),[lR]),lB=(0,r.useMemo)(()=>Y?H?.all.find(e=>e.hash===Y):null,[H?.all,Y]),lM=(0,r.useMemo)(()=>{if(!H?.all||X.length<2)return null;let e=new Map(H.all.map(e=>[e.hash,e])),t=new Map(l$.map((e,t)=>[e,t])),a=Array.from(new Set(X)).filter(e=>t.has(e)).sort((e,a)=>(t.get(e)??Number.MAX_SAFE_INTEGER)-(t.get(a)??Number.MAX_SAFE_INTEGER));if(a.length<2)return null;let s=a[0],l=a[a.length-1],n=e.get(s),r=e.get(l);return n&&r?{latestHash:s,oldestHash:l,latestCommit:n,oldestCommit:r}:null},[l$,H?.all,X]),lF=!!lM;(0,r.useEffect)(()=>{if(0===l$.length){(Y||X.length>0||ee)&&ea(null);return}let e=new Set(l$),t=X.filter(t=>e.has(t));t.length!==X.length&&Z(t),Y&&!e.has(Y)&&Q(t.length>0?t[t.length-1]:null),ee&&!e.has(ee)&&et(t.length>0?t[t.length-1]:null)},[l$,Y,X,ee,ea]);let lP=(0,r.useCallback)((e,t)=>{let a=t?.isRangeSelect??!1,s=t?.isMultiSelect??!1;if(a){let t=ee??Y??e,a=l$.indexOf(t),s=l$.indexOf(e);if(-1!==a&&-1!==s){let[l,n]=a<s?[a,s]:[s,a];Z(l$.slice(l,n+1)),Q(e),et(t);return}}if(s){if(lE.has(e)){let t=X.filter(t=>t!==e);Z(t),Q(a=>a!==e?a:t.length>0?t[t.length-1]:null),ee===e&&et(t.length>0?t[t.length-1]:null)}else Z([...X,e]),Q(e),et(e);return}ea(e)},[l$,lE,X,Y,ee,ea]),lT=(0,r.useMemo)(()=>lR.filter(e=>lE.has(e.hash)).reverse(),[lR,lE]),lD=(0,r.useMemo)(()=>Object.values(lu).some(e=>"visible"===e||"hidden"===e),[lu]),lL=(0,r.useMemo)(()=>{let e=new Set;if(G?.branches)for(let t of G.branches)"hidden"===lS(t,!1)&&e.add(t);if(G?.remotes)for(let[t,a]of Object.entries(G.remotes))for(let s of a){let a=`remotes/${t}/${s}`;"hidden"===lS(a,!0)&&e.add(a)}return e},[G?.branches,G?.remotes,lS]);(0,r.useEffect)(()=>{lD&&lR.length<50&&!q&&O<5e3&&H?.all&&H.all.length>=O&&I(e=>Math.min(e+100,5e3))},[lD,lR.length,q,O,H?.all]),(0,r.useEffect)(()=>{sv&&H?.all&&!q&&(H.all.some(e=>e.hash===sv)?requestAnimationFrame(()=>{sk.current?.scrollToCommit(sv)&&(ea(sv),sw(null))}):O<5e3?I(e=>e+100):(console.warn("Could not find commit after loading 5000 commits"),sw(null)))},[sv,H?.all,q,O,ea]);let lA=(0,r.useCallback)(e=>{if(!G?.branchCommits)return;let t=G.branchCommits[e];if(t){if(H?.all?.some(e=>e.hash===t)&&sk.current&&sk.current.scrollToCommit(t))return void ea(t);sw(t),ea(t)}},[G?.branchCommits,H?.all,ea]);(0,r.useEffect)(()=>{if(!v.current)return;let t=S.current;if(!t||!G?.branchCommits||U!==t)return;let a=`${e}:${t}`;L.current!==a&&(L.current=a,lA(t))},[U,G?.branchCommits,e,lA]);let lO=(0,r.useCallback)((e,t)=>{let a=t?.isRangeSelect??!1,s=t?.isMultiSelect??!1;if(a){let t=sR??e,a=lf.indexOf(t),s=lf.indexOf(e);if(-1!==a&&-1!==s){let[l,n]=a<s?[a,s]:[s,a],r=lf.slice(l,n+1);ls.has(e)?sS(sC.filter(e=>!r.includes(e))):sS(Array.from(new Set([...sC,...r]))),sE(t)}else sS([e]),sE(e);return}if(s){ls.has(e)?sS(sC.filter(t=>t!==e)):sS([...sC,e]),sE(e);return}sS([e]),sE(e),lA(e)},[sR,lf,lA,sC,ls]),lI=(0,r.useCallback)(e=>{ls.has(e)||(sS([e]),sE(e))},[ls]),lH=(0,r.useCallback)(async(t,a)=>{sI(!1),sD(!1),sP({isOpen:!0,executionId:null,scriptName:t.name,branchRef:a,output:"",status:"starting",error:null});try{let s=await fetch("/api/custom-scripts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:"start",repoPath:e,branchRef:a,scriptContent:t.content})}),l=await s.json();if(!s.ok)throw Error(l.error||"Failed to start script execution");let n=[];l.previousBranch&&l.checkedOutBranch&&l.previousBranch!==l.checkedOutBranch&&n.push(`[info] Checked out ${l.checkedOutBranch} (from ${l.previousBranch})`),sP(e=>({...e,executionId:l.executionId,output:[n.join("\n"),l.output].filter(Boolean).join("\n"),status:l.status,error:null}))}catch(e){sP(t=>({...t,status:"failed",error:e.message,output:t.output?`${t.output}
|
|
2
|
+
[error] ${e.message}`:`[error] ${e.message}`}))}},[e]),l_=(0,r.useCallback)(async()=>{if(sF.executionId&&sH){sD(!0);try{let e=await fetch("/api/custom-scripts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:"cancel",executionId:sF.executionId})}),t=await e.json();if(!e.ok)throw Error(t.error||"Failed to cancel script execution");sP(e=>({...e,output:t.output,status:t.status})),"running"!==t.status&&"starting"!==t.status&&sD(!1)}catch(e){sP(t=>({...t,output:`${t.output}
|
|
3
|
+
[error] ${e.message}`})),sD(!1)}}},[sF.executionId,sH]),lK=(0,r.useCallback)(async()=>{if(sL)return;sA(!0);let e=await P(sF.output);sA(!1),sI(e),e&&setTimeout(()=>sI(!1),1500)},[sL,sF.output]);(0,r.useEffect)(()=>{if(!sF.executionId||!sH)return;let e=!1,t=null,a=async()=>{try{let s=await fetch("/api/custom-scripts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:"status",executionId:sF.executionId})}),l=await s.json();if(!s.ok)throw Error(l.error||"Failed to fetch script execution output");if(e)return;let n=l.status;sP(e=>e.executionId!==l.executionId?e:{...e,output:l.output,status:n,error:null}),"running"===n?t=setTimeout(a,450):sD(!1)}catch(t){if(e)return;sD(!1),sP(e=>({...e,status:"failed",error:t.message,output:e.output?`${e.output}
|
|
4
|
+
[error] ${t.message}`:`[error] ${t.message}`}))}};return a(),()=>{e=!0,t&&clearTimeout(t)}},[sF.executionId,sH]);let lW=e=>{let t=e.filter(e=>e!==nS);0!==t.length&&(eR(t),e$(!1),eC(!0))},lz=e=>{lW([e])},lq=(0,r.useCallback)(e=>{let t=e.trim();t&&(eD(t),eP(!0))},[]),lG=(0,r.useCallback)(()=>{eI(!1),e_(null),eW(!1)},[]),lV=(0,r.useCallback)(e=>{e&&(e_(e),eW(!1),eI(!0))},[]),lU=async()=>{if(0!==eS.length){eM(!0);try{let t=new Map,a=(e,a,s)=>{t.has(e)||t.set(e,{branchRef:a,run:s})},l=new Set;if(eE)for(let e of eS){if(e.startsWith("remotes/"))continue;let t=G?.trackingInfo?.[e];t?.upstream&&l.add(t.upstream)}for(let t of l){let[s,...l]=t.split("/"),n=l.join("/");if(s&&n){let t=`${s}/${n}`;a(`remote:${t}`,t,()=>es({repoPath:e,action:"delete-remote-branch",data:{remote:s,branch:n},suppressErrorToast:!0}))}}for(let t of eS){if(t.startsWith("remotes/")){let s=t.split("/");if(s.length>=3){let t=s[1],l=s.slice(2).join("/"),n=`${t}/${l}`;a(`remote:${n}`,n,()=>es({repoPath:e,action:"delete-remote-branch",data:{remote:t,branch:l},suppressErrorToast:!0}))}continue}a(`local:${t}`,t,()=>es({repoPath:e,action:"delete-branch",data:{branch:t},suppressErrorToast:!0}))}let n=Array.from(t.values()),r=(await Promise.allSettled(n.map(e=>e.run()))).flatMap((e,t)=>{if("fulfilled"===e.status)return[];let a=n[t].branchRef;return console.error(`Failed to delete branch "${a}":`,e.reason),[a]});r.length>0&&(0,u.oR)({type:"error",title:1===r.length?"Failed to Delete 1 Branch":`Failed to Delete ${r.length} Branches`,description:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{children:"The following branches could not be deleted:"}),(0,s.jsx)("ul",{className:"mt-1 max-h-40 overflow-y-auto list-disc pl-5",children:r.map(e=>(0,s.jsx)("li",{className:"break-all",children:e},e))})]}),duration:1e4}),eC(!1),eR([]),e$(!1),sS([]),sE(null)}catch(e){console.error(e)}finally{eM(!1)}}},lJ=async()=>{if(eH){eq(!0);try{if(await es({repoPath:e,action:"delete-tag",data:{tag:eH}}),eK&&nE)try{await es({repoPath:e,action:"delete-remote-tag",data:{remote:nE,tag:eH}})}catch(e){console.error("Failed to delete remote tag:",e)}lG()}catch(e){console.error(e)}finally{eq(!1)}}},lY=async()=>{if(eT){eA(!0);try{await es({repoPath:e,action:"delete-worktree",data:{path:eT}}),eP(!1),eD(null)}catch(e){console.error(e)}finally{eA(!1)}}},lQ=e=>{e5(e),e6(null),e9(e),tt(!1),e4(!0)},lX=e=>{let t=e.split("/");if(t.length<3||"remotes"!==t[0])return;let a=t[1],s=t.slice(2).join("/");a&&s&&(e5(e),e6({remote:a,branch:s}),e9(s),tt(!1),e4(!0))},lZ=async()=>{if(e3&&e8){if(e7?e7.branch===e8:e3===e8)return void sK();ts(!0);try{e7?await es({repoPath:e,action:"rename-remote-branch",data:{remote:e7.remote,oldName:e7.branch,newName:e8}}):await es({repoPath:e,action:"rename-branch",data:{oldName:e3,newName:e8,renameTrackingRemote:te}}),sK()}catch(e){console.error(e)}finally{ts(!1)}}},l0=async()=>{if(!tr)return;let t=tr.trim(),a=to.trim();if(t&&a){if(t===a)return void sW();th(!0);try{await es({repoPath:e,action:"rename-remote",data:{oldName:t,newName:a}}),sW()}catch(e){console.error(e)}finally{th(!1)}}},l1=async()=>{if(!tx)return;let t=tx.trim();if(t){tf(!0);try{await es({repoPath:e,action:"delete-remote",data:{name:t}}),sz()}catch(e){console.error(e)}finally{tf(!1)}}},l2=async()=>{let t=tN.trim(),a=tk.trim();if(t&&a){tC(!0);try{await es({repoPath:e,action:"add-remote",data:{name:t,url:a}}),sq()}catch(e){console.error(e)}finally{tC(!1)}}},l4=({sourceBranch:e,targetBranch:t})=>{t$(e),tM(t),tP(!0),tA("checking"),tR(!0)},l3=async()=>{if(tE&&tB){tD(!0);try{await es({repoPath:e,action:"checkout",data:{branch:tE}}),await es({repoPath:e,action:"rebase",data:{ontoBranch:tB,stashChanges:tF}}),tO()}catch(e){en(e)&&(tO(),el(),(0,u.oR)({type:"warning",title:"Rebase Conflict Detected",description:"Redirected to the conflict resolver. Resolve conflicted files, then continue or abort.",duration:12e3})),console.error(e)}finally{tD(!1)}}};(0,r.useEffect)(()=>{if(!tS||!tE||!tB)return;let t=!1;return tA("checking"),(async()=>{try{let a=await es({repoPath:e,action:"check-rebase-conflicts",data:{sourceBranch:tE,ontoBranch:tB}});t||tA(a.hasConflicts?"has-conflicts":"no-conflict")}catch(e){console.error(e),t||tA("has-conflicts")}})(),()=>{t=!0}},[tS,tE,tB,e,es]);let l5=({sourceBranch:e,targetBranch:t})=>{tK(t),tz(e),tG(!1),tU(!1),tY(!1),tX(""),t2("checking"),tH(!0)},l7=(0,r.useCallback)(t=>{if(tU(t),t){if(!tW)return void tX("");(async()=>{try{let t=await es({repoPath:e,action:"get-latest-commit-message",data:{branch:tW}});tX("string"==typeof t?.message?t.message:"")}catch(e){console.error(e),tX("")}})()}},[tW,e,es]),l6=async()=>{if(t_&&tW){t0(!0);try{await es({repoPath:e,action:"checkout",data:{branch:t_}}),await es({repoPath:e,action:"merge",data:{targetBranch:tW,rebaseBeforeMerge:tq,squash:tV,fastForward:tJ,squashMessage:tV?tQ:void 0}}),t4()}catch(e){en(e)&&(t4(),el(),(0,u.oR)({type:"warning",title:"Merge Conflict Detected",description:"Redirected to the conflict resolver. Resolve conflicted files, then continue or abort.",duration:12e3})),console.error(e)}finally{t0(!1)}}};(0,r.useEffect)(()=>{if(!tI||!tW||!t_)return;let t=!1;return t2("checking"),(async()=>{try{let a=await es({repoPath:e,action:"check-merge-conflicts",data:{sourceBranch:tW,targetBranch:t_}});t||t2(a.hasConflicts?"has-conflicts":"no-conflict")}catch(e){console.error(e),t||t2("has-conflicts")}})(),()=>{t=!0}},[tI,tW,t_,e,es]);let l8=async t=>{t6(t),ay(null),t9([]),as([]),at(""),an(""),ai(null),ac(!1),ah(!1),au(!0),ap(!1),af(""),t5(!0),av(!0);try{let a=await es({repoPath:e,action:"get-remotes",data:{}});if(!a.remotes||0===a.remotes.length){ay("No remote repository configured. Please add a remote first."),av(!1);return}t9(a.remotes);let s=await es({repoPath:e,action:"get-tracking-branch",data:{branch:t}});ai(s.tracking);let l=s.tracking?.remote,n=l&&a.remotes.includes(l)?l:a.remotes[0];at(n),aC(!0);let r=await es({repoPath:e,action:"get-remote-branches",data:{remote:n}});as(r.branches||[]),s.tracking?.remote===n&&s.tracking?.branch?an(s.tracking.branch):(r.branches?.includes(t),an(t))}catch(e){console.error(e),ay(e.message||"Failed to load remote information")}finally{av(!1),aC(!1)}},l9=async t=>{at(t),aC(!0),as([]);try{let a=await es({repoPath:e,action:"get-remote-branches",data:{remote:t}});as(a.branches||[]),ar?.remote===t&&ar?.branch?an(ar.branch):an(t7||"")}catch(e){console.error(e),ay(e.message||"Failed to load remote branches")}finally{aC(!1)}},ne=(0,r.useCallback)(t=>{if(ap(t),t){if(!t7)return void af("");(async()=>{try{let t=await es({repoPath:e,action:"get-latest-commit-message",data:{branch:t7}});af("string"==typeof t?.message?t.message:"")}catch(e){console.error(e),af("")}})()}},[t7,e,es]),nt=async()=>{if(t7&&ae&&al){aj(!0),ay(null);try{let t=!aa.includes(al)||ar?.remote!==ae||ar?.branch!==al;await es({repoPath:e,action:"push-to-remote",data:{localBranch:t7,remote:ae,remoteBranch:al,rebaseFirst:!ad&&ao,forcePush:ad,pushLocalOnlyTags:am,setUpstream:t,squash:ax,squashMessage:ab}}),await es({repoPath:e,action:"fetch",data:{remote:ae}}),t5(!1),t6(null)}catch(e){console.error(e),ay(e.message||"Failed to push to remote")}finally{aj(!1)}}},na=async t=>{a$(t),aq(null),aM([]),aD([]),aP(""),aA(""),aI(null),a_(!0),aR(!0),aV(!0);try{let a=await es({repoPath:e,action:"get-remotes",data:{}});if(!a.remotes||0===a.remotes.length){aq("No remote repository configured. Please add a remote first."),aV(!1);return}aM(a.remotes);let s=await es({repoPath:e,action:"get-tracking-branch",data:{branch:t}});aI(s.tracking);let l=s.tracking?.remote,n=l&&a.remotes.includes(l)?l:a.remotes[0];aP(n),aJ(!0);let r=await es({repoPath:e,action:"get-remote-branches",data:{remote:n}});aD(r.branches||[]),s.tracking?.remote===n&&s.tracking?.branch?aA(s.tracking.branch):aA("")}catch(e){console.error(e),aq(e.message||"Failed to load remote information")}finally{aV(!1),aJ(!1)}},ns=async t=>{aP(t),aJ(!0),aD([]),aA("");try{let a=await es({repoPath:e,action:"get-remote-branches",data:{remote:t}});aD(a.branches||[]),aO?.remote===t&&aO?.branch?aA(aO.branch):aA("")}catch(e){console.error(e),aq(e.message||"Failed to load remote branches")}finally{aJ(!1)}},nl=async()=>{if(aE&&aF&&aL){aW(!0),aq(null);try{await es({repoPath:e,action:"pull-from-remote",data:{localBranch:aE,remote:aF,remoteBranch:aL,rebase:aH}}),aR(!1),a$(null)}catch(e){console.error(e),aq(e.message||"Failed to pull from remote")}finally{aW(!1)}}},nn=e=>{a5(e),a6(e.split("/").slice(2).join("/")),a4(!0)},nr=async()=>{if(a3&&a7){a9(!0);try{await es({repoPath:e,action:"checkout-to-local",data:{remoteBranch:a3,localBranch:a7}}),a4(!1),a5(null),a6("")}catch(e){console.error(e)}finally{a9(!1)}}},ni=async()=>{aQ(!0);try{await es({repoPath:e,action:"fetch",data:{allRemotes:!0}})}catch(e){console.error(e)}finally{aQ(!1)}},no=(0,r.useCallback)(async()=>{if(!aX){aZ(!0);try{let t=await fetch("/api/fs/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Failed to open repository folder")}catch(e){(0,u.oR)({type:"error",title:"Failed to Open Repo Folder",description:e instanceof Error?e.message:"Unknown error"})}finally{aZ(!1)}}},[aX,e]),nc=(0,r.useCallback)(async()=>{if(!a0){a1(!0);try{let t=await fetch("/api/fs/open-terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Failed to open terminal")}catch(e){(0,u.oR)({type:"error",title:"Failed to Open Terminal",description:e instanceof Error?e.message:"Unknown error"})}finally{a1(!1)}}},[a0,e]),nd=(0,r.useCallback)((e,t)=>{if(t)return;let a=window.location.origin;try{window.top?.location?.origin&&(a=window.top.location.origin)}catch{}let s=`${a}/workspace?path=${encodeURIComponent(e)}`;window.open(s,"_blank","noopener,noreferrer")},[]),nh=async t=>{try{await es({repoPath:e,action:"fetch",data:{remote:t}})}catch(e){console.error(e)}},nm=async t=>{try{await es({repoPath:e,action:"checkout",data:{branch:t}})}catch(e){console.error(e)}},nu=async e=>{ss(e),st(!0)},nx=async()=>{if(sa){sn(!0);try{await es({repoPath:e,action:"reset",data:{commitHash:sa,mode:"hard"}}),st(!1),ss(null)}catch(e){console.error(e)}finally{sn(!1)}}},np=async()=>{if(so){sh(!0);try{await es({repoPath:e,action:"revert",data:{commitHash:so.hash}}),si(!1),sc(null)}catch(e){console.error(e)}finally{sh(!1)}}},nb=async()=>{if(sx&&sb.trim()){sy(!0);try{let t,a;await es({repoPath:e,action:"reword",data:{commitHash:sx.hash,message:(t=sb.trim(),(a=sg.replace(/\r\n/g,"\n")).trim()?`${t}
|
|
5
|
+
|
|
6
|
+
${a}`:t),branch:sx.branch}}),sG()}catch(e){console.error(e)}finally{sy(!1)}}},nf=e=>{if(!(e instanceof Error))return!1;let t=e.message.toLowerCase();return t.includes("cherry-pick")&&t.includes("already in progress")},ng=e=>{if(!(e instanceof Error))return!1;let t=e.message.toLowerCase();return t.includes("could not apply")||t.includes("conflict")||t.includes("cherry-pick --continue")},nj=(0,r.useCallback)(async t=>{1===t.length?await es({repoPath:e,action:"cherry-pick",data:{commitHash:t[0]}}):await es({repoPath:e,action:"cherry-pick-multiple",data:{commitHashes:t}})},[e,es]),nN=(0,r.useCallback)(async()=>{try{await es({repoPath:e,action:"cherry-pick-abort"})}catch(e){console.error(e)}finally{eV(!1),eZ(!1),eJ([])}},[e,es]),ny=async()=>{if(0!==eU.length){eQ(!0);try{let e=eU.map(e=>e.hash);await nj(e),eV(!1),eJ([])}catch(e){nf(e)?(eV(!1),eZ(!0)):ng(e)&&await nN(),console.error(e)}finally{eQ(!1)}}},nk=async()=>{if(0===eU.length)return void eZ(!1);e1(!0);try{await es({repoPath:e,action:"cherry-pick-abort"});let t=eU.map(e=>e.hash);await nj(t),eZ(!1),eJ([])}catch(e){nf(e)?eZ(!0):ng(e)&&await nN(),console.error(e)}finally{e1(!1)}},nv=async()=>{if(eo){eu(!0);try{await es({repoPath:e,action:"branch",data:{branch:eo,fromRef:ed||void 0}}),ei(!1),ec(""),eh(null)}catch(e){console.error(e)}finally{eu(!1)}}},nw=e=>{eh(e||null),ei(!0)},nC=async()=>{if(eb&&eg.trim()){ev(!0);try{await es({repoPath:e,action:"create-tag",data:{tagName:eg.trim(),commitHash:eb,pushToRemote:eN}}),ep(!1),ef(null),ej(""),ey(!1)}catch(e){console.error(e)}finally{ev(!1)}}},nS=G?.current,nR=G?.trackingInfo,nE=(0,r.useMemo)(()=>Object.keys(G?.remoteUrls??{}).sort((e,t)=>"origin"===e?-1:"origin"===t?1:e.localeCompare(t)),[G?.remoteUrls])[0]||null,n$=(0,r.useMemo)(()=>{let e=[];for(let t of eS){if(t.startsWith("remotes/"))continue;let a=nR?.[t]?.upstream;a&&e.push(a)}return Array.from(new Set(e))},[eS,nR]),nB=(0,r.useMemo)(()=>!e3||e7?null:nR?.[e3]??null,[e3,e7,nR]),nM=J?.files?.length,nF=nS||(V?"Loading branches...":"Detached HEAD"),nP=nS&&"number"==typeof nM&&nM>0?`${nS} (${nM})`:nF,nT=(0,r.useMemo)(()=>{if(!nS)return null;let e=nR?.[nS];if(!e?.upstream)return null;let t=e.upstream.indexOf("/");return t<=0?null:{upstream:e.upstream,remote:e.upstream.slice(0,t),branch:e.upstream.slice(t+1)}},[nS,nR]),nD=(0,r.useMemo)(()=>V?"Loading branches...":nS?nT?null:`Branch "${nS}" has no tracking remote branch`:"Not on a local branch",[nS,nT,V]),nL=(0,r.useMemo)(()=>V?"Loading branches...":nS?null:"Not on a local branch",[nS,V]),nA=e=>{let t=function(e,t){let{branchRef:a,branchLeafName:l,currentBranch:n,isRemote:r,selectedBranchRefs:i}=e,o=!r&&a===n,c=i&&i.length>0?i:[a],d=c.length>1,h=[];return o||r||h.push({label:"Checkout",onClick:()=>t.onCheckout(a)}),r&&h.push({label:"Checkout to local",onClick:()=>t.onCheckoutToLocal(a)}),h.push({label:"Create Branch",onClick:()=>t.onCreateBranch(a)}),r||h.push({label:"Rename Branch",onClick:()=>t.onRenameBranch(a)}),r&&h.push({label:"Rename branch",onClick:()=>t.onRenameRemoteBranch(a)}),r||h.push({label:"Push to Remote",onClick:()=>t.onPushToRemote(a)}),r||h.push({label:"Pull from Remote",onClick:()=>t.onPullFromRemote(a)}),!o&&n&&(h.push({label:`Rebase ${n} onto ${l}`,labelNode:(0,s.jsxs)(s.Fragment,{children:["Rebase ",(0,s.jsx)("span",{className:"font-bold",children:n})," onto ",l]}),onClick:()=>t.onRebase({sourceBranch:n,targetBranch:a})}),h.push({label:`Rebase ${l} onto ${n}`,labelNode:(0,s.jsxs)(s.Fragment,{children:["Rebase ",l," onto ",(0,s.jsx)("span",{className:"font-bold",children:n})]}),onClick:()=>t.onRebase({sourceBranch:a,targetBranch:n})}),h.push({label:`Merge ${n} into ${l}`,labelNode:(0,s.jsxs)(s.Fragment,{children:["Merge ",(0,s.jsx)("span",{className:"font-bold",children:n})," into ",l]}),onClick:()=>t.onMerge({sourceBranch:n,targetBranch:a})}),h.push({label:`Merge ${l} into ${n}`,labelNode:(0,s.jsxs)(s.Fragment,{children:["Merge ",l," into ",(0,s.jsx)("span",{className:"font-bold",children:n})]}),onClick:()=>t.onMerge({sourceBranch:a,targetBranch:n})})),o||(d?h.push({label:`Delete Selected Branches (${c.length})`,onClick:()=>t.onDeleteBranches(c),danger:!0}):h.push({label:"Delete Branch",onClick:()=>t.onDeleteBranch(a),danger:!0})),h}(e,{onCheckout:nm,onCheckoutToLocal:nn,onCreateBranch:nw,onDeleteBranch:lz,onDeleteBranches:lW,onRenameBranch:lQ,onRenameRemoteBranch:lX,onRebase:l4,onMerge:l5,onPushToRemote:l8,onPullFromRemote:na});return lr.length>0&&t.push({label:"Custom scripts",children:lr.map(t=>({label:t.name,onClick:()=>{lH(t,e.branchRef)}}))}),t},nO=(0,r.useMemo)(()=>new Set(G?.branches??[]),[G?.branches]),nI=(0,r.useMemo)(()=>{let e=new Map;if(!G?.remotes)return e;for(let[t,a]of Object.entries(G.remotes))for(let s of a)e.set(`${t}/${s}`,`remotes/${t}/${s}`);return e},[G?.remotes]),nH=(0,r.useMemo)(()=>le?C(le).filter(e=>e!==nS):[],[le,nS]),n_=G?.worktrees??[],nK=(0,s.jsxs)("div",{className:"w-[22rem] max-w-[calc(100vw-2rem)] flex flex-col border border-base-300 bg-base-100 rounded-box shadow-xl overflow-hidden",children:[(0,s.jsxs)("div",{className:"px-4 border-b border-base-300 flex items-center justify-between bg-base-100 h-[57px] shrink-0",children:[(0,s.jsx)("h2",{className:"font-bold text-lg",children:"Branches"}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[lD&&(0,s.jsx)("div",{className:"tooltip tooltip-left z-20","data-tip":"Clear filters",children:(0,s.jsx)("button",{className:"btn btn-ghost btn-xs btn-square",onClick:lC,children:(0,s.jsx)("i",{className:"iconoir-filter text-[16px]","aria-hidden":"true"})})}),(0,s.jsx)("div",{className:"tooltip tooltip-left z-20","data-tip":"Create Branch",children:(0,s.jsx)("button",{className:"btn btn-ghost btn-xs btn-square",onClick:()=>nw(),children:(0,s.jsx)("i",{className:"iconoir-plus-circle text-[16px]","aria-hidden":"true"})})})]})]}),(0,s.jsx)("div",{className:"max-h-[70vh] overflow-auto",children:(0,s.jsxs)("div",{className:"p-2 space-y-0.5",children:[le&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c,{items:[{label:"Delete",onClick:()=>lW(nH),danger:!0,disabled:0===nH.length}],children:(0,s.jsx)(R,{name:"Branches",groupPath:"__local__",icon:(0,s.jsx)("i",{className:"iconoir-git-branch text-[14px]","aria-hidden":"true"}),isExpanded:li,onToggle:lN,visibilityMap:lu,onToggleVisibility:lw})}),li&&(0,s.jsx)(E,{node:le,currentBranch:G?.current,expandedFolders:lp,onToggleFolder:lv,onCheckout:nm,onCheckoutToLocal:nn,onCreateBranch:()=>nw(),onDeleteBranch:lz,onRenameBranch:lQ,onRenameRemoteBranch:lX,onRebase:l4,onMerge:l5,onPushToRemote:l8,onPullFromRemote:na,getBranchContextMenuItems:nA,onBranchClick:lO,onBranchContextMenu:lI,onDeleteBranchGroup:lW,selectedBranches:ls,visibilityMap:lu,onToggleVisibility:lw,depth:1,groupPath:"__local__",trackingInfo:G?.trackingInfo})]}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c,{items:[{label:"Fetch from all remotes",onClick:ni},{label:"Add remote",onClick:()=>{ty("origin"),tv(""),tj(!0)}}],children:(0,s.jsx)(R,{name:"Remotes",groupPath:"__remotes__",icon:(0,s.jsx)("i",{className:"iconoir-globe text-[14px]","aria-hidden":"true"}),isExpanded:lc,onToggle:ly,visibilityMap:lu,onToggleVisibility:lw})}),lc&&V&&!lt&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-2 py-2 text-sm opacity-70",style:{paddingLeft:"20px"},children:[(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),(0,s.jsx)("span",{children:"Loading remotes..."})]}),lc&<&&Array.from(lt.entries()).map(([e,t])=>{let a=`__remotes__/${e}`,l=lp.has(a);return(0,s.jsxs)("div",{children:[(0,s.jsx)(c,{items:[{label:`Fetch from ${e}`,onClick:()=>nh(e)},{label:"Rename",onClick:()=>{ti(e),tc(e),tn(!0)}},{label:"Delete",onClick:()=>{e&&(tp(e),tu(!0))},danger:!0}],children:(0,s.jsx)(R,{name:e,groupPath:a,icon:(0,s.jsx)("i",{className:"iconoir-globe text-[14px] opacity-50","aria-hidden":"true"}),isExpanded:l,onToggle:()=>lv(a),visibilityMap:lu,onToggleVisibility:lw,depth:1})}),l&&(0,s.jsx)(E,{node:t,currentBranch:G?.current,expandedFolders:lp,onToggleFolder:lv,onCheckout:nm,onCheckoutToLocal:nn,onCreateBranch:()=>nw(),onDeleteBranch:lz,onRenameBranch:lQ,onRenameRemoteBranch:lX,onRebase:l4,onMerge:l5,onPushToRemote:l8,onPullFromRemote:na,getBranchContextMenuItems:nA,onBranchClick:lO,onBranchContextMenu:lI,onDeleteBranchGroup:lW,selectedBranches:ls,visibilityMap:lu,onToggleVisibility:lw,depth:2,groupPath:a,isRemote:!0,trackingInfo:G?.trackingInfo})]},e)})]}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"group flex items-center gap-1 px-2 py-1.5 text-sm rounded-md cursor-pointer hover:bg-base-200 transition-colors font-medium",onClick:lk,children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[(0,s.jsx)("span",{className:"text-xs opacity-70",children:lh?"▼":"▶"}),(0,s.jsx)("i",{className:"iconoir-folder text-[14px]","aria-hidden":"true"}),(0,s.jsx)("span",{className:"truncate min-w-0 flex-1",children:"Worktrees"})]}),(0,s.jsx)("span",{className:"text-xs opacity-60",children:n_.length})]}),lh&&V&&0===n_.length&&(0,s.jsxs)("div",{className:"flex items-center gap-2 px-2 py-2 text-sm opacity-70",style:{paddingLeft:"20px"},children:[(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),(0,s.jsx)("span",{children:"Loading worktrees..."})]}),lh&&!V&&0===n_.length&&(0,s.jsx)("div",{className:"px-2 py-2 text-sm opacity-70",style:{paddingLeft:"20px"},children:"No worktrees found"}),lh&&n_.map(e=>{let t=(0,s.jsxs)("button",{type:"button",className:(0,o.cn)("group flex w-full items-center gap-2 px-2 py-1.5 text-sm rounded-md transition-colors text-left",e.isCurrent?"cursor-default opacity-85":"cursor-pointer hover:bg-base-200"),style:{paddingLeft:"20px"},onClick:()=>nd(e.path,e.isCurrent),title:e.path,disabled:e.isCurrent,children:[(0,s.jsx)("i",{className:`iconoir-folder text-[14px] shrink-0 ${e.isCurrent?"text-primary":"opacity-60"}`,"aria-hidden":"true"}),(0,s.jsx)("span",{className:"truncate min-w-0 flex-1",children:e.path}),e.branch&&(0,s.jsx)("span",{className:"shrink-0 text-xs opacity-60",children:e.branch}),e.isCurrent&&(0,s.jsx)("span",{className:"shrink-0 text-xs text-primary font-medium",children:"current"})]});return e.isCurrent?(0,s.jsx)("div",{children:t},e.path):(0,s.jsx)(c,{items:[{label:"Delete worktree",onClick:()=>lq(e.path),danger:!0}],children:t},e.path)})]})]})})]});return _&&100===O?(0,s.jsx)("div",{className:"flex items-center justify-center p-8 h-full",children:(0,s.jsx)("span",{className:"loading loading-spinner text-base-content/50"})}):K?(0,s.jsxs)("div",{className:"flex items-center justify-center p-8 h-full flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-error font-medium",children:"Error Loading History"}),(0,s.jsx)("p",{className:"text-sm opacity-70",children:W?.message||"An unknown error occurred"}),(0,s.jsxs)("button",{onClick:()=>z(),className:"btn btn-outline btn-sm",children:[(0,s.jsx)("i",{className:"iconoir-refresh-circle text-[16px] mr-1","aria-hidden":"true"}),"Try Again"]})]}):H?(0,s.jsxs)("div",{className:"flex h-full overflow-hidden",children:[se&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Reset to Commit"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to hard reset the current branch to commit ",(0,s.jsx)("span",{className:"font-mono bg-base-200 px-1 rounded",children:sa?.substring(0,7)}),"?",(0,s.jsx)("br",{}),(0,s.jsx)("span",{className:"text-error font-bold",children:"Warning: This will discard all local changes and commits after this point. This action cannot be undone."})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>st(!1),disabled:sl,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:nx,disabled:sl,children:[sl&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Reset"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>st(!1),children:"close"})})]}),sr&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Revert Commit"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to revert commit ",(0,s.jsx)("span",{className:"font-mono bg-base-200 px-1 rounded",children:so?.hash.substring(0,7)})," on ",(0,s.jsx)("span",{className:"font-bold break-all",children:G?.current||"current"}),"?"]}),so?.message&&(0,s.jsx)("div",{className:"rounded border border-base-300 bg-base-200/40 px-3 py-2 text-xs break-words",children:so.message}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{si(!1),sc(null)},disabled:sd,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:np,disabled:sd,children:[sd&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Revert"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>{si(!1),sc(null)},children:"close"})})]}),sm&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Reword Commit"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Reword commit ",(0,s.jsx)("span",{className:"font-mono bg-base-200 px-1 rounded",children:sx?.hash.substring(0,7)})," on branch ",(0,s.jsx)("span",{className:"font-bold",children:sx?.branch}),"."]}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm mb-3",value:sb,onChange:e=>sf(e.target.value),autoFocus:!0,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&sb.trim()&&!sN&&(e.preventDefault(),nb())},placeholder:"Commit subject",disabled:sN}),(0,s.jsx)("textarea",{className:"textarea textarea-bordered w-full h-32 font-mono text-sm",value:sg,onChange:e=>sj(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&sb.trim()&&!sN&&(e.preventDefault(),nb())},placeholder:"Commit message body (optional)",disabled:sN}),sx?.branch!==G?.current&&(0,s.jsx)("div",{className:"alert alert-warning text-xs mt-2 py-2",children:(0,s.jsxs)("span",{children:["This will briefly checkout ",(0,s.jsx)("b",{children:sx?.branch})," to amend the commit."]})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sG,disabled:sN,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:nb,disabled:!sb.trim()||sN,children:[sN&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Reword"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:sG,children:"close"})})]}),ew&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:eS.length>1?"Delete Branches":"Delete Branch"}),eS.length>1?(0,s.jsxs)("div",{className:"py-4 space-y-3",children:[(0,s.jsxs)("p",{className:"break-words",children:["Are you sure you want to delete ",(0,s.jsxs)("span",{className:"font-bold",children:[eS.length," selected branches"]}),"? This action cannot be undone."]}),(0,s.jsx)("div",{className:"max-h-44 overflow-auto rounded border border-base-300 bg-base-200/40 p-2 space-y-1",children:eS.map(e=>(0,s.jsx)("div",{className:"text-xs min-w-0 break-all",children:e.startsWith("remotes/")?e.slice(8):e},e))})]}):(0,s.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to delete the branch ",(0,s.jsx)("span",{className:"font-bold break-all",children:eS[0]?.startsWith("remotes/")?eS[0].slice(8):eS[0]}),"? This action cannot be undone."]}),n$.length>0&&(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start items-start gap-2 min-w-0",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:eE,onChange:e=>e$(e.target.checked),disabled:eB}),(0,s.jsx)("span",{className:"label-text break-words whitespace-normal",children:1===n$.length?(0,s.jsxs)(s.Fragment,{children:["Delete tracking remote branch ",(0,s.jsx)("span",{className:"font-mono opacity-70 break-all",children:n$[0]})]}):(0,s.jsxs)(s.Fragment,{children:["Delete ",n$.length," tracking remote branches"]})})]})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{eC(!1),eR([]),e$(!1)},disabled:eB,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:lU,disabled:eB,children:[eB&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Delete"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>{eC(!1),eR([]),e$(!1)},children:"close"})})]}),eF&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Delete Worktree"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to delete the worktree ",(0,s.jsx)("span",{className:"font-bold break-all",children:eT}),"?"]}),(0,s.jsx)("p",{className:"text-sm text-error break-words",children:"This will remove the worktree from git and remove its working directory."}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{eP(!1),eD(null)},disabled:eL,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:()=>void lY(),disabled:eL||!eT,children:[eL&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Delete"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>{eP(!1),eD(null)},children:"close"})})]}),eO&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Delete Tag"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to delete the tag ",(0,s.jsx)("span",{className:"font-bold break-all",children:eH}),"? This action cannot be undone."]}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start items-start gap-2 min-w-0",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:eK,onChange:e=>eW(e.target.checked),disabled:ez||!nE}),(0,s.jsx)("span",{className:"label-text break-words whitespace-normal",children:nE?(0,s.jsxs)(s.Fragment,{children:["Also delete from remote ",(0,s.jsx)("span",{className:"font-mono opacity-70",children:nE})]}):"No remote configured"})]})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:lG,disabled:ez,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:lJ,disabled:ez||!eH,children:[ez&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Delete"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:lG,children:"close"})})]}),eG&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Cherry Pick"}),(0,s.jsx)("p",{className:"text-sm opacity-70 mt-1",children:eU.length>1?"Apply selected commits from oldest to newest":"Apply changes from the selected commit"}),1===eU.length?(0,s.jsxs)("p",{className:"py-4 break-words",children:["Are you sure to apply ",(0,s.jsx)("span",{className:"font-bold font-mono break-all",children:eU[0]?.hash})," ",(0,s.jsx)("span",{className:"font-bold break-words",children:eU[0]?.message})," to ",(0,s.jsx)("span",{className:"font-bold break-all",children:G?.current||"current"})," branch?"]}):(0,s.jsxs)("div",{className:"py-4 space-y-3",children:[(0,s.jsxs)("p",{className:"break-words",children:["Are you sure to apply ",(0,s.jsxs)("span",{className:"font-bold",children:[eU.length," selected commits"]})," to ",(0,s.jsx)("span",{className:"font-bold break-all",children:G?.current||"current"})," branch?"]}),(0,s.jsx)("div",{className:"max-h-44 overflow-auto rounded border border-base-300 bg-base-200/40 p-2 space-y-1",children:eU.map(e=>(0,s.jsxs)("div",{className:"text-xs min-w-0",children:[(0,s.jsx)("span",{className:"font-mono opacity-70",children:e.hash.slice(0,7)})," ",(0,s.jsx)("span",{className:"break-words",children:e.message})]},e.hash))})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{eV(!1),eJ([])},disabled:eY,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:ny,disabled:eY,children:[eY&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Confirm"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>{eV(!1),eJ([])},children:"close"})})]}),eX&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Cherry Pick In Progress"}),(0,s.jsx)("p",{className:"text-sm opacity-70 mt-1",children:"Another cherry-pick operation is currently in progress."}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Abort the in-progress cherry-pick and continue with ",eU.length>1?"the selected commits":"this commit","?"]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{eZ(!1),eJ([])},disabled:e0,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-warning",onClick:()=>void nk(),disabled:e0,children:[e0&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Abort and Continue"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>{eZ(!1),eJ([])},children:"close"})})]}),e2&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:e7?"Rename Remote Branch":"Rename Branch"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Enter a new name for the branch ",(0,s.jsx)("span",{className:"font-bold break-all",children:e3}),". Press ",(0,s.jsx)("kbd",{className:"kbd kbd-sm",children:"Cmd"}),"+",(0,s.jsx)("kbd",{className:"kbd kbd-sm",children:"Enter"})," to confirm."]}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full",value:e8,onChange:e=>e9((0,o.L9)(e.target.value)),placeholder:"New branch name",disabled:ta,autoFocus:!0,onKeyDown:e=>{let t="Enter"===e.key&&(e.metaKey||e.ctrlKey),a=e7?e8===e7.branch:e8===e3;t&&e8&&!a&&!ta&&lZ()}}),!e7&&nB?.upstream&&(0,s.jsx)("div",{className:"form-control mt-2",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start items-start gap-2 min-w-0",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:te,onChange:e=>tt(e.target.checked),disabled:ta}),(0,s.jsxs)("span",{className:"label-text break-words whitespace-normal",children:["Also rename tracking remote branch ",(0,s.jsx)("span",{className:"font-mono opacity-70 break-all",children:nB.upstream})]})]})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sK,disabled:ta,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:lZ,disabled:!e8||(e7?e8===e7.branch:e8===e3)||ta,children:[ta&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Rename"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:sK,children:"close"})})]}),tl&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Rename Remote"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Enter a new name for remote ",(0,s.jsx)("span",{className:"font-bold break-all",children:tr}),". Press ",(0,s.jsx)("kbd",{className:"kbd kbd-sm",children:"Cmd"}),"+",(0,s.jsx)("kbd",{className:"kbd kbd-sm",children:"Enter"})," to confirm."]}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full",value:to,onChange:e=>tc(e.target.value),placeholder:"New remote name",disabled:td,autoFocus:!0,onKeyDown:e=>{let t="Enter"===e.key&&(e.metaKey||e.ctrlKey),a=to.trim(),s=a===(tr??"").trim();t&&a&&!s&&!td&&l0()}}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sW,disabled:td,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:l0,disabled:!to.trim()||to.trim()===(tr??"").trim()||td,children:[td&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Rename"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:sW,children:"close"})})]}),tm&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Delete Remote"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to delete remote ",(0,s.jsx)("span",{className:"font-bold break-all",children:tx}),"? This removes all tracking branches for that remote."]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sz,disabled:tb,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:l1,disabled:!tx||tb,children:[tb&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Delete"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:sz,children:"close"})})]}),tg&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Add Remote"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Add a new remote by providing a name and URL. Press ",(0,s.jsx)("kbd",{className:"kbd kbd-sm",children:"Cmd"}),"+",(0,s.jsx)("kbd",{className:"kbd kbd-sm",children:"Enter"})," to confirm."]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label pt-0",children:(0,s.jsx)("span",{className:"label-text",children:"Remote name"})}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full",value:tN,onChange:e=>ty(e.target.value),placeholder:"origin",disabled:tw,autoFocus:!0})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label pt-0",children:(0,s.jsx)("span",{className:"label-text",children:"Remote URL"})}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full",value:tk,onChange:e=>tv(e.target.value),placeholder:"https://github.com/owner/repo.git",disabled:tw,onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&tN.trim()&&tk.trim()&&!tw&&l2()}})]})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sq,disabled:tw,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:l2,disabled:!tN.trim()||!tk.trim()||tw,children:[tw&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Add"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:sq,children:"close"})})]}),tS&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Rebase"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Copy commits from one branch to another.",(0,s.jsx)("br",{}),"Are you sure to rebase ",(0,s.jsx)("span",{className:"font-bold break-all",children:tE})," onto ",(0,s.jsx)("span",{className:"font-bold break-all",children:tB}),"?"]}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:tF,onChange:e=>tP(e.target.checked),disabled:tT}),(0,s.jsx)("span",{className:"label-text",children:"Stash and reapply local changes"})]})}),!tF&&(0,s.jsx)("p",{className:"text-xs text-warning mt-2 ml-6",children:"Warning: All local changes will be discarded."}),"checking"===tL?(0,s.jsxs)("div",{className:"alert alert-info text-sm mt-4 py-2",children:[(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),(0,s.jsxs)("span",{children:["Checking conflicts for rebasing ",(0,s.jsx)("span",{className:"font-bold break-all",children:tE})," onto ",(0,s.jsx)("span",{className:"font-bold break-all",children:tB}),"..."]})]}):"no-conflict"===tL?(0,s.jsxs)("div",{className:"alert alert-success text-sm mt-4 py-2",children:[(0,s.jsx)("i",{className:"iconoir-check-circle-solid text-[18px]","aria-hidden":"true"}),(0,s.jsxs)("span",{children:["No conflict: rebasing ",(0,s.jsx)("span",{className:"font-bold break-all",children:tE})," onto ",(0,s.jsx)("span",{className:"font-bold break-all",children:tB})," will not cause conflicts."]})]}):(0,s.jsxs)("div",{className:"alert alert-warning text-sm mt-4 py-2",children:[(0,s.jsx)("i",{className:"iconoir-warning-circle-solid text-[18px]","aria-hidden":"true"}),(0,s.jsxs)("span",{children:["Conflicts detected: rebasing ",(0,s.jsx)("span",{className:"font-bold break-all",children:tE})," onto ",(0,s.jsx)("span",{className:"font-bold break-all",children:tB})," will cause conflicts."]})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:tO,disabled:tT,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:l3,disabled:tT,children:[tT&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Confirm"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:tO,children:"close"})})]}),tI&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Merge"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Merge branch into another one.",(0,s.jsx)("br",{}),"Are you sure to merge ",(0,s.jsx)("span",{className:"font-bold break-all",children:tW})," into ",(0,s.jsx)("span",{className:"font-bold break-all",children:t_}),"?"]}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:tq,onChange:e=>tG(e.target.checked),disabled:tZ}),(0,s.jsx)("span",{className:"label-text",children:"Rebase before merge"})]})}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:tV,onChange:e=>l7(e.target.checked),disabled:tZ}),(0,s.jsx)("span",{className:"label-text",children:"Squash before merge"})]})}),tV&&(0,s.jsx)("textarea",{className:"textarea textarea-bordered w-full mt-2",placeholder:"Commit message for squash merge",value:tQ,onChange:e=>tX(e.target.value),disabled:tZ,autoFocus:!0}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:tJ,onChange:e=>tY(e.target.checked),disabled:tZ}),(0,s.jsx)("span",{className:"label-text",children:"Fast forward merge"})]})}),"checking"===t1?(0,s.jsxs)("div",{className:"alert alert-info text-sm mt-4 py-2",children:[(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),(0,s.jsxs)("span",{children:["Checking conflicts for merging ",(0,s.jsx)("span",{className:"font-bold break-all",children:tW})," into ",(0,s.jsx)("span",{className:"font-bold break-all",children:t_}),"..."]})]}):"no-conflict"===t1?(0,s.jsxs)("div",{className:"alert alert-success text-sm mt-4 py-2",children:[(0,s.jsx)("i",{className:"iconoir-check-circle-solid text-[18px]","aria-hidden":"true"}),(0,s.jsxs)("span",{children:["No conflict: merging ",(0,s.jsx)("span",{className:"font-bold break-all",children:tW})," into ",(0,s.jsx)("span",{className:"font-bold break-all",children:t_})," will not cause conflicts."]})]}):(0,s.jsxs)("div",{className:"alert alert-warning text-sm mt-4 py-2",children:[(0,s.jsx)("i",{className:"iconoir-warning-circle-solid text-[18px]","aria-hidden":"true"}),(0,s.jsxs)("span",{children:["Conflicts detected: merging ",(0,s.jsx)("span",{className:"font-bold break-all",children:tW})," into ",(0,s.jsx)("span",{className:"font-bold break-all",children:t_})," will cause conflicts."]})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:t4,disabled:tZ,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:l6,disabled:tZ,children:[tZ&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Confirm"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:t4,children:"close"})})]}),t3&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Push to Remote"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Push ",(0,s.jsx)("span",{className:"font-bold break-all",children:t7})," to a remote repository."]}),aN&&0===t8.length?(0,s.jsxs)("div",{className:"alert alert-error",children:[(0,s.jsx)("span",{className:"text-xl",children:"⚠️"}),(0,s.jsx)("span",{children:aN})]}):ak?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)("span",{className:"loading loading-spinner loading-lg"})}):(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"form-control w-full flex flex-row items-center justify-between gap-4",children:[(0,s.jsx)("label",{className:"label flex-shrink-0",children:(0,s.jsx)("span",{className:"label-text",children:"Remote Repository"})}),(0,s.jsx)("select",{className:"select select-bordered w-64",value:ae,onChange:e=>l9(e.target.value),disabled:ag,children:t8.map(e=>(0,s.jsx)("option",{value:e,children:e},e))})]}),(0,s.jsxs)("div",{className:"form-control w-full flex flex-row items-center justify-between gap-4",children:[(0,s.jsx)("label",{className:"label flex-shrink-0",children:(0,s.jsx)("span",{className:"label-text",children:"Remote Branch"})}),(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1 w-64",children:[aw?(0,s.jsxs)("div",{className:"flex items-center gap-2 p-3 border rounded-lg bg-base-200 opacity-70 w-full",children:[(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"})," Loading branches..."]}):(0,s.jsxs)("select",{className:"select select-bordered w-full",value:al,onChange:e=>an(e.target.value),disabled:ag,children:[t7&&!aa.includes(t7)&&(0,s.jsxs)("option",{value:t7,children:[t7," (new)"]}),aa.map(e=>(0,s.jsxs)("option",{value:e,children:[e,ar?.remote===ae&&ar?.branch===e?" (tracking)":""]},e))]}),al&&!aa.includes(al)&&(0,s.jsx)("div",{className:"label",children:(0,s.jsx)("span",{className:"label-text-alt text-warning",children:"New branch will be created"})})]})]}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:ao,onChange:e=>ac(e.target.checked),disabled:ag||ad}),(0,s.jsx)("span",{className:"label-text",children:"Rebase onto remote branch before pushing"})]})}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm checkbox-error",checked:ad,onChange:e=>ah(e.target.checked),disabled:ag}),(0,s.jsx)("span",{className:"label-text text-error",children:"Force push"})]})}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:am,onChange:e=>au(e.target.checked),disabled:ag}),(0,s.jsx)("span",{className:"label-text",children:"Push all tags"})]})}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:ax,onChange:e=>ne(e.target.checked),disabled:ag}),(0,s.jsx)("span",{className:"label-text",children:"Squash local commits before push"})]})}),ax&&(0,s.jsx)("textarea",{className:"textarea textarea-bordered w-full",placeholder:"Commit message for squash",value:ab,onChange:e=>af(e.target.value),disabled:ag,autoFocus:!0}),aN&&(0,s.jsx)("div",{className:"alert alert-error text-sm",children:(0,s.jsx)("span",{children:aN})})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>t5(!1),disabled:ag,children:"Cancel"}),t8.length>0&&(0,s.jsxs)("button",{className:"btn btn-primary",onClick:nt,disabled:ag||!ae||!al,children:[ag&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"})," Push"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>t5(!1),children:"close"})})]}),aS&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Pull from Remote"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Pull changes from a remote branch into ",(0,s.jsx)("span",{className:"font-bold break-all",children:aE}),"."]}),az&&0===aB.length?(0,s.jsx)("div",{className:"alert alert-error",children:(0,s.jsx)("span",{children:az})}):aG?(0,s.jsx)("div",{className:"flex justify-center py-8",children:(0,s.jsx)("span",{className:"loading loading-spinner loading-lg"})}):(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"form-control w-full flex flex-row items-center justify-between gap-4",children:[(0,s.jsx)("label",{className:"label flex-shrink-0",children:(0,s.jsx)("span",{className:"label-text",children:"Remote Repository"})}),(0,s.jsx)("select",{className:"select select-bordered w-64",value:aF,onChange:e=>ns(e.target.value),disabled:aK,children:aB.map(e=>(0,s.jsx)("option",{value:e,children:e},e))})]}),(0,s.jsxs)("div",{className:"form-control w-full flex flex-row items-center justify-between gap-4",children:[(0,s.jsx)("label",{className:"label flex-shrink-0",children:(0,s.jsx)("span",{className:"label-text",children:"Remote Branch"})}),aU?(0,s.jsxs)("div",{className:"flex items-center gap-2 p-3 border rounded-lg bg-base-200 opacity-70 w-64",children:[(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"})," Loading branches..."]}):(0,s.jsx)("select",{className:"select select-bordered w-64",value:aL,onChange:e=>aA(e.target.value),disabled:aK,children:aT.map(e=>(0,s.jsxs)("option",{value:e,children:[e,aO?.remote===aF&&aO?.branch===e?" (tracking)":""]},e))})]}),(0,s.jsx)("div",{className:"form-control",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:aH,onChange:e=>a_(e.target.checked),disabled:aK}),(0,s.jsx)("span",{className:"label-text",children:"Rebase onto remote branch"})]})}),az&&(0,s.jsx)("div",{className:"alert alert-error text-sm",children:(0,s.jsx)("span",{children:az})})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>aR(!1),disabled:aK,children:"Cancel"}),aB.length>0&&(0,s.jsxs)("button",{className:"btn btn-primary",onClick:nl,disabled:aK||!aF||!aL,children:[aK&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"})," Pull"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>aR(!1),children:"close"})})]}),ex&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Create Tag"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Create a new tag at commit ",(0,s.jsx)("span",{className:"font-mono bg-base-200 px-1 rounded",children:eb?.substring(0,7)}),"."]}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono",value:eg,onChange:e=>ej(e.target.value),placeholder:"Tag name",disabled:ek,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&eg.trim()&&!ek&&nC()}}),(0,s.jsx)("div",{className:"form-control mt-3",children:(0,s.jsxs)("label",{className:"label cursor-pointer justify-start gap-2",children:[(0,s.jsx)("input",{type:"checkbox",className:"checkbox checkbox-sm",checked:eN,onChange:e=>ey(e.target.checked),disabled:ek}),(0,s.jsx)("span",{className:"label-text",children:"Push tag to remote after creation"})]})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{ep(!1),ef(null),ej(""),ey(!1)},disabled:ek,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:nC,disabled:!eg.trim()||ek,children:[ek&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Create"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>{ep(!1),ef(null),ej(""),ey(!1)},children:"close"})})]}),er&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Create New Branch"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Create a new branch from"," ",(0,s.jsx)("span",{className:"font-bold break-all",children:ed?ed.replace(/^remotes\//,""):"current HEAD"}),"."]}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full",value:eo,onChange:e=>ec((0,o.L9)(e.target.value)),placeholder:"Branch name",disabled:em,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&eo&&!em&&nv()}}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{ei(!1),eh(null)},disabled:em,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:nv,disabled:!eo||em,children:[em&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"})," Create & Checkout"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>{ei(!1),eh(null)},children:"close"})})]}),a2&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box",children:[(0,s.jsx)("h3",{className:"font-bold text-lg",children:"Checkout to Local Branch"}),(0,s.jsxs)("p",{className:"py-4 break-words",children:["Create a local branch from ",(0,s.jsx)("span",{className:"font-bold break-all",children:a3?.replace(/^remotes\//,"")})," and set up tracking."]}),(0,s.jsxs)("div",{className:"form-control w-full",children:[(0,s.jsx)("label",{className:"label",children:(0,s.jsx)("span",{className:"label-text",children:"Local Branch Name"})}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full",value:a7,onChange:e=>a6((0,o.L9)(e.target.value)),placeholder:"Local branch name",disabled:a8,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&a7&&!a8&&nr()}})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>a4(!1),disabled:a8,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:nr,disabled:!a7||a8,children:[a8&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"})," Checkout"]})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:()=>a4(!1),children:"close"})})]}),sF.isOpen&&(0,s.jsxs)("dialog",{className:"modal modal-open",children:[(0,s.jsxs)("div",{className:"modal-box max-w-4xl",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("h3",{className:"font-bold text-lg truncate",children:["Custom Script: ",sF.scriptName]}),(0,s.jsxs)("p",{className:"text-xs opacity-70 mt-1 break-all",children:["Branch: ",sF.branchRef]})]}),(0,s.jsx)("span",{className:(0,o.cn)("badge badge-sm shrink-0","running"===sF.status||"starting"===sF.status?"badge-info":"completed"===sF.status?"badge-success":"failed"===sF.status?"badge-error":"canceled"===sF.status?"badge-warning":"badge-ghost"),children:sF.status})]}),(0,s.jsx)("div",{className:"mt-4 border border-base-300 rounded bg-base-200/40",children:(0,s.jsx)("pre",{className:"p-3 font-mono text-xs overflow-auto max-h-[50vh] whitespace-pre-wrap break-words",children:sF.output||"Waiting for output..."})}),sF.error&&(0,s.jsx)("div",{className:"alert alert-error py-2 mt-3",children:(0,s.jsx)("span",{children:sF.error})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsxs)("button",{className:"btn btn-warning",onClick:()=>void l_(),disabled:!sH||sT,children:[sT&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Cancel"]}),(0,s.jsxs)("button",{className:"btn btn-outline",onClick:()=>void lK(),disabled:sL,children:[sL&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),sO?"Copied":"Copy"]}),(0,s.jsx)("button",{className:"btn btn-primary",onClick:()=>{sP(T),sI(!1),sD(!1)},disabled:!s_,children:"Done"})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:e=>{s_?(sP(T),sI(!1),sD(!1)):e.preventDefault()},children:"close"})})]}),(0,s.jsxs)("div",{className:"flex-1 flex flex-col min-w-0 bg-base-100",children:[(0,s.jsxs)("div",{className:"h-[57px] flex items-center justify-between gap-3 px-6 border-b border-base-300 shrink-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,s.jsx)("h1",{className:"font-bold text-lg",children:"History"}),(0,s.jsxs)("div",{className:"relative",ref:sM,children:[(0,s.jsxs)("button",{className:"btn btn-sm gap-2 max-w-[24rem]",onClick:()=>sB(e=>!e),title:nP,children:[(0,s.jsx)("span",{className:"truncate",children:nP}),(0,s.jsx)("i",{className:(0,o.cn)("iconoir-nav-arrow-down text-[16px] shrink-0 transition-transform",s$&&"rotate-180"),"aria-hidden":"true"})]}),s$&&(0,s.jsx)("div",{className:"absolute left-0 top-full mt-2 z-50",children:nK})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsxs)("button",{className:"btn btn-sm gap-2",onClick:()=>void ni(),disabled:aY||aS||t3,title:"Fetch latest changes from all remotes",children:[aY?(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,s.jsx)("i",{className:"iconoir-refresh text-[16px]","aria-hidden":"true"}),"Fetch"]}),(0,s.jsxs)("button",{className:"btn btn-sm gap-2",onClick:()=>{nS&&!nD&&na(nS)},disabled:!!nD||aS||t3,title:nD||`Pull from ${nT?.upstream}`,children:[aG?(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,s.jsx)("i",{className:"iconoir-arrow-down text-[16px]","aria-hidden":"true"}),"Pull"]}),(0,s.jsxs)("button",{className:"btn btn-sm gap-2",onClick:()=>{nS&&!nL&&l8(nS)},disabled:!!nL||aS||t3,title:nL||(nT?`Push to ${nT.upstream}`:"Push current branch to remote"),children:[ak?(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,s.jsx)("i",{className:"iconoir-arrow-up text-[16px]","aria-hidden":"true"}),"Push"]})]})]}),(0,s.jsxs)("div",{className:"shrink-0 flex items-center gap-2",children:[(0,s.jsxs)("button",{className:"btn btn-sm gap-2",onClick:()=>void nc(),disabled:a0,title:"Open terminal in repository folder",children:[a0?(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,s.jsx)("i",{className:"iconoir-terminal text-[16px]","aria-hidden":"true"}),"Open Terminal"]}),(0,s.jsxs)("button",{className:"btn btn-sm gap-2",onClick:()=>void no(),disabled:aX,title:"Open repository folder in Finder",children:[aX?(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}):(0,s.jsx)("i",{className:"iconoir-folder text-[16px]","aria-hidden":"true"}),"Open Repo Folder"]})]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-hidden relative",children:lD&&V?(0,s.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,s.jsx)("span",{className:"loading loading-spinner loading-lg opacity-50"})}):(0,s.jsx)(h,{ref:sk,commits:lR,selectedHash:Y||void 0,selectedHashes:lE,onSelectCommit:lP,onResetToCommit:nu,onRevertCommit:(e,t)=>{sc({hash:e,message:t}),si(!0)},onCreateTag:e=>{ef(e),ej(""),ey(!1),ep(!0)},onCherryPickCommit:(e,t)=>{eJ([{hash:e,message:t}]),eV(!0)},onCherryPickSelectedCommits:()=>{lT.length<2||(eJ(lT.map(e=>({hash:e.hash,message:e.message}))),eV(!0))},onRewordCommit:(e,t,a,s)=>{sp({hash:e,subject:t,body:a,branch:s}),sf(t),sj(a),su(!0)},localBranches:G?.branches||[],trackingInfo:G?.trackingInfo,onEndReached:()=>{!q&&H.all.length>=O&&I(e=>e+50)},isLoadingMore:q&&O>100,currentBranch:G?.current,hiddenBranches:lL,getBranchTagContextMenuItems:e=>{if(e.startsWith("tag:")){let t=e.replace(/^tag:\s*/,"").trim();return t?[{label:"Delete Tag",onClick:()=>lV(t),danger:!0}]:null}if(nO.has(e))return nA({branchRef:e,branchLeafName:e.split("/").pop()||e,currentBranch:nS,isRemote:!1});let t=nI.get(e);return t?nA({branchRef:t,branchLeafName:t.split("/").pop()||e,currentBranch:nS,isRemote:!0}):null}})}),Y&&(0,s.jsxs)("div",{className:"flex flex-col overflow-hidden border-t border-base-300 bg-base-200/30",style:{height:sQ},children:[(0,s.jsx)("div",{className:(0,o.cn)("h-1.5 cursor-ns-resize flex items-center justify-center hover:bg-base-200 transition-colors group shrink-0",sZ&&"bg-base-200"),onMouseDown:s8,children:(0,s.jsx)("div",{className:"w-8 h-1 rounded-full bg-base-300 group-hover:bg-base-content/20 transition-colors"})}),(0,s.jsxs)("div",{className:"flex flex-row items-center py-2 px-4 border-b border-base-300 bg-base-100 shrink-0 justify-between gap-4",children:[(0,s.jsx)("div",{className:"flex items-center gap-4 flex-1 min-w-0",children:lF&&lM?(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"text-sm font-bold truncate",children:[lM.latestHash.substring(0,7),": ",lM.latestCommit.message]}),(0,s.jsxs)("div",{className:"text-sm font-bold truncate opacity-75",children:[lM.oldestHash.substring(0,7),": ",lM.oldestCommit.message]})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-sm font-bold truncate",children:lB?.message}),(0,s.jsx)("span",{className:"text-xs font-mono opacity-50 shrink-0",children:Y.substring(0,7)})]})}),(0,s.jsx)("div",{className:"flex items-center gap-1 shrink-0",children:(0,s.jsx)("button",{className:"ml-2 btn btn-ghost btn-xs btn-square",onClick:()=>ea(null),title:"Close",children:"✕"})})]}),lF&&lM?(0,s.jsxs)("div",{className:"flex-1 overflow-hidden min-h-0 flex flex-col bg-base-100",children:[(0,s.jsx)("div",{className:"px-4 pt-2 pb-1 text-[10px] uppercase tracking-wider font-bold opacity-60 border-b border-base-300 bg-base-100 shrink-0",children:"Changes"}),(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(N,{repoPath:e,fromCommitHash:lM.oldestHash,toCommitHash:lM.latestHash})})]}):(0,s.jsxs)("div",{ref:s7,className:"flex-1 overflow-hidden bg-base-100 grid",style:{gridTemplateRows:`${s2}fr 6px ${1-s2}fr`},children:[(0,s.jsxs)("div",{className:"border-b border-base-300 bg-base-100 min-h-0 flex flex-col",children:[(0,s.jsx)("div",{className:"px-4 pt-3 pb-1 text-[10px] uppercase tracking-wider font-bold opacity-60",children:"Message"}),(0,s.jsx)("div",{className:"px-4 pb-3 overflow-auto flex-1 min-h-0",children:(0,s.jsx)("div",{className:"text-xs opacity-70 whitespace-pre-wrap font-mono",children:lB?(lB.body?.trim()?`${lB.message}
|
|
7
|
+
|
|
8
|
+
${lB.body}`:lB.message).replace(/\r\n/g,"\n").replace(/\\r\\n/g,"\n").replace(/\\n/g,"\n"):"No additional message"})})]}),(0,s.jsx)("div",{className:(0,o.cn)("cursor-ns-resize flex items-center justify-center hover:bg-base-200/60 transition-colors",s3&&"bg-base-200/60"),onMouseDown:s9,children:(0,s.jsx)("div",{className:"w-8 h-1 rounded-full bg-base-300"})}),(0,s.jsxs)("div",{className:"flex-1 overflow-hidden min-h-0 flex flex-col",children:[(0,s.jsx)("div",{className:"px-4 pt-2 pb-1 text-[10px] uppercase tracking-wider font-bold opacity-60 border-b border-base-300 bg-base-100 shrink-0",children:"Changes"}),(0,s.jsx)("div",{className:"flex-1 min-h-0",children:(0,s.jsx)(N,{repoPath:e,commitHash:Y})})]})]})]})]})]}):(0,s.jsx)("div",{className:"flex items-center justify-center p-8 h-full opacity-70",children:"No history data available"})}}}]);
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
linear-gradient(-45deg, rgba(120, 120, 120, 0.16) 25%, transparent 25%),
|
|
4
4
|
linear-gradient(45deg, transparent 75%, rgba(120, 120, 120, 0.16) 75%),
|
|
5
5
|
linear-gradient(-45deg, transparent 75%, rgba(120, 120, 120, 0.16) 75%)
|
|
6
|
-
`,backgroundSize:"22px 22px",backgroundPosition:"0 0, 0 11px, 11px -11px, -11px 0px"};function d(e,t){let[n,l]=(0,r.useState)(null),s=(0,r.useMemo)(()=>e&&t?`data:${e};base64,${t}`:null,[e,t]),a=(0,r.useMemo)(()=>(function(e){if(!e)return null;let t=e.endsWith("==")?2:+!!e.endsWith("="),n=Math.max(0,Math.floor(3*e.length/4)-t);return n<1024?`${n} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:`${(n/1048576).toFixed(1)} MB`})(t),[t]);(0,r.useEffect)(()=>{if(!s)return;let e=!1,t=new Image;return t.onload=()=>{e||l({src:s,dimensions:{width:t.naturalWidth,height:t.naturalHeight}})},t.onerror=()=>{e||l({src:s,dimensions:null})},t.src=s,()=>{e=!0}},[s]);let i=s&&n?.src===s?n.dimensions:null;return{src:s,metadata:i&&a?`${i.width} x ${i.height} px, ${a}`:a?`-, ${a}`:null}}function c({title:e,filePath:t,imageSrc:n,metadata:s}){return(0,l.jsxs)("section",{className:"border border-base-300 rounded-lg bg-base-200/30 overflow-hidden h-full min-h-0 flex flex-col",children:[(0,l.jsx)("header",{className:"px-3 py-2 border-b border-base-300 text-[10px] uppercase tracking-wider font-bold opacity-70",children:s?`${e} (${s})`:e}),(0,l.jsx)("div",{className:"flex-1 min-h-0 flex items-center justify-center p-3",style:o,children:n?(0,l.jsx)("img",{src:n,alt:`${e} image for ${t}`,className:"max-w-full max-h-full object-contain",draggable:!1}):(0,l.jsx)("span",{className:"text-sm opacity-50",children:"No image"})})]})}function u({filePath:e,imageDiff:t}){let n=d(t?.left?.mimeType,t?.left?.base64),u=d(t?.right?.mimeType,t?.right?.base64),m=!!(n.src&&u.src),[f,h]=(0,r.useState)(()=>{try{let e=localStorage.getItem(a);if("side-by-side"===e||"swipe"===e||"onion-skin"===e)return e}catch(e){console.error("Failed to load image diff mode preference:",e)}return"side-by-side"}),[p,x]=(0,r.useState)(50),[g,b]=(0,r.useState)(50),[N,y]=(0,r.useState)(null),v=(0,r.useRef)(null),j=m||"side-by-side"===f?f:"side-by-side";(0,r.useEffect)(()=>{try{localStorage.setItem(a,f)}catch(e){console.error("Failed to save image diff mode preference:",e)}},[f]);let w=(0,r.useCallback)(e=>{let t=v.current;if(!t)return;let n=t.getBoundingClientRect();n.width<=0||x(100*Math.max(0,Math.min(1,(e-n.left)/n.width)))},[]),k=(0,r.useCallback)(e=>{"swipe"===j&&m&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),y(e.pointerId),w(e.clientX))},[j,m,w]),$=(0,r.useCallback)(e=>{"swipe"===j&&N===e.pointerId&&w(e.clientX)},[j,N,w]),D=(0,r.useCallback)(e=>{N===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),y(null))},[N]);return(0,l.jsxs)("div",{className:"h-full min-h-0 p-4 box-border flex flex-col",children:[(0,l.jsx)("div",{className:(0,s.cn)("flex-1 min-h-0","side-by-side"===j?"overflow-auto":"overflow-hidden"),children:"side-by-side"===j?(0,l.jsxs)("div",{className:"min-w-[720px] h-full min-h-0 grid grid-cols-2 gap-4",children:[(0,l.jsx)(c,{title:"Old",filePath:e,imageSrc:n.src,metadata:n.metadata}),(0,l.jsx)(c,{title:"New",filePath:e,imageSrc:u.src,metadata:u.metadata})]}):(0,l.jsxs)("div",{className:"h-full min-h-0 flex flex-col",children:[(0,l.jsxs)("div",{className:"px-1 pb-2 text-sm font-semibold flex items-center justify-between gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,l.jsx)("span",{className:"text-error shrink-0",children:"Old"}),(0,l.jsx)("span",{className:"text-[11px] opacity-60 truncate font-mono",children:n.metadata??"No image"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 min-w-0 justify-end",children:[(0,l.jsx)("span",{className:"text-[11px] opacity-60 truncate font-mono",children:u.metadata??"No image"}),(0,l.jsx)("span",{className:"text-success shrink-0",children:"New"})]})]}),(0,l.jsxs)("div",{ref:v,className:(0,s.cn)("relative flex-1 min-h-0 rounded-lg border border-base-300 overflow-hidden shadow-sm","swipe"===j&&m?"cursor-ew-resize touch-none":""),style:o,onPointerDown:k,onPointerMove:$,onPointerUp:D,onPointerCancel:D,children:[n.src?(0,l.jsx)("img",{src:n.src,alt:`Old image for ${e}`,className:"absolute inset-0 w-full h-full object-contain pointer-events-none select-none",draggable:!1}):null,"onion-skin"===j?u.src?(0,l.jsx)("img",{src:u.src,alt:`New image for ${e}`,className:"absolute inset-0 w-full h-full object-contain pointer-events-none select-none",style:{opacity:g/100},draggable:!1}):null:u.src?(0,l.jsx)("img",{src:u.src,alt:`New image for ${e}`,className:"absolute inset-0 w-full h-full object-contain pointer-events-none select-none",style:{clipPath:`inset(0 0 0 ${p}%)`},draggable:!1}):null,"swipe"===j&&m?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"absolute top-0 bottom-0 w-[2px] bg-primary/90 pointer-events-none",style:{left:`${p}%`,transform:"translateX(-1px)"}}),(0,l.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 w-4 h-4 rounded-full border border-primary bg-base-100 pointer-events-none",style:{left:`${p}%`,transform:"translate(-50%, -50%)"}})]}):null,n.src||u.src?null:(0,l.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-sm opacity-50",children:"No image data available"})]})]})}),"onion-skin"===j&&m?(0,l.jsxs)("div",{className:"mt-3 flex items-center justify-center gap-3 shrink-0",children:[(0,l.jsx)("span",{className:"text-sm font-semibold text-error",children:"Old"}),(0,l.jsx)("input",{type:"range",min:0,max:100,value:g,onChange:e=>b(Number(e.target.value)),className:"range range-primary range-sm w-[320px] max-w-[65vw]","aria-label":"Onion skin blend slider"}),(0,l.jsx)("span",{className:"text-sm font-semibold text-success",children:"New"})]}):null,(0,l.jsx)("div",{className:"mt-3 flex items-center justify-center gap-2 shrink-0",children:i.map(e=>{let t="side-by-side"!==e.value&&!m;return(0,l.jsx)("button",{type:"button",onClick:()=>h(e.value),disabled:t,className:(0,s.cn)("px-4 py-1.5 text-sm rounded-lg transition-colors font-semibold",j===e.value?"bg-base-300 text-base-content":"text-base-content/60 hover:text-base-content hover:bg-base-200",t?"opacity-40 cursor-not-allowed hover:bg-transparent":""),children:e.label},e.value)})}),m?null:(0,l.jsx)("p",{className:"text-center text-[11px] opacity-60 mt-2",children:"Swipe and Onion Skin modes require both old and new image versions."})]})}},6162:(e,t,n)=>{n.d(t,{O:()=>f});var l=n(5155),s=n(8599),r=n(1425),a=n(4786);n(9413);var i=n(2115);let o=[];function d(e){return e.left?.type===a.sY.REMOVED&&e.right?.type===a.sY.ADDED}function c(e){return"string"==typeof e&&e.length>0?e:" "}function u(e){let t=e.type===a.sY.ADDED,n=e.type===a.sY.REMOVED;return(0,l.jsxs)("tr",{className:"line",children:[(0,l.jsx)("td",{className:(0,s.cn)("gutter",{"empty-gutter":null===e.leftLineNumber,"diff-added":t,"diff-removed":n}),children:(0,l.jsx)("pre",{className:"line-number",children:e.leftLineNumber??""})}),(0,l.jsx)("td",{className:(0,s.cn)("gutter",{"empty-gutter":null===e.rightLineNumber,"diff-added":t,"diff-removed":n}),children:(0,l.jsx)("pre",{className:"line-number",children:e.rightLineNumber??""})}),(0,l.jsx)("td",{className:(0,s.cn)("marker",{"diff-added":t,"diff-removed":n}),children:(0,l.jsx)("pre",{children:t?"+":n?"-":""})}),(0,l.jsx)("td",{className:(0,s.cn)("content",{"diff-added":t,"diff-removed":n}),children:(0,l.jsx)("pre",{className:"content-text",children:e.value})})]},e.key)}function m({oldValue:e,newValue:t,useDarkTheme:n=!1,linesOffset:r=0,showDiffOnly:m=!0,extraLinesSurroundingDiff:f=3}){let[h,p]=(0,i.useState)({signature:"",blocks:[]}),x=(0,i.useMemo)(()=>`${r}:${+!!m}:${f}:${e}\0${t}`,[e,t,r,m,f]),g=(0,i.useMemo)(()=>h.signature===x?h.blocks:o,[h,x]),{lineInformation:b,diffLines:N}=(0,i.useMemo)(()=>(0,a.sO)(e,t,!0,void 0,r),[e,t,r]),y=(0,i.useMemo)(()=>{if(0===b.length)return[];if(!m||0===N.length)return b.map((e,t)=>({type:"line",line:e,sourceIndex:t}));let e=Math.max(0,f),t=Array.from({length:b.length},()=>!1);N.forEach(n=>{let l=Math.max(0,n-e),s=Math.min(b.length-1,n+e);for(let e=l;e<=s;e+=1)t[e]=!0});for(let e=0;e<t.length;e+=1){if(t[e])continue;let n=e;for(;e<t.length&&!t[e];)e+=1;if(g.includes(n))for(let l=n;l<e;l+=1)t[l]=!0;e-=1}let n=[];for(let e=0;e<t.length;e+=1){if(t[e]){n.push({type:"line",line:b[e],sourceIndex:e});continue}let l=e;for(;e<t.length&&!t[e];)e+=1;n.push({type:"fold",foldStartIndex:l,totalLines:e-l}),e-=1}return n},[b,N,m,f,g]),v=(0,i.useMemo)(()=>{let e=[];for(let t=0;t<y.length;t+=1){let n=y[t];if("fold"===n.type){e.push((0,l.jsxs)("tr",{className:"code-fold",children:[(0,l.jsx)("td",{className:"code-fold-gutter"}),(0,l.jsx)("td",{className:"code-fold-gutter"}),(0,l.jsx)("td",{}),(0,l.jsx)("td",{children:(0,l.jsx)("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{p(e=>{let t=e.signature===x?e.blocks:[];return t.includes(n.foldStartIndex)?e.signature===x?e:{signature:x,blocks:t}:{signature:x,blocks:[...t,n.foldStartIndex]}})},children:(0,l.jsxs)("pre",{className:"code-fold-content",children:["Expand ",n.totalLines," lines ..."]})})})]},`fold-${n.foldStartIndex}`));continue}if(d(n.line)){let n=[],l=[],s=t;for(;s<y.length;){let e=y[s];if("line"!==e.type||!d(e.line))break;n.push({key:`line-${e.sourceIndex}-paired-removed`,type:a.sY.REMOVED,leftLineNumber:e.line.left?.lineNumber??null,rightLineNumber:null,value:c(e.line.left?.value)}),l.push({key:`line-${e.sourceIndex}-paired-added`,type:a.sY.ADDED,leftLineNumber:null,rightLineNumber:e.line.right?.lineNumber??null,value:c(e.line.right?.value)}),s+=1}n.forEach(t=>{e.push(u(t))}),l.forEach(t=>{e.push(u(t))}),t=s-1;continue}e.push(u(function(e,t){let n=e.left??{},l=e.right??{};return n.type===a.sY.REMOVED?{key:`line-${t}-removed`,type:a.sY.REMOVED,leftLineNumber:n.lineNumber??null,rightLineNumber:null,value:c(n.value)}:l.type===a.sY.ADDED?{key:`line-${t}-added`,type:a.sY.ADDED,leftLineNumber:null,rightLineNumber:l.lineNumber??null,value:c(l.value)}:{key:`line-${t}-default`,type:a.sY.DEFAULT,leftLineNumber:n.lineNumber??null,rightLineNumber:l.lineNumber??null,value:c(n.value??l.value)}}(n.line,n.sourceIndex)))}return e},[y,x]);return(0,l.jsx)("table",{className:(0,s.cn)("diff-container",n?"dark-theme":"light-theme"),children:(0,l.jsx)("tbody",{children:v})})}function f({oldValue:e,newValue:t,splitView:n,useDarkTheme:s=!1,linesOffset:a=0,showDiffOnly:i=!0,extraLinesSurroundingDiff:o=3}){return n?(0,l.jsx)(r.Ay,{oldValue:e,newValue:t,splitView:!0,useDarkTheme:s,disableWordDiff:!0}):(0,l.jsx)(m,{oldValue:e,newValue:t,useDarkTheme:s,linesOffset:a,showDiffOnly:i,extraLinesSurroundingDiff:o})}},6534:(e,t,n)=>{n.d(t,{J:()=>a});var l=n(2115),s=n(696),r=n(8599);function a(e,t){let n=(0,s.GK)(e);(0,l.useEffect)(()=>{let l=e?n?(0,r.iu)(n):(0,r.kj)(e):"Workspace";document.title=`${l} | ${t}`},[e,n,t])}}}]);
|
|
6
|
+
`,backgroundSize:"22px 22px",backgroundPosition:"0 0, 0 11px, 11px -11px, -11px 0px"};function d(e,t){let[n,l]=(0,r.useState)(null),s=(0,r.useMemo)(()=>e&&t?`data:${e};base64,${t}`:null,[e,t]),a=(0,r.useMemo)(()=>(function(e){if(!e)return null;let t=e.endsWith("==")?2:+!!e.endsWith("="),n=Math.max(0,Math.floor(3*e.length/4)-t);return n<1024?`${n} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:`${(n/1048576).toFixed(1)} MB`})(t),[t]);(0,r.useEffect)(()=>{if(!s)return;let e=!1,t=new Image;return t.onload=()=>{e||l({src:s,dimensions:{width:t.naturalWidth,height:t.naturalHeight}})},t.onerror=()=>{e||l({src:s,dimensions:null})},t.src=s,()=>{e=!0}},[s]);let i=s&&n?.src===s?n.dimensions:null;return{src:s,metadata:i&&a?`${i.width} x ${i.height} px, ${a}`:a?`-, ${a}`:null}}function c({title:e,filePath:t,imageSrc:n,metadata:s}){return(0,l.jsxs)("section",{className:"border border-base-300 rounded-lg bg-base-200/30 overflow-hidden h-full min-h-0 flex flex-col",children:[(0,l.jsx)("header",{className:"px-3 py-2 border-b border-base-300 text-[10px] uppercase tracking-wider font-bold opacity-70",children:s?`${e} (${s})`:e}),(0,l.jsx)("div",{className:"flex-1 min-h-0 flex items-center justify-center p-3",style:o,children:n?(0,l.jsx)("img",{src:n,alt:`${e} image for ${t}`,className:"max-w-full max-h-full object-contain",draggable:!1}):(0,l.jsx)("span",{className:"text-sm opacity-50",children:"No image"})})]})}function u({filePath:e,imageDiff:t}){let n=d(t?.left?.mimeType,t?.left?.base64),u=d(t?.right?.mimeType,t?.right?.base64),m=!!(n.src&&u.src),[f,h]=(0,r.useState)(()=>{try{let e=localStorage.getItem(a);if("side-by-side"===e||"swipe"===e||"onion-skin"===e)return e}catch(e){console.error("Failed to load image diff mode preference:",e)}return"side-by-side"}),[p,x]=(0,r.useState)(50),[g,b]=(0,r.useState)(50),[N,y]=(0,r.useState)(null),v=(0,r.useRef)(null),j=m||"side-by-side"===f?f:"side-by-side";(0,r.useEffect)(()=>{try{localStorage.setItem(a,f)}catch(e){console.error("Failed to save image diff mode preference:",e)}},[f]);let w=(0,r.useCallback)(e=>{let t=v.current;if(!t)return;let n=t.getBoundingClientRect();n.width<=0||x(100*Math.max(0,Math.min(1,(e-n.left)/n.width)))},[]),k=(0,r.useCallback)(e=>{"swipe"===j&&m&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),y(e.pointerId),w(e.clientX))},[j,m,w]),$=(0,r.useCallback)(e=>{"swipe"===j&&N===e.pointerId&&w(e.clientX)},[j,N,w]),D=(0,r.useCallback)(e=>{N===e.pointerId&&(e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),y(null))},[N]);return(0,l.jsxs)("div",{className:"h-full min-h-0 p-4 box-border flex flex-col",children:[(0,l.jsx)("div",{className:(0,s.cn)("flex-1 min-h-0","side-by-side"===j?"overflow-auto":"overflow-hidden"),children:"side-by-side"===j?(0,l.jsxs)("div",{className:"min-w-[720px] h-full min-h-0 grid grid-cols-2 gap-4",children:[(0,l.jsx)(c,{title:"Old",filePath:e,imageSrc:n.src,metadata:n.metadata}),(0,l.jsx)(c,{title:"New",filePath:e,imageSrc:u.src,metadata:u.metadata})]}):(0,l.jsxs)("div",{className:"h-full min-h-0 flex flex-col",children:[(0,l.jsxs)("div",{className:"px-1 pb-2 text-sm font-semibold flex items-center justify-between gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,l.jsx)("span",{className:"text-error shrink-0",children:"Old"}),(0,l.jsx)("span",{className:"text-[11px] opacity-60 truncate font-mono",children:n.metadata??"No image"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 min-w-0 justify-end",children:[(0,l.jsx)("span",{className:"text-[11px] opacity-60 truncate font-mono",children:u.metadata??"No image"}),(0,l.jsx)("span",{className:"text-success shrink-0",children:"New"})]})]}),(0,l.jsxs)("div",{ref:v,className:(0,s.cn)("relative flex-1 min-h-0 rounded-lg border border-base-300 overflow-hidden shadow-sm","swipe"===j&&m?"cursor-ew-resize touch-none":""),style:o,onPointerDown:k,onPointerMove:$,onPointerUp:D,onPointerCancel:D,children:[n.src?(0,l.jsx)("img",{src:n.src,alt:`Old image for ${e}`,className:"absolute inset-0 w-full h-full object-contain pointer-events-none select-none",draggable:!1}):null,"onion-skin"===j?u.src?(0,l.jsx)("img",{src:u.src,alt:`New image for ${e}`,className:"absolute inset-0 w-full h-full object-contain pointer-events-none select-none",style:{opacity:g/100},draggable:!1}):null:u.src?(0,l.jsx)("img",{src:u.src,alt:`New image for ${e}`,className:"absolute inset-0 w-full h-full object-contain pointer-events-none select-none",style:{clipPath:`inset(0 0 0 ${p}%)`},draggable:!1}):null,"swipe"===j&&m?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"absolute top-0 bottom-0 w-[2px] bg-primary/90 pointer-events-none",style:{left:`${p}%`,transform:"translateX(-1px)"}}),(0,l.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 w-4 h-4 rounded-full border border-primary bg-base-100 pointer-events-none",style:{left:`${p}%`,transform:"translate(-50%, -50%)"}})]}):null,n.src||u.src?null:(0,l.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-sm opacity-50",children:"No image data available"})]})]})}),"onion-skin"===j&&m?(0,l.jsxs)("div",{className:"mt-3 flex items-center justify-center gap-3 shrink-0",children:[(0,l.jsx)("span",{className:"text-sm font-semibold text-error",children:"Old"}),(0,l.jsx)("input",{type:"range",min:0,max:100,value:g,onChange:e=>b(Number(e.target.value)),className:"range range-primary range-sm w-[320px] max-w-[65vw]","aria-label":"Onion skin blend slider"}),(0,l.jsx)("span",{className:"text-sm font-semibold text-success",children:"New"})]}):null,(0,l.jsx)("div",{className:"mt-3 flex items-center justify-center gap-2 shrink-0",children:i.map(e=>{let t="side-by-side"!==e.value&&!m;return(0,l.jsx)("button",{type:"button",onClick:()=>h(e.value),disabled:t,className:(0,s.cn)("px-4 py-1.5 text-sm rounded-lg transition-colors font-semibold",j===e.value?"bg-base-300 text-base-content":"text-base-content/60 hover:text-base-content hover:bg-base-200",t?"opacity-40 cursor-not-allowed hover:bg-transparent":""),children:e.label},e.value)})}),m?null:(0,l.jsx)("p",{className:"text-center text-[11px] opacity-60 mt-2",children:"Swipe and Onion Skin modes require both old and new image versions."})]})}},6162:(e,t,n)=>{n.d(t,{O:()=>f});var l=n(5155),s=n(8599),r=n(1425),a=n(4786);n(9413);var i=n(2115);let o=[];function d(e){return e.left?.type===a.sY.REMOVED&&e.right?.type===a.sY.ADDED}function c(e){return"string"==typeof e&&e.length>0?e:" "}function u(e){let t=e.type===a.sY.ADDED,n=e.type===a.sY.REMOVED;return(0,l.jsxs)("tr",{className:"line",children:[(0,l.jsx)("td",{className:(0,s.cn)("gutter",{"empty-gutter":null===e.leftLineNumber,"diff-added":t,"diff-removed":n}),children:(0,l.jsx)("pre",{className:"line-number",children:e.leftLineNumber??""})}),(0,l.jsx)("td",{className:(0,s.cn)("gutter",{"empty-gutter":null===e.rightLineNumber,"diff-added":t,"diff-removed":n}),children:(0,l.jsx)("pre",{className:"line-number",children:e.rightLineNumber??""})}),(0,l.jsx)("td",{className:(0,s.cn)("marker",{"diff-added":t,"diff-removed":n}),children:(0,l.jsx)("pre",{children:t?"+":n?"-":""})}),(0,l.jsx)("td",{className:(0,s.cn)("content",{"diff-added":t,"diff-removed":n}),children:(0,l.jsx)("pre",{className:"content-text",children:e.value})})]},e.key)}function m({oldValue:e,newValue:t,useDarkTheme:n=!1,linesOffset:r=0,showDiffOnly:m=!0,extraLinesSurroundingDiff:f=3}){let[h,p]=(0,i.useState)({signature:"",blocks:[]}),x=(0,i.useMemo)(()=>`${r}:${+!!m}:${f}:${e}\0${t}`,[e,t,r,m,f]),g=(0,i.useMemo)(()=>h.signature===x?h.blocks:o,[h,x]),{lineInformation:b}=(0,i.useMemo)(()=>(0,a.sO)(e,t,!0,void 0,r),[e,t,r]),N=(0,i.useMemo)(()=>{let e=[];return b.forEach((t,n)=>{(t.left?.type!==a.sY.DEFAULT||t.right?.type!==a.sY.DEFAULT)&&e.push(n)}),e},[b]),y=(0,i.useMemo)(()=>{if(0===b.length)return[];if(!m||0===N.length)return b.map((e,t)=>({type:"line",line:e,sourceIndex:t}));let e=Math.max(0,f),t=Array.from({length:b.length},()=>!1);N.forEach(n=>{let l=Math.max(0,n-e),s=Math.min(b.length-1,n+e);for(let e=l;e<=s;e+=1)t[e]=!0});for(let e=0;e<t.length;e+=1){if(t[e])continue;let n=e;for(;e<t.length&&!t[e];)e+=1;if(g.includes(n))for(let l=n;l<e;l+=1)t[l]=!0;e-=1}let n=[];for(let e=0;e<t.length;e+=1){if(t[e]){n.push({type:"line",line:b[e],sourceIndex:e});continue}let l=e;for(;e<t.length&&!t[e];)e+=1;n.push({type:"fold",foldStartIndex:l,totalLines:e-l}),e-=1}return n},[b,N,m,f,g]),v=(0,i.useMemo)(()=>{let e=[];for(let t=0;t<y.length;t+=1){let n=y[t];if("fold"===n.type){e.push((0,l.jsxs)("tr",{className:"code-fold",children:[(0,l.jsx)("td",{className:"code-fold-gutter"}),(0,l.jsx)("td",{className:"code-fold-gutter"}),(0,l.jsx)("td",{}),(0,l.jsx)("td",{children:(0,l.jsx)("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{p(e=>{let t=e.signature===x?e.blocks:[];return t.includes(n.foldStartIndex)?e.signature===x?e:{signature:x,blocks:t}:{signature:x,blocks:[...t,n.foldStartIndex]}})},children:(0,l.jsxs)("pre",{className:"code-fold-content",children:["Expand ",n.totalLines," lines ..."]})})})]},`fold-${n.foldStartIndex}`));continue}if(d(n.line)){let n=[],l=[],s=t;for(;s<y.length;){let e=y[s];if("line"!==e.type||!d(e.line))break;n.push({key:`line-${e.sourceIndex}-paired-removed`,type:a.sY.REMOVED,leftLineNumber:e.line.left?.lineNumber??null,rightLineNumber:null,value:c(e.line.left?.value)}),l.push({key:`line-${e.sourceIndex}-paired-added`,type:a.sY.ADDED,leftLineNumber:null,rightLineNumber:e.line.right?.lineNumber??null,value:c(e.line.right?.value)}),s+=1}n.forEach(t=>{e.push(u(t))}),l.forEach(t=>{e.push(u(t))}),t=s-1;continue}e.push(u(function(e,t){let n=e.left??{},l=e.right??{};return n.type===a.sY.REMOVED?{key:`line-${t}-removed`,type:a.sY.REMOVED,leftLineNumber:n.lineNumber??null,rightLineNumber:null,value:c(n.value)}:l.type===a.sY.ADDED?{key:`line-${t}-added`,type:a.sY.ADDED,leftLineNumber:null,rightLineNumber:l.lineNumber??null,value:c(l.value)}:{key:`line-${t}-default`,type:a.sY.DEFAULT,leftLineNumber:n.lineNumber??null,rightLineNumber:l.lineNumber??null,value:c(n.value??l.value)}}(n.line,n.sourceIndex)))}return e},[y,x]);return(0,l.jsx)("table",{className:(0,s.cn)("diff-container",n?"dark-theme":"light-theme"),children:(0,l.jsx)("tbody",{children:v})})}function f({oldValue:e,newValue:t,splitView:n,useDarkTheme:s=!1,linesOffset:a=0,showDiffOnly:i=!0,extraLinesSurroundingDiff:o=3}){return n?(0,l.jsx)(r.Ay,{oldValue:e,newValue:t,splitView:!0,useDarkTheme:s,disableWordDiff:!0}):(0,l.jsx)(m,{oldValue:e,newValue:t,useDarkTheme:s,linesOffset:a,showDiffOnly:i,extraLinesSurroundingDiff:o})}},6534:(e,t,n)=>{n.d(t,{J:()=>a});var l=n(2115),s=n(696),r=n(8599);function a(e,t){let n=(0,s.GK)(e);(0,l.useEffect)(()=>{let l=e?n?(0,r.iu)(n):(0,r.kj)(e):"Workspace";document.title=`${l} | ${t}`},[e,n,t])}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71,167,171,177,218,267,429,504,507,645,748,799,819,833,851,896,916,988],{4441:()=>{}},_=>{_.O(0,[441,794,358],()=>_(_.s=4441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71,167,171,177,218,267,429,504,507,645,748,799,819,833,851,896,916,988],{4441:()=>{}},_=>{_.O(0,[441,794,358],()=>_(_.s=4441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71,167,171,177,218,267,429,504,507,645,748,799,819,833,851,896,916,988],{4441:()=>{}},_=>{_.O(0,[441,794,358],()=>_(_.s=4441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71,167,171,177,218,267,429,504,507,645,748,799,819,833,851,896,916,988],{4441:()=>{}},_=>{_.O(0,[441,794,358],()=>_(_.s=4441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71,167,171,177,218,267,429,504,507,645,748,799,819,833,851,896,916,988],{4441:()=>{}},_=>{_.O(0,[441,794,358],()=>_(_.s=4441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71,167,171,177,218,267,429,504,507,645,748,799,819,833,851,896,916,988],{4441:()=>{}},_=>{_.O(0,[441,794,358],()=>_(_.s=4441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71,167,171,177,218,267,429,504,507,645,748,799,819,833,851,896,916,988],{4441:()=>{}},_=>{_.O(0,[441,794,358],()=>_(_.s=4441)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71,167,171,177,218,267,429,504,507,645,748,799,819,833,851,896,916,988],{4441:()=>{}},_=>{_.O(0,[441,794,358],()=>_(_.s=4441)),_N_E=_.O()}]);
|