trident-git 0.5.1 → 0.10.0
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 +6 -6
- package/.next/build-manifest.json +3 -3
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.js +4 -4
- package/.next/required-server-files.json +4 -4
- package/.next/server/app/_global-error/page.js +3 -3
- 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.js +2 -2
- package/.next/server/app/_not-found/page.js.nft.json +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.js +1 -1
- package/.next/server/app/api/credentials/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/custom-scripts/route.js +2 -2
- package/.next/server/app/api/custom-scripts/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/open/route.js +1 -1
- package/.next/server/app/api/fs/open/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/open-terminal/route.js +1 -1
- package/.next/server/app/api/fs/open-terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/route.js +1 -1
- 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.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.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.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.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.js +1 -1
- package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next/server/app/credentials/page.js +2 -2
- package/.next/server/app/credentials/page.js.nft.json +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 +4 -4
- package/.next/server/app/credentials.segments/_full.segment.rsc +4 -4
- 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 +2 -2
- package/.next/server/app/credentials.segments/credentials.segment.rsc +1 -1
- package/.next/server/app/icon.png/route.js +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.js +3 -3
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace/changes/page.js +3 -3
- package/.next/server/app/workspace/changes/page.js.nft.json +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 -2
- package/.next/server/app/workspace/conflicts/page.js.nft.json +1 -1
- package/.next/server/app/workspace/conflicts/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspace/conflicts.html +1 -1
- package/.next/server/app/workspace/conflicts.rsc +6 -6
- package/.next/server/app/workspace/conflicts.segments/_full.segment.rsc +6 -6
- package/.next/server/app/workspace/conflicts.segments/_head.segment.rsc +1 -1
- package/.next/server/app/workspace/conflicts.segments/_index.segment.rsc +3 -3
- package/.next/server/app/workspace/conflicts.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/workspace/conflicts.segments/workspace/conflicts/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/workspace/conflicts.segments/workspace/conflicts.segment.rsc +1 -1
- package/.next/server/app/workspace/conflicts.segments/workspace.segment.rsc +3 -3
- package/.next/server/app/workspace/custom-scripts/page.js +2 -2
- package/.next/server/app/workspace/custom-scripts/page.js.nft.json +1 -1
- 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 +2 -2
- 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.js +2 -2
- package/.next/server/app/workspace/settings/page.js.nft.json +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.js +2 -2
- package/.next/server/app/workspace/stashes/page.js.nft.json +1 -1
- 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 +6 -6
- package/.next/server/chunks/116.js +1 -1
- package/.next/server/chunks/{386.js → 266.js} +1 -1
- package/.next/server/chunks/471.js +3 -3
- package/.next/server/chunks/725.js +4 -4
- package/.next/server/chunks/764.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/next-font-manifest.js +1 -1
- package/.next/server/next-font-manifest.json +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/446-4590c885aa3c0cf7.js +8 -0
- package/.next/static/chunks/app/_not-found/page-4c0a9d0b7f164692.js +1 -0
- package/.next/static/chunks/app/credentials/page-07fecc857743845b.js +1 -0
- package/.next/static/chunks/app/layout-3a89133183963c99.js +1 -0
- package/.next/static/chunks/app/{page-b6a88311748e2958.js → page-ebdbe7959d4d2112.js} +1 -1
- package/.next/static/chunks/app/workspace/changes/{page-332cb9b7837d465b.js → page-9cc0418e85135e2c.js} +1 -1
- package/.next/static/chunks/app/workspace/conflicts/page-310cc2e533418cb9.js +1 -0
- package/.next/static/chunks/app/workspace/custom-scripts/page-9efd46619d453d38.js +1 -0
- package/.next/static/chunks/app/workspace/{page-f7b05714b4e0eb2a.js → history/page-3ee1cf05f8f891fb.js} +1 -1
- package/.next/static/chunks/app/workspace/{layout-586ee7be4f6abf20.js → layout-75d987f016bdfce7.js} +1 -1
- package/.next/static/chunks/app/workspace/page-2533388880ae7887.js +1 -0
- package/.next/static/chunks/app/workspace/settings/page-d5ac0cd9f79beaf2.js +1 -0
- package/.next/static/chunks/app/workspace/stashes/{page-be8d99eec6bfb023.js → page-1996f32e07346504.js} +1 -1
- package/.next/static/chunks/{main-app-9697367bdd1cd307.js → main-app-8bead961b2b5992f.js} +1 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-75b91957b25dc110.js +1 -0
- package/.next/static/css/34464e853551fd25.css +1 -0
- package/README.md +19 -1
- package/package.json +5 -1
- package/.next/server/chunks/946.js +0 -1
- package/.next/static/chunks/446-93c95576ca9e5b50.js +0 -8
- package/.next/static/chunks/app/_not-found/page-57dae00b22f032ec.js +0 -1
- package/.next/static/chunks/app/credentials/page-98f6c498c4356393.js +0 -1
- package/.next/static/chunks/app/layout-dda593914e513c38.js +0 -1
- package/.next/static/chunks/app/workspace/conflicts/page-18af9ad0cb7d82fc.js +0 -1
- package/.next/static/chunks/app/workspace/custom-scripts/page-8948e627574c391b.js +0 -1
- package/.next/static/chunks/app/workspace/history/page-023ae7cc39ee9664.js +0 -1
- package/.next/static/chunks/app/workspace/settings/page-b42cabafb9d3c3fe.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/global-error-24e6fb8a3a0a87ef.js +0 -1
- package/.next/static/css/c4d257db89c36a31.css +0 -1
- /package/.next/static/{m-UCD7bYHUI6k3svPwOgO → l9uLuY-iXi6iaQyhMpyBw}/_buildManifest.js +0 -0
- /package/.next/static/{m-UCD7bYHUI6k3svPwOgO → l9uLuY-iXi6iaQyhMpyBw}/_ssgManifest.js +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
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"})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[492],{5419:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(9541)}])},5949:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HTTPAccessErrorFallback",{enumerable:!0,get:function(){return o}});let r=l(5155),n=l(7356);function o({status:e,message:t}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:`${e}: ${t}`}),(0,r.jsx)("div",{style:n.styles.error,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("style",{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)}}"}}),(0,r.jsx)("h1",{className:"next-error-h1",style:n.styles.h1,children:e}),(0,r.jsx)("div",{style:n.styles.desc,children:(0,r.jsx)("h2",{style:n.styles.h2,children:t})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7356:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"styles",{enumerable:!0,get:function(){return l}});let l={error:{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"},desc:{display:"inline-block"},h1:{display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},h2:{fontSize:14,fontWeight:400,lineHeight:"49px",margin:0}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9541:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=l(5155),n=l(5949),o=function(){return(0,r.jsx)("html",{children:(0,r.jsx)("body",{children:(0,r.jsx)(n.HTTPAccessErrorFallback,{status:404,message:"This page could not be found."})})})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},e=>{e.O(0,[441,794,358],()=>e(e.s=5419)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[871],{302:(e,s,t)=>{"use strict";t.d(s,{v:()=>c});var a=t(2115);let n=[],l=0,i=!1;function r(e){if("Escape"!==e.key)return;let s=n[n.length-1];s&&(e.preventDefault(),s.onEscape())}function c(e,s){let t=(0,a.useRef)(s);(0,a.useEffect)(()=>{t.current=s},[s]),(0,a.useEffect)(()=>{if(!e)return;let s=++l;return n.push({id:s,onEscape:()=>t.current()}),!i&&"u">typeof document&&(document.addEventListener("keydown",r),i=!0),()=>{let e=n.findIndex(e=>e.id===s);e>=0&&n.splice(e,1),i&&"u">typeof document&&!(n.length>0)&&(document.removeEventListener("keydown",r),i=!1)}},[e])}},3706:(e,s,t)=>{Promise.resolve().then(t.bind(t,4740))},4740:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>m});var a=t(5155),n=t(2115),l=t(7702),i=t(7651),r=t.n(i),c=t(8500),d=t.n(c),o=t(302);let u={github:"https://www.google.com/s2/favicons?domain=github.com&sz=64",gitlab:"https://www.google.com/s2/favicons?domain=gitlab.com&sz=64"};function x({type:e,size:s,className:t=""}){return(0,a.jsx)(r(),{src:u[e],alt:`${"github"===e?"GitHub":"GitLab"} icon`,width:s,height:s,className:t,unoptimized:!0})}function m(){let{data:e,isLoading:s,error:t}=(0,l.aX)(),i=(0,l.Lv)(),r=(0,l.sX)(),c=(0,l.Ii)(),[u,m]=(0,n.useState)(null),[b,p]=(0,n.useState)(null),[j,g]=(0,n.useState)(null),[N,f]=(0,n.useState)(""),[y,v]=(0,n.useState)(""),[w,k]=(0,n.useState)(!1),[E,C]=(0,n.useState)(null),S=()=>{m(null),p(null),f(""),v(""),k(!1),C(null)},L=e=>{S(),m(e)},G=async e=>{e.preventDefault(),C(null);try{b?await r.mutateAsync({id:b.id,token:N}):"github"===u?await i.mutateAsync({type:"github",token:N}):"gitlab"===u&&await i.mutateAsync({type:"gitlab",serverUrl:y,token:N}),S()}catch(e){C(e.message)}},F=async()=>{if(j)try{await c.mutateAsync(j.id),g(null)}catch(e){console.error("Failed to delete credential:",e)}},P=i.isPending||r.isPending;return(0,o.v)(null!==u,S),(0,o.v)(null!==j,()=>g(null)),(0,a.jsxs)("main",{className:"min-h-screen bg-base-100",children:[(0,a.jsxs)("div",{className:"container mx-auto max-w-4xl py-12 px-6",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-8",children:(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(d(),{href:"/",className:"btn btn-ghost btn-square",children:(0,a.jsx)("i",{className:"iconoir-arrow-left text-[20px]","aria-hidden":"true"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:"Credentials"}),(0,a.jsx)("p",{className:"text-sm opacity-70 mt-1",children:"Manage your remote repository credentials"})]})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-8",children:[(0,a.jsx)("div",{className:"card bg-base-100 shadow-lg hover:shadow-xl transition-shadow cursor-pointer border border-base-200",onClick:()=>L("github"),children:(0,a.jsxs)("div",{className:"card-body p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"p-2 bg-base-200 rounded-lg",children:(0,a.jsx)(x,{type:"github",size:24,className:"h-6 w-6 rounded-sm"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"card-title text-base",children:"GitHub"}),(0,a.jsx)("p",{className:"text-xs opacity-70",children:"Personal Access Token"})]})]}),(0,a.jsxs)("button",{className:"btn btn-sm w-full gap-2",children:[(0,a.jsx)("i",{className:"iconoir-plus text-[16px]","aria-hidden":"true"}),"Add GitHub"]})]})}),(0,a.jsx)("div",{className:"card bg-base-100 shadow-lg hover:shadow-xl transition-shadow cursor-pointer border border-base-200",onClick:()=>L("gitlab"),children:(0,a.jsxs)("div",{className:"card-body p-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,a.jsx)("div",{className:"p-2 bg-base-200 rounded-lg",children:(0,a.jsx)(x,{type:"gitlab",size:24,className:"h-6 w-6 rounded-sm"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"card-title text-base",children:"GitLab"}),(0,a.jsx)("p",{className:"text-xs opacity-70",children:"Server URL + Personal Access Token"})]})]}),(0,a.jsxs)("button",{className:"btn btn-sm w-full gap-2",children:[(0,a.jsx)("i",{className:"iconoir-plus text-[16px]","aria-hidden":"true"}),"Add GitLab Server"]})]})})]}),(0,a.jsxs)("div",{className:"border border-base-200 rounded-lg overflow-hidden bg-base-100",children:[(0,a.jsx)("div",{className:"px-6 py-3 bg-base-200/50 border-b border-base-200",children:(0,a.jsx)("h2",{className:"text-sm font-bold opacity-70",children:"Saved Credentials"})}),s?(0,a.jsxs)("div",{className:"p-12 text-center opacity-70",children:[(0,a.jsx)("span",{className:"loading loading-spinner"}),(0,a.jsx)("p",{className:"mt-2 text-sm",children:"Loading credentials..."})]}):t?(0,a.jsx)("div",{className:"p-12 text-center text-error",children:(0,a.jsx)("p",{children:"Failed to load credentials"})}):e?.length===0?(0,a.jsxs)("div",{className:"p-12 text-center opacity-50",children:[(0,a.jsx)("i",{className:"iconoir-key text-[40px] mx-auto","aria-hidden":"true"}),(0,a.jsx)("p",{className:"font-bold mt-2",children:"No credentials saved yet."}),(0,a.jsx)("p",{className:"text-xs mt-1",children:"Add your first credential using the cards above."})]}):(0,a.jsx)("div",{className:"divide-y divide-base-200",children:e?.map(e=>(0,a.jsx)(h,{credential:e,onEdit:()=>{p(e),m(e.type),f(""),"gitlab"===e.type&&v(e.serverUrl)},onDelete:()=>g(e)},e.id))})]})]}),null!==u&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box",children:[(0,a.jsx)("h3",{className:"font-bold text-lg flex items-center gap-2",children:"github"===u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x,{type:"github",size:20,className:"h-5 w-5 rounded-sm"}),"GitHub Credential"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x,{type:"gitlab",size:20,className:"h-5 w-5 rounded-sm"}),"GitLab Credential"]})}),(0,a.jsx)("p",{className:"py-4 text-sm opacity-70",children:b?"Enter a new personal access token to update this credential.":"github"===u?"Enter your GitHub personal access token. This will be stored securely in your system keychain.":"Enter your GitLab server URL and personal access token."}),(0,a.jsxs)("form",{onSubmit:G,className:"flex flex-col gap-4",children:["gitlab"===u&&!b&&(0,a.jsxs)("div",{className:"form-control w-full",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Server URL"})}),(0,a.jsx)("input",{type:"url",placeholder:"https://gitlab.example.com",value:y,onChange:e=>v(e.target.value),required:!0,className:"input input-bordered w-full",autoFocus:!0}),(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"Enter the full URL of your GitLab server"})})]}),"gitlab"===u&&b&&(0,a.jsxs)("div",{className:"form-control w-full",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Server URL"})}),(0,a.jsxs)("div",{className:"p-3 bg-base-200 rounded-lg text-sm font-mono flex items-center gap-2 min-w-0 break-all",children:[(0,a.jsx)(x,{type:"gitlab",size:16,className:"h-4 w-4 shrink-0 rounded-sm"}),b.serverUrl]})]}),(0,a.jsxs)("div",{className:"form-control w-full",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Personal Access Token"})}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:w?"text":"password",placeholder:b?"Enter new token":"ghp_xxxxxxxxxxxx or glpat-xxxxx",value:N,onChange:e=>f(e.target.value),className:"input input-bordered w-full pr-10",required:!0,autoFocus:!("gitlab"===u&&!b)}),(0,a.jsx)("button",{type:"button",className:"absolute right-2 top-2 btn btn-ghost btn-xs btn-square",onClick:()=>k(!w),children:w?(0,a.jsx)("i",{className:"iconoir-eye-closed text-[16px]","aria-hidden":"true"}):(0,a.jsx)("i",{className:"iconoir-eye text-[16px]","aria-hidden":"true"})})]}),(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text-alt opacity-70",children:"github"===u?(0,a.jsxs)(a.Fragment,{children:["Token needs repo scope."," ",(0,a.jsx)("a",{href:"https://github.com/settings/tokens/new?description=Trident&scopes=repo,user,notifications,workflow",target:"_blank",rel:"noreferrer",className:"link link-primary",children:"Create new token"})]}):"Token needs api scope for GitLab access"})})]}),E&&(0,a.jsx)("div",{className:"alert alert-error text-sm",children:(0,a.jsx)("span",{children:E})}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{type:"button",className:"btn",onClick:S,disabled:P,children:"Cancel"}),(0,a.jsxs)("button",{type:"submit",className:"btn btn-primary",disabled:P,children:[P&&(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),b?"Update":"Verify & Save"]})]})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:S,children:"close"})})]}),null!==j&&(0,a.jsxs)("dialog",{className:"modal modal-open",children:[(0,a.jsxs)("div",{className:"modal-box",children:[(0,a.jsx)("h3",{className:"font-bold text-lg",children:"Delete Credential"}),(0,a.jsxs)("p",{className:"py-4 break-words",children:["Are you sure you want to delete this ",j?.type==="github"?"GitHub":"GitLab"," ","credential for ",(0,a.jsx)("strong",{className:"break-all",children:j?.username}),"? This action cannot be undone."]}),(0,a.jsxs)("div",{className:"modal-action",children:[(0,a.jsx)("button",{className:"btn",onClick:()=>g(null),children:"Cancel"}),(0,a.jsxs)("button",{className:"btn btn-error",onClick:F,disabled:c.isPending,children:[c.isPending&&(0,a.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Delete"]})]})]}),(0,a.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,a.jsx)("button",{onClick:()=>g(null),children:"close"})})]})]})}function h({credential:e,onEdit:s,onDelete:t}){let n="gitlab"===e.type;return(0,a.jsxs)("div",{className:"px-6 py-4 flex items-center justify-between hover:bg-base-200/30 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"p-2 bg-base-200 rounded-lg",children:n?(0,a.jsx)(x,{type:"gitlab",size:20,className:"h-5 w-5 rounded-sm"}):(0,a.jsx)(x,{type:"github",size:20,className:"h-5 w-5 rounded-sm"})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-bold text-sm",children:n?"GitLab":"GitHub"}),n&&(0,a.jsx)("span",{className:"text-xs opacity-70 font-mono bg-base-200 px-1.5 py-0.5 rounded",children:e.serverUrl.replace(/^https?:\/\//,"")})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 text-xs opacity-70 mt-1",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("i",{className:"iconoir-user text-[14px]","aria-hidden":"true"}),e.username]}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("i",{className:"iconoir-calendar text-[14px]","aria-hidden":"true"}),new Date(e.updatedAt).toLocaleDateString()]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:s,title:"Edit",children:(0,a.jsx)("i",{className:"iconoir-edit-pencil text-[16px]","aria-hidden":"true"})}),(0,a.jsx)("button",{className:"btn btn-ghost btn-sm btn-square text-error hover:bg-error/10",onClick:t,title:"Delete",children:(0,a.jsx)("i",{className:"iconoir-trash text-[16px]","aria-hidden":"true"})})]})]})}},7651:(e,s,t)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0});var a={default:function(){return o},getImageProps:function(){return d}};for(var n in a)Object.defineProperty(s,n,{enumerable:!0,get:a[n]});let l=t(3623),i=t(5413),r=t(8437),c=l._(t(6095));function d(e){let{props:s}=(0,i.getImgProps)(e,{defaultLoader:c.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,t]of Object.entries(s))void 0===t&&delete s[e];return{props:s}}let o=r.Image},7702:(e,s,t)=>{"use strict";t.d(s,{Ii:()=>m,Lv:()=>d,aX:()=>r,sX:()=>u});var a=t(4109),n=t(5625),l=t(8934);async function i(){let e=await fetch("/api/credentials");if(!e.ok)throw Error("Failed to fetch credentials");return e.json()}function r(){return(0,a.I)({queryKey:["credentials"],queryFn:i})}async function c(e){let s=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await s.json();if(!s.ok)throw Error(t.error||"Failed to create credential");return t}function d(){let e=(0,n.jE)();return(0,l.n)({mutationFn:c,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function o(e){let s=await fetch("/api/credentials",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),t=await s.json();if(!s.ok)throw Error(t.error||"Failed to update credential");return t}function u(){let e=(0,n.jE)();return(0,l.n)({mutationFn:o,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function x(e){let s=await fetch("/api/credentials",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}),t=await s.json();if(!s.ok)throw Error(t.error||"Failed to delete credential")}function m(){let e=(0,n.jE)();return(0,l.n)({mutationFn:x,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}}},e=>{e.O(0,[176,500,437,441,794,358],()=>e(e.s=3706)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[558],{302:(e,t,s)=>{"use strict";s.d(t,{v:()=>o});var n=s(2115);let a=[],r=0,l=!1;function i(e){if("Escape"!==e.key)return;let t=a[a.length-1];t&&(e.preventDefault(),t.onEscape())}function o(e,t){let s=(0,n.useRef)(t);(0,n.useEffect)(()=>{s.current=t},[t]),(0,n.useEffect)(()=>{if(!e)return;let t=++r;return a.push({id:t,onEscape:()=>s.current()}),!l&&"u">typeof document&&(document.addEventListener("keydown",i),l=!0),()=>{let e=a.findIndex(e=>e.id===t);e>=0&&a.splice(e,1),l&&"u">typeof document&&!(a.length>0)&&(document.removeEventListener("keydown",i),l=!1)}},[e])}},1743:()=>{},2246:(e,t,s)=>{"use strict";s.d(t,{Providers:()=>x});var n=s(5155),a=s(6887),r=s(5625),l=s(2115),i=s(460),o=s(6695);function c(){let{toasts:e}=(0,o.dj)(),[t,s]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{s(!0)},[]),t)?(0,n.jsx)("div",{className:"toast toast-bottom toast-end z-50 p-4 gap-2",children:e.map(e=>{let t="alert-info";return"success"===e.type?t="alert-success":"warning"===e.type||"warning"===e.variant?t="alert-warning":("error"===e.type||"destructive"===e.variant)&&(t="alert-error"),(0,n.jsxs)("div",{className:`alert ${t} shadow-lg max-w-md w-auto flex-col items-start gap-1 p-3 text-sm animate-in fade-in slide-in-from-bottom-2 duration-300`,children:[(0,n.jsxs)("div",{className:"w-full",children:[e.title&&(0,n.jsx)("h3",{className:"font-bold",children:e.title}),e.description&&(0,n.jsx)("div",{className:"opacity-90 break-words",children:e.description})]}),e.action&&(0,n.jsx)("div",{className:"mt-2 w-full",children:e.action})]},e.id)})}):null}var d=s(3321),u=s(696),p=s(8599),m=s(302);function h(e,t){return new Date(t.lastOpenedAt||0).getTime()-new Date(e.lastOpenedAt||0).getTime()}function f(){let e=(0,d.useRouter)(),{data:t}=(0,u.uG)(),[s,a]=(0,l.useState)(!1),[r,i]=(0,l.useState)(""),[o,c]=(0,l.useState)(0),f=(0,l.useRef)(null),x=(0,l.useMemo)(()=>(t||[]).filter(e=>!!e.lastOpenedAt).sort(h).slice(0,5),[t]),v=(0,l.useMemo)(()=>{let e=r.trim().toLowerCase();return e?x.filter(t=>{let s=(0,p.iu)(t).toLowerCase(),n=t.path.toLowerCase();return s.includes(e)||n.includes(e)}):x},[r,x]),w=(0,l.useCallback)(()=>{a(!1),i(""),c(0)},[]),b=0===v.length?-1:Math.min(o,v.length-1),y=(0,l.useCallback)(t=>{w(),e.push(`/workspace?path=${encodeURIComponent(t)}`)},[w,e]);return((0,l.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()&&(e.preventDefault(),a(!0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,m.v)(s,w),(0,l.useEffect)(()=>{s&&requestAnimationFrame(()=>f.current?.focus())},[s]),s)?(0,n.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40 px-4 py-16",onMouseDown:w,role:"dialog","aria-modal":"true","aria-label":"Command palette",children:(0,n.jsxs)("div",{className:"mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-base-300 bg-base-100 shadow-2xl",onMouseDown:e=>e.stopPropagation(),children:[(0,n.jsx)("div",{className:"border-b border-base-300 p-3",children:(0,n.jsx)("input",{ref:f,type:"text",value:r,onChange:e=>{i(e.target.value),c(0)},onKeyDown:e=>{if("ArrowDown"===e.key){e.preventDefault(),v.length>0&&c(e=>(e+1)%v.length);return}if("ArrowUp"===e.key){e.preventDefault(),v.length>0&&c(e=>e<=0?v.length-1:e-1);return}if("Enter"===e.key){e.preventDefault();let t=b>=0?v[b]:null;t&&y(t.path)}},placeholder:"Type a command...",className:"input input-ghost w-full text-base focus:outline-none"})}),(0,n.jsxs)("div",{className:"max-h-80 overflow-y-auto py-2",children:[(0,n.jsx)("div",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider opacity-60",children:"Recent repositories"}),0===x.length&&(0,n.jsx)("div",{className:"px-4 py-6 text-sm opacity-60",children:"No recently opened repositories yet."}),x.length>0&&0===v.length&&(0,n.jsx)("div",{className:"px-4 py-6 text-sm opacity-60",children:"No matching repositories."}),v.map((e,t)=>{let s=(0,p.iu)(e);return(0,n.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full items-center justify-between gap-4 px-4 py-3 text-left",b===t?"bg-base-200":"hover:bg-base-200/70"),onMouseEnter:()=>c(t),onClick:()=>y(e.path),children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"truncate text-sm font-medium",children:s}),(0,n.jsx)("div",{className:"truncate text-xs opacity-65",children:e.path})]}),(0,n.jsx)("span",{className:"text-xs opacity-60",children:"Open"})]},e.path)})]}),(0,n.jsx)("div",{className:"border-t border-base-300 px-4 py-2 text-xs opacity-60",children:"Use ↑ ↓ to navigate, Enter to open, Esc to close."})]})}):null}function x({children:e}){let[t]=(0,l.useState)(()=>new a.E);return(0,n.jsx)(r.Ht,{client:t,children:(0,n.jsxs)(i.N,{attribute:"data-theme",defaultTheme:"system",enableSystem:!0,children:[e,(0,n.jsx)(f,{}),(0,n.jsx)(c,{})]})})}},5205:(e,t,s)=>{Promise.resolve().then(s.t.bind(s,421,23)),Promise.resolve().then(s.t.bind(s,9695,23)),Promise.resolve().then(s.t.bind(s,1743,23)),Promise.resolve().then(s.bind(s,2246))}},e=>{e.O(0,[293,334,176,785,200,26,441,794,358],()=>e(e.s=5205)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[612],{3280:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>f});var n=t(5155),l=t(3321),a=t(2115),r=t(6534),i=t(696),c=t(8599),d=t(6695),o=t(6162),u=t(460);function x(e){return"merge"===e?"Merge":"rebase"===e?"Rebase":"Conflict"}function m({filePath:e,versions:s,isBinary:t,onResolve:l,busy:r}){let[i,c]=(0,a.useState)(s.current||s.ours||s.theirs||""),{resolvedTheme:d}=(0,u.D)();return t?(0,n.jsxs)("div",{className:"h-full p-6 flex flex-col gap-4",children:[(0,n.jsx)("h2",{className:"text-lg font-bold",children:"Binary Conflict"}),(0,n.jsx)("p",{className:"text-sm opacity-70",children:"This conflicted file looks binary. Use one side to resolve it."}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{className:"btn btn-sm",onClick:()=>l("ours",{stage:!0}),disabled:r,children:"Use Ours"}),(0,n.jsx)("button",{className:"btn btn-sm",onClick:()=>l("theirs",{stage:!0}),disabled:r,children:"Use Theirs"})]})]}):(0,n.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[(0,n.jsxs)("div",{className:"px-4 py-3 border-b border-base-300 bg-base-100 flex items-center justify-between gap-3",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"text-xs uppercase tracking-wider opacity-60",children:"Resolving"}),(0,n.jsx)("div",{className:"font-mono text-xs truncate",title:e,children:e})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{className:"btn btn-xs",onClick:()=>c(s.ours),disabled:r,children:"Copy Ours"}),(0,n.jsx)("button",{className:"btn btn-xs",onClick:()=>c(s.theirs),disabled:r,children:"Copy Theirs"}),(0,n.jsx)("button",{className:"btn btn-xs btn-outline",onClick:()=>void l("manual",{content:i,stage:!1}),disabled:r,children:"Save"}),(0,n.jsx)("button",{className:"btn btn-xs btn-primary",onClick:()=>void l("manual",{content:i,stage:!0}),disabled:r,children:"Save + Stage"})]})]}),(0,n.jsxs)("div",{className:"flex-1 min-h-0 border-b border-base-300 flex flex-col",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-0 border-b border-base-300",children:[(0,n.jsx)("div",{className:"px-3 py-2 text-xs font-bold uppercase tracking-wider bg-base-200/60 border-r border-base-300",children:"Ours"}),(0,n.jsx)("div",{className:"px-3 py-2 text-xs font-bold uppercase tracking-wider bg-base-200/60",children:"Theirs"})]}),(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-auto diff-viewer-wrapper",children:(0,n.jsx)(o.O,{oldValue:s.ours,newValue:s.theirs,splitView:!0,useDarkTheme:"dark"===d,showDiffOnly:!1})})]}),(0,n.jsxs)("div",{className:"flex-[1.2] min-h-0 flex flex-col",children:[(0,n.jsx)("div",{className:"px-3 py-2 text-xs font-bold uppercase tracking-wider bg-base-200/60 border-b border-base-300",children:"Resolved (Editable)"}),(0,n.jsx)("textarea",{value:i,onChange:e=>c(e.target.value),className:"textarea textarea-ghost h-full w-full rounded-none resize-none font-mono text-xs leading-5",spellCheck:!1})]}),(0,n.jsxs)("div",{className:"px-4 py-2 border-t border-base-300 bg-base-100 flex items-center justify-end gap-2",children:[(0,n.jsx)("button",{className:"btn btn-sm",onClick:()=>void l("ours",{stage:!0}),disabled:r,children:"Use Ours + Stage"}),(0,n.jsx)("button",{className:"btn btn-sm",onClick:()=>void l("theirs",{stage:!0}),disabled:r,children:"Use Theirs + Stage"})]})]})}function b({repoPath:e}){let s=(0,l.useRouter)(),t=(0,l.useSearchParams)(),{data:r,isLoading:o,isError:u,error:b,refetch:h}=(0,i.en)(e),{data:f,isLoading:p,isError:g,error:N,refetch:j}=(0,i.F7)(e),{mutateAsync:v,isPending:y}=(0,i.a3)(),[k,w]=(0,a.useState)(null),C=r?.conflicted??[],E=new Set(C),D=(r?.files??[]).filter(e=>!E.has(e.path)&&" "===e.index&&" "!==e.working_dir).map(e=>e.path),$=(r?.files??[]).filter(e=>!E.has(e.path)&&" "!==e.index).map(e=>e.path),L=k&&C.includes(k)?k:C[0]??null,{data:S,isLoading:O,isError:R,error:A,refetch:M}=(0,i.b5)(e,L),T=f?.operation??null,V=(0,a.useCallback)((e="")=>{let s=new URLSearchParams(t.toString()).toString();return s?`/workspace${e}?${s}`:`/workspace${e}`},[t]),Y=(0,a.useCallback)(async()=>{await Promise.all([h(),j(),M()])},[j,h,M]),U=async(s,t,n={})=>{await v({repoPath:e,action:"resolve-conflict-file",data:{path:s,strategy:t,content:n.content,stage:n.stage??!0}}),await Y(),(0,d.oR)({type:"success",title:"Conflict Updated",description:"manual"===t?!1===n.stage?"Saved manual resolution.":"Saved and staged manual resolution.":`Applied ${t} version${!1===n.stage?"":" and staged it"}.`})},P=async s=>{await v({repoPath:e,action:"stage",data:{files:[s]}}),await Y()},F=async()=>{let t="rebase"===T?"abort-rebase":"merge"===T?"abort-merge":null;t&&(await v({repoPath:e,action:t}),(0,d.oR)({type:"info",title:`${x(T)} Aborted`,description:`The ${x(T).toLowerCase()} operation was aborted.`}),s.push(V()))},I=async()=>{let t="rebase"===T?"continue-rebase":"merge"===T?"continue-merge":null;t&&(await v({repoPath:e,action:t}),(0,d.oR)({type:"success",title:`${x(T)} Completed`,description:`${x(T)} continued successfully.`}),s.push(V()))};if(o||p)return(0,n.jsx)("div",{className:"flex items-center justify-center h-64",children:(0,n.jsx)("span",{className:"loading loading-spinner text-base-content/50"})});if(u||g)return(0,n.jsxs)("div",{className:"flex items-center justify-center h-64 flex-col gap-4",children:[(0,n.jsx)("p",{className:"text-error font-bold",children:"Error Loading Conflicts"}),(0,n.jsx)("p",{className:"text-sm opacity-70",children:b?.message||N?.message||"An unknown error occurred"}),(0,n.jsxs)("button",{onClick:()=>void Y(),className:"btn btn-outline btn-sm",disabled:y,children:[(0,n.jsx)("i",{className:"iconoir-refresh-circle text-[16px] mr-1","aria-hidden":"true"}),"Try Again"]})]});let _=!!T,B=C.length>0,J=!!f?.canContinue&&_,W=!!L&&(0,c.kO)(L,S?.ours,S?.theirs||S?.current);return(0,n.jsxs)("div",{className:"flex h-full overflow-hidden",children:[(0,n.jsxs)("div",{className:"w-80 border-r border-base-300 flex flex-col bg-base-200/30",children:[(0,n.jsxs)("div",{className:"h-[57px] px-4 border-b border-base-300 flex items-center justify-between bg-base-100",children:[(0,n.jsx)("h1",{className:"font-bold text-lg",children:"Conflicts"}),(0,n.jsx)("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>void Y(),disabled:y,title:"Refresh",children:(0,n.jsx)("i",{className:"iconoir-refresh-circle text-[16px]","aria-hidden":"true"})})]}),(0,n.jsxs)("div",{className:"p-4 border-b border-base-300 space-y-2",children:[(0,n.jsx)("div",{className:"text-xs opacity-70",children:"Operation"}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:(0,c.cn)("badge",_?"badge-warning":"badge-ghost"),children:_?x(T):"None"}),(0,n.jsx)("span",{className:(0,c.cn)("badge",B?"badge-error":"badge-success"),children:B?`${C.length} unresolved`:"No unresolved"})]})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto p-2",children:[(0,n.jsx)("div",{className:"px-2 py-2 text-xs font-bold uppercase tracking-wider opacity-70",children:"Unresolved Files"}),(0,n.jsxs)("div",{className:"space-y-0.5",children:[0===C.length&&(0,n.jsx)("p",{className:"px-2 py-2 text-xs opacity-50 italic",children:"No unresolved conflicts."}),C.map(e=>(0,n.jsxs)("div",{className:(0,c.cn)("rounded-md border border-transparent",L===e&&"bg-base-300 border-base-300"),children:[(0,n.jsxs)("button",{className:(0,c.cn)("w-full text-left flex items-center gap-2 px-2 py-2 rounded-md text-sm hover:bg-base-300 transition-colors",L===e&&"text-primary font-medium"),onClick:()=>w(e),title:e,children:[(0,n.jsx)("i",{className:"iconoir-warning-triangle text-[14px] text-error shrink-0","aria-hidden":"true"}),(0,n.jsx)("span",{className:"truncate font-mono text-xs",children:e})]}),(0,n.jsxs)("div",{className:"px-2 pb-2 flex items-center gap-1",children:[(0,n.jsx)("button",{className:"btn btn-xs",onClick:()=>void U(e,"ours",{stage:!0}),disabled:y,children:"Ours"}),(0,n.jsx)("button",{className:"btn btn-xs",onClick:()=>void U(e,"theirs",{stage:!0}),disabled:y,children:"Theirs"})]})]},e))]}),D.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"h-px bg-base-300 mx-2 my-3"}),(0,n.jsx)("div",{className:"px-2 py-2 text-xs font-bold uppercase tracking-wider opacity-70",children:"Ready to Stage"}),(0,n.jsx)("div",{className:"space-y-1",children:D.map(e=>(0,n.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-base-100 border border-base-300",children:[(0,n.jsx)("span",{className:"truncate font-mono text-xs flex-1",title:e,children:e}),(0,n.jsx)("button",{className:"btn btn-xs btn-success",onClick:()=>void P(e),disabled:y,title:"Stage as resolved",children:"Stage"})]},e))})]}),$.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"h-px bg-base-300 mx-2 my-3"}),(0,n.jsx)("div",{className:"px-2 py-2 text-xs font-bold uppercase tracking-wider opacity-70",children:"Staged Resolutions"}),(0,n.jsx)("div",{className:"space-y-1",children:$.map(e=>(0,n.jsx)("div",{className:"px-2 py-1.5 rounded-md bg-success/10 border border-success/20",children:(0,n.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})},e))})]})]}),(0,n.jsx)("div",{className:"border-t border-base-300 p-3 space-y-2",children:(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,n.jsx)("button",{className:"btn btn-primary btn-sm",onClick:()=>void I(),disabled:!J||y,children:"Continue"}),(0,n.jsx)("button",{className:"btn btn-error btn-outline btn-sm",onClick:()=>void F(),disabled:!_||y,children:"Abort"})]})})]}),(0,n.jsx)("div",{className:"flex-1 flex flex-col bg-base-100 overflow-hidden",children:L?O?(0,n.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,n.jsx)("span",{className:"loading loading-spinner"})}):R||!S?(0,n.jsxs)("div",{className:"flex-1 flex items-center justify-center flex-col gap-3",children:[(0,n.jsx)("p",{className:"text-error font-bold",children:"Failed to load file versions"}),(0,n.jsx)("p",{className:"text-xs opacity-70",children:A?.message||"Unknown error"}),(0,n.jsx)("button",{className:"btn btn-sm btn-outline",onClick:()=>void M(),children:"Retry"})]}):(0,n.jsx)(m,{filePath:L,versions:S,isBinary:W,onResolve:(e,s)=>U(L,e,s),busy:y},`${L}:${S.ours.length}:${S.theirs.length}:${S.current.length}`):(0,n.jsx)("div",{className:"flex-1 flex items-center justify-center opacity-60",children:(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"p-8 rounded-full bg-base-200 mb-4 text-4xl mx-auto w-fit",children:(0,n.jsx)("i",{className:"iconoir-warning-triangle text-[32px]","aria-hidden":"true"})}),(0,n.jsx)("p",{className:"text-sm font-bold",children:"Select a conflicted file to resolve"}),(0,n.jsx)("p",{className:"text-xs opacity-70 mt-2",children:"Pick ours/theirs or edit manually."})]})})})]})}function h(){let e=(0,l.useSearchParams)().get("path");return((0,r.J)(e,"Conflicts"),e)?(0,n.jsx)(b,{repoPath:e}):(0,n.jsx)("div",{className:"p-8",children:"No repository path specified."})}function f(){return(0,n.jsx)(a.Suspense,{fallback:(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("span",{className:"loading loading-spinner"})}),children:(0,n.jsx)(h,{})})}},6162:(e,s,t)=>{"use strict";t.d(s,{O:()=>m});var n=t(5155),l=t(8599),a=t(1425),r=t(4786);t(9413);var i=t(2115);let c=[];function d(e){return e.left?.type===r.sY.REMOVED&&e.right?.type===r.sY.ADDED}function o(e){return"string"==typeof e&&e.length>0?e:" "}function u(e){let s=e.type===r.sY.ADDED,t=e.type===r.sY.REMOVED;return(0,n.jsxs)("tr",{className:"line",children:[(0,n.jsx)("td",{className:(0,l.cn)("gutter",{"empty-gutter":null===e.leftLineNumber,"diff-added":s,"diff-removed":t}),children:(0,n.jsx)("pre",{className:"line-number",children:e.leftLineNumber??""})}),(0,n.jsx)("td",{className:(0,l.cn)("gutter",{"empty-gutter":null===e.rightLineNumber,"diff-added":s,"diff-removed":t}),children:(0,n.jsx)("pre",{className:"line-number",children:e.rightLineNumber??""})}),(0,n.jsx)("td",{className:(0,l.cn)("marker",{"diff-added":s,"diff-removed":t}),children:(0,n.jsx)("pre",{children:s?"+":t?"-":""})}),(0,n.jsx)("td",{className:(0,l.cn)("content",{"diff-added":s,"diff-removed":t}),children:(0,n.jsx)("pre",{className:"content-text",children:e.value})})]},e.key)}function x({oldValue:e,newValue:s,useDarkTheme:t=!1,linesOffset:a=0,showDiffOnly:x=!0,extraLinesSurroundingDiff:m=3}){let[b,h]=(0,i.useState)({signature:"",blocks:[]}),f=(0,i.useMemo)(()=>`${a}:${+!!x}:${m}:${e}\0${s}`,[e,s,a,x,m]),p=(0,i.useMemo)(()=>b.signature===f?b.blocks:c,[b,f]),{lineInformation:g}=(0,i.useMemo)(()=>(0,r.sO)(e,s,!0,void 0,a),[e,s,a]),N=(0,i.useMemo)(()=>{let e=[];return g.forEach((s,t)=>{(s.left?.type!==r.sY.DEFAULT||s.right?.type!==r.sY.DEFAULT)&&e.push(t)}),e},[g]),j=(0,i.useMemo)(()=>{if(0===g.length)return[];if(!x||0===N.length)return g.map((e,s)=>({type:"line",line:e,sourceIndex:s}));let e=Math.max(0,m),s=Array.from({length:g.length},()=>!1);N.forEach(t=>{let n=Math.max(0,t-e),l=Math.min(g.length-1,t+e);for(let e=n;e<=l;e+=1)s[e]=!0});for(let e=0;e<s.length;e+=1){if(s[e])continue;let t=e;for(;e<s.length&&!s[e];)e+=1;if(p.includes(t))for(let n=t;n<e;n+=1)s[n]=!0;e-=1}let t=[];for(let e=0;e<s.length;e+=1){if(s[e]){t.push({type:"line",line:g[e],sourceIndex:e});continue}let n=e;for(;e<s.length&&!s[e];)e+=1;t.push({type:"fold",foldStartIndex:n,totalLines:e-n}),e-=1}return t},[g,N,x,m,p]),v=(0,i.useMemo)(()=>{let e=[];for(let s=0;s<j.length;s+=1){let t=j[s];if("fold"===t.type){e.push((0,n.jsxs)("tr",{className:"code-fold",children:[(0,n.jsx)("td",{className:"code-fold-gutter"}),(0,n.jsx)("td",{className:"code-fold-gutter"}),(0,n.jsx)("td",{}),(0,n.jsx)("td",{children:(0,n.jsx)("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{h(e=>{let s=e.signature===f?e.blocks:[];return s.includes(t.foldStartIndex)?e.signature===f?e:{signature:f,blocks:s}:{signature:f,blocks:[...s,t.foldStartIndex]}})},children:(0,n.jsxs)("pre",{className:"code-fold-content",children:["Expand ",t.totalLines," lines ..."]})})})]},`fold-${t.foldStartIndex}`));continue}if(d(t.line)){let t=[],n=[],l=s;for(;l<j.length;){let e=j[l];if("line"!==e.type||!d(e.line))break;t.push({key:`line-${e.sourceIndex}-paired-removed`,type:r.sY.REMOVED,leftLineNumber:e.line.left?.lineNumber??null,rightLineNumber:null,value:o(e.line.left?.value)}),n.push({key:`line-${e.sourceIndex}-paired-added`,type:r.sY.ADDED,leftLineNumber:null,rightLineNumber:e.line.right?.lineNumber??null,value:o(e.line.right?.value)}),l+=1}t.forEach(s=>{e.push(u(s))}),n.forEach(s=>{e.push(u(s))}),s=l-1;continue}e.push(u(function(e,s){let t=e.left??{},n=e.right??{};return t.type===r.sY.REMOVED?{key:`line-${s}-removed`,type:r.sY.REMOVED,leftLineNumber:t.lineNumber??null,rightLineNumber:null,value:o(t.value)}:n.type===r.sY.ADDED?{key:`line-${s}-added`,type:r.sY.ADDED,leftLineNumber:null,rightLineNumber:n.lineNumber??null,value:o(n.value)}:{key:`line-${s}-default`,type:r.sY.DEFAULT,leftLineNumber:t.lineNumber??null,rightLineNumber:n.lineNumber??null,value:o(t.value??n.value)}}(t.line,t.sourceIndex)))}return e},[j,f]);return(0,n.jsx)("table",{className:(0,l.cn)("diff-container",t?"dark-theme":"light-theme"),children:(0,n.jsx)("tbody",{children:v})})}function m({oldValue:e,newValue:s,splitView:t,useDarkTheme:l=!1,linesOffset:r=0,showDiffOnly:i=!0,extraLinesSurroundingDiff:c=3}){return t?(0,n.jsx)(a.Ay,{oldValue:e,newValue:s,splitView:!0,useDarkTheme:l,disableWordDiff:!0}):(0,n.jsx)(x,{oldValue:e,newValue:s,useDarkTheme:l,linesOffset:r,showDiffOnly:i,extraLinesSurroundingDiff:c})}},6534:(e,s,t)=>{"use strict";t.d(s,{J:()=>r});var n=t(2115),l=t(696),a=t(8599);function r(e,s){let t=(0,l.GK)(e);(0,n.useEffect)(()=>{let n=e?t?(0,a.iu)(t):(0,a.kj)(e):"Workspace";document.title=`${n} | ${s}`},[e,t,s])}},7621:(e,s,t)=>{Promise.resolve().then(t.bind(t,3280))}},e=>{e.O(0,[508,176,785,841,26,441,794,358],()=>e(e.s=7621)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[943],{6534:(e,s,t)=>{"use strict";t.d(s,{J:()=>r});var a=t(2115),l=t(696),n=t(8599);function r(e,s){let t=(0,l.GK)(e);(0,a.useEffect)(()=>{let a=e?t?(0,n.iu)(t):(0,n.kj)(e):"Workspace";document.title=`${a} | ${s}`},[e,t,s])}},7443:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>o});var a=t(5155),l=t(2115),n=t(3321),r=t(6534),c=t(696);let i={name:"",target:"branch",action:"run-bash-script",content:""};function d(){let e=(0,n.useSearchParams)().get("path");(0,r.J)(e,"Custom scripts");let{isLoading:s}=(0,c.uG)(),t=(0,c.GK)(e),d=(0,c.Lp)(),o=(0,l.useMemo)(()=>t?.customScripts??[],[t?.customScripts]),[m,h]=(0,l.useState)(null),[u,p]=(0,l.useState)(i),[x,b]=(0,l.useState)(null);if(s)return(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsx)("span",{className:"loading loading-spinner"})});if(!e||!t)return(0,a.jsx)("div",{className:"p-8",children:"Repository not found."});let j=()=>{p(i),h(null),b(null)},N=s=>{d.mutate({path:e,updates:{customScripts:s}})};return(0,a.jsxs)("div",{className:"p-8 max-w-4xl mx-auto space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold",children:"Custom Scripts"}),(0,a.jsx)("p",{className:"text-sm opacity-70 mt-2",children:"Manage custom bash scripts for this repository. Scripts appear in branch context menus."})]}),(0,a.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,a.jsxs)("div",{className:"card-body",children:[(0,a.jsx)("h2",{className:"card-title",children:m?"Edit Script":"New Script"}),(0,a.jsxs)("form",{className:"space-y-4",onSubmit:e=>{e.preventDefault();let s=u.name.trim(),t=u.content;if(!s)return void b("Script name is required.");if(!t.trim())return void b("Script content is required.");let a={id:m||("u">typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`script-${Date.now()}-${Math.random().toString(36).slice(2,8)}`),name:s,target:u.target,action:u.action,content:t};N(m?o.map(e=>e.id===m?a:e):[...o,a]),j()},children:[(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Name"})}),(0,a.jsx)("input",{type:"text",className:"input input-bordered w-full",value:u.name,onChange:e=>p(s=>({...s,name:e.target.value})),placeholder:"Example: Run tests"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Target"})}),(0,a.jsx)("select",{className:"select select-bordered w-full",value:u.target,onChange:e=>p(s=>({...s,target:e.target.value})),children:(0,a.jsx)("option",{value:"branch",children:"Branch"})})]}),(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Action"})}),(0,a.jsx)("select",{className:"select select-bordered w-full",value:u.action,onChange:e=>p(s=>({...s,action:e.target.value})),children:(0,a.jsx)("option",{value:"run-bash-script",children:"Run bash script"})})]})]}),(0,a.jsxs)("div",{className:"form-control",children:[(0,a.jsx)("label",{className:"label",children:(0,a.jsx)("span",{className:"label-text",children:"Script Content"})}),(0,a.jsx)("textarea",{className:"textarea textarea-bordered w-full h-56 font-mono text-sm",value:u.content,onChange:e=>p(s=>({...s,content:e.target.value})),placeholder:'#!/usr/bin/env bash\nset -euo pipefail\n\necho "Hello from custom script"'})]}),x&&(0,a.jsx)("div",{className:"alert alert-error py-2",children:(0,a.jsx)("span",{children:x})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"submit",className:"btn btn-primary btn-sm",disabled:d.isPending,children:m?"Update Script":"Add Script"}),m&&(0,a.jsx)("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:j,disabled:d.isPending,children:"Cancel Edit"})]})]})]})}),(0,a.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,a.jsxs)("div",{className:"card-body",children:[(0,a.jsx)("h2",{className:"card-title",children:"Saved Scripts"}),0===o.length?(0,a.jsx)("p",{className:"text-sm opacity-60",children:"No custom scripts yet."}):(0,a.jsx)("div",{className:"space-y-3",children:o.map(e=>(0,a.jsxs)("div",{className:"border border-base-300 rounded-lg p-4 bg-base-100",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"font-medium truncate",children:e.name}),(0,a.jsx)("div",{className:"text-xs opacity-60 mt-1",children:"Target: Branch | Action: Run bash script"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsx)("button",{className:"btn btn-ghost btn-xs",onClick:()=>{h(e.id),p({name:e.name,target:e.target,action:e.action,content:e.content}),b(null)},disabled:d.isPending,children:"Edit"}),(0,a.jsx)("button",{className:"btn btn-ghost btn-xs text-error",onClick:()=>{var s;return s=e.id,void(N(o.filter(e=>e.id!==s)),m===s&&j())},disabled:d.isPending,children:"Delete"})]})]}),(0,a.jsx)("pre",{className:"mt-3 text-xs font-mono bg-base-200 rounded p-3 overflow-auto max-h-36 whitespace-pre-wrap break-words",children:e.content})]},e.id))})]})})]})}function o(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,a.jsx)("span",{className:"loading loading-spinner"})}),children:(0,a.jsx)(d,{})})}},8426:(e,s,t)=>{Promise.resolve().then(t.bind(t,7443))}},e=>{e.O(0,[176,785,26,441,794,358],()=>e(e.s=8426)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[411],{6147:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>u});var n=a(5155),r=a(3321),i=a(9446),t=a(2115),l=a(6534);function c(){let e=(0,r.useSearchParams)().get("path");return((0,l.J)(e,"History"),e)?(0,n.jsx)(i.u,{repoPath:e}):(0,n.jsx)("div",{className:"p-8",children:"No repository path specified."})}function u(){return(0,n.jsx)(t.Suspense,{fallback:(0,n.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,n.jsx)("span",{className:"loading loading-spinner"})}),children:(0,n.jsx)(c,{})})}},6795:(e,s,a)=>{Promise.resolve().then(a.bind(a,6147))}},e=>{e.O(0,[508,176,785,841,26,790,446,441,794,358],()=>e(e.s=6795)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[535],{4395:(e,t,a)=>{Promise.resolve().then(a.bind(a,5432))},5432:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>h});var s=a(5155),n=a(3321),i=a(2115),l=a(6534),r=a(696),c=a(7702),o=a(8599);function d(e){try{if(e.startsWith("git@")){let t=e.match(/git@([^:]+):/);return t?t[1]:null}return new URL(e).hostname}catch{return null}}function u(){let e=(0,n.useSearchParams)().get("path");(0,l.J)(e,"Settings");let{data:t,isLoading:a}=(0,r.uG)(),{data:u,isLoading:h}=(0,c.aX)(),{data:m,isLoading:p}=(0,r._6)(e),y=(0,r.Lp)(),f=(0,i.useMemo)(()=>t?.find(t=>t.path===e),[t,e]),[b,x]=(0,i.useState)({path:null,value:"",isDirty:!1}),j=(0,i.useMemo)(()=>{if(!u||!m?.remoteUrls)return[];let e=new Set(Object.values(m.remoteUrls).map(d).filter(Boolean));return u.filter(t=>{if("github"===t.type)return e.has("github.com");if("gitlab"===t.type&&t.serverUrl){let a=d(t.serverUrl);return a&&e.has(a)}return!1})},[u,m]);if(a||h||p)return(0,s.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,s.jsx)("span",{className:"loading loading-spinner"})});if(!e||!f)return(0,s.jsx)("div",{className:"p-8",children:"Repository not found."});let N=b.path===e&&b.isDirty?b.value:f.displayName??"",v=f.displayName?.trim()??"",g=N.trim(),w=g!==v,k=(0,o.iu)({path:f.path,name:f.name,displayName:N}),E=(0,o.kj)(f.path),S=()=>{x({path:e,value:N,isDirty:!1}),y.mutate({path:e,updates:{displayName:N}})};return(0,s.jsxs)("div",{className:"p-8 max-w-2xl mx-auto",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold mb-6",children:"Workspace Settings"}),(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,s.jsxs)("div",{className:"card-body",children:[(0,s.jsx)("h2",{className:"card-title",children:"Repository Display Name"}),(0,s.jsx)("p",{className:"text-sm opacity-70",children:"Set a custom name for this repository in the workspace UI."}),(0,s.jsxs)("div",{className:"form-control w-full mt-4",children:[(0,s.jsx)("label",{className:"label",children:(0,s.jsx)("span",{className:"label-text",children:"Display Name"})}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full",placeholder:E,value:N,onChange:t=>{x({path:e,value:t.target.value,isDirty:!0})},onKeyDown:e=>{"Enter"===e.key&&w&&!y.isPending&&(e.preventDefault(),S())}}),(0,s.jsx)("label",{className:"label",children:(0,s.jsxs)("span",{className:"label-text-alt opacity-70",children:["Preview: ",(0,s.jsx)("span",{className:"font-medium",children:k})]})})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,s.jsx)("button",{type:"button",className:"btn btn-primary btn-sm",onClick:S,disabled:!w||y.isPending,children:"Save Name"}),(0,s.jsx)("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>{x({path:e,value:"",isDirty:!1}),y.mutate({path:e,updates:{displayName:null}})},disabled:!g&&!f.displayName||y.isPending,children:"Reset"})]})]})}),(0,s.jsx)("div",{className:"card bg-base-100 shadow-xl border border-base-200",children:(0,s.jsxs)("div",{className:"card-body",children:[(0,s.jsx)("h2",{className:"card-title",children:"Repository Credentials"}),(0,s.jsx)("p",{className:"text-sm opacity-70",children:"Associate a credential with this repository to authenticate with remote servers."}),(0,s.jsxs)("div",{className:"form-control w-full mt-4",children:[(0,s.jsx)("label",{className:"label",children:(0,s.jsx)("span",{className:"label-text",children:"Associated Credential"})}),(0,s.jsxs)("select",{className:"select select-bordered w-full",value:f.credentialId||"none",onChange:t=>{let a=t.target.value;y.mutate({path:e,updates:{credentialId:"none"===a?null:a}})},children:[(0,s.jsx)("option",{value:"none",children:"None"}),j.map(e=>(0,s.jsxs)("option",{value:e.id,children:["github"===e.type?"GitHub":"GitLab","gitlab"===e.type&&` (${new URL(e.serverUrl).hostname})`," - ","github"===e.type?"Account":"Token"]},e.id))]}),0===j.length&&(0,s.jsx)("label",{className:"label",children:(0,s.jsx)("span",{className:"label-text-alt opacity-70",children:"No matching credentials found for this repository's remotes. Add credentials in the Credentials page."})})]})]})})]})]})}function h(){return(0,s.jsx)(i.Suspense,{fallback:(0,s.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,s.jsx)("span",{className:"loading loading-spinner"})}),children:(0,s.jsx)(u,{})})}},6534:(e,t,a)=>{"use strict";a.d(t,{J:()=>l});var s=a(2115),n=a(696),i=a(8599);function l(e,t){let a=(0,n.GK)(e);(0,s.useEffect)(()=>{let s=e?a?(0,i.iu)(a):(0,i.kj)(e):"Workspace";document.title=`${s} | ${t}`},[e,a,t])}},7702:(e,t,a)=>{"use strict";a.d(t,{Ii:()=>m,Lv:()=>o,aX:()=>r,sX:()=>u});var s=a(4109),n=a(5625),i=a(8934);async function l(){let e=await fetch("/api/credentials");if(!e.ok)throw Error("Failed to fetch credentials");return e.json()}function r(){return(0,s.I)({queryKey:["credentials"],queryFn:l})}async function c(e){let t=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();if(!t.ok)throw Error(a.error||"Failed to create credential");return a}function o(){let e=(0,n.jE)();return(0,i.n)({mutationFn:c,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function d(e){let t=await fetch("/api/credentials",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await t.json();if(!t.ok)throw Error(a.error||"Failed to update credential");return a}function u(){let e=(0,n.jE)();return(0,i.n)({mutationFn:d,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}async function h(e){let t=await fetch("/api/credentials",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})}),a=await t.json();if(!t.ok)throw Error(a.error||"Failed to delete credential")}function m(){let e=(0,n.jE)();return(0,i.n)({mutationFn:h,onSuccess:()=>{e.invalidateQueries({queryKey:["credentials"]})}})}}},e=>{e.O(0,[176,785,26,441,794,358],()=>e(e.s=4395)),_N_E=e.O()}]);
|
package/.next/static/chunks/next/dist/client/components/builtin/global-error-24e6fb8a3a0a87ef.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[337],{2108:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,7123,23))}},e=>{e.O(0,[441,794,358],()=>e(e.s=2108)),_N_E=e.O()}]);
|