@nice2dev/ui 1.0.6 β†’ 1.0.10

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.
Files changed (137) hide show
  1. package/dist/NiceAPIFlow.doc-DnQLPUie.js +30 -0
  2. package/dist/NiceAPIFlow.doc-Dx4qw1lm.cjs +6 -0
  3. package/dist/NiceBranchManager.doc-BXjiENlD.cjs +6 -0
  4. package/dist/NiceBranchManager.doc-xLB82YwU.js +30 -0
  5. package/dist/NiceButton-CDiS45Ya.cjs +1 -0
  6. package/dist/NiceButton-D9l39Rs7.js +595 -0
  7. package/dist/NiceCodeTemplate.doc-BWxTE4C_.cjs +6 -0
  8. package/dist/NiceCodeTemplate.doc-CA2U5F-v.js +30 -0
  9. package/dist/NiceDataBranchGraph.doc-CkitupWc.js +29 -0
  10. package/dist/NiceDataBranchGraph.doc-DDUgipqH.cjs +5 -0
  11. package/dist/NiceDataBranchManager.doc-B0ODKOs4.js +30 -0
  12. package/dist/NiceDataBranchManager.doc-CC5o8ihs.cjs +6 -0
  13. package/dist/NiceDataConflictResolver.doc-CdzScNie.cjs +5 -0
  14. package/dist/NiceDataConflictResolver.doc-V8vxYAeo.js +29 -0
  15. package/dist/NiceDataDiffViewer.doc-CR14Bq3A.cjs +6 -0
  16. package/dist/NiceDataDiffViewer.doc-w2I2QjhX.js +30 -0
  17. package/dist/NiceDataMapper.doc-C7jSyHRM.js +30 -0
  18. package/dist/NiceDataMapper.doc-DXjQHz87.cjs +6 -0
  19. package/dist/NiceDataMergeBuilder.doc-CV32WC_w.cjs +6 -0
  20. package/dist/NiceDataMergeBuilder.doc-DtuYb3nx.js +30 -0
  21. package/dist/NiceDataSnapshot.doc-CFLkY3ry.js +30 -0
  22. package/dist/NiceDataSnapshot.doc-CpZyQ17u.cjs +6 -0
  23. package/dist/NiceErrorBoundary-B5nF-OVn.cjs +1 -0
  24. package/dist/NiceErrorBoundary-BAeqfoSc.cjs +1 -0
  25. package/dist/NiceErrorBoundary-D75yr_WE.js +762 -0
  26. package/dist/NiceErrorBoundary-niMx1aSJ.js +837 -0
  27. package/dist/NiceEventOrchestrator.doc-C4SJfIDV.js +30 -0
  28. package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +6 -0
  29. package/dist/NiceForm-CKoJA6NG.js +5131 -0
  30. package/dist/NiceForm-D7xnpnRJ.cjs +382 -0
  31. package/dist/NiceForm.css +1 -0
  32. package/dist/NiceGitBlame.doc-BG3_K9_0.cjs +6 -0
  33. package/dist/NiceGitBlame.doc-DrJABEat.js +30 -0
  34. package/dist/NiceGitConflictResolver.doc-BK7hAfz6.js +30 -0
  35. package/dist/NiceGitConflictResolver.doc-CgroGM9_.cjs +6 -0
  36. package/dist/NiceGitDiffViewer.doc-BAwgcY_3.cjs +6 -0
  37. package/dist/NiceGitDiffViewer.doc-BXKJeP-E.js +30 -0
  38. package/dist/NiceGitGraph.doc-B-WtGuzn.cjs +5 -0
  39. package/dist/NiceGitGraph.doc-DxnDPCgC.js +29 -0
  40. package/dist/NiceGitHooks.doc-BrEizvMp.js +29 -0
  41. package/dist/NiceGitHooks.doc-C4EdV5zj.cjs +5 -0
  42. package/dist/NiceMergeRequestBuilder.doc-C5p8mYuh.cjs +6 -0
  43. package/dist/NiceMergeRequestBuilder.doc-Ct9RCmU8.js +30 -0
  44. package/dist/NiceModal-1QX7NhyH.js +95 -0
  45. package/dist/NiceModal-CAwsKVQ2.cjs +1 -0
  46. package/dist/NiceModuleLifecyclePanel-Brg1RLwi.cjs +1 -0
  47. package/dist/NiceModuleLifecyclePanel-C9xMSjOF.cjs +1 -0
  48. package/dist/NiceModuleLifecyclePanel-CMrPbSw9.js +5249 -0
  49. package/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5053 -0
  50. package/dist/NiceModuleLifecyclePanel.css +1 -0
  51. package/dist/NicePagination-DbE-uOkl.js +171 -0
  52. package/dist/NicePagination-DlealakT.cjs +1 -0
  53. package/dist/NicePinCodeInput-B8cI8zu8.js +11830 -0
  54. package/dist/NicePinCodeInput-CrMfdxxc.js +15287 -0
  55. package/dist/NicePinCodeInput-D0aF9MK8.cjs +692 -0
  56. package/dist/NicePinCodeInput-SGQaHvpE.cjs +419 -0
  57. package/dist/NicePinCodeInput.css +1 -1
  58. package/dist/NicePipelineEditor.doc-0eGt8zbX.cjs +5 -0
  59. package/dist/NicePipelineEditor.doc-DTmaOebn.js +29 -0
  60. package/dist/NicePipelineMonitor.doc-67CmsRcf.cjs +5 -0
  61. package/dist/NicePipelineMonitor.doc-mSMdhuG8.js +29 -0
  62. package/dist/NiceSavedQueryPanel-BZNvqSQW.cjs +596 -0
  63. package/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6190 -0
  64. package/dist/NiceSavedQueryPanel-CZ5bYOe_.js +6449 -0
  65. package/dist/NiceSavedQueryPanel-Ce2s060j.cjs +596 -0
  66. package/dist/NiceStateDesigner.doc-B36u0hNU.js +29 -0
  67. package/dist/NiceStateDesigner.doc-MPmvNHSx.cjs +5 -0
  68. package/dist/NiceTabs-DvOmxKyQ.cjs +1 -0
  69. package/dist/NiceTabs-DzLHzwuA.js +1636 -0
  70. package/dist/NiceTestBuilder.doc-BFInj8GJ.js +30 -0
  71. package/dist/NiceTestBuilder.doc-CB03U_uR.cjs +6 -0
  72. package/dist/NiceToggle-CaY1u82g.js +277 -0
  73. package/dist/NiceToggle-DFJFQv_Z.cjs +1 -0
  74. package/dist/NiceWindow-CVgkxcCz.cjs +1 -0
  75. package/dist/NiceWindow-DeC83yfE.js +1409 -0
  76. package/dist/NiceWindow-IdHAcP70.cjs +1 -0
  77. package/dist/NiceWindow-SiCaREbq.js +1408 -0
  78. package/dist/charts-BAS21jkC.js +4621 -0
  79. package/dist/charts-Bx_kNBsE.js +4280 -0
  80. package/dist/charts-DECVsCHX.cjs +754 -0
  81. package/dist/charts-DShUbWrP.cjs +759 -0
  82. package/dist/charts.cjs +1 -1
  83. package/dist/charts.css +1 -0
  84. package/dist/charts.d.ts +45 -48
  85. package/dist/charts.mjs +1 -1
  86. package/dist/core-BZBTsGWN.cjs +96 -0
  87. package/dist/core-BpghV7Ls.js +17555 -0
  88. package/dist/core-C2ZmWe_u.cjs +96 -0
  89. package/dist/core-Da43q-pO.js +22094 -0
  90. package/dist/data-branching-CJlrg8qf.cjs +1 -0
  91. package/dist/data-branching-DCUwI53s.js +6121 -0
  92. package/dist/data-branching-De4ExX-S.cjs +1 -0
  93. package/dist/data-branching-DiRfob1f.js +6071 -0
  94. package/dist/data-branching.cjs +1 -0
  95. package/dist/data-branching.d.ts +364 -0
  96. package/dist/data-branching.mjs +9 -0
  97. package/dist/data.cjs +1 -1
  98. package/dist/data.d.ts +206 -192
  99. package/dist/data.mjs +1 -1
  100. package/dist/devops-BnYinjkT.cjs +17 -0
  101. package/dist/devops-CXynFG3X.cjs +17 -0
  102. package/dist/devops-Ckh57eti.js +7198 -0
  103. package/dist/devops-D0TfzV5B.js +7660 -0
  104. package/dist/devops.cjs +1 -0
  105. package/dist/devops.d.ts +721 -0
  106. package/dist/devops.mjs +12 -0
  107. package/dist/editors.cjs +1 -1
  108. package/dist/editors.d.ts +311 -393
  109. package/dist/editors.mjs +61 -64
  110. package/dist/feedback.cjs +1 -1
  111. package/dist/feedback.d.ts +3 -44
  112. package/dist/feedback.mjs +11 -10
  113. package/dist/index-B8wxZ8Ps.cjs +5192 -0
  114. package/dist/index-CBIZ6mTQ.cjs +5734 -0
  115. package/dist/index-CIl98Vbm.js +72951 -0
  116. package/dist/index-pAuGTbuB.js +57319 -0
  117. package/dist/index.cjs +1 -1
  118. package/dist/index.css +1 -1
  119. package/dist/index.d.ts +4673 -10015
  120. package/dist/index.mjs +880 -969
  121. package/dist/lazy.cjs +1 -0
  122. package/dist/lazy.d.ts +1848 -0
  123. package/dist/lazy.mjs +98 -0
  124. package/dist/navigation.cjs +1 -1
  125. package/dist/navigation.d.ts +151 -216
  126. package/dist/navigation.mjs +111 -48
  127. package/dist/no-code-B5bzduNP.cjs +332 -0
  128. package/dist/no-code-BCuadkm4.cjs +332 -0
  129. package/dist/no-code-D8RJ7lx0.js +7064 -0
  130. package/dist/no-code-TL7PyulA.js +7005 -0
  131. package/dist/no-code.cjs +1 -0
  132. package/dist/no-code.d.ts +833 -0
  133. package/dist/no-code.mjs +13 -0
  134. package/dist/overlays.cjs +1 -1
  135. package/dist/overlays.d.ts +13 -45
  136. package/dist/overlays.mjs +490 -24
  137. package/package.json +24 -2
@@ -0,0 +1,17 @@
1
+ "use strict";const e=require("react/jsx-runtime"),i=require("react"),pe=["var(--color-success, #22c55e)","var(--color-primary, #3b82f6)","var(--color-warning, #f59e0b)","var(--color-accent-pink, #ec4899)","var(--color-accent, #8b5cf6)","#14b8a6","#f97316","var(--color-error, #ef4444)","var(--color-accent, #6366f1)","#84cc16"],xe=24,ue=40,fe=28,ze=6,Re=4;function Ie(x,v,z,N){const A=[],q=[],G=new Map;x.forEach((h,m)=>G.set(h.hash,m));const M=new Map,T=[],L=new Map;let U=0;const _=new Map;if(v.forEach(h=>{if(!h.lastCommit)return;const m=_.get(h.lastCommit)||[];m.push({type:h.isRemote?"remote":"branch",name:h.name,commit:h.lastCommit,color:h.isHead?"var(--color-success, #22c55e)":h.isRemote?"var(--text-muted, #6b7280)":"var(--color-primary, #3b82f6)"}),_.set(h.lastCommit,m)}),z.forEach(h=>{const m=_.get(h.commit)||[];m.push({type:"tag",name:h.name,commit:h.commit,color:"var(--color-warning, #f59e0b)"}),_.set(h.commit,m)}),N){const h=_.get(N)||[];h.push({type:"head",name:"HEAD",commit:N,color:"var(--color-error, #ef4444)"}),_.set(N,h)}return x.forEach((h,m)=>{let w=T.findIndex(C=>C===h.hash);w===-1&&(w=T.findIndex(C=>C===null),w===-1&&(w=T.length,T.push(null))),L.has(w)||(L.set(w,pe[U%pe.length]),U++),M.set(h.hash,w);const B=L.get(w)||pe[0];A.push({commit:h,x:w,y:m,color:B,refs:_.get(h.hash)||[]}),h.parents.forEach((C,j)=>{const y=G.get(C);if(y!==void 0){let W=M.get(C);W===void 0&&(j===0?(W=w,T[w]=C):(W=T.findIndex(P=>P===null),W===-1?(W=T.length,T.push(C)):T[W]=C),M.set(C,W));const V=L.get(W)||B;q.push({from:h.hash,to:C,fromX:w,fromY:m,toX:W,toY:y,color:j===0?B:V,type:j===0?w===W?"straight":"branch":"merge"})}}),(h.parents.length===0||!x.slice(m+1).some(C=>C.parents.includes(h.hash)))&&(T[w]=null)}),{nodes:A,edges:q}}const Be=({nodes:x,edges:v,selectedHash:z,compact:N,onNodeClick:A,onNodeDoubleClick:q})=>{const G=N?fe:ue,M=N?Re:ze,L=(Math.max(...x.map(m=>m.x),0)+2)*xe,U=(x.length+1)*G,_=m=>xe/2+m*xe,h=m=>G/2+m*G;return e.jsxs("svg",{width:L,height:U,style:{minWidth:L,minHeight:U,display:"block"},children:[v.map((m,w)=>{const B=_(m.fromX),C=h(m.fromY),j=_(m.toX),y=h(m.toY);if(m.type==="straight")return e.jsx("line",{x1:B,y1:C,x2:j,y2:y,stroke:m.color,strokeWidth:2},w);const W=(C+y)/2,V=`M ${B} ${C} C ${B} ${W}, ${j} ${W}, ${j} ${y}`;return e.jsx("path",{d:V,fill:"none",stroke:m.color,strokeWidth:2,strokeDasharray:m.type==="merge"?"4,2":void 0},w)}),x.map(m=>{const w=_(m.x),B=h(m.y),C=m.commit.hash===z,j=m.commit.isMerge;return e.jsxs("g",{onClick:()=>A(m.commit.hash),onDoubleClick:()=>q(m.commit.hash),style:{cursor:"pointer"},children:[C&&e.jsx("circle",{cx:w,cy:B,r:M+4,fill:"none",stroke:"#fff",strokeWidth:2}),e.jsx("circle",{cx:w,cy:B,r:M,fill:j?"var(--bg-elevated, #1e1e1e)":m.color,stroke:m.color,strokeWidth:j?2:0}),m.refs.length>0&&!N&&e.jsx("foreignObject",{x:w+10,y:B-8,width:200,height:16,children:e.jsx("div",{style:{display:"flex",gap:4,whiteSpace:"nowrap"},children:m.refs.map((y,W)=>e.jsxs("span",{style:{padding:"1px 6px",borderRadius:4,fontSize:10,fontWeight:500,background:`${y.color}22`,color:y.color,border:`1px solid ${y.color}44`},children:[y.type==="tag"?"🏷️ ":y.type==="head"?"πŸ‘‰ ":"",y.name]},W))})})]},m.commit.hash)})]})},ge=({commits:x,branches:v,tags:z,head:N,selectedCommit:A,branchFilter:q,authorFilter:G,dateRange:M,searchQuery:T,maxCommits:L=100,showRemotes:U=!0,showTags:_=!0,compact:h=!1,onCommitSelect:m,onCommitDoubleClick:w,onBranchCheckout:B,onBranchCreate:C,onTagCreate:j,onCherryPick:y,onRevert:W,onReset:V,onCompare:P,onViewDiff:D,className:b,style:S,"data-testid":u})=>{const[k,E]=i.useState(A),[F,K]=i.useState(null),[O,Y]=i.useState(!1),[X,d]=i.useState(null),r=i.useRef(null),l=A??k,o=i.useMemo(()=>{let f=x;if(q&&q.length>0){const I=new Set;v.filter(J=>q.includes(J.name)).forEach(J=>{J.lastCommit&&I.add(J.lastCommit)}),f=f.filter(J=>I.has(J.hash))}if(G&&G.length>0&&(f=f.filter(I=>G.some(J=>I.author.name.toLowerCase().includes(J.toLowerCase())||I.author.email.toLowerCase().includes(J.toLowerCase())))),M&&(M.from&&(f=f.filter(I=>I.date>=M.from)),M.to&&(f=f.filter(I=>I.date<=M.to))),T&&T.trim()){const I=T.toLowerCase();f=f.filter(J=>J.hash.toLowerCase().includes(I)||J.shortHash.toLowerCase().includes(I)||J.message.toLowerCase().includes(I)||J.author.name.toLowerCase().includes(I))}return f.slice(0,L)},[x,q,G,M,T,L,v]),{nodes:t,edges:p}=i.useMemo(()=>Ie(o,U?v:v.filter(f=>!f.isRemote),_?z:[],N),[o,v,z,N,U,_]),c=i.useMemo(()=>o.find(f=>f.hash===l),[o,l]),n=i.useCallback(f=>{if(O&&X)P?.(X,f),Y(!1),d(null);else if(O)d(f);else{E(f);const I=o.find(J=>J.hash===f);I&&m?.(I)}},[O,X,o,m,P]),g=i.useCallback(f=>{const I=o.find(J=>J.hash===f);I&&(w?.(I),D?.(f))},[o,w,D]),R=i.useCallback((f,I)=>{f.preventDefault(),K({x:f.clientX,y:f.clientY,commit:I})},[]),ee=i.useCallback(()=>K(null),[]),Z=f=>{const J=new Date().getTime()-f.getTime(),te=Math.floor(J/(1e3*60*60*24));return te===0?"Today":te===1?"Yesterday":te<7?`${te} days ago`:f.toLocaleDateString()},Q=h?fe:ue;return e.jsxs("div",{className:`nice-git-graph ${b||""}`,style:{display:"flex",height:"100%",background:"var(--bg-elevated, #1e1e1e)",color:"var(--text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...S},"data-testid":u,onClick:ee,children:[e.jsxs("div",{ref:r,style:{flex:1,overflow:"auto",display:"flex"},children:[e.jsx("div",{style:{flexShrink:0,borderRight:"1px solid var(--border-color, #333)"},children:e.jsx(Be,{nodes:t,edges:p,selectedHash:l,compact:h,onNodeClick:n,onNodeDoubleClick:g})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[t.map(f=>e.jsxs("div",{onClick:()=>n(f.commit.hash),onDoubleClick:()=>g(f.commit.hash),onContextMenu:I=>R(I,f.commit),style:{height:Q,padding:"0 12px",display:"flex",alignItems:"center",gap:12,cursor:"pointer",background:f.commit.hash===l?"rgba(59, 130, 246, 0.15)":"transparent",borderBottom:"1px solid #2a2a2a"},children:[f.commit.author.avatar?e.jsx("img",{src:f.commit.author.avatar,alt:"",style:{width:h?20:24,height:h?20:24,borderRadius:"50%",flexShrink:0}}):e.jsx("div",{style:{width:h?20:24,height:h?20:24,borderRadius:"50%",background:f.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:h?10:12,color:"var(--bg-primary, #fff)",fontWeight:600,flexShrink:0},children:f.commit.author.name.charAt(0).toUpperCase()}),e.jsx("div",{style:{flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontSize:h?12:13},children:f.commit.message}),f.commit.stats&&!h&&e.jsxs("div",{style:{display:"flex",gap:8,fontSize:11,color:"var(--text-muted, #888)",flexShrink:0},children:[e.jsxs("span",{style:{color:"var(--color-success, #22c55e)"},children:["+",f.commit.stats.additions]}),e.jsxs("span",{style:{color:"var(--color-error, #ef4444)"},children:["-",f.commit.stats.deletions]})]}),e.jsx("code",{style:{fontSize:h?10:11,color:"var(--text-muted, #888)",fontFamily:"monospace",flexShrink:0},children:f.commit.shortHash}),!h&&e.jsx("span",{style:{fontSize:11,color:"var(--text-muted, #888)",flexShrink:0,width:100},children:f.commit.author.name}),e.jsx("span",{style:{fontSize:h?10:11,color:"var(--text-muted, #666)",flexShrink:0,width:h?60:80,textAlign:"right"},children:Z(f.commit.date)})]},f.commit.hash)),o.length===0&&e.jsx("div",{style:{padding:24,textAlign:"center",color:"var(--text-muted, #666)",fontSize:13},children:"No commits match the filters"})]})]}),c&&!h&&e.jsxs("div",{style:{width:320,borderLeft:"1px solid var(--border-color, #333)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid var(--border-color, #333)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[c.author.avatar?e.jsx("img",{src:c.author.avatar,alt:"",style:{width:32,height:32,borderRadius:"50%"}}):e.jsx("div",{style:{width:32,height:32,borderRadius:"50%",background:"var(--color-primary, #3b82f6)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--bg-primary, #fff)",fontWeight:600},children:c.author.name.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,fontSize:13},children:c.author.name}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted, #888)"},children:c.author.email})]})]}),e.jsx("code",{style:{fontSize:11,color:"var(--text-muted, #888)",fontFamily:"monospace"},children:c.hash})]}),e.jsxs("div",{style:{padding:16,borderBottom:"1px solid var(--border-color, #333)"},children:[e.jsx("div",{style:{fontSize:14,fontWeight:500,marginBottom:8},children:c.message}),c.body&&e.jsx("div",{style:{fontSize:12,color:"var(--text-muted, #aaa)",whiteSpace:"pre-wrap",maxHeight:120,overflow:"auto"},children:c.body})]}),c.stats&&e.jsxs("div",{style:{padding:16,borderBottom:"1px solid var(--border-color, #333)",display:"flex",gap:16},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:20,fontWeight:600},children:c.stats.filesChanged}),e.jsx("div",{style:{fontSize:10,color:"var(--text-muted, #888)"},children:"files changed"})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:20,fontWeight:600,color:"var(--color-success, #22c55e)"},children:["+",c.stats.additions]}),e.jsx("div",{style:{fontSize:10,color:"var(--text-muted, #888)"},children:"additions"})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:20,fontWeight:600,color:"var(--color-error, #ef4444)"},children:["-",c.stats.deletions]}),e.jsx("div",{style:{fontSize:10,color:"var(--text-muted, #888)"},children:"deletions"})]})]}),e.jsxs("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:8},children:[e.jsx("button",{onClick:()=>D?.(c.hash),style:{padding:"8px 12px",borderRadius:4,border:"none",background:"var(--color-primary, #3b82f6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500},children:"View Changes"}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx("button",{onClick:()=>y?.(c.hash),style:{flex:1,padding:"6px 10px",borderRadius:4,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:11},children:"Cherry Pick"}),e.jsx("button",{onClick:()=>W?.(c.hash),style:{flex:1,padding:"6px 10px",borderRadius:4,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:11},children:"Revert"})]}),e.jsx("button",{onClick:()=>C?.(c.hash),style:{padding:"6px 10px",borderRadius:4,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:11},children:"Create Branch Here"}),e.jsx("button",{onClick:()=>j?.(c.hash),style:{padding:"6px 10px",borderRadius:4,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:11},children:"Create Tag Here"}),e.jsx("button",{onClick:()=>{Y(!0),d(c.hash)},style:{padding:"6px 10px",borderRadius:4,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:11},children:"Compare with..."})]})]}),O&&e.jsxs("div",{style:{position:"absolute",top:8,left:"50%",transform:"translateX(-50%)",padding:"8px 16px",background:"var(--color-primary, #3b82f6)",borderRadius:4,fontSize:12,fontWeight:500},children:[X?`Select commit to compare with ${X.slice(0,7)}`:"Select first commit",e.jsx("button",{onClick:()=>{Y(!1),d(null)},style:{marginLeft:12,padding:"2px 8px",background:"rgba(255,255,255,0.2)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:11},children:"Cancel"})]}),F&&e.jsx("div",{style:{position:"fixed",left:F.x,top:F.y,background:"var(--bg-elevated, #252525)",border:"1px solid var(--border-color, #444)",borderRadius:6,boxShadow:"0 4px 12px rgba(0,0,0,0.3)",minWidth:160,zIndex:1e3},children:[{label:"View Changes",onClick:()=>D?.(F.commit.hash)},{label:"Cherry Pick",onClick:()=>y?.(F.commit.hash)},{label:"Revert",onClick:()=>W?.(F.commit.hash)},{divider:!0},{label:"Create Branch",onClick:()=>C?.(F.commit.hash)},{label:"Create Tag",onClick:()=>j?.(F.commit.hash)},{divider:!0},{label:"Reset Soft",onClick:()=>V?.(F.commit.hash,"soft")},{label:"Reset Mixed",onClick:()=>V?.(F.commit.hash,"mixed")},{label:"Reset Hard",onClick:()=>V?.(F.commit.hash,"hard"),danger:!0}].map((f,I)=>"divider"in f?e.jsx("div",{style:{height:1,background:"var(--bg-tertiary, #444)",margin:"4px 0"}},I):e.jsx("button",{onClick:()=>{f.onClick?.(),ee()},style:{display:"block",width:"100%",padding:"8px 12px",border:"none",background:"transparent",color:"danger"in f&&f.danger?"var(--color-error, #ef4444)":"var(--bg-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},onMouseOver:J=>{J.currentTarget.style.background="var(--bg-tertiary, #333)"},onMouseOut:J=>{J.currentTarget.style.background="transparent"},children:f.label},I))})]})},Me=Object.freeze(Object.defineProperty({__proto__:null,NiceGitGraph:ge},Symbol.toStringTag,{value:"Module"})),he=({branches:x,currentBranch:v,defaultBranch:z="main",protectionRules:N=[],showRemotes:A=!0,selectedBranch:q,onBranchSelect:G,onCheckout:M,onCreateBranch:T,onDeleteBranch:L,onRenameBranch:U,onMerge:_,onRebase:h,onSetUpstream:m,onPush:w,onPull:B,onCompare:C,onProtectionChange:j,className:y,style:W,"data-testid":V})=>{const[P,D]=i.useState(""),[b,S]=i.useState("all"),[u,k]=i.useState(),[E,F]=i.useState(!1),[K,O]=i.useState(!1),[Y,X]=i.useState(!1),[d,r]=i.useState(""),[l,o]=i.useState(v||z),[t,p]=i.useState(""),[c,n]=i.useState(v||z),[g,R]=i.useState(null),ee=q??u,Z=i.useMemo(()=>{let a=x;if(b==="local"?a=a.filter(s=>!s.isRemote):b==="remote"?a=a.filter(s=>s.isRemote):A||(a=a.filter(s=>!s.isRemote)),P.trim()){const s=P.toLowerCase();a=a.filter($=>$.name.toLowerCase().includes(s))}return a.sort((s,$)=>s.isHead?-1:$.isHead?1:s.name===z?-1:$.name===z?1:s.isRemote!==$.isRemote?s.isRemote?1:-1:s.name.localeCompare($.name))},[x,b,A,P,z]),Q=i.useMemo(()=>{const a=Z.filter($=>!$.isRemote),s=Z.filter($=>$.isRemote);return{local:a,remote:s}},[Z]),f=i.useCallback(a=>{k(a),G?.(a)},[G]),I=i.useCallback((a,s)=>{a.preventDefault(),R({x:a.clientX,y:a.clientY,branch:s})},[]),J=i.useCallback(()=>R(null),[]),te=i.useCallback(()=>{d.trim()&&(T?.(d.trim(),l),r(""),F(!1))},[d,l,T]),ce=i.useCallback(()=>{t&&c&&t!==c&&(_?.(t,c),O(!1))},[t,c,_]),le=a=>{if(!a)return"-";const $=new Date().getTime()-a.getTime(),re=Math.floor($/(1e3*60*60*24));return re===0?"Today":re===1?"Yesterday":re<7?`${re} days ago`:re<30?`${Math.floor(re/7)} weeks ago`:a.toLocaleDateString()},H=i.useMemo(()=>x.find(a=>a.name===ee),[x,ee]),ie=i.useCallback(a=>N.some(s=>new RegExp(s.pattern.replace(/\*/g,".*")).test(a)),[N]),ne=Q.local,se=a=>{const s=a.name===ee,$=a.isHead,re=a.name===z,Ce=ie(a.name);return e.jsxs("div",{onClick:()=>f(a.name),onDoubleClick:()=>M?.(a.name),onContextMenu:we=>I(we,a),style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",cursor:"pointer",background:s?"rgba(59, 130, 246, 0.15)":$?"rgba(34, 197, 94, 0.08)":"transparent",borderLeft:$?"3px solid #22c55e":"3px solid transparent"},children:[e.jsx("span",{style:{fontSize:16},children:a.isRemote?"☁️":$?"πŸ“":"🌿"}),e.jsx("span",{style:{flex:1,fontSize:13,fontWeight:$?600:400,color:$?"var(--color-success, #22c55e)":"var(--text-primary, #e0e0e0)"},children:a.name}),e.jsxs("div",{style:{display:"flex",gap:4},children:[re&&e.jsx("span",{style:{padding:"2px 6px",borderRadius:4,fontSize:10,background:"#3b82f622",color:"var(--color-primary, #3b82f6)",border:"1px solid #3b82f644"},children:"default"}),Ce&&e.jsx("span",{style:{padding:"2px 6px",borderRadius:4,fontSize:10,background:"#f59e0b22",color:"var(--color-warning, #f59e0b)",border:"1px solid #f59e0b44"},children:"πŸ”’ protected"})]}),a.upstream&&(a.ahead||a.behind)&&e.jsxs("div",{style:{display:"flex",gap:4,fontSize:10,color:"var(--text-muted, #888)"},children:[a.ahead?e.jsxs("span",{style:{color:"var(--color-success, #22c55e)"},children:["↑",a.ahead]}):null,a.behind?e.jsxs("span",{style:{color:"var(--color-error, #ef4444)"},children:["↓",a.behind]}):null]}),a.lastCommit&&e.jsx("span",{style:{fontSize:10,color:"var(--text-muted, #666)",width:80,textAlign:"right"},children:le(a.lastCommit.date)})]},a.name)};return e.jsxs("div",{className:`nice-branch-manager ${y||""}`,style:{display:"flex",height:"100%",background:"var(--bg-elevated, #1e1e1e)",color:"var(--text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...W},"data-testid":V,onClick:J,children:[e.jsxs("div",{style:{width:350,display:"flex",flexDirection:"column",borderRight:"1px solid var(--border-color, #333)"},children:[e.jsxs("div",{style:{padding:12,borderBottom:"1px solid var(--border-color, #333)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[e.jsx("span",{style:{fontSize:18},children:"🌳"}),e.jsx("span",{style:{fontWeight:600,fontSize:14},children:"Branches"}),e.jsxs("span",{style:{marginLeft:"auto",padding:"2px 8px",background:"var(--bg-tertiary, #333)",borderRadius:10,fontSize:11},children:[x.filter(a=>!a.isRemote).length," local"]})]}),e.jsx("input",{type:"text",placeholder:"Search branches...",value:P,onChange:a=>D(a.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #252525)",color:"var(--bg-primary, #fff)",fontSize:12,marginBottom:8}}),e.jsx("div",{style:{display:"flex",gap:4},children:["all","local","remote"].map(a=>e.jsx("button",{onClick:()=>S(a),style:{flex:1,padding:"6px 0",borderRadius:4,border:"none",background:b===a?"var(--color-primary, #3b82f6)":"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:11,textTransform:"capitalize"},children:a},a))})]}),e.jsxs("div",{style:{padding:8,borderBottom:"1px solid var(--border-color, #333)",display:"flex",gap:8},children:[e.jsx("button",{onClick:()=>F(!0),style:{flex:1,padding:"8px 12px",borderRadius:4,border:"none",background:"var(--color-success, #22c55e)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500},children:"+ New Branch"}),e.jsx("button",{onClick:()=>O(!0),style:{flex:1,padding:"8px 12px",borderRadius:4,border:"none",background:"var(--color-primary, #3b82f6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500},children:"‡ Merge"})]}),e.jsxs("div",{style:{flex:1,overflow:"auto"},children:[Q.local.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"8px 12px",fontSize:10,fontWeight:600,color:"var(--text-muted, #888)",textTransform:"uppercase",background:"var(--bg-elevated, #252525)"},children:["Local (",Q.local.length,")"]}),Q.local.map(se)]}),A&&Q.remote.length>0&&b!=="local"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"8px 12px",fontSize:10,fontWeight:600,color:"var(--text-muted, #888)",textTransform:"uppercase",background:"var(--bg-elevated, #252525)",marginTop:8},children:["Remote (",Q.remote.length,")"]}),Q.remote.map(se)]}),Z.length===0&&e.jsx("div",{style:{padding:24,textAlign:"center",color:"var(--text-muted, #666)",fontSize:12},children:"No branches match the filter"})]})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:H?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{padding:16,borderBottom:"1px solid var(--border-color, #333)",background:"var(--bg-elevated, #252525)"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontSize:24},children:H.isRemote?"☁️":H.isHead?"πŸ“":"🌿"}),e.jsxs("div",{style:{flex:1},children:[e.jsx("h2",{style:{margin:0,fontSize:18,fontWeight:600},children:H.name}),H.description&&e.jsx("p",{style:{margin:"4px 0 0",fontSize:12,color:"var(--text-muted, #888)"},children:H.description})]}),H.isHead&&e.jsx("span",{style:{padding:"4px 12px",borderRadius:4,background:"#22c55e22",color:"var(--color-success, #22c55e)",fontSize:12,fontWeight:500},children:"βœ“ Current"})]})}),e.jsxs("div",{style:{padding:16,borderBottom:"1px solid var(--border-color, #333)"},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:16},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--text-muted, #888)",marginBottom:4},children:"Upstream"}),e.jsx("div",{style:{fontSize:13},children:H.upstream||e.jsx("span",{style:{color:"var(--text-muted, #666)"},children:"Not set"})})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--text-muted, #888)",marginBottom:4},children:"Sync Status"}),e.jsx("div",{style:{display:"flex",gap:8,fontSize:13},children:H.upstream?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{color:"var(--color-success, #22c55e)"},children:["↑ ",H.ahead||0," ahead"]}),e.jsxs("span",{style:{color:"var(--color-error, #ef4444)"},children:["↓ ",H.behind||0," behind"]})]}):e.jsx("span",{style:{color:"var(--text-muted, #666)"},children:"-"})})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--text-muted, #888)",marginBottom:4},children:"Last Commit"}),e.jsx("div",{style:{fontSize:13},children:H.lastCommit?e.jsxs(e.Fragment,{children:[e.jsx("code",{style:{fontSize:11,color:"var(--text-muted, #aaa)"},children:H.lastCommit.hash.slice(0,7)})," ",le(H.lastCommit.date)]}):e.jsx("span",{style:{color:"var(--text-muted, #666)"},children:"-"})})]})]}),H.lastCommit&&e.jsxs("div",{style:{marginTop:16,padding:12,background:"var(--bg-elevated, #1e1e1e)",borderRadius:6,fontSize:12},children:[e.jsx("div",{style:{fontWeight:500,marginBottom:4},children:H.lastCommit.message}),e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted, #888)"},children:["by ",H.lastCommit.author]})]})]}),e.jsx("div",{style:{padding:16},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:8},children:[!H.isHead&&e.jsx("button",{onClick:()=>M?.(H.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--color-success, #22c55e)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500},children:"πŸ“ Checkout"}),H.upstream&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>B?.(H.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--color-primary, #3b82f6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500},children:"↓ Pull"}),e.jsx("button",{onClick:()=>w?.(H.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--color-accent, #8b5cf6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12,fontWeight:500},children:"↑ Push"})]}),!H.upstream&&!H.isRemote&&e.jsx("button",{onClick:()=>m?.(H.name,`origin/${H.name}`),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12},children:"Set Upstream"}),e.jsx("button",{onClick:()=>{p(H.name),n(v||z),O(!0)},style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12},children:"‡ Merge into..."}),e.jsx("button",{onClick:()=>C?.(z,H.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12},children:"πŸ”€ Compare"}),!H.isHead&&!H.isRemote&&!ie(H.name)&&e.jsx("button",{onClick:()=>L?.(H.name),style:{padding:"10px 16px",borderRadius:6,border:"none",background:"var(--color-error, #ef4444)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12},children:"πŸ—‘ Delete"})]})})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted, #666)",fontSize:13},children:"Select a branch to view details"})}),E&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>F(!1),children:e.jsxs("div",{style:{width:400,background:"var(--bg-elevated, #252525)",borderRadius:8,padding:24},onClick:a=>a.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:"Create New Branch"}),e.jsxs("div",{style:{marginBottom:12},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #888)",marginBottom:4},children:"Branch Name"}),e.jsx("input",{type:"text",placeholder:"feature/my-feature",value:d,onChange:a=>r(a.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:13},autoFocus:!0})]}),e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #888)",marginBottom:4},children:"Based on"}),e.jsx("select",{value:l,onChange:a=>o(a.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:13},children:ne.map(a=>e.jsxs("option",{value:a.name,children:[a.name," ",a.isHead?"(current)":""]},a.name))})]}),e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>F(!1),style:{padding:"10px 20px",borderRadius:6,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12},children:"Cancel"}),e.jsx("button",{onClick:te,disabled:!d.trim(),style:{padding:"10px 20px",borderRadius:6,border:"none",background:d.trim()?"var(--color-success, #22c55e)":"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:d.trim()?"pointer":"not-allowed",fontSize:12,fontWeight:500},children:"Create Branch"})]})]})}),K&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>O(!1),children:e.jsxs("div",{style:{width:400,background:"var(--bg-elevated, #252525)",borderRadius:8,padding:24},onClick:a=>a.stopPropagation(),children:[e.jsx("h3",{style:{margin:"0 0 16px",fontSize:16},children:"Merge Branches"}),e.jsxs("div",{style:{marginBottom:12},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #888)",marginBottom:4},children:"Merge from"}),e.jsxs("select",{value:t,onChange:a=>p(a.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:13},children:[e.jsx("option",{value:"",children:"Select branch..."}),ne.map(a=>e.jsx("option",{value:a.name,children:a.name},a.name))]})]}),e.jsx("div",{style:{textAlign:"center",padding:"8px 0",color:"var(--text-muted, #888)"},children:"↓ into ↓"}),e.jsxs("div",{style:{marginBottom:20},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #888)",marginBottom:4},children:"Merge into"}),e.jsx("select",{value:c,onChange:a=>n(a.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:13},children:ne.map(a=>e.jsxs("option",{value:a.name,children:[a.name," ",a.isHead?"(current)":""]},a.name))})]}),e.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>O(!1),style:{padding:"10px 20px",borderRadius:6,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12},children:"Cancel"}),e.jsx("button",{onClick:ce,disabled:!t||!c||t===c,style:{padding:"10px 20px",borderRadius:6,border:"none",background:t&&c&&t!==c?"var(--color-primary, #3b82f6)":"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:t&&c&&t!==c?"pointer":"not-allowed",fontSize:12,fontWeight:500},children:"Merge"})]})]})}),g&&e.jsx("div",{style:{position:"fixed",left:g.x,top:g.y,background:"var(--bg-elevated, #252525)",border:"1px solid var(--border-color, #444)",borderRadius:6,boxShadow:"0 4px 12px rgba(0,0,0,0.3)",minWidth:160,zIndex:1e3},children:[!g.branch.isHead&&{label:"Checkout",onClick:()=>M?.(g.branch.name)},{label:"Compare",onClick:()=>C?.(z,g.branch.name)},{label:"Merge into current",onClick:()=>_?.(g.branch.name,v||z)},{divider:!0},!g.branch.isRemote&&{label:"Rename",onClick:()=>{const a=prompt("New name:",g.branch.name);a&&U?.(g.branch.name,a)}},!g.branch.isHead&&!g.branch.isRemote&&!ie(g.branch.name)&&{label:"Delete",onClick:()=>L?.(g.branch.name),danger:!0}].filter(Boolean).map((a,s)=>a?"divider"in a?e.jsx("div",{style:{height:1,background:"var(--bg-tertiary, #444)",margin:"4px 0"}},s):e.jsx("button",{onClick:()=>{a.onClick?.(),J()},style:{display:"block",width:"100%",padding:"8px 12px",border:"none",background:"transparent",color:"danger"in a&&a.danger?"var(--color-error, #ef4444)":"var(--bg-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},onMouseOver:$=>$.currentTarget.style.background="var(--bg-tertiary, #333)",onMouseOut:$=>$.currentTarget.style.background="transparent",children:a.label},s):null)})]})},Te=Object.freeze(Object.defineProperty({__proto__:null,NiceBranchManager:he},Symbol.toStringTag,{value:"Module"})),me=({branches:x,users:v=[],labels:z=[],issues:N=[],templates:A=[],diff:q,currentBranch:G,defaultTargetBranch:M="main",initialSourceBranch:T,platform:L="github",onSubmit:U,onCancel:_,onBranchChange:h,onPreview:m,className:w,style:B,"data-testid":C})=>{const[j,y]=i.useState(""),[W,V]=i.useState(""),[P,D]=i.useState(T||G||""),[b,S]=i.useState(M),[u,k]=i.useState(!1),[E,F]=i.useState([]),[K,O]=i.useState([]),[Y,X]=i.useState([]),[d,r]=i.useState([]),[l,o]=i.useState(!1),[t,p]=i.useState(!0),[c,n]=i.useState(!1),[g,R]=i.useState(!1),[ee,Z]=i.useState(!1),[Q,f]=i.useState(!1),I=i.useMemo(()=>P?P.replace(/^(feature|bugfix|hotfix|release)\//,"").replace(/[-_]/g," ").replace(/\b\w/g,$=>$.toUpperCase()):"",[P]),J=i.useMemo(()=>x.filter(s=>!s.isRemote),[x]),te=i.useCallback((s,$)=>{D(s),S($),h?.(s,$)},[h]),ce=i.useCallback(()=>{if(!P||!b||!j.trim())return;const s={title:j.trim(),description:W.trim(),sourceBranch:P,targetBranch:b,isDraft:u,labels:E,reviewers:K,assignees:Y,linkedIssues:d,squashCommits:l,deleteSourceBranch:t};U?.(s)},[j,W,P,b,u,E,K,Y,d,l,t,U]),le=s=>{V(s.content),f(!1)},H=s=>{F($=>$.includes(s)?$.filter(re=>re!==s):[...$,s])},ie=s=>{O($=>$.includes(s)?$.filter(re=>re!==s):[...$,s])},ne=s=>{r($=>$.includes(s)?$.filter(re=>re!==s):[...$,s])},se={github:{title:"Pull Request",btn:"Create Pull Request"},gitlab:{title:"Merge Request",btn:"Create Merge Request"},bitbucket:{title:"Pull Request",btn:"Create Pull Request"},azure:{title:"Pull Request",btn:"Create Pull Request"}},a=P&&b&&P!==b&&j.trim();return e.jsxs("div",{className:`nice-merge-request-builder ${w||""}`,style:{display:"flex",flexDirection:"column",height:"100%",background:"var(--bg-elevated, #1e1e1e)",color:"var(--text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...B},"data-testid":C,children:[e.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border-color, #333)",background:"var(--bg-elevated, #252525)",display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontSize:24},children:"πŸ”€"}),e.jsxs("div",{children:[e.jsxs("h2",{style:{margin:0,fontSize:18,fontWeight:600},children:[u?"Draft ":"",se[L].title]}),e.jsxs("p",{style:{margin:"4px 0 0",fontSize:12,color:"var(--text-muted, #888)"},children:["Create a new ",L==="gitlab"?"merge":"pull"," request"]})]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:20},children:[e.jsxs("div",{style:{background:"var(--bg-elevated, #252525)",borderRadius:8,padding:16,marginBottom:20},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,justifyContent:"center"},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:{display:"block",fontSize:11,color:"var(--text-muted, #888)",marginBottom:4},children:"From"}),e.jsxs("select",{value:P,onChange:s=>te(s.target.value,b),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:13},children:[e.jsx("option",{value:"",children:"Select source branch..."}),J.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name))]})]}),e.jsx("div",{style:{padding:"20px 0 0"},children:e.jsx("span",{style:{fontSize:20,color:"var(--text-muted, #888)"},children:"β†’"})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("label",{style:{display:"block",fontSize:11,color:"var(--text-muted, #888)",marginBottom:4},children:"Into"}),e.jsx("select",{value:b,onChange:s=>te(P,s.target.value),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:13},children:J.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name))})]})]}),q&&e.jsxs("div",{style:{marginTop:12,padding:"8px 12px",background:"var(--bg-elevated, #1e1e1e)",borderRadius:6,display:"flex",gap:16,fontSize:12},children:[e.jsxs("span",{style:{color:"var(--color-success, #22c55e)"},children:["+",q.additions," additions"]}),e.jsxs("span",{style:{color:"var(--color-error, #ef4444)"},children:["-",q.deletions," deletions"]}),e.jsxs("span",{style:{color:"var(--text-muted, #888)"},children:[q.changedFiles," files changed"]})]}),P===b&&P&&e.jsx("div",{style:{marginTop:12,padding:"8px 12px",background:"#ef444422",color:"var(--color-error, #ef4444)",borderRadius:6,fontSize:12},children:"Source and target branches cannot be the same"})]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #888)",marginBottom:6},children:"Title"}),e.jsx("input",{type:"text",value:j,onChange:s=>y(s.target.value),placeholder:I||"Enter a title...",style:{width:"100%",padding:"12px 16px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #252525)",color:"var(--bg-primary, #fff)",fontSize:14}}),!j&&I&&e.jsxs("button",{onClick:()=>y(I),style:{marginTop:4,padding:0,background:"none",border:"none",color:"var(--color-primary, #3b82f6)",fontSize:11,cursor:"pointer"},children:['Use suggested: "',I,'"']})]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:6},children:[e.jsx("label",{style:{fontSize:12,color:"var(--text-muted, #888)"},children:"Description"}),A.length>0&&e.jsx("button",{onClick:()=>f(!Q),style:{padding:"4px 8px",borderRadius:4,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--text-muted, #888)",fontSize:11,cursor:"pointer"},children:"πŸ“ Templates"})]}),e.jsx("textarea",{value:W,onChange:s=>V(s.target.value),placeholder:"Describe your changes...",rows:8,style:{width:"100%",padding:"12px 16px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #252525)",color:"var(--bg-primary, #fff)",fontSize:13,resize:"vertical",fontFamily:"inherit"}})]}),Q&&A.length>0&&e.jsxs("div",{style:{marginBottom:16,padding:12,background:"var(--bg-elevated, #252525)",borderRadius:6,border:"1px solid var(--border-color, #444)"},children:[e.jsx("div",{style:{fontSize:12,color:"var(--text-muted, #888)",marginBottom:8},children:"Select Template"}),A.map(s=>e.jsxs("button",{onClick:()=>le(s),style:{display:"block",width:"100%",padding:"8px 12px",marginBottom:4,borderRadius:4,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},children:[e.jsx("div",{style:{fontWeight:500},children:s.name}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted, #888)"},children:s.description})]},s.id))]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:16,marginBottom:20},children:[e.jsxs("div",{children:[e.jsx("button",{onClick:()=>n(!c),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #252525)",color:"var(--bg-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{children:"🏷️ Labels"}),E.length>0&&e.jsxs("span",{style:{color:"var(--color-primary, #3b82f6)"},children:["(",E.length,")"]})]})}),c&&e.jsx("div",{style:{marginTop:8,padding:8,background:"var(--bg-tertiary, #333)",borderRadius:6,maxHeight:200,overflow:"auto"},children:z.map(s=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:E.includes(s.id),onChange:()=>H(s.id)}),e.jsx("span",{style:{width:12,height:12,borderRadius:"50%",background:s.color}}),e.jsx("span",{style:{fontSize:12},children:s.name})]},s.id))})]}),e.jsxs("div",{children:[e.jsx("button",{onClick:()=>R(!g),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #252525)",color:"var(--bg-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{children:"πŸ‘₯ Reviewers"}),K.length>0&&e.jsxs("span",{style:{color:"var(--color-success, #22c55e)"},children:["(",K.length,")"]})]})}),g&&e.jsx("div",{style:{marginTop:8,padding:8,background:"var(--bg-tertiary, #333)",borderRadius:6,maxHeight:200,overflow:"auto"},children:v.map(s=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:K.includes(s.id),onChange:()=>ie(s.id)}),s.avatar?e.jsx("img",{src:s.avatar,alt:"",style:{width:20,height:20,borderRadius:"50%"}}):e.jsx("span",{style:{width:20,height:20,borderRadius:"50%",background:"var(--text-muted, #666)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10},children:s.name[0]}),e.jsx("span",{style:{fontSize:12},children:s.name})]},s.id))})]}),e.jsxs("div",{children:[e.jsx("button",{onClick:()=>Z(!ee),style:{width:"100%",padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #252525)",color:"var(--bg-primary, #fff)",textAlign:"left",cursor:"pointer",fontSize:12},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{children:"πŸ”— Linked Issues"}),d.length>0&&e.jsxs("span",{style:{color:"var(--color-accent, #8b5cf6)"},children:["(",d.length,")"]})]})}),ee&&e.jsx("div",{style:{marginTop:8,padding:8,background:"var(--bg-tertiary, #333)",borderRadius:6,maxHeight:200,overflow:"auto"},children:N.filter(s=>s.state==="open").map(s=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:d.includes(s.id),onChange:()=>ne(s.id)}),e.jsxs("span",{style:{fontSize:12,color:"var(--text-muted, #888)"},children:["#",s.number]}),e.jsx("span",{style:{fontSize:12,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.title})]},s.id))})]}),e.jsx("div",{children:e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #252525)",cursor:"pointer",fontSize:12},children:[e.jsx("input",{type:"checkbox",checked:u,onChange:s=>k(s.target.checked)}),e.jsx("span",{children:"πŸ“ Create as Draft"})]})})]}),e.jsxs("div",{style:{background:"var(--bg-elevated, #252525)",borderRadius:8,padding:16,marginBottom:20},children:[e.jsx("div",{style:{fontSize:12,color:"var(--text-muted, #888)",marginBottom:12},children:"Merge Options"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",fontSize:12},children:[e.jsx("input",{type:"checkbox",checked:l,onChange:s=>o(s.target.checked)}),"Squash commits on merge"]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",fontSize:12},children:[e.jsx("input",{type:"checkbox",checked:t,onChange:s=>p(s.target.checked)}),"Delete source branch after merge"]})]})]}),q&&q.files.length>0&&e.jsxs("div",{style:{background:"var(--bg-elevated, #252525)",borderRadius:8,padding:16},children:[e.jsxs("div",{style:{fontSize:12,color:"var(--text-muted, #888)",marginBottom:12},children:["Changed Files (",q.changedFiles,")"]}),e.jsx("div",{style:{maxHeight:200,overflow:"auto"},children:q.files.map(s=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:4,fontSize:12},children:[e.jsx("span",{style:{width:12,height:12,borderRadius:2,background:s.status==="added"?"var(--color-success, #22c55e)":s.status==="deleted"?"var(--color-error, #ef4444)":s.status==="renamed"?"var(--color-primary, #3b82f6)":"var(--color-warning, #f59e0b)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:8,color:"var(--bg-primary, #fff)"},children:s.status==="added"?"+":s.status==="deleted"?"-":s.status==="renamed"?"β†’":"M"}),e.jsx("span",{style:{flex:1,fontFamily:"monospace",fontSize:11},children:s.path}),e.jsxs("span",{style:{color:"var(--color-success, #22c55e)",fontSize:11},children:["+",s.additions]}),e.jsxs("span",{style:{color:"var(--color-error, #ef4444)",fontSize:11},children:["-",s.deletions]})]},s.path))})]})]}),e.jsxs("div",{style:{padding:"16px 20px",borderTop:"1px solid var(--border-color, #333)",background:"var(--bg-elevated, #252525)",display:"flex",alignItems:"center",justifyContent:"flex-end",gap:12},children:[e.jsx("button",{onClick:_,style:{padding:"10px 20px",borderRadius:6,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:13},children:"Cancel"}),e.jsx("button",{onClick:()=>m?.({title:j,description:W,sourceBranch:P,targetBranch:b,isDraft:u,labels:E,reviewers:K,assignees:Y,linkedIssues:d,squashCommits:l,deleteSourceBranch:t}),disabled:!a,style:{padding:"10px 20px",borderRadius:6,border:"none",background:a?"var(--bg-tertiary, #333)":"var(--bg-elevated, #222)",color:a?"var(--bg-primary, #fff)":"var(--text-muted, #666)",cursor:a?"pointer":"not-allowed",fontSize:13},children:"Preview"}),e.jsx("button",{onClick:ce,disabled:!a,style:{padding:"10px 24px",borderRadius:6,border:"none",background:a?"var(--color-success, #22c55e)":"var(--bg-elevated, #222)",color:a?"var(--bg-primary, #fff)":"var(--text-muted, #666)",cursor:a?"pointer":"not-allowed",fontSize:13,fontWeight:500},children:u?"Create Draft":se[L].btn})]})]})},We=Object.freeze(Object.defineProperty({__proto__:null,NiceMergeRequestBuilder:me},Symbol.toStringTag,{value:"Module"})),be=({files:x,viewMode:v,showWhitespace:z,comments:N=[],selectedFile:A,showFileTree:q=!0,contextLines:G=3,baseRef:M,headRef:T,onFileSelect:L,onViewModeChange:U,onAddComment:_,onResolveComment:h,onExpandChunk:m,className:w,style:B,"data-testid":C})=>{const[j,y]=i.useState("split"),[W,V]=i.useState(!1),[P,D]=i.useState(x[0]?.path),[b,S]=i.useState(new Set),[u,k]=i.useState(null),E=v??j,F=z??W,K=A??P,O=i.useMemo(()=>x.find(n=>n.path===K),[x,K]),Y=i.useMemo(()=>({additions:x.reduce((n,g)=>n+g.additions,0),deletions:x.reduce((n,g)=>n+g.deletions,0)}),[x]),X=i.useCallback(n=>{D(n),L?.(n)},[L]),d=i.useCallback(n=>{y(n),U?.(n)},[U]),r=i.useCallback((n,g)=>{const R=`${n}:${g}`;S(ee=>{const Z=new Set(ee);return Z.has(R)?Z.delete(R):Z.add(R),Z}),m?.(n,g)},[m]),l=i.useMemo(()=>N.filter(n=>n.filePath===K),[N,K]),o=n=>{switch(n){case"added":return{icon:"+",color:"var(--color-success, #22c55e)"};case"deleted":return{icon:"-",color:"var(--color-error, #ef4444)"};case"modified":return{icon:"M",color:"var(--color-warning, #f59e0b)"};case"renamed":return{icon:"β†’",color:"var(--color-primary, #3b82f6)"};case"copied":return{icon:"C",color:"var(--color-accent, #8b5cf6)"}}},t=(n,g,R)=>{const ee=n.type==="addition"?"rgba(34, 197, 94, 0.1)":n.type==="deletion"?"rgba(239, 68, 68, 0.1)":n.type==="header"?"rgba(59, 130, 246, 0.1)":"transparent",Z=n.type==="addition"?"#4ade80":n.type==="deletion"?"#f87171":n.type==="header"?"var(--color-primary-light, #60a5fa)":"var(--text-primary, #e0e0e0)",Q=R==="old"?n.lineNumberOld:R==="new"?n.lineNumberNew:void 0,f=F?n.content.replace(/ /g,"Β·").replace(/\t/g,"β†’ "):n.content;return e.jsxs("div",{style:{display:"flex",alignItems:"stretch",background:ee,minHeight:20,fontSize:12,fontFamily:'"JetBrains Mono", "Fira Code", monospace'},children:[Q!==void 0&&e.jsx("div",{style:{minWidth:50,padding:"0 8px",textAlign:"right",color:"var(--text-muted, #666)",background:"rgba(0,0,0,0.2)",userSelect:"none",borderRight:"1px solid var(--border-color, #333)"},children:Q}),E==="unified"&&e.jsx("div",{style:{width:20,textAlign:"center",color:Z,fontWeight:600},children:n.type==="addition"?"+":n.type==="deletion"?"-":" "}),e.jsx("div",{style:{flex:1,padding:"0 8px",color:Z,whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis"},children:f||" "}),_&&Q&&n.type!=="header"&&e.jsx("button",{onClick:()=>k({filePath:K,line:Q,side:R||"new",body:""}),style:{width:24,border:"none",background:"transparent",color:"var(--color-primary, #3b82f6)",cursor:"pointer",opacity:.3,transition:"opacity 0.2s"},onMouseEnter:I=>I.currentTarget.style.opacity="1",onMouseLeave:I=>I.currentTarget.style.opacity="0.3",children:"πŸ’¬"})]},`${g}-${R||"unified"}`)},p=n=>e.jsx("div",{style:{borderTop:"1px solid var(--border-color, #333)"},children:n.chunks.map((g,R)=>{const ee=`${n.path}:${R}`;return b.has(ee),e.jsxs("div",{children:[e.jsxs("div",{onClick:()=>r(n.path,R),style:{padding:"6px 12px",background:"rgba(59, 130, 246, 0.1)",borderBottom:"1px solid var(--border-color, #333)",fontSize:11,color:"var(--color-primary-light, #60a5fa)",cursor:"pointer",fontFamily:"monospace"},children:["@@ -",g.oldStart,",",g.oldLines," +",g.newStart,",",g.newLines," @@"," ",g.header||""]}),g.lines.map((Z,Q)=>t(Z,Q))]},R)})}),c=n=>e.jsx("div",{style:{borderTop:"1px solid var(--border-color, #333)"},children:n.chunks.map((g,R)=>{const ee=[],Z=[];for(const f of g.lines)(f.type==="deletion"||f.type==="context")&&ee.push(f),(f.type==="addition"||f.type==="context")&&Z.push(f);const Q=Math.max(ee.length,Z.length);for(;ee.length<Q;)ee.push({content:"",type:"context"});for(;Z.length<Q;)Z.push({content:"",type:"context"});return e.jsxs("div",{children:[e.jsxs("div",{style:{padding:"6px 12px",background:"rgba(59, 130, 246, 0.1)",borderBottom:"1px solid var(--border-color, #333)",fontSize:11,color:"var(--color-primary-light, #60a5fa)",fontFamily:"monospace"},children:["@@ -",g.oldStart,",",g.oldLines," +",g.newStart,",",g.newLines," @@"," ",g.header||""]}),e.jsxs("div",{style:{display:"flex"},children:[e.jsx("div",{style:{flex:1,borderRight:"1px solid var(--border-color, #444)"},children:ee.map((f,I)=>t(f,I,"old"))}),e.jsx("div",{style:{flex:1},children:Z.map((f,I)=>t(f,I,"new"))})]})]},R)})});return e.jsxs("div",{className:`nice-git-diff-viewer ${w||""}`,style:{display:"flex",height:"100%",background:"var(--bg-elevated, #1e1e1e)",color:"var(--text-primary, #e0e0e0)",fontFamily:"system-ui, sans-serif",...B},"data-testid":C,children:[q&&e.jsxs("div",{style:{width:280,borderRight:"1px solid var(--border-color, #333)",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:12,borderBottom:"1px solid var(--border-color, #333)",background:"var(--bg-elevated, #252525)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx("span",{style:{fontSize:16},children:"πŸ“"}),e.jsx("span",{style:{fontWeight:600,fontSize:13},children:"Changed Files"}),e.jsx("span",{style:{marginLeft:"auto",padding:"2px 8px",background:"var(--bg-tertiary, #333)",borderRadius:10,fontSize:11},children:x.length})]}),(M||T)&&e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted, #888)"},children:[M&&e.jsx("span",{children:M}),M&&T&&e.jsx("span",{style:{margin:"0 4px"},children:"β†’"}),T&&e.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:T})]})]}),e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid var(--border-color, #333)",display:"flex",gap:12,fontSize:12},children:[e.jsxs("span",{style:{color:"var(--color-success, #22c55e)"},children:["+",Y.additions]}),e.jsxs("span",{style:{color:"var(--color-error, #ef4444)"},children:["-",Y.deletions]})]}),e.jsx("div",{style:{flex:1,overflow:"auto"},children:x.map(n=>{const g=o(n.status),R=n.path===K;return e.jsxs("div",{onClick:()=>X(n.path),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",cursor:"pointer",background:R?"rgba(59, 130, 246, 0.15)":"transparent",borderLeft:R?"2px solid #3b82f6":"2px solid transparent"},children:[e.jsx("span",{style:{width:16,height:16,borderRadius:2,background:g.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,color:"var(--bg-primary, #fff)",fontWeight:600},children:g.icon}),e.jsx("span",{style:{flex:1,fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.path.split("/").pop()}),e.jsxs("div",{style:{display:"flex",gap:4,fontSize:10},children:[n.additions>0&&e.jsxs("span",{style:{color:"var(--color-success, #22c55e)"},children:["+",n.additions]}),n.deletions>0&&e.jsxs("span",{style:{color:"var(--color-error, #ef4444)"},children:["-",n.deletions]})]})]},n.path)})})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"8px 16px",borderBottom:"1px solid var(--border-color, #333)",background:"var(--bg-elevated, #252525)",display:"flex",alignItems:"center",gap:16},children:[O&&e.jsx("div",{style:{flex:1,fontSize:13,fontFamily:"monospace"},children:O.oldPath&&O.oldPath!==O.path?e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:"var(--color-error, #ef4444)"},children:O.oldPath}),e.jsx("span",{style:{margin:"0 8px",color:"var(--text-muted, #888)"},children:"β†’"}),e.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:O.path})]}):O.path}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("button",{onClick:()=>d("unified"),style:{padding:"6px 12px",borderRadius:4,border:"none",background:E==="unified"?"var(--color-primary, #3b82f6)":"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:11},children:"Unified"}),e.jsx("button",{onClick:()=>d("split"),style:{padding:"6px 12px",borderRadius:4,border:"none",background:E==="split"?"var(--color-primary, #3b82f6)":"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:11},children:"Split"})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,color:"var(--text-muted, #888)",cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:F,onChange:n=>V(n.target.checked)}),"Show whitespace"]})]}),e.jsx("div",{style:{flex:1,overflow:"auto"},children:O?O.binary?e.jsxs("div",{style:{padding:40,textAlign:"center",color:"var(--text-muted, #888)"},children:[e.jsx("span",{style:{fontSize:48},children:"πŸ“¦"}),e.jsx("p",{children:"Binary file cannot be displayed"})]}):E==="split"?c(O):p(O):e.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-muted, #666)"},children:"Select a file to view changes"})}),l.length>0&&e.jsxs("div",{style:{borderTop:"1px solid var(--border-color, #333)",background:"var(--bg-elevated, #252525)",maxHeight:200,overflow:"auto"},children:[e.jsxs("div",{style:{padding:"8px 16px",fontSize:12,fontWeight:600,borderBottom:"1px solid var(--border-color, #333)"},children:["Comments (",l.length,")"]}),l.map(n=>e.jsxs("div",{style:{padding:12,borderBottom:"1px solid var(--border-color, #333)",opacity:n.resolved?.5:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[n.author.avatar?e.jsx("img",{src:n.author.avatar,alt:"",style:{width:20,height:20,borderRadius:"50%"}}):e.jsx("span",{style:{width:20,height:20,borderRadius:"50%",background:"var(--text-muted, #666)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10},children:n.author.name[0]}),e.jsx("span",{style:{fontSize:12,fontWeight:500},children:n.author.name}),e.jsxs("span",{style:{fontSize:10,color:"var(--text-muted, #888)"},children:["Line ",n.line," (",n.side,")"]}),n.resolved&&e.jsx("span",{style:{padding:"2px 6px",borderRadius:4,fontSize:10,background:"#22c55e22",color:"var(--color-success, #22c55e)"},children:"Resolved"}),h&&!n.resolved&&e.jsx("button",{onClick:()=>h(n.id),style:{marginLeft:"auto",padding:"4px 8px",borderRadius:4,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--text-muted, #888)",cursor:"pointer",fontSize:10},children:"Resolve"})]}),e.jsx("div",{style:{fontSize:12,color:"var(--text-secondary, #ccc)"},children:n.body})]},n.id))]}),u&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>k(null),children:e.jsxs("div",{style:{width:400,background:"var(--bg-elevated, #252525)",borderRadius:8,padding:20},onClick:n=>n.stopPropagation(),children:[e.jsxs("h3",{style:{margin:"0 0 12px",fontSize:14},children:["Add comment on line ",u.line]}),e.jsx("textarea",{value:u.body,onChange:n=>k({...u,body:n.target.value}),placeholder:"Write a comment...",rows:4,style:{width:"100%",padding:12,borderRadius:6,border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:13,resize:"vertical"},autoFocus:!0}),e.jsxs("div",{style:{marginTop:12,display:"flex",gap:8,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>k(null),style:{padding:"8px 16px",borderRadius:4,border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:12},children:"Cancel"}),e.jsx("button",{onClick:()=>{u.body.trim()&&(_?.(u.filePath,u.line,u.side,u.body.trim()),k(null))},disabled:!u.body.trim(),style:{padding:"8px 16px",borderRadius:4,border:"none",background:u.body.trim()?"var(--color-primary, #3b82f6)":"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:u.body.trim()?"pointer":"not-allowed",fontSize:12,fontWeight:500},children:"Add Comment"})]})]})})]})]})},$e=Object.freeze(Object.defineProperty({__proto__:null,NiceGitDiffViewer:be},Symbol.toStringTag,{value:"Module"})),Ne=(x,v)=>{const N=new Date().getTime()-x.getTime(),A=Math.floor(N/(1e3*60*60*24));return A===0?"today":A===1?"yesterday":A<7?`${A} days ago`:A<30?`${Math.floor(A/7)} weeks ago`:A<365?`${Math.floor(A/30)} months ago`:`${Math.floor(A/365)} years ago`},Ae=x=>{const z=new Date().getTime()-x.getTime(),N=Math.floor(z/(1e3*60*60*24));return N<7?"rgba(59, 130, 246, 0.3)":N<30?"rgba(34, 197, 94, 0.3)":N<90?"rgba(234, 179, 8, 0.3)":N<365?"rgba(249, 115, 22, 0.3)":"rgba(239, 68, 68, 0.3)"},oe=x=>{const v=["var(--color-primary, #3b82f6)","var(--color-success, #22c55e)","var(--color-warning, #f59e0b)","var(--color-error, #ef4444)","var(--color-accent, #8b5cf6)","var(--color-info, #06b6d4)","var(--color-accent-pink, #ec4899)","#14b8a6","#f97316","var(--color-accent, #6366f1)"];let z=0;for(let N=0;N<x.length;N++)z=(z<<5)-z+x.charCodeAt(N),z=z&z;return v[Math.abs(z)%v.length]},ye=({file:x,viewMode:v="inline",showAgeHeatmap:z=!0,showAvatars:N=!0,groupHunks:A=!0,highlightOnHover:q=!0,timeZone:G,dateRange:M,authorFilter:T,selectedLine:L,syntaxTheme:U="dark",onLineClick:_,onCommitClick:h,onAuthorClick:m,onBlameParent:w,className:B,style:C,"data-testid":j="nice-git-blame"})=>{const[y,W]=i.useState(null),[V,P]=i.useState(null),[D,b]=i.useState(null),S=i.useMemo(()=>{const r=[];return x.hunks.forEach(l=>{l.lines.forEach(o=>{r.push(o)})}),r.sort((l,o)=>l.lineNumber-o.lineNumber)},[x.hunks]),u=i.useMemo(()=>S.filter(r=>!(M?.from&&r.commit.timestamp<M.from||M?.to&&r.commit.timestamp>M.to||T&&T.length>0&&!T.includes(r.commit.author.id))),[S,M,T]),k=i.useMemo(()=>{if(!A)return u.map(t=>({startLine:t.lineNumber,endLine:t.lineNumber,commit:t.commit,lines:[t],isFirstOfCommit:!0}));const r=[];let l=null;const o=new Set;return u.forEach(t=>{if(!l||l.commit.id!==t.commit.id){const p=!o.has(t.commit.id);o.add(t.commit.id),l={startLine:t.lineNumber,endLine:t.lineNumber,commit:t.commit,lines:[t],isFirstOfCommit:p},r.push(l)}else l.endLine=t.lineNumber,l.lines.push(t)}),r},[u,A]),E=i.useMemo(()=>{const r=new Map;return S.forEach(l=>{r.has(l.commit.author.id)||r.set(l.commit.author.id,l.commit.author)}),Array.from(r.values())},[S]),F=i.useMemo(()=>{const r=new Map;return S.forEach(l=>{r.has(l.commit.id)||r.set(l.commit.id,l.commit)}),Array.from(r.values()).sort((l,o)=>o.timestamp.getTime()-l.timestamp.getTime())},[S]),K=i.useCallback(r=>{_?.(r)},[_]),O=i.useCallback((r,l)=>{l.stopPropagation(),V===r.id?P(null):P(r.id),h?.(r)},[V,h]),Y=(r,l)=>{const o=l===0,t=r.commit,p=q&&y===t.id;return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"0 12px",minWidth:v==="inline"?280:40,background:p?"rgba(59, 130, 246, 0.15)":z?Ae(t.timestamp):"transparent",borderRight:`3px solid ${oe(t.author.id)}`,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:()=>W(t.id),onMouseLeave:()=>W(null),onClick:c=>O(t,c),children:[o&&v==="inline"&&e.jsxs(e.Fragment,{children:[N&&e.jsx("div",{style:{width:24,height:24,borderRadius:"50%",background:oe(t.author.id),display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"var(--bg-primary, #fff)",fontWeight:500,flexShrink:0},title:t.author.name,children:t.author.avatar?e.jsx("img",{src:t.author.avatar,alt:t.author.name,style:{width:"100%",height:"100%",borderRadius:"50%"}}):t.author.name[0].toUpperCase()}),e.jsxs("div",{style:{flex:1,minWidth:0,overflow:"hidden"},children:[e.jsx("div",{style:{fontSize:11,fontFamily:"monospace",color:"var(--text-muted, #6b7280)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.shortId}),e.jsx("div",{style:{fontSize:10,color:"var(--text-muted, #9ca3af)",whiteSpace:"nowrap"},children:Ne(t.timestamp)})]})]}),v==="gutter"&&o&&e.jsx("div",{style:{width:24,height:24,borderRadius:"50%",background:oe(t.author.id),display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,color:"var(--bg-primary, #fff)"},title:`${t.author.name} - ${t.shortId}
2
+ ${t.message}`,children:t.author.name[0].toUpperCase()})]})},X=r=>{if(D!==r.lineNumber||v!=="tooltip")return null;const l=r.commit;return e.jsxs("div",{style:{position:"absolute",left:60,top:-8,zIndex:100,background:"var(--text-primary, #1f2937)",border:"1px solid #374151",borderRadius:8,padding:12,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)",minWidth:320},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:"50%",background:oe(l.author.id),display:"flex",alignItems:"center",justifyContent:"center",color:"var(--bg-primary, #fff)",fontWeight:500},children:l.author.name[0].toUpperCase()}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,color:"var(--border-color, #e5e7eb)"},children:l.author.name}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted, #9ca3af)"},children:l.author.email})]})]}),e.jsx("div",{style:{fontFamily:"monospace",fontSize:12,color:"var(--color-primary-light, #60a5fa)",marginBottom:4},children:l.shortId}),e.jsx("div",{style:{fontSize:13,color:"var(--border-color, #e5e7eb)",marginBottom:8},children:l.message}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted, #6b7280)"},children:l.timestamp.toLocaleString()}),l.parents&&l.parents.length>0&&w&&e.jsx("button",{onClick:()=>w(l),style:{marginTop:8,padding:"4px 8px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:4,color:"var(--border-color, #e5e7eb)",fontSize:11,cursor:"pointer"},children:"⬆ Blame parent"})]})},d=r=>V!==r.id?null:e.jsx("div",{style:{background:"var(--text-primary, #1f2937)",borderBottom:"1px solid #374151",padding:16},children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[e.jsx("div",{style:{width:48,height:48,borderRadius:"50%",background:oe(r.author.id),display:"flex",alignItems:"center",justifyContent:"center",color:"var(--bg-primary, #fff)",fontSize:20,fontWeight:500,flexShrink:0},children:r.author.name[0].toUpperCase()}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[e.jsx("span",{style:{fontWeight:500,color:"var(--border-color, #e5e7eb)"},children:r.author.name}),e.jsx("span",{style:{fontSize:11,color:"var(--text-muted, #6b7280)"},children:r.author.email})]}),e.jsx("div",{style:{fontFamily:"monospace",fontSize:13,color:"var(--color-primary-light, #60a5fa)",marginBottom:8},children:r.id}),e.jsx("div",{style:{fontSize:14,color:"var(--border-color, #e5e7eb)",marginBottom:8,lineHeight:1.5},children:r.message}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,fontSize:12,color:"var(--text-muted, #9ca3af)"},children:[e.jsxs("span",{children:["πŸ“… ",r.timestamp.toLocaleString()]}),r.parents&&r.parents.length>0&&e.jsxs("span",{children:["πŸ‘† ",r.parents.length," parent(s)"]})]}),w&&r.parents&&r.parents.length>0&&e.jsx("button",{onClick:()=>w(r),style:{marginTop:12,padding:"6px 12px",background:"var(--color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",fontSize:12,cursor:"pointer"},children:"⬆ Blame in parent commit"})]})]})});return e.jsxs("div",{className:`nice-git-blame ${B||""}`,style:{display:"flex",flexDirection:"column",height:"100%",background:U==="dark"?"var(--bg-canvas, #0d1117)":"var(--bg-primary, #ffffff)",color:U==="dark"?"var(--text-primary, #e6edf3)":"var(--text-primary, #1f2937)",fontFamily:"system-ui, sans-serif",...C},"data-testid":j,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid #30363d",background:U==="dark"?"var(--bg-elevated, #161b22)":"#f6f8fa"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontSize:16},children:"πŸ“‹"}),e.jsx("span",{style:{fontWeight:500},children:x.path}),e.jsxs("span",{style:{fontSize:12,color:"var(--text-muted, #8b949e)"},children:["at ",x.revision.substring(0,7)]})]}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:8},children:e.jsxs("span",{style:{fontSize:12,color:"var(--text-muted, #8b949e)"},children:[F.length," commits by ",E.length," author(s)"]})})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,padding:"8px 16px",borderBottom:"1px solid #30363d",background:U==="dark"?"var(--bg-elevated, #161b22)":"#f6f8fa",flexWrap:"wrap"},children:[E.slice(0,10).map(r=>e.jsxs("div",{onClick:()=>m?.(r),style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer"},children:[e.jsx("div",{style:{width:12,height:12,borderRadius:"50%",background:oe(r.id)}}),e.jsx("span",{style:{fontSize:12},children:r.name})]},r.id)),E.length>10&&e.jsxs("span",{style:{fontSize:12,color:"var(--text-muted, #8b949e)"},children:["+",E.length-10," more"]})]}),e.jsx("div",{style:{flex:1,overflow:"auto",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,lineHeight:"20px"},children:k.map((r,l)=>e.jsxs(i.Fragment,{children:[r.isFirstOfCommit&&V===r.commit.id&&d(r.commit),r.lines.map((o,t)=>e.jsxs("div",{onClick:()=>K(o),onMouseEnter:()=>b(o.lineNumber),onMouseLeave:()=>b(null),style:{display:"flex",alignItems:"stretch",background:L===o.lineNumber?"rgba(59, 130, 246, 0.2)":q&&y===r.commit.id?"rgba(59, 130, 246, 0.08)":"transparent",borderLeft:L===o.lineNumber?"2px solid #3b82f6":"2px solid transparent",position:"relative"},children:[Y(r,t),e.jsx("div",{style:{padding:"0 12px",color:"#6e7681",textAlign:"right",minWidth:50,userSelect:"none",background:U==="dark"?"var(--bg-canvas, #0d1117)":"#f6f8fa",borderRight:"1px solid #30363d"},children:o.lineNumber}),e.jsx("div",{style:{flex:1,padding:"0 16px",whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis"},children:o.content}),v==="tooltip"&&X(o)]},o.lineNumber))]},`${r.commit.id}-${r.startLine}`))}),z&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,padding:"8px 16px",borderTop:"1px solid #30363d",background:U==="dark"?"var(--bg-elevated, #161b22)":"#f6f8fa",fontSize:11,color:"var(--text-muted, #8b949e)"},children:[e.jsx("span",{children:"Age:"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"rgba(59, 130, 246, 0.3)",borderRadius:2}}),e.jsx("span",{children:"<1 week"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"rgba(34, 197, 94, 0.3)",borderRadius:2}}),e.jsx("span",{children:"<1 month"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"rgba(234, 179, 8, 0.3)",borderRadius:2}}),e.jsx("span",{children:"<3 months"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"rgba(249, 115, 22, 0.3)",borderRadius:2}}),e.jsx("span",{children:"<1 year"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:16,height:16,background:"rgba(239, 68, 68, 0.3)",borderRadius:2}}),e.jsx("span",{children:">1 year"})]})]})]})},Pe=Object.freeze(Object.defineProperty({__proto__:null,NiceGitBlame:ye},Symbol.toStringTag,{value:"Module"})),De=x=>{if(!x.resolved)return[];switch(x.resolution){case"ours":return x.oursContent;case"theirs":return x.theirsContent;case"both":return[...x.oursContent,...x.theirsContent];case"custom":return x.customContent||[];default:return[]}},ve=({file:x,context:v,viewMode:z="split",showLineNumbers:N=!0,showBase:A=!1,currentConflictIndex:q,syntaxTheme:G="dark",onResolve:M,onResolveAll:T,onNavigateConflict:L,onSave:U,onCancel:_,className:h,style:m,"data-testid":w="nice-git-conflict-resolver"})=>{const[B,C]=i.useState(x.conflicts),[j,y]=i.useState(q??0),[W,V]=i.useState(null),[P,D]=i.useState(""),b=i.useMemo(()=>B.filter(t=>!t.resolved).length,[B]),S=i.useMemo(()=>B.filter(t=>t.resolved).length,[B]),u=B[j],k=i.useCallback((t,p,c)=>{C(g=>g.map(R=>R.id===t?{...R,resolved:!0,resolution:p,customContent:c}:R)),V(null),M?.(t,p,c);const n=B.findIndex((g,R)=>R>j&&!g.resolved);n!==-1&&(y(n),L?.(n))},[B,j,M,L]),E=i.useCallback(t=>{C(p=>p.map(c=>c.resolved?c:{...c,resolved:!0,resolution:t})),T?.(t)},[T]),F=i.useCallback(t=>{const p=t==="prev"?Math.max(0,j-1):Math.min(B.length-1,j+1);y(p),L?.(p)},[j,B.length,L]),K=i.useCallback(()=>{u&&(V(u.id),D(u.oursContent.join(`
3
+ `)))},[u]),O=i.useCallback(()=>{W&&k(W,"custom",P.split(`
4
+ `))},[W,P,k]),Y=i.useCallback(()=>{const t=x.content.split(`
5
+ `);let p=[],c=0;B.forEach(n=>{p=[...p,...t.slice(c,n.startLine-1)],p=[...p,...De(n)],c=n.endLine}),p=[...p,...t.slice(c)],U?.(p.join(`
6
+ `))},[x.content,B,U]),X=(t,p,c,n)=>e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0,borderLeft:`3px solid ${c}`},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:`${c}20`,borderBottom:"1px solid #30363d"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:500,color:c},children:t}),n&&e.jsx("button",{onClick:n,style:{padding:"4px 10px",background:c,border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",fontSize:11,cursor:"pointer"},children:"Accept"})]}),e.jsx("div",{style:{flex:1,overflow:"auto",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,lineHeight:"20px"},children:p.map((g,R)=>e.jsxs("div",{style:{display:"flex",alignItems:"stretch",background:G==="dark"?"var(--bg-canvas, #0d1117)":"var(--bg-primary, #fff)"},children:[N&&e.jsx("span",{style:{padding:"0 12px",color:"#6e7681",textAlign:"right",minWidth:40,borderRight:"1px solid #30363d",userSelect:"none"},children:R+1}),e.jsx("span",{style:{padding:"0 12px",whiteSpace:"pre"},children:g||" "})]},R))})]}),d=()=>u?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[e.jsxs("div",{style:{background:"rgba(34, 197, 94, 0.1)",borderLeft:"3px solid #22c55e"},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("span",{style:{fontSize:12,color:"var(--color-success, #22c55e)",fontWeight:500},children:["← Ours (",v?.oursCommit.branch||"HEAD",")"]}),e.jsx("button",{onClick:()=>k(u.id,"ours"),style:{padding:"4px 10px",background:"var(--color-success, #22c55e)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",fontSize:11,cursor:"pointer"},children:"Accept Ours"})]}),e.jsx("pre",{style:{margin:0,padding:12,fontFamily:"monospace",fontSize:13},children:u.oursContent.join(`
7
+ `)})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"8px 12px",background:"var(--text-primary, #1f2937)"},children:[e.jsx("div",{style:{flex:1,height:1,background:"var(--text-secondary, #374151)"}}),e.jsx("span",{style:{color:"var(--text-muted, #9ca3af)",fontSize:11},children:"VS"}),e.jsx("div",{style:{flex:1,height:1,background:"var(--text-secondary, #374151)"}})]}),e.jsxs("div",{style:{background:"rgba(59, 130, 246, 0.1)",borderLeft:"3px solid #3b82f6"},children:[e.jsxs("div",{style:{padding:"8px 12px",borderBottom:"1px solid #30363d",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("span",{style:{fontSize:12,color:"var(--color-primary, #3b82f6)",fontWeight:500},children:["β†’ Theirs (",v?.theirsCommit.branch||"incoming",")"]}),e.jsx("button",{onClick:()=>k(u.id,"theirs"),style:{padding:"4px 10px",background:"var(--color-primary, #3b82f6)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",fontSize:11,cursor:"pointer"},children:"Accept Theirs"})]}),e.jsx("pre",{style:{margin:0,padding:12,fontFamily:"monospace",fontSize:13},children:u.theirsContent.join(`
8
+ `)})]})]}):null,r=()=>u?e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[X(`← Ours (${v?.oursCommit.branch||"HEAD"})`,u.oursContent,"var(--color-success, #22c55e)",()=>k(u.id,"ours")),A&&X("Base (ancestor)",u.baseContent,"var(--text-muted, #6b7280)"),X(`β†’ Theirs (${v?.theirsCommit.branch||"incoming"})`,u.theirsContent,"var(--color-primary, #3b82f6)",()=>k(u.id,"theirs"))]}):null,l=()=>u?e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[X(`← Ours (${v?.oursCommit.branch||"HEAD"})`,u.oursContent,"var(--color-success, #22c55e)",()=>k(u.id,"ours")),X("Base",u.baseContent,"var(--text-muted, #6b7280)"),X(`β†’ Theirs (${v?.theirsCommit.branch||"incoming"})`,u.theirsContent,"var(--color-primary, #3b82f6)",()=>k(u.id,"theirs"))]}):null,o=()=>W!==u?.id?null:e.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:e.jsxs("div",{style:{width:"80%",maxWidth:800,background:"var(--text-primary, #1f2937)",borderRadius:8,overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid #374151",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx("span",{style:{fontWeight:500},children:"✏️ Edit Resolution"}),e.jsx("button",{onClick:()=>V(null),style:{background:"transparent",border:"none",color:"var(--text-muted, #9ca3af)",cursor:"pointer",fontSize:18},children:"βœ•"})]}),e.jsx("textarea",{value:P,onChange:t=>D(t.target.value),style:{width:"100%",height:300,padding:16,fontFamily:"monospace",fontSize:13,background:"var(--bg-canvas, #0d1117)",color:"var(--text-primary, #e6edf3)",border:"none",resize:"none"}}),e.jsxs("div",{style:{padding:16,borderTop:"1px solid #374151",display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsx("button",{onClick:()=>V(null),style:{padding:"8px 16px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Cancel"}),e.jsx("button",{onClick:O,style:{padding:"8px 16px",background:"var(--color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Save Changes"})]})]})});return e.jsxs("div",{className:`nice-git-conflict-resolver ${h||""}`,style:{display:"flex",flexDirection:"column",height:"100%",background:G==="dark"?"var(--bg-canvas, #0d1117)":"var(--bg-primary, #ffffff)",color:G==="dark"?"var(--text-primary, #e6edf3)":"var(--text-primary, #1f2937)",fontFamily:"system-ui, sans-serif",position:"relative",...m},"data-testid":w,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid #30363d",background:G==="dark"?"var(--bg-elevated, #161b22)":"#f6f8fa"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontSize:18},children:"⚠️"}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500},children:x.path}),e.jsxs("div",{style:{fontSize:12,color:"var(--text-muted, #8b949e)"},children:[B.length," conflict(s) β€’ ",S," resolved β€’ ",b," ","remaining"]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("button",{onClick:_,style:{padding:"6px 12px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Cancel"}),e.jsx("button",{onClick:Y,disabled:b>0,style:{padding:"6px 12px",background:b>0?"var(--text-secondary, #374151)":"var(--color-success, #22c55e)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:b>0?"not-allowed":"pointer",opacity:b>0?.5:1},children:"βœ“ Save Resolved"})]})]}),v&&e.jsxs("div",{style:{display:"flex",gap:24,padding:"8px 16px",borderBottom:"1px solid #30363d",background:G==="dark"?"var(--bg-elevated, #161b22)":"#f6f8fa",fontSize:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{color:"var(--color-success, #22c55e)"},children:"← Ours:"}),e.jsx("span",{children:v.oursCommit.branch}),e.jsxs("span",{style:{color:"var(--text-muted, #8b949e)",fontFamily:"monospace"},children:["(",v.oursCommit.shortId,")"]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{color:"var(--color-primary, #3b82f6)"},children:"β†’ Theirs:"}),e.jsx("span",{children:v.theirsCommit.branch}),e.jsxs("span",{style:{color:"var(--text-muted, #8b949e)",fontFamily:"monospace"},children:["(",v.theirsCommit.shortId,")"]})]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:"1px solid #30363d",background:G==="dark"?"var(--text-primary, #1f2937)":"var(--bg-secondary, #f0f0f0)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("button",{onClick:()=>F("prev"),disabled:j===0,style:{padding:"4px 8px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:j===0?"not-allowed":"pointer",opacity:j===0?.5:1},children:"← Prev"}),e.jsxs("span",{style:{padding:"0 8px"},children:["Conflict ",j+1," of ",B.length,u?.resolved&&e.jsx("span",{style:{marginLeft:8,color:"var(--color-success, #22c55e)"},children:"βœ“ Resolved"})]}),e.jsx("button",{onClick:()=>F("next"),disabled:j===B.length-1,style:{padding:"4px 8px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:j===B.length-1?"not-allowed":"pointer",opacity:j===B.length-1?.5:1},children:"Next β†’"})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("button",{onClick:()=>E("ours"),disabled:b===0,style:{padding:"4px 10px",background:"var(--color-success, #22c55e)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",fontSize:11,cursor:b===0?"not-allowed":"pointer",opacity:b===0?.5:1},children:"Accept All Ours"}),e.jsx("button",{onClick:()=>E("theirs"),disabled:b===0,style:{padding:"4px 10px",background:"var(--color-primary, #3b82f6)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",fontSize:11,cursor:b===0?"not-allowed":"pointer",opacity:b===0?.5:1},children:"Accept All Theirs"})]})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[u&&!u.resolved&&e.jsxs(e.Fragment,{children:[z==="inline"&&d(),z==="split"&&r(),z==="three-way"&&l()]}),u?.resolved&&e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16,color:"var(--color-success, #22c55e)"},children:[e.jsx("span",{style:{fontSize:48},children:"βœ“"}),e.jsx("span",{style:{fontSize:18},children:"Conflict Resolved"}),e.jsxs("span",{style:{color:"var(--text-muted, #8b949e)",fontSize:13},children:["Resolution: ",u.resolution]}),e.jsx("button",{onClick:()=>C(t=>t.map(p=>p.id===u.id?{...p,resolved:!1,resolution:void 0}:p)),style:{padding:"8px 16px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"↩ Re-resolve"})]})]}),u&&!u.resolved&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:12,padding:"12px 16px",borderTop:"1px solid #30363d",background:G==="dark"?"var(--bg-elevated, #161b22)":"#f6f8fa"},children:[e.jsx("button",{onClick:()=>k(u.id,"ours"),style:{padding:"8px 20px",background:"var(--color-success, #22c55e)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer",fontWeight:500},children:"βœ“ Accept Ours"}),e.jsx("button",{onClick:()=>k(u.id,"theirs"),style:{padding:"8px 20px",background:"var(--color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer",fontWeight:500},children:"βœ“ Accept Theirs"}),e.jsx("button",{onClick:()=>k(u.id,"both"),style:{padding:"8px 20px",background:"var(--color-accent, #8b5cf6)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer",fontWeight:500},children:"↔ Accept Both"}),e.jsx("button",{onClick:K,style:{padding:"8px 20px",background:"var(--color-warning, #f59e0b)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer",fontWeight:500},children:"✏️ Edit Manually"})]}),o()]})},Le=Object.freeze(Object.defineProperty({__proto__:null,NiceGitConflictResolver:ve},Symbol.toStringTag,{value:"Module"})),ae={"pre-commit":{title:"Pre-commit",description:"Runs before commit is created. Good for linting and formatting.",icon:"βœ“"},"prepare-commit-msg":{title:"Prepare Commit Message",description:"Runs before commit message editor opens. Can modify default message.",icon:"πŸ“"},"commit-msg":{title:"Commit Message",description:"Validates commit message format (e.g., conventional commits).",icon:"πŸ’¬"},"post-commit":{title:"Post-commit",description:"Runs after commit is created. Good for notifications.",icon:"πŸ“€"},"pre-push":{title:"Pre-push",description:"Runs before push. Good for running tests.",icon:"πŸš€"},"pre-rebase":{title:"Pre-rebase",description:"Runs before rebase starts.",icon:"πŸ”€"},"post-merge":{title:"Post-merge",description:"Runs after merge completes. Good for dependency updates.",icon:"πŸ”—"},"post-checkout":{title:"Post-checkout",description:"Runs after checkout completes.",icon:"πŸ“₯"},"pre-auto-gc":{title:"Pre-auto GC",description:"Runs before automatic garbage collection.",icon:"πŸ—‘οΈ"}},Ee=[{id:"eslint-staged",name:"ESLint (staged files)",description:"Run ESLint on staged JavaScript/TypeScript files",icon:"πŸ”",category:"lint",hook:"pre-commit",actions:[{type:"lint",name:"ESLint",command:"npx eslint --fix",runOn:"staged",filePatterns:["*.js","*.jsx","*.ts","*.tsx"],enabled:!0,failOnError:!0}]},{id:"prettier-staged",name:"Prettier (staged files)",description:"Format staged files with Prettier",icon:"✨",category:"lint",hook:"pre-commit",actions:[{type:"format",name:"Prettier",command:"npx prettier --write",runOn:"staged",filePatterns:["*.js","*.jsx","*.ts","*.tsx","*.css","*.json","*.md"],enabled:!0,failOnError:!1}]},{id:"jest-tests",name:"Jest Tests",description:"Run Jest tests before push",icon:"πŸ§ͺ",category:"test",hook:"pre-push",actions:[{type:"test",name:"Jest",command:"npm test",runOn:"all",enabled:!0,failOnError:!0}]},{id:"typecheck",name:"TypeScript Check",description:"Run TypeScript compiler check",icon:"πŸ“˜",category:"quality",hook:"pre-commit",actions:[{type:"typecheck",name:"tsc",command:"npx tsc --noEmit",runOn:"all",enabled:!0,failOnError:!0}]},{id:"conventional-commits",name:"Conventional Commits",description:"Validate commit message format",icon:"πŸ“‹",category:"quality",hook:"commit-msg",actions:[{type:"custom",name:"Commitlint",command:"npx commitlint --edit $1",enabled:!0,failOnError:!0}]},{id:"secrets-scan",name:"Secret Detection",description:"Scan for accidentally committed secrets",icon:"πŸ”",category:"security",hook:"pre-commit",actions:[{type:"custom",name:"Detect Secrets",command:"npx secretlint",runOn:"staged",enabled:!0,failOnError:!0}]}],je=({hooks:x,templates:v=Ee,manager:z="husky",repoPath:N,selectedHook:A,onHookChange:q,onHookToggle:G,onActionAdd:M,onActionRemove:T,onActionUpdate:L,onInstall:U,onUninstall:_,onExport:h,className:m,style:w,"data-testid":B="nice-git-hooks"})=>{const[C,j]=i.useState(x),[y,W]=i.useState(A||null),[V,P]=i.useState(!1),[D,b]=i.useState(null),[S,u]=i.useState(!1),k=i.useMemo(()=>C.find(o=>o.type===y),[C,y]),E=i.useCallback((o,t)=>{j(p=>p.map(c=>c.type===o?{...c,enabled:t}:c)),G?.(o,t)},[G]),F=i.useCallback(o=>{if(!y)return;const t=o?o.actions.map((p,c)=>({...p,id:crypto.randomUUID(),order:(k?.actions.length||0)+c})):[{id:crypto.randomUUID(),type:"custom",name:"New Action",command:'echo "Hello"',order:k?.actions.length||0,enabled:!0,failOnError:!0}];j(p=>p.map(c=>c.type===y?{...c,actions:[...c.actions,...t]}:c)),t.forEach(p=>M?.(y,p)),P(!1)},[y,k,M]),K=i.useCallback(o=>{y&&(j(t=>t.map(p=>p.type===y?{...p,actions:p.actions.filter(c=>c.id!==o)}:p)),T?.(y,o))},[y,T]),O=i.useCallback(o=>{y&&(j(t=>t.map(p=>p.type===y?{...p,actions:p.actions.map(c=>c.id===o.id?o:c)}:p)),b(null),L?.(y,o))},[y,L]),Y=i.useCallback((o,t)=>{if(!k)return;const p=[...k.actions],c=p.findIndex(g=>g.id===o);if(c===-1)return;const n=t==="up"?c-1:c+1;n<0||n>=p.length||([p[c],p[n]]=[p[n],p[c]],p.forEach((g,R)=>g.order=R),j(g=>g.map(R=>R.type===y?{...R,actions:p}:R)))},[k,y]),X=i.useCallback(o=>{const t=["#!/bin/sh",""];return o.verbose&&t.push("set -x"),t.push("# Generated by NiceGitHooks",`# Hook: ${o.type}`,""),o.actions.forEach(p=>{if(!p.enabled){t.push(`# [DISABLED] ${p.name}`);return}if(t.push(`# ${p.name}`),p.condition){const{type:n,operator:g,value:R}=p.condition;n==="branch"?(t.push("BRANCH=$(git rev-parse --abbrev-ref HEAD)"),g==="equals"?t.push(`if [ "$BRANCH" != "${R}" ]; then exit 0; fi`):g==="matches"&&t.push(`if ! echo "$BRANCH" | grep -q "${R}"; then exit 0; fi`)):n==="env"&&t.push(`if [ -z "$${R}" ]; then exit 0; fi`)}let c=p.command;p.runOn==="staged"&&p.filePatterns?.length&&(p.filePatterns.map(n=>`'${n}'`).join(" "),c=`git diff --cached --name-only --diff-filter=ACM | grep -E "${p.filePatterns.join("|")}" | xargs ${c}`),t.push(c),p.failOnError&&(t.push("if [ $? -ne 0 ]; then"),t.push(` echo "❌ ${p.name} failed""`),t.push(" exit 1"),t.push("fi")),t.push("")}),t.push("exit 0"),t.join(`
9
+ `)},[]),d=o=>({lint:"πŸ”",test:"πŸ§ͺ",format:"✨",typecheck:"πŸ“˜",build:"πŸ”¨",custom:"βš™οΈ"})[o],r=()=>D?e.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:e.jsxs("div",{style:{width:"90%",maxWidth:600,background:"var(--text-primary, #1f2937)",borderRadius:12,overflow:"hidden"},children:[e.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid #374151",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx("span",{style:{fontWeight:500,fontSize:16},children:"✏️ Edit Action"}),e.jsx("button",{onClick:()=>b(null),style:{background:"none",border:"none",color:"var(--text-muted, #9ca3af)",cursor:"pointer",fontSize:20},children:"βœ•"})]}),e.jsxs("div",{style:{padding:20,display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #9ca3af)",marginBottom:4},children:"Name"}),e.jsx("input",{type:"text",value:D.name,onChange:o=>b({...D,name:o.target.value}),style:{width:"100%",padding:"8px 12px",background:"var(--text-secondary, #374151)",border:"1px solid #4b5563",borderRadius:6,color:"var(--bg-primary, #fff)"}})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #9ca3af)",marginBottom:4},children:"Type"}),e.jsxs("select",{value:D.type,onChange:o=>b({...D,type:o.target.value}),style:{width:"100%",padding:"8px 12px",background:"var(--text-secondary, #374151)",border:"1px solid #4b5563",borderRadius:6,color:"var(--bg-primary, #fff)"},children:[e.jsx("option",{value:"lint",children:"πŸ” Lint"}),e.jsx("option",{value:"test",children:"πŸ§ͺ Test"}),e.jsx("option",{value:"format",children:"✨ Format"}),e.jsx("option",{value:"typecheck",children:"πŸ“˜ Typecheck"}),e.jsx("option",{value:"build",children:"πŸ”¨ Build"}),e.jsx("option",{value:"custom",children:"βš™οΈ Custom"})]})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #9ca3af)",marginBottom:4},children:"Command"}),e.jsx("textarea",{value:D.command,onChange:o=>b({...D,command:o.target.value}),style:{width:"100%",padding:"8px 12px",background:"var(--text-secondary, #374151)",border:"1px solid #4b5563",borderRadius:6,color:"var(--bg-primary, #fff)",fontFamily:"monospace",minHeight:80,resize:"vertical"}})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #9ca3af)",marginBottom:4},children:"Run On"}),e.jsxs("select",{value:D.runOn||"all",onChange:o=>b({...D,runOn:o.target.value}),style:{width:"100%",padding:"8px 12px",background:"var(--text-secondary, #374151)",border:"1px solid #4b5563",borderRadius:6,color:"var(--bg-primary, #fff)"},children:[e.jsx("option",{value:"all",children:"All files"}),e.jsx("option",{value:"staged",children:"Staged files only"}),e.jsx("option",{value:"changed",children:"Changed files"})]})]}),e.jsxs("div",{children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"var(--text-muted, #9ca3af)",marginBottom:4},children:"File Patterns (comma-separated)"}),e.jsx("input",{type:"text",value:D.filePatterns?.join(", ")||"",onChange:o=>b({...D,filePatterns:o.target.value.split(",").map(t=>t.trim()).filter(Boolean)}),placeholder:"*.ts, *.tsx, *.js",style:{width:"100%",padding:"8px 12px",background:"var(--text-secondary, #374151)",border:"1px solid #4b5563",borderRadius:6,color:"var(--bg-primary, #fff)"}})]}),e.jsxs("div",{style:{display:"flex",gap:16},children:[e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:D.enabled,onChange:o=>b({...D,enabled:o.target.checked})}),e.jsx("span",{style:{fontSize:13},children:"Enabled"})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:D.failOnError,onChange:o=>b({...D,failOnError:o.target.checked})}),e.jsx("span",{style:{fontSize:13},children:"Fail on error"})]})]})]}),e.jsxs("div",{style:{padding:16,borderTop:"1px solid #374151",display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsx("button",{onClick:()=>b(null),style:{padding:"8px 16px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Cancel"}),e.jsx("button",{onClick:()=>O(D),style:{padding:"8px 16px",background:"var(--color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Save"})]})]})}):null,l=()=>{if(!S||!k)return null;const o=X(k);return e.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:e.jsxs("div",{style:{width:"90%",maxWidth:700,maxHeight:"80vh",background:"var(--text-primary, #1f2937)",borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid #374151",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs("span",{style:{fontWeight:500,fontSize:16},children:["πŸ“œ Script Preview: ",k.type]}),e.jsx("button",{onClick:()=>u(!1),style:{background:"none",border:"none",color:"var(--text-muted, #9ca3af)",cursor:"pointer",fontSize:20},children:"βœ•"})]}),e.jsx("pre",{style:{flex:1,margin:0,padding:20,background:"var(--bg-canvas, #0d1117)",color:"var(--text-primary, #e6edf3)",fontFamily:"monospace",fontSize:13,overflow:"auto"},children:o}),e.jsxs("div",{style:{padding:16,borderTop:"1px solid #374151",display:"flex",justifyContent:"flex-end",gap:8},children:[e.jsx("button",{onClick:()=>{navigator.clipboard.writeText(o)},style:{padding:"8px 16px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"πŸ“‹ Copy"}),e.jsx("button",{onClick:()=>u(!1),style:{padding:"8px 16px",background:"var(--color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"Close"})]})]})})};return e.jsxs("div",{className:`nice-git-hooks ${m||""}`,style:{display:"flex",height:"100%",background:"var(--bg-canvas, #0d1117)",color:"var(--text-primary, #e6edf3)",fontFamily:"system-ui, sans-serif",...w},"data-testid":B,children:[e.jsxs("div",{style:{width:280,borderRight:"1px solid #30363d",display:"flex",flexDirection:"column"},children:[e.jsx("div",{style:{padding:"12px 16px",borderBottom:"1px solid #30363d",fontWeight:500},children:"πŸͺ Git Hooks"}),e.jsx("div",{style:{flex:1,overflow:"auto"},children:Object.entries(ae).map(([o,t])=>{const p=C.find(g=>g.type===o),c=y===o,n=p?.actions.length||0;return e.jsxs("div",{onClick:()=>W(o),style:{padding:"12px 16px",cursor:"pointer",background:c?"rgba(59, 130, 246, 0.15)":"transparent",borderLeft:c?"2px solid #3b82f6":"2px solid transparent",display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontSize:18},children:t.icon}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:13,fontWeight:500},children:t.title}),e.jsxs("div",{style:{fontSize:11,color:"var(--text-muted, #8b949e)"},children:[n," action",n!==1?"s":""]})]}),e.jsx("button",{onClick:g=>{g.stopPropagation(),E(o,!p?.enabled)},style:{width:36,height:20,borderRadius:10,background:p?.enabled?"var(--color-success, #22c55e)":"var(--text-secondary, #374151)",border:"none",cursor:"pointer",position:"relative",transition:"background 0.2s"},children:e.jsx("div",{style:{position:"absolute",top:2,left:p?.enabled?18:2,width:16,height:16,borderRadius:"50%",background:"var(--bg-primary, #fff)",transition:"left 0.2s"}})})]},o)})}),e.jsx("div",{style:{padding:12,borderTop:"1px solid #30363d",display:"flex",gap:8},children:e.jsx("button",{onClick:()=>h?.(C,"husky"),style:{flex:1,padding:"8px 12px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",fontSize:12,cursor:"pointer"},children:"Export"})})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:k?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid #30363d",background:"var(--bg-elevated, #161b22)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[e.jsx("span",{style:{fontSize:24},children:ae[k.type].icon}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:18,fontWeight:500},children:ae[k.type].title}),e.jsx("div",{style:{fontSize:12,color:"var(--text-muted, #8b949e)"},children:ae[k.type].description})]})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:12},children:[e.jsx("button",{onClick:()=>u(!0),style:{padding:"6px 12px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",fontSize:12,cursor:"pointer"},children:"πŸ“œ Preview Script"}),e.jsx("button",{onClick:()=>U?.(k.type),style:{padding:"6px 12px",background:"var(--color-success, #22c55e)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",fontSize:12,cursor:"pointer"},children:"⬇️ Install"}),e.jsx("button",{onClick:()=>_?.(k.type),style:{padding:"6px 12px",background:"var(--color-error, #ef4444)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",fontSize:12,cursor:"pointer"},children:"❌ Uninstall"})]})]}),e.jsx("div",{style:{flex:1,overflow:"auto",padding:16},children:k.actions.length===0?e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:40,color:"var(--text-muted, #8b949e)"},children:[e.jsx("span",{style:{fontSize:48,marginBottom:16},children:"πŸ“­"}),e.jsx("span",{children:"No actions configured"}),e.jsx("span",{style:{fontSize:12,marginTop:4},children:"Add an action from templates or create a custom one"})]}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:k.actions.sort((o,t)=>o.order-t.order).map((o,t)=>e.jsxs("div",{style:{padding:16,background:"var(--bg-elevated, #161b22)",borderRadius:8,border:"1px solid #30363d",opacity:o.enabled?1:.5},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontSize:20},children:d(o.type)}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{style:{fontWeight:500},children:o.name}),e.jsx("code",{style:{fontSize:11,color:"var(--text-muted, #8b949e)",background:"var(--bg-canvas, #0d1117)",padding:"2px 6px",borderRadius:4},children:o.command})]}),e.jsxs("div",{style:{display:"flex",gap:4},children:[e.jsx("button",{onClick:()=>Y(o.id,"up"),disabled:t===0,style:{padding:"4px 8px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:t===0?"not-allowed":"pointer",opacity:t===0?.5:1},children:"↑"}),e.jsx("button",{onClick:()=>Y(o.id,"down"),disabled:t===k.actions.length-1,style:{padding:"4px 8px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:t===k.actions.length-1?"not-allowed":"pointer",opacity:t===k.actions.length-1?.5:1},children:"↓"}),e.jsx("button",{onClick:()=>b(o),style:{padding:"4px 8px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"✏️"}),e.jsx("button",{onClick:()=>K(o.id),style:{padding:"4px 8px",background:"var(--color-error, #ef4444)",border:"none",borderRadius:4,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"πŸ—‘οΈ"})]})]}),o.filePatterns&&o.filePatterns.length>0&&e.jsxs("div",{style:{marginTop:8,fontSize:11,color:"var(--text-muted, #8b949e)"},children:["Files: ",o.filePatterns.join(", ")]}),e.jsxs("div",{style:{marginTop:8,display:"flex",gap:8},children:[o.runOn&&e.jsx("span",{style:{fontSize:10,padding:"2px 6px",background:"var(--color-primary-active, #1d4ed8)",borderRadius:4},children:o.runOn}),o.failOnError&&e.jsx("span",{style:{fontSize:10,padding:"2px 6px",background:"var(--color-error, #b91c1c)",borderRadius:4},children:"fail on error"})]})]},o.id))})}),e.jsxs("div",{style:{padding:16,borderTop:"1px solid #30363d",display:"flex",gap:8},children:[e.jsx("button",{onClick:()=>P(!V),style:{padding:"10px 16px",background:"var(--color-primary, #3b82f6)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer",fontWeight:500},children:"βž• Add from Template"}),e.jsx("button",{onClick:()=>F(),style:{padding:"10px 16px",background:"var(--text-secondary, #374151)",border:"none",borderRadius:6,color:"var(--bg-primary, #fff)",cursor:"pointer"},children:"βš™οΈ Custom Action"})]}),V&&e.jsxs("div",{style:{position:"absolute",bottom:70,left:300,width:400,maxHeight:300,overflow:"auto",background:"var(--text-primary, #1f2937)",border:"1px solid #374151",borderRadius:8,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.3)",zIndex:50},children:[v.filter(o=>o.hook===y).map(o=>e.jsxs("div",{onClick:()=>F(o),style:{padding:12,cursor:"pointer",borderBottom:"1px solid #374151",display:"flex",alignItems:"center",gap:12},children:[e.jsx("span",{style:{fontSize:24},children:o.icon}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500},children:o.name}),e.jsx("div",{style:{fontSize:11,color:"var(--text-muted, #8b949e)"},children:o.description})]})]},o.id)),v.filter(o=>o.hook===y).length===0&&e.jsx("div",{style:{padding:20,textAlign:"center",color:"var(--text-muted, #8b949e)"},children:"No templates for this hook type"})]})]}):e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"var(--text-muted, #8b949e)"},children:[e.jsx("span",{style:{fontSize:64,marginBottom:16},children:"πŸͺ"}),e.jsx("span",{style:{fontSize:18},children:"Select a hook to configure"}),e.jsx("span",{style:{fontSize:12,marginTop:4},children:"Click on a hook from the list to start editing"})]})}),r(),l()]})},Oe=Object.freeze(Object.defineProperty({__proto__:null,NiceGitHooks:je},Symbol.toStringTag,{value:"Module"})),Fe={push:"πŸ“€",pull_request:"πŸ”€",schedule:"⏰",manual:"πŸ‘†",tag:"🏷️",workflow_dispatch:"⚑"},_e={script:"πŸ“œ",action:"βš™οΈ",checkout:"πŸ“₯",upload_artifact:"πŸ“€",download_artifact:"πŸ“₯",docker:"🐳",deploy:"πŸš€"},ke=({pipeline:x,templates:v,runners:z,environments:N,onPipelineChange:A,onStageAdd:q,onStageRemove:G,onStageMove:M,onJobAdd:T,onJobRemove:L,onStepAdd:U,onStepRemove:_,onVariableAdd:h,onVariableRemove:m,onSecretAdd:w,onSecretRemove:B,onTemplateApply:C,onSave:j,onRun:y,onValidate:W,className:V,style:P,"data-testid":D})=>{const[b,S]=i.useState("visual"),[u,k]=i.useState(null),[E,F]=i.useState(null),[K,O]=i.useState(!1),Y=x.stages.find(r=>r.id===u),X=Y?.jobs.find(r=>r.id===E),d=i.useMemo(()=>{const r=[];return r.push(`name: ${x.name}`),r.push(""),r.push("on:"),x.triggers.forEach(l=>{r.push(` ${l}:`),(l==="push"||l==="pull_request")&&(r.push(" branches:"),r.push(` - ${x.branch||"main"}`))}),r.push(""),x.variables.length>0&&(r.push("env:"),x.variables.filter(l=>!l.isSecret).forEach(l=>{r.push(` ${l.name}: ${l.value}`)}),r.push("")),r.push("jobs:"),x.stages.forEach(l=>{l.jobs.forEach(o=>{r.push(` ${l.name.toLowerCase().replace(/\s+/g,"-")}-${o.name.toLowerCase().replace(/\s+/g,"-")}:`),r.push(` name: ${o.name}`),o.runner&&r.push(` runs-on: ${o.runner}`),l.dependsOn?.length&&r.push(` needs: [${l.dependsOn.join(", ")}]`),r.push(" steps:"),o.steps.forEach(t=>{t.type==="checkout"?r.push(" - uses: actions/checkout@v4"):t.type==="action"&&t.action?(r.push(` - uses: ${t.action}${t.actionVersion?`@${t.actionVersion}`:""}`),t.with&&Object.keys(t.with).length>0&&(r.push(" with:"),Object.entries(t.with).forEach(([p,c])=>{r.push(` ${p}: ${c}`)}))):t.type==="script"&&t.script&&(r.push(` - name: ${t.name}`),r.push(" run: |"),t.script.split(`
10
+ `).forEach(p=>{r.push(` ${p}`)}))})})}),r.join(`
11
+ `)},[x]);return e.jsxs("div",{className:`nice-pipeline-editor ${V||""}`,style:{display:"flex",flexDirection:"column",height:"100%",background:"var(--bg-elevated, #1e1e1e)",color:"var(--text-primary, #e0e0e0)",...P},"data-testid":D,children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"12px 16px",borderBottom:"1px solid var(--border-color, #333)",background:"var(--bg-elevated, #252525)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.jsx("span",{style:{fontSize:"20px"},children:"βš™οΈ"}),e.jsx("input",{type:"text",value:x.name,onChange:r=>A({...x,name:r.target.value}),style:{padding:"6px 12px",borderRadius:"4px",border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:"14px",fontWeight:500,width:"250px"}})]}),e.jsx("div",{style:{flex:1}}),e.jsx("button",{onClick:()=>O(!0),style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"12px"},children:"πŸ“‹ Templates"}),e.jsx("button",{onClick:W,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"12px"},children:"βœ“ Validate"}),e.jsx("button",{onClick:j,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--color-primary, #3b82f6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"12px",fontWeight:500},children:"πŸ’Ύ Save"}),e.jsx("button",{onClick:y,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--color-success, #22c55e)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"12px",fontWeight:500},children:"β–Ά Run Pipeline"})]}),e.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border-color, #333)"},children:[{id:"visual",label:"🎨 Visual Editor"},{id:"yaml",label:"πŸ“ YAML"},{id:"triggers",label:"⚑ Triggers"},{id:"variables",label:"πŸ”§ Variables"}].map(r=>e.jsx("button",{onClick:()=>S(r.id),style:{padding:"10px 20px",border:"none",background:b===r.id?"var(--bg-elevated, #1e1e1e)":"transparent",color:b===r.id?"var(--bg-primary, #fff)":"var(--text-muted, #888)",cursor:"pointer",fontSize:"12px",borderBottom:b===r.id?"2px solid #3b82f6":"2px solid transparent"},children:r.label},r.id))}),e.jsxs("div",{style:{flex:1,display:"flex",overflow:"hidden"},children:[b==="visual"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{width:"300px",borderRight:"1px solid var(--border-color, #333)",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"12px",borderBottom:"1px solid var(--border-color, #333)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontWeight:500,fontSize:"13px"},children:"Stages"}),e.jsx("button",{onClick:q,style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--color-primary, #3b82f6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"+ Add Stage"})]}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"8px"},children:[x.stages.map((r,l)=>e.jsxs("div",{children:[l>0&&e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"4px"},children:e.jsx("span",{style:{color:"var(--bg-tertiary, #444)"},children:"↓"})}),e.jsxs("div",{onClick:()=>{k(r.id),F(null)},style:{padding:"12px",background:u===r.id?"rgba(59, 130, 246, 0.2)":"var(--bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer",border:u===r.id?"1px solid #3b82f6":"1px solid var(--border-color, #333)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[e.jsx("span",{style:{fontWeight:500,fontSize:"13px"},children:r.name}),e.jsxs("div",{style:{display:"flex",gap:"4px"},children:[l>0&&e.jsx("button",{onClick:o=>{o.stopPropagation(),M(r.id,"up")},style:{padding:"2px 4px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:"2px",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"↑"}),l<x.stages.length-1&&e.jsx("button",{onClick:o=>{o.stopPropagation(),M(r.id,"down")},style:{padding:"2px 4px",background:"var(--bg-tertiary, #333)",border:"none",borderRadius:"2px",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"↓"}),e.jsx("button",{onClick:o=>{o.stopPropagation(),G(r.id)},style:{padding:"2px 4px",background:"var(--color-error, #ef4444)",border:"none",borderRadius:"2px",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"βœ•"})]})]}),e.jsxs("div",{style:{fontSize:"11px",color:"var(--text-muted, #888)"},children:[r.jobs.length," job",r.jobs.length!==1?"s":""," β€’"," ",r.parallel?"Parallel":"Sequential"]})]})]},r.id)),x.stages.length===0&&e.jsx("div",{style:{textAlign:"center",color:"var(--text-muted, #666)",padding:"24px",fontSize:"12px"},children:"No stages yet. Add a stage to get started."})]})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:Y?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-color, #333)",display:"flex",justifyContent:"space-between",alignItems:"center",background:"var(--bg-elevated, #252525)"},children:[e.jsxs("span",{style:{fontWeight:500},children:["Stage: ",Y.name]}),e.jsx("button",{onClick:()=>T(Y.id),style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--color-success, #22c55e)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"+ Add Job"})]}),e.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[e.jsx("div",{style:{width:"200px",borderRight:"1px solid var(--border-color, #333)",overflow:"auto",padding:"8px"},children:Y.jobs.map(r=>e.jsxs("div",{onClick:()=>F(r.id),style:{padding:"10px",marginBottom:"4px",background:E===r.id?"rgba(59, 130, 246, 0.2)":"var(--bg-elevated, #252525)",borderRadius:"6px",cursor:"pointer",border:E===r.id?"1px solid #3b82f6":"1px solid transparent"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontSize:"12px",fontWeight:500},children:r.name}),e.jsx("button",{onClick:l=>{l.stopPropagation(),L(Y.id,r.id)},style:{padding:"2px 4px",background:"var(--color-error, #ef4444)",border:"none",borderRadius:"2px",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"9px"},children:"βœ•"})]}),e.jsxs("div",{style:{fontSize:"10px",color:"var(--text-muted, #888)",marginTop:"4px"},children:[r.steps.length," steps"]})]},r.id))}),X?e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[e.jsxs("h3",{style:{margin:0,fontSize:"14px"},children:["Job: ",X.name]}),e.jsx("button",{onClick:()=>U(Y.id,X.id),style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--color-accent, #8b5cf6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"+ Add Step"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"12px",marginBottom:"16px",padding:"12px",background:"var(--bg-elevated, #252525)",borderRadius:"8px"},children:[e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:"11px",color:"var(--text-muted, #888)",display:"block",marginBottom:"4px"},children:"Runner"}),e.jsxs("select",{style:{width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:"11px"},children:[e.jsx("option",{value:"",children:"Select runner..."}),z.map(r=>e.jsxs("option",{value:r.id,children:[r.name," (",r.os,")"]},r.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{style:{fontSize:"11px",color:"var(--text-muted, #888)",display:"block",marginBottom:"4px"},children:"Environment"}),e.jsxs("select",{style:{width:"100%",padding:"6px",borderRadius:"4px",border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:"11px"},children:[e.jsx("option",{value:"",children:"No environment"}),N.map(r=>e.jsxs("option",{value:r.id,children:[r.name," ",r.protection&&"πŸ”’"]},r.id))]})]})]}),X.steps.map((r,l)=>e.jsxs("div",{style:{marginBottom:"8px",padding:"12px",background:"var(--bg-elevated, #252525)",borderRadius:"8px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[e.jsx("span",{style:{fontSize:"16px"},children:_e[r.type]}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,flex:1},children:r.name}),e.jsx("span",{style:{fontSize:"10px",color:"var(--text-muted, #888)",padding:"2px 6px",background:"var(--bg-tertiary, #333)",borderRadius:"4px"},children:r.type}),e.jsx("button",{onClick:()=>_(Y.id,X.id,r.id),style:{padding:"2px 6px",background:"var(--color-error, #ef4444)",border:"none",borderRadius:"4px",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"βœ•"})]}),r.type==="script"&&r.script&&e.jsx("pre",{style:{margin:0,padding:"8px",background:"var(--bg-elevated, #1e1e1e)",borderRadius:"4px",fontSize:"10px",fontFamily:"monospace",overflow:"auto"},children:r.script}),r.type==="action"&&e.jsxs("div",{style:{fontSize:"11px",color:"var(--text-muted, #888)"},children:["uses: ",r.action,r.actionVersion&&`@${r.actionVersion}`]})]},r.id)),X.steps.length===0&&e.jsx("div",{style:{textAlign:"center",color:"var(--text-muted, #666)",padding:"24px",fontSize:"12px"},children:"No steps yet. Add a step to define what this job does."})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted, #666)"},children:"Select a job to edit its steps"})]})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted, #666)"},children:"Select a stage to view its jobs"})})]}),b==="yaml"&&e.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:e.jsx("pre",{style:{margin:0,padding:"16px",background:"var(--bg-elevated, #252525)",borderRadius:"8px",fontFamily:"monospace",fontSize:"12px",lineHeight:"1.6",whiteSpace:"pre-wrap"},children:d})}),b==="triggers"&&e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"24px"},children:[e.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"14px"},children:"Pipeline Triggers"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"16px"},children:["push","pull_request","schedule","manual","tag","workflow_dispatch"].map(r=>e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"16px",background:"var(--bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer",border:x.triggers.includes(r)?"2px solid #3b82f6":"2px solid transparent"},children:[e.jsx("input",{type:"checkbox",checked:x.triggers.includes(r),onChange:l=>{const o=l.target.checked?[...x.triggers,r]:x.triggers.filter(t=>t!==r);A({...x,triggers:o})}}),e.jsx("span",{style:{fontSize:"24px"},children:Fe[r]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,fontSize:"13px"},children:r.replace("_"," ")}),e.jsxs("div",{style:{fontSize:"11px",color:"var(--text-muted, #888)"},children:[r==="push"&&"Run on push to branch",r==="pull_request"&&"Run on PR/MR",r==="schedule"&&"Run on schedule (cron)",r==="manual"&&"Manual trigger only",r==="tag"&&"Run on tag push",r==="workflow_dispatch"&&"API/UI trigger"]})]})]},r))})]}),b==="variables"&&e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"24px"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[e.jsx("h3",{style:{margin:0,fontSize:"14px"},children:"Variables & Secrets"}),e.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.jsx("button",{onClick:h,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--color-primary, #3b82f6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"+ Add Variable"}),e.jsx("button",{onClick:w,style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--color-warning, #f59e0b)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"πŸ”’ Add Secret"})]})]}),e.jsxs("div",{style:{background:"var(--bg-elevated, #252525)",borderRadius:"8px",overflow:"hidden"},children:[e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"12px"},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{background:"var(--bg-elevated, #1e1e1e)"},children:[e.jsx("th",{style:{padding:"10px 16px",textAlign:"left",fontWeight:500},children:"Name"}),e.jsx("th",{style:{padding:"10px 16px",textAlign:"left",fontWeight:500},children:"Value"}),e.jsx("th",{style:{padding:"10px 16px",textAlign:"center",fontWeight:500},children:"Type"}),e.jsx("th",{style:{padding:"10px 16px",textAlign:"right",fontWeight:500},children:"Actions"})]})}),e.jsx("tbody",{children:x.variables.map(r=>e.jsxs("tr",{children:[e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--border-color, #333)",fontFamily:"monospace"},children:r.name}),e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--border-color, #333)"},children:r.isSecret?"β€’β€’β€’β€’β€’β€’β€’β€’":r.value}),e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--border-color, #333)",textAlign:"center"},children:e.jsx("span",{style:{padding:"2px 8px",borderRadius:"4px",background:r.isSecret?"#f59e0b22":"#3b82f622",color:r.isSecret?"var(--color-warning, #f59e0b)":"var(--color-primary, #3b82f6)",fontSize:"10px"},children:r.isSecret?"πŸ”’ Secret":"Variable"})}),e.jsx("td",{style:{padding:"10px 16px",borderBottom:"1px solid var(--border-color, #333)",textAlign:"right"},children:e.jsx("button",{onClick:()=>m(r.name),style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--color-error, #ef4444)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"Remove"})})]},r.name))})]}),x.variables.length===0&&e.jsx("div",{style:{padding:"24px",textAlign:"center",color:"var(--text-muted, #666)",fontSize:"12px"},children:"No variables defined"})]})]})]}),K&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:e.jsxs("div",{style:{width:"600px",maxHeight:"80vh",background:"var(--bg-elevated, #252525)",borderRadius:"12px",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px",borderBottom:"1px solid var(--border-color, #333)"},children:[e.jsx("span",{style:{fontWeight:600},children:"Pipeline Templates"}),e.jsx("button",{onClick:()=>O(!1),style:{background:"none",border:"none",color:"var(--text-muted, #888)",cursor:"pointer",fontSize:"18px"},children:"βœ•"})]}),e.jsx("div",{style:{maxHeight:"60vh",overflow:"auto",padding:"16px"},children:v.map(r=>e.jsxs("div",{onClick:()=>{C(r),O(!1)},style:{display:"flex",alignItems:"center",gap:"16px",padding:"16px",marginBottom:"8px",background:"var(--bg-elevated, #1e1e1e)",borderRadius:"8px",cursor:"pointer"},children:[e.jsx("span",{style:{fontSize:"32px"},children:r.icon}),e.jsxs("div",{children:[e.jsx("div",{style:{fontWeight:500,fontSize:"14px",marginBottom:"4px"},children:r.name}),e.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted, #888)"},children:r.description}),e.jsx("div",{style:{fontSize:"10px",color:"var(--text-muted, #666)",marginTop:"4px"},children:r.category})]})]},r.id))})]})})]})},He=Object.freeze(Object.defineProperty({__proto__:null,NicePipelineEditor:ke},Symbol.toStringTag,{value:"Module"})),de={queued:{color:"var(--text-muted, #6b7280)",icon:"⏳",label:"Queued"},pending:{color:"var(--text-muted, #6b7280)",icon:"⏳",label:"Pending"},waiting:{color:"var(--color-warning, #f59e0b)",icon:"⏸️",label:"Waiting"},in_progress:{color:"var(--color-primary, #3b82f6)",icon:"πŸ”„",label:"In Progress"},running:{color:"var(--color-primary, #3b82f6)",icon:"πŸ”„",label:"Running"},completed:{color:"var(--color-success, #22c55e)",icon:"βœ“",label:"Completed"},success:{color:"var(--color-success, #22c55e)",icon:"βœ“",label:"Success"},failed:{color:"var(--color-error, #ef4444)",icon:"βœ•",label:"Failed"},failure:{color:"var(--color-error, #ef4444)",icon:"βœ•",label:"Failed"},cancelled:{color:"var(--text-muted, #6b7280)",icon:"⊘",label:"Cancelled"},skipped:{color:"var(--text-muted, #6b7280)",icon:"β†·",label:"Skipped"}},Se=({runs:x,stats:v,selectedRunId:z,onRunSelect:N,onCancel:A,onRerun:q,onRerunFromStage:G,onDownloadArtifact:M,onDownloadLogs:T,onApprove:L,onReject:U,className:_,style:h,"data-testid":m})=>{const[w,B]=i.useState("all"),[C,j]=i.useState("all"),[y,W]=i.useState(new Set),[V,P]=i.useState(new Set),[D,b]=i.useState(null),S=x.find(d=>d.id===z),u=i.useMemo(()=>x.filter(d=>!(w!=="all"&&d.status!==w||C!=="all"&&d.branch!==C)),[x,w,C]),k=i.useMemo(()=>[...new Set(x.map(d=>d.branch))],[x]),E=d=>{if(!d)return"-";const r=Math.floor(d/1e3);if(r<60)return`${r}s`;const l=Math.floor(r/60),o=r%60;if(l<60)return`${l}m ${o}s`;const t=Math.floor(l/60),p=l%60;return`${t}h ${p}m`},F=d=>d?new Date(d).toLocaleString():"-",K=d=>d<1024?`${d} B`:d<1024*1024?`${(d/1024).toFixed(1)} KB`:`${(d/(1024*1024)).toFixed(1)} MB`,O=d=>{W(r=>{const l=new Set(r);return l.has(d)?l.delete(d):l.add(d),l})},Y=d=>{P(r=>{const l=new Set(r);return l.has(d)?l.delete(d):l.add(d),l})},X=()=>{if(!D||!S)return[];for(const d of S.stages)for(const r of d.jobs)if(r.id===D.jobId)return r.steps.find(o=>o.id===D.stepId)?.logs||[];return[]};return e.jsxs("div",{className:`nice-pipeline-monitor ${_||""}`,style:{display:"flex",height:"100%",background:"var(--bg-elevated, #1e1e1e)",color:"var(--text-primary, #e0e0e0)",...h},"data-testid":m,children:[e.jsxs("div",{style:{width:"400px",borderRight:"1px solid var(--border-color, #333)",display:"flex",flexDirection:"column"},children:[v&&e.jsx("div",{style:{padding:"16px",borderBottom:"1px solid var(--border-color, #333)",background:"var(--bg-elevated, #252525)"},children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"12px",textAlign:"center"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--color-primary, #3b82f6)"},children:v.totalRuns}),e.jsx("div",{style:{fontSize:"10px",color:"var(--text-muted, #888)"},children:"Total Runs"})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--color-success, #22c55e)"},children:[v.successRate.toFixed(0),"%"]}),e.jsx("div",{style:{fontSize:"10px",color:"var(--text-muted, #888)"},children:"Success Rate"})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--color-warning, #f59e0b)"},children:E(v.avgDuration)}),e.jsx("div",{style:{fontSize:"10px",color:"var(--text-muted, #888)"},children:"Avg Duration"})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:"20px",fontWeight:600,color:"var(--color-error, #ef4444)"},children:v.failedRuns}),e.jsx("div",{style:{fontSize:"10px",color:"var(--text-muted, #888)"},children:"Failed"})]})]})}),e.jsxs("div",{style:{padding:"12px",borderBottom:"1px solid var(--border-color, #333)",display:"flex",gap:"8px"},children:[e.jsxs("select",{value:w,onChange:d=>B(d.target.value),style:{flex:1,padding:"6px",borderRadius:"4px",border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:"11px"},children:[e.jsx("option",{value:"all",children:"All Status"}),e.jsx("option",{value:"in_progress",children:"In Progress"}),e.jsx("option",{value:"completed",children:"Completed"}),e.jsx("option",{value:"failed",children:"Failed"}),e.jsx("option",{value:"cancelled",children:"Cancelled"})]}),e.jsxs("select",{value:C,onChange:d=>j(d.target.value),style:{flex:1,padding:"6px",borderRadius:"4px",border:"1px solid var(--border-color, #444)",background:"var(--bg-elevated, #1e1e1e)",color:"var(--bg-primary, #fff)",fontSize:"11px"},children:[e.jsx("option",{value:"all",children:"All Branches"}),k.map(d=>e.jsx("option",{value:d,children:d},d))]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto"},children:[u.map(d=>{const r=de[d.status];return e.jsxs("div",{onClick:()=>N(d.id),style:{padding:"12px 16px",borderBottom:"1px solid var(--border-color, #333)",cursor:"pointer",background:z===d.id?"rgba(59, 130, 246, 0.1)":"transparent"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"6px"},children:[e.jsx("span",{style:{fontSize:"16px",animation:d.status==="in_progress"?"spin 1s linear infinite":"none"},children:r.icon}),e.jsxs("span",{style:{flex:1,fontWeight:500,fontSize:"13px"},children:[d.pipelineName," #",d.runNumber]}),e.jsx("span",{style:{padding:"2px 8px",borderRadius:"4px",background:`${r.color}22`,color:r.color,fontSize:"10px"},children:r.label})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"11px",color:"var(--text-muted, #888)"},children:[e.jsxs("span",{children:["πŸ”€ ",d.branch]}),e.jsx("span",{children:"β€’"}),e.jsx("span",{children:d.commit.sha.slice(0,7)}),e.jsx("span",{children:"β€’"}),e.jsx("span",{children:E(d.duration)})]}),e.jsx("div",{style:{marginTop:"6px",fontSize:"11px",color:"var(--text-muted, #666)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d.commit.message})]},d.id)}),u.length===0&&e.jsx("div",{style:{padding:"24px",textAlign:"center",color:"var(--text-muted, #666)",fontSize:"12px"},children:"No pipeline runs match the filters"})]})]}),e.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:S?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{padding:"16px",borderBottom:"1px solid var(--border-color, #333)",background:"var(--bg-elevated, #252525)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"12px"},children:[e.jsxs("div",{children:[e.jsxs("h2",{style:{margin:"0 0 4px 0",fontSize:"16px",fontWeight:500},children:[S.pipelineName," #",S.runNumber]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",fontSize:"12px",color:"var(--text-muted, #888)"},children:[e.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[S.commit.authorAvatar&&e.jsx("img",{src:S.commit.authorAvatar,alt:"",style:{width:"16px",height:"16px",borderRadius:"50%"}}),S.commit.author]}),e.jsxs("span",{children:["πŸ”€ ",S.branch]}),e.jsxs("span",{children:["πŸ“ ",S.commit.sha.slice(0,7)]})]})]}),e.jsxs("div",{style:{display:"flex",gap:"8px"},children:[(S.status==="in_progress"||S.status==="queued"||S.status==="waiting")&&e.jsx("button",{onClick:()=>A(S.id),style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--color-error, #ef4444)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"Cancel"}),e.jsx("button",{onClick:()=>q(S.id),style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--color-primary, #3b82f6)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"Re-run"}),e.jsx("button",{onClick:()=>T(S.id),style:{padding:"6px 12px",borderRadius:"4px",border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"11px"},children:"πŸ“₯ Logs"})]})]}),e.jsxs("div",{style:{display:"flex",gap:"16px",fontSize:"12px"},children:[e.jsxs("span",{children:["Started: ",F(S.startedAt)]}),S.completedAt&&e.jsxs("span",{children:["Completed: ",F(S.completedAt)]}),e.jsxs("span",{children:["Duration: ",E(S.duration)]})]})]}),e.jsxs("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:[e.jsx("div",{style:{marginBottom:"24px"},children:S.stages.map((d,r)=>{const l=de[d.status],o=y.has(d.id);return e.jsxs("div",{style:{marginBottom:"8px"},children:[e.jsxs("div",{onClick:()=>O(d.id),style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",background:"var(--bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer",border:`2px solid ${l.color}44`},children:[e.jsx("span",{style:{color:"var(--text-muted, #666)"},children:o?"β–Ό":"β–Ά"}),e.jsx("span",{style:{fontSize:"16px"},children:l.icon}),e.jsx("span",{style:{flex:1,fontWeight:500},children:d.name}),e.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted, #888)"},children:E(d.duration)}),d.status==="waiting"&&L&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:t=>{t.stopPropagation(),L(S.id,d.id)},style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--color-success, #22c55e)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"Approve"}),e.jsx("button",{onClick:t=>{t.stopPropagation(),U?.(S.id,d.id)},style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--color-error, #ef4444)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"Reject"})]}),e.jsx("button",{onClick:t=>{t.stopPropagation(),G(S.id,d.id)},style:{padding:"4px 8px",borderRadius:"4px",border:"none",background:"var(--bg-tertiary, #333)",color:"var(--bg-primary, #fff)",cursor:"pointer",fontSize:"10px"},children:"Re-run from here"})]}),o&&e.jsx("div",{style:{marginLeft:"32px",marginTop:"8px"},children:d.jobs.map(t=>{const p=de[t.status],c=V.has(t.id);return e.jsxs("div",{style:{marginBottom:"8px"},children:[e.jsxs("div",{onClick:()=>Y(t.id),style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",background:"var(--bg-elevated, #1e1e1e)",borderRadius:"6px",cursor:"pointer",borderLeft:`3px solid ${p.color}`},children:[e.jsx("span",{style:{color:"var(--text-muted, #666)",fontSize:"10px"},children:c?"β–Ό":"β–Ά"}),e.jsx("span",{style:{fontSize:"14px"},children:p.icon}),e.jsx("span",{style:{flex:1,fontSize:"12px"},children:t.name}),t.runner&&e.jsxs("span",{style:{fontSize:"10px",color:"var(--text-muted, #666)"},children:["πŸ–₯️ ",t.runner]}),e.jsx("span",{style:{fontSize:"10px",color:"var(--text-muted, #888)"},children:E(t.duration)})]}),c&&e.jsx("div",{style:{marginLeft:"24px",marginTop:"4px"},children:t.steps.map(n=>{const g=de[n.status];return e.jsxs("div",{onClick:()=>b({jobId:t.id,stepId:n.id}),style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 10px",marginBottom:"2px",background:"transparent",borderRadius:"4px",cursor:n.logs?.length?"pointer":"default"},children:[e.jsx("span",{style:{fontSize:"12px"},children:g.icon}),e.jsx("span",{style:{flex:1,fontSize:"11px"},children:n.name}),e.jsx("span",{style:{fontSize:"10px",color:"var(--text-muted, #888)"},children:E(n.duration)}),n.logs?.length?e.jsx("span",{style:{fontSize:"10px",color:"var(--text-muted, #666)"},children:"πŸ“„"}):null]},n.id)})})]},t.id)})}),r<S.stages.length-1&&e.jsx("div",{style:{marginLeft:"24px",padding:"4px 0",color:"var(--bg-tertiary, #444)"},children:"↓"})]},d.id)})}),S.artifacts.length>0&&e.jsxs("div",{style:{marginTop:"24px"},children:[e.jsx("h3",{style:{margin:"0 0 12px 0",fontSize:"13px",color:"var(--text-muted, #888)"},children:"Artifacts"}),e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"8px"},children:S.artifacts.map(d=>e.jsxs("div",{onClick:()=>M(d),style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",background:"var(--bg-elevated, #252525)",borderRadius:"8px",cursor:"pointer"},children:[e.jsx("span",{style:{fontSize:"24px"},children:"πŸ“¦"}),e.jsxs("div",{style:{flex:1,overflow:"hidden"},children:[e.jsx("div",{style:{fontSize:"12px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d.name}),e.jsx("div",{style:{fontSize:"10px",color:"var(--text-muted, #888)"},children:K(d.size)})]}),e.jsx("span",{style:{fontSize:"16px"},children:"πŸ“₯"})]},d.id))})]})]})]}):e.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted, #666)"},children:"Select a pipeline run to view details"})}),D&&e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:e.jsxs("div",{style:{width:"80%",height:"80%",background:"var(--bg-elevated, #1e1e1e)",borderRadius:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border-color, #333)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontWeight:500},children:"Step Logs"}),e.jsx("button",{onClick:()=>b(null),style:{background:"none",border:"none",color:"var(--text-muted, #888)",cursor:"pointer",fontSize:"18px"},children:"βœ•"})]}),e.jsx("div",{style:{flex:1,overflow:"auto",padding:"12px"},children:e.jsx("pre",{style:{margin:0,fontFamily:"monospace",fontSize:"11px",lineHeight:"1.5",whiteSpace:"pre-wrap",color:"var(--text-secondary, #d4d4d4)"},children:X().join(`
12
+ `)||"No logs available"})})]})}),e.jsx("style",{children:`
13
+ @keyframes spin {
14
+ from { transform: rotate(0deg); }
15
+ to { transform: rotate(360deg); }
16
+ }
17
+ `})]})},Ge=Object.freeze(Object.defineProperty({__proto__:null,NicePipelineMonitor:Se},Symbol.toStringTag,{value:"Module"}));exports.NiceBranchManager=he;exports.NiceBranchManager$1=Te;exports.NiceGitBlame=ye;exports.NiceGitBlame$1=Pe;exports.NiceGitConflictResolver=ve;exports.NiceGitConflictResolver$1=Le;exports.NiceGitDiffViewer=be;exports.NiceGitDiffViewer$1=$e;exports.NiceGitGraph=ge;exports.NiceGitGraph$1=Me;exports.NiceGitHooks=je;exports.NiceGitHooks$1=Oe;exports.NiceMergeRequestBuilder=me;exports.NiceMergeRequestBuilder$1=We;exports.NicePipelineEditor=ke;exports.NicePipelineEditor$1=He;exports.NicePipelineMonitor=Se;exports.NicePipelineMonitor$1=Ge;