PageSourceSearch

https://contributor.info/js/contributions-BLaC9LGh.js

js contributor.info collected 2026-10-10 00:36:41 UTC 26,172 bytes, 1 lines download raw bytes

1var me=Object.defineProperty;var xe=(r,a,c)=>a in r?me(r,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):r[a]=c;var Z=(r,a,c)=>xe(r,typeof a!="symbol"?a+"":a,c);import{j as e,r as v,n as fe,L as pe}from"./vendor-react-core-Ba2gwJNM.js";import{S as se}from"./switch-DeplDPKd.js";import{L as oe}from"./label-C7mpxRQf.js";import{a1 as ae,c as ee,at as ge,J as be,bL as ye,b0 as ve,a6 as ne,b1 as we,ac as je,ad as _e,ae as V,aY as Ne,cu as Ce,bq as Me,br as ke,bs as $e}from"./index-D-XLV-_s.js";import{s as Ae,g as ie}from"./supabase-avatar-cache-CFk-35qs.js";import{P as Se}from"./ProgressiveChart-CDbLTClm.js";import{S as Te}from"./skeleton-chart-g0a1SNVV.js";import{Y as Le}from"./distribution-charts-lazy-DDgZlkdA.js";import{L as ze}from"./learn-more-link-BqXmoMmb.js";import{R as Ee}from"./repo-stats-context-IT0-ZfjC.js";import{B as De,D as Ie,H as Re,E as Pe}from"./vendor-ui-C6PEtgd7.js";import{O as Oe}from"./optimized-avatar-h4G6FDnr.js";import{S as Ue}from"./separator-Czgj9iqU.js";import"./vendor-utils-MSNXLbuZ.js";import"./vendor-supabase-De54M4W1.js";import"./avatar-cache-eWIsQoHb.js";import"./contributor-hover-card-C0HX-wbl.js";import"./contributor-utils-CYFJma5l.js";import"./WorkspaceCreateModal-CKYWBdxp.js";import"./dialog-DXz7xUgG.js";import"./WorkspaceCreateForm-ByHHkgXW.js";import"./textarea-BDmvTWAt.js";import"./alert-BRJJGBfn.js";import"./WorkspaceCreationDisabled-CffNXK0T.js";import"./workspace.service-dymkAwqF.js";import"./workspace-permissions.service-Ds-SiVVv.js";import"./index-B0Ir_8Hh.js";import"./auth-helpers-BgxV-mAQ.js";import"./workspace-onboarding-CmxLHnAg.js";import"./use-subscription-limits-B2jTL4ZS.js";import"./subscription.service-Dn0uOl1t.js";import"./shareable-card-C6xl7CxJ.js";import"./dub-Bh1lUtcN.js";import"./progress-Bjlj8gEp.js";import"./optimized-avatar-utils-DZFOtv7e.js";const Fe=(r,a)=>a?"bg-purple-100 text-purple-700 dark:bg-purple-900/20 dark:text-purple-400":r==="closed"?"bg-red-100 text-red-700 dark:bg-red-900/20 dark:text-red-400":"bg-green-100 text-green-700 dark:bg-green-900/20 dark:text-green-400",le=(r,a)=>a?"merged":r,I=r=>r.toLocaleString(),Be=r=>{const a=new Date(r),n=new Date().getTime()-a.getTime(),i=Math.floor(n/(1e3*60*60*24));return i===0?"today":i===1?"1 day ago":`${i} days ago`};function Ke({pullRequest:r,role:a,children:c}){const n=r.additions+r.deletions,i=r.html_url||`https://github.com/${r.repository_owner}/${r.repository_name}/pull/${r.number}`,l=le(r.state,r.merged_at);return e.jsxs(De,{openDelay:0,closeDelay:100,children:[e.jsx(Ie,{asChild:!0,children:e.jsx("div",{className:"inline-block",style:{pointerEvents:"auto"},children:c})}),e.jsx(Re,{children:e.jsxs(Pe,{className:ee("relative z-[100] w-80 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2"),side:"top",align:"center",alignOffset:0,sideOffset:5,collisionPadding:10,sticky:"always",avoidCollisions:!0,onPointerDownOutside:s=>s.preventDefault(),forceMount:!0,children:[a&&e.jsx(ae,{className:ee("absolute top-4 right-4 border-0",a.toLowerCase()==="contributor"?"bg-blue-500 text-white hover:bg-blue-600":a.toLowerCase()==="bot"?"bg-gray-500 text-white hover:bg-gray-600":"bg-green-500 text-white hover:bg-green-600"),variant:"default",children:a}),e.jsxs("div",{className:"flex gap-3 mb-4",children:[e.jsx("a",{href:`https://github.com/${r.user.login}`,target:"_blank",rel:"noopener noreferrer",children:e.jsx(Oe,{src:r.user.avatar_url,alt:r.user.login,size:48,priority:!0,fallback:r.user.login?r.user.login[0].toUpperCase():"?",className:"cursor-pointer hover:opacity-80 transition-opacity"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("a",{href:`https://github.com/${r.user.login}`,target:"_blank",rel:"noopener noreferrer",className:"inline-block hover:underline",children:e.jsx("h4",{className:"text-sm font-semibold",children:r.user.login})}),e.jsx("div",{className:"text-xs text-muted-foreground",children:Be(r.created_at)})]})]}),e.jsx(Ue,{className:"my-3"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[e.jsxs("div",{className:"flex items-center gap-1 mt-0.5 flex-shrink-0",children:[e.jsx(ae,{className:ee("text-xs border-0",Fe(r.state,r.merged_at)),variant:"secondary",children:le(r.state,r.merged_at)}),e.jsxs("span",{className:"text-xs text-muted-foreground font-medium",children:["#",r.number]})]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium hover:underline line-clamp-2",title:r.title,children:r.title})})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"Lines Touched"}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ge,{className:"h-3 w-3 text-green-600"}),e.jsxs("span",{className:"text-green-600 font-medium",children:["+",I(r.additions)]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(be,{className:"h-3 w-3 text-red-600"}),e.jsx("span",{className:"text-red-600 font-medium",children:I(r.deletions*-1)})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-muted-foreground",children:"Total:"}),e.jsx("span",{className:"font-medium",children:I(n)})]})]}),n>0&&e.jsxs("div",{className:"flex h-2 rounded-full overflow-hidden bg-muted",children:[e.jsx("div",{className:"bg-green-500",style:{width:`${r.additions/n*100}%`}}),e.jsx("div",{className:"bg-red-500",style:{width:`${r.deletions/n*100}%`}})]}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:["PR #",r.number," ",l,(r.merged_at,"")," with ",I(n)," total lines touched (+",I(r.additions),"/-",I(r.deletions),")."]})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:e.jsxs("a",{href:`https://github.com/${r.repository_owner}/${r.repository_name}`,target:"_blank",rel:"noopener noreferrer",className:"hover:underline",children:[r.repository_owner,"/",r.repository_name]})})]})]})})]})}
1const Ye=Math.sqrt(50),We=Math.sqrt(10),qe=Math.sqrt(2);function He(r,a,c){const n=(a-r)/Math.max(0,c),i=Math.floor(Math.log10(n)),l=n/10**i;let s=1;return l>=Ye?s=10:l>=We?s=5:l>=qe&&(s=2),i>=0?s*10**i:-(10**-i)/s}function ce(r,a,c){if(!Number.isFinite(r)||!Number.isFinite(a)||c<=0||r>=a)return[];const n=He(r,a,c),i=[];if(n>0){const l=Math.ceil(r/n),s=Math.floor(a/n);for(let p=l;p<=s;p++)i.push(p*n)}else{const l=-n,s=Math.ceil(r*l),p=Math.floor(a*l);for(let h=s;h<=p;h++)i.push(h/l)}return i}function Xe(r){return Math.sign(r)*Math.log1p(Math.abs(r))}function de(r,a,c,n,i=!1){const l=i?Xe:h=>h,s=l(a),p=l(c);return p===s?0:(l(r)-s)/(p-s)*n}const he=40;function Ve({points:r,pointKey:a,xMax:c,yMax:n,logScale:i,nodeSize:l,margin:s,showXAxis:p,showYAxis:h,xTickCount:g,yTickCount:E,xTickFormatter:R,yTickFormatter:B,xLabel:L,yLabel:G,xLabelOffset:C,yLabelOffset:x,renderNode:J,renderTooltip:z}){const P=v.useRef(null),[$,O]=v.useState(null),[j,U]=v.useState(null);v.useEffect(()=>{const o=P.current;if(!o)return;const y=()=>{const N=o.getBoundingClientRect();N.width>0&&N.height>0&&O({width:N.width,height:N.height})};y();const f=new ResizeObserver(y);return f.observe(o),()=>f.disconnect()},[]);const D=$?.width??0,K=$?.height??0,A=Math.max(0,D-s.left-s.right),_=Math.max(0,K-s.top-s.bottom),Y=A>0&&_>0,T=o=>s.left+A-de(o,0,c,A),M=o=>s.top+_-de(o,1,n,_,i),Q=o=>Math.min(Math.max(o,s.left+l/2),s.left+A-l/2),re=o=>Math.min(Math.max(o,s.top+l/2),s.top+_-l/2),W=o=>Q(T(o.x)),q=o=>re(M(o.y)),H=ce(0,c,g),u=ce(1,n,E),t=o=>{if(!z||!Y||r.length===0)return;const y=o.currentTarget.getBoundingClientRect(),f=o.clientX-y.left,N=o.clientY-y.top;let S=null,d=he*he;for(const m of r){const b=W(m)-f,w=q(m)-N,k=b*b+w*w;k<d&&(d=k,S=m)}U(S?{point:S,mouseX:f,mouseY:N}:null)};return e.jsxs("div",{ref:P,className:"relative h-full w-full",children:[Y&&e.jsxs("svg",{width:D,height:K,onMouseMove:z?t:void 0,onMouseLeave:z?()=>U(null):void 0,children:[e.jsxs("g",{"aria-hidden":"true",children:[H.map(o=>e.jsx("line",{x1:T(o),x2:T(o),y1:s.top,y2:s.top+_,stroke:"hsl(var(--border))",strokeWidth:.5,strokeOpacity:.3},`grid-x-${o}`)),u.map(o=>e.jsx("line",{x1:s.left,x2:s.left+A,y1:M(o),y2:M(o),stroke:"hsl(var(--border))",strokeWidth:.5,strokeOpacity:.3},`grid-y-${o}`))]}),p&&e.jsxs("g",{"aria-hidden":"true",children:[e.jsx("line",{x1:s.left,x2:s.left+A,y1:s.top+_,y2:s.top+_,stroke:"hsl(var(--border))",strokeWidth:1}),H.map(o=>e.jsxs("g",{children:[e.jsx("line",{x1:T(o),x2:T(o),y1:s.top+_,y2:s.top+_+6,stroke:"hsl(var(--border))",strokeWidth:1}),e.jsx("text",{x:T(o),y:s.top+_+10,textAnchor:"middle",dominantBaseline:"hanging",fill:"hsl(var(--foreground))",fontSize:11,children:R(o)})]},`tick-x-${o}`)),e.jsx("text",{x:s.left+A/2,y:s.top+_+C,textAnchor:"middle",fill:"hsl(var(--foreground))",fontSize:12,children:L})]}),h&&e.jsxs("g",{"aria-hidden":"true",children:[e.jsx("line",{x1:s.left,x2:s.left,y1:s.top,y2:s.top+_,stroke:"hsl(var(--border))",strokeWidth:1}),u.map(o=>e.jsxs("g",{children:[e.jsx("line",{x1:s.left-2,x2:s.left,y1:M(o),y2:M(o),stroke:"hsl(var(--border))",strokeWidth:1}),e.jsx("text",{x:s.left-5,y:M(o),textAnchor:"end",dominantBaseline:"middle",fill:"hsl(var(--foreground))",fontSize:11,children:B(o)})]},`tick-y-${o}`)),e.jsx("text",{x:s.left+x,y:s.top+_/2,textAnchor:"middle",fill:"hsl(var(--foreground))",fontSize:12,transform:`rotate(-90, ${s.left+x}, ${s.top+_/2})`,children:G})]}),e.jsx("g",{children:r.map((o,y)=>e.jsx("g",{children:J(o,W(o),q(o),y)},a(o)))})]}),j&&z&&e.jsx("div",{className:"pointer-events-none absolute z-10",style:{left:Math.min(j.mouseX+14,D-160),top:Math.max(j.mouseY-14,0),transform:"translateY(-100%)"},children:z(j.point)})]})}function Ge(r,a){const{maxUniqueAvatars:c}=a,n=new Map;for(const h of r){const g=n.get(h.author);(!g||h.y>g.y||h.y===g.y&&h.x<g.x)&&n.set(h.author,h)}const i=new Set([...n.values()].sort((h,g)=>g.y-h.y||h.x-g.x).slice(0,Math.max(0,c)).map(h=>h.id)),l=new Set;return{processedData:r.map(h=>{const g=!l.has(h.author);g&&l.add(h.author);const E=i.has(h.id);return{...h,showAsAvatar:E,isFirstOccurrence:g,zIndex:E?h.zIndex+1e3:h.zIndex}}).sort((h,g)=>h.showAsAvatar!==g.showAsAvatar?h.showAsAvatar?1:-1:h.zIndex-g.zIndex),uniqueContributorCount:l.size,totalContributions:r.length,uniqueContributors:Array.from(l)}}
1class Je{constructor(){Z(this,"cache",{});Z(this,"CACHE_DURATION",300*1e3)}getRepoKey(a,c){return`${a}/${c}`}isStale(a){return Date.now()-a>this.CACHE_DURATION}async getRoles(a,c){const n=this.getRepoKey(a,c),i=this.cache[n];return i&&!this.isStale(i.lastFetched)?i.roles:i?.loading?this.waitForLoad(n):this.fetchAndCache(a,c)}getContributorRole(a,c,n){const i=this.getRepoKey(a,c),l=this.cache[i];return!l||this.isStale(l.lastFetched)?null:l.roles.get(n)||null}isMaintainer(a,c,n){const i=this.getContributorRole(a,c,n);return i?.role==="maintainer"||i?.role==="owner"}preloadRoles(a,c){const n=this.getRepoKey(a,c),i=this.cache[n];(!i||this.isStale(i.lastFetched)&&!i.loading)&&this.fetchAndCache(a,c).catch(l=>{console.warn("Failed to preload maintainer roles:",l)})}clearCache(a,c){const n=this.getRepoKey(a,c);delete this.cache[n]}clearAllCache(){this.cache={}}async fetchAndCache(a,c){const n=this.getRepoKey(a,c);this.cache[n]={roles:new Map,lastFetched:0,loading:!0};try{const{data:i,error:l}=await ye.from("contributor_roles").select("*").eq("repository_owner",a).eq("repository_name",c).gte("confidence_score",.5).order("confidence_score",{ascending:!1});if(l)throw l;const s=new Map;return(i||[]).forEach(p=>{s.set(p.user_id,p)}),this.cache[n]={roles:s,lastFetched:Date.now(),loading:!1},s}catch(i){return delete this.cache[n],console.error("Failed to fetch maintainer roles:",i),new Map}}async waitForLoad(a){return new Promise(c=>{const n=()=>{const i=this.cache[a];i?.loading?setTimeout(n,100):c(i?.roles||new Map)};n()})}}const te=new Je;function Qe(r,a){if(!r[0]?.data?.length)return"No pull request data available.";const c=r[0].data,n=c.length,i=new Map;c.forEach(h=>{i.set(h.contributor,(i.get(h.contributor)||0)+1)});const l=[...i.entries()].sort((h,g)=>g[1]-h[1])[0],s=Math.max(...c.map(h=>h.y)),p=Math.round(c.reduce((h,g)=>h+g.y,0)/n);return`This scatter plot shows ${n} pull requests over the last ${a} days. Most active contributor: ${l?.[0]||"unknown"} with ${l?.[1]||0} pull requests. Largest pull request: ${s.toLocaleString()} lines changed. Average lines per pull request: ${p.toLocaleString()}.`}function It({isRepositoryTracked:r=!0}){const{stats:a,directCommitsData:c,includeBots:n}=v.useContext(Ee),{effectiveTimeRange:i}=ve(),{owner:l,repo:s}=fe(),[p,h]=v.useState(!0),[g,E]=v.useState(10),[R,B]=v.useState(n),[L,G]=v.useState("all"),C=a||{pullRequests:[],loading:!1,error:null},[x,J]=v.useState(typeof window<"u"&&window.innerWidth<768),[z,P]=v.useState(new Map),$=parseInt(i,10),O=14,j=v.useRef(null),U=v.useRef(!1),D=v.useRef(x);v.useEffect(()=>{const u=()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{const t=window.innerWidth<768,o=D.current;J(t),D.current=t,t&&!o&&!U.current&&h(!0)},250)};return window.addEventListener("resize",u,{passive:!0}),()=>{window.removeEventListener("resize",u),j.current&&clearTimeout(j.current)}},[]),v.useEffect(()=>{if(C.pullRequests&&C.pullRequests.length>0){const u=Math.max(...C.pullRequests.map(t=>t.additions+t.deletions));E(u)}},[C.pullRequests]),v.useEffect(()=>{B(n)},[n]),v.useEffect(()=>{l&&s&&te.getRoles(l,s).catch(u=>{console.warn("Failed to preload maintainer roles:",u)})},[l,s]),v.useEffect(()=>{(async()=>{if(!C.pullRequests?.length)return;const t=Array.from(new Map(C.pullRequests.map(o=>[o.user.id,{githubId:o.user.id,username:o.user.login,fallbackUrl:o.user.avatar_url}])).values());try{const o=await Ae.getAvatarUrls(t),y=new Map;o.forEach((f,N)=>{y.set(N,f.url)}),P(y)}catch{const o=new Map;t.forEach(y=>{y.fallbackUrl&&o.set(y.githubId,y.fallbackUrl)}),P(o)}})()},[C.pullRequests]);const K=()=>{if(!C?.pullRequests||!Array.isArray(C.pullRequests))return[];try{const u=[...C.pullRequests].filter(d=>R||!ne({githubUser:d.user}).isBot).filter(d=>L==="all"?d.state==="open"||d.merged_at!==null:L==="open"?d.state==="open":L==="closed"?d.state==="closed"&&!d.merged_at:L==="merged"?d.merged_at!==null:!0).sort((d,m)=>new Date(m.created_at).getTime()-new Date(d.created_at).getTime()),t=new Map,o=u.map(d=>{const m=Math.floor((new Date().getTime()-new Date(d.created_at).getTime())/864e5);if(x&&m>O||!x&&m>$)return null;
1const b=d.additions+d.deletions,w=z.get(d.user.id)||d.user.avatar_url,k=Ce(d.user.login,w);t.has(m)||t.set(m,[]);const F=t.get(m);return F&&F.push(d),{x:m,y:Math.max(b,1),id:`pr-${d.id}`,author:d.user.login,avatar:k,prNumber:d.number,prTitle:d.title,zIndex:0,_pr:d}}).filter(d=>d!==null),y=o.map(d=>{const m=t.get(Math.floor(d.x))||[],b=m.findIndex(X=>`pr-${X.id}`===d.id),w=m.length;let k=0,F=0;if(x){const X=Math.min(w,8);if(X>1&&(k=b/(X-1)*.8),w>4){const ue=Math.min(d.y*.03,2);F=(b%3-1)*ue}}return{...d,x:d.x+k,y:Math.max(1,d.y+F)}}),f={maxUniqueAvatars:x?25:50,avatarSize:x?28:35,graySquareSize:x?17:21,graySquareOpacity:.6},{processedData:N}=Ge(y,f);return[{id:"pull-requests",data:N.map(d=>({...d,contributor:d.author,image:d.avatar,showAvatar:d.showAsAvatar,_pr:o.find(m=>m.id===d.id)?._pr}))}]}catch(u){return console.error("Error generating scatter plot data:",u),[]}},A=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),_=u=>{if(typeof u.cx!="number"||typeof u.cy!="number"||!u.payload)return null;const t=u.payload,o=u.index??0,y=l&&s&&t.contributor?te.isMaintainer(l,s,t.contributor):!1,f=x?28:35,N=Math.max(f/2,u.cx-f/2),S=Math.max(0,u.cy-f/2),d=t.showAvatar!==!1;if(A){const m=f/2;if(!d){const b=f*.6;return e.jsxs("g",{transform:`translate(${N}, ${S})`,style:{isolation:"isolate"},children:[e.jsx("rect",{className:"contribution-square",x:(f-b)/2,y:(f-b)/2,width:b,height:b,fill:"hsl(var(--muted-foreground) / 0.2)",stroke:"hsl(var(--border) / 0.5)",strokeWidth:"1",rx:"2",role:"button",tabIndex:0,"aria-label":`Additional pull request #${t._pr.number} by ${t.contributor}`,style:{cursor:"pointer",opacity:.6},onClick:()=>{const w=t._pr.html_url||`https://github.com/${t._pr.repository_owner}/${t._pr.repository_name}/pull/${t._pr.number}`;window.open(w,"_blank","noopener,noreferrer")}}),e.jsxs("title",{children:[t.contributor," - PR #",t._pr.number]})]})}return e.jsxs("g",{transform:`translate(${N}, ${S})`,style:{isolation:"isolate"},children:[e.jsx("circle",{cx:m,cy:m,r:m-1,fill:"hsl(var(--muted))",stroke:"hsl(var(--foreground))",strokeWidth:"2",style:{cursor:"pointer"}}),e.jsx("defs",{children:e.jsx("clipPath",{id:`avatar-clip-${t.contributor}-${o}`,children:e.jsx("circle",{cx:m,cy:m,r:m-2})})}),e.jsx("image",{href:t.image,x:"2",y:"2",width:f-4,height:f-4,clipPath:`url(#avatar-clip-${t.contributor}-${o})`,preserveAspectRatio:"xMidYMid slice",style:{pointerEvents:"none"}}),e.jsx("text",{x:m,y:m,textAnchor:"middle",dominantBaseline:"middle",fill:"hsl(var(--foreground))",fontSize:x?10:12,style:{pointerEvents:"none",userSelect:"none"},children:t.contributor?t.contributor[0].toUpperCase():"?"}),e.jsx("circle",{cx:m,cy:m,r:m,fill:"transparent",style:{cursor:"pointer"},onClick:()=>{const b=t._pr.html_url||`https://github.com/${t._pr.repository_owner}/${t._pr.repository_name}/pull/${t._pr.number}`;window.open(b,"_blank","noopener,noreferrer")},children:e.jsxs("title",{children:[t.contributor," - PR #",t._pr.number]})})]})}if(!d){const m=f*.6;return e.jsx("foreignObject",{x:N,y:S,width:f,height:f,style:{overflow:"visible",pointerEvents:"auto"},children:e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx("div",{className:"contribution-square",role:"button",tabIndex:0,"aria-label":`Additional pull request #${t._pr.number} by ${t.contributor}`,style:{width:m,height:m,backgroundColor:"hsl(var(--muted-foreground) / 0.2)",border:"1px solid hsl(var(--border) / 0.5)",borderRadius:"2px",cursor:"pointer",opacity:.6},onClick:()=>{const b=t._pr.html_url||`https://github.com/${t._pr.repository_owner}/${t._pr.repository_name}/pull/${t._pr.number}`;window.open(b,"_blank","noopener,noreferrer")},onKeyDown:b=>{if(b.key==="Enter"||b.key===" "){b.preventDefault();const w=t._pr.html_url||`https://github.com/${t._pr.repository_owner}/${t._pr.repository_name}/pull/${t._pr.number}`;window.open(w,"_blank","noopener,noreferrer")}},title:`${t.contributor} - PR #${t._pr.number}`})})})}return e.jsx("foreignObject",{x:N,y:S,width:f,height:f,style:{overflow:"visible",pointerEvents:"auto"},children:e.jsx("div",{style:{width:"100%",height:"100%",color:"hsl(var(--foreground))",borderColor:"hsl(var(--foreground))"},children:(()=>{const m=l&&s&&t.contributor?te.getContributorRole(l,s,t.contributor):null,b=m?ie({role:m.role},{type:t._pr.user.type}):ie(void 0,{type:t._pr.user.type});return e.jsx(Ke,{pullRequest:t._pr,role:b,children:e.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[e.jsxs(Me,{className:`${x?"w-6 h-6":"w-8 h-8"} border-2 cursor-pointer`,style:{backgroundColor:"var(--muted)",borderColor:"hsl(var(--foreground))"},role:"button",tabIndex:0,"aria-label":`Pull request #${t._pr.number} by ${t.contributor}`,"aria-describedby":y?`maintainer-badge-${t._pr.id}`:void 0,onClick:()=>{const w=t._pr.html_url||`https://github.com/${t._pr.repository_owner}/${t._pr.repository_name}/pull/${t._pr.number}`;window.open(w,"_blank","noopener,noreferrer")},onKeyDown:w=>{if(w.key==="Enter"||w.key===" "){w.preventDefault();const k=t._pr.html_url||`https://github.com/${t._pr.repository_owner}/${t._pr.repository_name}/pull/${t._pr.number}`;window.open(k,"_blank","noopener,noreferrer")}},children:[e.jsx(ke,{src:t.image,alt:`${t.contributor}'s avatar`,loading:"lazy",style:{objectFit:"cover",width:"100%",height:"100%"},crossOrigin:"anonymous",onError:w=>{const k=w.target;k.style.display="none"}}),e.jsx($e,{style:{backgroundColor:"var(--muted)",color:"var(--muted-foreground)",fontSize:x?"10px":"12px"},children:t.contributor?t.contributor[0].toUpperCase():"?"})]}),y&&e.jsx("span",{id:`maintainer-badge-${t._pr.id}`,title:"Maintainer","aria-label":`${t.contributor} is a maintainer`,role:"img",className:"bg-green-500",style:{position:"absolute",top:-2,right:-2,width:x?10:12,height:x?10:12,borderRadius:"9999px",border:"1px solid hsl(var(--background))",boxShadow:"0 0 0 1px hsl(var(--foreground) / 0.3)"}})]})})})()})})},Y=()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>
1{U.current=!0,h(!p)},50)},T=()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{B(!R)},50)},M=K(),Q=M[0]?.data??[],W=C.pullRequests.filter(u=>ne({githubUser:u.user}).isBot).length>0,q=v.useMemo(()=>Qe(M,x?O:$),[M,x,$]);if(!r)return e.jsx("div",{className:`${x?"h-[280px]":"h-[400px]"} w-full flex items-center justify-center bg-muted/10 rounded-lg border-2 border-dashed border-muted-foreground/20`,children:e.jsx("div",{className:"text-center",children:e.jsx("p",{className:"text-muted-foreground text-sm",children:"Track this repository to see contribution analytics"})})});const H=c?.hasYoloCoders===!0;return e.jsxs("div",{className:"space-y-4 w-full overflow-hidden","data-tour":"leaderboard",children:[e.jsxs("div",{className:`flex flex-col gap-4 pt-3 ${x?"px-2":"md:px-7"} shareable-desktop-only`,children:[H&&l&&s&&e.jsxs(pe,{to:`/repo/${l}/${s}/health`,className:"flex items-center justify-between text-slate-500 shadow-sm !border !border-slate-300 p-1 gap-2 text-sm rounded-full hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors w-fit",children:[e.jsxs("div",{className:"flex gap-2 items-center min-w-0",children:[e.jsxs("div",{className:"flex items-center font-medium gap-1 px-2 py-0.5 rounded-2xl bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-400 flex-shrink-0",children:[e.jsx(Le,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"YOLO Coders"}),e.jsx("span",{className:"sm:hidden",children:"YOLO"})]}),e.jsx("p",{className:"text-sm hidden sm:inline text-muted-foreground",style:{overflow:"hidden",textOverflow:"ellipsis"},children:"Pushing commits directly to main"})]}),e.jsxs("div",{className:"flex gap-1 items-center mr-1 sm:mr-2 flex-shrink-0",children:[e.jsx("span",{className:"text-sm hidden sm:inline",children:"See more"}),e.jsx(we,{className:"h-4 w-4"})]})]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[e.jsxs("span",{children:[M[0]?.data?.length??0," pull requests shown"]}),e.jsx(ze,{href:"https://docs.contributor.info/features/contribution-analytics",feature:"contribution_analytics",source:"contributions_chart"})]}),e.jsx("div",{className:"flex-shrink-0",children:e.jsx(je,{value:L,onValueChange:u=>G(u),children:e.jsxs(_e,{className:"grid w-full grid-cols-4",children:[e.jsx(V,{value:"all",className:"text-xs",children:"All"}),e.jsx(V,{value:"open",className:"text-xs",children:"Open"}),e.jsx(V,{value:"merged",className:"text-xs",children:"Merged"}),e.jsx(V,{value:"closed",className:"text-xs",children:"Closed"})]})})}),e.jsxs("div",{className:`flex flex-wrap gap-2 ${x?"w-full":""}`,children:[W&&e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(se,{id:"include-bots",checked:R,onCheckedChange:T}),e.jsx(oe,{htmlFor:"include-bots",className:"text-sm",children:"Show Bots"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(se,{id:"logarithmic-scale",checked:p,onCheckedChange:Y,"aria-describedby":"logarithmic-scale-description"}),e.jsx(oe,{htmlFor:"logarithmic-scale",className:"text-sm",children:p?"Enhanced":"Enhance"}),e.jsx("span",{id:"logarithmic-scale-description",className:"sr-only",children:p?"Enhanced view is enabled. Uses logarithmic scale for better visualization of data distribution.":"Enable enhanced view for logarithmic scale visualization."})]}),e.jsx("div",{className:"basis-full text-xs text-muted-foreground",children:"Enhanced mode uses a log scale for readability."})]})]})]}),e.jsxs("div",{className:`${x?"h-[280px]":"h-[400px]"} w-full overflow-hidden relative`,role:"figure","aria-labelledby":"scatter-chart-title","aria-describedby":"scatter-chart-desc",children:[e.jsx("h3",{id:"scatter-chart-title",className:"sr-only",children:"Pull Request Contributions Over Time"}),e.jsx("div",{id:"scatter-chart-desc",className:"sr-only",children:q}),e.jsx(Se,{skeleton:e.jsx(Te,{variant:"scatter",height:x?"sm":"lg",showAxes:!0}),highFidelity:M.length>0?e.jsx(Ve,{points:Q,pointKey:u=>u.id,xMax:Math.max(x?O:$,1),yMax:Math.max(Math.round(g*1.5),10),logScale:p,nodeSize:x?28:35,margin:{top:20,right:x?30:60,bottom:x?45:70,left:x?35:90},showXAxis:$>0,showYAxis:g>0,xTickCount:x?3:7,yTickCount:x?3:5,xTickFormatter:u=>u===0?"Today":u>$?`${$}+`:`${u}`,yTickFormatter:u=>u>=1e3?Ne(u):`${Math.round(u)}`,xLabel:"Days Ago",yLabel:"Lines Touched",xLabelOffset:x?35:50,yLabelOffset:x?-20:-60,renderNode:(u,t,o,y)=>e.jsx(_,{cx:t,cy:o,payload:u,index:y}),renderTooltip:x?void 0:u=>{const t=Math.floor(u.x);return e.jsxs("div",{className:"bg-background border rounded p-2 shadow-lg",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:"#1f77b4"}}),e.jsx("span",{className:"font-medium",children:u.contributor})]}),e.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:[t===0?"Today":`${t} days ago`," •"," ",Math.round(u.y)," lines touched"]})]})}}):e.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No data to display"}),priority:!1,highFiDelay:300,className:"h-full w-full"})]})]})}export{It as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.