PageSourceSearch

https://neuronsystems.org/assets/PlayerComparisonCard-B-S72OD3.js

js neuronsystems.org collected 2026-10-04 15:11:42 UTC 4,471 bytes, 1 lines download raw bytes

1import{j as s}from"./vendor-react-CsLxataF.js";import{C as h,b as g,c as f,a as j}from"./card-C6wCVWxq.js";import{B as m}from"./index-DWS0Q1HR.js";import{a8 as N,br as b,x as p,Z as v,bO as w,bN as C,K as P}from"./vendor-ui-icons-CESq4qwy.js";import"./vendor-ui-radix-DfFpnFnJ.js";import"./vendor-query-D5b9F9Hf.js";import"./vendor-firebase-core-BxCRMkaw.js";import"./vendor-firebase-firestore-e4-kmAWa.js";import"./vendor-router-B5sD648o.js";const O=({player1:t,player2:r,highlightWinner:o=!0,compact:n=!1})=>{const u=[{label:"PPG",icon:s.jsx(N,{className:"w-3 h-3"}),value1:t.ppg,value2:r.ppg,format:e=>e?.toFixed(1)||"-",higherBetter:!0},{label:"Salary",icon:s.jsx(b,{className:"w-3 h-3"}),value1:t.salary,value2:r.salary,format:e=>e?`$${(e/1e3).toFixed(1)}K`:"-",higherBetter:!1},{label:"Ownership",icon:s.jsx(p,{className:"w-3 h-3"}),value1:t.ownership,value2:r.ownership,format:e=>e?`${e.toFixed(1)}%`:"-",higherBetter:!1},{label:"Projected",icon:s.jsx(v,{className:"w-3 h-3"}),value1:t.projectedPoints,value2:r.projectedPoints,format:e=>e?.toFixed(1)||"-",higherBetter:!0}],d=(e,a,l)=>!e||!a||!o?"":l?e>a?"text-green-500 font-bold":e<a?"text-muted-foreground":"":e<a?"text-green-500 font-bold":e>a?"text-muted-foreground":"",c=(e,a)=>{if(!e||!a)return 50;const l=e+a;return e/l*100},x=e=>{switch(e){case"up":return s.jsx(P,{className:"w-3 h-3 text-green-500"});case"down":return s.jsx(C,{className:"w-3 h-3 text-red-500"});default:return s.jsx(w,{className:"w-3 h-3 text-muted-foreground"})}},i=(()=>{const e=(t.ppg||0)/(t.salary||1)*1e3,a=(r.ppg||0)/(r.salary||1)*1e3;return Math.abs(e-a)<.5?{text:"Toss-up",color:"bg-yellow-500/20 text-yellow-400"}:e>a?{text:`${t.name} better value`,color:"bg-green-500/20 text-green-400"}:{text:`${r.name} better value`,color:"bg-green-500/20 text-green-400"}})();return n?s.jsxs("div",{className:"flex items-center gap-4 p-3 bg-card/50 rounded-lg border",children:[s.jsxs("div",{className:"flex-1 text-center",children:[s.jsx("div",{className:"font-semibold text-sm",children:t.name}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[t.position," • ",t.team]})]}),s.jsx(m,{className:i.color,children:i.text}),s.jsxs("div",{className:"flex-1 text-center",children:[s.jsx("div",{className:"font-semibold text-sm",children:r.name}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[r.position," • ",r.team]})]})]}):s.jsxs(h,{className:"bg-gradient-to-br from-card to-card/80 border-primary/20",children:[s.jsx(g,{className:"pb-2",children:s.jsxs(f,{className:"text-sm flex items-center justify-between",children:[s.jsx("span",{children:"Player Comparison"}),s.jsx(m,{className:i.color,children:i.text})]})}),s.jsxs(j,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"font-bold text-primary",children:t.name}),s.jsxs("div",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[t.position," • ",t.team,x(t.trend)]})]}),s.jsx("div",{className:"text-xs text-muted-foreground self-center",children:"VS"}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"font-bold text-primary",children:r.name}),s.jsxs("div",{className:"text-xs text-muted-foreground flex items-center justify-center gap-1",children:[r.position," • ",r.team,x(r.trend)]})]})]}),s.jsx("div",{className:"space-y-3",children:u.map(e=>s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"grid grid-cols-3 text-xs",children:[s.jsx("span",{className:d(e.value1,e.value2,e.higherBetter),children:e.format(e.value1||0)}),s.jsxs("span",{className:"text-center text-muted-foreground flex items-center justify-center gap-1",children:[e.icon,e.label]}),s.jsx("span",{className:`text-right ${d(e.value2,e.value1,e.higherBetter)}`,children:e.format(e.value2||0)})]}),s.jsxs("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden flex",children:[s.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${c(e.value1,e.value2)}%`}}),s.jsx("div",{className:"h-full bg-secondary transition-all duration-500",style:{width:`${100-c(e.value1,e.value2)}%`}})]})]},e.label))})]})]})},U=t=>{const r=/(\w+(?:\s+\w+)?)\s+(?:vs\.?|versus|or)\s+(\w+(?:\s+\w+)?)/gi,o=[];let n;for(;(n=r.exec(t))!==null;)o.push([n[1].trim(),n[2].trim()]);return o};export{O as PlayerComparisonCard,O as default,U as detectPlayerPairs};

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.