From f1956dc95396ba0e26553155a1fc01a0b339fdfd Mon Sep 17 00:00:00 2001 From: Kev Date: Fri, 19 Jun 2026 11:25:14 -0400 Subject: [PATCH] Session 50: Complete Parlay Lab (2215 tests) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correlation-aware combined parlay grading — the Desk-tier differentiator. - Correlation model (parlayService.js, added to S28 funcs): correlationScore (game-aware 0.7/0.4/0.2/0.0), combinedGrade (avg penalized by avgCorr*0.5), estimatedPayout (fair-odds product * (1-avgCorr) discount), correlationWarning, gradeParlay. - POST /api/parlay/grade (public, 2-6 legs) -> {combined,correlation,payout,legs}. Fixed the Next proxy (was forwarding to /api/scan/parlay). - ParlayContext: legs gained team/game/archetype; tier-aware maxLegs; auto-grades the slip (debounced) when legs>=2 -> live combined/correlation/payout; hasLeg/ legKey/atCap. - "+" button on every graded prop: StatStrip onAddLeg/isLegActive, wired by vyndr/GameCard via useParlay (builds leg w/ team + game). GradeResultCard feeds the same context from the scan page. - ParlayPanel (replaces legacy ParlayTray): bottom slide-up w/ legs, combined grade, correlation warning, est payout, CLEAR ALL + floating leg-count badge. Tier-gated: free 2 legs (payout blurred -> Desk upsell), Analyst 4, Desk 6. Backend 2185 -> 2215 tests (+30), 187 suites. Web build clean (exit 0). Co-Authored-By: Claude Opus 4.8 (1M context) --- BUILD-STATE.md | 37 +++++- CLAUDE.md | 23 ++++ src/routes/parlay.js | 16 +++ src/services/parlayService.js | 141 ++++++++++++++++++++++- tests/integration/parlayGrade.test.js | 27 +++++ tests/unit/parlayCorrelation.test.js | 85 ++++++++++++++ tests/unit/parlayLabUI.test.js | 96 +++++++++++++++ web/public/sw.js | 2 +- web/src/app/api/parlay/grade/route.ts | 48 ++------ web/src/app/layout.tsx | 5 +- web/src/components/vyndr/GameCard.tsx | 22 ++++ web/src/components/vyndr/ParlayPanel.tsx | 133 +++++++++++++++++++++ web/src/components/vyndr/StatStrip.tsx | 29 +++++ web/src/contexts/ParlayContext.tsx | 90 ++++++++++++++- 14 files changed, 706 insertions(+), 48 deletions(-) create mode 100644 tests/integration/parlayGrade.test.js create mode 100644 tests/unit/parlayCorrelation.test.js create mode 100644 tests/unit/parlayLabUI.test.js create mode 100644 web/src/components/vyndr/ParlayPanel.tsx diff --git a/BUILD-STATE.md b/BUILD-STATE.md index ef04f77..19b9cc6 100755 --- a/BUILD-STATE.md +++ b/BUILD-STATE.md @@ -4,8 +4,41 @@ 2026-06-18 ## Current Phase -SHIP BUILD v49.0 — Complete onboarding flow (prefs API, 3-step page, redirect, -dashboard personalization, settings editor) + name micro-fixes. +SHIP BUILD v50.0 — Parlay Lab: correlation-aware combined grading, live slip, +"+" on every graded prop, tier-gated panel. The Desk-tier differentiator. + +## Session 50 (2026-06-19) — SHIPPED ✅ PARLAY LAB + +Backend 2185 → **2215 tests** (+30), 187 suites. Web build clean (exit 0). + +### Phase 1 — correlation-score model (parlayService.js, ADDED to S28 funcs) +Numeric, GAME-AWARE model: `correlationScore(l1,l2)` → 0.7 same-player/game / +0.4 same-team/game / 0.2 same-game-diff-team / 0.0 diff-game. `combinedGrade` = +leg-grade avg penalized by `avgCorrelation * 0.5`. `estimatedPayout` = product of +per-grade fair odds × (1 − avgCorrelation) discount. `correlationWarning` → +"⚠ N legs from {TEAM}…". `gradeParlay` bundles it all. + +### Phase 2 — POST /api/parlay/grade +Returns `{ combined, correlation, payout, legs }` (2–6 legs, public/stateless). +The Next `/api/parlay/grade` proxy was forwarding to the wrong upstream +(`/api/scan/parlay`) — fixed to the new route. + +### Phase 3 — ParlayContext extended +`ParlayLeg` gained team/game/archetype; MAX_LEGS now 6 with a tier-aware +`maxLegs` (set by the panel). Auto-grades the slip (debounced) via the endpoint +when legs ≥ 2 → live `combined`/`correlation`/`payout`. + `hasLeg`/`legKey`/`atCap`. + +### Phase 4 — "+" buttons +`StatStrip` renders a "+"/"✓" per graded prop (toggles add/remove); `vyndr/GameCard` +wires it via `useParlay` (builds a leg with team + game id). `GradeResultCard`'s +existing "Add to Parlay" feeds the same context from the scan page. + +### Phase 5 — ParlayPanel (replaces legacy ParlayTray in the layout) +Bottom slide-up: legs (archetype + grade + remove), correlation warning, combined +grade, est. payout, CLEAR ALL + a floating leg-count badge (bottom-right) when +closed. Tier-gated: free 2 legs (payout blurred → Desk upgrade), Analyst 4, Desk 6. + +## Session 49 (2026-06-19) — SHIPPED ✅ ONBOARDING FLOW ## Session 49 (2026-06-19) — SHIPPED ✅ ONBOARDING FLOW diff --git a/CLAUDE.md b/CLAUDE.md index 1af2507..1724439 100755 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -533,6 +533,29 @@ snapshot, locked to the line, and read from cache. - **Name micro-fix:** `playerName.js` `collapseInitials` merges "J C" → "JC" (display + key) so space-separated initials dedupe. +## Parlay Lab (Session 50 — non-obvious) +- **Correlation model** lives in `src/services/parlayService.js` (ADDED to the + S28 categorical matrix — both coexist). `correlationScore(l1,l2)` is numeric + + GAME-aware (0.7 same-player/game, 0.4 same-team/game, 0.2 same-game, 0.0 diff- + game). `combinedGrade` penalizes the leg-grade avg by `avgCorrelation*0.5`; + `estimatedPayout` = Πfair-odds × (1−avgCorr) discount. `gradeParlay` is the + bundle the route returns. Leg shape: `{ player, team, game, stat, grade }`. +- **POST /api/parlay/grade** (`src/routes/parlay.js`) — public, 2–6 legs, returns + `{ combined, correlation, payout, legs }`. The Next proxy was pointed at the + WRONG upstream (`/api/scan/parlay`); it now forwards to `/api/parlay/grade`. +- **ParlayContext auto-grades** the slip (debounced 250ms) via that endpoint + whenever legs change (≥2). `combined`/`correlation`/`payout` are live on the + context — don't call the endpoint from components, read the context. +- **Leg cap is tier-aware via the context.** `maxLegs` defaults 6; `ParlayPanel` + sets it from `useAuth().tier` (free 2 / analyst 4 / desk 6). `addLeg` reads a + ref so it stays a stable callback. The "+" buttons no-op at the cap. +- **"+" wiring:** `StatStrip` takes `onAddLeg`/`isLegActive`; `vyndr/GameCard` + provides them via `useParlay` (it owns the game id + team). `legKey` = + `player|stat|line|direction` is the dedupe key (exported from the context). +- **ParlayPanel** (mounted in layout, REPLACED `ParlayTray` which called a + then-missing `/grade` endpoint). Floating badge bottom-right when closed; free + tier blurs the payout with a `window.__goPaywall` upsell. + ## Active Skills - vyndr-voice (all user-facing output) - prop-analysis (grading methodology) diff --git a/src/routes/parlay.js b/src/routes/parlay.js index 206dad3..2ea8986 100644 --- a/src/routes/parlay.js +++ b/src/routes/parlay.js @@ -33,6 +33,22 @@ router.post('/calculate', (req, res) => { } }); +// POST /api/parlay/grade (Session 50) — the Parlay Lab. Returns +// { combined, correlation, payout, legs }. Public + stateless (the lightweight +// math); the Lab UI is tier-gated on the frontend. 2–6 legs. +router.post('/grade', (req, res) => { + const legs = req.body?.legs; + if (!Array.isArray(legs) || legs.length < 2 || legs.length > 6) { + return res.status(400).set(MISSION_HEADER).json({ error: 'A parlay needs 2–6 legs.' }); + } + try { + const betAmount = Number(req.body?.betAmount) || 10; + return res.set(MISSION_HEADER).json(parlayService.gradeParlay(legs, betAmount)); + } catch (err) { + return res.status(400).set(MISSION_HEADER).json({ error: err.message }); + } +}); + router.post('/suggestions', (req, res) => { try { const { props, legs, max } = req.body || {}; diff --git a/src/services/parlayService.js b/src/services/parlayService.js index f39d33a..fe42da6 100644 --- a/src/services/parlayService.js +++ b/src/services/parlayService.js @@ -185,9 +185,148 @@ function suggestParlays(props, { legs = 3, max = 3 } = {}) { return suggestions; } +// ─────────────────────────────────────────────────────────────────── +// Session 50 — Parlay Lab correlation-score model. +// +// A numeric, GAME-AWARE correlation model (0.0 independent … 1.0 perfectly +// correlated) layered on top of the S28 categorical matrix. Legs are the light +// UI shape { player, team, game, stat, grade }. +// ─────────────────────────────────────────────────────────────────── + +/** Grade → 0..1 score (A+ = 1.0 … F = 0.0), reusing the 13-step order. */ +function gradeScore(grade) { + return gradeToNumeric(grade) / (GRADE_ORDER.length - 1); +} +/** 0..1 score → letter grade. */ +function scoreToGrade(score) { + const s = Math.max(0, Math.min(1, Number(score) || 0)); + return numericToGrade(s * (GRADE_ORDER.length - 1)); +} + +const sameVal = (a, b) => a != null && b != null && String(a).toLowerCase() === String(b).toLowerCase(); + +/** + * Pairwise correlation between two legs (0.0–1.0): + * 0.7 same player, same game (different stats move together) + * 0.4 same team, same game (team performance drives both) + * 0.2 same game, different teams (game pace, mostly independent) + * 0.0 different games (fully independent — what books price) + */ +function correlationScore(leg1, leg2) { + if (!leg1 || !leg2) return 0; + if (!sameVal(leg1.game, leg2.game)) return 0; // different (or unknown) game + if (sameVal(leg1.player, leg2.player)) return 0.7; + if (sameVal(leg1.team, leg2.team)) return 0.4; + return 0.2; +} + +function pairwise(legs) { + const out = []; + for (let i = 0; i < legs.length; i += 1) { + for (let j = i + 1; j < legs.length; j += 1) out.push(correlationScore(legs[i], legs[j])); + } + return out; +} + +/** + * Combined parlay grade — the leg-grade average PENALIZED by correlation. + * penalty = avgCorrelation * 0.5 (each 0.1 correlation ≈ 0.05 grade-score drop). + */ +function combinedGrade(legs) { + const list = Array.isArray(legs) ? legs : []; + if (list.length === 0) return { grade: '—', score: 0, penalty: 0, maxCorrelation: 0, avgCorrelation: 0 }; + const rawAvg = list.reduce((s, l) => s + gradeScore(l.grade), 0) / list.length; + const pairs = pairwise(list); + const maxCorrelation = pairs.length ? Math.max(...pairs) : 0; + const avgCorrelation = pairs.length ? pairs.reduce((a, b) => a + b, 0) / pairs.length : 0; + const penalty = avgCorrelation * 0.5; + const score = Math.max(0, Math.min(1, rawAvg - penalty)); + return { + grade: scoreToGrade(score), + score: Math.round(score * 1000) / 1000, + penalty: Math.round(penalty * 1000) / 1000, + maxCorrelation: Math.round(maxCorrelation * 100) / 100, + avgCorrelation: Math.round(avgCorrelation * 100) / 100, + }; +} + +// Fair decimal odds the model assigns each grade (lower grade = longer odds). +const FAIR_ODDS = { + 'A+': 1.15, A: 1.25, 'A-': 1.35, 'B+': 1.45, B: 1.70, 'B-': 1.90, + 'C+': 2.0, C: 2.10, 'C-': 2.5, 'D+': 2.8, D: 3.0, 'D-': 4.0, F: 5.0, +}; +function fairOdds(grade) { + return FAIR_ODDS[String(grade || 'C').toUpperCase()] ?? 2.1; +} + +/** + * Estimated payout. Books price parlays as independent (product of fair odds); + * VYNDR discounts that by the slip's average correlation. + */ +function estimatedPayout(legs, betAmount = 10) { + const list = Array.isArray(legs) ? legs : []; + const bet = Number(betAmount) || 10; + const fairMultiplier = list.reduce((m, l) => m * fairOdds(l.grade), 1); + const pairs = pairwise(list); + const avgCorrelation = pairs.length ? pairs.reduce((a, b) => a + b, 0) / pairs.length : 0; + const correlationDiscount = Math.max(0.5, Math.min(1, 1 - avgCorrelation)); + const multiplier = fairMultiplier * correlationDiscount; + return { + payout: Math.round(bet * multiplier * 100) / 100, + multiplier: Math.round(multiplier * 100) / 100, + fairMultiplier: Math.round(fairMultiplier * 100) / 100, + correlationDiscount: Math.round(correlationDiscount * 100) / 100, + }; +} + +/** Human warning for the most-correlated cluster, or null when independent. */ +function correlationWarning(legs) { + const list = Array.isArray(legs) ? legs : []; + if (list.length < 2) return null; + const byTeam = {}; + for (const l of list) { + if (!l.team || !l.game) continue; + const k = `${String(l.team).toUpperCase()}|${l.game}`; + (byTeam[k] = byTeam[k] || []).push(l); + } + let worst = null; + for (const [k, group] of Object.entries(byTeam)) { + if (group.length >= 2 && (!worst || group.length > worst.count)) worst = { team: k.split('|')[0], count: group.length }; + } + if (worst) return `⚠ ${worst.count} legs from ${worst.team} — high correlation`; + for (let i = 0; i < list.length; i += 1) { + for (let j = i + 1; j < list.length; j += 1) { + if (sameVal(list[i].game, list[j].game)) return '⚠ 2 legs from the same game — correlated'; + } + } + return null; +} + +/** The full Parlay-Lab analysis the /grade route returns. */ +function gradeParlay(legs, betAmount = 10) { + const combined = combinedGrade(legs); + const payout = estimatedPayout(legs, betAmount); + return { + combined: { grade: combined.grade, score: combined.score, penalty: combined.penalty }, + correlation: { max: combined.maxCorrelation, avg: combined.avgCorrelation, warning: correlationWarning(legs) }, + payout: { amount: payout.payout, multiplier: payout.multiplier, fairMultiplier: payout.fairMultiplier, discount: payout.correlationDiscount }, + legs: (Array.isArray(legs) ? legs : []).map((l) => ({ ...l, score: gradeScore(l.grade) })), + }; +} + module.exports = { calculateParlay, detectCorrelation, suggestParlays, - __internals: { americanToDecimal, decimalToAmerican, gradeToNumeric, numericToGrade, INTERACTIONS }, + // Session 50 — Parlay Lab model + correlationScore, + combinedGrade, + estimatedPayout, + correlationWarning, + gradeParlay, + gradeToNumeric, + numericToGrade, + gradeScore, + scoreToGrade, + __internals: { americanToDecimal, decimalToAmerican, gradeToNumeric, numericToGrade, INTERACTIONS, FAIR_ODDS }, }; diff --git a/tests/integration/parlayGrade.test.js b/tests/integration/parlayGrade.test.js new file mode 100644 index 0000000..89e276e --- /dev/null +++ b/tests/integration/parlayGrade.test.js @@ -0,0 +1,27 @@ +// Session 50 — POST /api/parlay/grade (the Parlay Lab endpoint). + +const request = require('supertest'); +const app = require('../../src/app'); + +const legs = (n) => Array.from({ length: n }, (_, i) => ({ player: `P${i}`, team: i % 2 ? 'BOS' : 'NYY', game: 'NYY@BOS', stat: 'hits', line: 1.5, grade: i % 2 ? 'B+' : 'A' })); + +describe('POST /api/parlay/grade', () => { + it('returns combined grade + correlation + payout for a valid parlay', async () => { + const res = await request(app).post('/api/parlay/grade').send({ legs: legs(3), betAmount: 10 }); + expect(res.status).toBe(200); + expect(res.body.combined.grade).toBeTruthy(); + expect(typeof res.body.correlation.avg).toBe('number'); + expect(res.body.payout.amount).toBeGreaterThan(0); + expect(res.body.legs).toHaveLength(3); + }); + + it('handles 2 and 6 legs', async () => { + expect((await request(app).post('/api/parlay/grade').send({ legs: legs(2) })).status).toBe(200); + expect((await request(app).post('/api/parlay/grade').send({ legs: legs(6) })).status).toBe(200); + }); + + it('rejects < 2 or > 6 legs (400)', async () => { + expect((await request(app).post('/api/parlay/grade').send({ legs: legs(1) })).status).toBe(400); + expect((await request(app).post('/api/parlay/grade').send({ legs: legs(7) })).status).toBe(400); + }); +}); diff --git a/tests/unit/parlayCorrelation.test.js b/tests/unit/parlayCorrelation.test.js new file mode 100644 index 0000000..07743a5 --- /dev/null +++ b/tests/unit/parlayCorrelation.test.js @@ -0,0 +1,85 @@ +// Session 50 — Parlay Lab correlation-score model. + +const svc = require('../../src/services/parlayService'); + +const leg = (over) => ({ player: 'P', team: 'NYY', game: 'NYY@BOS', stat: 'hits', grade: 'A', ...over }); + +describe('correlationScore', () => { + it('same player, same game → 0.7', () => { + expect(svc.correlationScore(leg({ stat: 'hits' }), leg({ stat: 'total_bases' }))).toBe(0.7); + }); + it('same team, same game, different players → 0.4', () => { + expect(svc.correlationScore(leg({ player: 'A' }), leg({ player: 'B' }))).toBe(0.4); + }); + it('same game, different teams → 0.2', () => { + expect(svc.correlationScore(leg({ player: 'A', team: 'NYY' }), leg({ player: 'B', team: 'BOS' }))).toBe(0.2); + }); + it('different games → 0.0', () => { + expect(svc.correlationScore(leg({ game: 'NYY@BOS' }), leg({ game: 'LAD@SF', player: 'B', team: 'LAD' }))).toBe(0); + }); +}); + +describe('combinedGrade', () => { + it('3 independent A legs → A (no penalty)', () => { + const r = svc.combinedGrade([ + { grade: 'A', game: 'g1', team: 't1', player: 'a' }, + { grade: 'A', game: 'g2', team: 't2', player: 'b' }, + { grade: 'A', game: 'g3', team: 't3', player: 'c' }, + ]); + expect(r.grade).toBe('A'); + expect(r.penalty).toBe(0); + }); + it('3 same-team same-game A legs → penalized below A', () => { + const r = svc.combinedGrade([ + { grade: 'A', game: 'g1', team: 'NYY', player: 'a' }, + { grade: 'A', game: 'g1', team: 'NYY', player: 'b' }, + { grade: 'A', game: 'g1', team: 'NYY', player: 'c' }, + ]); + expect(r.avgCorrelation).toBe(0.4); + expect(r.penalty).toBeGreaterThan(0); + expect(['B+', 'B', 'B-', 'A-']).toContain(r.grade); + expect(svc.gradeScore(r.grade)).toBeLessThan(svc.gradeScore('A')); + }); +}); + +describe('estimatedPayout', () => { + it('returns multiplier + discount for a 3-leg parlay', () => { + const r = svc.estimatedPayout([{ grade: 'A' }, { grade: 'B+' }, { grade: 'A' }], 10); + expect(r.fairMultiplier).toBeCloseTo(1.25 * 1.45 * 1.25, 2); + expect(r.correlationDiscount).toBe(1); // independent + expect(r.payout).toBeGreaterThan(10); + }); + it('discounts correlated slips', () => { + const corr = svc.estimatedPayout([{ grade: 'A', game: 'g', team: 'NYY', player: 'a' }, { grade: 'A', game: 'g', team: 'NYY', player: 'b' }], 10); + expect(corr.correlationDiscount).toBeLessThan(1); + }); +}); + +describe('correlationWarning', () => { + it('flags 2+ legs from the same team', () => { + const w = svc.correlationWarning([ + { game: 'g', team: 'PHI', player: 'a' }, { game: 'g', team: 'PHI', player: 'b' }, { game: 'g2', team: 'NYY', player: 'c' }, + ]); + expect(w).toBe('⚠ 2 legs from PHI — high correlation'); + }); + it('flags same-game legs on different teams', () => { + expect(svc.correlationWarning([{ game: 'g', team: 'A', player: 'x' }, { game: 'g', team: 'B', player: 'y' }])) + .toBe('⚠ 2 legs from the same game — correlated'); + }); + it('null when all legs are independent', () => { + expect(svc.correlationWarning([{ game: 'g1', team: 'A', player: 'x' }, { game: 'g2', team: 'B', player: 'y' }])).toBeNull(); + }); +}); + +describe('gradeParlay (full analysis)', () => { + it('returns combined + correlation + payout + legs', () => { + const r = svc.gradeParlay([ + { grade: 'A', game: 'g', team: 'NYY', player: 'a', stat: 'hits', line: 1.5 }, + { grade: 'B+', game: 'g', team: 'NYY', player: 'b', stat: 'tb', line: 1.5 }, + ], 10); + expect(r.combined.grade).toBeTruthy(); + expect(r.correlation.warning).toContain('NYY'); + expect(r.payout.amount).toBeGreaterThan(0); + expect(r.legs).toHaveLength(2); + }); +}); diff --git a/tests/unit/parlayLabUI.test.js b/tests/unit/parlayLabUI.test.js new file mode 100644 index 0000000..5f6dde7 --- /dev/null +++ b/tests/unit/parlayLabUI.test.js @@ -0,0 +1,96 @@ +// Session 50 — Parlay Lab UI: context behaviors + components (source-asserted, +// matching the repo's frontend test pattern) + legKey logic. + +const fs = require('fs'); +const path = require('path'); +const WEB = path.join(__dirname, '..', '..', 'web', 'src'); +const read = (rel) => fs.readFileSync(path.join(WEB, rel), 'utf8'); + +describe('ParlayContext (Session 50 extensions)', () => { + const src = read('contexts/ParlayContext.tsx'); + it('legs carry team/game/archetype for the correlation model', () => { + expect(src).toContain('team?: string;'); + expect(src).toContain('game?: string;'); + expect(src).toContain('archetype?: string;'); + }); + it('addLeg dedupes by player|stat|line|direction and caps at maxLegs', () => { + expect(src).toContain('legKey'); + expect(src).toContain('prev.length >= maxLegsRef.current'); + }); + it('auto-grades via /api/parlay/grade when legs >= 2', () => { + expect(src).toContain("fetch('/api/parlay/grade'"); + expect(src).toContain('if (legs.length < 2)'); + expect(src).toContain('setCombined'); + }); + it('exposes combined/correlation/payout + tier cap', () => { + for (const k of ['combined', 'correlation', 'payout', 'maxLegs', 'setMaxLegs', 'atCap', 'hasLeg']) { + expect(src).toContain(k); + } + }); + it('removeLeg + clear reset state', () => { + expect(src).toContain('const removeLeg'); + expect(src).toContain('const clear = useCallback(() => setLegs([])'); + }); +}); + +describe('StatStrip "+" button', () => { + const src = read('components/vyndr/StatStrip.tsx'); + it('renders an add/remove parlay button on graded props', () => { + expect(src).toContain('onAddLeg'); + expect(src).toContain('isLegActive'); + expect(src).toContain(''); + expect(src).toContain("active ? '✓' : '+'"); + }); +}); + +describe('GameCard wires the "+" to the parlay', () => { + const src = read('components/vyndr/GameCard.tsx'); + it('uses useParlay and builds a leg with team + game', () => { + expect(src).toContain('useParlay'); + expect(src).toContain('stripHandlers'); + expect(src).toContain('game: gameId'); + }); + it('toggles the leg (add if absent, remove if present)', () => { + expect(src).toContain('if (existing) removeLeg(existing.id); else addLeg(leg);'); + }); +}); + +describe('GradeResultCard add-to-parlay (scan page)', () => { + it('GradeResultCard has the Add to Parlay action', () => { + expect(read('components/vyndr/GradeResultCard.tsx')).toContain('Add to Parlay'); + }); + it('scan page wires onAddToParlay → addLeg', () => { + const src = read('app/scan/page.tsx'); + expect(src).toContain('onAddToParlay'); + expect(src).toContain('addLeg('); + }); +}); + +describe('ParlayPanel', () => { + const src = read('components/vyndr/ParlayPanel.tsx'); + it('renders legs (player + grade), combined grade, correlation warning, payout', () => { + expect(src).toContain('PARLAY LAB'); + expect(src).toContain('COMBINED GRADE'); + expect(src).toContain('correlation?.warning'); + expect(src).toContain('EST. PAYOUT'); + }); + it('floating badge with leg count when closed', () => { + expect(src).toContain('Open Parlay Lab'); + expect(src).toContain('{legs.length}'); + }); + it('tier-gates: free blurs payout + caps at 2, desk/analyst full', () => { + expect(src).toContain('TIER_MAX = { free: 2, analyst: 4, desk: 6 }'); + expect(src).toContain("filter: 'blur(6px)'"); + expect(src).toContain('__goPaywall'); + expect(src).toContain('setMaxLegs(tierMaxLegs'); + }); + it('CLEAR ALL resets the slip', () => { + expect(src).toContain('CLEAR ALL'); + expect(src).toContain('onClick={clear}'); + }); + it('is mounted globally in the layout', () => { + const layout = read('app/layout.tsx'); + expect(layout).toContain(''); + expect(layout).not.toContain(''); + }); +}); diff --git a/web/public/sw.js b/web/public/sw.js index d53ce93..93c25be 100644 --- a/web/public/sw.js +++ b/web/public/sw.js @@ -1,2 +1,2 @@ (()=>{"use strict";let e,t,a,s,r,i={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"serwist",runtime:"runtime",suffix:"u">typeof registration?registration.scope:""},n=e=>[i.prefix,e,i.suffix].filter(e=>e&&e.length>0).join("-"),c=e=>e||n(i.precache),o=e=>e||n(i.runtime);var l=class extends Error{details;constructor(e,t){super(((e,...t)=>{let a=e;return t.length>0&&(a+=` :: ${JSON.stringify(t)}`),a})(e,t)),this.name=e,this.details=t}};function h(e){return new Promise(t=>setTimeout(t,e))}let u=new Set;function d(e,t){let a=new URL(e);for(let e of t)a.searchParams.delete(e);return a.href}async function f(e,t,a,s){let r=d(t.url,a);if(t.url===r)return e.match(t,s);let i={...s,ignoreSearch:!0};for(let n of(await e.keys(t,i)))if(r===d(n.url,a))return e.match(n,s)}var p=class{promise;resolve;reject;constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};let m=async()=>{for(let e of u)await e()},w="-precache-",g=async(e,t=w)=>{let a=(await self.caches.keys()).filter(a=>a.includes(t)&&a.includes(self.registration.scope)&&a!==e);return await Promise.all(a.map(e=>self.caches.delete(e))),a},y=(e,t)=>{let a=t();return e.waitUntil(a),a},_=(e,t)=>t.some(t=>e instanceof t),b=new WeakMap,v=new WeakMap,R=new WeakMap,E={get(e,t,a){if(e instanceof IDBTransaction){if("done"===t)return b.get(e);if("store"===t)return a.objectStoreNames[1]?void 0:a.objectStore(a.objectStoreNames[0])}return q(e[t])},set:(e,t,a)=>(e[t]=a,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function q(e){if(e instanceof IDBRequest){let t;return t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("success",r),e.removeEventListener("error",i)},r=()=>{t(q(e.result)),s()},i=()=>{a(e.error),s()};e.addEventListener("success",r),e.addEventListener("error",i)}),R.set(t,e),t}if(v.has(e))return v.get(e);let t=function(e){if("function"==typeof e)return(r||(r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(x(this),t),q(this.request)}:function(...t){return q(e.apply(x(this),t))};return(e instanceof IDBTransaction&&function(e){if(b.has(e))return;let t=new Promise((t,a)=>{let s=()=>{e.removeEventListener("complete",r),e.removeEventListener("error",i),e.removeEventListener("abort",i)},r=()=>{t(),s()},i=()=>{a(e.error||new DOMException("AbortError","AbortError")),s()};e.addEventListener("complete",r),e.addEventListener("error",i),e.addEventListener("abort",i)});b.set(e,t)}(e),_(e,s||(s=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(e,E):e}(e);return t!==e&&(v.set(e,t),R.set(t,e)),t}let x=e=>R.get(e);function D(e,t,{blocked:a,upgrade:s,blocking:r,terminated:i}={}){let n=indexedDB.open(e,t),c=q(n);return s&&n.addEventListener("upgradeneeded",e=>{s(q(n.result),e.oldVersion,e.newVersion,q(n.transaction),e)}),a&&n.addEventListener("blocked",e=>a(e.oldVersion,e.newVersion,e)),c.then(e=>{i&&e.addEventListener("close",()=>i()),r&&e.addEventListener("versionchange",e=>r(e.oldVersion,e.newVersion,e))}).catch(()=>{}),c}let S=["get","getKey","getAll","getAllKeys","count"],k=["put","add","delete","clear"],T=new Map;function P(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(T.get(t))return T.get(t);let a=t.replace(/FromIndex$/,""),s=t!==a,r=k.includes(a);if(!(a in(s?IDBIndex:IDBObjectStore).prototype)||!(r||S.includes(a)))return;let i=async function(e,...t){let i=this.transaction(e,r?"readwrite":"readonly"),n=i.store;return s&&(n=n.index(t.shift())),(await Promise.all([n[a](...t),r&&i.done]))[0]};return T.set(t,i),i}E={...e=E,get:(t,a,s)=>P(t,a)||e.get(t,a,s),has:(t,a)=>!!P(t,a)||e.has(t,a)};let C=["continue","continuePrimaryKey","advance"],N={},I=new WeakMap,U=new WeakMap,L={get(e,t){if(!C.includes(t))return e[t];let a=N[t];return a||(a=N[t]=function(...e){I.set(this,U.get(this)[t](...e))}),a}};async function*A(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let a=new Proxy(t,L);for(U.set(a,t),R.set(a,x(t));t;)yield a,t=await (I.get(a)||t.continue()),I.delete(a)}function O(e,t){return t===Symbol.asyncIterator&&_(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&_(e,[IDBIndex,IDBObjectStore])}E={...t=E,get:(e,a,s)=>O(e,a)?A:t.get(e,a,s),has:(e,a)=>O(e,a)||t.has(e,a)};let M=async(e,t)=>{let s=null;if(e.url&&(s=new URL(e.url).origin),s!==self.location.origin)throw new l("cross-origin-copy-response",{origin:s});let r=e.clone(),i={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},n=t?t(i):i,c=!function(){if(void 0===a){let e=new Response("");if("body"in e)try{new Response(e.body),a=!0}catch{a=!1}a=!1}return a}()?await r.blob():r.body;return new Response(c,n)},B="requests",K="queueName";var F=class{_db=null;async addEntry(e){let t=(await this.getDb()).transaction(B,"readwrite",{durability:"relaxed"});await t.store.add(e),await t.done}async getFirstEntryId(){return(await (await this.getDb()).transaction(B).store.openCursor())?.value.id}async getAllEntriesByQueueName(e){return await (await this.getDb()).getAllFromIndex(B,K,IDBKeyRange.only(e))||[]}async getEntryCountByQueueName(e){return(await this.getDb()).countFromIndex(B,K,IDBKeyRange.only(e))}async deleteEntry(e){await (await this.getDb()).delete(B,e)}async getFirstEntryByQueueName(e){return await this.getEndEntryFromIndex(IDBKeyRange.only(e),"next")}async getLastEntryByQueueName(e){return await this.getEndEntryFromIndex(IDBKeyRange.only(e),"prev")}async getEndEntryFromIndex(e,t){return(await (await this.getDb()).transaction(B).store.index(K).openCursor(e,t))?.value}async getDb(){return this._db||(this._db=await D("serwist-background-sync",3,{upgrade:this._upgradeDb})),this._db}_upgradeDb(e,t){t>0&&t<3&&e.objectStoreNames.contains(B)&&e.deleteObjectStore(B),e.createObjectStore(B,{autoIncrement:!0,keyPath:"id"}).createIndex(K,K,{unique:!1})}},W=class{_queueName;_queueDb;constructor(e){this._queueName=e,this._queueDb=new F}async pushEntry(e){delete e.id,e.queueName=this._queueName,await this._queueDb.addEntry(e)}async unshiftEntry(e){let t=await this._queueDb.getFirstEntryId();t?e.id=t-1:delete e.id,e.queueName=this._queueName,await this._queueDb.addEntry(e)}async popEntry(){return this._removeEntry(await this._queueDb.getLastEntryByQueueName(this._queueName))}async shiftEntry(){return this._removeEntry(await this._queueDb.getFirstEntryByQueueName(this._queueName))}async getAll(){return await this._queueDb.getAllEntriesByQueueName(this._queueName)}async size(){return await this._queueDb.getEntryCountByQueueName(this._queueName)}async deleteEntry(e){await this._queueDb.deleteEntry(e)}async _removeEntry(e){return e&&await this.deleteEntry(e.id),e}};let j=["method","referrer","referrerPolicy","mode","credentials","cache","redirect","integrity","keepalive"];var H=class e{_requestData;static async fromRequest(t){let a={url:t.url,headers:{}};for(let e of("GET"!==t.method&&(a.body=await t.clone().arrayBuffer()),t.headers.forEach((e,t)=>{a.headers[t]=e}),j))void 0!==t[e]&&(a[e]=t[e]);return new e(a)}constructor(e){"navigate"===e.mode&&(e.mode="same-origin"),this._requestData=e}toObject(){let e=Object.assign({},this._requestData);return e.headers=Object.assign({},this._requestData.headers),e.body&&(e.body=e.body.slice(0)),e}toRequest(){return new Request(this._requestData.url,this._requestData)}clone(){return new e(this.toObject())}};let $="serwist-background-sync",V=new Set,Q=e=>{let t={request:new H(e.requestData).toRequest(),timestamp:e.timestamp};return e.metadata&&(t.metadata=e.metadata),t};var G=class{_name;_onSync;_maxRetentionTime;_queueStore;_forceSyncFallback;_syncInProgress=!1;_requestsAddedDuringSync=!1;constructor(e,{forceSyncFallback:t,onSync:a,maxRetentionTime:s}={}){if(V.has(e))throw new l("duplicate-queue-name",{name:e});V.add(e),this._name=e,this._onSync=a||this.replayRequests,this._maxRetentionTime=s||10080,this._forceSyncFallback=!!t,this._queueStore=new W(this._name),this._addSyncListener()}get name(){return this._name}async pushRequest(e){await this._addRequest(e,"push")}async unshiftRequest(e){await this._addRequest(e,"unshift")}async popRequest(){return this._removeRequest("pop")}async shiftRequest(){return this._removeRequest("shift")}async getAll(){let e=await this._queueStore.getAll(),t=Date.now(),a=[];for(let s of e){let e=60*this._maxRetentionTime*1e3;t-s.timestamp>e?await this._queueStore.deleteEntry(s.id):a.push(Q(s))}return a}async size(){return await this._queueStore.size()}async _addRequest({request:e,metadata:t,timestamp:a=Date.now()},s){let r={requestData:(await H.fromRequest(e.clone())).toObject(),timestamp:a};switch(t&&(r.metadata=t),s){case"push":await this._queueStore.pushEntry(r);break;case"unshift":await this._queueStore.unshiftEntry(r)}this._syncInProgress?this._requestsAddedDuringSync=!0:await this.registerSync()}async _removeRequest(e){let t,a=Date.now();switch(e){case"pop":t=await this._queueStore.popEntry();break;case"shift":t=await this._queueStore.shiftEntry()}if(t){let s=60*this._maxRetentionTime*1e3;return a-t.timestamp>s?this._removeRequest(e):Q(t)}}async replayRequests(){let e;for(;e=await this.shiftRequest();)try{await fetch(e.request.clone())}catch{throw await this.unshiftRequest(e),new l("queue-replay-failed",{name:this._name})}}async registerSync(){if("sync"in self.registration&&!this._forceSyncFallback)try{await self.registration.sync.register(`${$}:${this._name}`)}catch(e){}}_addSyncListener(){"sync"in self.registration&&!this._forceSyncFallback?self.addEventListener("sync",e=>{if(e.tag===`${$}:${this._name}`){let t=async()=>{let t;this._syncInProgress=!0;try{await this._onSync({queue:this})}catch(e){if(e instanceof Error)throw e}finally{this._requestsAddedDuringSync&&!(t&&!e.lastChance)&&await this.registerSync(),this._syncInProgress=!1,this._requestsAddedDuringSync=!1}};e.waitUntil(t())}}):this._onSync({queue:this})}static get _queueNames(){return V}},z=class{_queue;constructor(e,t){this._queue=new G(e,t)}async fetchDidFail({request:e}){await this._queue.pushRequest({request:e})}};let Y={cacheWillUpdate:async({response:e})=>200===e.status||0===e.status?e:null};function J(e){return"string"==typeof e?new Request(e):e}var X=class{event;request;url;params;_cacheKeys={};_strategy;_handlerDeferred;_extendLifetimePromises;_plugins;_pluginStateMap;constructor(e,t){for(const a of(this.event=t.event,this.request=t.request,t.url&&(this.url=t.url,this.params=t.params),this._strategy=e,this._handlerDeferred=new p,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map,this._plugins))this._pluginStateMap.set(a,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){let{event:t}=this,a=J(e),s=await this.getPreloadResponse();if(s)return s;let r=this.hasCallback("fetchDidFail")?a.clone():null;try{for(let e of this.iterateCallbacks("requestWillFetch"))a=await e({request:a.clone(),event:t})}catch(e){if(e instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:e.message})}let i=a.clone();try{let e;for(let s of(e=await fetch(a,"navigate"===a.mode?void 0:this._strategy.fetchOptions),this.iterateCallbacks("fetchDidSucceed")))e=await s({event:t,request:i,response:e});return e}catch(e){throw r&&await this.runCallbacks("fetchDidFail",{error:e,event:t,originalRequest:r.clone(),request:i.clone()}),e}}async fetchAndCachePut(e){let t=await this.fetch(e),a=t.clone();return this.waitUntil(this.cachePut(e,a)),t}async cacheMatch(e){let t,a=J(e),{cacheName:s,matchOptions:r}=this._strategy,i=await this.getCacheKey(a,"read"),n={...r,cacheName:s};for(let e of(t=await caches.match(i,n),this.iterateCallbacks("cachedResponseWillBeUsed")))t=await e({cacheName:s,matchOptions:r,cachedResponse:t,request:i,event:this.event})||void 0;return t}async cachePut(e,t){let a=J(e);await h(0);let s=await this.getCacheKey(a,"write");if(!t)throw new l("cache-put-with-no-response",{url:new URL(String(s.url),location.href).href.replace(RegExp(`^${location.origin}`),"")});let r=await this._ensureResponseSafeToCache(t);if(!r)return!1;let{cacheName:i,matchOptions:n}=this._strategy,c=await self.caches.open(i),o=this.hasCallback("cacheDidUpdate"),u=o?await f(c,s.clone(),["__WB_REVISION__"],n):null;try{await c.put(s,o?r.clone():r)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&await m(),e}for(let e of this.iterateCallbacks("cacheDidUpdate"))await e({cacheName:i,oldResponse:u,newResponse:r.clone(),request:s,event:this.event});return!0}async getCacheKey(e,t){let a=`${e.url} | ${t}`;if(!this._cacheKeys[a]){let s=e;for(let e of this.iterateCallbacks("cacheKeyWillBeUsed"))s=J(await e({mode:t,request:s,event:this.event,params:this.params}));this._cacheKeys[a]=s}return this._cacheKeys[a]}hasCallback(e){for(let t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(let a of this.iterateCallbacks(e))await a(t)}*iterateCallbacks(e){for(let t of this._strategy.plugins)if("function"==typeof t[e]){let a=this._pluginStateMap.get(t),s=s=>{let r={...s,state:a};return t[e](r)};yield s}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async getPreloadResponse(){if(this.event instanceof FetchEvent&&"navigate"===this.event.request.mode&&"preloadResponse"in this.event)try{let e=await this.event.preloadResponse;if(e)return e}catch(e){return}}async _ensureResponseSafeToCache(e){let t=e,a=!1;for(let e of this.iterateCallbacks("cacheWillUpdate"))if(t=await e({request:this.request,response:t,event:this.event})||void 0,a=!0,!t)break;return!a&&t&&200!==t.status&&(t=void 0),t}},Z=class{cacheName;plugins;fetchOptions;matchOptions;constructor(e={}){this.cacheName=o(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){let[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});let t=e.event,a="string"==typeof e.request?new Request(e.request):e.request,s=new X(this,e.url?{event:t,request:a,url:e.url,params:e.params}:{event:t,request:a}),r=this._getResponse(s,a,t);return[r,this._awaitComplete(r,s,a,t)]}async _getResponse(e,t,a){let s;await e.runCallbacks("handlerWillStart",{event:a,request:t});try{if(s=await this._handle(t,e),void 0===s||"error"===s.type)throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(let i of e.iterateCallbacks("handlerDidError"))if(void 0!==(s=await i({error:r,event:a,request:t})))break}if(!s)throw r}for(let r of e.iterateCallbacks("handlerWillRespond"))s=await r({event:a,request:t,response:s});return s}async _awaitComplete(e,t,a,s){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:s,request:a,response:r}),await t.doneWaiting()}catch(e){e instanceof Error&&(i=e)}if(await t.runCallbacks("handlerDidComplete",{event:s,request:a,response:r,error:i}),t.destroy(),i)throw i}},ee=class extends Z{_networkTimeoutSeconds;constructor(e={}){super(e),this.plugins.some(e=>"cacheWillUpdate"in e)||this.plugins.unshift(Y),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,t){let a,s=[],r=[];if(this._networkTimeoutSeconds){let{id:i,promise:n}=this._getTimeoutPromise({request:e,logs:s,handler:t});a=i,r.push(n)}let i=this._getNetworkPromise({timeoutId:a,request:e,logs:s,handler:t});r.push(i);let n=await t.waitUntil((async()=>await t.waitUntil(Promise.race(r))||await i)());if(!n)throw new l("no-response",{url:e.url});return n}_getTimeoutPromise({request:e,logs:t,handler:a}){let s;return{promise:new Promise(t=>{s=setTimeout(async()=>{t(await a.cacheMatch(e))},1e3*this._networkTimeoutSeconds)}),id:s}}async _getNetworkPromise({timeoutId:e,request:t,logs:a,handler:s}){let r,i;try{i=await s.fetchAndCachePut(t)}catch(e){e instanceof Error&&(r=e)}return e&&clearTimeout(e),(r||!i)&&(i=await s.cacheMatch(t)),i}},et=class extends Z{_networkTimeoutSeconds;constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}async _handle(e,t){let a,s;try{let a=[t.fetch(e)];if(this._networkTimeoutSeconds){let e=h(1e3*this._networkTimeoutSeconds);a.push(e)}if(!(s=await Promise.race(a)))throw Error(`Timed out the network response after ${this._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(a=e)}if(!s)throw new l("no-response",{url:e.url,error:a});return s}};let ea=e=>e&&"object"==typeof e?e:{handle:e};var es=class{handler;match;method;catchHandler;constructor(e,t,a="GET"){this.handler=ea(t),this.match=e,this.method=a}setCatchHandler(e){this.catchHandler=ea(e)}},er=class e extends Z{_fallbackToNetwork;static defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:e})=>!e||e.status>=400?null:e};static copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:e})=>e.redirected?await M(e):e};constructor(t={}){t.cacheName=c(t.cacheName),super(t),this._fallbackToNetwork=!1!==t.fallbackToNetwork,this.plugins.push(e.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){let a=await t.getPreloadResponse();if(a)return a;let s=await t.cacheMatch(e);return s||(t.event&&"install"===t.event.type?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let a,s=t.params||{};if(this._fallbackToNetwork){let r=s.integrity,i=e.integrity,n=!i||i===r;a=await t.fetch(new Request(e,{integrity:"no-cors"!==e.mode?i||r:void 0})),r&&n&&"no-cors"!==e.mode&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,a.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return a}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();let a=await t.fetch(e);if(!await t.cachePut(e,a.clone()))throw new l("bad-precaching-response",{url:e.url,status:a.status});return a}_useDefaultCacheabilityPluginIfNeeded(){let t=null,a=0;for(let[s,r]of this.plugins.entries())r!==e.copyRedirectedCacheableResponsesPlugin&&(r===e.defaultPrecacheCacheabilityPlugin&&(t=s),r.cacheWillUpdate&&a++);0===a?this.plugins.push(e.defaultPrecacheCacheabilityPlugin):a>1&&null!==t&&this.plugins.splice(t,1)}},ei=class extends es{_allowlist;_denylist;constructor(e,{allowlist:t=[/./],denylist:a=[]}={}){super(e=>this._match(e),e),this._allowlist=t,this._denylist=a}_match({url:e,request:t}){if(t&&"navigate"!==t.mode)return!1;let a=e.pathname+e.search;for(let e of this._denylist)if(e.test(a))return!1;return!!this._allowlist.some(e=>e.test(a))}},en=class extends es{constructor(e,t,a){super(({url:t})=>{let a=e.exec(t.href);if(a)return t.origin!==location.origin&&0!==a.index?void 0:a.slice(1)},t,a)}};let ec=e=>{if(!e)throw new l("add-to-cache-list-unexpected-type",{entry:e});if("string"==typeof e){let t=new URL(e,location.href);return{cacheKey:t.href,url:t.href}}let{revision:t,url:a}=e;if(!a)throw new l("add-to-cache-list-unexpected-type",{entry:e});if(!t){let e=new URL(a,location.href);return{cacheKey:e.href,url:e.href}}let s=new URL(a,location.href),r=new URL(a,location.href);return s.searchParams.set("__WB_REVISION__",t),{cacheKey:s.href,url:r.href}};var eo=class{updatedURLs=[];notUpdatedURLs=[];handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)};cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:a})=>{if("install"===e.type&&t?.originalRequest&&t.originalRequest instanceof Request){let e=t.originalRequest.url;a?this.notUpdatedURLs.push(e):this.updatedURLs.push(e)}return a}};let el=async(e,t,a)=>{let s=t.map((e,t)=>({index:t,item:e})),r=async e=>{let t=[];for(;;){let r=s.pop();if(!r)return e(t);let i=await a(r.item);t.push({result:i,index:r.index})}},i=Array.from({length:e},()=>new Promise(r));return(await Promise.all(i)).flat().sort((e,t)=>e.indexe.result)};"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);let eh="cache-entries",eu=e=>{let t=new URL(e,location.href);return t.hash="",t.href};var ed=class{_cacheName;_db=null;constructor(e){this._cacheName=e}_getId(e){return`${this._cacheName}|${eu(e)}`}_upgradeDb(e){let t=e.createObjectStore(eh,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&function(e,{blocked:t}={}){let a=indexedDB.deleteDatabase(e);t&&a.addEventListener("blocked",e=>t(e.oldVersion,e)),q(a).then(()=>void 0)}(this._cacheName)}async setTimestamp(e,t){e=eu(e);let a={id:this._getId(e),cacheName:this._cacheName,url:e,timestamp:t},s=(await this.getDb()).transaction(eh,"readwrite",{durability:"relaxed"});await s.store.put(a),await s.done}async getTimestamp(e){return(await (await this.getDb()).get(eh,this._getId(e)))?.timestamp}async expireEntries(e,t){let a=await (await this.getDb()).transaction(eh,"readwrite").store.index("timestamp").openCursor(null,"prev"),s=[],r=0;for(;a;){let i=a.value;i.cacheName===this._cacheName&&(e&&i.timestamp=t?(a.delete(),s.push(i.url)):r++),a=await a.continue()}return s}async getDb(){return this._db||(this._db=await D("serwist-expiration",1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}},ef=class{_isRunning=!1;_rerunRequested=!1;_maxEntries;_maxAgeSeconds;_matchOptions;_cacheName;_timestampModel;constructor(e,t={}){this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new ed(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;let e=this._maxAgeSeconds?Date.now()-1e3*this._maxAgeSeconds:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),a=await self.caches.open(this._cacheName);for(let e of t)await a.delete(e,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,this.expireEntries())}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(!this._maxAgeSeconds)return!1;let t=await this._timestampModel.getTimestamp(e),a=Date.now()-1e3*this._maxAgeSeconds;return void 0===t||t{u.add(e)})(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===o())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new ef(e,this._config),this._cacheExpirations.set(e,t)),t}cachedResponseWillBeUsed({event:e,cacheName:t,request:a,cachedResponse:s}){if(!s)return null;let r=this._isResponseDateFresh(s),i=this._getCacheExpiration(t),n="last-used"===this._config.maxAgeFrom,c=(async()=>{n&&await i.updateTimestamp(a.url),await i.expireEntries()})();try{e.waitUntil(c)}catch{}return r?s:null}_isResponseDateFresh(e){if("last-used"===this._config.maxAgeFrom)return!0;let t=Date.now();if(!this._config.maxAgeSeconds)return!0;let a=this._getDateHeaderTimestamp(e);return null===a||a>=t-1e3*this._config.maxAgeSeconds}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;let t=new Date(e.headers.get("date")).getTime();return Number.isNaN(t)?null:t}async cacheDidUpdate({cacheName:e,request:t}){let a=this._getCacheExpiration(e);await a.updateTimestamp(t.url),await a.expireEntries()}async deleteCacheAndMetadata(){for(let[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}};let em=/^\/(\w+\/)?collect/,ew=({serwist:e,cacheName:t,...a})=>{let s,r,c=t||n(i.googleAnalytics),o=new z("serwist-google-analytics",{maxRetentionTime:2880,onSync:async({queue:e})=>{let t;for(;t=await e.shiftRequest();){let{request:s,timestamp:r}=t,i=new URL(s.url);try{let e="POST"===s.method?new URLSearchParams(await s.clone().text()):i.searchParams,t=r-(Number(e.get("qt"))||0),n=Date.now()-t;if(e.set("qt",String(n)),a.parameterOverrides)for(let t of Object.keys(a.parameterOverrides)){let s=a.parameterOverrides[t];e.set(t,s)}"function"==typeof a.hitFilter&&a.hitFilter.call(null,e),await fetch(new Request(i.origin+i.pathname,{body:e.toString(),method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"text/plain"}}))}catch(a){throw await e.unshiftRequest(t),a}}}});for(let t of[new es(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtm.js"===e.pathname,new ee({cacheName:c}),"GET"),new es(({url:e})=>"www.google-analytics.com"===e.hostname&&"/analytics.js"===e.pathname,new ee({cacheName:c}),"GET"),new es(({url:e})=>"www.googletagmanager.com"===e.hostname&&"/gtag/js"===e.pathname,new ee({cacheName:c}),"GET"),new es(s=({url:e})=>"www.google-analytics.com"===e.hostname&&em.test(e.pathname),r=new et({plugins:[o]}),"GET"),new es(s,r,"POST")])e.registerRoute(t)};var eg=class{_fallbackUrls;_serwist;constructor({fallbackUrls:e,serwist:t}){this._fallbackUrls=e,this._serwist=t}async handlerDidError(e){for(let t of this._fallbackUrls)if("string"==typeof t){let e=await this._serwist.matchPrecache(t);if(void 0!==e)return e}else if(t.matcher(e)){let e=await this._serwist.matchPrecache(t.url);if(void 0!==e)return e}}},ey=class extends Z{async _handle(e,t){let a,s=await t.cacheMatch(e);if(s);else try{s=await t.fetchAndCachePut(e)}catch(e){e instanceof Error&&(a=e)}if(!s)throw new l("no-response",{url:e.url,error:a});return s}},e_=class extends es{constructor(e,t){super(({request:a})=>{let s=e.getUrlsToPrecacheKeys();for(let r of function*(e,{directoryIndex:t="index.html",ignoreURLParametersMatching:a=[/^utm_/,/^fbclid$/],cleanURLs:s=!0,urlManipulation:r}={}){let i=new URL(e,location.href);i.hash="",yield i.href;let n=((e,t=[])=>{for(let a of[...e.searchParams.keys()])t.some(e=>e.test(a))&&e.searchParams.delete(a);return e})(i,a);if(yield n.href,t&&n.pathname.endsWith("/")){let e=new URL(n.href);e.pathname+=t,yield e.href}if(s){let e=new URL(n.href);e.pathname+=".html",yield e.href}if(r)for(let e of r({url:i}))yield e.href}(a.url,t)){let t=s.get(r);if(t)return{cacheKey:t,integrity:e.getIntegrityForPrecacheKey(t)}}},e.precacheStrategy)}},eb=class{_precacheController;constructor({precacheController:e}){this._precacheController=e}cacheKeyWillBeUsed=async({request:e,params:t})=>{let a=t?.cacheKey||this._precacheController.getPrecacheKeyForUrl(e.url);return a?new Request(a,{headers:e.headers}):e}},ev=class{_urlsToCacheKeys=new Map;_urlsToCacheModes=new Map;_cacheKeysToIntegrities=new Map;_concurrentPrecaching;_precacheStrategy;_routes;_defaultHandlerMap;_catchHandler;_requestRules;constructor({precacheEntries:e,precacheOptions:t,skipWaiting:a=!1,importScripts:s,navigationPreload:r=!1,cacheId:n,clientsClaim:o=!1,runtimeCaching:l,offlineAnalyticsConfig:h,disableDevLogs:u=!1,fallbacks:d,requestRules:f}={}){const{precacheStrategyOptions:p,precacheRouteOptions:m,precacheMiscOptions:w}=((e,t={})=>{let{cacheName:a,plugins:s=[],fetchOptions:r,matchOptions:i,fallbackToNetwork:n,directoryIndex:o,ignoreURLParametersMatching:l,cleanURLs:h,urlManipulation:u,cleanupOutdatedCaches:d,concurrency:f=10,navigateFallback:p,navigateFallbackAllowlist:m,navigateFallbackDenylist:w}=t??{};return{precacheStrategyOptions:{cacheName:c(a),plugins:[...s,new eb({precacheController:e})],fetchOptions:r,matchOptions:i,fallbackToNetwork:n},precacheRouteOptions:{directoryIndex:o,ignoreURLParametersMatching:l,cleanURLs:h,urlManipulation:u},precacheMiscOptions:{cleanupOutdatedCaches:d,concurrency:f,navigateFallback:p,navigateFallbackAllowlist:m,navigateFallbackDenylist:w}}})(this,t);if(this._concurrentPrecaching=w.concurrency,this._precacheStrategy=new er(p),this._routes=new Map,this._defaultHandlerMap=new Map,this._requestRules=f,this.handleInstall=this.handleInstall.bind(this),this.handleActivate=this.handleActivate.bind(this),this.handleFetch=this.handleFetch.bind(this),this.handleCache=this.handleCache.bind(this),s&&s.length>0&&self.importScripts(...s),r&&self.registration?.navigationPreload&&self.addEventListener("activate",e=>{e.waitUntil(self.registration.navigationPreload.enable().then(()=>{}))}),void 0!==n&&(e=>{var t=e;for(let e of Object.keys(i))(e=>{let a=t[e];"string"==typeof a&&(i[e]=a)})(e)})({prefix:n}),a?self.skipWaiting():self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),o&&self.addEventListener("activate",()=>self.clients.claim()),e&&e.length>0&&this.addToPrecacheList(e),w.cleanupOutdatedCaches&&(e=>{self.addEventListener("activate",t=>{t.waitUntil(g(c(e)).then(e=>{}))})})(p.cacheName),this.registerRoute(new e_(this,m)),w.navigateFallback&&this.registerRoute(new ei(this.createHandlerBoundToUrl(w.navigateFallback),{allowlist:w.navigateFallbackAllowlist,denylist:w.navigateFallbackDenylist})),void 0!==h&&("boolean"==typeof h?h&&ew({serwist:this}):ew({...h,serwist:this})),void 0!==l){if(void 0!==d){const e=new eg({fallbackUrls:d.entries,serwist:this});l.forEach(t=>{t.handler instanceof Z&&!t.handler.plugins.some(e=>"handlerDidError"in e)&&t.handler.plugins.push(e)})}for(const e of l)this.registerCapture(e.matcher,e.handler,e.method)}u&&(self.__WB_DISABLE_DEV_LOGS=!0)}get precacheStrategy(){return this._precacheStrategy}get routes(){return this._routes}addEventListeners(){self.addEventListener("install",this.handleInstall),self.addEventListener("activate",this.handleActivate),self.addEventListener("fetch",this.handleFetch),self.addEventListener("message",this.handleCache)}addToPrecacheList(e){let t=[];for(let a of e){"string"==typeof a?t.push(a):a&&!a.integrity&&void 0===a.revision&&t.push(a.url);let{cacheKey:e,url:s}=ec(a),r="string"!=typeof a&&a.revision?"reload":"default";if(this._urlsToCacheKeys.has(s)&&this._urlsToCacheKeys.get(s)!==e)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(s),secondEntry:e});if("string"!=typeof a&&a.integrity){if(this._cacheKeysToIntegrities.has(e)&&this._cacheKeysToIntegrities.get(e)!==a.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:s});this._cacheKeysToIntegrities.set(e,a.integrity)}this._urlsToCacheKeys.set(s,e),this._urlsToCacheModes.set(s,r)}t.length>0&&console.warn(`Serwist is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`)}handleInstall(e){return this.registerRequestRules(e),y(e,async()=>{let t=new eo;this.precacheStrategy.plugins.push(t),await el(this._concurrentPrecaching,Array.from(this._urlsToCacheKeys.entries()),async([t,a])=>{let s=this._cacheKeysToIntegrities.get(a),r=this._urlsToCacheModes.get(t),i=new Request(t,{integrity:s,cache:r,credentials:"same-origin"});await Promise.all(this.precacheStrategy.handleAll({event:e,request:i,url:new URL(i.url),params:{cacheKey:a}}))});let{updatedURLs:a,notUpdatedURLs:s}=t;return{updatedURLs:a,notUpdatedURLs:s}})}async registerRequestRules(e){if(this._requestRules&&e?.addRoutes)try{await e.addRoutes(this._requestRules),this._requestRules=void 0}catch(e){throw e}}handleActivate(e){return y(e,async()=>{let e=await self.caches.open(this.precacheStrategy.cacheName),t=await e.keys(),a=new Set(this._urlsToCacheKeys.values()),s=[];for(let r of t)a.has(r.url)||(await e.delete(r),s.push(r.url));return{deletedCacheRequests:s}})}handleFetch(e){let{request:t}=e,a=this.handleRequest({request:t,event:e});a&&e.respondWith(a)}handleCache(e){if(e.data&&"CACHE_URLS"===e.data.type){let{payload:t}=e.data,a=Promise.all(t.urlsToCache.map(t=>{let a;return a="string"==typeof t?new Request(t):new Request(...t),this.handleRequest({request:a,event:e})}));e.waitUntil(a),e.ports?.[0]&&a.then(()=>e.ports[0].postMessage(!0))}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,ea(e))}setCatchHandler(e){this._catchHandler=ea(e)}registerCapture(e,t,a){let s=((e,t,a)=>{if("string"==typeof e){let s=new URL(e,location.href);return new es(({url:e})=>e.href===s.href,t,a)}if(e instanceof RegExp)return new en(e,t,a);if("function"==typeof e)return new es(e,t,a);if(e instanceof es)return e;throw new l("unsupported-route-type",{moduleName:"serwist",funcName:"parseRoute",paramName:"capture"})})(e,t,a);return this.registerRoute(s),s}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});let t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}getUrlsToPrecacheKeys(){return this._urlsToCacheKeys}getPrecachedUrls(){return[...this._urlsToCacheKeys.keys()]}getPrecacheKeyForUrl(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForPrecacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,a=this.getPrecacheKeyForUrl(t);if(a)return(await self.caches.open(this.precacheStrategy.cacheName)).match(a)}createHandlerBoundToUrl(e){let t=this.getPrecacheKeyForUrl(e);if(!t)throw new l("non-precached-url",{url:e});return a=>(a.request=new Request(e),a.params={cacheKey:t,...a.params},this.precacheStrategy.handle(a))}handleRequest({request:e,event:t}){let a,s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;let r=s.origin===location.origin,{params:i,route:n}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:s}),c=n?.handler,o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;try{a=c.handle({url:s,request:e,event:t,params:i})}catch(e){a=Promise.reject(e)}let l=n?.catchHandler;return a instanceof Promise&&(this._catchHandler||l)&&(a=a.catch(async a=>{if(l)try{return await l.handle({url:s,request:e,event:t,params:i})}catch(e){e instanceof Error&&(a=e)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw a})),a}findMatchingRoute({url:e,sameOrigin:t,request:a,event:s}){for(let r of this._routes.get(a.method)||[]){let i,n=r.match({url:e,sameOrigin:t,request:a,event:s});if(n)return Array.isArray(i=n)&&0===i.length||n.constructor===Object&&0===Object.keys(n).length?i=void 0:"boolean"==typeof n&&(i=void 0),{route:r,params:i}}return{}}};let eR="/offline",eE=["pages","api-responses","next-static","static-media","fallback","offline-fallback"],eq=[{matcher:({url:e,sameOrigin:t})=>t&&e.pathname.startsWith("/api/"),handler:new ee({cacheName:"api-responses",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:100,maxAgeSeconds:3600})]})},{matcher:({request:e})=>"navigate"===e.mode,handler:new ee({cacheName:"pages",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:50,maxAgeSeconds:86400}),{handlerDidError:async()=>await caches.match(eR)||Response.error()}]})},{matcher:({url:e,sameOrigin:t})=>t&&e.pathname.startsWith("/_next/static/"),handler:new ey({cacheName:"next-static",plugins:[new ep({maxEntries:200,maxAgeSeconds:2592e3})]})},{matcher:({url:e})=>e.pathname.startsWith("/images/")||e.pathname.startsWith("/icons/")||/\.(?:png|jpe?g|gif|svg|webp|ico|woff2?)$/.test(e.pathname),handler:new ey({cacheName:"static-media",plugins:[new ep({maxEntries:100,maxAgeSeconds:2592e3})]})},{matcher:()=>!0,handler:new ee({cacheName:"fallback",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:50,maxAgeSeconds:86400})]})}];new ev({precacheEntries:[{'revision':null,'url':'/_next/static/chunks/1079-304a546a4a673437.js'},{'revision':null,'url':'/_next/static/chunks/1896-359ed2e68a8c4f1d.js'},{'revision':null,'url':'/_next/static/chunks/1958-56cbbb8dba15fd2f.js'},{'revision':null,'url':'/_next/static/chunks/2346-36e36720a5f6591a.js'},{'revision':null,'url':'/_next/static/chunks/3268-0a7190b483de059a.js'},{'revision':null,'url':'/_next/static/chunks/4bd1b696-e356ca5ba0218e27.js'},{'revision':null,'url':'/_next/static/chunks/52774a7f.f2ab7a9b4b8ba576.js'},{'revision':null,'url':'/_next/static/chunks/5562-360ea4729dc6dd70.js'},{'revision':null,'url':'/_next/static/chunks/5838-7e0aa455e9f24259.js'},{'revision':null,'url':'/_next/static/chunks/7363-209a1a709d8f324d.js'},{'revision':null,'url':'/_next/static/chunks/7602.2868ff821d53ee09.js'},{'revision':null,'url':'/_next/static/chunks/8078-0cb13480a43e9ef1.js'},{'revision':null,'url':'/_next/static/chunks/8500-f62a38ff68ab7f42.js'},{'revision':null,'url':'/_next/static/chunks/9da6db1e-9623f3245f088d02.js'},{'revision':null,'url':'/_next/static/chunks/app/_global-error/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/_not-found/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/about/page-fdb7d7bffef68ad1.js'},{'revision':null,'url':'/_next/static/chunks/app/account/page-9300f08c33aa8887.js'},{'revision':null,'url':'/_next/static/chunks/app/admin/page-b3b6af59ae9681bb.js'},{'revision':null,'url':'/_next/static/chunks/app/api/admin/stats/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/books/%5B...path%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/checkout/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/content/%5B...path%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/gamelines/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/props/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/tonight/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hero-prop/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hotlist/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/intelligence/feed/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/accuracy/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/lines/%5B...path%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/mlb/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/nba/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/soccer/%5Bleague%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/wnba/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/add-leg/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/calculate/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/grade/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/players/search/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/preferences/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/live/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/most-parlayed/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/top-graded/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/scan/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/pitchers/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/cascade/%5Bplayer%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/depth/%5Bteam%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/leaders/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/lineup/%5Bteam%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/parlays-graded/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/player/%5Bname%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/public/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/streaks/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ticker/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/profile/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/recent-scans/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scans/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/waitlist/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/webhook/nexapay/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/welcome-email/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/auth/callback/page-e6df9771a50edb87.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/%5Bslug%5D/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/compare/page-5e631b0c698c6f5f.js'},{'revision':null,'url':'/_next/static/chunks/app/dashboard/page-daad76d30ea02c3d.js'},{'revision':null,'url':'/_next/static/chunks/app/explore/page-8856c642532e2773.js'},{'revision':null,'url':'/_next/static/chunks/app/forgot-password/page-a251f52b4206e8d1.js'},{'revision':null,'url':'/_next/static/chunks/app/game/%5Bid%5D/page-ac9d9a479ea7ab89.js'},{'revision':null,'url':'/_next/static/chunks/app/help/page-03c6534f006d09da.js'},{'revision':null,'url':'/_next/static/chunks/app/intelligence/page-772d69c9ecfe1503.js'},{'revision':null,'url':'/_next/static/chunks/app/invite/page-e1e3f46af5f1e44b.js'},{'revision':null,'url':'/_next/static/chunks/app/layout-37c50fea6a11561a.js'},{'revision':null,'url':'/_next/static/chunks/app/ledger/page-47459e4f664b707a.js'},{'revision':null,'url':'/_next/static/chunks/app/login/page-541367415c6c9f89.js'},{'revision':null,'url':'/_next/static/chunks/app/marketplace/page-cbada49ae96a7527.js'},{'revision':null,'url':'/_next/static/chunks/app/not-found-898edc4d76c31251.js'},{'revision':null,'url':'/_next/static/chunks/app/notifications/page-fdb7d7bffef68ad1.js'},{'revision':null,'url':'/_next/static/chunks/app/offline/page-a7a57ff039afc1af.js'},{'revision':null,'url':'/_next/static/chunks/app/onboarding/page-3483923fb16d41ff.js'},{'revision':null,'url':'/_next/static/chunks/app/page-693f3a380221741a.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/page-a9a1a22752478255.js'},{'revision':null,'url':'/_next/static/chunks/app/pricing/page-2182e68653f4cedc.js'},{'revision':null,'url':'/_next/static/chunks/app/privacy/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/profile/page-d607627acb1b73ab.js'},{'revision':null,'url':'/_next/static/chunks/app/report/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/responsible-gambling/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/scan/page-b58c699857fc9860.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/page-eea60cdbf9380312.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/security/page-697d02aa2d05cf7e.js'},{'revision':null,'url':'/_next/static/chunks/app/signup/page-b6917fd30dbecebe.js'},{'revision':null,'url':'/_next/static/chunks/app/soccer/page-5a64e650908111d7.js'},{'revision':null,'url':'/_next/static/chunks/app/terminal/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/terms/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/tracker/page-e23baec2b3735bb1.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/cancel/page-3702e818a6853705.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/desk/page-24eaa80743986159.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/success/page-ea358cb8f714f1ea.js'},{'revision':null,'url':'/_next/static/chunks/app/verify/page-9df376f065215168.js'},{'revision':null,'url':'/_next/static/chunks/app/welcome/page-259277230533599f.js'},{'revision':null,'url':'/_next/static/chunks/framework-95da69ac6843d788.js'},{'revision':null,'url':'/_next/static/chunks/main-a354262253293123.js'},{'revision':null,'url':'/_next/static/chunks/main-app-4231d5f500f33972.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/app-error-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/forbidden-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/global-error-756d787dba63aa4d.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/unauthorized-2017baecb7226565.js'},{'revision':'846118c33b2c0e922d7b3a7676f81f6f','url':'/_next/static/chunks/polyfills-42372ed130431b0a.js'},{'revision':null,'url':'/_next/static/chunks/webpack-42b9616650231776.js'},{'revision':null,'url':'/_next/static/css/6ee3c69ef5f8952b.css'},{'revision':'cd34c7793d9776838308cfbe5d93922b','url':'/_next/static/media/011e180705008d6f-s.woff2'},{'revision':'324703f03c390d2e2a4f387de85fe63d','url':'/_next/static/media/0aa834ed78bf6d07-s.woff2'},{'revision':'9dda5cfc9a46f256d0e131bb535e46f8','url':'/_next/static/media/19cfc7226ec3afaa-s.woff2'},{'revision':'7de6d31e5076eb437418b6e01998ee12','url':'/_next/static/media/20535187d867b7b9-s.woff2'},{'revision':'4e2553027f1d60eff32898367dd4d541','url':'/_next/static/media/21350d82a1f187e9-s.woff2'},{'revision':'0d11e07b5aaafda6ae2efc53256932ec','url':'/_next/static/media/37786be940ec402b-s.p.woff2'},{'revision':'5de0bff80f9f432b5cf52c1c2f80fe20','url':'/_next/static/media/46e154b2fcbd6033-s.woff2'},{'revision':'6041b3192dc3e1a50141d5d418a24199','url':'/_next/static/media/5356a6a4f2c8c8d8-s.woff2'},{'revision':'f572f7b57d27ec7fd8373961f0b762b0','url':'/_next/static/media/58f386aa6b1a2a92-s.woff2'},{'revision':'e829cbe042e8b2b2e6b99c0eec9e230d','url':'/_next/static/media/656feb427634a431-s.woff2'},{'revision':'54f02056e07c55023315568c637e3a96','url':'/_next/static/media/67957d42bae0796d-s.woff2'},{'revision':'e220ad1849c282590e47db0ff88fc3f3','url':'/_next/static/media/704b853f32d191d5-s.woff2'},{'revision':'662cde3543f3375874e26c26845cec22','url':'/_next/static/media/73cb51aac9c97f90-s.woff2'},{'revision':'afac1fab355fe8db5c2dcaa7623dffb3','url':'/_next/static/media/7ba5fb2a8c88521c-s.woff2'},{'revision':'c94e6e6c23e789fcb0fc60d790c9d2c1','url':'/_next/static/media/886030b0b59bc5a7-s.woff2'},{'revision':'01ba6c2a184b8cba08b0d57167664d75','url':'/_next/static/media/8e9860b6e62d6359-s.woff2'},{'revision':'17a5b2a15bf5647b49cadb9a3bb02e1c','url':'/_next/static/media/92eeb95d069020cc-s.woff2'},{'revision':'4a4e74bed5809194e4bc6538eb1a1e30','url':'/_next/static/media/939c4f875ee75fbb-s.woff2'},{'revision':'6708425c446b05de1c2d471a0eaf4099','url':'/_next/static/media/98e207f02528a563-s.p.woff2'},{'revision':'13dface50f6dc0bff1015561c84119e6','url':'/_next/static/media/991629005c80bdf1-s.woff2'},{'revision':'216ee1a35b060106ed2852cdd8c026c7','url':'/_next/static/media/99dcf268bda04fe5-s.woff2'},{'revision':'9e494903d6b0ffec1a1e14d34427d44d','url':'/_next/static/media/ba9851c3c22cd980-s.woff2'},{'revision':'782150e6836b9b074d1a798807adcb18','url':'/_next/static/media/bb3ef058b751a6ad-s.p.woff2'},{'revision':'027a89e9ab733a145db70f09b8a18b42','url':'/_next/static/media/c5fe6dc8356a8c31-s.woff2'},{'revision':'75fa2e527eaae805bbf44e3378d1232c','url':'/_next/static/media/d26bbd13d6b70f89-s.woff2'},{'revision':'0ba762bde65aaa682fcc089f8c57288e','url':'/_next/static/media/d29838c109ef09b4-s.woff2'},{'revision':'814fe1615d4dbc7bbd92d26a6bda0905','url':'/_next/static/media/d3ebbfd689654d3a-s.p.woff2'},{'revision':'e71a597e376ed91862e822b5a5de8c04','url':'/_next/static/media/db96af6b531dc71f-s.p.woff2'},{'revision':'d54db44de5ccb18886ece2fda72bdfe0','url':'/_next/static/media/df0a9ae256c0569c-s.woff2'},{'revision':'9fb609fe01d739bb9df558e1fba2498e','url':'/_next/static/media/e40af3453d7c920a-s.woff2'},{'revision':'65850a373e258f1c897a2b3d75eb74de','url':'/_next/static/media/e4af272ccee01ff0-s.p.woff2'},{'revision':'de1d49f26130d43f91829088086625f4','url':'/_next/static/media/ef4d5661765d0e49-s.woff2'},{'revision':'0f8d347d49960d05c9430d83e49edeb7','url':'/_next/static/media/f911b923c6adde36-s.woff2'},{'revision':'d02deea99d76a2f0bde9778a2b46ac02','url':'/_next/static/oukmfNM-iSFSKzQZktLBV/_buildManifest.js'},{'revision':'b6652df95db52feb4daf4eca35380933','url':'/_next/static/oukmfNM-iSFSKzQZktLBV/_ssgManifest.js'},{'revision':'d7bc0f63f9618b8b700d028d7d242de8','url':'/apple-touch-icon.png'},{'revision':'5616f81ec5f8a9f726a17fb7ac66a54a','url':'/favicon-16.png'},{'revision':'1fc285cfb0116a0523eb34c779a7d282','url':'/favicon-32.png'},{'revision':'583b034f36839a8af92841771eef38b6','url':'/favicon.ico'},{'revision':'b15795128b3691e5703d0ce14ce10827','url':'/favicon.png'},{'revision':'44e9d71551be13574ac2e10063d03aa9','url':'/favicon.svg'},{'revision':'252b8f8c4d0f64c7cd120f182a6c74ab','url':'/icon-192.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icon-512.png'},{'revision':'252b8f8c4d0f64c7cd120f182a6c74ab','url':'/icons/icon-192.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icons/icon-512.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icons/icon-maskable-512.png'},{'revision':'bf670b1fafa1b3127bd50abe86d723b9','url':'/images/player-silhouette.svg'},{'revision':'d692f690fbd1564f090131e02be5ba9c','url':'/manifest.json'},{'revision':'9f61cf51298661d5c57a782534216240','url':'/og-image.png'},{'revision':'7c759c20b35840eacf9344692cb51061','url':'/og-image.svg'},{'revision':'9327802333275f11e68c3f19f20c160d','url':'/widget.js'}],skipWaiting:!0,clientsClaim:!0,navigationPreload:!0,runtimeCaching:eq}).addEventListeners(),self.addEventListener("install",e=>{e.waitUntil(caches.open("offline-fallback").then(e=>e.add(eR)).catch(()=>{}))}),self.addEventListener("activate",e=>{e.waitUntil(caches.keys().then(e=>Promise.all(e.filter(e=>!eE.includes(e)&&!e.startsWith("serwist")).map(e=>(console.log("[SW] deleting stale cache:",e),caches.delete(e))))))}),self.addEventListener("push",e=>{let t;if(!e.data)return;try{t=e.data.json()}catch{t={title:"VYNDR",body:e.data.text()}}let{title:a="VYNDR",body:s="",icon:r="/icons/icon-192.png",url:i="/",tag:n="vyndr-notification"}=t;e.waitUntil(self.registration.showNotification(a,{body:s,icon:r,badge:"/icons/icon-192.png",tag:n,data:{url:i}}))}),self.addEventListener("notificationclick",e=>{e.notification.close();let t=e.notification.data?.url??"/";e.waitUntil(self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(e=>{let a=e.find(e=>e.url.endsWith(t));return a?a.focus():self.clients.openWindow(t)}))})})(); \ No newline at end of file +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`)}handleInstall(e){return this.registerRequestRules(e),y(e,async()=>{let t=new eo;this.precacheStrategy.plugins.push(t),await el(this._concurrentPrecaching,Array.from(this._urlsToCacheKeys.entries()),async([t,a])=>{let s=this._cacheKeysToIntegrities.get(a),r=this._urlsToCacheModes.get(t),i=new Request(t,{integrity:s,cache:r,credentials:"same-origin"});await Promise.all(this.precacheStrategy.handleAll({event:e,request:i,url:new URL(i.url),params:{cacheKey:a}}))});let{updatedURLs:a,notUpdatedURLs:s}=t;return{updatedURLs:a,notUpdatedURLs:s}})}async registerRequestRules(e){if(this._requestRules&&e?.addRoutes)try{await e.addRoutes(this._requestRules),this._requestRules=void 0}catch(e){throw e}}handleActivate(e){return y(e,async()=>{let e=await self.caches.open(this.precacheStrategy.cacheName),t=await e.keys(),a=new Set(this._urlsToCacheKeys.values()),s=[];for(let r of t)a.has(r.url)||(await e.delete(r),s.push(r.url));return{deletedCacheRequests:s}})}handleFetch(e){let{request:t}=e,a=this.handleRequest({request:t,event:e});a&&e.respondWith(a)}handleCache(e){if(e.data&&"CACHE_URLS"===e.data.type){let{payload:t}=e.data,a=Promise.all(t.urlsToCache.map(t=>{let a;return a="string"==typeof t?new Request(t):new Request(...t),this.handleRequest({request:a,event:e})}));e.waitUntil(a),e.ports?.[0]&&a.then(()=>e.ports[0].postMessage(!0))}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,ea(e))}setCatchHandler(e){this._catchHandler=ea(e)}registerCapture(e,t,a){let s=((e,t,a)=>{if("string"==typeof e){let s=new URL(e,location.href);return new es(({url:e})=>e.href===s.href,t,a)}if(e instanceof RegExp)return new en(e,t,a);if("function"==typeof e)return new es(e,t,a);if(e instanceof es)return e;throw new l("unsupported-route-type",{moduleName:"serwist",funcName:"parseRoute",paramName:"capture"})})(e,t,a);return this.registerRoute(s),s}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});let t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}getUrlsToPrecacheKeys(){return this._urlsToCacheKeys}getPrecachedUrls(){return[...this._urlsToCacheKeys.keys()]}getPrecacheKeyForUrl(e){let t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForPrecacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){let t=e instanceof Request?e.url:e,a=this.getPrecacheKeyForUrl(t);if(a)return(await self.caches.open(this.precacheStrategy.cacheName)).match(a)}createHandlerBoundToUrl(e){let t=this.getPrecacheKeyForUrl(e);if(!t)throw new l("non-precached-url",{url:e});return a=>(a.request=new Request(e),a.params={cacheKey:t,...a.params},this.precacheStrategy.handle(a))}handleRequest({request:e,event:t}){let a,s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;let r=s.origin===location.origin,{params:i,route:n}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:s}),c=n?.handler,o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;try{a=c.handle({url:s,request:e,event:t,params:i})}catch(e){a=Promise.reject(e)}let l=n?.catchHandler;return a instanceof Promise&&(this._catchHandler||l)&&(a=a.catch(async a=>{if(l)try{return await l.handle({url:s,request:e,event:t,params:i})}catch(e){e instanceof Error&&(a=e)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw a})),a}findMatchingRoute({url:e,sameOrigin:t,request:a,event:s}){for(let r of this._routes.get(a.method)||[]){let i,n=r.match({url:e,sameOrigin:t,request:a,event:s});if(n)return Array.isArray(i=n)&&0===i.length||n.constructor===Object&&0===Object.keys(n).length?i=void 0:"boolean"==typeof n&&(i=void 0),{route:r,params:i}}return{}}};let eR="/offline",eE=["pages","api-responses","next-static","static-media","fallback","offline-fallback"],eq=[{matcher:({url:e,sameOrigin:t})=>t&&e.pathname.startsWith("/api/"),handler:new ee({cacheName:"api-responses",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:100,maxAgeSeconds:3600})]})},{matcher:({request:e})=>"navigate"===e.mode,handler:new ee({cacheName:"pages",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:50,maxAgeSeconds:86400}),{handlerDidError:async()=>await caches.match(eR)||Response.error()}]})},{matcher:({url:e,sameOrigin:t})=>t&&e.pathname.startsWith("/_next/static/"),handler:new ey({cacheName:"next-static",plugins:[new ep({maxEntries:200,maxAgeSeconds:2592e3})]})},{matcher:({url:e})=>e.pathname.startsWith("/images/")||e.pathname.startsWith("/icons/")||/\.(?:png|jpe?g|gif|svg|webp|ico|woff2?)$/.test(e.pathname),handler:new ey({cacheName:"static-media",plugins:[new ep({maxEntries:100,maxAgeSeconds:2592e3})]})},{matcher:()=>!0,handler:new ee({cacheName:"fallback",networkTimeoutSeconds:5,plugins:[new ep({maxEntries:50,maxAgeSeconds:86400})]})}];new ev({precacheEntries:[{'revision':'d02deea99d76a2f0bde9778a2b46ac02','url':'/_next/static/6LOjWx1Nzr3e0zbuUpYJb/_buildManifest.js'},{'revision':'b6652df95db52feb4daf4eca35380933','url':'/_next/static/6LOjWx1Nzr3e0zbuUpYJb/_ssgManifest.js'},{'revision':null,'url':'/_next/static/chunks/1079-304a546a4a673437.js'},{'revision':null,'url':'/_next/static/chunks/1896-359ed2e68a8c4f1d.js'},{'revision':null,'url':'/_next/static/chunks/1958-56cbbb8dba15fd2f.js'},{'revision':null,'url':'/_next/static/chunks/2346-36e36720a5f6591a.js'},{'revision':null,'url':'/_next/static/chunks/4233-1a8c8d10694f2fb7.js'},{'revision':null,'url':'/_next/static/chunks/4bd1b696-e356ca5ba0218e27.js'},{'revision':null,'url':'/_next/static/chunks/52774a7f.f2ab7a9b4b8ba576.js'},{'revision':null,'url':'/_next/static/chunks/5562-774179e47123d0cb.js'},{'revision':null,'url':'/_next/static/chunks/5838-7e0aa455e9f24259.js'},{'revision':null,'url':'/_next/static/chunks/7363-209a1a709d8f324d.js'},{'revision':null,'url':'/_next/static/chunks/7602.2868ff821d53ee09.js'},{'revision':null,'url':'/_next/static/chunks/8078-0cb13480a43e9ef1.js'},{'revision':null,'url':'/_next/static/chunks/8500-f62a38ff68ab7f42.js'},{'revision':null,'url':'/_next/static/chunks/9da6db1e-9623f3245f088d02.js'},{'revision':null,'url':'/_next/static/chunks/app/_global-error/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/_not-found/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/about/page-c4423424333614ed.js'},{'revision':null,'url':'/_next/static/chunks/app/account/page-9300f08c33aa8887.js'},{'revision':null,'url':'/_next/static/chunks/app/admin/page-b3b6af59ae9681bb.js'},{'revision':null,'url':'/_next/static/chunks/app/api/admin/stats/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/books/%5B...path%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/checkout/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/content/%5B...path%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/gamelines/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/props/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/tonight/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hero-prop/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hotlist/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/intelligence/feed/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/accuracy/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/lines/%5B...path%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/mlb/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/nba/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/soccer/%5Bleague%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/wnba/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/add-leg/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/calculate/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/grade/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/players/search/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/preferences/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/live/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/most-parlayed/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/top-graded/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/scan/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/pitchers/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/cascade/%5Bplayer%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/depth/%5Bteam%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/leaders/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/lineup/%5Bteam%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/parlays-graded/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/player/%5Bname%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/public/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/streaks/%5Bsport%5D/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ticker/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/profile/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/recent-scans/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scans/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/waitlist/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/webhook/nexapay/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/api/welcome-email/route-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/auth/callback/page-e6df9771a50edb87.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/%5Bslug%5D/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/compare/page-5e631b0c698c6f5f.js'},{'revision':null,'url':'/_next/static/chunks/app/dashboard/page-7de7369ea71ef108.js'},{'revision':null,'url':'/_next/static/chunks/app/explore/page-8856c642532e2773.js'},{'revision':null,'url':'/_next/static/chunks/app/forgot-password/page-a251f52b4206e8d1.js'},{'revision':null,'url':'/_next/static/chunks/app/game/%5Bid%5D/page-3d020b802c020ad8.js'},{'revision':null,'url':'/_next/static/chunks/app/help/page-03c6534f006d09da.js'},{'revision':null,'url':'/_next/static/chunks/app/intelligence/page-772d69c9ecfe1503.js'},{'revision':null,'url':'/_next/static/chunks/app/invite/page-e1e3f46af5f1e44b.js'},{'revision':null,'url':'/_next/static/chunks/app/layout-693c2dd4d6a6fc0e.js'},{'revision':null,'url':'/_next/static/chunks/app/ledger/page-47459e4f664b707a.js'},{'revision':null,'url':'/_next/static/chunks/app/login/page-5ab357bd6974642c.js'},{'revision':null,'url':'/_next/static/chunks/app/marketplace/page-cbada49ae96a7527.js'},{'revision':null,'url':'/_next/static/chunks/app/not-found-108d10a892324183.js'},{'revision':null,'url':'/_next/static/chunks/app/notifications/page-c4423424333614ed.js'},{'revision':null,'url':'/_next/static/chunks/app/offline/page-a7a57ff039afc1af.js'},{'revision':null,'url':'/_next/static/chunks/app/onboarding/page-3483923fb16d41ff.js'},{'revision':null,'url':'/_next/static/chunks/app/page-9cbfc34d94afa4a6.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/page-a9a1a22752478255.js'},{'revision':null,'url':'/_next/static/chunks/app/pricing/page-ce5fd8b3a31f76b9.js'},{'revision':null,'url':'/_next/static/chunks/app/privacy/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/profile/page-d607627acb1b73ab.js'},{'revision':null,'url':'/_next/static/chunks/app/report/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/responsible-gambling/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/scan/page-94020f60a56e9388.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/page-eea60cdbf9380312.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/security/page-697d02aa2d05cf7e.js'},{'revision':null,'url':'/_next/static/chunks/app/signup/page-f429c5ddc836e247.js'},{'revision':null,'url':'/_next/static/chunks/app/soccer/page-5a64e650908111d7.js'},{'revision':null,'url':'/_next/static/chunks/app/terminal/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/terms/page-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/app/tracker/page-e23baec2b3735bb1.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/cancel/page-3702e818a6853705.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/desk/page-b88c47031c7d7d63.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/success/page-ea358cb8f714f1ea.js'},{'revision':null,'url':'/_next/static/chunks/app/verify/page-9df376f065215168.js'},{'revision':null,'url':'/_next/static/chunks/app/welcome/page-259277230533599f.js'},{'revision':null,'url':'/_next/static/chunks/framework-95da69ac6843d788.js'},{'revision':null,'url':'/_next/static/chunks/main-a354262253293123.js'},{'revision':null,'url':'/_next/static/chunks/main-app-4231d5f500f33972.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/app-error-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/forbidden-2017baecb7226565.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/global-error-756d787dba63aa4d.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/unauthorized-2017baecb7226565.js'},{'revision':'846118c33b2c0e922d7b3a7676f81f6f','url':'/_next/static/chunks/polyfills-42372ed130431b0a.js'},{'revision':null,'url':'/_next/static/chunks/webpack-42b9616650231776.js'},{'revision':null,'url':'/_next/static/css/6ee3c69ef5f8952b.css'},{'revision':'cd34c7793d9776838308cfbe5d93922b','url':'/_next/static/media/011e180705008d6f-s.woff2'},{'revision':'324703f03c390d2e2a4f387de85fe63d','url':'/_next/static/media/0aa834ed78bf6d07-s.woff2'},{'revision':'9dda5cfc9a46f256d0e131bb535e46f8','url':'/_next/static/media/19cfc7226ec3afaa-s.woff2'},{'revision':'7de6d31e5076eb437418b6e01998ee12','url':'/_next/static/media/20535187d867b7b9-s.woff2'},{'revision':'4e2553027f1d60eff32898367dd4d541','url':'/_next/static/media/21350d82a1f187e9-s.woff2'},{'revision':'0d11e07b5aaafda6ae2efc53256932ec','url':'/_next/static/media/37786be940ec402b-s.p.woff2'},{'revision':'5de0bff80f9f432b5cf52c1c2f80fe20','url':'/_next/static/media/46e154b2fcbd6033-s.woff2'},{'revision':'6041b3192dc3e1a50141d5d418a24199','url':'/_next/static/media/5356a6a4f2c8c8d8-s.woff2'},{'revision':'f572f7b57d27ec7fd8373961f0b762b0','url':'/_next/static/media/58f386aa6b1a2a92-s.woff2'},{'revision':'e829cbe042e8b2b2e6b99c0eec9e230d','url':'/_next/static/media/656feb427634a431-s.woff2'},{'revision':'54f02056e07c55023315568c637e3a96','url':'/_next/static/media/67957d42bae0796d-s.woff2'},{'revision':'e220ad1849c282590e47db0ff88fc3f3','url':'/_next/static/media/704b853f32d191d5-s.woff2'},{'revision':'662cde3543f3375874e26c26845cec22','url':'/_next/static/media/73cb51aac9c97f90-s.woff2'},{'revision':'afac1fab355fe8db5c2dcaa7623dffb3','url':'/_next/static/media/7ba5fb2a8c88521c-s.woff2'},{'revision':'c94e6e6c23e789fcb0fc60d790c9d2c1','url':'/_next/static/media/886030b0b59bc5a7-s.woff2'},{'revision':'01ba6c2a184b8cba08b0d57167664d75','url':'/_next/static/media/8e9860b6e62d6359-s.woff2'},{'revision':'17a5b2a15bf5647b49cadb9a3bb02e1c','url':'/_next/static/media/92eeb95d069020cc-s.woff2'},{'revision':'4a4e74bed5809194e4bc6538eb1a1e30','url':'/_next/static/media/939c4f875ee75fbb-s.woff2'},{'revision':'6708425c446b05de1c2d471a0eaf4099','url':'/_next/static/media/98e207f02528a563-s.p.woff2'},{'revision':'13dface50f6dc0bff1015561c84119e6','url':'/_next/static/media/991629005c80bdf1-s.woff2'},{'revision':'216ee1a35b060106ed2852cdd8c026c7','url':'/_next/static/media/99dcf268bda04fe5-s.woff2'},{'revision':'9e494903d6b0ffec1a1e14d34427d44d','url':'/_next/static/media/ba9851c3c22cd980-s.woff2'},{'revision':'782150e6836b9b074d1a798807adcb18','url':'/_next/static/media/bb3ef058b751a6ad-s.p.woff2'},{'revision':'027a89e9ab733a145db70f09b8a18b42','url':'/_next/static/media/c5fe6dc8356a8c31-s.woff2'},{'revision':'75fa2e527eaae805bbf44e3378d1232c','url':'/_next/static/media/d26bbd13d6b70f89-s.woff2'},{'revision':'0ba762bde65aaa682fcc089f8c57288e','url':'/_next/static/media/d29838c109ef09b4-s.woff2'},{'revision':'814fe1615d4dbc7bbd92d26a6bda0905','url':'/_next/static/media/d3ebbfd689654d3a-s.p.woff2'},{'revision':'e71a597e376ed91862e822b5a5de8c04','url':'/_next/static/media/db96af6b531dc71f-s.p.woff2'},{'revision':'d54db44de5ccb18886ece2fda72bdfe0','url':'/_next/static/media/df0a9ae256c0569c-s.woff2'},{'revision':'9fb609fe01d739bb9df558e1fba2498e','url':'/_next/static/media/e40af3453d7c920a-s.woff2'},{'revision':'65850a373e258f1c897a2b3d75eb74de','url':'/_next/static/media/e4af272ccee01ff0-s.p.woff2'},{'revision':'de1d49f26130d43f91829088086625f4','url':'/_next/static/media/ef4d5661765d0e49-s.woff2'},{'revision':'0f8d347d49960d05c9430d83e49edeb7','url':'/_next/static/media/f911b923c6adde36-s.woff2'},{'revision':'d7bc0f63f9618b8b700d028d7d242de8','url':'/apple-touch-icon.png'},{'revision':'5616f81ec5f8a9f726a17fb7ac66a54a','url':'/favicon-16.png'},{'revision':'1fc285cfb0116a0523eb34c779a7d282','url':'/favicon-32.png'},{'revision':'583b034f36839a8af92841771eef38b6','url':'/favicon.ico'},{'revision':'b15795128b3691e5703d0ce14ce10827','url':'/favicon.png'},{'revision':'44e9d71551be13574ac2e10063d03aa9','url':'/favicon.svg'},{'revision':'252b8f8c4d0f64c7cd120f182a6c74ab','url':'/icon-192.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icon-512.png'},{'revision':'252b8f8c4d0f64c7cd120f182a6c74ab','url':'/icons/icon-192.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icons/icon-512.png'},{'revision':'3e3b53bbd210bd772b36b70165657e7c','url':'/icons/icon-maskable-512.png'},{'revision':'bf670b1fafa1b3127bd50abe86d723b9','url':'/images/player-silhouette.svg'},{'revision':'d692f690fbd1564f090131e02be5ba9c','url':'/manifest.json'},{'revision':'9f61cf51298661d5c57a782534216240','url':'/og-image.png'},{'revision':'7c759c20b35840eacf9344692cb51061','url':'/og-image.svg'},{'revision':'9327802333275f11e68c3f19f20c160d','url':'/widget.js'}],skipWaiting:!0,clientsClaim:!0,navigationPreload:!0,runtimeCaching:eq}).addEventListeners(),self.addEventListener("install",e=>{e.waitUntil(caches.open("offline-fallback").then(e=>e.add(eR)).catch(()=>{}))}),self.addEventListener("activate",e=>{e.waitUntil(caches.keys().then(e=>Promise.all(e.filter(e=>!eE.includes(e)&&!e.startsWith("serwist")).map(e=>(console.log("[SW] deleting stale cache:",e),caches.delete(e))))))}),self.addEventListener("push",e=>{let t;if(!e.data)return;try{t=e.data.json()}catch{t={title:"VYNDR",body:e.data.text()}}let{title:a="VYNDR",body:s="",icon:r="/icons/icon-192.png",url:i="/",tag:n="vyndr-notification"}=t;e.waitUntil(self.registration.showNotification(a,{body:s,icon:r,badge:"/icons/icon-192.png",tag:n,data:{url:i}}))}),self.addEventListener("notificationclick",e=>{e.notification.close();let t=e.notification.data?.url??"/";e.waitUntil(self.clients.matchAll({type:"window",includeUncontrolled:!0}).then(e=>{let a=e.find(e=>e.url.endsWith(t));return a?a.focus():self.clients.openWindow(t)}))})})(); \ No newline at end of file diff --git a/web/src/app/api/parlay/grade/route.ts b/web/src/app/api/parlay/grade/route.ts index c81ece3..8df13fc 100644 --- a/web/src/app/api/parlay/grade/route.ts +++ b/web/src/app/api/parlay/grade/route.ts @@ -1,56 +1,28 @@ import { NextRequest, NextResponse } from 'next/server'; -import { getUserFromRequest, jsonError } from '@/lib/auth-helpers'; export const dynamic = 'force-dynamic'; const BACKEND_URL = process.env.BACKEND_URL || 'http://localhost:3000'; -interface Leg { - sport?: 'NBA' | 'MLB' | 'WNBA'; - player: string; - stat_type: string; - line: number; - direction: 'over' | 'under'; -} - -interface Body { - legs: Leg[]; -} - +/** + * Parlay Lab grade proxy (Session 50) — forwards POST /api/parlay/grade to the + * Express correlation model. Public + stateless (the Lab UI is tier-gated on the + * frontend); body carries { legs, betAmount }. + */ export async function POST(req: NextRequest) { - const user = await getUserFromRequest(req); - if (!user) return jsonError(401, 'Log in to grade parlays.'); - - let body: Body; + const body = await req.text(); try { - body = (await req.json()) as Body; - } catch { - return jsonError(400, 'Invalid JSON.'); - } - - if (!Array.isArray(body.legs) || body.legs.length < 2 || body.legs.length > 12) { - return jsonError(400, 'Send 2–12 legs.'); - } - - try { - const upstream = await fetch(`${BACKEND_URL}/api/scan/parlay`, { + const upstream = await fetch(`${BACKEND_URL}/api/parlay/grade`, { method: 'POST', headers: { 'Content-Type': 'application/json', ...(req.headers.get('authorization') ? { Authorization: req.headers.get('authorization')! } : {}), }, - body: JSON.stringify({ legs: body.legs }), + body, }); - const data = await upstream.json().catch(() => ({})); - if (!upstream.ok) { - return NextResponse.json( - { error: (data as { error?: string }).error || 'The engine hit a wall on this parlay.' }, - { status: upstream.status }, - ); - } - return NextResponse.json(data); + return NextResponse.json(data, { status: upstream.status }); } catch { - return jsonError(502, 'The engine hit a wall on this parlay.'); + return NextResponse.json({ error: 'The engine hit a wall on this parlay.' }, { status: 502 }); } } diff --git a/web/src/app/layout.tsx b/web/src/app/layout.tsx index ea648ab..e140f11 100644 --- a/web/src/app/layout.tsx +++ b/web/src/app/layout.tsx @@ -9,7 +9,8 @@ import Footer from '@/components/Footer'; import AuthGate from '@/components/AuthGate'; import HashRedirect from '@/components/vyndr/HashRedirect'; import GlobalHosts from '@/components/vyndr/GlobalHosts'; -import ParlayTray from '@/components/ParlayTray'; +// Session 50 — the Parlay Lab supersedes the legacy ParlayTray. +import ParlayPanel from '@/components/vyndr/ParlayPanel'; import BottomTabBar from '@/components/BottomTabBar'; import InstallPrompt from '@/components/InstallPrompt'; import PushPrompt from '@/components/PushPrompt'; @@ -141,7 +142,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
{children}