trident-git 0.5.1 → 0.9.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 +7 -7
- 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 +7 -7
- 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 +5 -5
- 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-4ead45a8bdded8f1.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 → DX0NFQf0fq5wYBl_EgDbX}/_buildManifest.js +0 -0
- /package/.next/static/{m-UCD7bYHUI6k3svPwOgO → DX0NFQf0fq5wYBl_EgDbX}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports.id=764,exports.ids=[764],exports.modules={1135:()=>{},1384:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23)),Promise.resolve().then(c.t.bind(c,5098,23)),Promise.resolve().then(c.t.bind(c,7644,23)),Promise.resolve().then(c.t.bind(c,3859,23)),Promise.resolve().then(c.t.bind(c,8099,23)),Promise.resolve().then(c.t.bind(c,6237,23)),Promise.resolve().then(c.t.bind(c,8562,23)),Promise.resolve().then(c.t.bind(c,6675,23))},3048:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23))},3381:(a,b,c)=>{"use strict";c.d(b,{dj:()=>o,oR:()=>n,tk:()=>p});var d=c(7484);let e=5e3;async function f(a){try{return await navigator.clipboard.writeText(a),!0}catch{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.left="-9999px",document.body.appendChild(b),b.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(b)}}}let g=0;function h(){return(g=(g+1)%Number.MAX_SAFE_INTEGER).toString()}let i=new Map,j=(a,b=e)=>{if(i.has(a))return;let c=setTimeout(()=>{i.delete(a),m({type:"REMOVE_TOAST",toastId:a})},b);i.set(a,c)},k=[],l={toasts:[]};function m(a){l=((a,b)=>{switch(b.type){case"ADD_TOAST":return{...a,toasts:[b.toast,...a.toasts].slice(0,5)};case"UPDATE_TOAST":return{...a,toasts:a.toasts.map(a=>a.id===b.toast.id?{...a,...b.toast}:a)};case"DISMISS_TOAST":{let{toastId:c}=b;return c?j(c,0):a.toasts.forEach(a=>{j(a.id,0)}),{...a,toasts:a.toasts.filter(a=>a.id!==c&&void 0!==c)}}case"REMOVE_TOAST":if(void 0===b.toastId)return{...a,toasts:[]};return{...a,toasts:a.toasts.filter(a=>a.id!==b.toastId)}}})(l,a),k.forEach(a=>{a(l)})}function n(a){let b=h();return m({type:"ADD_TOAST",toast:{...a,id:b}}),j(b,a.duration||e),{id:b,dismiss:()=>m({type:"DISMISS_TOAST",toastId:b}),update:a=>m({type:"UPDATE_TOAST",toast:{...a,id:b}})}}function o(){let[a,b]=d.useState(l);return d.useEffect(()=>(k.push(b),()=>{let a=k.indexOf(b);a>-1&&k.splice(a,1)}),[a]),{...a,toast:n,dismiss:a=>m({type:"DISMISS_TOAST",toastId:a})}}function p(a,b={}){let c="string"==typeof a?a:a.message,e=b.title||(b.operation?`${b.operation} Failed`:"Git Operation Failed"),g=h();return n({type:"error",title:e,description:d.createElement(()=>{let[a,e]=d.useState(!1),[h,i]=d.useState(!1),j=async a=>{a.stopPropagation(),await f(c)&&(e(!0),setTimeout(()=>e(!1),2e3))},k=async a=>{if(a.stopPropagation(),b.onFix){i(!0);try{await b.onFix(),m({type:"DISMISS_TOAST",toastId:g})}catch(a){console.error("Fix failed",a),i(!1)}}};return d.createElement("div",{className:"mt-2 space-y-3"},d.createElement("div",{className:"max-h-[120px] overflow-y-auto whitespace-pre-wrap font-mono text-[11px] leading-relaxed bg-black/20 p-3 rounded-md break-all text-error-content/90 border border-error-content/20"},c),d.createElement("div",{className:"flex gap-2"},d.createElement("button",{onClick:j,type:"button",className:`btn btn-xs ${a?"btn-success text-white":"bg-white/20 hover:bg-white/30 text-white border-white/20"}`},a?"Copied!":"Copy Error"),b.onFix?d.createElement("button",{onClick:k,type:"button",disabled:h,className:"btn btn-xs btn-warning text-white"},h?"Fixing...":b.fixLabel||"Fix Issue"):null))}),duration:1e4}),{id:g,dismiss:()=>m({type:"DISMISS_TOAST",toastId:g})}}},4490:(a,b,c)=>{"use strict";c.d(b,{L9:()=>q,cn:()=>f,iu:()=>h,kO:()=>n,kj:()=>g,tq:()=>p,u:()=>o});var d=c(9314),e=c(6862);function f(...a){return(0,e.QP)((0,d.$)(a))}function g(a){let b=a.replace(/[\\/]+$/,"").split(/[/\\]/).filter(Boolean);return b[b.length-1]||a}function h(a){let b=a.displayName?.trim();return b||(a.name?.trim()?a.name:g(a.path))}function i(a){if(!a)return"";let b=a.split("/").pop()||"",c=b.lastIndexOf(".");return -1===c||0===c?b.toLowerCase():b.slice(c+1).toLowerCase()}let j=new Set(["js","jsx","ts","tsx","mjs","cjs","mts","cts","py","pyw","pyi","pyx","rb","rake","gemspec","java","kt","kts","scala","sc","groovy","gradle","c","h","cpp","cc","cxx","hpp","hh","hxx","c++","h++","cs","fs","fsx","fsi","go","rs","swift","dart","zig","nim","v","odin","php","phtml","php3","php4","php5","php7","phps","pl","pm","pod","t","psgi","lua","tcl","r","R","jl","ex","exs","erl","hrl","clj","cljs","cljc","edn","lisp","lsp","el","scm","ss","rkt","hs","lhs","elm","purs","ml","mli","f90","f95","f03","f08","for","asm","s","S","vhd","vhdl","v","sv","svh","bas","vb","vbs","vba","pas","pp","inc","dpr","dpk","sh","bash","zsh","fish","ksh","csh","tcsh","ps1","psm1","psd1","bat","cmd","html","htm","xhtml","shtml","css","scss","sass","less","styl","stylus","pcss","postcss","svg","xml","xsl","xslt","xsd","dtd","rss","atom","rdf","wsdl","soap","vue","svelte","astro","mdx","hbs","handlebars","mustache","ejs","pug","jade","haml","slim","erb","graphql","gql","json","json5","jsonc","jsonl","ndjson","geojson","yaml","yml","toml","ini","cfg","conf","config","properties","env","csv","tsv","psv","txt","text","log","out","md","markdown","mdown","mkd","mkdn","mdwn","rst","rest","adoc","asciidoc","asc","org","tex","latex","ltx","bib","sty","cls","rtf","diff","patch","gitignore","gitattributes","gitmodules","gitconfig","dockerignore","dockerfile","containerfile","editorconfig","prettierrc","eslintrc","babelrc","stylelintrc","browserslistrc","npmrc","nvmrc","yarnrc","pnpmfile","makefile","mk","cmake","make","mak","rake","podfile","gemfile","fastfile","sql","plsql","pgsql","mysql","sqlite","hql","cql","proto","protobuf","thrift","avro","capnp","fbs","flatc","tf","tfvars","hcl","nomad","sentinel","prisma","graphqls","lock"]),k=new Set(["jpg","jpeg","png","gif","bmp","ico","icns","tiff","tif","webp","avif","heic","heif","psd","ai","eps","raw","cr2","nef","orf","sr2","dng","mp4","avi","mov","wmv","flv","mkv","webm","m4v","mpeg","mpg","3gp","3g2","ogv","mp3","wav","ogg","oga","flac","aac","m4a","wma","aiff","aif","mid","midi","opus","zip","rar","7z","tar","gz","bz2","xz","lz","lzma","lz4","zst","cab","iso","dmg","exe","dll","so","dylib","a","lib","obj","o","app","msi","deb","rpm","apk","ipa","pkg","snap","flatpak","appimage","class","jar","war","ear","pyc","pyo","pyd","beam","wasm","wat","pdf","doc","docx","xls","xlsx","ppt","pptx","odt","ods","odp","pages","numbers","key","ttf","otf","woff","woff2","eot","fon","fnt","db","sqlite","sqlite3","mdb","accdb","frm","myd","myi","ibd","bin","dat","data","sav","bak","swf","fla","blend","fbx","obj","stl","gltf","glb","3ds","dae","ply","sketch","fig","xd","unity","unitypackage","asset","prefab","meta"]),l=new Set(["png","jpg","jpeg","gif","bmp","ico","icns","tiff","tif","webp","avif","heic","heif","svg"]);function m(a){if(!a)return!1;if(a.includes("\0"))return!0;let b=a.slice(0,8192),c=0;for(let a=0;a<b.length;a++){let d=b.charCodeAt(a);d<32&&9!==d&&10!==d&&13!==d&&c++}return b.length>0&&c/b.length>.1}function n(a,b,c){let d=function(a){if(!a)return"unknown";let b=i(a);return j.has(b)?"text":k.has(b)?"binary":"unknown"}(a);return"binary"===d||"text"!==d&&(m(b||"")||m(c||""))}function o(a){return l.has(i(a))}function p(a){return a?a.split("\n").reduce((a,b)=>b.startsWith("+++ ")||b.startsWith("--- ")?a:b.startsWith("+")||b.startsWith("-")?a+1:a,0):0}function q(a){return a.replace(/[\s~^:?*\[\]\\@{}<>|"'`!#$%&()+=;,]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-")}},4591:(a,b,c)=>{Promise.resolve().then(c.bind(c,9633))},4626:(a,b,c)=>{"use strict";c.d(b,{F3:()=>n,F7:()=>s,GK:()=>m,Jy:()=>z,Lp:()=>p,Ud:()=>B,X0:()=>q,Y5:()=>k,_6:()=>v,_X:()=>u,a3:()=>F,b5:()=>t,cT:()=>A,en:()=>r,fr:()=>o,gg:()=>x,st:()=>y,t0:()=>j,uG:()=>l,xV:()=>w});var d=c(7484),e=c(434),f=c(5023),g=c(3241),h=c(3381);let i="/api";function j(){return(0,e.I)({queryKey:["settings"],queryFn:async()=>{let a=await fetch(`${i}/settings`);if(!a.ok)throw Error("Failed to fetch settings");return a.json()}})}function k(){let a=(0,f.jE)();return(0,g.n)({mutationFn:async a=>{let b=await fetch(`${i}/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!b.ok)throw Error("Failed to update settings");return b.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["settings"]})}})}function l(){return(0,e.I)({queryKey:["repos"],queryFn:async()=>{let a=await fetch(`${i}/repos`);if(!a.ok)throw Error("Failed to fetch repositories");return a.json()}})}function m(a){let{data:b}=l();return(0,d.useMemo)(()=>b?.find(b=>b.path===a)||null,[b,a])}function n(){let a=(0,f.jE)();return(0,g.n)({mutationFn:async({path:a,name:b,initializeIfNeeded:c})=>{let d=await fetch(`${i}/repos`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a,name:b,initializeIfNeeded:c})});if(!d.ok)throw Error((await d.json().catch(()=>({}))).error||"Failed to add repository");return d.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["repos"]})}})}function o(){let a=(0,f.jE)();return(0,g.n)({mutationFn:async a=>{let b=await fetch(`${i}/repos/clone`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||"Failed to clone repository");return c},onSuccess:()=>{a.invalidateQueries({queryKey:["repos"]})}})}function p(){let a=(0,f.jE)();return(0,g.n)({mutationFn:async({path:a,updates:b})=>{let c=await fetch(`${i}/repos`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a,updates:b})});if(!c.ok)throw Error(await c.text());return c.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["repos"]})}})}function q(){let a=(0,f.jE)();return(0,g.n)({mutationFn:async({path:a,deleteLocalFolder:b=!1})=>{let c=await fetch(`${i}/repos`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a,deleteLocalFolder:b})});if(!c.ok)throw Error(await c.text());return c.json()},onSuccess:()=>{a.invalidateQueries({queryKey:["repos"]})}})}function r(a){return(0,e.I)({queryKey:["git",a,"status"],queryFn:async()=>{if(!a)return null;let b=await fetch(`${i}/git/status?path=${encodeURIComponent(a)}`);if(!b.ok){let a=Error((await b.json().catch(()=>({}))).error||"Failed to fetch status");throw a.status=b.status,a}return b.json()},enabled:!!a,refetchOnWindowFocus:!0,refetchOnReconnect:!0,retry:(a,b)=>404!==b.status&&400!==b.status&&a<3})}function s(a){return(0,e.I)({queryKey:["git",a,"conflict-state"],queryFn:async()=>{if(!a)return{operation:null,conflictedFiles:[],hasConflicts:!1,canContinue:!1};let b=await fetch(`${i}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:a,action:"get-conflict-state"})});if(!b.ok){let a=Error((await b.json().catch(()=>({}))).error||"Failed to fetch conflict state");throw a.status=b.status,a}let c=await b.json();return{operation:c.operation??null,conflictedFiles:c.conflictedFiles??[],hasConflicts:!!c.hasConflicts,canContinue:!!c.canContinue}},enabled:!!a,refetchOnWindowFocus:!0,refetchOnReconnect:!0,retry:(a,b)=>404!==b.status&&400!==b.status&&a<3})}function t(a,b){return(0,e.I)({queryKey:["git",a,"conflict-file-versions",b],queryFn:async()=>{if(!a||!b)return{ours:"",theirs:"",current:""};let c=await fetch(`${i}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:a,action:"get-conflict-file-versions",data:{path:b}})});if(!c.ok){let a=Error((await c.json().catch(()=>({}))).error||"Failed to fetch conflict file versions");throw a.status=c.status,a}let d=await c.json();return{ours:"string"==typeof d.ours?d.ours:"",theirs:"string"==typeof d.theirs?d.theirs:"",current:"string"==typeof d.current?d.current:""}},enabled:!!a&&!!b,refetchOnWindowFocus:!0,refetchOnReconnect:!0,retry:(a,b)=>404!==b.status&&400!==b.status&&a<3})}function u(a,b=50){return(0,e.I)({queryKey:["git",a,"log",b],queryFn:async()=>{if(!a)return null;let c=await fetch(`${i}/git/log?path=${encodeURIComponent(a)}&limit=${b}`);if(!c.ok){let a=Error((await c.json().catch(()=>({}))).error||"Failed to fetch log");throw a.status=c.status,a}return c.json()},enabled:!!a,placeholderData:a=>a,retry:(a,b)=>404!==b.status&&400!==b.status&&a<3})}function v(a){return(0,e.I)({queryKey:["git",a,"branches"],queryFn:async()=>{if(!a)return null;let b=await fetch(`${i}/git/branches?path=${encodeURIComponent(a)}`);if(!b.ok)throw Error("Failed to fetch branches");return b.json()},enabled:!!a})}function w(a,b){return(0,e.I)({queryKey:["git",a,"diff",b],queryFn:async()=>{if(!a||!b)return null;let c=await fetch(`${i}/git/diff?path=${encodeURIComponent(a)}&file=${encodeURIComponent(b)}`);if(!c.ok){let a=Error((await c.json().catch(()=>({}))).error||"Failed to fetch diff");throw a.status=c.status,a}return c.json()},enabled:!!a&&!!b,retry:(a,b)=>404!==b.status&&400!==b.status&&a<3})}function x(a,b){let c=b.commitHash??null,d=b.fromCommitHash??null,f=b.toCommitHash??null,g=!!d&&!!f,h=!!c;return(0,e.I)({queryKey:["git",a,"commit-diff",c,d,f],queryFn:async()=>{if(!a||!h&&!g)return null;let b=new URLSearchParams({path:a});h?b.set("commit",c):g&&(b.set("from",d),b.set("to",f));let e=await fetch(`${i}/git/diff?${b.toString()}`);if(!e.ok){let a=Error((await e.json().catch(()=>({}))).error||"Failed to fetch commit diff");throw a.status=e.status,a}return e.json()},enabled:!!a&&(h||g),retry:(a,b)=>404!==b.status&&400!==b.status&&a<3})}function y(a,b,c){let d=c.commitHash??null,f=c.fromCommitHash??null,g=c.toCommitHash??null,h=!!f&&!!g,j=!!d;return(0,e.I)({queryKey:["git",a,"commit-file-diff",b,d,f,g],queryFn:async()=>{if(!a||!b||!j&&!h)return null;let c=new URLSearchParams({path:a,file:b});j?c.set("commit",d):h&&(c.set("from",f),c.set("to",g));let e=await fetch(`${i}/git/diff?${c.toString()}`);if(!e.ok){let a=Error((await e.json().catch(()=>({}))).error||"Failed to fetch file diff");throw a.status=e.status,a}return e.json()},enabled:!!a&&!!b&&(j||h),retry:(a,b)=>404!==b.status&&400!==b.status&&a<3})}function z(a){return(0,e.I)({queryKey:["git",a,"stashes"],queryFn:async()=>{if(!a)return[];let b=await fetch(`${i}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:a,action:"stash-list"})});if(!b.ok)throw Error("Failed to fetch stashes");return(await b.json()).stashes||[]},enabled:!!a})}function A(a,b){return(0,e.I)({queryKey:["git",a,"stash-files",b],queryFn:async()=>{if(!a||null===b)return[];let c=await fetch(`${i}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:a,action:"stash-files",data:{index:b}})});if(!c.ok)throw Error("Failed to fetch stash files");return(await c.json()).files||[]},enabled:!!a&&null!==b})}function B(a,b,c){return(0,e.I)({queryKey:["git",a,"stash-file-diff",b,c],queryFn:async()=>{if(!a||null===b||!c)return{left:"",right:"",diff:""};let d=await fetch(`${i}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:a,action:"stash-file-diff",data:{index:b,file:c}})});if(!d.ok)throw Error("Failed to fetch stash file diff");return d.json()},enabled:!!a&&null!==b&&!!c})}let C={commit:"Commit",push:"Push",pull:"Pull",fetch:"Fetch",stage:"Stage",unstage:"Unstage",checkout:"Checkout","checkout-to-local":"Checkout",branch:"Create Branch","create-tag":"Create Tag","delete-branch":"Delete Branch","delete-worktree":"Delete Worktree","delete-remote-branch":"Delete Remote Branch","delete-remote":"Delete Remote","delete-tag":"Delete Tag","delete-remote-tag":"Delete Remote Tag","rename-branch":"Rename Branch","rename-remote-branch":"Rename Remote Branch","rename-remote":"Rename Remote","add-remote":"Add Remote",reset:"Reset",revert:"Revert Commit","cherry-pick":"Cherry Pick","cherry-pick-multiple":"Cherry Pick","cherry-pick-abort":"Cherry Pick",rebase:"Rebase",merge:"Merge","check-merge-conflicts":"Check Merge Conflicts","check-rebase-conflicts":"Check Rebase Conflicts","get-conflict-state":"Get Conflict State","get-conflict-file-versions":"Get Conflict File Versions","resolve-conflict-file":"Resolve Conflict File","continue-merge":"Continue Merge","abort-merge":"Abort Merge","continue-rebase":"Continue Rebase","abort-rebase":"Abort Rebase","get-remotes":"Get Remotes","get-remote-branches":"Get Remote Branches","get-tracking-branch":"Get Tracking Branch","get-latest-commit-message":"Get Latest Commit Message","push-to-remote":"Push","pull-from-remote":"Pull",stash:"Stash","stash-apply":"Apply Stash","stash-drop":"Drop Stash","stash-pop":"Pop Stash",reword:"Reword Commit",discard:"Discard Changes","cleanup-lock-file":"Cleanup Lock File"},D=["check-merge-conflicts","check-rebase-conflicts","get-conflict-state","get-conflict-file-versions","get-remotes","get-remote-branches","get-tracking-branch","get-latest-commit-message"];async function E(a){let b=await fetch(`${i}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:a,action:"cleanup-lock-file"})});if(!b.ok)throw Error("Failed to cleanup lock file");return b.json()}function F(){let a=(0,f.jE)();return(0,g.n)({mutationFn:async({repoPath:a,action:b,data:c})=>{let d=await fetch(`${i}/git/action`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repoPath:a,action:b,data:c})});if(!d.ok)throw Error((await d.json()).error||"Failed to execute action");return d.json()},onSuccess:(b,c)=>{D.includes(c.action)||a.invalidateQueries({queryKey:["git",c.repoPath]})},onError:(b,c)=>{if(!D.includes(c.action)&&!c.suppressErrorToast){let d=C[c.action]||c.action;b.message.includes("Unable to create")&&b.message.includes(".git/index.lock")?(0,h.tk)(b,{operation:d,fixLabel:"Remove Lock File",onFix:async()=>{await E(c.repoPath),a.invalidateQueries({queryKey:["git",c.repoPath]})}}):(0,h.tk)(b,{operation:d})}}})}},4709:(a,b,c)=>{"use strict";c.d(b,{Providers:()=>d});let d=(0,c(7943).registerClientReference)(function(){throw Error("Attempted to call Providers() from the server but Providers is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/trident/trident/src/app/providers.tsx","Providers")},4936:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,1921,23)),Promise.resolve().then(c.t.bind(c,440,23)),Promise.resolve().then(c.t.bind(c,4342,23)),Promise.resolve().then(c.t.bind(c,2265,23)),Promise.resolve().then(c.t.bind(c,5421,23)),Promise.resolve().then(c.t.bind(c,1335,23)),Promise.resolve().then(c.t.bind(c,664,23)),Promise.resolve().then(c.bind(c,4661))},6200:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,5547,23))},6487:()=>{},6537:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>k,metadata:()=>j});var d=c(5735),e=c(210),f=c.n(e),g=c(84),h=c.n(g);c(1135);var i=c(4709);let j={title:"Trident",description:"Git repository management tool"};function k({children:a}){return(0,d.jsxs)("html",{lang:"en",suppressHydrationWarning:!0,children:[(0,d.jsx)("head",{children:(0,d.jsx)("link",{rel:"stylesheet",href:"https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css"})}),(0,d.jsx)("body",{className:`${f().variable} ${h().variable} antialiased`,children:(0,d.jsx)(i.Providers,{children:a})})]})}},6567:(a,b,c)=>{Promise.resolve().then(c.bind(c,4709))},8162:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(8868);let e=async a=>[{type:"image/png",sizes:"256x256",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.png")+"?91e8b75214a43d69"}]},8335:()=>{},8550:(a,b,c)=>{"use strict";c.d(b,{v:()=>e});var d=c(7484);function e(a,b){(0,d.useRef)(b)}},9633:(a,b,c)=>{"use strict";c.d(b,{Providers:()=>q});var d=c(8249),e=c(7351),f=c(5023),g=c(7484),h=c(8696),i=c(3381);function j(){let{toasts:a}=(0,i.dj)(),[b,c]=(0,g.useState)(!1);return b?(0,d.jsx)("div",{className:"toast toast-bottom toast-end z-50 p-4 gap-2",children:a.map(a=>{let b="alert-info";return"success"===a.type?b="alert-success":"warning"===a.type||"warning"===a.variant?b="alert-warning":("error"===a.type||"destructive"===a.variant)&&(b="alert-error"),(0,d.jsxs)("div",{className:`alert ${b} 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,d.jsxs)("div",{className:"w-full",children:[a.title&&(0,d.jsx)("h3",{className:"font-bold",children:a.title}),a.description&&(0,d.jsx)("div",{className:"opacity-90 break-words",children:a.description})]}),a.action&&(0,d.jsx)("div",{className:"mt-2 w-full",children:a.action})]},a.id)})}):null}var k=c(9099),l=c(4626),m=c(4490),n=c(8550);function o(a,b){return new Date(b.lastOpenedAt||0).getTime()-new Date(a.lastOpenedAt||0).getTime()}function p(){let a=(0,k.useRouter)(),{data:b}=(0,l.uG)(),[c,e]=(0,g.useState)(!1),[f,h]=(0,g.useState)(""),[i,j]=(0,g.useState)(0),p=(0,g.useRef)(null),q=(0,g.useMemo)(()=>(b||[]).filter(a=>!!a.lastOpenedAt).sort(o).slice(0,5),[b]),r=(0,g.useMemo)(()=>{let a=f.trim().toLowerCase();return a?q.filter(b=>{let c=(0,m.iu)(b).toLowerCase(),d=b.path.toLowerCase();return c.includes(a)||d.includes(a)}):q},[f,q]),s=(0,g.useCallback)(()=>{e(!1),h(""),j(0)},[]),t=0===r.length?-1:Math.min(i,r.length-1),u=(0,g.useCallback)(b=>{s(),a.push(`/workspace?path=${encodeURIComponent(b)}`)},[s,a]);return((0,n.v)(c,s),c)?(0,d.jsx)("div",{className:"fixed inset-0 z-50 bg-black/40 px-4 py-16",onMouseDown:s,role:"dialog","aria-modal":"true","aria-label":"Command palette",children:(0,d.jsxs)("div",{className:"mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-base-300 bg-base-100 shadow-2xl",onMouseDown:a=>a.stopPropagation(),children:[(0,d.jsx)("div",{className:"border-b border-base-300 p-3",children:(0,d.jsx)("input",{ref:p,type:"text",value:f,onChange:a=>{h(a.target.value),j(0)},onKeyDown:a=>{if("ArrowDown"===a.key){a.preventDefault(),r.length>0&&j(a=>(a+1)%r.length);return}if("ArrowUp"===a.key){a.preventDefault(),r.length>0&&j(a=>a<=0?r.length-1:a-1);return}if("Enter"===a.key){a.preventDefault();let b=t>=0?r[t]:null;b&&u(b.path)}},placeholder:"Type a command...",className:"input input-ghost w-full text-base focus:outline-none"})}),(0,d.jsxs)("div",{className:"max-h-80 overflow-y-auto py-2",children:[(0,d.jsx)("div",{className:"px-4 pb-2 text-xs font-semibold uppercase tracking-wider opacity-60",children:"Recent repositories"}),0===q.length&&(0,d.jsx)("div",{className:"px-4 py-6 text-sm opacity-60",children:"No recently opened repositories yet."}),q.length>0&&0===r.length&&(0,d.jsx)("div",{className:"px-4 py-6 text-sm opacity-60",children:"No matching repositories."}),r.map((a,b)=>{let c=(0,m.iu)(a);return(0,d.jsxs)("button",{type:"button",className:(0,m.cn)("flex w-full items-center justify-between gap-4 px-4 py-3 text-left",t===b?"bg-base-200":"hover:bg-base-200/70"),onMouseEnter:()=>j(b),onClick:()=>u(a.path),children:[(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("div",{className:"truncate text-sm font-medium",children:c}),(0,d.jsx)("div",{className:"truncate text-xs opacity-65",children:a.path})]}),(0,d.jsx)("span",{className:"text-xs opacity-60",children:"Open"})]},a.path)})]}),(0,d.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 q({children:a}){let[b]=(0,g.useState)(()=>new e.E);return(0,d.jsx)(f.Ht,{client:b,children:(0,d.jsxs)(h.N,{attribute:"data-theme",defaultTheme:"system",enableSystem:!0,children:[a,(0,d.jsx)(p,{}),(0,d.jsx)(j,{})]})})}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-7dec27dc3bfe207a.js","static/chunks/4bd1b696-096d35a2bd1da3af.js","static/chunks/794-37dad9bbc14b04b8.js","static/chunks/main-app-
|
|
1
|
+
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-7dec27dc3bfe207a.js","static/chunks/4bd1b696-096d35a2bd1da3af.js","static/chunks/794-37dad9bbc14b04b8.js","static/chunks/main-app-8bead961b2b5992f.js"],rootMainFilesTree:{},pages:{"/_app":[]}},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js","/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__NEXT_FONT_MANIFEST='{"pages":{},"app":{"/
|
|
1
|
+
self.__NEXT_FONT_MANIFEST='{"pages":{},"app":{"/home/runner/work/trident/trident/src/app/layout":["static/media/4cf2300e9c8272f7-s.p.woff2","static/media/93f479601ee12b01-s.p.woff2"]},"appUsingSizeAdjust":true,"pagesUsingSizeAdjust":false}';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"pages":{},"app":{"/
|
|
1
|
+
{"pages":{},"app":{"/home/runner/work/trident/trident/src/app/layout":["static/media/4cf2300e9c8272f7-s.p.woff2","static/media/93f479601ee12b01-s.p.woff2"]},"appUsingSizeAdjust":true,"pagesUsingSizeAdjust":false}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--DX0NFQf0fq5wYBl_EgDbX--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/4cf2300e9c8272f7-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/93f479601ee12b01-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/de70bee13400563f.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/34464e853551fd25.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-7dec27dc3bfe207a.js"/><script src="/_next/static/chunks/4bd1b696-096d35a2bd1da3af.js" async=""></script><script src="/_next/static/chunks/794-37dad9bbc14b04b8.js" async=""></script><script src="/_next/static/chunks/main-app-8bead961b2b5992f.js" async=""></script><script src="/_next/static/chunks/176-b068120641913226.js" async=""></script><script src="/_next/static/chunks/785-e6d755147ff87934.js" async=""></script><script src="/_next/static/chunks/200-3664e65687e716a2.js" async=""></script><script src="/_next/static/chunks/26-a76b3447d31c0f53.js" async=""></script><script src="/_next/static/chunks/app/layout-3a89133183963c99.js" async=""></script><link rel="preload" href="https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css" as="style"/><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>Trident</title><meta name="description" content="Git repository management tool"/><link rel="icon" href="/icon.png?91e8b75214a43d69" type="image/png" sizes="256x256"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_188709 __variable_9a8899 antialiased"><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("data-theme","theme","system",null,["light","dark"],null,true,true)</script><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-7dec27dc3bfe207a.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[2246,[\"176\",\"static/chunks/176-b068120641913226.js\",\"785\",\"static/chunks/785-e6d755147ff87934.js\",\"200\",\"static/chunks/200-3664e65687e716a2.js\",\"26\",\"static/chunks/26-a76b3447d31c0f53.js\",\"558\",\"static/chunks/app/layout-3a89133183963c99.js\"],\"Providers\"]\n3:I[7121,[],\"\"]\n4:I[4581,[],\"\"]\n5:I[484,[],\"OutletBoundary\"]\n6:\"$Sreact.suspense\"\n8:I[484,[],\"ViewportBoundary\"]\na:I[484,[],\"MetadataBoundary\"]\nc:I[7123,[],\"\"]\n:HL[\"/_next/static/media/4cf2300e9c8272f7-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/93f479601ee12b01-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/de70bee13400563f.css\",\"style\"]\n:HL[\"/_next/static/css/34464e853551fd25.css\",\"style\"]\n:HL[\"https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"DX0NFQf0fq5wYBl_EgDbX\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/de70bee13400563f.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/34464e853551fd25.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"link\",null,{\"rel\":\"stylesheet\",\"href\":\"https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css\"}]}],[\"$\",\"body\",null,{\"className\":\"__variable_188709 __variable_9a8899 antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@7\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$6\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"d:I[6869,[],\"IconMark\"]\n7:null\nb:[[\"$\",\"title\",\"0\",{\"children\":\"Trident\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Git repository management tool\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.png?91e8b75214a43d69\",\"type\":\"image/png\",\"sizes\":\"256x256\"}],[\"$\",\"$Ld\",\"3\",{}]]\n"])</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-7dec27dc3bfe207a.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[484,[],\"ViewportBoundary\"]\n9:I[484,[],\"MetadataBoundary\"]\nb:I[7123,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"
|
|
1
|
+
<!DOCTYPE html><!--DX0NFQf0fq5wYBl_EgDbX--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-7dec27dc3bfe207a.js"/><script src="/_next/static/chunks/4bd1b696-096d35a2bd1da3af.js" async=""></script><script src="/_next/static/chunks/794-37dad9bbc14b04b8.js" async=""></script><script src="/_next/static/chunks/main-app-8bead961b2b5992f.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-7dec27dc3bfe207a.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[7121,[],\"\"]\n3:I[4581,[],\"\"]\n4:I[484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[484,[],\"ViewportBoundary\"]\n9:I[484,[],\"MetadataBoundary\"]\nb:I[7123,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"DX0NFQf0fq5wYBl_EgDbX\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"CL+GZ24+FITLzXuJRxysP2F18mmhmMcIrtXX+6WVGKA="}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[446],{302:(e,a,t)=>{t.d(a,{v:()=>o});var s=t(2115);let l=[],n=0,r=!1;function i(e){if("Escape"!==e.key)return;let a=l[l.length-1];a&&(e.preventDefault(),a.onEscape())}function o(e,a){let t=(0,s.useRef)(a);(0,s.useEffect)(()=>{t.current=a},[a]),(0,s.useEffect)(()=>{if(!e)return;let a=++n;return l.push({id:a,onEscape:()=>t.current()}),!r&&"u">typeof document&&(document.addEventListener("keydown",i),r=!0),()=>{let e=l.findIndex(e=>e.id===a);e>=0&&l.splice(e,1),r&&"u">typeof document&&!(l.length>0)&&(document.removeEventListener("keydown",i),r=!1)}},[e])}},9446:(e,a,t)=>{t.d(a,{u:()=>T});var s=t(5155),l=t(696),n=t(5625),r=t(2115);function i(e){let a=0x811c9dc5;for(let t=0;t<e.length;t++)a^=e.charCodeAt(t),a=Math.imul(a,0x1000193);return a>>>0}var o=t(8599);function c({children:e,items:a,containerClassName:t="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)},a=e=>{"Escape"===e.key&&n(!1)};return setTimeout(()=>{document.addEventListener("click",e),document.addEventListener("contextmenu",e),document.addEventListener("keydown",a)},0),()=>{document.removeEventListener("click",e),document.removeEventListener("contextmenu",e),document.removeEventListener("keydown",a)}},[l]),(0,r.useEffect)(()=>{if(!l||!d.current)return;let e=d.current;requestAnimationFrame(()=>{let t=document.createElement("div");t.style.position="absolute",t.style.visibility="hidden",t.style.whiteSpace="nowrap",t.style.pointerEvents="none";let s=window.getComputedStyle(e);t.style.fontSize=s.fontSize,t.style.fontFamily=s.fontFamily,t.style.fontWeight=s.fontWeight,t.style.padding="0.5rem 0.75rem",t.style.boxSizing="border-box",document.body.appendChild(t);let l=0;a.forEach(e=>{t.textContent=e.label;let a=t.getBoundingClientRect().width+20*!!e.icon+16*!!e.children?.length;a>l&&(l=a)}),document.body.removeChild(t);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,a]);let m=(e,a)=>{let t=!!e.children?.length;return(0,s.jsxs)("li",{className:(0,o.cn)(t&&"relative group/submenu"),children:[(0,s.jsxs)("a",{onClick:a=>{a.stopPropagation(),e.disabled||t||(e.onClick?.(),n(!1))},className:(0,o.cn)("flex items-center gap-2","whitespace-nowrap",e.danger&&"text-error",e.disabled&&"opacity-40 pointer-events-none",t&&"flex items-center justify-between gap-3"),children:[(0,s.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[e.icon&&(0,s.jsx)("span",{className:"inline-flex shrink-0 opacity-80",children:e.icon}),(0,s.jsx)("span",{children:e.labelNode??e.label})]}),t&&(0,s.jsx)("i",{className:"iconoir-nav-arrow-right text-[12px]","aria-hidden":"true"})]}),t&&(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,t)=>m(e,`${a}-${t}`))})]})]},a)};return(0,s.jsxs)("div",{ref:h,className:t,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:a.map((e,a)=>m(e,`menu-${a}`))})]})}function d({text:e,searchQuery:a}){if(!a||!e)return(0,s.jsx)(s.Fragment,{children:e});let t=a.toLowerCase(),l=e.toLowerCase(),n=[],r=0,i=l.indexOf(t);for(;-1!==i;)i>r&&n.push({text:e.slice(r,i),highlighted:!1}),n.push({text:e.slice(i,i+t.length),highlighted:!0}),r=i+t.length,i=l.indexOf(t,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,a)=>e.highlighted?(0,s.jsx)("mark",{className:"bg-warning text-warning-content rounded-sm px-0.5",children:e.text},a):(0,s.jsx)("span",{children:e.text},a))})}let h=(0,r.forwardRef)(function({commits:e,onSelectCommit:a,onResetToCommit:t,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,a={}){let t=[],s=new Set(a.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 a,t=r[e],s=t?(a=i(t),`hsl(${a%360} 82% 52%)`):n[e]??`hsl(${47*e%360} 78% 56%)`;return n[e]=s,s}return e.forEach((e,a)=>{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,a){if(0===e.length)return null;let t=e.find(e=>a.has(e));return t||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,a){let t,s;if(a.has(e))return e;let l=-1===(s=(t=e.startsWith("remotes/")?e.slice(8):e).indexOf("/"))?null:t.slice(s+1);return l&&a.has(l)?l:e}(h,s);(function(e,a,t){return!a||t.has(e)&&!t.has(a)})(e,r[d],s)&&(r[d]=e)}let m=c(d),u={...e,x:d,y:a,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:a,x2:e,y2:a+1,color:c(e),type:"straight"});l[d]=null;let x=e.parents;if(x.length>0){let e=x[0],t=l.indexOf(e);-1!==t?u.paths.push({x1:d,y1:a,x2:t,y2:a+1,color:m,type:"merge"}):(l[d]=e,u.paths.push({x1:d,y1:a,x2:d,y2:a+1,color:m,type:"straight"}));for(let e=1;e<x.length;e++){let t=x[e],s=l.indexOf(t);if(-1!==s)u.paths.push({x1:d,y1:a,x2:s,y2:a+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]=t,u.paths.push({x1:d,y1:a,x2:e,y2:a+1,color:c(e),type:"fork"})}}}null===l[d]&&(r[d]=null,n[d]=void 0),t.push(u)}),t})(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 a=S.findIndex(a=>a.hash===e);if(-1===a)return!1;if(R.current){let e=24*a-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:a,clientHeight:t,scrollHeight:s}=e.currentTarget;s-a-t<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,a)=>{let t=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 ${t} ${l} L ${n} ${r}`;else{let e=l+12,a=r-12;i=`M ${t} ${l} C ${t} ${e}, ${n} ${a}, ${n} ${r}`}return(0,s.jsx)("path",{d:i,stroke:e.color,strokeWidth:2,fill:"none",strokeLinecap:"round"},a)})},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",icon:(0,s.jsx)("i",{className:"iconoir-refresh-circle text-[14px]","aria-hidden":"true"}),onClick:()=>t?.(e.hash)}];if(l&&f.push({label:"Revert commit",icon:(0,s.jsx)("i",{className:"iconoir-u-turn-arrow-left text-[14px]","aria-hidden":"true"}),onClick:()=>l(e.hash,e.message)}),n&&f.push({label:"Create tag",icon:(0,s.jsx)("i",{className:"iconoir-bookmark text-[14px]","aria-hidden":"true"}),onClick:()=>n(e.hash)}),h&&f.push({label:"Cherry-pick commit",icon:(0,s.jsx)("i",{className:"iconoir-git-fork text-[14px]","aria-hidden":"true"}),onClick:()=>h(e.hash,e.message)}),m&&b>1&&r&&f.push({label:`Cherry-pick ${b} selected commits`,icon:(0,s.jsx)("i",{className:"iconoir-git-fork text-[14px]","aria-hidden":"true"}),onClick:m}),u&&N&&N.length>0){let a=e.refs?e.refs.replace(/[()]/g,"").split(",").map(e=>e.trim()):[],t=null;for(let e of a){let a=e.replace(/^HEAD\s*->\s*/,"");if(N.includes(a)&&(t=a,g&&a===g))break}t&&f.push({label:"Reword commit",icon:(0,s.jsx)("i",{className:"iconoir-edit-pencil text-[14px]","aria-hidden":"true"}),onClick:()=>u(e.hash,e.message,e.body??"",t)})}let v=(()=>{if(!e.refs)return[];let a=e.refs.replace(/^\s*\((.*)\)\s*$/,"$1").split(",").map(e=>{let a=e.startsWith("HEAD -> "),t=w(e.replace(/^HEAD\s*->\s*/,"").trim());return{raw:e,name:t,isHead:a}}),t=[],s=new Set,l=e=>j&&(j.has(e)||j.has(`remotes/${e}`));return a.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=a.findIndex((e,a)=>a!==n&&!s.has(a)&&i.has(e.name));if(-1!==o){let l=a[o],i=r.split("/")[0];t.push({displayName:`${e.name} (${i})`,primaryRef:e.name,secondaryRef:l.name,isHead:e.isHead}),s.add(n),s.add(o);return}}}}),a.forEach((e,a)=>{!s.has(a)&&(l(e.name)||t.push({displayName:C(e.name),primaryRef:e.name,isHead:e.isHead}))}),t})();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:t=>a?.(e.hash,{isMultiSelect:t.metaKey||t.ctrlKey,isRangeSelect:t.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,a)=>{let t=g&&(e.primaryRef===g||e.isHead&&e.primaryRef===g),l=e.primaryRef.startsWith("tag:")?{textColor:"#374151",backgroundColor:"#e5e7eb"}:function(e){let a,t,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:a,b:t}){let s=e=>{let a=e/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)};return .2126*s(e)+.7152*s(a)+.0722*s(t)}((t=u/100*(1-Math.abs(2*(a=x/100)-1)),l=t*(1-Math.abs((s=m/60)%2-1)),n=0,r=0,o=0,s>=0&&s<1?(n=t,r=l):s>=1&&s<2?(n=l,r=t):s>=2&&s<3?(r=t,o=l):s>=3&&s<4?(r=l,o=t):s>=4&&s<5?(n=l,o=t):(n=t,o=l),{r:Math.round((n+(c=a-t/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",t&&"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},a):(0,s.jsx)(c,{items:r,containerClassName:"inline-flex shrink-0",children:n},a)}),(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=t(302),u=t(6695),x=t(460),p=t(6162),b=t(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:a,expandedFolders:t,onToggleFolder:l,onSelectFile:n,depth:r=0}){let i=Array.from(e.children.values()).sort((e,a)=>{let t=e.children.size>0,s=a.children.size>0;return t&&!s?-1:!t&&s?1:e.name.localeCompare(a.name)});return(0,s.jsx)(s.Fragment,{children:i.map(e=>{if(e.children.size>0){let i=t.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:a,expandedFolders:t,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",a===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:a,fromCommitHash:t,toCommitHash:n,filePath:i,splitView:c}){let{data:d,isLoading:h}=(0,l.st)(e,i,{commitHash:a,fromCommitHash:t,toCommitHash:n}),{resolvedTheme:m}=(0,x.D)(),[u,f]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{f(!1)},[i,a,t,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:a=null,fromCommitHash:t=null,toCommitHash:n=null}){let i=!!t&&!!n,c=i?`${t}..${n}`:a??"none",{data:d,isLoading:h}=(0,l.gg)(e,{commitHash:a,fromCommitHash:t,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 a={name:"",path:"",children:new Map};for(let t of e){let e=t.path.split("/").filter(Boolean),s=a,l="";for(let a=0;a<e.length;a++){let n=e[a];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),a===e.length-1&&(s.file=t)}}return a})(d?.files??[]),[d?.files]),k=(0,r.useMemo)(()=>(function e(a){let t=[];return Array.from(a.children.values()).forEach(a=>{a.children.size>0&&(t.push(a.path),t.push(...e(a)))}),t})(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(a=>{v.has(a)||e.add(a)}),u&&(function(e){let a=e.split("/").filter(Boolean),t=[];for(let e=1;e<a.length;e++)t.push(a.slice(0,e).join("/"));return t})(u).forEach(a=>e.add(a)),e},[k,v,u]),E=(0,r.useCallback)(e=>{N(a=>{let t=new Set(a[c]??new Set);return t.has(e)?t.delete(e):t.add(e),{...a,[c]:t}})},[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:a,fromCommitHash:t,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,a=""){let t={name:"",children:new Map};for(let s of e){let e=s.split("/"),l=t;for(let t=0;t<e.length;t++){let n=e[t];l.children.has(n)||l.children.set(n,{name:n,children:new Map}),l=l.children.get(n),t===e.length-1&&(l.fullPath=a?`${a}/${s}`:s)}}return t}function k(e,a,t){if(a[e])return a[e];let s=e.split("/");for(let e=s.length-1;e>0;e--){let t=s.slice(0,e).join("/");if(a[t])return a[t]}if(t){let e=t.split("/");for(let t=e.length;t>0;t--){let s=e.slice(0,t).join("/");if(a[s])return a[s]}}return null}function v(e){return Array.from(e.children.values()).sort((e,a)=>{let t=e.children.size>0&&!e.fullPath,s=a.children.size>0&&!a.fullPath;return t&&!s?-1:!t&&s?1:e.name.localeCompare(a.name)})}function w(e,a,t=""){let s=[];for(let l of v(e)){if(void 0!==l.fullPath){s.push(l.fullPath);continue}let e=t?`${t}/${l.name}`:l.name;a.has(e)&&s.push(...w(l,a,e))}return s}function C(e){let a=[];for(let t of v(e)){if(t.fullPath){a.push(t.fullPath);continue}a.push(...C(t))}return a}function S({type:e,isActive:a,isInherited:t,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",a&&"bg-primary/10",t&&"opacity-50",!a&&!n&&"opacity-0 group-hover:opacity-100"),onClick:l,title:"visible"===e?a?"Remove visible filter":"Show only this branch":a?"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:a,icon:t,isExpanded:l,onToggle:n,visibilityMap:r,onToggleVisibility:i,depth:c=0}){let d=r[a],h=a.includes("/")?a.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:t}),(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(a,"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(a,"hidden")},showOnHover:"hidden"===d||x&&"hidden"===u})]})]})}function E({node:e,currentBranch:a,expandedFolders:t,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,a)=>{let t=e.children.size>0&&!e.fullPath,s=a.children.size>0&&!a.fullPath;return t&&!s?-1:!t&&s?1:e.name.localeCompare(a.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=t.has(D),A=P&&e.fullPath===a,O=v[D],I=k(D,v,B),H=!O&&null!==I;if(T){let k=C(e).filter(e=>e!==a);return(0,s.jsxs)("div",{children:[(0,s.jsx)(c,{items:[{label:"Delete",icon:(0,s.jsx)("i",{className:"iconoir-trash text-[14px]","aria-hidden":"true"}),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:a,expandedFolders:t,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:a,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:a=>g?.(e.fullPath,{isMultiSelect:a.metaKey||a.ctrlKey,isRangeSelect:a.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 $=t(3321);function B(e){return Math.min(Math.max(e,100),900)}function M(e){return Math.min(Math.max(e,.15),.75)}async function F(e){try{return await navigator.clipboard.writeText(e),!0}catch{let a=document.createElement("textarea");a.value=e,a.style.position="fixed",a.style.left="-9999px",document.body.appendChild(a),a.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(a)}}}let P={isOpen:!1,executionId:null,scriptName:"",branchRef:"",output:"",status:"idle",error:null};function T({repoPath:e}){let a=(0,n.jE)(),{data:t}=(0,l.t0)(),i=(0,l.Y5)(),d=(0,$.useRouter)(),x=(0,$.useSearchParams)(),p=(x.get("branch")??"").trim(),b=(0,r.useRef)(null),f=(0,r.useRef)(null),[g,j]=(0,r.useState)(100),{data:v,isLoading:S,isError:T,error:D,refetch:L,isFetching:A}=(0,l._X)(e,g),{data:O,isLoading:I}=(0,l._6)(e),H=O?.current?.trim()??"",{data:_}=(0,l.en)(e),[K,W]=(0,r.useState)(null),[z,q]=(0,r.useState)([]),[G,V]=(0,r.useState)(null),U=(0,r.useCallback)(e=>{W(e),q(e?[e]:[]),V(e)},[]);(0,r.useEffect)(()=>{U(null),sg([]),sN(null)},[e,U]);let{mutateAsync:J}=(0,l.a3)(),Y=(0,r.useCallback)(()=>{let e=new URLSearchParams(x.toString()).toString();d.push(e?`/workspace/conflicts?${e}`:"/workspace/conflicts")},[d,x]),Q=(0,r.useCallback)(e=>{if(!(e instanceof Error))return!1;let a=e.message.toLowerCase();return a.includes("conflict")||a.includes("could not apply")||a.includes("fix conflicts")||a.includes("resolve all conflicts")||a.includes("merge --continue")||a.includes("rebase --continue")},[]);(0,r.useEffect)(()=>{b.current=null,f.current=null},[e]),(0,r.useEffect)(()=>{if(!p||!O)return;let a=`${e}:${p}`;if(b.current!==a){if(O.current===p){b.current=a;return}if(!O.branches.includes(p)){b.current=a,(0,u.oR)({type:"error",title:"Branch Not Found",description:`Branch "${p}" does not exist in this repository.`});return}b.current=a,(async()=>{try{await J({repoPath:e,action:"checkout",data:{branch:p}})}catch(e){console.error(e)}})()}},[O,e,p,J]);let[X,Z]=(0,r.useState)(!1),[ee,ea]=(0,r.useState)(""),[et,es]=(0,r.useState)(null),[el,en]=(0,r.useState)(!1),[er,ei]=(0,r.useState)(!1),[eo,ec]=(0,r.useState)(null),[ed,eh]=(0,r.useState)(""),[em,eu]=(0,r.useState)(!1),[ex,ep]=(0,r.useState)(!1),[eb,ef]=(0,r.useState)(!1),[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)(null),[eE,e$]=(0,r.useState)(!1),[eB,eM]=(0,r.useState)(!1),[eF,eP]=(0,r.useState)(null),[eT,eD]=(0,r.useState)(!1),[eL,eA]=(0,r.useState)(!1),[eO,eI]=(0,r.useState)(!1),[eH,e_]=(0,r.useState)([]),[eK,eW]=(0,r.useState)(!1),[ez,eq]=(0,r.useState)(!1),[eG,eV]=(0,r.useState)(!1),[eU,eJ]=(0,r.useState)(!1),[eY,eQ]=(0,r.useState)(null),[eX,eZ]=(0,r.useState)(null),[e0,e1]=(0,r.useState)(""),[e2,e4]=(0,r.useState)(!1),[e3,e5]=(0,r.useState)(!1),[e7,e6]=(0,r.useState)(!1),[e8,e9]=(0,r.useState)(null),[ae,aa]=(0,r.useState)(""),[at,as]=(0,r.useState)(!1),[al,an]=(0,r.useState)(!1),[ar,ai]=(0,r.useState)(null),[ao,ac]=(0,r.useState)(!1),[ad,ah]=(0,r.useState)(!1),[am,au]=(0,r.useState)("origin"),[ax,ap]=(0,r.useState)(""),[ab,af]=(0,r.useState)(!1),[ag,aj]=(0,r.useState)(!1),[aN,ay]=(0,r.useState)(null),[ak,av]=(0,r.useState)(null),[aw,aC]=(0,r.useState)(!0),[aS,aR]=(0,r.useState)(!1),[aE,a$]=(0,r.useState)("checking"),aB=(0,r.useCallback)(()=>{aj(!1),ay(null),av(null),a$("checking")},[]),[aM,aF]=(0,r.useState)(!1),[aP,aT]=(0,r.useState)(null),[aD,aL]=(0,r.useState)(null),[aA,aO]=(0,r.useState)(!1),[aI,aH]=(0,r.useState)(!1),[a_,aK]=(0,r.useState)(!1),[aW,az]=(0,r.useState)(""),[aq,aG]=(0,r.useState)(!1),[aV,aU]=(0,r.useState)("checking"),aJ=(0,r.useCallback)(()=>{aF(!1),aT(null),aL(null),aU("checking")},[]),[aY,aQ]=(0,r.useState)(!1),[aX,aZ]=(0,r.useState)(null),[a0,a1]=(0,r.useState)([]),[a2,a4]=(0,r.useState)(""),[a3,a5]=(0,r.useState)([]),[a7,a6]=(0,r.useState)(""),[a8,a9]=(0,r.useState)(null),[te,ta]=(0,r.useState)(!1),[tt,ts]=(0,r.useState)(!1),[tl,tn]=(0,r.useState)(!0),[tr,ti]=(0,r.useState)(!1),[to,tc]=(0,r.useState)(""),[td,th]=(0,r.useState)(!1),[tm,tu]=(0,r.useState)(null),[tx,tp]=(0,r.useState)(!1),[tb,tf]=(0,r.useState)(!1),[tg,tj]=(0,r.useState)(!1),[tN,ty]=(0,r.useState)(null),[tk,tv]=(0,r.useState)([]),[tw,tC]=(0,r.useState)(""),[tS,tR]=(0,r.useState)([]),[tE,t$]=(0,r.useState)(""),[tB,tM]=(0,r.useState)(null),[tF,tP]=(0,r.useState)(!0),[tT,tD]=(0,r.useState)(!1),[tL,tA]=(0,r.useState)(null),[tO,tI]=(0,r.useState)(!1),[tH,t_]=(0,r.useState)(!1),[tK,tW]=(0,r.useState)(!1),[tz,tq]=(0,r.useState)(!1),[tG,tV]=(0,r.useState)(!1),[tU,tJ]=(0,r.useState)(!1),[tY,tQ]=(0,r.useState)(null),[tX,tZ]=(0,r.useState)(""),[t0,t1]=(0,r.useState)(!1),[t2,t4]=(0,r.useState)(!1),[t3,t5]=(0,r.useState)(null),[t7,t6]=(0,r.useState)(!1),[t8,t9]=(0,r.useState)(!1),[se,sa]=(0,r.useState)(null),[st,ss]=(0,r.useState)(!1),[sl,sn]=(0,r.useState)(!1),[sr,si]=(0,r.useState)(null),[so,sc]=(0,r.useState)(""),[sd,sh]=(0,r.useState)(""),[sm,su]=(0,r.useState)(!1),sx=(0,r.useRef)(null),[sp,sb]=(0,r.useState)(null),[sf,sg]=(0,r.useState)([]),[sj,sN]=(0,r.useState)(null),[sy,sk]=(0,r.useState)(!1),sv=(0,r.useRef)(null),[sw,sC]=(0,r.useState)(P),[sS,sR]=(0,r.useState)(!1),[sE,s$]=(0,r.useState)(!1),[sB,sM]=(0,r.useState)(!1),sF="starting"===sw.status||"running"===sw.status,sP="completed"===sw.status||"failed"===sw.status||"canceled"===sw.status;(0,r.useEffect)(()=>{sP&&sw.executionId&&a.invalidateQueries({queryKey:["git",e]})},[sP,sw.executionId,a,e]);let sT=(0,r.useCallback)(()=>{eJ(!1),eQ(null),eZ(null),e1(""),e4(!1)},[]),sD=(0,r.useCallback)(()=>{e6(!1),e9(null),aa("")},[]),sL=(0,r.useCallback)(()=>{an(!1),ai(null)},[]),sA=(0,r.useCallback)(()=>{ah(!1),au("origin"),ap("")},[]),sO=(0,r.useCallback)(()=>{sn(!1),si(null),sc(""),sh("")},[]),sI=(0,r.useCallback)(()=>{if(ez){eq(!1),e_([]);return}if(tU)return void tJ(!1);if(X){Z(!1),es(null);return}if(er){ei(!1),ec(null),eh(""),eu(!1);return}if(tg)return void tj(!1);if(aY)return void aQ(!1);if(aM)return void aJ();if(ag)return void aB();if(eU)return void sT();if(e7)return void sD();if(al)return void sL();if(ad)return void sA();if(eO){eI(!1),e_([]);return}if(eb){ef(!1),ej([]),ey(!1);return}if(ew){eC(!1),eR(null);return}if(eB){eM(!1),eP(null),eD(!1);return}if(sl)return void sO();if(t2)return void t4(!1);if(t8){t9(!1),sa(null);return}sy?sk(!1):sw.isOpen&&sP&&(sC(P),sM(!1),sR(!1))},[ez,tU,X,er,tg,aY,aJ,aM,aB,ag,eU,sT,e7,sD,al,sL,ad,sA,eO,eb,ew,eB,sl,sO,t2,t8,sy,sw.isOpen,sP]),sH=t2||t8||sl||eb||ew||eB||ez||eO||eU||e7||al||ad||ag||aM||aY||tg||X||er||tU||sy||sw.isOpen;(0,m.v)(sH,sI);let s_="git-web:history-panel-height",sK="git-web:history-commit-details-message-ratio",[sW,sz]=(0,r.useState)(300),[sq,sG]=(0,r.useState)(!1),sV=(0,r.useRef)(null),[sU,sJ]=(0,r.useState)(.28),[sY,sQ]=(0,r.useState)(!1),sX=(0,r.useRef)(null),sZ=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(t?.historyPanelHeight)sz(B(t.historyPanelHeight));else try{let e=localStorage.getItem(s_);if(e){let a=parseInt(e,10);!isNaN(a)&&a>=100&&a<=900&&sz(a)}}catch(e){console.error("Failed to load panel height from localStorage:",e)}},[t?.historyPanelHeight]),(0,r.useEffect)(()=>{try{localStorage.setItem(s_,String(sW))}catch(e){console.error("Failed to save panel height to localStorage:",e)}},[sW]),(0,r.useEffect)(()=>{try{let e=localStorage.getItem(sK);if(!e)return;let a=parseFloat(e);Number.isNaN(a)||sJ(M(a))}catch(e){console.error("Failed to load commit details ratio from localStorage:",e)}},[]),(0,r.useEffect)(()=>{try{localStorage.setItem(sK,String(sU))}catch(e){console.error("Failed to save commit details ratio to localStorage:",e)}},[sU]),(0,r.useEffect)(()=>{!sq&&sZ.current&&(i.mutate({historyPanelHeight:sW}),sZ.current=!1)},[sq,sW,i]);let s0=(0,r.useCallback)(e=>{e.preventDefault(),sG(!0),sV.current={startY:e.clientY,startHeight:sW}},[sW]);(0,r.useEffect)(()=>{if(!sq)return;let e=e=>{if(!sV.current)return;let a=sV.current.startY-e.clientY;sz(B(sV.current.startHeight+a)),sZ.current=!0},a=()=>{sG(!1),sV.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",a),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",a)}},[sq]);let s1=(0,r.useCallback)(e=>{e.preventDefault(),sQ(!0)},[]);(0,r.useEffect)(()=>{if(!sY)return;let e=e=>{let a=sX.current;if(!a)return;let t=a.getBoundingClientRect();t.height<=0||sJ(M((e.clientY-t.top)/t.height))},a=()=>{sQ(!1)};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",a),document.body.style.cursor="ns-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",a),document.body.style.cursor="",document.body.style.userSelect=""}},[sY]),(0,r.useEffect)(()=>{if(!sy)return;let e=e=>{sv.current&&!sv.current.contains(e.target)&&sk(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[sy]);let s2=(0,r.useMemo)(()=>O?.branches?y(O.branches):null,[O?.branches]),s4=(0,r.useMemo)(()=>{if(!O?.remotes)return null;var e=O.remotes;let a=new Map;for(let[t,s]of Object.entries(e))a.set(t,y(s,`remotes/${t}`));return a},[O?.remotes]),s3=(0,r.useMemo)(()=>{let e=new Set;for(let a of O?.branches??[])e.add(a);for(let[a,t]of Object.entries(O?.remotes??{}))for(let s of t)e.add(`remotes/${a}/${s}`);return e},[O?.branches,O?.remotes]),s5=(0,r.useMemo)(()=>new Set(sf),[sf]),s7=(0,l.GK)(e),s6=(0,l.Lp)(),s8=(0,r.useMemo)(()=>(s7?.customScripts??[]).filter(e=>"branch"===e.target&&"run-bash-script"===e.action&&e.name.trim().length>0&&e.content.trim().length>0),[s7?.customScripts]),[s9,le]=(0,r.useState)(!0),[la,lt]=(0,r.useState)(!0),[ls,ll]=(0,r.useState)(!0),[ln,lr]=(0,r.useState)({}),[li,lo]=(0,r.useState)(new Set),lc=(0,r.useMemo)(()=>{let e=[];if(s9&&s2&&e.push(...w(s2,li)),la&&s4)for(let[a,t]of Array.from(s4.entries())){let s=`__remotes__/${a}`;li.has(s)&&e.push(...w(t,li,`remotes/${a}`))}return e},[li,s2,s9,s4,la]);(0,r.useEffect)(()=>{if(0===sf.length)return;let e=sf.filter(e=>s3.has(e));e.length!==sf.length&&sg(e),sj&&!s3.has(sj)&&sN(e.length>0?e[e.length-1]:null)},[s3,sj,sf]);let ld=(0,r.useRef)(null);(0,r.useEffect)(()=>{s7&&s7.path!==ld.current&&(ld.current=s7.path,void 0!==s7.localGroupExpanded&&le(s7.localGroupExpanded),void 0!==s7.remotesGroupExpanded&<(s7.remotesGroupExpanded),void 0!==s7.worktreesGroupExpanded&&ll(s7.worktreesGroupExpanded),s7.expandedFolders&&lo(new Set(s7.expandedFolders)),s7.visibilityMap&&lr(s7.visibilityMap))},[s7]);let lh=(0,r.useCallback)(a=>{s6.mutate({path:e,updates:a})},[e,s6]),lm=(0,r.useCallback)(()=>{let e=!s9;le(e),lh({localGroupExpanded:e})},[s9,lh]),lu=(0,r.useCallback)(()=>{let e=!la;lt(e),lh({remotesGroupExpanded:e})},[la,lh]),lx=(0,r.useCallback)(()=>{let e=!ls;ll(e),lh({worktreesGroupExpanded:e})},[lh,ls]),lp=(0,r.useCallback)(e=>{lo(a=>{let t=new Set(a);return t.has(e)?t.delete(e):t.add(e),lh({expandedFolders:Array.from(t)}),t})},[lh]),lb=(0,r.useCallback)((e,a)=>{lr(t=>{let s={...t};s[e]===a?delete s[e]:s[e]=a;let l={};return Object.entries(s).forEach(([e,a])=>{("visible"===a||"hidden"===a)&&(l[e]=a)}),lh({visibilityMap:l}),s})},[lh]),lf=(0,r.useCallback)(()=>{lr({}),lh({visibilityMap:{}})},[lh]),lg=(0,r.useCallback)((e,a)=>{let t=k(e,ln);if(t)return t;if(a){let a=e.split("/");if(a.length>=2&&"remotes"===a[0]){let e=a[1],t=ln[`__remotes__/${e}`];if(t)return t;let s=ln.__remotes__;if(s)return s}}else{let e=ln.__local__;if(e)return e}return null},[ln]),lj=(0,r.useMemo)(()=>{if(!v?.all||!O?.branches||!O?.branchCommits)return v?.all||[];let e=Object.values(ln).some(e=>"visible"===e),a=Object.values(ln).some(e=>"hidden"===e);if(!e&&!a)return v.all;let t=[...O.branches.map(e=>({branch:e,isRemote:!1}))];if(O.remotes)for(let[e,a]of Object.entries(O.remotes))for(let s of a)t.push({branch:`remotes/${e}/${s}`,isRemote:!0});let s=new Set,l=new Set,n=new Set;for(let{branch:e,isRemote:a}of t){let t=lg(e,a);"visible"===t?s.add(e):"hidden"===t?l.add(e):n.add(e)}let r=new Map(v.all.map(e=>[e.hash,e])),i=(e,a)=>{let t=[e];for(;t.length>0;){let e=t.pop();if(a.has(e))continue;let s=r.get(e);if(s)for(let l of(a.add(e),s.parents||[]))a.has(l)||t.push(l)}},o=new Set;for(let e of s){let a=O.branchCommits[e];a&&i(a,o)}if(e)return v.all.filter(e=>o.has(e.hash));if(a){let e=new Set;for(let a of n){let t=O.branchCommits[a];t&&i(t,e)}return v.all.filter(a=>e.has(a.hash))}return v.all},[v?.all,O?.branches,O?.branchCommits,O?.remotes,ln,lg]),lN=(0,r.useMemo)(()=>new Set(z),[z]),ly=(0,r.useMemo)(()=>lj.map(e=>e.hash),[lj]),lk=(0,r.useMemo)(()=>K?v?.all.find(e=>e.hash===K):null,[v?.all,K]),lv=(0,r.useMemo)(()=>{if(!v?.all||z.length<2)return null;let e=new Map(v.all.map(e=>[e.hash,e])),a=new Map(ly.map((e,a)=>[e,a])),t=Array.from(new Set(z)).filter(e=>a.has(e)).sort((e,t)=>(a.get(e)??Number.MAX_SAFE_INTEGER)-(a.get(t)??Number.MAX_SAFE_INTEGER));if(t.length<2)return null;let s=t[0],l=t[t.length-1],n=e.get(s),r=e.get(l);return n&&r?{latestHash:s,oldestHash:l,latestCommit:n,oldestCommit:r}:null},[ly,v?.all,z]),lw=!!lv;(0,r.useEffect)(()=>{if(0===ly.length){(K||z.length>0||G)&&U(null);return}let e=new Set(ly),a=z.filter(a=>e.has(a));a.length!==z.length&&q(a),K&&!e.has(K)&&W(a.length>0?a[a.length-1]:null),G&&!e.has(G)&&V(a.length>0?a[a.length-1]:null)},[ly,K,z,G,U]);let lC=(0,r.useCallback)((e,a)=>{let t=a?.isRangeSelect??!1,s=a?.isMultiSelect??!1;if(t){let a=G??K??e,t=ly.indexOf(a),s=ly.indexOf(e);if(-1!==t&&-1!==s){let[l,n]=t<s?[t,s]:[s,t];q(ly.slice(l,n+1)),W(e),V(a);return}}if(s){if(lN.has(e)){let a=z.filter(a=>a!==e);q(a),W(t=>t!==e?t:a.length>0?a[a.length-1]:null),G===e&&V(a.length>0?a[a.length-1]:null)}else q([...z,e]),W(e),V(e);return}U(e)},[ly,lN,z,K,G,U]),lS=(0,r.useMemo)(()=>lj.filter(e=>lN.has(e.hash)).reverse(),[lj,lN]),lR=(0,r.useMemo)(()=>Object.values(ln).some(e=>"visible"===e||"hidden"===e),[ln]),lE=(0,r.useMemo)(()=>{let e=new Set;if(O?.branches)for(let a of O.branches)"hidden"===lg(a,!1)&&e.add(a);if(O?.remotes)for(let[a,t]of Object.entries(O.remotes))for(let s of t){let t=`remotes/${a}/${s}`;"hidden"===lg(t,!0)&&e.add(t)}return e},[O?.branches,O?.remotes,lg]);(0,r.useEffect)(()=>{lR&&lj.length<50&&!A&&g<5e3&&v?.all&&v.all.length>=g&&j(e=>Math.min(e+100,5e3))},[lR,lj.length,A,g,v?.all]),(0,r.useEffect)(()=>{sp&&v?.all&&!A&&(v.all.some(e=>e.hash===sp)?requestAnimationFrame(()=>{sx.current?.scrollToCommit(sp)&&(U(sp),sb(null))}):g<5e3?j(e=>e+100):(console.warn("Could not find commit after loading 5000 commits"),sb(null)))},[sp,v?.all,A,g,U]);let l$=(0,r.useCallback)(e=>{if(!O?.branchCommits)return;let a=O.branchCommits[e];if(a){if(v?.all?.some(e=>e.hash===a)&&sx.current&&sx.current.scrollToCommit(a))return void U(a);sb(a),U(a)}},[O?.branchCommits,v?.all,U]);(0,r.useEffect)(()=>{if(!p||!O?.branchCommits||H!==p)return;let a=`${e}:${p}`;f.current!==a&&(f.current=a,l$(p))},[H,O?.branchCommits,e,p,l$]);let lB=(0,r.useCallback)((e,a)=>{let t=a?.isRangeSelect??!1,s=a?.isMultiSelect??!1;if(t){let a=sj??e,t=lc.indexOf(a),s=lc.indexOf(e);if(-1!==t&&-1!==s){let[l,n]=t<s?[t,s]:[s,t],r=lc.slice(l,n+1);s5.has(e)?sg(sf.filter(e=>!r.includes(e))):sg(Array.from(new Set([...sf,...r]))),sN(a)}else sg([e]),sN(e);return}if(s){s5.has(e)?sg(sf.filter(a=>a!==e)):sg([...sf,e]),sN(e);return}sg([e]),sN(e),l$(e)},[sj,lc,l$,sf,s5]),lM=(0,r.useCallback)(e=>{s5.has(e)||(sg([e]),sN(e))},[s5]),lF=(0,r.useCallback)(async(a,t)=>{sM(!1),sR(!1),sC({isOpen:!0,executionId:null,scriptName:a.name,branchRef:t,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:t,scriptContent:a.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})`),sC(e=>({...e,executionId:l.executionId,output:[n.join("\n"),l.output].filter(Boolean).join("\n"),status:l.status,error:null}))}catch(e){sC(a=>({...a,status:"failed",error:e.message,output:a.output?`${a.output}
|
|
2
|
+
[error] ${e.message}`:`[error] ${e.message}`}))}},[e]),lP=(0,r.useCallback)(async()=>{if(sw.executionId&&sF){sR(!0);try{let e=await fetch("/api/custom-scripts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:"cancel",executionId:sw.executionId})}),a=await e.json();if(!e.ok)throw Error(a.error||"Failed to cancel script execution");sC(e=>({...e,output:a.output,status:a.status})),"running"!==a.status&&"starting"!==a.status&&sR(!1)}catch(e){sC(a=>({...a,output:`${a.output}
|
|
3
|
+
[error] ${e.message}`})),sR(!1)}}},[sw.executionId,sF]),lT=(0,r.useCallback)(async()=>{if(sE)return;s$(!0);let e=await F(sw.output);s$(!1),sM(e),e&&setTimeout(()=>sM(!1),1500)},[sE,sw.output]);(0,r.useEffect)(()=>{if(!sw.executionId||!sF)return;let e=!1,a=null,t=async()=>{try{let s=await fetch("/api/custom-scripts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:"status",executionId:sw.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;sC(e=>e.executionId!==l.executionId?e:{...e,output:l.output,status:n,error:null}),"running"===n?a=setTimeout(t,450):sR(!1)}catch(a){if(e)return;sR(!1),sC(e=>({...e,status:"failed",error:a.message,output:e.output?`${e.output}
|
|
4
|
+
[error] ${a.message}`:`[error] ${a.message}`}))}};return t(),()=>{e=!0,a&&clearTimeout(a)}},[sw.executionId,sF]);let lD=e=>{let a=e.filter(e=>e!==ng);0!==a.length&&(ej(a),ey(!1),ef(!0))},lL=e=>{lD([e])},lA=(0,r.useCallback)(e=>{let a=e.trim();a&&(eR(a),eC(!0))},[]),lO=(0,r.useCallback)(()=>{eM(!1),eP(null),eD(!1)},[]),lI=(0,r.useCallback)(e=>{e&&(eP(e),eD(!1),eM(!0))},[]),lH=async()=>{if(0!==eg.length){ev(!0);try{let a=new Map,t=(e,t,s)=>{a.has(e)||a.set(e,{branchRef:t,run:s})},l=new Set;if(eN)for(let e of eg){if(e.startsWith("remotes/"))continue;let a=O?.trackingInfo?.[e];a?.upstream&&l.add(a.upstream)}for(let a of l){let[s,...l]=a.split("/"),n=l.join("/");if(s&&n){let a=`${s}/${n}`;t(`remote:${a}`,a,()=>J({repoPath:e,action:"delete-remote-branch",data:{remote:s,branch:n},suppressErrorToast:!0}))}}for(let a of eg){if(a.startsWith("remotes/")){let s=a.split("/");if(s.length>=3){let a=s[1],l=s.slice(2).join("/"),n=`${a}/${l}`;t(`remote:${n}`,n,()=>J({repoPath:e,action:"delete-remote-branch",data:{remote:a,branch:l},suppressErrorToast:!0}))}continue}t(`local:${a}`,a,()=>J({repoPath:e,action:"delete-branch",data:{branch:a},suppressErrorToast:!0}))}let n=Array.from(a.values()),r=(await Promise.allSettled(n.map(e=>e.run()))).flatMap((e,a)=>{if("fulfilled"===e.status)return[];let t=n[a].branchRef;return console.error(`Failed to delete branch "${t}":`,e.reason),[t]});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}),ef(!1),ej([]),ey(!1),sg([]),sN(null)}catch(e){console.error(e)}finally{ev(!1)}}},l_=async()=>{if(eF){eA(!0);try{if(await J({repoPath:e,action:"delete-tag",data:{tag:eF}}),eT&&nN)try{await J({repoPath:e,action:"delete-remote-tag",data:{remote:nN,tag:eF}})}catch(e){console.error("Failed to delete remote tag:",e)}lO()}catch(e){console.error(e)}finally{eA(!1)}}},lK=async()=>{if(eS){e$(!0);try{await J({repoPath:e,action:"delete-worktree",data:{path:eS}}),eC(!1),eR(null)}catch(e){console.error(e)}finally{e$(!1)}}},lW=e=>{eQ(e),eZ(null),e1(e),e4(!1),eJ(!0)},lz=e=>{let a=e.split("/");if(a.length<3||"remotes"!==a[0])return;let t=a[1],s=a.slice(2).join("/");t&&s&&(eQ(e),eZ({remote:t,branch:s}),e1(s),e4(!1),eJ(!0))},lq=async()=>{if(eY&&e0){if(eX?eX.branch===e0:eY===e0)return void sT();e5(!0);try{eX?await J({repoPath:e,action:"rename-remote-branch",data:{remote:eX.remote,oldName:eX.branch,newName:e0}}):await J({repoPath:e,action:"rename-branch",data:{oldName:eY,newName:e0,renameTrackingRemote:e2}}),sT()}catch(e){console.error(e)}finally{e5(!1)}}},lG=async()=>{if(!e8)return;let a=e8.trim(),t=ae.trim();if(a&&t){if(a===t)return void sD();as(!0);try{await J({repoPath:e,action:"rename-remote",data:{oldName:a,newName:t}}),sD()}catch(e){console.error(e)}finally{as(!1)}}},lV=async()=>{if(!ar)return;let a=ar.trim();if(a){ac(!0);try{await J({repoPath:e,action:"delete-remote",data:{name:a}}),sL()}catch(e){console.error(e)}finally{ac(!1)}}},lU=async()=>{let a=am.trim(),t=ax.trim();if(a&&t){af(!0);try{await J({repoPath:e,action:"add-remote",data:{name:a,url:t}}),sA()}catch(e){console.error(e)}finally{af(!1)}}},lJ=({sourceBranch:e,targetBranch:a})=>{ay(e),av(a),aC(!0),a$("checking"),aj(!0)},lY=async()=>{if(aN&&ak){aR(!0);try{await J({repoPath:e,action:"checkout",data:{branch:aN}}),await J({repoPath:e,action:"rebase",data:{ontoBranch:ak,stashChanges:aw}}),aB()}catch(e){Q(e)&&(aB(),Y(),(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{aR(!1)}}};(0,r.useEffect)(()=>{if(!ag||!aN||!ak)return;let a=!1;return a$("checking"),(async()=>{try{let t=await J({repoPath:e,action:"check-rebase-conflicts",data:{sourceBranch:aN,ontoBranch:ak}});a||a$(t.hasConflicts?"has-conflicts":"no-conflict")}catch(e){console.error(e),a||a$("has-conflicts")}})(),()=>{a=!0}},[ag,aN,ak,e,J]);let lQ=({sourceBranch:e,targetBranch:a})=>{aT(a),aL(e),aO(!1),aH(!1),aK(!1),az(""),aU("checking"),aF(!0)},lX=(0,r.useCallback)(a=>{if(aH(a),a){if(!aD)return void az("");(async()=>{try{let a=await J({repoPath:e,action:"get-latest-commit-message",data:{branch:aD}});az("string"==typeof a?.message?a.message:"")}catch(e){console.error(e),az("")}})()}},[aD,e,J]),lZ=async()=>{if(aP&&aD){aG(!0);try{await J({repoPath:e,action:"checkout",data:{branch:aP}}),await J({repoPath:e,action:"merge",data:{targetBranch:aD,rebaseBeforeMerge:aA,squash:aI,fastForward:a_,squashMessage:aI?aW:void 0}}),aJ()}catch(e){Q(e)&&(aJ(),Y(),(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{aG(!1)}}};(0,r.useEffect)(()=>{if(!aM||!aD||!aP)return;let a=!1;return aU("checking"),(async()=>{try{let t=await J({repoPath:e,action:"check-merge-conflicts",data:{sourceBranch:aD,targetBranch:aP}});a||aU(t.hasConflicts?"has-conflicts":"no-conflict")}catch(e){console.error(e),a||aU("has-conflicts")}})(),()=>{a=!0}},[aM,aD,aP,e,J]);let l0=async a=>{aZ(a),tu(null),a1([]),a5([]),a4(""),a6(""),a9(null),ta(!1),ts(!1),tn(!0),ti(!1),tc(""),aQ(!0),tp(!0);try{let t=await J({repoPath:e,action:"get-remotes",data:{}});if(!t.remotes||0===t.remotes.length){tu("No remote repository configured. Please add a remote first."),tp(!1);return}a1(t.remotes);let s=await J({repoPath:e,action:"get-tracking-branch",data:{branch:a}});a9(s.tracking);let l=s.tracking?.remote,n=l&&t.remotes.includes(l)?l:t.remotes[0];a4(n),tf(!0);let r=await J({repoPath:e,action:"get-remote-branches",data:{remote:n}});a5(r.branches||[]),s.tracking?.remote===n&&s.tracking?.branch?a6(s.tracking.branch):(r.branches?.includes(a),a6(a))}catch(e){console.error(e),tu(e.message||"Failed to load remote information")}finally{tp(!1),tf(!1)}},l1=async a=>{a4(a),tf(!0),a5([]);try{let t=await J({repoPath:e,action:"get-remote-branches",data:{remote:a}});a5(t.branches||[]),a8?.remote===a&&a8?.branch?a6(a8.branch):a6(aX||"")}catch(e){console.error(e),tu(e.message||"Failed to load remote branches")}finally{tf(!1)}},l2=(0,r.useCallback)(a=>{if(ti(a),a){if(!aX)return void tc("");(async()=>{try{let a=await J({repoPath:e,action:"get-latest-commit-message",data:{branch:aX}});tc("string"==typeof a?.message?a.message:"")}catch(e){console.error(e),tc("")}})()}},[aX,e,J]),l4=async()=>{if(aX&&a2&&a7){th(!0),tu(null);try{let a=!a3.includes(a7)||a8?.remote!==a2||a8?.branch!==a7;await J({repoPath:e,action:"push-to-remote",data:{localBranch:aX,remote:a2,remoteBranch:a7,rebaseFirst:!tt&&te,forcePush:tt,pushLocalOnlyTags:tl,setUpstream:a,squash:tr,squashMessage:to}}),await J({repoPath:e,action:"fetch",data:{remote:a2}}),aQ(!1),aZ(null)}catch(e){console.error(e),tu(e.message||"Failed to push to remote")}finally{th(!1)}}},l3=async a=>{ty(a),tA(null),tv([]),tR([]),tC(""),t$(""),tM(null),tP(!0),tj(!0),tI(!0);try{let t=await J({repoPath:e,action:"get-remotes",data:{}});if(!t.remotes||0===t.remotes.length){tA("No remote repository configured. Please add a remote first."),tI(!1);return}tv(t.remotes);let s=await J({repoPath:e,action:"get-tracking-branch",data:{branch:a}});tM(s.tracking);let l=s.tracking?.remote,n=l&&t.remotes.includes(l)?l:t.remotes[0];tC(n),t_(!0);let r=await J({repoPath:e,action:"get-remote-branches",data:{remote:n}});tR(r.branches||[]),s.tracking?.remote===n&&s.tracking?.branch?t$(s.tracking.branch):t$("")}catch(e){console.error(e),tA(e.message||"Failed to load remote information")}finally{tI(!1),t_(!1)}},l5=async a=>{tC(a),t_(!0),tR([]),t$("");try{let t=await J({repoPath:e,action:"get-remote-branches",data:{remote:a}});tR(t.branches||[]),tB?.remote===a&&tB?.branch?t$(tB.branch):t$("")}catch(e){console.error(e),tA(e.message||"Failed to load remote branches")}finally{t_(!1)}},l7=async()=>{if(tN&&tw&&tE){tD(!0),tA(null);try{await J({repoPath:e,action:"pull-from-remote",data:{localBranch:tN,remote:tw,remoteBranch:tE,rebase:tF}}),tj(!1),ty(null)}catch(e){console.error(e),tA(e.message||"Failed to pull from remote")}finally{tD(!1)}}},l6=e=>{tQ(e),tZ(e.split("/").slice(2).join("/")),tJ(!0)},l8=async()=>{if(tY&&tX){t1(!0);try{await J({repoPath:e,action:"checkout-to-local",data:{remoteBranch:tY,localBranch:tX}}),tJ(!1),tQ(null),tZ("")}catch(e){console.error(e)}finally{t1(!1)}}},l9=async()=>{tW(!0);try{await J({repoPath:e,action:"fetch",data:{allRemotes:!0}})}catch(e){console.error(e)}finally{tW(!1)}},ne=(0,r.useCallback)(async()=>{if(!tz){tq(!0);try{let a=await fetch("/api/fs/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),t=await a.json().catch(()=>({}));if(!a.ok)throw Error(t.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{tq(!1)}}},[tz,e]),na=(0,r.useCallback)(async()=>{if(!tG){tV(!0);try{let a=await fetch("/api/fs/open-terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),t=await a.json().catch(()=>({}));if(!a.ok)throw Error(t.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{tV(!1)}}},[tG,e]),nt=(0,r.useCallback)((e,a)=>{if(a)return;let t=window.location.origin;try{window.top?.location?.origin&&(t=window.top.location.origin)}catch{}let s=`${t}/workspace?path=${encodeURIComponent(e)}`;window.open(s,"_blank","noopener,noreferrer")},[]),ns=async a=>{try{await J({repoPath:e,action:"fetch",data:{remote:a}})}catch(e){console.error(e)}},nl=async a=>{try{await J({repoPath:e,action:"checkout",data:{branch:a}})}catch(e){console.error(e)}},nn=async e=>{t5(e),t4(!0)},nr=async()=>{if(t3){t6(!0);try{await J({repoPath:e,action:"reset",data:{commitHash:t3,mode:"hard"}}),t4(!1),t5(null)}catch(e){console.error(e)}finally{t6(!1)}}},ni=async()=>{if(se){ss(!0);try{await J({repoPath:e,action:"revert",data:{commitHash:se.hash}}),t9(!1),sa(null)}catch(e){console.error(e)}finally{ss(!1)}}},no=async()=>{if(sr&&so.trim()){su(!0);try{let a,t;await J({repoPath:e,action:"reword",data:{commitHash:sr.hash,message:(a=so.trim(),(t=sd.replace(/\r\n/g,"\n")).trim()?`${a}
|
|
5
|
+
|
|
6
|
+
${t}`:a),branch:sr.branch}}),sO()}catch(e){console.error(e)}finally{su(!1)}}},nc=e=>{if(!(e instanceof Error))return!1;let a=e.message.toLowerCase();return a.includes("cherry-pick")&&a.includes("already in progress")},nd=e=>{if(!(e instanceof Error))return!1;let a=e.message.toLowerCase();return a.includes("could not apply")||a.includes("conflict")||a.includes("cherry-pick --continue")},nh=(0,r.useCallback)(async a=>{1===a.length?await J({repoPath:e,action:"cherry-pick",data:{commitHash:a[0]}}):await J({repoPath:e,action:"cherry-pick-multiple",data:{commitHashes:a}})},[e,J]),nm=(0,r.useCallback)(async()=>{try{await J({repoPath:e,action:"cherry-pick-abort"})}catch(e){console.error(e)}finally{eI(!1),eq(!1),e_([])}},[e,J]),nu=async()=>{if(0!==eH.length){eW(!0);try{let e=eH.map(e=>e.hash);await nh(e),eI(!1),e_([])}catch(e){nc(e)?(eI(!1),eq(!0)):nd(e)&&await nm(),console.error(e)}finally{eW(!1)}}},nx=async()=>{if(0===eH.length)return void eq(!1);eV(!0);try{await J({repoPath:e,action:"cherry-pick-abort"});let a=eH.map(e=>e.hash);await nh(a),eq(!1),e_([])}catch(e){nc(e)?eq(!0):nd(e)&&await nm(),console.error(e)}finally{eV(!1)}},np=async()=>{if(ee){en(!0);try{await J({repoPath:e,action:"branch",data:{branch:ee,fromRef:et||void 0}}),Z(!1),ea(""),es(null)}catch(e){console.error(e)}finally{en(!1)}}},nb=e=>{es(e||null),Z(!0)},nf=async()=>{if(eo&&ed.trim()){ep(!0);try{await J({repoPath:e,action:"create-tag",data:{tagName:ed.trim(),commitHash:eo,pushToRemote:em}}),ei(!1),ec(null),eh(""),eu(!1)}catch(e){console.error(e)}finally{ep(!1)}}},ng=O?.current,nj=O?.trackingInfo,nN=(0,r.useMemo)(()=>Object.keys(O?.remoteUrls??{}).sort((e,a)=>"origin"===e?-1:"origin"===a?1:e.localeCompare(a)),[O?.remoteUrls])[0]||null,ny=(0,r.useMemo)(()=>{let e=[];for(let a of eg){if(a.startsWith("remotes/"))continue;let t=nj?.[a]?.upstream;t&&e.push(t)}return Array.from(new Set(e))},[eg,nj]),nk=(0,r.useMemo)(()=>!eY||eX?null:nj?.[eY]??null,[eY,eX,nj]),nv=_?.files?.length,nw=ng||(I?"Loading branches...":"Detached HEAD"),nC=ng&&"number"==typeof nv&&nv>0?`${ng} (${nv})`:nw,nS=(0,r.useMemo)(()=>{if(!ng)return null;let e=nj?.[ng];if(!e?.upstream)return null;let a=e.upstream.indexOf("/");return a<=0?null:{upstream:e.upstream,remote:e.upstream.slice(0,a),branch:e.upstream.slice(a+1)}},[ng,nj]),nR=(0,r.useMemo)(()=>I?"Loading branches...":ng?nS?null:`Branch "${ng}" has no tracking remote branch`:"Not on a local branch",[ng,nS,I]),nE=(0,r.useMemo)(()=>I?"Loading branches...":ng?null:"Not on a local branch",[ng,I]),n$=e=>{let a=function(e,a){let{branchRef:t,branchLeafName:l,currentBranch:n,isRemote:r,selectedBranchRefs:i}=e,o=!r&&t===n,c=i&&i.length>0?i:[t],d=c.length>1,h=[];return o||r||h.push({label:"Checkout",icon:(0,s.jsx)("i",{className:"iconoir-arrow-right text-[14px]","aria-hidden":"true"}),onClick:()=>a.onCheckout(t)}),r&&h.push({label:"Checkout to local",icon:(0,s.jsx)("i",{className:"iconoir-arrow-down text-[14px]","aria-hidden":"true"}),onClick:()=>a.onCheckoutToLocal(t)}),h.push({label:"Create Branch",icon:(0,s.jsx)("i",{className:"iconoir-plus-circle text-[14px]","aria-hidden":"true"}),onClick:()=>a.onCreateBranch(t)}),r||h.push({label:"Rename Branch",icon:(0,s.jsx)("i",{className:"iconoir-edit-pencil text-[14px]","aria-hidden":"true"}),onClick:()=>a.onRenameBranch(t)}),r&&h.push({label:"Rename branch",icon:(0,s.jsx)("i",{className:"iconoir-edit-pencil text-[14px]","aria-hidden":"true"}),onClick:()=>a.onRenameRemoteBranch(t)}),r||h.push({label:"Push to Remote",icon:(0,s.jsx)("i",{className:"iconoir-arrow-up text-[14px]","aria-hidden":"true"}),onClick:()=>a.onPushToRemote(t)}),r||h.push({label:"Pull from Remote",icon:(0,s.jsx)("i",{className:"iconoir-arrow-down text-[14px]","aria-hidden":"true"}),onClick:()=>a.onPullFromRemote(t)}),!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]}),icon:(0,s.jsx)("i",{className:"iconoir-git-fork text-[14px]","aria-hidden":"true"}),onClick:()=>a.onRebase({sourceBranch:n,targetBranch:t})}),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})]}),icon:(0,s.jsx)("i",{className:"iconoir-git-fork text-[14px]","aria-hidden":"true"}),onClick:()=>a.onRebase({sourceBranch:t,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]}),icon:(0,s.jsx)("i",{className:"iconoir-git-fork text-[14px]","aria-hidden":"true"}),onClick:()=>a.onMerge({sourceBranch:n,targetBranch:t})}),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})]}),icon:(0,s.jsx)("i",{className:"iconoir-git-fork text-[14px]","aria-hidden":"true"}),onClick:()=>a.onMerge({sourceBranch:t,targetBranch:n})})),o||(d?h.push({label:`Delete Selected Branches (${c.length})`,icon:(0,s.jsx)("i",{className:"iconoir-trash text-[14px]","aria-hidden":"true"}),onClick:()=>a.onDeleteBranches(c),danger:!0}):h.push({label:"Delete Branch",icon:(0,s.jsx)("i",{className:"iconoir-trash text-[14px]","aria-hidden":"true"}),onClick:()=>a.onDeleteBranch(t),danger:!0})),h}(e,{onCheckout:nl,onCheckoutToLocal:l6,onCreateBranch:nb,onDeleteBranch:lL,onDeleteBranches:lD,onRenameBranch:lW,onRenameRemoteBranch:lz,onRebase:lJ,onMerge:lQ,onPushToRemote:l0,onPullFromRemote:l3});return s8.length>0&&a.push({label:"Custom scripts",icon:(0,s.jsx)("i",{className:"iconoir-terminal text-[14px]","aria-hidden":"true"}),children:s8.map(a=>({label:a.name,icon:(0,s.jsx)("i",{className:"iconoir-play text-[14px]","aria-hidden":"true"}),onClick:()=>{lF(a,e.branchRef)}}))}),a},nB=(0,r.useMemo)(()=>new Set(O?.branches??[]),[O?.branches]),nM=(0,r.useMemo)(()=>{let e=new Map;if(!O?.remotes)return e;for(let[a,t]of Object.entries(O.remotes))for(let s of t)e.set(`${a}/${s}`,`remotes/${a}/${s}`);return e},[O?.remotes]),nF=(0,r.useMemo)(()=>s2?C(s2).filter(e=>e!==ng):[],[s2,ng]),nP=O?.worktrees??[],nT=(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:[lR&&(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:lf,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:()=>nb(),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:[s2&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c,{items:[{label:"Delete",icon:(0,s.jsx)("i",{className:"iconoir-trash text-[14px]","aria-hidden":"true"}),onClick:()=>lD(nF),danger:!0,disabled:0===nF.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:s9,onToggle:lm,visibilityMap:ln,onToggleVisibility:lb})}),s9&&(0,s.jsx)(E,{node:s2,currentBranch:O?.current,expandedFolders:li,onToggleFolder:lp,onCheckout:nl,onCheckoutToLocal:l6,onCreateBranch:()=>nb(),onDeleteBranch:lL,onRenameBranch:lW,onRenameRemoteBranch:lz,onRebase:lJ,onMerge:lQ,onPushToRemote:l0,onPullFromRemote:l3,getBranchContextMenuItems:n$,onBranchClick:lB,onBranchContextMenu:lM,onDeleteBranchGroup:lD,selectedBranches:s5,visibilityMap:ln,onToggleVisibility:lb,depth:1,groupPath:"__local__",trackingInfo:O?.trackingInfo})]}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c,{items:[{label:"Fetch from all remotes",icon:(0,s.jsx)("i",{className:"iconoir-refresh-circle text-[14px]","aria-hidden":"true"}),onClick:l9},{label:"Add remote",icon:(0,s.jsx)("i",{className:"iconoir-plus-circle text-[14px]","aria-hidden":"true"}),onClick:()=>{au("origin"),ap(""),ah(!0)}}],children:(0,s.jsx)(R,{name:"Remotes",groupPath:"__remotes__",icon:(0,s.jsx)("i",{className:"iconoir-globe text-[14px]","aria-hidden":"true"}),isExpanded:la,onToggle:lu,visibilityMap:ln,onToggleVisibility:lb})}),la&&I&&!s4&&(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..."})]}),la&&s4&&Array.from(s4.entries()).map(([e,a])=>{let t=`__remotes__/${e}`,l=li.has(t);return(0,s.jsxs)("div",{children:[(0,s.jsx)(c,{items:[{label:`Fetch from ${e}`,icon:(0,s.jsx)("i",{className:"iconoir-refresh-circle text-[14px]","aria-hidden":"true"}),onClick:()=>ns(e)},{label:"Rename",icon:(0,s.jsx)("i",{className:"iconoir-edit-pencil text-[14px]","aria-hidden":"true"}),onClick:()=>{e9(e),aa(e),e6(!0)}},{label:"Delete",icon:(0,s.jsx)("i",{className:"iconoir-trash text-[14px]","aria-hidden":"true"}),onClick:()=>{e&&(ai(e),an(!0))},danger:!0}],children:(0,s.jsx)(R,{name:e,groupPath:t,icon:(0,s.jsx)("i",{className:"iconoir-globe text-[14px] opacity-50","aria-hidden":"true"}),isExpanded:l,onToggle:()=>lp(t),visibilityMap:ln,onToggleVisibility:lb,depth:1})}),l&&(0,s.jsx)(E,{node:a,currentBranch:O?.current,expandedFolders:li,onToggleFolder:lp,onCheckout:nl,onCheckoutToLocal:l6,onCreateBranch:()=>nb(),onDeleteBranch:lL,onRenameBranch:lW,onRenameRemoteBranch:lz,onRebase:lJ,onMerge:lQ,onPushToRemote:l0,onPullFromRemote:l3,getBranchContextMenuItems:n$,onBranchClick:lB,onBranchContextMenu:lM,onDeleteBranchGroup:lD,selectedBranches:s5,visibilityMap:ln,onToggleVisibility:lb,depth:2,groupPath:t,isRemote:!0,trackingInfo:O?.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:lx,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:ls?"▼":"▶"}),(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:nP.length})]}),ls&&I&&0===nP.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..."})]}),ls&&!I&&0===nP.length&&(0,s.jsx)("div",{className:"px-2 py-2 text-sm opacity-70",style:{paddingLeft:"20px"},children:"No worktrees found"}),ls&&nP.map(e=>{let a=(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:()=>nt(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:a},e.path):(0,s.jsx)(c,{items:[{label:"Delete worktree",icon:(0,s.jsx)("i",{className:"iconoir-trash text-[14px]","aria-hidden":"true"}),onClick:()=>lA(e.path),danger:!0}],children:a},e.path)})]})]})})]});return S&&100===g?(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"})}):T?(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:D?.message||"An unknown error occurred"}),(0,s.jsxs)("button",{onClick:()=>L(),className:"btn btn-outline btn-sm",children:[(0,s.jsx)("i",{className:"iconoir-refresh-circle text-[16px] mr-1","aria-hidden":"true"}),"Try Again"]})]}):v?(0,s.jsxs)("div",{className:"flex h-full overflow-hidden",children:[t2&&(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:t3?.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:()=>t4(!1),disabled:t7,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:nr,disabled:t7,children:[t7&&(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:()=>t4(!1),children:"close"})})]}),t8&&(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:se?.hash.substring(0,7)})," on ",(0,s.jsx)("span",{className:"font-bold break-all",children:O?.current||"current"}),"?"]}),se?.message&&(0,s.jsx)("div",{className:"rounded border border-base-300 bg-base-200/40 px-3 py-2 text-xs break-words",children:se.message}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{t9(!1),sa(null)},disabled:st,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:ni,disabled:st,children:[st&&(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:()=>{t9(!1),sa(null)},children:"close"})})]}),sl&&(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:sr?.hash.substring(0,7)})," on branch ",(0,s.jsx)("span",{className:"font-bold",children:sr?.branch}),"."]}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono text-sm mb-3",value:so,onChange:e=>sc(e.target.value),autoFocus:!0,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&so.trim()&&!sm&&(e.preventDefault(),no())},placeholder:"Commit subject",disabled:sm}),(0,s.jsx)("textarea",{className:"textarea textarea-bordered w-full h-32 font-mono text-sm",value:sd,onChange:e=>sh(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&so.trim()&&!sm&&(e.preventDefault(),no())},placeholder:"Commit message body (optional)",disabled:sm}),sr?.branch!==O?.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:sr?.branch})," to amend the commit."]})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sO,disabled:sm,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:no,disabled:!so.trim()||sm,children:[sm&&(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:sO,children:"close"})})]}),eb&&(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:eg.length>1?"Delete Branches":"Delete Branch"}),eg.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:[eg.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:eg.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:eg[0]?.startsWith("remotes/")?eg[0].slice(8):eg[0]}),"? This action cannot be undone."]}),ny.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:eN,onChange:e=>ey(e.target.checked),disabled:ek}),(0,s.jsx)("span",{className:"label-text break-words whitespace-normal",children:1===ny.length?(0,s.jsxs)(s.Fragment,{children:["Delete tracking remote branch ",(0,s.jsx)("span",{className:"font-mono opacity-70 break-all",children:ny[0]})]}):(0,s.jsxs)(s.Fragment,{children:["Delete ",ny.length," tracking remote branches"]})})]})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{ef(!1),ej([]),ey(!1)},disabled:ek,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:lH,disabled:ek,children:[ek&&(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:()=>{ef(!1),ej([]),ey(!1)},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:"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:eS}),"?"]}),(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:()=>{eC(!1),eR(null)},disabled:eE,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:()=>void lK(),disabled:eE||!eS,children:[eE&&(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(null)},children:"close"})})]}),eB&&(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:eF}),"? 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:eT,onChange:e=>eD(e.target.checked),disabled:eL||!nN}),(0,s.jsx)("span",{className:"label-text break-words whitespace-normal",children:nN?(0,s.jsxs)(s.Fragment,{children:["Also delete from remote ",(0,s.jsx)("span",{className:"font-mono opacity-70",children:nN})]}):"No remote configured"})]})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:lO,disabled:eL,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:l_,disabled:eL||!eF,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:lO,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:"Cherry Pick"}),(0,s.jsx)("p",{className:"text-sm opacity-70 mt-1",children:eH.length>1?"Apply selected commits from oldest to newest":"Apply changes from the selected commit"}),1===eH.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:eH[0]?.hash})," ",(0,s.jsx)("span",{className:"font-bold break-words",children:eH[0]?.message})," to ",(0,s.jsx)("span",{className:"font-bold break-all",children:O?.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:[eH.length," selected commits"]})," to ",(0,s.jsx)("span",{className:"font-bold break-all",children:O?.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:eH.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:()=>{eI(!1),e_([])},disabled:eK,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:nu,disabled:eK,children:[eK&&(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:()=>{eI(!1),e_([])},children:"close"})})]}),ez&&(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 ",eH.length>1?"the selected commits":"this commit","?"]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{eq(!1),e_([])},disabled:eG,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-warning",onClick:()=>void nx(),disabled:eG,children:[eG&&(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:()=>{eq(!1),e_([])},children:"close"})})]}),eU&&(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:eX?"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:eY}),". 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:e0,onChange:e=>e1((0,o.L9)(e.target.value)),placeholder:"New branch name",disabled:e3,autoFocus:!0,onKeyDown:e=>{let a="Enter"===e.key&&(e.metaKey||e.ctrlKey),t=eX?e0===eX.branch:e0===eY;a&&e0&&!t&&!e3&&lq()}}),!eX&&nk?.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:e2,onChange:e=>e4(e.target.checked),disabled:e3}),(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:nk.upstream})]})]})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sT,disabled:e3,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:lq,disabled:!e0||(eX?e0===eX.branch:e0===eY)||e3,children:[e3&&(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:sT,children:"close"})})]}),e7&&(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:e8}),". 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:ae,onChange:e=>aa(e.target.value),placeholder:"New remote name",disabled:at,autoFocus:!0,onKeyDown:e=>{let a="Enter"===e.key&&(e.metaKey||e.ctrlKey),t=ae.trim(),s=t===(e8??"").trim();a&&t&&!s&&!at&&lG()}}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sD,disabled:at,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:lG,disabled:!ae.trim()||ae.trim()===(e8??"").trim()||at,children:[at&&(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:sD,children:"close"})})]}),al&&(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:ar}),"? This removes all tracking branches for that remote."]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sL,disabled:ao,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-error",onClick:lV,disabled:!ar||ao,children:[ao&&(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:sL,children:"close"})})]}),ad&&(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:am,onChange:e=>au(e.target.value),placeholder:"origin",disabled:ab,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:ax,onChange:e=>ap(e.target.value),placeholder:"https://github.com/owner/repo.git",disabled:ab,onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&am.trim()&&ax.trim()&&!ab&&lU()}})]})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:sA,disabled:ab,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:lU,disabled:!am.trim()||!ax.trim()||ab,children:[ab&&(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:sA,children:"close"})})]}),ag&&(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:aN})," onto ",(0,s.jsx)("span",{className:"font-bold break-all",children:ak}),"?"]}),(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:aw,onChange:e=>aC(e.target.checked),disabled:aS}),(0,s.jsx)("span",{className:"label-text",children:"Stash and reapply local changes"})]})}),!aw&&(0,s.jsx)("p",{className:"text-xs text-warning mt-2 ml-6",children:"Warning: All local changes will be discarded."}),"checking"===aE?(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:aN})," onto ",(0,s.jsx)("span",{className:"font-bold break-all",children:ak}),"..."]})]}):"no-conflict"===aE?(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:aN})," onto ",(0,s.jsx)("span",{className:"font-bold break-all",children:ak})," 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:aN})," onto ",(0,s.jsx)("span",{className:"font-bold break-all",children:ak})," will cause conflicts."]})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:aB,disabled:aS,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:lY,disabled:aS,children:[aS&&(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:aB,children:"close"})})]}),aM&&(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:aD})," into ",(0,s.jsx)("span",{className:"font-bold break-all",children:aP}),"?"]}),(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:aA,onChange:e=>aO(e.target.checked),disabled:aq}),(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:aI,onChange:e=>lX(e.target.checked),disabled:aq}),(0,s.jsx)("span",{className:"label-text",children:"Squash before merge"})]})}),aI&&(0,s.jsx)("textarea",{className:"textarea textarea-bordered w-full mt-2",placeholder:"Commit message for squash merge",value:aW,onChange:e=>az(e.target.value),disabled:aq,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:a_,onChange:e=>aK(e.target.checked),disabled:aq}),(0,s.jsx)("span",{className:"label-text",children:"Fast forward merge"})]})}),"checking"===aV?(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:aD})," into ",(0,s.jsx)("span",{className:"font-bold break-all",children:aP}),"..."]})]}):"no-conflict"===aV?(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:aD})," into ",(0,s.jsx)("span",{className:"font-bold break-all",children:aP})," 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:aD})," into ",(0,s.jsx)("span",{className:"font-bold break-all",children:aP})," will cause conflicts."]})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:aJ,disabled:aq,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:lZ,disabled:aq,children:[aq&&(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:aJ,children:"close"})})]}),aY&&(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:aX})," to a remote repository."]}),tm&&0===a0.length?(0,s.jsxs)("div",{className:"alert alert-error",children:[(0,s.jsx)("span",{className:"text-xl",children:"⚠️"}),(0,s.jsx)("span",{children:tm})]}):tx?(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:a2,onChange:e=>l1(e.target.value),disabled:td,children:a0.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:[tb?(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:a7,onChange:e=>a6(e.target.value),disabled:td,children:[aX&&!a3.includes(aX)&&(0,s.jsxs)("option",{value:aX,children:[aX," (new)"]}),a3.map(e=>(0,s.jsxs)("option",{value:e,children:[e,a8?.remote===a2&&a8?.branch===e?" (tracking)":""]},e))]}),a7&&!a3.includes(a7)&&(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:te,onChange:e=>ta(e.target.checked),disabled:td||tt}),(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:tt,onChange:e=>ts(e.target.checked),disabled:td}),(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:tl,onChange:e=>tn(e.target.checked),disabled:td}),(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:tr,onChange:e=>l2(e.target.checked),disabled:td}),(0,s.jsx)("span",{className:"label-text",children:"Squash local commits before push"})]})}),tr&&(0,s.jsx)("textarea",{className:"textarea textarea-bordered w-full",placeholder:"Commit message for squash",value:to,onChange:e=>tc(e.target.value),disabled:td,autoFocus:!0}),tm&&(0,s.jsx)("div",{className:"alert alert-error text-sm",children:(0,s.jsx)("span",{children:tm})})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>aQ(!1),disabled:td,children:"Cancel"}),a0.length>0&&(0,s.jsxs)("button",{className:"btn btn-primary",onClick:l4,disabled:td||!a2||!a7,children:[td&&(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:()=>aQ(!1),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:"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:tN}),"."]}),tL&&0===tk.length?(0,s.jsx)("div",{className:"alert alert-error",children:(0,s.jsx)("span",{children:tL})}):tO?(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:tw,onChange:e=>l5(e.target.value),disabled:tT,children:tk.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"})}),tH?(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:tE,onChange:e=>t$(e.target.value),disabled:tT,children:tS.map(e=>(0,s.jsxs)("option",{value:e,children:[e,tB?.remote===tw&&tB?.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:tF,onChange:e=>tP(e.target.checked),disabled:tT}),(0,s.jsx)("span",{className:"label-text",children:"Rebase onto remote branch"})]})}),tL&&(0,s.jsx)("div",{className:"alert alert-error text-sm",children:(0,s.jsx)("span",{children:tL})})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>tj(!1),disabled:tT,children:"Cancel"}),tk.length>0&&(0,s.jsxs)("button",{className:"btn btn-primary",onClick:l7,disabled:tT||!tw||!tE,children:[tT&&(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:()=>tj(!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 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:eo?.substring(0,7)}),"."]}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full font-mono",value:ed,onChange:e=>eh(e.target.value),placeholder:"Tag name",disabled:ex,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&ed.trim()&&!ex&&nf()}}),(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:em,onChange:e=>eu(e.target.checked),disabled:ex}),(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:()=>{ei(!1),ec(null),eh(""),eu(!1)},disabled:ex,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:nf,disabled:!ed.trim()||ex,children:[ex&&(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:()=>{ei(!1),ec(null),eh(""),eu(!1)},children:"close"})})]}),X&&(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:et?et.replace(/^remotes\//,""):"current HEAD"}),"."]}),(0,s.jsx)("input",{type:"text",className:"input input-bordered w-full",value:ee,onChange:e=>ea((0,o.L9)(e.target.value)),placeholder:"Branch name",disabled:el,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&ee&&!el&&np()}}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>{Z(!1),es(null)},disabled:el,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:np,disabled:!ee||el,children:[el&&(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:()=>{Z(!1),es(null)},children:"close"})})]}),tU&&(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:tY?.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:tX,onChange:e=>tZ((0,o.L9)(e.target.value)),placeholder:"Local branch name",disabled:t0,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&tX&&!t0&&l8()}})]}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsx)("button",{className:"btn",onClick:()=>tJ(!1),disabled:t0,children:"Cancel"}),(0,s.jsxs)("button",{className:"btn btn-primary",onClick:l8,disabled:!tX||t0,children:[t0&&(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:()=>tJ(!1),children:"close"})})]}),sw.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: ",sw.scriptName]}),(0,s.jsxs)("p",{className:"text-xs opacity-70 mt-1 break-all",children:["Branch: ",sw.branchRef]})]}),(0,s.jsx)("span",{className:(0,o.cn)("badge badge-sm shrink-0","running"===sw.status||"starting"===sw.status?"badge-info":"completed"===sw.status?"badge-success":"failed"===sw.status?"badge-error":"canceled"===sw.status?"badge-warning":"badge-ghost"),children:sw.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:sw.output||"Waiting for output..."})}),sw.error&&(0,s.jsx)("div",{className:"alert alert-error py-2 mt-3",children:(0,s.jsx)("span",{children:sw.error})}),(0,s.jsxs)("div",{className:"modal-action",children:[(0,s.jsxs)("button",{className:"btn btn-warning",onClick:()=>void lP(),disabled:!sF||sS,children:[sS&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),"Cancel"]}),(0,s.jsxs)("button",{className:"btn btn-outline",onClick:()=>void lT(),disabled:sE,children:[sE&&(0,s.jsx)("span",{className:"loading loading-spinner loading-xs"}),sB?"Copied":"Copy"]}),(0,s.jsx)("button",{className:"btn btn-primary",onClick:()=>{sC(P),sM(!1),sR(!1)},disabled:!sP,children:"Done"})]})]}),(0,s.jsx)("form",{method:"dialog",className:"modal-backdrop",children:(0,s.jsx)("button",{onClick:e=>{sP?(sC(P),sM(!1),sR(!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:sv,children:[(0,s.jsxs)("button",{className:"btn btn-sm gap-2 max-w-[24rem]",onClick:()=>sk(e=>!e),title:nC,children:[(0,s.jsx)("span",{className:"truncate",children:nC}),(0,s.jsx)("i",{className:(0,o.cn)("iconoir-nav-arrow-down text-[16px] shrink-0 transition-transform",sy&&"rotate-180"),"aria-hidden":"true"})]}),sy&&(0,s.jsx)("div",{className:"absolute left-0 top-full mt-2 z-50",children:nT})]}),(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 l9(),disabled:tK||tg||aY,title:"Fetch latest changes from all remotes",children:[tK?(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:()=>{ng&&!nR&&l3(ng)},disabled:!!nR||tg||aY,title:nR||`Pull from ${nS?.upstream}`,children:[tO?(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:()=>{ng&&!nE&&l0(ng)},disabled:!!nE||tg||aY,title:nE||(nS?`Push to ${nS.upstream}`:"Push current branch to remote"),children:[tx?(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 na(),disabled:tG,title:"Open terminal in repository folder",children:[tG?(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 ne(),disabled:tz,title:"Open repository folder in Finder",children:[tz?(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:lR&&I?(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:sx,commits:lj,selectedHash:K||void 0,selectedHashes:lN,onSelectCommit:lC,onResetToCommit:nn,onRevertCommit:(e,a)=>{sa({hash:e,message:a}),t9(!0)},onCreateTag:e=>{ec(e),eh(""),eu(!1),ei(!0)},onCherryPickCommit:(e,a)=>{e_([{hash:e,message:a}]),eI(!0)},onCherryPickSelectedCommits:()=>{lS.length<2||(e_(lS.map(e=>({hash:e.hash,message:e.message}))),eI(!0))},onRewordCommit:(e,a,t,s)=>{si({hash:e,subject:a,body:t,branch:s}),sc(a),sh(t),sn(!0)},localBranches:O?.branches||[],trackingInfo:O?.trackingInfo,onEndReached:()=>{!A&&v.all.length>=g&&j(e=>e+50)},isLoadingMore:A&&g>100,currentBranch:O?.current,hiddenBranches:lE,getBranchTagContextMenuItems:e=>{if(e.startsWith("tag:")){let a=e.replace(/^tag:\s*/,"").trim();return a?[{label:"Delete Tag",icon:(0,s.jsx)("i",{className:"iconoir-trash text-[14px]","aria-hidden":"true"}),onClick:()=>lI(a),danger:!0}]:null}if(nB.has(e))return n$({branchRef:e,branchLeafName:e.split("/").pop()||e,currentBranch:ng,isRemote:!1});let a=nM.get(e);return a?n$({branchRef:a,branchLeafName:a.split("/").pop()||e,currentBranch:ng,isRemote:!0}):null}})}),K&&(0,s.jsxs)("div",{className:"flex flex-col overflow-hidden border-t border-base-300 bg-base-200/30",style:{height:sW},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",sq&&"bg-base-200"),onMouseDown:s0,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:lw&&lv?(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:[lv.latestHash.substring(0,7),": ",lv.latestCommit.message]}),(0,s.jsxs)("div",{className:"text-sm font-bold truncate opacity-75",children:[lv.oldestHash.substring(0,7),": ",lv.oldestCommit.message]})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-sm font-bold truncate",children:lk?.message}),(0,s.jsx)("span",{className:"text-xs font-mono opacity-50 shrink-0",children:K.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:()=>U(null),title:"Close",children:"✕"})})]}),lw&&lv?(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:lv.oldestHash,toCommitHash:lv.latestHash})})]}):(0,s.jsxs)("div",{ref:sX,className:"flex-1 overflow-hidden bg-base-100 grid",style:{gridTemplateRows:`${sU}fr 6px ${1-sU}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:lk?(lk.body?.trim()?`${lk.message}
|
|
7
|
+
|
|
8
|
+
${lk.body}`:lk.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",sY&&"bg-base-200/60"),onMouseDown:s1,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:K})})]})]})]})]})]}):(0,s.jsx)("div",{className:"flex items-center justify-center p-8 h-full opacity-70",children:"No history data available"})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[492],{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)},9879:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return l(9541)}])}},e=>{e.O(0,[441,794,358],()=>e(e.s=9879)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
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])}},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"})})]})]})}},7638:(e,s,t)=>{Promise.resolve().then(t.bind(t,4740))},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=7638)),_N_E=e.O()}]);
|