PageSourceSearch

https://betting-insight-ai--guybostonvideo.replit.app/assets/parlay-builder-XIXwaj6G.js

js betting-insight-ai--guybostonvideo.replit.app collected 2026-10-03 03:50:26 UTC 30,672 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui-DVg5vlja.js";import{r as p}from"./vendor-charts-0WqoWmMF.js";import{u as Fe}from"./vendor-query-DdcG7b8d.js";import{L as De,e as we,v as Me,P as Y,l as ge,H as Ee,k as Ue,a0 as Re,p as We}from"./layout-G0LJ2LXm.js";import{s as Ke,k as m,a as He,X as D,C as xe}from"./index-BNgjLe9x.js";import{HitStackContent as Ye}from"./auto-parlay-30WVvigk.js";import{B as Ge}from"./book-filter-dropdown-D-H2Ce-Y.js";import{g as me}from"./affiliate-links-BAUpR8Rt.js";import{g as Xe}from"./parlay-nfl-week-h9eIL-F5.js";import{R as ye}from"./refresh-cw-CVNP42wc.js";import{C as je}from"./chevron-up-nwO4_gQL.js";import"./vendor-react-BzrpNAyj.js";import"./input-Czw0F4nb.js";import"./select-B6B4xCeH.js";import"./lock-D_2SkQQO.js";import"./sliders-horizontal-DrN7U0ji.js";const G=r=>{const i=r.label.match(/\s[OU]([\d.]+)(?:\s|$)/);return i?Number(i[1]):NaN};function qe(r,i,w,L="over"){const C=Array.from(new Set([...r,...i].map(G).filter(Number.isFinite))).sort((z,te)=>z-te),h=r.find(z=>z._isConsensus)??i.find(z=>z._isConsensus),B=h?G(h):C[0],x=w!=null&&C.includes(w)?w:B,k=r.some(z=>G(z)===x),S=i.some(z=>G(z)===x),W=L==="over"&&!k&&S?"under":L==="under"&&!S&&k?"over":L,ee=(W==="over"?r:i).find(z=>G(z)===x);return{allLines:C,line:x,direction:W,market:ee}}const ze="b2b_parlay_builder_draft_v1";function X(){return new Intl.DateTimeFormat("en-CA",{timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date)}function Je(){try{const r=localStorage.getItem(ze);if(!r)return{};const i=JSON.parse(r);if(!i||typeof i!="object")return{};const w=i;return w.draftDate===X()?w:{...w,legs:[],selectedPropLine:{},selectedPropDir:{},altLineSelections:{}}}catch{return{}}}function Ve(r){return r>0?r/100+1:100/Math.abs(r)+1}function Ze(r){return r>=2?Math.round((r-1)*100):Math.round(-100/(r-1))}function Qe(r){const i=r.reduce((w,L)=>w*Ve(L),1);return Ze(i)}function R(r){return r>0?`+${r}`:`${r}`}const et=["NBA","MLB","WNBA","NFL","CFB"];function tt(){const r=new Date().getMonth()+1,i=[];return r>=4&&r<=10&&i.push("MLB"),r>=5&&r<=9&&i.push("WNBA"),(r>=10||r<=5)&&i.push("NBA"),(r>=8||r<=2)&&i.push("NFL","CFB"),i.length>0?i:["MLB"]}const ve=tt(),Ne={NYY:"yankees new york",BOS:"red sox boston celtics",LAD:"dodgers los angeles lakers",CHC:"cubs chicago bulls sky",CHW:"white sox chicago",SF:"giants san francisco warriors",NYM:"mets new york knicks nets",ATL:"braves hawks dream atlanta",HOU:"astros rockets houston",LAA:"angels los angeles anaheim",OAK:"athletics oakland",SEA:"mariners storm seattle",TEX:"rangers texas",MIN:"twins timberwolves lynx minnesota",CLE:"guardians cavaliers cleveland",DET:"tigers pistons detroit",KC:"royals kansas city",TOR:"blue jays raptors toronto",BAL:"orioles baltimore",TB:"rays tampa bay",MIA:"marlins heat miami",PHI:"phillies 76ers sixers philadelphia",WSH:"nationals mystics washington",PIT:"pirates pittsburgh",CIN:"reds cincinnati",MIL:"brewers bucks milwaukee",STL:"cardinals st louis",COL:"rockies colorado",ARI:"diamondbacks arizona",SD:"padres san diego",LAL:"lakers los angeles",GSW:"warriors golden state",BKN:"nets brooklyn",NYK:"knicks new york",DAL:"mavericks wings dallas",DEN:"nuggets denver",IND:"pacers fever indiana",MEM:"grizzlies memphis",NOP:"pelicans new orleans",OKC:"thunder oklahoma city",ORL:"magic orlando",PHX:"suns mercury phoenix",POR:"blazers portland",SAC:"kings sacramento",SAS:"spurs san antonio",UTA:"jazz utah",WAS:"wizards mystics washington",CHA:"hornets charlotte",LVA:"aces las vegas",NYL:"liberty new york",CON:"sun connecticut",GSV:"valkyries golden state",BUF:"bills buffalo",CAR:"panthers carolina",JAX:"jaguars jacksonville",NE:"patriots new england",NO:"saints new orleans",LV:"raiders las vegas",LAC:"chargers los angeles",LAR:"rams los angeles",GB:"packers green bay",TEN:"titans tennessee"};function st(r){return r.replace(/\s+[OU][\d.]+\s+/," ").replace(/\s+[OU][\d.]+$/,"").trim()}function F(r){const i=r.match(/[OU]([\d.]+)/);return i?parseFloat(i[1]):0}function nt(r){return r.key.endsWith("_over")?"over":"under"}function ke(r){if(!r)return"";try{return new Intl.DateTimeFormat("en-US",{timeZone:"America/Ne
1w_York",hour:"numeric",minute:"2-digit",hour12:!0}).format(new Date(r))+" ET"}catch{return""}}function rt(r,i){const w=r.marketLabel,L=r.eventLabel,C=Object.values(r.books).length>0?Math.max(...Object.values(r.books)):0,h=C!==0?String(C):"",B=w.match(/^(.+?)\s+([OU])([\d.]+)\s+(.+)$/);if(B)return{playerName:B[1].trim(),statType:B[4].trim(),line:B[3],betDirection:B[2]==="O"?"over":"under",matchup:L,sport:i.toLowerCase(),playType:"player_prop",legOdds:h};const x=w.match(/^(.+?)\s+([OU])([\d.]+)$/);if(x)return{playerName:x[1].trim(),statType:"Total",line:x[3],betDirection:x[2]==="O"?"over":"under",matchup:L,sport:i.toLowerCase(),playType:"game_total",legOdds:h};const k=w.match(/^(\S+)\s+([-+]?[\d.]+)$/);if(k){const S=parseFloat(k[2]);return{playerName:k[1].trim(),statType:"Spread",line:Math.abs(S).toString(),betDirection:S<0?"under":"over",matchup:L,sport:i.toLowerCase(),playType:"moneyline",legOdds:h}}return{playerName:w,statType:"Moneyline",line:"0",betDirection:"over",matchup:L,sport:i.toLowerCase(),playType:"moneyline",legOdds:h}}function at(){const[r]=p.useState(Je),[i,w]=p.useState(X),L=Xe(i),C=t=>h==="NFL"?`${new Intl.DateTimeFormat("en-US",{timeZone:"America/New_York",weekday:"short",month:"short",day:"numeric"}).format(new Date(t))} · ${ke(t)}`:ke(t),[h,B]=p.useState(()=>r.sport&&et.includes(r.sport)?r.sport:ve[0]??"MLB"),[x,k]=p.useState(()=>Array.isArray(r.legs)?r.legs:[]),{enabledBooks:S,allKnownBooks:W}=He(),[ee,z]=p.useState(!1),[te,Le]=p.useState([]),[Se,Oe]=p.useState(void 0),[Ae,se]=p.useState(new Set),[Ce,ne]=p.useState(new Set),[T,$e]=p.useState(()=>r.includeProps??!1),[P,be]=p.useState(()=>r.search??""),[re,ae]=p.useState(()=>r.selectedPropLine??{}),[oe,q]=p.useState(()=>r.selectedPropDir??{}),[M,J]=p.useState(()=>r.altLineSelections??{}),V=p.useRef(null);p.useEffect(()=>{try{localStorage.setItem(ze,JSON.stringify({draftDate:i,sport:h,legs:x,includeProps:T,search:P,selectedPropLine:re,selectedPropDir:oe,altLineSelections:M}))}catch{}},[i,h,x,T,P,re,oe,M]);const{data:_=[],isFetching:K,refetch:Be}=Fe({queryKey:["parlay-events",h,T,i],queryFn:async()=>{const t=await fetch(`/api/parlay/events?sport=${h}&includeProps=${T}&date=${i}`,{cache:"no-store"});return t.ok?t.json():[]},staleTime:0,refetchInterval:3e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:"always"});p.useEffect(()=>{if(_.length===0)return;const t=new Map;for(const n of _)for(const a of n.markets)t.set(`${n.eventId}__${a.key}`,{market:a});const s=(n,a)=>{const b=Object.entries(n);return b.length===Object.keys(a).length&&b.every(([o,u])=>a[o]===u)};k(n=>{let a=!1;const b=n.map(o=>{const u=t.get(o.id);if(!u)return!T&&o.id.includes("__prop_")||Object.keys(o.books).length===0?o:(a=!0,{...o,books:{}});const c=u.market.type==="game"?M[o.id]:void 0,g=c!=null?u.market.altLines?.find(j=>j.line===c):void 0,y=g?u.market.key.endsWith("_over")?g.overBooks:g.underBooks:u.market.books;return s(o.books,y)?o:(a=!0,{...o,books:y})});return a?b:n})},[_,M,T]),p.useEffect(()=>{const t=window.setInterval(()=>{const s=X();s!==i&&w(s)},6e4);return()=>window.clearInterval(t)},[i]),p.useEffect(()=>{i!==X()&&w(X())},[i]),p.useEffect(()=>{i!==r.draftDate&&(k([]),ae({}),q({}),J({}),se(new Set),ne(new Set))},[i,r.draftDate]),p.useEffect(()=>{if(V.current===null){V.current=h;return}V.current!==h&&(V.current=h,se(new Set),ne(new Set),k([]),ae({}),q({}),J({}))},[h]);const ue=p.useCallback((t,s)=>{const n=`${t.eventId}__${s.key}`;x.some(a=>a.id===n)||k(a=>[...a,{id:n,eventLabel:`${t.awayTeam} @ ${t.homeTeam}`,marketLabel:s.label,books:s.books}])},[x]),E=t=>k(s=>s.filter(n=>n.id!==t)),Te=()=>k([]),Z=(t,s)=>x.some(n=>n.id===`${t}__${s}`),Pe=t=>se(s=>{const n=new Set(s);return n.has(t)?n.delete(t):n.add(t),n}),_e=t=>ne(s=>{const n=new Set(s);return n.has(t)?n.delete(t):n.add(t),n}),pe=p.useMemo(()=>{const t=P.trim().toLowerCase();if(!t||_.length===0)return[];const s=t.split(/\s+/).filter(Boolean),n=[];for(const a of _){const b=(Ne[a.homeTeam]||"").toLowerCase(),o=(Ne[a.awayTeam]||"").toLowerCase(),u=`${a.homeTeam} ${a.awayTeam} ${b} ${o}`.toLowerCase();for(const c of a.markets){const g=`${u} ${c.label.toLowerCase()}`;s.every(y=>g.includes(y))&&n.push({event:a,market:c})}}return n},[P,_]),Q=p.useMemo(()=>{const t=[],s=new Map;for(const{event:n,market:a}of pe)if(a.type==="game")t.push({event:n,market:a});else{const b=nt(a),o=st(a.label),u=`${n.eventId}__${o}`;s.has(u)||s.set(u,{event:n,baseLabel:o,over:[],under:[]});const c=s.get(u);b==="over"?c.over.push(a):c.under.push(a)}for(const n of s.values())n.over.sort((a,b)=>F(a.label)-F(b.label)),n.under.sort((a,b)=>F(a.label)-F(b.label));return{gameResults:t.slice(0,60),propGroups:Array.from(s.entries()).slice(0,60)}},[pe]),he=p.useMemo(()=>x.length<2?[]:W.filter(s=>S.has(s)).map(s=>{const n=x.filter(a=>a.books[s]===void 0);return n.length>0?{book:s,odds:null,missingLegs:n.map(a=>a.marketLabel)}:{book:s,odds:Qe(x.map(a=>a.books[s])),missingLegs:[]}}).filter(s=>s.odds!==null||s.missingLegs.length>0).sort((s,n)=>s.odds!==null&&n.odds!==null?n.odds-s.odds:s.odds!==null?-1:1),[x,S,W]),le=he.filter(t=>t.odds!==null),fe=he.filter(t=>t.odds===null),ie=Q.gameResults.length+Q.propGroups.length;return e.jsxs("div",{className:"flex flex-col 2xl:flex-row 2xl:items-start gap-6",children:[e.jsxs("div",{className:"2xl:flex-1 min-w-0 space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("div",{className:"flex rounded-lg border border-border overflow-hidden",children:ve.map(t=>e.jsx("button",{onClick:()=>B(t),"data-testid":`sport-tab-${t}`,className:m("px-4 py-2 text-sm font-semibold transition-colors",h===t?"bg-blue-600 text-white":"bg-card text-muted-foreground hover:bg-muted"),children:t},t))}),e.jsxs("button",{onClick:()=>$e(t=>!t),className:m("flex items-center gap-2 h-8 px-3 rounded-md border text-sm font-medium transition-all",T?"bg-blue-500/15 border-blue-500/40 text-blue-400":"bg-zinc-800/80 border-zinc-700/60 text-zinc-400 hover:text-zinc-200"),"data-testid":"toggle-props",children:[e.jsx("div",{className:m("relative inline-flex h-4 w-7 items-center rounded-full transition-colors shrink-0",T?"bg-blue-500":"bg-zinc-600"),children:e.jsx("span",{className:m("inline-block h-3 w-3 rounded-full bg-white shadow transition-transform",T?"translate-x-3.5":"translate-x-0.5")})}),"Props"]}),e.jsx(Ge,{}),e.jsxs("button",{onClick:()=>Be(),disabled:K,className:"flex items-center gap-1.5 h-8 px-3 text-[11px] font-medium rounded-md bg-zinc-800/80 border border-zinc-700/60 text-zinc-300 hover:bg-zinc-700/80 disabled:opacity-50 transition-all",children:[e.jsx(ye,{className:m("h-3 w-3",K&&"animate-spin")}),K?"Loading…":"Refresh"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Me,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-zinc-500 pointer-events-none"}),e.jsx("input",{type:"text",placeholder:`Search ${h} teams, players, or markets…`,value:P,onChange:t=>be(t.target.value),className:"w-full h-10 pl-9 pr-9 text-sm bg-zinc-900 border border-zinc-700/80 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/40 focu
1s:border-blue-500/50 placeholder:text-zinc-600 text-zinc-100 transition-colors","data-testid":"input-search-markets"}),P&&e.jsx("button",{onClick:()=>be(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-zinc-500 hover:text-zinc-300 transition-colors",children:e.jsx(D,{className:"h-4 w-4"})})]}),P.trim()&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] font-medium text-zinc-500 uppercase tracking-wide px-0.5",children:ie===0?`No results for "${P}"`:`${ie} result${ie!==1?"s":""}`}),Q.gameResults.map(({event:t,market:s})=>{const n=`${t.eventId}__${s.key}`,a=s.key.endsWith("_over"),b=F(s.label),o=M[n],u=s.altLines&&s.altLines.length>0,c=o!=null?s.altLines?.find(d=>d.line===o):void 0,g=c?a?c.overBooks:c.underBooks:s.books,y=o!=null&&o!==b?s.label.replace(/[OU][\d.]+/,`${a?"O":"U"}${o}`):s.label,j=Z(t.eventId,s.key),v=Object.entries(g).filter(([d])=>S.has(d)).sort(([,d],[,N])=>N-d).slice(0,6),I=d=>{const N=d===b?void 0:d;if(J(O=>{const $={...O};return N==null?delete $[n]:$[n]=N,$}),j){const O=s.altLines?.find(f=>f.line===d),$=O?a?O.overBooks:O.underBooks:s.books,l=d!==b?s.label.replace(/[OU][\d.]+/,`${a?"O":"U"}${d}`):s.label;k(f=>f.map(A=>A.id===n?{...A,marketLabel:l,books:$}:A))}},U=()=>{if(j){E(n);return}k(d=>[...d.filter(N=>N.id!==n),{id:n,eventLabel:`${t.awayTeam} @ ${t.homeTeam}`,marketLabel:y,books:g}])};return e.jsxs("div",{className:m("flex items-start gap-3 px-3 py-2.5 rounded-lg border transition-colors",j?"bg-blue-500/10 border-blue-500/30":"bg-zinc-900/60 border-zinc-800 hover:border-zinc-700"),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-semibold text-zinc-100",children:y}),e.jsxs("span",{className:"text-xs text-zinc-500",children:[t.awayTeam," @ ",t.homeTeam,t.startsAt?` · ${C(t.startsAt)}`:""]})]}),u&&e.jsxs("div",{className:"flex items-center gap-1 flex-wrap mt-1.5 mb-1",children:[e.jsxs("button",{onClick:()=>I(b),className:m("px-2 py-0.5 rounded text-[11px] font-mono font-semibold border transition-colors",o==null||o===b?"bg-blue-500/20 border-blue-500/50 text-blue-300":"bg-zinc-800 border-zinc-700 text-zinc-400 hover:border-blue-500/40 hover:text-zinc-200"),children:[a?"O":"U",b]}),s.altLines.filter(d=>d.line!==b).map(d=>e.jsxs("button",{onClick:()=>I(d.line),className:m("px-2 py-0.5 rounded text-[11px] font-mono font-semibold border transition-colors",o===d.line?"bg-blue-500/20 border-blue-500/50 text-blue-300":"bg-zinc-800 border-zinc-700 text-zinc-400 hover:border-blue-500/40 hover:text-zinc-200"),children:[a?"O":"U",d.line]},d.line))]}),v.length>0&&e.jsx("div",{className:"flex items-center gap-2.5 mt-0.5 flex-wrap",children:v.map(([d,N])=>e.jsxs("span",{className:"text-[11px]",children:[e.jsxs("span",{className:"text-zinc-500",children:[d,":"]})," ",e.jsx("span",{className:m("font-mono font-semibold",N>0?"text-blue-400":"text-zinc-300"),children:R(N)})]},d))})]}),e.jsx("button",{onClick:U,className:m("shrink-0 flex items-center gap-1 px-3 py-1.5 rounded-md text-xs font-semibold transition-colors mt-0.5",j?"bg-blue-500/20 text-blue-400 border border-blue-500/30 hover:bg-red-500/20 hover:text-red-400 hover:border-red-500/30":"bg-blue-600 hover:bg-blue-700 text-white"),children:j?e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"h-3 w-3"})," Remove"]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"h-3 w-3"})," Add"]})})]},n)}),Q.propGroups.map(([t,s])=>{const{event:n,baseLabel:a,over:b,under:o}=s,u=`${n.awayTeam} @ ${n.homeTeam}`,c=n.startsAt?` · ${C(n.startsAt)}`:"",{allLines:g,line:y,direction:j,market:v}=qe(b,o,re[t],oe[t]),I=b.some(l=>F(l.label)===y),U=o.some(l=>F(l.label)===y),d=v?`${n.eventId}__${v.key}`:null,N=d?x.some(l=>l.id===d):!1,O=v?Object.entries(v.books).filter(([l])=>S.has(l)).sort(([,l],[,f])=>f-l).slice(0,7):[],$=()=>{if(!(!v||!d))if(N)E(d);else{const l=new Set([...b.map(f=>`${n.eventId}__${f.key}`),...o.map(f=>`${n.eventId}__${f.key}`)]);k(f=>[...f.filter(A=>!l.has(A.id)),{id:d,eventLabel:u,marketLabel:v.label,books:v.books}])}};return e.jsxs("div",{className:m("px-3 py-3 rounded-lg border transition-colors",N?"bg-blue-500/10 border-blue-500/30":"bg-zinc-900/60 border-zinc-800 hover:border-zinc-700"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2.5",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-semibold text-zinc-100",children:a}),e.jsxs("span",{className:"text-xs text-zinc-500 ml-2",children:[u,c]})]}),e.jsx("button",{onClick:$,disabled:!v,className:m("shrink-0 flex items-center gap-1 px-3 py-1.5 rounded-md text-xs font-semibold transition-colors",N?"bg-blue-500/20 text-blue-400 border border-blue-500/30 hover:bg-red-500/20 hover:text-red-400 hover:border-red-500/30":"bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-40"),children:N?e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"h-3 w-3"})," Remove"]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"h-3 w-3"})," Add"]})})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-2",children:[e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[e.jsx("span",{className:"text-[10px] font-semibold text-zinc-500 uppercase tracking-wide mr-0.5",children:"Line"}),g.map(l=>e.jsx("button",{onClick:()=>ae(f=>({...f,[t]:l})),className:m("px-2 py-0.5 rounded text-[11px] font-mono font-semibold border transition-colors",y===l?"bg-blue-500/20 border-blue-500/50 text-blue-300":"bg-zinc-800 border-zinc-700 text-zinc-400 hover:border-blue-500/40 hover:text-zinc-200"),children:l},l))]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-[10px] font-semibold text-zinc-500 uppercase tracking-wide mr-0.5",children:"Pick"}),I&&e.jsx("button",{onClick:()=>q(l=>({...l,[t]:"over"})),className:m("px-3 py-0.5 rounded text-[11px] font-semibold border transition-colors",j==="over"?"bg-blue-500/20 border-blue-500/50 text-blue-300":"bg-zinc-800 border-zinc-700 text-zinc-400 hover:border-blue-500/40 hover:text-zinc-200"),children:"Over"}),U&&e.jsx("button",{onClick:()=>q(l=>({...l,[t]:"under"})),className:m("px-3 py-0.5 rounded text-[11px] font-semibold border transition-colors",j==="under"?"bg-zinc-500/20 border-zinc-500/50 text-zinc-200":"bg-zinc-800 border-zinc-700 text-zinc-400 hover:border-zinc-500/40 hover:text-zinc-200"),children:"Under"})]})]}),O.length>0&&e.jsx("div",{className:"flex items-center gap-2.5 flex-wrap",children:O.map(([l,f])=>e.jsxs("span",{className:"text-[11px]",children:[e.jsxs("span",{className:"text-zinc-500",children:[l,":"]}
1)," ",e.jsx("span",{className:m("font-mono font-semibold",f>0?"text-blue-400":"text-zinc-300"),children:R(f)})]},l))})]},t)})]}),h==="NFL"&&e.jsxs("div",{className:"text-sm text-zinc-400","data-testid":"nfl-parlay-week",children:[L.label," · Upcoming NFL games"]}),!P.trim()&&e.jsxs(e.Fragment,{children:[K&&_.length===0&&e.jsxs("div",{className:"flex items-center justify-center py-10 gap-2 text-zinc-500 text-sm",children:[e.jsx(ye,{className:"h-4 w-4 animate-spin"})," Loading ",h," games…"]}),!K&&_.length===0&&e.jsx("div",{className:"text-center py-10 text-zinc-500 text-sm",children:h==="NFL"?`No upcoming NFL games with available odds for the ${L.label.toLowerCase()}.`:`No ${h} games found for today.`}),e.jsx("div",{className:"space-y-2",children:_.map(t=>{const s=Ae.has(t.eventId),n=t.markets.filter(o=>o.type==="game"),a=t.markets.filter(o=>o.type==="prop"),b=Ce.has(t.eventId);return e.jsxs(xe,{className:"bg-zinc-900/50 border-zinc-800",children:[e.jsx("button",{className:"w-full text-left",onClick:()=>Pe(t.eventId),children:e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsxs("div",{className:m("flex gap-2.5",h==="NFL"?"min-w-0 flex-col items-start gap-1":"items-center"),children:[e.jsxs("span",{className:"font-semibold text-sm text-zinc-100",children:[t.awayTeam," @ ",t.homeTeam]}),t.startsAt&&e.jsx("span",{className:"text-xs text-zinc-500",children:C(t.startsAt)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[11px] text-zinc-600",children:[n.length," lines",a.length>0?` · ${a.length} props`:""]}),s?e.jsx(je,{className:"h-4 w-4 text-zinc-500"}):e.jsx(ge,{className:"h-4 w-4 text-zinc-500"})]})]})}),s&&e.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-zinc-800/60 pt-3",children:[n.length>0&&(()=>{const o=n.filter(c=>!c.altLines||c.altLines.length===0),u=n.filter(c=>c.altLines&&c.altLines.length>0);return e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[10px] font-semibold text-zinc-500 uppercase tracking-widest",children:"Game Lines"}),o.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map(c=>{const g=Z(t.eventId,c.key),y=Object.entries(c.books).filter(([j])=>S.has(j)).sort(([,j],[,v])=>v-j)[0];return e.jsxs("button",{onClick:()=>g?E(`${t.eventId}__${c.key}`):ue(t,c),className:m("flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs font-medium border transition-colors",g?"bg-blue-500/20 border-blue-500/40 text-blue-400":"bg-zinc-800 border-zinc-700/60 text-zinc-400 hover:border-blue-500/30 hover:text-zinc-200"),children:[g?e.jsx(D,{className:"h-3 w-3"}):e.jsx(Y,{className:"h-3 w-3"}),c.label,y&&e.jsx("span",{className:m("font-mono text-[11px]",y[1]>0?"text-blue-400":"text-zinc-400"),children:R(y[1])})]},c.key)})}),u.map(c=>{const g=`${t.eventId}__${c.key}`,y=c.key.endsWith("_over"),j=F(c.label),v=M[g],I=v!=null?c.altLines?.find(l=>l.line===v):void 0,U=I?y?I.overBooks:I.underBooks:c.books,d=v!=null&&v!==j?c.label.replace(/[OU][\d.]+/,`${y?"O":"U"}${v}`):c.label,N=Z(t.eventId,c.key),O=Object.entries(U).filter(([l])=>S.has(l)).sort(([,l],[,f])=>f-l)[0],$=l=>{const f=l===j?void 0:l;if(J(A=>{const H={...A};return f==null?delete H[g]:H[g]=f,H}),N){const A=c.altLines?.find(ce=>ce.line===l),H=A?y?A.overBooks:A.underBooks:c.books,Ie=l!==j?c.label.replace(/[OU][\d.]+/,`${y?"O":"U"}${l}`):c.label;k(ce=>ce.map(de=>de.id===g?{...de,marketLabel:Ie,books:H}:de))}};return e.jsxs("div",{className:m("px-2.5 py-2 rounded-lg border transition-colors",N?"bg-blue-500/10 border-blue-500/30":"bg-zinc-800/60 border-zinc-700/50"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[e.jsx("span",{className:"text-xs font-medium text-zinc-300",children:d}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[O&&e.jsx("span",{className:m("font-mono text-[11px] font-semibold",O[1]>0?"text-blue-400":"text-zinc-300"),children:R(O[1])}),e.jsx("button",{onClick:()=>N?E(g):k(l=>[...l.filter(f=>f.id!==g),{id:g,eventLabel:`${t.awayTeam} @ ${t.homeTeam}`,marketLabel:d,books:U}]),className:m("flex items-center gap-1 px-2 py-0.5 rounded text-[11px] font-semibold border transition-colors",N?"bg-blue-500/20 border-blue-500/30 text-blue-400 hover:bg-red-500/20 hover:text-red-400 hover:border-red-500/30":"bg-blue-600 border-transparent text-white hover:bg-blue-700"),
1children:N?e.jsxs(e.Fragment,{children:[e.jsx(D,{className:"h-3 w-3"}),"Remove"]}):e.jsxs(e.Fragment,{children:[e.jsx(Y,{className:"h-3 w-3"}),"Add"]})})]})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[e.jsx("span",{className:"text-[10px] text-zinc-600 mr-0.5",children:"Line:"}),e.jsxs("button",{onClick:()=>$(j),className:m("px-1.5 py-0.5 rounded text-[11px] font-mono font-semibold border transition-colors",v==null||v===j?"bg-blue-500/20 border-blue-500/50 text-blue-300":"bg-zinc-800 border-zinc-700 text-zinc-400 hover:border-blue-500/40 hover:text-zinc-200"),children:[y?"O":"U",j]}),c.altLines.filter(l=>l.line!==j).map(l=>e.jsxs("button",{onClick:()=>$(l.line),className:m("px-1.5 py-0.5 rounded text-[11px] font-mono font-semibold border transition-colors",v===l.line?"bg-blue-500/20 border-blue-500/50 text-blue-300":"bg-zinc-800 border-zinc-700 text-zinc-400 hover:border-blue-500/40 hover:text-zinc-200"),children:[y?"O":"U",l.line]},l.line))]})]},c.key)})]})})(),a.length>0&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>_e(t.eventId),className:"flex items-center gap-1.5 text-[11px] font-medium text-zinc-500 hover:text-zinc-300 transition-colors mb-2",children:[b?e.jsx(je,{className:"h-3 w-3"}):e.jsx(ge,{className:"h-3 w-3"}),"Player Props (",a.length,")"]}),b&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(o=>{const u=Z(t.eventId,o.key);return e.jsxs("button",{onClick:()=>u?E(`${t.eventId}__${o.key}`):ue(t,o),className:m("flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs font-medium border transition-colors",u?"bg-blue-500/20 border-blue-500/40 text-blue-400":"bg-zinc-800 border-zinc-700/60 text-zinc-400 hover:border-blue-500/30 hover:text-zinc-200"),children:[u?e.jsx(D,{className:"h-3 w-3"}):e.jsx(Y,{className:"h-3 w-3"}),o.label]},o.key)})})]})]})]},t.eventId)})})]})]}),e.jsxs("div",{className:"2xl:w-[360px] 2xl:flex-shrink-0 2xl:sticky 2xl:top-4 space-y-4",children:[e.jsxs(xe,{className:"bg-zinc-900/60 border-blue-500/20",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800/60",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4 text-blue-400"}),e.jsx("span",{className:"text-sm font-semibold text-zinc-100",children:"Parlay Legs"}),x.length>0&&e.jsx("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-blue-500/20 text-blue-400 border border-blue-500/30",children:x.length})]}),x.length>0&&e.jsxs("button",{onClick:Te,className:"text-[11px] text-zinc-500 hover:text-red-400 flex items-center gap-1 transition-colors",children:[e.jsx(Ee,{className:"h-3 w-3"})," Clear"]})]}),e.jsxs("div",{className:"p-3 space-y-2",children:[x.length===0?e.jsx("p",{className:"text-xs text-zinc-500 text-center py-3",children:"Search or click a market above to add legs."}):x.map((t,s)=>{const a=Object.entries(t.books).filter(([o])=>S.has(o)).reduce((o,u)=>!o||u[1]>o[1]?u:o,null),b=Object.keys(t.books).length===0;return e.jsxs("div",{className:"flex items-start justify-between gap-2 bg-zinc-800/50 rounded-lg px-3 py-2 border border-zinc-700/40",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx("span",{className:"bg-blue-500/20 text-blue-400 text-[10px] font-bold px-1.5 py-0.5 rounded",children:s+1}),e.jsx("span",{className:"text-xs font-semibold text-zinc-200 truncate",children:t.marketLabel})]}),e.jsx("p",{className:"text-[11px] text-zinc-500 truncate",children:t.eventLabel}),a&&e.jsxs("p",{className:"text-[11px] mt-0.5",children:[e.jsxs("span",{className:"text-zinc-600",children:["best ",me(a[0])," "]}),e.jsx("span",{className:m("font-mono font-semibold",a[1]>0?"text-blue-400":"text-zinc-300"),children:R(a[1])})]}),b&&e.jsx("p",{className:"text-[11px] mt-0.5 text-amber-400",children:"Line no longer available"})]}),e.jsx("button",{onClick:()=>E(t.id),className:"text-zinc-600 hover:text-red-400 transition-colors mt-0.5 shrink-0",children:e.jsx(D,{className:"h-3.5 w-3.5"})})]},t.id)}),x.length>=1&&e.jsxs("button",{onClick:()=>{const t=x.map(n=>rt(n,h)),s=le[0]?.odds??void 0;Le(t),Oe(s),z(!0)},className:"w-full flex items-center justify-center gap-1.5 mt-1 px-3 py-2 rounded-lg bg-primary/15 border border-primary/30 text-primary text-xs font-semibold hover:bg-primary/25 transition-colors",children:[e.jsx(Ue,{className:"h-3.5 w-3.5"}),"Track Parlay"]})]})]}),x.length>=2&&e.jsxs(xe,{className:"bg-zinc-900/60 border-blue-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-zinc-800/60",children:[e.jsx(Re,{className:"h-4 w-4 text-blue-400"}),e.jsx("span",{className:"text-sm font-semibold text-zinc-100",children:"Parlay Odds by Book"}),e.jsxs("span",{className:"text-xs text-zinc-500",children:["(",x.length," legs)"]})]}),e.jsxs("div",{className:"p-3 space-y-3",children:[le.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold text-zinc-500 uppercase tracking-widest mb-1.5",children:"All Legs Available"}),e.jsx("div",{className:"rounded-lg border border-zinc-800 overflow-hidden",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-zinc-800/80 border-b border-zinc-800",children:[e.jsx("th",{className:"text-left px-3 py-2 font-medium text-zinc-500",children:"Book"}),e.jsx("th",{className:"text-right px-3 py-2 font-medium text-zinc-500",children:"Odds"})]})}),e.jsx("tbody",{children:le.map((t,s)=>e.jsxs("tr",{className:m("border-b border-zinc-800/50 last:border-0",s===0&&"bg-blue-500/5"),children:[e.jsx("td",{className:"px-3 py-2 text-zinc-300",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[s===0&&e.jsx("span",{className:"text-[9px] bg-blue-500/25 text-blue-400 px-1 py-0.5 rounded font-bold",children:"BEST"}),me(t.book)]})}),e.jsx("td",{className:m("px-3 py-2 text-right font-bold font-mono",s===0?"text-blue-400":"text-zinc-300"),children:R(t.odds)})]},t.book))})]})})]}),fe.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[10px] font-semibold text-zinc-500 uppercase tracking-widest mb-1.5",children:"Missing Legs"}),e.jsx("div",{className:"rounded-lg border border-zinc-800/40 overflow-hidden",children:e.jsx("table",{className:"w-full text-xs",children:e.jsx("tbody",{children:fe.map(t=>e.jsxs("tr",{className:"border-b border-zinc-800/30 last:border-0 opacity-50",children:[e.jsx("td",{className:"px-3 py-2 text-zinc-400",children:me(t.book)}),e.jsx("td",{className:"px-3 py-2 text-right text-zinc-500 text-[11px]",children:t.missingLegs.join(", ")})]},t.book))})})})]})]})]}),x.length===1&&e.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/40 py-4 text-center",children:e.jsx("p",{className:"text-xs text-zinc-500",children:"Add at least 2 legs to calculate parlay odds."})})]}),e.jsx(We,{open:ee,onClose:()=>z(!1),prefill:null,prefillLegs:te,prefillParlayOdds:Se})]})}function Nt(){Ke();const[r,i]=p.useState("manual");return e.jsx(De,{children:e.jsxs("div",{className:"max-w-6xl mx-auto 
1space-y-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex items-center justify-center w-9 h-9 rounded-lg bg-blue-500/15 border border-blue-500/25",children:e.jsx(we,{className:"h-5 w-5 text-blue-400"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-zinc-100",children:"Parlay Builder"}),e.jsx("p",{className:"text-xs text-zinc-500",children:r==="hitstack"?"Auto-generate high-probability parlays from analytics data":"Build your parlay and compare odds across every sportsbook"})]})]}),e.jsxs("div",{className:"flex rounded-lg border border-zinc-700 overflow-hidden text-sm font-semibold",children:[e.jsx("button",{onClick:()=>i("hitstack"),className:m("px-5 py-2.5 transition-colors",r==="hitstack"?"bg-amber-500 text-black":"bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:"HitStack"}),e.jsx("button",{onClick:()=>i("manual"),className:m("px-5 py-2.5 transition-colors border-l border-zinc-700",r==="manual"?"bg-blue-600 text-white":"bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:"Manual"})]})]}),r==="hitstack"?e.jsx(Ye,{embedded:!0}):e.jsx(at,{})]})})}export{Nt 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.