difit 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{index-Blx_E2fr.js → index-GkNEbjZ7.js} +2 -2
- package/dist/client/assets/{prism-java-BWsdaGwD.js → prism-java-C-dW1Z2z.js} +1 -1
- package/dist/client/assets/{prism-php-Cv8baymX.js → prism-php-CRAMsZfC.js} +1 -1
- package/dist/client/assets/{prism-ruby-X0-wafPq.js → prism-ruby-CfFUi7wW.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/git-diff.js +1 -1
- package/package.json +1 -1
|
@@ -180,8 +180,8 @@ prismjs/prism.js:
|
|
|
180
180
|
* @namespace
|
|
181
181
|
* @public
|
|
182
182
|
*)
|
|
183
|
-
*/const dm="modulepreload",gm=function(r){return"/"+r},_d={},Sl=function(f,d,s){let O=Promise.resolve();if(d&&d.length>0){let E=function(p){return Promise.all(p.map(A=>Promise.resolve(A).then(z=>({status:"fulfilled",value:z}),z=>({status:"rejected",reason:z}))))};document.getElementsByTagName("link");const w=document.querySelector("meta[property=csp-nonce]"),H=w?.nonce||w?.getAttribute("nonce");O=E(d.map(p=>{if(p=gm(p),p in _d)return;_d[p]=!0;const A=p.endsWith(".css"),z=A?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${z}`))return;const G=document.createElement("link");if(G.rel=A?"stylesheet":dm,A||(G.as="script"),G.crossOrigin="",G.href=p,H&&G.setAttribute("nonce",H),document.head.appendChild(G),A)return new Promise((K,y)=>{G.addEventListener("load",K),G.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${p}`)))})}))}function U(w){const H=new Event("vite:preloadError",{cancelable:!0});if(H.payload=w,window.dispatchEvent(H),!H.defaultPrevented)throw w}return O.then(w=>{for(const H of w||[])H.status==="rejected"&&U(H.reason);return f().catch(U)})},Hu={};function pm(r){if(!Hu[r]){const d={bash:()=>Sl(()=>import("./prism-bash-DTkDXsAh.js"),[]),sh:()=>Sl(()=>import("./prism-bash-DTkDXsAh.js"),[]),shell:()=>Sl(()=>import("./prism-bash-DTkDXsAh.js"),[]),php:async()=>(await Sl(()=>import("./prism-markup-templating-Ct1xsyfA.js"),[]),Sl(()=>import("./prism-php-Cv8baymX.js").then(s=>s.p),[])),sql:()=>Sl(()=>import("./prism-sql-AgAyy5H_.js"),[]),ruby:()=>Sl(()=>import("./prism-ruby-X0-wafPq.js").then(s=>s.p),[]),java:()=>Sl(()=>import("./prism-java-BWsdaGwD.js").then(s=>s.p),[])}[r];if(!d)return console.warn(`No loader available for language: ${r}`),Promise.reject(new Error(`Unsupported language: ${r}`));Hu[r]=d().then(()=>{}).catch(s=>{throw delete Hu[r],console.warn(`Failed to load language: ${r}`,s),s})}return Hu[r]}typeof global<"u"?global.Prism=C:typeof window<"u"&&(window.Prism=C);const Td=["markup","html","xml","svg","javascript","js","typescript","ts","jsx","tsx","css","c","cpp","swift","kotlin","objectivec","reason","rust","go","graphql","yaml","yml","json","markdown","md","python","py"];function ym(r,f){const[d,s]=ge.useState(()=>Td.includes(f)||!!C.languages[f]);return ge.useEffect(()=>{if(!d){if(Td.includes(f)){s(!0);return}pm(f).then(()=>{s(!0)}).catch(()=>{s(!1)})}},[f,d]),{ready:d,actualLang:d?f:"text"}}function hm(r){const f=r.split("/").pop()?.toLowerCase()||"",d=r.split(".").pop()?.toLowerCase(),s={dockerfile:"docker",makefile:"makefile",".gitignore":"git",".env":"bash",".bashrc":"bash",".zshrc":"bash",".bash_profile":"bash",".profile":"bash"};return s[f]?s[f]:{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",css:"css",scss:"css",html:"html",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",php:"php",sql:"sql",xml:"xml",swift:"swift",kt:"kotlin",scala:"scala",r:"r",lua:"lua",perl:"perl",dockerfile:"docker",makefile:"makefile",gitignore:"git",env:"bash",conf:"nginx",ini:"ini",toml:"toml"}[d||""]||"text"}let Vd="";function mm(r){Vd=r}function oc({code:r,language:f,className:d}){const s=f||hm(Vd),{actualLang:O}=ym(r,s);return b.jsx(fm,{code:r,language:O,theme:Xd.nightOwl,prism:C,children:({style:U,tokens:w,getLineProps:H,getTokenProps:E})=>b.jsx("span",{className:d,style:{...U,background:"transparent"},children:w.map((p,A)=>b.jsx("span",{...H({line:p}),children:p.map((z,G)=>b.jsx("span",{...E({token:z})},G))},A))})})}function bm({chunk:r,comments:f,onAddComment:d,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U}){const[w,H]=ge.useState(null),E=y=>{H(w===y?null:y)},p=()=>{H(null)},A=async y=>{w!==null&&(await d(w,y),H(null))},z=y=>f.filter(T=>T.line===y),K=(y=>{const T=[];let D=r.oldStart,v=r.newStart,M=0;for(;M<y.length;){const L=y[M];if(!L){M++;continue}if(L.type==="normal")T.push({oldLine:L,newLine:{...L},oldLineNumber:D,newLineNumber:v}),D++,v++,M++;else if(L.type==="delete"){let V=M+1;for(;V<y.length&&y[V]?.type==="delete";)V++;const Q=y.slice(M,V),ae=[];for(;V<y.length&&y[V]?.type==="add";){const ne=y[V];ne&&ae.push(ne),V++}const ie=Math.max(Q.length,ae.length);for(let ne=0;ne<ie;ne++){const be=Q[ne],ke=ae[ne];T.push({oldLine:be,newLine:ke,oldLineNumber:be?D+ne:void 0,newLineNumber:ke?v+ne:void 0})}D+=Q.length,v+=ae.length,M=V}else L.type==="add"&&(T.push({newLine:L,newLineNumber:v}),v++,M++)}return T})(r.lines);return b.jsx("div",{className:"bg-github-bg-primary border border-github-border rounded-md overflow-hidden",children:b.jsx("table",{className:"w-full border-collapse font-mono text-xs leading-5",children:b.jsx("tbody",{children:K.map((y,T)=>{const D=y.newLineNumber?z(y.newLineNumber):y.oldLineNumber?z(y.oldLineNumber):[];return b.jsxs(dc.Fragment,{children:[b.jsxs("tr",{className:"group",children:[b.jsx("td",{className:"w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:y.oldLineNumber||""}),b.jsx("td",{className:`w-1/2 p-0 align-top border-r border-github-border relative ${y.oldLine?.type==="delete"?"bg-diff-deletion-bg cursor-pointer":y.oldLine?.type==="normal"?"bg-transparent":"bg-github-bg-secondary"}`,onClick:()=>y.oldLine?.type==="delete"&&y.oldLineNumber&&E(y.oldLineNumber),title:y.oldLine?.type==="delete"&&y.oldLineNumber?"Click to add comment":"",children:y.oldLine&&b.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:b.jsx(oc,{code:y.oldLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit"})})}),b.jsx("td",{className:"w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:y.newLineNumber||""}),b.jsx("td",{className:`w-1/2 p-0 align-top relative ${y.newLine?.type==="add"?"bg-diff-addition-bg cursor-pointer":y.newLine?.type==="normal"?"bg-transparent cursor-pointer":"bg-github-bg-secondary"}`,onClick:()=>(y.newLine?.type==="add"||y.newLine?.type==="normal")&&y.newLineNumber&&E(y.newLineNumber),title:(y.newLine?.type==="add"||y.newLine?.type==="normal")&&y.newLineNumber?"Click to add comment":"",children:y.newLine&&b.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:b.jsx(oc,{code:y.newLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit"})})})]}),D.length>0&&b.jsx("tr",{className:"bg-github-bg-secondary",children:b.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:D.map(v=>b.jsx(Bd,{comment:v,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U},v.id))})}),w&&(w===y.oldLineNumber&&y.oldLine?.type==="delete"||w===y.newLineNumber&&(y.newLine?.type==="add"||y.newLine?.type==="normal"))&&b.jsx("tr",{className:"bg-github-bg-secondary",children:b.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:b.jsx(Ld,{onSubmit:A,onCancel:p})})})]},T)})})})})}function vm({chunk:r,comments:f,onAddComment:d,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U,mode:w="inline"}){const[H,E]=ge.useState(null),[p,A]=ge.useState(null),z=v=>{switch(v.type){case"add":return"bg-diff-addition-bg";case"delete":return"bg-diff-deletion-bg";default:return"bg-transparent"}},G=v=>{switch(v.type){case"add":return"+";case"delete":return"-";default:return" "}},K=(v,M)=>{H===v?(E(null),A(null)):(E(v),A(M))},y=()=>{E(null),A(null)},T=async v=>{H!==null&&(await d(H,v,p||void 0),E(null),A(null))},D=v=>f.filter(M=>M.line===v);return w==="side-by-side"?b.jsx(bm,{chunk:r,comments:f,onAddComment:d,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U}):b.jsx("div",{className:"bg-github-bg-primary",children:b.jsx("table",{className:"w-full border-collapse font-mono text-xs leading-5",children:b.jsx("tbody",{children:r.lines.map((v,M)=>{const L=D(v.newLineNumber||v.oldLineNumber||0);return b.jsxs(dc.Fragment,{children:[b.jsxs("tr",{className:`cursor-pointer group ${z(v)}`,onClick:()=>K(v.newLineNumber||v.oldLineNumber||0,v.content),title:"Click to add comment",children:[b.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:v.oldLineNumber||""}),b.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:v.newLineNumber||""}),b.jsx("td",{className:"p-0 w-full relative align-top",children:b.jsxs("div",{className:"flex items-center relative min-h-[20px]",children:[b.jsx("span",{className:`w-5 text-center text-github-text-muted flex-shrink-0 bg-github-bg-secondary border-r border-github-border ${v.type==="add"?"text-github-accent bg-diff-addition-bg":v.type==="delete"?"text-github-danger bg-diff-deletion-bg":""}`,children:G(v)}),b.jsx(oc,{code:v.content,className:"flex-1 px-3 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit"})]})})]}),L.map(V=>b.jsx("tr",{className:"bg-github-bg-secondary",children:b.jsx("td",{colSpan:3,className:"p-0 border-t border-github-border",children:b.jsx(Bd,{comment:V,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U})})},V.id)),H===(v.newLineNumber||v.oldLineNumber)&&b.jsx("tr",{className:"bg-[var(--bg-secondary)]",children:b.jsx("td",{colSpan:3,className:"p-0 border-t border-[var(--border-muted)]",children:b.jsx(Ld,{onSubmit:T,onCancel:y})})})]},M)})})})})}function Sm({file:r,comments:f,diffMode:d,reviewedFiles:s,onToggleReviewed:O,onAddComment:U,onGeneratePrompt:w,onRemoveComment:H,onUpdateComment:E}){const p=s.has(r.path);mm(r.path);const A=G=>{switch(G){case"added":return b.jsx(jd,{size:16,className:"text-github-accent"});case"deleted":return b.jsx(Ud,{size:16,className:"text-github-danger"});case"renamed":return b.jsx(Md,{size:16,className:"text-github-warning"});default:return b.jsx(Cd,{size:16,className:"text-github-text-secondary"})}},z=async(G,K,y)=>{try{await U(r.path,G,K,y)}catch(T){console.error("Failed to add comment:",T)}};return b.jsxs("div",{className:"bg-github-bg-primary",children:[b.jsxs("div",{className:"bg-github-bg-secondary border-b border-github-border px-5 py-4 flex items-center justify-between flex-wrap gap-3 sticky top-0 z-10",children:[b.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[b.jsx("button",{onClick:()=>O(r.path),className:"text-github-text-muted hover:text-github-text-primary transition-colors cursor-pointer",title:p?"Expand file":"Collapse file",children:p?b.jsx(Rd,{size:16}):b.jsx(Dd,{size:16})}),A(r.status),b.jsx("h2",{className:"text-sm font-mono text-github-text-primary m-0 overflow-hidden text-ellipsis whitespace-nowrap",children:r.path}),b.jsx("button",{className:"bg-transparent border-none cursor-pointer px-1.5 py-1 rounded text-sm text-github-text-secondary transition-all hover:bg-github-bg-tertiary hover:text-github-text-primary",onClick:()=>{navigator.clipboard.writeText(r.path).then(()=>{console.log("File path copied to clipboard:",r.path)}).catch(G=>{console.error("Failed to copy file path:",G)})},title:"Copy file path",children:b.jsx(zd,{size:14})}),r.oldPath&&r.oldPath!==r.path&&b.jsxs("span",{className:"text-xs text-github-text-muted italic",children:["(renamed from ",r.oldPath,")"]})]}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[b.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-accent bg-green-100/10",children:["+",r.additions]}),b.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-danger bg-red-100/10",children:["-",r.deletions]})]}),b.jsxs("button",{onClick:()=>O(r.path),className:`flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-all duration-200 ${s.has(r.path)?"bg-github-accent text-white":"bg-gray-600 text-gray-200 border border-gray-500 hover:bg-gray-500 hover:text-white"}`,title:s.has(r.path)?"Mark as not reviewed":"Mark as reviewed",children:[s.has(r.path)?b.jsx(wd,{size:14}):b.jsx(ah,{size:14}),"Viewed"]})]})]}),!p&&b.jsx("div",{className:"overflow-y-auto",children:r.chunks.map((G,K)=>b.jsxs("div",{className:"border-b border-github-border",children:[b.jsx("div",{className:"bg-github-bg-tertiary px-3 py-2 border-b border-github-border",children:b.jsx("code",{className:"text-github-text-secondary text-xs font-mono",children:G.header})}),b.jsx(vm,{chunk:G,comments:f,onAddComment:z,onGeneratePrompt:w,onRemoveComment:H,onUpdateComment:E,mode:d})]},K))})]})}function xm(r){const f={name:"",path:"",isDirectory:!0,children:[]};return r.forEach(d=>{const s=d.path.split("/");let O=f;for(let U=0;U<s.length;U++){const w=s[U];if(!w)continue;const H=U===s.length-1,E=s.slice(0,U+1).join("/");O.children||(O.children=[]);let p=O.children.find(A=>A.name===w);p||(p={name:w,path:E,isDirectory:!H,children:H?void 0:[],file:H?d:void 0},O.children.push(p)),O=p}}),f}function Em({files:r,onScrollToFile:f,comments:d,reviewedFiles:s,onToggleReviewed:O}){const U=xm(r),w=v=>{if(!v.isDirectory||!v.children)return[];const M=[];return v.path&&M.push(v.path),v.children.forEach(L=>{M.push(...w(L))}),M},[H,E]=ge.useState(()=>new Set(w(U))),[p,A]=ge.useState(""),z=v=>d.filter(M=>M.file===v).length,G=v=>{if(!p.trim())return v;if(v.isDirectory&&v.children){const M=v.children.map(L=>G(L)).filter(L=>L!==null);return M.length>0?{...v,children:M}:null}else if(v.file)return v.file.path.toLowerCase().includes(p.toLowerCase())?v:null;return null},K=G(U)||{...U,children:[]},y=v=>{switch(v){case"added":return b.jsx(jd,{size:16,className:"text-github-accent"});case"deleted":return b.jsx(Ud,{size:16,className:"text-github-danger"});case"renamed":return b.jsx(Md,{size:16,className:"text-github-warning"});default:return b.jsx(Cd,{size:16,className:"text-github-text-secondary"})}},T=v=>{E(M=>{const L=new Set(M);return L.has(v)?L.delete(v):L.add(v),L})},D=(v,M=0)=>{if(v.isDirectory&&v.children){const L=H.has(v.path),V=ae=>ae.file&&z(ae.file.path)>0?!0:ae.children?ae.children.some(ie=>V(ie)):!1,Q=V(v);return b.jsxs("div",{children:[v.name&&b.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer",style:{paddingLeft:`${M*16+16}px`},onClick:()=>T(v.path),children:[L?b.jsx(Dd,{size:16}):b.jsx(Rd,{size:16}),L?b.jsx(Vy,{size:16,className:"text-github-text-secondary"}):b.jsx(Fy,{size:16,className:"text-github-text-secondary"}),b.jsx("span",{className:"text-sm text-github-text-primary font-medium flex-1 overflow-hidden text-ellipsis whitespace-nowrap",title:v.name,children:v.name}),Q&&b.jsx("span",{className:"bg-github-warning/20 text-github-warning text-xs px-1.5 py-0.5 rounded-full font-medium ml-auto flex items-center gap-1",children:b.jsx(vd,{size:12})})]}),(L||!v.name)&&v.children.map(ae=>D(ae,M+1))]},v.path)}else if(v.file){const L=z(v.file.path),V=s.has(v.file.path);return b.jsxs("div",{className:`flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer transition-colors ${V?"opacity-70":""}`,style:{paddingLeft:`${M*16+16}px`},onClick:()=>f(v.file.path),children:[b.jsx(kd,{checked:V,onChange:()=>{O(v.file.path)},title:V?"Mark as not reviewed":"Mark as reviewed",className:"z-10"}),y(v.file.status),b.jsx("span",{className:`text-sm text-github-text-primary flex-1 overflow-hidden text-ellipsis whitespace-nowrap ${V?"line-through text-github-text-muted":""}`,title:v.file.path,children:v.name}),L>0&&b.jsxs("span",{className:"bg-github-warning/20 text-github-warning text-xs px-1.5 py-0.5 rounded-full font-medium ml-auto flex items-center gap-1",children:[b.jsx(vd,{size:12}),L]})]},v.file.path)}return null};return b.jsxs("div",{className:"h-full flex flex-col",children:[b.jsxs("div",{className:"px-4 py-3 border-b border-github-border bg-github-bg-tertiary",children:[b.jsxs("h3",{className:"text-sm font-semibold text-github-text-primary m-0 mb-3",children:["Files changed (",r.length,")"]}),b.jsxs("div",{className:"relative",children:[b.jsx(th,{size:16,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-github-text-muted"}),b.jsx("input",{type:"text",placeholder:"Filter files...",value:p,onChange:v=>A(v.target.value),className:"w-full pl-9 pr-3 py-2 text-sm bg-github-bg-primary border border-github-border rounded-md focus:outline-none focus:border-github-accent text-github-text-primary placeholder-github-text-muted"})]})]}),b.jsx("div",{className:"flex-1 overflow-y-auto",children:K.children&&K.children.map(v=>D(v))})]})}function Am(r){const[f,d]=ge.useState([]),s=r?`reviewit-comments-${r}`:"reviewit-comments";return ge.useEffect(()=>{const A=localStorage.getItem(s);if(A)try{d(JSON.parse(A))}catch(z){console.error("Failed to parse saved comments:",z)}},[s]),ge.useEffect(()=>{localStorage.setItem(s,JSON.stringify(f))},[f,s]),{comments:f,addComment:(A,z,G,K)=>{console.log("Adding comment with codeContent:",K);const y={id:`${A}:${z}:${Date.now()}`,file:A,line:z,body:G,timestamp:new Date().toISOString(),codeContent:K};return d(T=>[...T,y]),y},removeComment:A=>{d(z=>z.filter(G=>G.id!==A))},updateComment:(A,z)=>{d(G=>G.map(K=>K.id===A?{...K,body:z}:K))},clearAllComments:()=>{d([]),localStorage.removeItem(s)},generatePrompt:A=>`${A.file}:${A.line}
|
|
183
|
+
*/const dm="modulepreload",gm=function(r){return"/"+r},_d={},Sl=function(f,d,s){let O=Promise.resolve();if(d&&d.length>0){let E=function(p){return Promise.all(p.map(A=>Promise.resolve(A).then(z=>({status:"fulfilled",value:z}),z=>({status:"rejected",reason:z}))))};document.getElementsByTagName("link");const w=document.querySelector("meta[property=csp-nonce]"),H=w?.nonce||w?.getAttribute("nonce");O=E(d.map(p=>{if(p=gm(p),p in _d)return;_d[p]=!0;const A=p.endsWith(".css"),z=A?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${z}`))return;const G=document.createElement("link");if(G.rel=A?"stylesheet":dm,A||(G.as="script"),G.crossOrigin="",G.href=p,H&&G.setAttribute("nonce",H),document.head.appendChild(G),A)return new Promise((K,y)=>{G.addEventListener("load",K),G.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${p}`)))})}))}function U(w){const H=new Event("vite:preloadError",{cancelable:!0});if(H.payload=w,window.dispatchEvent(H),!H.defaultPrevented)throw w}return O.then(w=>{for(const H of w||[])H.status==="rejected"&&U(H.reason);return f().catch(U)})},Hu={};function pm(r){if(!Hu[r]){const d={bash:()=>Sl(()=>import("./prism-bash-DTkDXsAh.js"),[]),sh:()=>Sl(()=>import("./prism-bash-DTkDXsAh.js"),[]),shell:()=>Sl(()=>import("./prism-bash-DTkDXsAh.js"),[]),php:async()=>(await Sl(()=>import("./prism-markup-templating-Ct1xsyfA.js"),[]),Sl(()=>import("./prism-php-CRAMsZfC.js").then(s=>s.p),[])),sql:()=>Sl(()=>import("./prism-sql-AgAyy5H_.js"),[]),ruby:()=>Sl(()=>import("./prism-ruby-CfFUi7wW.js").then(s=>s.p),[]),java:()=>Sl(()=>import("./prism-java-C-dW1Z2z.js").then(s=>s.p),[])}[r];if(!d)return console.warn(`No loader available for language: ${r}`),Promise.reject(new Error(`Unsupported language: ${r}`));Hu[r]=d().then(()=>{}).catch(s=>{throw delete Hu[r],console.warn(`Failed to load language: ${r}`,s),s})}return Hu[r]}typeof global<"u"?global.Prism=C:typeof window<"u"&&(window.Prism=C);const Td=["markup","html","xml","svg","javascript","js","typescript","ts","jsx","tsx","css","c","cpp","swift","kotlin","objectivec","reason","rust","go","graphql","yaml","yml","json","markdown","md","python","py"];function ym(r,f){const[d,s]=ge.useState(()=>Td.includes(f)||!!C.languages[f]);return ge.useEffect(()=>{if(!d){if(Td.includes(f)){s(!0);return}pm(f).then(()=>{s(!0)}).catch(()=>{s(!1)})}},[f,d]),{ready:d,actualLang:d?f:"text"}}function hm(r){const f=r.split("/").pop()?.toLowerCase()||"",d=r.split(".").pop()?.toLowerCase(),s={dockerfile:"docker",makefile:"makefile",".gitignore":"git",".env":"bash",".bashrc":"bash",".zshrc":"bash",".bash_profile":"bash",".profile":"bash"};return s[f]?s[f]:{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",css:"css",scss:"css",html:"html",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",php:"php",sql:"sql",xml:"xml",swift:"swift",kt:"kotlin",scala:"scala",r:"r",lua:"lua",perl:"perl",dockerfile:"docker",makefile:"makefile",gitignore:"git",env:"bash",conf:"nginx",ini:"ini",toml:"toml"}[d||""]||"text"}let Vd="";function mm(r){Vd=r}function oc({code:r,language:f,className:d}){const s=f||hm(Vd),{actualLang:O}=ym(r,s);return b.jsx(fm,{code:r,language:O,theme:Xd.nightOwl,prism:C,children:({style:U,tokens:w,getLineProps:H,getTokenProps:E})=>b.jsx("span",{className:d,style:{...U,background:"transparent"},children:w.map((p,A)=>b.jsx("span",{...H({line:p}),children:p.map((z,G)=>b.jsx("span",{...E({token:z})},G))},A))})})}function bm({chunk:r,comments:f,onAddComment:d,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U}){const[w,H]=ge.useState(null),E=y=>{H(w===y?null:y)},p=()=>{H(null)},A=async y=>{w!==null&&(await d(w,y),H(null))},z=y=>f.filter(T=>T.line===y),K=(y=>{const T=[];let D=r.oldStart,v=r.newStart,M=0;for(;M<y.length;){const L=y[M];if(!L){M++;continue}if(L.type==="normal")T.push({oldLine:L,newLine:{...L},oldLineNumber:D,newLineNumber:v}),D++,v++,M++;else if(L.type==="delete"){let V=M+1;for(;V<y.length&&y[V]?.type==="delete";)V++;const Q=y.slice(M,V),ae=[];for(;V<y.length&&y[V]?.type==="add";){const ne=y[V];ne&&ae.push(ne),V++}const ie=Math.max(Q.length,ae.length);for(let ne=0;ne<ie;ne++){const be=Q[ne],ke=ae[ne];T.push({oldLine:be,newLine:ke,oldLineNumber:be?D+ne:void 0,newLineNumber:ke?v+ne:void 0})}D+=Q.length,v+=ae.length,M=V}else L.type==="add"&&(T.push({newLine:L,newLineNumber:v}),v++,M++)}return T})(r.lines);return b.jsx("div",{className:"bg-github-bg-primary border border-github-border rounded-md overflow-hidden",children:b.jsx("table",{className:"w-full border-collapse font-mono text-xs leading-5",children:b.jsx("tbody",{children:K.map((y,T)=>{const D=y.newLineNumber?z(y.newLineNumber):y.oldLineNumber?z(y.oldLineNumber):[];return b.jsxs(dc.Fragment,{children:[b.jsxs("tr",{className:"group",children:[b.jsx("td",{className:"w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:y.oldLineNumber||""}),b.jsx("td",{className:`w-1/2 p-0 align-top border-r border-github-border relative ${y.oldLine?.type==="delete"?"bg-diff-deletion-bg cursor-pointer":y.oldLine?.type==="normal"?"bg-transparent":"bg-github-bg-secondary"}`,onClick:()=>y.oldLine?.type==="delete"&&y.oldLineNumber&&E(y.oldLineNumber),title:y.oldLine?.type==="delete"&&y.oldLineNumber?"Click to add comment":"",children:y.oldLine&&b.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:b.jsx(oc,{code:y.oldLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit"})})}),b.jsx("td",{className:"w-[60px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:y.newLineNumber||""}),b.jsx("td",{className:`w-1/2 p-0 align-top relative ${y.newLine?.type==="add"?"bg-diff-addition-bg cursor-pointer":y.newLine?.type==="normal"?"bg-transparent cursor-pointer":"bg-github-bg-secondary"}`,onClick:()=>(y.newLine?.type==="add"||y.newLine?.type==="normal")&&y.newLineNumber&&E(y.newLineNumber),title:(y.newLine?.type==="add"||y.newLine?.type==="normal")&&y.newLineNumber?"Click to add comment":"",children:y.newLine&&b.jsx("div",{className:"flex items-center relative min-h-[20px] px-3",children:b.jsx(oc,{code:y.newLine.content,className:"flex-1 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit"})})})]}),D.length>0&&b.jsx("tr",{className:"bg-github-bg-secondary",children:b.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:D.map(v=>b.jsx(Bd,{comment:v,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U},v.id))})}),w&&(w===y.oldLineNumber&&y.oldLine?.type==="delete"||w===y.newLineNumber&&(y.newLine?.type==="add"||y.newLine?.type==="normal"))&&b.jsx("tr",{className:"bg-github-bg-secondary",children:b.jsx("td",{colSpan:4,className:"p-0 border-t border-github-border",children:b.jsx(Ld,{onSubmit:A,onCancel:p})})})]},T)})})})})}function vm({chunk:r,comments:f,onAddComment:d,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U,mode:w="inline"}){const[H,E]=ge.useState(null),[p,A]=ge.useState(null),z=v=>{switch(v.type){case"add":return"bg-diff-addition-bg";case"delete":return"bg-diff-deletion-bg";default:return"bg-transparent"}},G=v=>{switch(v.type){case"add":return"+";case"delete":return"-";default:return" "}},K=(v,M)=>{H===v?(E(null),A(null)):(E(v),A(M))},y=()=>{E(null),A(null)},T=async v=>{H!==null&&(await d(H,v,p||void 0),E(null),A(null))},D=v=>f.filter(M=>M.line===v);return w==="side-by-side"?b.jsx(bm,{chunk:r,comments:f,onAddComment:d,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U}):b.jsx("div",{className:"bg-github-bg-primary",children:b.jsx("table",{className:"w-full border-collapse font-mono text-xs leading-5",children:b.jsx("tbody",{children:r.lines.map((v,M)=>{const L=D(v.newLineNumber||v.oldLineNumber||0);return b.jsxs(dc.Fragment,{children:[b.jsxs("tr",{className:`cursor-pointer group ${z(v)}`,onClick:()=>K(v.newLineNumber||v.oldLineNumber||0,v.content),title:"Click to add comment",children:[b.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:v.oldLineNumber||""}),b.jsx("td",{className:"w-[50px] px-2 text-right text-github-text-muted bg-github-bg-secondary border-r border-github-border select-none align-top",children:v.newLineNumber||""}),b.jsx("td",{className:"p-0 w-full relative align-top",children:b.jsxs("div",{className:"flex items-center relative min-h-[20px]",children:[b.jsx("span",{className:`w-5 text-center text-github-text-muted flex-shrink-0 bg-github-bg-secondary border-r border-github-border ${v.type==="add"?"text-github-accent bg-diff-addition-bg":v.type==="delete"?"text-github-danger bg-diff-deletion-bg":""}`,children:G(v)}),b.jsx(oc,{code:v.content,className:"flex-1 px-3 text-github-text-primary whitespace-pre-wrap break-all overflow-wrap-break-word [&_pre]:m-0 [&_pre]:p-0 [&_pre]:!bg-transparent [&_pre]:font-inherit [&_pre]:text-inherit [&_pre]:leading-inherit [&_code]:!bg-transparent [&_code]:font-inherit [&_code]:text-inherit [&_code]:leading-inherit"})]})})]}),L.map(V=>b.jsx("tr",{className:"bg-github-bg-secondary",children:b.jsx("td",{colSpan:3,className:"p-0 border-t border-github-border",children:b.jsx(Bd,{comment:V,onGeneratePrompt:s,onRemoveComment:O,onUpdateComment:U})})},V.id)),H===(v.newLineNumber||v.oldLineNumber)&&b.jsx("tr",{className:"bg-[var(--bg-secondary)]",children:b.jsx("td",{colSpan:3,className:"p-0 border-t border-[var(--border-muted)]",children:b.jsx(Ld,{onSubmit:T,onCancel:y})})})]},M)})})})})}function Sm({file:r,comments:f,diffMode:d,reviewedFiles:s,onToggleReviewed:O,onAddComment:U,onGeneratePrompt:w,onRemoveComment:H,onUpdateComment:E}){const p=s.has(r.path);mm(r.path);const A=G=>{switch(G){case"added":return b.jsx(jd,{size:16,className:"text-github-accent"});case"deleted":return b.jsx(Ud,{size:16,className:"text-github-danger"});case"renamed":return b.jsx(Md,{size:16,className:"text-github-warning"});default:return b.jsx(Cd,{size:16,className:"text-github-text-secondary"})}},z=async(G,K,y)=>{try{await U(r.path,G,K,y)}catch(T){console.error("Failed to add comment:",T)}};return b.jsxs("div",{className:"bg-github-bg-primary",children:[b.jsxs("div",{className:"bg-github-bg-secondary border-b border-github-border px-5 py-4 flex items-center justify-between flex-wrap gap-3 sticky top-0 z-10",children:[b.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[b.jsx("button",{onClick:()=>O(r.path),className:"text-github-text-muted hover:text-github-text-primary transition-colors cursor-pointer",title:p?"Expand file":"Collapse file",children:p?b.jsx(Rd,{size:16}):b.jsx(Dd,{size:16})}),A(r.status),b.jsx("h2",{className:"text-sm font-mono text-github-text-primary m-0 overflow-hidden text-ellipsis whitespace-nowrap",children:r.path}),b.jsx("button",{className:"bg-transparent border-none cursor-pointer px-1.5 py-1 rounded text-sm text-github-text-secondary transition-all hover:bg-github-bg-tertiary hover:text-github-text-primary",onClick:()=>{navigator.clipboard.writeText(r.path).then(()=>{console.log("File path copied to clipboard:",r.path)}).catch(G=>{console.error("Failed to copy file path:",G)})},title:"Copy file path",children:b.jsx(zd,{size:14})}),r.oldPath&&r.oldPath!==r.path&&b.jsxs("span",{className:"text-xs text-github-text-muted italic",children:["(renamed from ",r.oldPath,")"]})]}),b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[b.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-accent bg-green-100/10",children:["+",r.additions]}),b.jsxs("span",{className:"font-medium px-1 py-0.5 rounded text-github-danger bg-red-100/10",children:["-",r.deletions]})]}),b.jsxs("button",{onClick:()=>O(r.path),className:`flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-all duration-200 ${s.has(r.path)?"bg-github-accent text-white":"bg-gray-600 text-gray-200 border border-gray-500 hover:bg-gray-500 hover:text-white"}`,title:s.has(r.path)?"Mark as not reviewed":"Mark as reviewed",children:[s.has(r.path)?b.jsx(wd,{size:14}):b.jsx(ah,{size:14}),"Viewed"]})]})]}),!p&&b.jsx("div",{className:"overflow-y-auto",children:r.chunks.map((G,K)=>b.jsxs("div",{className:"border-b border-github-border",children:[b.jsx("div",{className:"bg-github-bg-tertiary px-3 py-2 border-b border-github-border",children:b.jsx("code",{className:"text-github-text-secondary text-xs font-mono",children:G.header})}),b.jsx(vm,{chunk:G,comments:f,onAddComment:z,onGeneratePrompt:w,onRemoveComment:H,onUpdateComment:E,mode:d})]},K))})]})}function xm(r){const f={name:"",path:"",isDirectory:!0,children:[]};return r.forEach(d=>{const s=d.path.split("/");let O=f;for(let U=0;U<s.length;U++){const w=s[U];if(!w)continue;const H=U===s.length-1,E=s.slice(0,U+1).join("/");O.children||(O.children=[]);let p=O.children.find(A=>A.name===w);p||(p={name:w,path:E,isDirectory:!H,children:H?void 0:[],file:H?d:void 0},O.children.push(p)),O=p}}),f}function Em({files:r,onScrollToFile:f,comments:d,reviewedFiles:s,onToggleReviewed:O}){const U=xm(r),w=v=>{if(!v.isDirectory||!v.children)return[];const M=[];return v.path&&M.push(v.path),v.children.forEach(L=>{M.push(...w(L))}),M},[H,E]=ge.useState(()=>new Set(w(U))),[p,A]=ge.useState(""),z=v=>d.filter(M=>M.file===v).length,G=v=>{if(!p.trim())return v;if(v.isDirectory&&v.children){const M=v.children.map(L=>G(L)).filter(L=>L!==null);return M.length>0?{...v,children:M}:null}else if(v.file)return v.file.path.toLowerCase().includes(p.toLowerCase())?v:null;return null},K=G(U)||{...U,children:[]},y=v=>{switch(v){case"added":return b.jsx(jd,{size:16,className:"text-github-accent"});case"deleted":return b.jsx(Ud,{size:16,className:"text-github-danger"});case"renamed":return b.jsx(Md,{size:16,className:"text-github-warning"});default:return b.jsx(Cd,{size:16,className:"text-github-text-secondary"})}},T=v=>{E(M=>{const L=new Set(M);return L.has(v)?L.delete(v):L.add(v),L})},D=(v,M=0)=>{if(v.isDirectory&&v.children){const L=H.has(v.path),V=ae=>ae.file&&z(ae.file.path)>0?!0:ae.children?ae.children.some(ie=>V(ie)):!1,Q=V(v);return b.jsxs("div",{children:[v.name&&b.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer",style:{paddingLeft:`${M*16+16}px`},onClick:()=>T(v.path),children:[L?b.jsx(Dd,{size:16}):b.jsx(Rd,{size:16}),L?b.jsx(Vy,{size:16,className:"text-github-text-secondary"}):b.jsx(Fy,{size:16,className:"text-github-text-secondary"}),b.jsx("span",{className:"text-sm text-github-text-primary font-medium flex-1 overflow-hidden text-ellipsis whitespace-nowrap",title:v.name,children:v.name}),Q&&b.jsx("span",{className:"bg-github-warning/20 text-github-warning text-xs px-1.5 py-0.5 rounded-full font-medium ml-auto flex items-center gap-1",children:b.jsx(vd,{size:12})})]}),(L||!v.name)&&v.children.map(ae=>D(ae,M+1))]},v.path)}else if(v.file){const L=z(v.file.path),V=s.has(v.file.path);return b.jsxs("div",{className:`flex items-center gap-2 px-4 py-2 hover:bg-github-bg-tertiary cursor-pointer transition-colors ${V?"opacity-70":""}`,style:{paddingLeft:`${M*16+16}px`},onClick:()=>f(v.file.path),children:[b.jsx(kd,{checked:V,onChange:()=>{O(v.file.path)},title:V?"Mark as not reviewed":"Mark as reviewed",className:"z-10"}),y(v.file.status),b.jsx("span",{className:`text-sm text-github-text-primary flex-1 overflow-hidden text-ellipsis whitespace-nowrap ${V?"line-through text-github-text-muted":""}`,title:v.file.path,children:v.name}),L>0&&b.jsxs("span",{className:"bg-github-warning/20 text-github-warning text-xs px-1.5 py-0.5 rounded-full font-medium ml-auto flex items-center gap-1",children:[b.jsx(vd,{size:12}),L]})]},v.file.path)}return null};return b.jsxs("div",{className:"h-full flex flex-col",children:[b.jsxs("div",{className:"px-4 py-3 border-b border-github-border bg-github-bg-tertiary",children:[b.jsxs("h3",{className:"text-sm font-semibold text-github-text-primary m-0 mb-3",children:["Files changed (",r.length,")"]}),b.jsxs("div",{className:"relative",children:[b.jsx(th,{size:16,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-github-text-muted"}),b.jsx("input",{type:"text",placeholder:"Filter files...",value:p,onChange:v=>A(v.target.value),className:"w-full pl-9 pr-3 py-2 text-sm bg-github-bg-primary border border-github-border rounded-md focus:outline-none focus:border-github-accent text-github-text-primary placeholder-github-text-muted"})]})]}),b.jsx("div",{className:"flex-1 overflow-y-auto",children:K.children&&K.children.map(v=>D(v))})]})}function Am(r){const[f,d]=ge.useState([]),s=r?`reviewit-comments-${r}`:"reviewit-comments";return ge.useEffect(()=>{const A=localStorage.getItem(s);if(A)try{d(JSON.parse(A))}catch(z){console.error("Failed to parse saved comments:",z)}},[s]),ge.useEffect(()=>{localStorage.setItem(s,JSON.stringify(f))},[f,s]),{comments:f,addComment:(A,z,G,K)=>{console.log("Adding comment with codeContent:",K);const y={id:`${A}:${z}:${Date.now()}`,file:A,line:z,body:G,timestamp:new Date().toISOString(),codeContent:K};return d(T=>[...T,y]),y},removeComment:A=>{d(z=>z.filter(G=>G.id!==A))},updateComment:(A,z)=>{d(G=>G.map(K=>K.id===A?{...K,body:z}:K))},clearAllComments:()=>{d([]),localStorage.removeItem(s)},generatePrompt:A=>`${A.file}:${A.line}
|
|
184
184
|
${A.body}`,generateAllCommentsPrompt:()=>f.length===0?"No comments available.":f.map(z=>`${z.file}:${z.line}
|
|
185
185
|
${z.body}`).join(`
|
|
186
186
|
=====
|
|
187
|
-
`)}}function _m(){const[r,f]=ge.useState(null),[d,s]=ge.useState(new Set),[O,U]=ge.useState("side-by-side"),[w,H]=ge.useState(!0),[E,p]=ge.useState(!0),[A,z]=ge.useState(null),[G,K]=ge.useState(!1),[y,T]=ge.useState(320),{comments:D,addComment:v,removeComment:M,updateComment:L,generatePrompt:V,generateAllCommentsPrompt:Q}=Am(r?.commit),ae=F=>{F.preventDefault();const Ee=F.clientX,se=y,re=Y=>{const J=Math.max(200,Math.min(600,se+(Y.clientX-Ee)));T(J)},R=()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",R)};document.addEventListener("mousemove",re),document.addEventListener("mouseup",R)};ge.useEffect(()=>{ne()},[w]),ge.useEffect(()=>{const F=()=>{if(D.length>0){const Ee=JSON.stringify({comments:D});navigator.sendBeacon("/api/comments",Ee)}};return window.addEventListener("beforeunload",F),()=>{window.removeEventListener("beforeunload",F),F()}},[D]),ge.useEffect(()=>{const F=new EventSource("/api/heartbeat");return F.onopen=()=>{console.log("Connected to server heartbeat")},F.onerror=()=>{console.log("Server connection lost"),F.close()},()=>{F.close()}},[]);const ie=F=>{const Ee=["pnpm-lock.yaml","package-lock.json","yarn.lock","Cargo.lock","Gemfile.lock","composer.lock","Pipfile.lock","poetry.lock","go.sum","mix.lock"],se=F.split("/").pop()||"";return Ee.includes(se)},ne=async()=>{try{const F=await fetch(`/api/diff?ignoreWhitespace=${w}`);if(!F.ok)throw new Error("Failed to fetch diff data");const Ee=await F.json();f(Ee);const se=Ee.files.filter(re=>ie(re.path)).map(re=>re.path);se.length>0&&s(re=>new Set([...re,...se]))}catch(F){z(F instanceof Error?F.message:"Unknown error")}finally{p(!1)}},be=(F,Ee,se,re)=>(v(F,Ee,se,re),Promise.resolve()),ke=async()=>{try{const F=Q();await navigator.clipboard.writeText(F),K(!0),setTimeout(()=>K(!1),2e3)}catch(F){console.error("Failed to copy all comments prompt:",F)}},ze=F=>{s(Ee=>{const se=new Set(Ee);return se.has(F)?se.delete(F):(se.add(F),setTimeout(()=>{const R=document.getElementById(`file-${F.replace(/[^a-zA-Z0-9]/g,"-")}`);R&&R.scrollIntoView({behavior:"instant",block:"start"})},100)),se})};return E?b.jsx("div",{className:"flex items-center justify-center h-screen bg-github-bg-primary",children:b.jsx("div",{className:"text-github-text-secondary text-base",children:"Loading diff..."})}):A?b.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-github-bg-primary text-center gap-2",children:[b.jsx("h2",{className:"text-github-danger text-2xl mb-2",children:"Error"}),b.jsx("p",{className:"text-github-text-secondary text-base",children:A})]}):r?b.jsxs("div",{className:"h-screen flex flex-col",children:[b.jsxs("header",{className:"bg-github-bg-secondary border-b border-github-border flex items-center",children:[b.jsx("div",{className:"px-4 py-3 border-r border-github-border",style:{width:`${y}px`,minWidth:"200px",maxWidth:"600px"},children:b.jsxs("h1",{className:"text-lg font-semibold text-github-text-primary m-0 flex items-center gap-2",children:[b.jsx(Ly,{size:20}),"ReviewIt"]})}),b.jsx("div",{className:"w-1"}),b.jsxs("div",{className:"flex-1 px-4 py-3 flex items-center justify-between gap-4",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"flex bg-github-bg-tertiary border border-github-border rounded-md p-1",children:[b.jsxs("button",{onClick:()=>U("side-by-side"),className:`px-3 py-1.5 text-xs font-medium rounded transition-all duration-200 flex items-center gap-1.5 cursor-pointer ${O==="side-by-side"?"bg-github-bg-primary text-github-text-primary shadow-sm":"text-github-text-secondary hover:text-github-text-primary"}`,children:[b.jsx(Hy,{size:14}),"Side by Side"]}),b.jsxs("button",{onClick:()=>U("inline"),className:`px-3 py-1.5 text-xs font-medium rounded transition-all duration-200 flex items-center gap-1.5 cursor-pointer ${O==="inline"?"bg-github-bg-primary text-github-text-primary shadow-sm":"text-github-text-secondary hover:text-github-text-primary"}`,children:[b.jsx(My,{size:14}),"Inline"]})]}),b.jsx(kd,{checked:w,onChange:H,label:"Ignore Whitespace",title:w?"Show whitespace changes":"Ignore whitespace changes"})]}),b.jsxs("div",{className:"flex items-center gap-4 text-sm text-github-text-secondary",children:[D.length>0&&b.jsxs("button",{onClick:ke,className:"text-xs px-3 py-1.5 bg-yellow-900/20 text-yellow-200 border border-yellow-600/50 rounded hover:bg-yellow-800/30 hover:border-yellow-500 transition-all whitespace-nowrap flex items-center gap-1.5",title:`Copy all ${D.length} comments to Claude Code`,children:[b.jsx(zd,{size:12}),G?"Copied All!":`Copy All Prompt (${D.length})`]}),b.jsxs("span",{children:["Reviewing:"," ",b.jsx("code",{className:"bg-github-bg-tertiary px-1.5 py-0.5 rounded text-xs text-github-text-primary",children:r.commit.includes("
|
|
187
|
+
`)}}function _m(){const[r,f]=ge.useState(null),[d,s]=ge.useState(new Set),[O,U]=ge.useState("side-by-side"),[w,H]=ge.useState(!0),[E,p]=ge.useState(!0),[A,z]=ge.useState(null),[G,K]=ge.useState(!1),[y,T]=ge.useState(320),{comments:D,addComment:v,removeComment:M,updateComment:L,generatePrompt:V,generateAllCommentsPrompt:Q}=Am(r?.commit),ae=F=>{F.preventDefault();const Ee=F.clientX,se=y,re=Y=>{const J=Math.max(200,Math.min(600,se+(Y.clientX-Ee)));T(J)},R=()=>{document.removeEventListener("mousemove",re),document.removeEventListener("mouseup",R)};document.addEventListener("mousemove",re),document.addEventListener("mouseup",R)};ge.useEffect(()=>{ne()},[w]),ge.useEffect(()=>{const F=()=>{if(D.length>0){const Ee=JSON.stringify({comments:D});navigator.sendBeacon("/api/comments",Ee)}};return window.addEventListener("beforeunload",F),()=>{window.removeEventListener("beforeunload",F),F()}},[D]),ge.useEffect(()=>{const F=new EventSource("/api/heartbeat");return F.onopen=()=>{console.log("Connected to server heartbeat")},F.onerror=()=>{console.log("Server connection lost"),F.close()},()=>{F.close()}},[]);const ie=F=>{const Ee=["pnpm-lock.yaml","package-lock.json","yarn.lock","Cargo.lock","Gemfile.lock","composer.lock","Pipfile.lock","poetry.lock","go.sum","mix.lock"],se=F.split("/").pop()||"";return Ee.includes(se)},ne=async()=>{try{const F=await fetch(`/api/diff?ignoreWhitespace=${w}`);if(!F.ok)throw new Error("Failed to fetch diff data");const Ee=await F.json();f(Ee);const se=Ee.files.filter(re=>ie(re.path)).map(re=>re.path);se.length>0&&s(re=>new Set([...re,...se]))}catch(F){z(F instanceof Error?F.message:"Unknown error")}finally{p(!1)}},be=(F,Ee,se,re)=>(v(F,Ee,se,re),Promise.resolve()),ke=async()=>{try{const F=Q();await navigator.clipboard.writeText(F),K(!0),setTimeout(()=>K(!1),2e3)}catch(F){console.error("Failed to copy all comments prompt:",F)}},ze=F=>{s(Ee=>{const se=new Set(Ee);return se.has(F)?se.delete(F):(se.add(F),setTimeout(()=>{const R=document.getElementById(`file-${F.replace(/[^a-zA-Z0-9]/g,"-")}`);R&&R.scrollIntoView({behavior:"instant",block:"start"})},100)),se})};return E?b.jsx("div",{className:"flex items-center justify-center h-screen bg-github-bg-primary",children:b.jsx("div",{className:"text-github-text-secondary text-base",children:"Loading diff..."})}):A?b.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-github-bg-primary text-center gap-2",children:[b.jsx("h2",{className:"text-github-danger text-2xl mb-2",children:"Error"}),b.jsx("p",{className:"text-github-text-secondary text-base",children:A})]}):r?b.jsxs("div",{className:"h-screen flex flex-col",children:[b.jsxs("header",{className:"bg-github-bg-secondary border-b border-github-border flex items-center",children:[b.jsx("div",{className:"px-4 py-3 border-r border-github-border",style:{width:`${y}px`,minWidth:"200px",maxWidth:"600px"},children:b.jsxs("h1",{className:"text-lg font-semibold text-github-text-primary m-0 flex items-center gap-2",children:[b.jsx(Ly,{size:20}),"ReviewIt"]})}),b.jsx("div",{className:"w-1"}),b.jsxs("div",{className:"flex-1 px-4 py-3 flex items-center justify-between gap-4",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsxs("div",{className:"flex bg-github-bg-tertiary border border-github-border rounded-md p-1",children:[b.jsxs("button",{onClick:()=>U("side-by-side"),className:`px-3 py-1.5 text-xs font-medium rounded transition-all duration-200 flex items-center gap-1.5 cursor-pointer ${O==="side-by-side"?"bg-github-bg-primary text-github-text-primary shadow-sm":"text-github-text-secondary hover:text-github-text-primary"}`,children:[b.jsx(Hy,{size:14}),"Side by Side"]}),b.jsxs("button",{onClick:()=>U("inline"),className:`px-3 py-1.5 text-xs font-medium rounded transition-all duration-200 flex items-center gap-1.5 cursor-pointer ${O==="inline"?"bg-github-bg-primary text-github-text-primary shadow-sm":"text-github-text-secondary hover:text-github-text-primary"}`,children:[b.jsx(My,{size:14}),"Inline"]})]}),b.jsx(kd,{checked:w,onChange:H,label:"Ignore Whitespace",title:w?"Show whitespace changes":"Ignore whitespace changes"})]}),b.jsxs("div",{className:"flex items-center gap-4 text-sm text-github-text-secondary",children:[D.length>0&&b.jsxs("button",{onClick:ke,className:"text-xs px-3 py-1.5 bg-yellow-900/20 text-yellow-200 border border-yellow-600/50 rounded hover:bg-yellow-800/30 hover:border-yellow-500 transition-all whitespace-nowrap flex items-center gap-1.5",title:`Copy all ${D.length} comments to Claude Code`,children:[b.jsx(zd,{size:12}),G?"Copied All!":`Copy All Prompt (${D.length})`]}),b.jsxs("span",{children:["Reviewing:"," ",b.jsx("code",{className:"bg-github-bg-tertiary px-1.5 py-0.5 rounded text-xs text-github-text-primary",children:r.commit.includes("...")?b.jsxs(b.Fragment,{children:[b.jsxs("span",{className:"text-github-text-secondary font-medium",children:[r.commit.split("...")[0],"..."]}),b.jsx("span",{className:"font-medium",children:r.commit.split("...")[1]})]}):r.commit})]}),b.jsxs("span",{children:[r.files.length," file",r.files.length!==1?"s":""," changed"]})]})]})]}),b.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[b.jsx("aside",{className:"bg-github-bg-secondary border-r border-github-border overflow-y-auto",style:{width:`${y}px`,minWidth:"200px",maxWidth:"600px"},children:b.jsx(Em,{files:r.files,onScrollToFile:F=>{const Ee=document.getElementById(`file-${F.replace(/[^a-zA-Z0-9]/g,"-")}`);Ee&&Ee.scrollIntoView({behavior:"smooth",block:"start"})},comments:D,reviewedFiles:d,onToggleReviewed:ze})}),b.jsx("div",{className:"w-1 bg-github-border hover:bg-github-text-muted cursor-col-resize transition-colors",onMouseDown:ae,title:"Drag to resize file list"}),b.jsx("main",{className:"flex-1 overflow-y-auto",children:r.files.map(F=>b.jsx("div",{id:`file-${F.path.replace(/[^a-zA-Z0-9]/g,"-")}`,className:"mb-6",children:b.jsx(Sm,{file:F,comments:D.filter(Ee=>Ee.file===F.path),diffMode:O,reviewedFiles:d,onToggleReviewed:ze,onAddComment:be,onGeneratePrompt:V,onRemoveComment:M,onUpdateComment:L})},F.path))})]})]}):b.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-github-bg-primary text-center gap-2",children:[b.jsx("h2",{className:"text-github-danger text-2xl mb-2",children:"No data"}),b.jsx("p",{className:"text-github-text-secondary text-base",children:"No diff data available"})]})}Ty.createRoot(document.getElementById("root")).render(b.jsx(dc.StrictMode,{children:b.jsx(_m,{})}));export{Nd as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as u}from"./index-
|
|
1
|
+
import{g as u}from"./index-GkNEbjZ7.js";function p(t,a){for(var r=0;r<a.length;r++){const e=a[r];if(typeof e!="string"&&!Array.isArray(e)){for(const s in e)if(s!=="default"&&!(s in t)){const n=Object.getOwnPropertyDescriptor(e,s);n&&Object.defineProperty(t,s,n.get?n:{enumerable:!0,get:()=>e[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var o={},i;function d(){return i||(i=1,function(t){var a=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,e={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[e,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:e.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:e.inside}],keyword:a,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":e,keyword:a,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:e.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:e.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return a.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),o}var c=d();const l=u(c),w=p({__proto__:null,default:l},[c]);export{w as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as c}from"./index-
|
|
1
|
+
import{g as c}from"./index-GkNEbjZ7.js";function f(e,r){for(var n=0;n<r.length;n++){const t=r[n];if(typeof t!="string"&&!Array.isArray(t)){for(const a in t)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(t,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>t[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var u={},d;function g(){return d||(d=1,function(e){var r=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],t=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,a=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:r,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:t,operator:a,punctuation:i};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},o=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];e.languages.insertBefore("php","variable",{string:o,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:r,string:o,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:t,operator:a,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",function(s){if(/<\?/.test(s.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;e.languages["markup-templating"].buildPlaceholders(s,"php",p)}}),e.hooks.add("after-tokenize",function(s){e.languages["markup-templating"].tokenizePlaceholders(s,"php")})}(Prism)),u}var b=g();const y=c(b),m=f({__proto__:null,default:y},[b]);export{m as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l}from"./index-
|
|
1
|
+
import{g as l}from"./index-GkNEbjZ7.js";function d(e,r){for(var n=0;n<r.length;n++){const t=r[n];if(typeof t!="string"&&!Array.isArray(t)){for(const i in t)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(t,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>t[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var a={},o;function g(){return o||(o=1,function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var r={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",t=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:r,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:r,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+t),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+t+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:r,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:r,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:r,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:r,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:r,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism)),a}var u=g();const p=l(u),b=d({__proto__:null,default:p},[u]);export{b as p};
|
package/dist/client/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<link rel="icon" type="image/png" sizes="512x512" href="/icon-512x512.png" />
|
|
11
11
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
12
12
|
<title>ReviewIt - Git Diff Viewer</title>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-GkNEbjZ7.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/index-BKXkeB0O.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
package/dist/server/git-diff.js
CHANGED
|
@@ -37,7 +37,7 @@ export class GitDiffParser {
|
|
|
37
37
|
const targetHash = await this.git.revparse([targetCommitish]);
|
|
38
38
|
const baseHash = await this.git.revparse([baseCommitish]);
|
|
39
39
|
resolvedCommit = createCommitRangeString(shortHash(baseHash), shortHash(targetHash));
|
|
40
|
-
diffArgs = [
|
|
40
|
+
diffArgs = [resolvedCommit];
|
|
41
41
|
}
|
|
42
42
|
if (ignoreWhitespace) {
|
|
43
43
|
diffArgs.push('-w');
|
package/package.json
CHANGED