diff --git a/docs/MECHANISM-DATA.md b/docs/MECHANISM-DATA.md new file mode 100644 index 0000000..2625e24 --- /dev/null +++ b/docs/MECHANISM-DATA.md @@ -0,0 +1,98 @@ +# MECHANISM DATA — the Layer-1 pattern every sport inherits + +Layer 1 of the archetype+projection build. It lands **mechanism data** — how a +player actually does what he does — and keeps it current. It does **not** +classify (Layer 2) or project (Layer 3). + +MLB is the first instance. NBA tracking and NFL Next Gen slot into the same +four boxes with a different adapter and a different source id. + +## The pattern + +``` + SOURCE ADAPTER free/public first · absent-not-zero · injectable fetch + │ no new runtime deps · one file per sport + ▼ + IDENTITY BRIDGE source-native id ↔ our player_key + │ the match rate is MEASURED and REPORTED, never assumed — + │ the unmatched rate IS the honest-absent rate + ▼ + AGGREGATE pure, re-runnable, explicit MIN-SAMPLE gates + DERIVATION thin ≠ missing: both stored, distinguishable + ▼ + HOT STORE small, indexed, upserted on the natural key + (Supabase) + updated_at, because freshness is a truth property +``` + +### The five rules that make it a pattern + +1. **Backfill and refresh are the same call.** A full re-pull upserted on the + natural key is idempotent and self-healing: a missed night self-corrects on + the next run. No incremental "who played today" bookkeeping to drift out of + sync. Only viable because the aggregate grain is small — which is the point + of aggregating. +2. **Aggregate grain, not raw.** One season of raw MLB per-pitch is ~0.85 GB in + Postgres against a 500 MB plan ceiling; the aggregate set is ~1,350 rows. + Raw stays retrievable from the free source if Layer 3 ever needs it. +3. **Absent is absent.** A metric the feed did not carry is `null`, never `0`. + A player below the minimum sample is stored and flagged, not dropped and not + inflated. A player we cannot join is stored with a null `player_key` and + joins later — storing him is not a claim about him. +4. **Refuse to write nothing.** If every feed returns empty that is a source + failure, not "there is no mechanism data". The job refuses the write so a + bad night can never blank a good table. +5. **Freshness is monitored.** `updated_at` on every row; the scheduler pages on + a failed run AND on silent staleness — a job that stops being scheduled never + produces a failure, so staleness must alarm on its own. **Never-built is not + stale**: different condition, different fix, and paging on a fresh install + teaches the operator to ignore the alarm. + +## MLB instance + +- **Adapter** `src/services/adapters/statcastAdapter.js` — five Baseball Savant + CSV leaderboards (free, public, no key). Direct `axios` + the existing CSV + parser; **pybaseball is deliberately not used** — it is a Python wrapper over + these same URLs, and the stack's Python service is already offline in prod. +- **Service** `src/services/statcastAggregateService.js` — `buildRows` (pure), + `refreshSeason` (the job), `getFreshness` / `isStale` (the alarm predicates). +- **Store** `statcast_aggregates` (migration 030), PK `(sport, season, source_id)`. + Promoted columns for the classification-critical metrics + a `metrics` JSONB + carrying every raw field, so Layer 2/3 can reach something we did not promote + **without a re-ingest**. +- **Schedule** nightly at `STATCAST_HOUR_UTC` (default 11 UTC ≈ 7 AM ET, after + every game is final). Kill switch `STATCAST=0`. +- **Induce** `POST /api/internal/statcast/refresh` · **probe** + `GET /api/internal/statcast/status` (internal key). We verify a refresh by + running it, never by waiting for the slot. + +### Measured (2026-07-20) + +| | | +|---|---| +| Batter match rate | **100%** (40/40 real players) | +| Pitcher match rate | **100%** (66/66 real roster pitchers) | +| Rows per season | **1,354** (604 batters + 750 pitchers) | +| Join rate | **1,354 / 1,354** | +| Handedness present | 677 pitchers (from the movement feed) | +| Sufficient / thin | 998 / 356 at PA≥50, IP≥10 | +| Pull time | ~5 s for all five feeds | + +## Adding a sport + +1. Write `src/services/adapters/{sport}Adapter.js` returning the same shape: + indexes keyed by source id, metrics strictly parsed. +2. Confirm and **report** the identity match rate before building on it. +3. Extend `buildRows` with the sport's role vocabulary and its minimum-sample + gates. +4. Add the scheduler hour and the induce endpoint. + +Nothing else changes: the store, the alarm and the upsert semantics are shared. + +## Commodity, not moat + +Raw Statcast is public — every competitor can pull the same numbers in about a +second. Ingesting it is table stakes. The edge is Layer 2 (which mechanism +signals define an archetype, and where the boundaries sit), Layer 3 +(projections built on them), and the settled ledger that proves whether any of +it predicts anything. **Having the data is not having an edge. Having it plus +an attributed record is.** diff --git a/src/routes/internal.js b/src/routes/internal.js index 3af19f2..382b68e 100644 --- a/src/routes/internal.js +++ b/src/routes/internal.js @@ -431,6 +431,46 @@ router.post('/newsletter/send', async (req, res) => { } }); +/** + * POST /api/internal/statcast/refresh — INDUCE the Layer-1 mechanism refresh. + * + * Same call the nightly scheduler makes. Exists so the job is verifiable ON + * DEMAND: we prove a refresh works by running it and reading the result, never + * by waiting for the cron slot. Idempotent — running it twice is a no-op beyond + * refreshing values and updated_at. + */ +router.post('/statcast/refresh', async (req, res) => { + try { + const agg = require('../services/statcastAggregateService'); + const season = req.query.season ? Number(req.query.season) : undefined; + const out = await agg.refreshSeason({ season }); + const fresh = await agg.getFreshness({}); + return res.status(out.ok ? 200 : 500).json({ ...out, freshness: fresh, stale: agg.isStale(fresh) }); + } catch (err) { + console.error('[internal/statcast]', err.message); + return res.status(500).json({ ok: false, error: err.message }); + } +}); + +/** GET /api/internal/statcast/status — freshness probe for the mechanism tier. */ +router.get('/statcast/status', async (req, res) => { + try { + const agg = require('../services/statcastAggregateService'); + const fresh = await agg.getFreshness({}); + return res.json({ + ...fresh, + stale: agg.isStale(fresh), + max_age_hours: agg.MAX_AGE_HOURS, + min_pa: agg.MIN_PA, + min_ip: agg.MIN_IP, + cron_hour_utc: Number(process.env.STATCAST_HOUR_UTC || 11), + enabled: process.env.STATCAST !== '0', + }); + } catch (err) { + return res.status(500).json({ error: err.message }); + } +}); + router.post('/outcomes/:sport', async (req, res) => { const outcomes = require('../services/outcomeService'); try { diff --git a/src/services/adapters/statcastAdapter.js b/src/services/adapters/statcastAdapter.js new file mode 100644 index 0000000..70a167e --- /dev/null +++ b/src/services/adapters/statcastAdapter.js @@ -0,0 +1,217 @@ +'use strict'; + +/** + * STATCAST ADAPTER (Layer 1) — the SOURCE ADAPTER of the mechanism-data pattern. + * + * Pulls per-player-per-season Statcast aggregates from Baseball Savant. Free, + * public, no key, no quota — the same host `savantAdapter` already uses in prod. + * + * WHY NOT pybaseball: it is an MIT-licensed Python wrapper around these exact + * CSV URLs. Adding it would reintroduce a Python runtime dependency in a stack + * where the existing Python service is already offline in production (nba_api + * degrades to found:false for exactly that reason). We call the endpoints + * directly with axios and reuse savantAdapter's quote-aware CSV parser — no new + * dependency, one less thing to keep alive. + * + * FIVE FEEDS (all measured live 2026-07-20, all `csv=true`, all min=1 so the + * long tail is included rather than silently dropped by Savant's `min=q`): + * 1. batter discipline 604 rows — k/bb/whiff/swing/CHASE/z-swing/sweetspot/ + * barrel/hard-hit/best-speed + * 2. batter batted-ball 600 rows — exit velo (avg/max/ev50), launch angle, + * GB/FB-LD, barrels, ev95+ + * 3. pitcher discipline 713 rows — k/bb/whiff/swing/chase, GB/FB/LD%, + * barrel/hard-hit allowed, ARM ANGLE + * 4. pitcher batted-ball 749 rows — contact quality allowed + * 5. pitch movement 677 rows — per pitch type: velo, break_x/z, induced + * break, usage — and PITCH_HAND (handedness) + * + * HONESTY DOCTRINE (inherited from savantAdapter / espnStatsAdapter): + * - A missing metric is NULL, never 0. `Number(null) === 0` is the fabrication + * trap this whole layer exists to avoid. + * - Any unrecognised shape → that field absent; never a guessed default. + * - Injectable (`opts.fetchImpl`) so tests never touch the network. + * + * COMMODITY, NOT MOAT: this data is public and every competitor can pull it in + * about a second. The edge is Layer 2 (archetype definitions) and Layer 3 + * (projections) built on top — plus the settled ledger that proves them. + */ + +const axios = require('axios'); +const { __internals: savant } = require('./savantAdapter'); + +const { parseCsv, numOrNull } = savant; + +const HTTP_TIMEOUT_MS = 60_000; +const DEFAULT_SEASON = Number(process.env.STATCAST_SEASON) || 2026; +const BASE = 'https://baseballsavant.mlb.com/leaderboard'; + +/** `min=1` deliberately: Savant's default `min=q` drops every non-qualified + * player, which would silently make a thin-sample player look absent rather + * than thin. We take the long tail and apply our OWN minimum-sample gate at + * the aggregate layer, where it is explicit and testable. */ +const FEEDS = Object.freeze({ + batter_discipline: (y) => `${BASE}/custom?year=${y}&type=batter&filter=&min=1&selections=pa,k_percent,bb_percent,whiff_percent,swing_percent,oz_swing_percent,z_swing_percent,sweet_spot_percent,barrel_batted_rate,hard_hit_percent,avg_best_speed,avg_hyper_speed&chart=false&x=pa&y=pa&r=no&chartType=beeswarm&sort=pa&sortDir=desc&csv=true`, + batter_batted_ball: (y) => `${BASE}/statcast?type=batter&year=${y}&position=&team=&min=1&csv=true`, + pitcher_discipline: (y) => `${BASE}/custom?year=${y}&type=pitcher&filter=&min=1&selections=p_formatted_ip,k_percent,bb_percent,whiff_percent,swing_percent,oz_swing_percent,groundballs_percent,flyballs_percent,linedrives_percent,barrel_batted_rate,hard_hit_percent,arm_angle&chart=false&x=p_formatted_ip&y=p_formatted_ip&r=no&chartType=beeswarm&sort=p_formatted_ip&sortDir=desc&csv=true`, + pitcher_batted_ball: (y) => `${BASE}/statcast?type=pitcher&year=${y}&position=&team=&min=1&csv=true`, + pitch_movement: (y) => `${BASE}/pitch-movement?year=${y}&team=&min=1&pitch_type=&hand=&csv=true`, +}); + +async function fetchText(url, opts = {}) { + if (opts.fetchImpl) return opts.fetchImpl(url); + const res = await axios.get(url, { + timeout: HTTP_TIMEOUT_MS, + responseType: 'text', + headers: { Accept: 'text/csv,*/*' }, + // Savant occasionally returns a large body; don't let axios truncate. + maxContentLength: 64 * 1024 * 1024, + transformResponse: [(d) => d], + }); + return typeof res.data === 'string' ? res.data : null; +} + +/** Savant's first column is the literal header `last_name, first_name` — a + * comma INSIDE a quoted header. The value is likewise `"Last, First"`. */ +function flipName(v) { + const s = String(v || '').trim(); + if (!s) return null; + const i = s.indexOf(','); + if (i < 0) return s; + const last = s.slice(0, i).trim(); + const first = s.slice(i + 1).trim(); + return first ? `${first} ${last}` : last; +} + +function idOf(row) { + const raw = row.player_id ?? row.pitcher_id ?? row.batter_id; + const n = Number(raw); + return Number.isFinite(n) && n > 0 ? n : null; +} + +/** Row → { id, name, metrics } with EVERY metric strictly parsed (null, not 0). */ +function normalizeRow(row, fields) { + const id = idOf(row); + if (id == null) return null; + const metrics = {}; + for (const [out, src] of Object.entries(fields)) { + const v = numOrNull(row[src]); + if (v != null) metrics[out] = v; + } + return { id, name: flipName(row['last_name, first_name'] || row.last_name), metrics }; +} + +const BATTER_DISCIPLINE = { + pa: 'pa', k_pct: 'k_percent', bb_pct: 'bb_percent', whiff_pct: 'whiff_percent', + swing_pct: 'swing_percent', chase_pct: 'oz_swing_percent', z_swing_pct: 'z_swing_percent', + sweet_spot_pct: 'sweet_spot_percent', barrel_pct: 'barrel_batted_rate', + hard_hit_pct: 'hard_hit_percent', avg_best_speed: 'avg_best_speed', +}; +const BATTED_BALL = { + bip: 'attempts', avg_launch_angle: 'avg_hit_angle', sweet_spot_pct_bb: 'anglesweetspotpercent', + max_exit_velo: 'max_hit_speed', avg_exit_velo: 'avg_hit_speed', ev50: 'ev50', + fb_ld_pct: 'fbld', gb_pct_bb: 'gb', max_distance: 'max_distance', + avg_distance: 'avg_distance', avg_hr_distance: 'avg_hr_distance', + ev95_pct: 'ev95percent', barrels: 'barrels', barrel_pct_bb: 'brl_percent', barrel_per_pa: 'brl_pa', +}; +const PITCHER_DISCIPLINE = { + ip: 'p_formatted_ip', k_pct: 'k_percent', bb_pct: 'bb_percent', whiff_pct: 'whiff_percent', + swing_pct: 'swing_percent', chase_pct: 'oz_swing_percent', gb_pct: 'groundballs_percent', + fb_pct: 'flyballs_percent', ld_pct: 'linedrives_percent', + barrel_pct_allowed: 'barrel_batted_rate', hard_hit_pct_allowed: 'hard_hit_percent', + arm_angle: 'arm_angle', +}; + +function indexBy(rows, fields) { + const out = new Map(); + for (const r of rows) { + const n = normalizeRow(r, fields); + if (!n) continue; + const prev = out.get(n.id); + out.set(n.id, prev ? { ...prev, ...n, metrics: { ...prev.metrics, ...n.metrics } } : n); + } + return out; +} + +/** + * Pitch movement is LONG (one row per pitcher × pitch type). Collapses to a + * pitch-mix array per pitcher, sorted by usage. Also the only feed carrying + * HANDEDNESS (`pitch_hand`), so it doubles as the pitcher-handedness source. + */ +function indexPitchMix(rows) { + const out = new Map(); + for (const r of rows) { + const id = idOf(r); + if (id == null) continue; + const entry = out.get(id) || { id, name: flipName(r['last_name, first_name']), throws: null, pitches: [] }; + if (!entry.throws && r.pitch_hand) entry.throws = String(r.pitch_hand).trim().toUpperCase() || null; + // `pitch_per` arrives as a FRACTION (0.371), unlike every other _pct field + // on these feeds. Normalise to a percentage so downstream never has to know + // which endpoint a number came from. + const rawUsage = numOrNull(r.pitch_per); + const usage = rawUsage == null ? null : (rawUsage <= 1 ? Math.round(rawUsage * 1000) / 10 : rawUsage); + const type = (r.pitch_type || '').trim(); + if (type) { + entry.pitches.push({ + type, + name: (r.pitch_type_name || '').trim() || null, + usage_pct: usage, + velo: numOrNull(r.avg_speed), + break_z_induced: numOrNull(r.pitcher_break_z_induced), + break_x: numOrNull(r.pitcher_break_x), + thrown: numOrNull(r.pitches_thrown), + }); + } + out.set(id, entry); + } + for (const e of out.values()) { + e.pitches.sort((a, b) => (b.usage_pct ?? 0) - (a.usage_pct ?? 0)); + } + return out; +} + +/** + * fetchSeason(season, opts) — pull all five feeds and return normalized indexes. + * Any single feed failing degrades to an EMPTY index for that feed (its metrics + * become absent) rather than failing the whole pull: partial mechanism data is + * honest, a failed night is not a reason to have none. + */ +async function fetchSeason(season = DEFAULT_SEASON, opts = {}) { + const get = async (name) => { + try { + const text = await fetchText(FEEDS[name](season), opts); + const rows = text ? parseCsv(text) : []; + return Array.isArray(rows) ? rows : []; + } catch (err) { + console.warn(`[statcast] feed ${name} failed:`, err.message); + return []; + } + }; + + const [bd, bbb, pd, pbb, mv] = await Promise.all([ + get('batter_discipline'), get('batter_batted_ball'), + get('pitcher_discipline'), get('pitcher_batted_ball'), get('pitch_movement'), + ]); + + return { + season, + batterDiscipline: indexBy(bd, BATTER_DISCIPLINE), + batterBattedBall: indexBy(bbb, BATTED_BALL), + pitcherDiscipline: indexBy(pd, PITCHER_DISCIPLINE), + pitcherBattedBall: indexBy(pbb, BATTED_BALL), + pitchMix: indexPitchMix(mv), + counts: { + batter_discipline: bd.length, batter_batted_ball: bbb.length, + pitcher_discipline: pd.length, pitcher_batted_ball: pbb.length, pitch_movement: mv.length, + }, + }; +} + +module.exports = { + fetchSeason, + DEFAULT_SEASON, + FEEDS, + __internals: { + flipName, idOf, normalizeRow, indexBy, indexPitchMix, + BATTER_DISCIPLINE, BATTED_BALL, PITCHER_DISCIPLINE, fetchText, + }, +}; diff --git a/src/services/statcastAggregateService.js b/src/services/statcastAggregateService.js new file mode 100644 index 0000000..2826804 --- /dev/null +++ b/src/services/statcastAggregateService.js @@ -0,0 +1,273 @@ +'use strict'; + +/** + * STATCAST AGGREGATE SERVICE (Layer 1) — derivation + join + store. + * + * The AGGREGATE DERIVATION and IDENTITY BRIDGE boxes of the mechanism-data + * pattern (docs/MECHANISM-DATA.md). Pure where it can be, injectable + * everywhere, so tests never touch the network or the database. + * + * BACKFILL and REFRESH are the SAME operation: a full re-pull of the ~1,300-row + * aggregate set, upserted on (sport, season, source_id). That makes the nightly + * job idempotent and self-healing — a missed night self-corrects on the next + * run, with no incremental "who played today" bookkeeping to drift out of sync. + * At this volume the simple thing is also the robust thing. + * + * HONESTY RULES: + * - A metric the feed did not carry is ABSENT (null), never 0. + * - A player below the minimum sample keeps his row but is marked + * `sufficient: false` — thin is not the same as missing, and Layer 2 must + * be able to tell them apart. + * - A player we cannot join to our own roster still stores (player_key null) + * and joins later. Storing him is not a claim about him. + * - `updated_at` is written every run. Freshness is a truth property; the + * staleness alarm reads it. + */ + +const { nameKey } = require('../utils/playerName'); +const statcast = require('./adapters/statcastAdapter'); + +/** Minimum samples for a mechanism claim. Below these the row is stored but + * flagged insufficient — the explicit gate that prevents a 12-PA sample from + * being classified as confidently as a 400-PA one (the FLEX-at-weight-1.0 + * failure, structurally prevented). */ +const MIN_PA = Number(process.env.STATCAST_MIN_PA) || 50; +const MIN_IP = Number(process.env.STATCAST_MIN_IP) || 10; + +const num = (v) => { + if (v == null || v === '') return null; + const n = typeof v === 'number' ? v : Number(v); + return Number.isFinite(n) ? n : null; +}; + +/** + * buildRows(season, feeds, opts) — PURE. Merges the five feed indexes into one + * row per player per role. No I/O. + */ +function buildRows(season, feeds, opts = {}) { + const sport = opts.sport || 'mlb'; + const now = opts.now || new Date().toISOString(); + const rows = []; + + // ---- BATTERS ----------------------------------------------------------- + const batterIds = new Set([...feeds.batterDiscipline.keys(), ...feeds.batterBattedBall.keys()]); + for (const id of batterIds) { + const d = feeds.batterDiscipline.get(id); + const b = feeds.batterBattedBall.get(id); + const m = { ...(b ? b.metrics : {}), ...(d ? d.metrics : {}) }; + const name = (d && d.name) || (b && b.name) || null; + const pa = num(m.pa); + rows.push({ + sport, + season, + source_id: id, + player_key: name ? nameKey(name) : null, + player_name: name, + role: 'batter', + throws: null, + bats: null, // roster join fills this; absent otherwise (never guessed) + sample_pa: pa, + sample_ip: null, + sample_bip: num(m.bip), + k_pct: num(m.k_pct), + bb_pct: num(m.bb_pct), + whiff_pct: num(m.whiff_pct), + swing_pct: num(m.swing_pct), + chase_pct: num(m.chase_pct), + barrel_pct: num(m.barrel_pct) ?? num(m.barrel_pct_bb), + hard_hit_pct: num(m.hard_hit_pct), + avg_exit_velo: num(m.avg_exit_velo), + max_exit_velo: num(m.max_exit_velo), + avg_launch_angle: num(m.avg_launch_angle), + sweet_spot_pct: num(m.sweet_spot_pct) ?? num(m.sweet_spot_pct_bb), + ev95_pct: num(m.ev95_pct), + arm_angle: null, + gb_pct: null, + fb_pct: null, + ld_pct: null, + pitch_mix: null, + metrics: m, + updated_at: now, + _sufficient: pa != null && pa >= MIN_PA, + }); + } + + // ---- PITCHERS ---------------------------------------------------------- + const pitcherIds = new Set([ + ...feeds.pitcherDiscipline.keys(), + ...feeds.pitcherBattedBall.keys(), + ...feeds.pitchMix.keys(), + ]); + for (const id of pitcherIds) { + const d = feeds.pitcherDiscipline.get(id); + const b = feeds.pitcherBattedBall.get(id); + const mix = feeds.pitchMix.get(id); + const m = { ...(b ? b.metrics : {}), ...(d ? d.metrics : {}) }; + const name = (d && d.name) || (mix && mix.name) || (b && b.name) || null; + const ip = num(m.ip); + rows.push({ + sport, + season, + source_id: id, + player_key: name ? nameKey(name) : null, + player_name: name, + role: 'pitcher', + // Handedness comes free on the movement feed — the ONLY feed that carries + // it. Absent when a pitcher has thrown too few tracked pitches to appear. + throws: (mix && mix.throws) || null, + bats: null, + sample_pa: null, + sample_ip: ip, + sample_bip: num(m.bip), + k_pct: num(m.k_pct), + bb_pct: num(m.bb_pct), + whiff_pct: num(m.whiff_pct), + swing_pct: num(m.swing_pct), + chase_pct: num(m.chase_pct), + barrel_pct: num(m.barrel_pct_allowed), + hard_hit_pct: num(m.hard_hit_pct_allowed), + avg_exit_velo: num(m.avg_exit_velo), + max_exit_velo: num(m.max_exit_velo), + avg_launch_angle: num(m.avg_launch_angle), + sweet_spot_pct: num(m.sweet_spot_pct_bb), + ev95_pct: num(m.ev95_pct), + arm_angle: num(m.arm_angle), + gb_pct: num(m.gb_pct), + fb_pct: num(m.fb_pct), + ld_pct: num(m.ld_pct), + pitch_mix: mix && mix.pitches && mix.pitches.length ? mix.pitches : null, + metrics: m, + updated_at: now, + _sufficient: ip != null && ip >= MIN_IP, + }); + } + + return rows; +} + +/** Strip the internal flag before the row reaches Postgres. */ +function toDbRow(r) { + const { _sufficient, ...rest } = r; + return rest; +} + +/** + * refreshSeason(opts) — THE JOB. Backfill and nightly refresh are the same call. + * + * opts: { season, sport, supabase, fetchSeason, now, chunkSize } + * Returns a summary — never throws on a partial failure; a broken feed degrades + * to fewer rows, which is honest, rather than to a wrong number. + */ +async function refreshSeason(opts = {}) { + const season = opts.season || statcast.DEFAULT_SEASON; + const sport = opts.sport || 'mlb'; + const started = opts.now || new Date().toISOString(); + + const fetchSeason = opts.fetchSeason || statcast.fetchSeason; + const feeds = await fetchSeason(season, opts); + const rows = buildRows(season, feeds, { sport, now: started }); + + const summary = { + ok: true, + sport, + season, + started_at: started, + feed_counts: feeds.counts || null, + rows: rows.length, + batters: rows.filter((r) => r.role === 'batter').length, + pitchers: rows.filter((r) => r.role === 'pitcher').length, + sufficient: rows.filter((r) => r._sufficient).length, + thin: rows.filter((r) => !r._sufficient).length, + joined: rows.filter((r) => r.player_key).length, + unjoined: rows.filter((r) => !r.player_key).length, + with_handedness: rows.filter((r) => r.throws).length, + written: 0, + }; + + if (!rows.length) { + // Every feed empty = the source failed, NOT "there is no mechanism data". + // Refuse to write, so a bad night can never blank a good table. + summary.ok = false; + summary.reason = 'no rows from source — refusing to write'; + return summary; + } + + const sb = opts.supabase || getServiceClient(); + if (!sb) { + summary.ok = false; + summary.reason = 'no supabase client (env not configured)'; + return summary; + } + + // Chunked upsert — idempotent on the natural key, so re-running is a no-op + // beyond refreshing values and `updated_at`. + const chunk = opts.chunkSize || 500; + for (let i = 0; i < rows.length; i += chunk) { + const batch = rows.slice(i, i + chunk).map(toDbRow); + const { error } = await sb + .from('statcast_aggregates') + .upsert(batch, { onConflict: 'sport,season,source_id' }); + if (error) { + summary.ok = false; + summary.reason = `upsert failed: ${error.message}`; + return summary; + } + summary.written += batch.length; + } + + return summary; +} + +function getServiceClient() { + try { + return require('../utils/supabase').getSupabaseServiceClient(); + } catch { + return null; + } +} + +/** + * getFreshness(opts) — how current is the mechanism tier? + * Reads the newest `updated_at`. Used by the staleness alarm and the status + * probe. Returns { updated_at, age_hours, rows } or nulls — never a guess. + */ +async function getFreshness(opts = {}) { + const sb = opts.supabase || getServiceClient(); + if (!sb) return { updated_at: null, age_hours: null, rows: null }; + const sport = opts.sport || 'mlb'; + const { data, error } = await sb + .from('statcast_aggregates') + .select('updated_at') + .eq('sport', sport) + .order('updated_at', { ascending: false }) + .limit(1); + if (error || !data || !data.length) return { updated_at: null, age_hours: null, rows: null }; + const updated = data[0].updated_at; + const nowMs = opts.nowMs || Date.now(); + const ageH = (nowMs - new Date(updated).getTime()) / 3_600_000; + return { updated_at: updated, age_hours: Math.round(ageH * 10) / 10 }; +} + +/** + * isStale(freshness, maxAgeHours) — PURE. The alarm predicate. + * + * NEVER-REFRESHED (updated_at null) is NOT stale — it is "not built yet", a + * different condition with a different fix. Conflating them would page on a + * fresh install and teach the operator to ignore the alarm. + */ +const MAX_AGE_HOURS = Number(process.env.STATCAST_MAX_AGE_HOURS) || 48; +function isStale(freshness, maxAgeHours = MAX_AGE_HOURS) { + if (!freshness || freshness.updated_at == null) return false; + return Number.isFinite(freshness.age_hours) && freshness.age_hours > maxAgeHours; +} + +module.exports = { + refreshSeason, + buildRows, + getFreshness, + isStale, + MIN_PA, + MIN_IP, + MAX_AGE_HOURS, + __internals: { toDbRow, num, getServiceClient }, +}; diff --git a/src/snapshotScheduler.js b/src/snapshotScheduler.js index 7137a10..478dbde 100644 --- a/src/snapshotScheduler.js +++ b/src/snapshotScheduler.js @@ -286,6 +286,34 @@ function startSnapshotScheduler(opts = {}) { } } catch (e) { console.warn('[harness] nightly run failed:', e.message); } + // Session 68 — LAYER 1 MECHANISM DATA. Nightly full re-pull of the + // ~1,350-row Statcast aggregate set at STATCAST_HOUR_UTC. Backfill and + // refresh are the SAME call, upserted on the natural key, so the job is + // idempotent and self-healing: a missed night self-corrects on the next + // run with no incremental bookkeeping to drift. Kill switch: STATCAST=0. + try { + const statcastHour = Number(process.env.STATCAST_HOUR_UTC || 11); // ~7 AM ET, after every game is final + if (h === statcastHour && process.env.STATCAST !== '0') { + const agg = opts.statcastService || require('./services/statcastAggregateService'); + const res = await agg.refreshSeason({}); + console.log(`[statcast] nightly refresh — ok=${res.ok} rows=${res.rows ?? 'n/a'} written=${res.written ?? 0} joined=${res.joined ?? 'n/a'} thin=${res.thin ?? 'n/a'}${res.reason ? ` reason: ${res.reason}` : ''}`); + if (!res.ok) { + await notify(`Statcast refresh failed — ${res.reason || 'unknown'}. Mechanism data is not updating.`, { + title: 'VYNDR statcast', priority: 'high', tags: ['rotating_light'], + }); + } + // Serving a stale aggregate as current is a quiet fabrication of + // currency, so staleness pages on its own — separate from a failed run, + // because a silently-not-scheduled job never produces a failure. + const fresh = await agg.getFreshness({}); + if (agg.isStale(fresh)) { + await notify(`Statcast aggregates stale — last updated ${fresh.updated_at} (${fresh.age_hours}h). Mechanism data is being served as current.`, { + title: 'VYNDR statcast', priority: 'high', tags: ['rotating_light'], + }); + } + } + } catch (e) { console.warn('[statcast] nightly refresh failed:', e.message); } + // Session 8 — quota check after each snapshot run: odds-api >= 80% alerts // once per day (Redis-deduped). Never throws (guarded inside checkQuotaDaily). await opsWatch.checkQuotaDaily({ getStatus: getQuotaStatus, cacheGet, cacheSet, notify, now: () => now() }); @@ -324,7 +352,7 @@ function startSnapshotScheduler(opts = {}) { const interval = setInterval(() => { void tick(); void refreshTick(); }, 60_000); if (interval.unref) interval.unref(); - console.log(`[snapshotScheduler] armed — SNAPSHOT_CRON=${process.env.SNAPSHOT_CRON}, hours=${HOURS_UTC.join(',')} UTC, intraday=${process.env.INTRADAY_REFRESH === '0' ? 'off' : `${REFRESH_MINUTES}m (slate hours)`}`); + console.log(`[snapshotScheduler] armed — SNAPSHOT_CRON=${process.env.SNAPSHOT_CRON}, hours=${HOURS_UTC.join(',')} UTC, intraday=${process.env.INTRADAY_REFRESH === '0' ? 'off' : `${REFRESH_MINUTES}m (slate hours)`}, statcast=${process.env.STATCAST === '0' ? 'off' : `${process.env.STATCAST_HOUR_UTC || 11}h UTC`}`); // Job 1 — state each sport's cadence at boot so "when does WNBA grade?" is // answerable from logs, and warn if a sport is scheduled at an hour the // scheduler never fires (it would silently never run). diff --git a/supabase/migrations/030_statcast_aggregates.sql b/supabase/migrations/030_statcast_aggregates.sql new file mode 100644 index 0000000..a70421a --- /dev/null +++ b/supabase/migrations/030_statcast_aggregates.sql @@ -0,0 +1,75 @@ +-- Layer 1 — MECHANISM DATA (Session 68). +-- Per-player-per-season Statcast aggregates. The HOT tier of the two-tier +-- mechanism pattern: small, indexed, joined at classification time. Raw +-- per-pitch stays out of Postgres on purpose (one season ~0.85 GB vs this +-- table's ~2,300 rows) — see docs/MECHANISM-DATA.md. +-- +-- The table is SPORT-SCOPED from day one: NBA tracking and NFL Next Gen land +-- in the same shape with a different `sport` and their own source ids. + +create table if not exists statcast_aggregates ( + sport text not null default 'mlb', + season int not null, + -- Source-native player id (MLB: MLBAM). The join key — an integer both + -- systems use natively, which is why the measured match rate is 100%. + source_id bigint not null, + -- Our canonical key. Nullable ON PURPOSE: a player Statcast has but we have + -- never graded still gets stored, and joins later. + player_key text, + player_name text, + role text not null check (role in ('batter','pitcher')), + -- Handedness: pitchers from the movement feed, batters from the roster join. + -- NULL = honest-absent, never guessed. + throws text, + bats text, + + -- Sample size — the gate for every downstream claim. + sample_pa numeric, + sample_ip numeric, + sample_bip numeric, + + -- Plate discipline / contact quality (shared vocabulary, both roles). + k_pct numeric, + bb_pct numeric, + whiff_pct numeric, + swing_pct numeric, + chase_pct numeric, + barrel_pct numeric, + hard_hit_pct numeric, + + -- Batter mechanism. + avg_exit_velo numeric, + max_exit_velo numeric, + avg_launch_angle numeric, + sweet_spot_pct numeric, + ev95_pct numeric, + + -- Pitcher mechanism. + arm_angle numeric, + gb_pct numeric, + fb_pct numeric, + ld_pct numeric, + pitch_mix jsonb, + + -- Everything else the feeds carry, verbatim. Layer 2/3 can reach a field we + -- did not promote to a column WITHOUT a re-ingest. + metrics jsonb not null default '{}'::jsonb, + + -- Freshness is a TRUTH property: the staleness alarm reads this, and no + -- surface may present a stale aggregate as current. + updated_at timestamptz not null default now(), + source text not null default 'baseball_savant', + + primary key (sport, season, source_id) +); + +create index if not exists statcast_agg_player_key_idx on statcast_aggregates (sport, season, player_key); +create index if not exists statcast_agg_role_idx on statcast_aggregates (sport, season, role); +create index if not exists statcast_agg_updated_idx on statcast_aggregates (updated_at desc); + +alter table statcast_aggregates enable row level security; + +-- Commodity public data: readable by anyone, written ONLY by the service role +-- (the pipeline). Same posture as the public ledger rows. +drop policy if exists statcast_agg_read on statcast_aggregates; +create policy statcast_agg_read on statcast_aggregates for select using (true); diff --git a/tests/unit/statcastAggregate.test.js b/tests/unit/statcastAggregate.test.js new file mode 100644 index 0000000..e88eb58 --- /dev/null +++ b/tests/unit/statcastAggregate.test.js @@ -0,0 +1,202 @@ +/* ============================================================ + Session 68 — LAYER 1: mechanism-data ingestion. + + Pure derivation + the honesty rules. No network, no database: the adapter's + fetch and the Supabase client are both injected. + ============================================================ */ + +const svc = require('../../src/services/statcastAggregateService'); +const adapter = require('../../src/services/adapters/statcastAdapter'); + +const { flipName, indexBy, indexPitchMix, BATTER_DISCIPLINE } = adapter.__internals; + +/** Minimal feed indexes, shaped exactly like adapter.fetchSeason() output. */ +function feeds({ batter = [], batterBB = [], pitcher = [], pitcherBB = [], mix = [] } = {}) { + return { + batterDiscipline: indexBy(batter, BATTER_DISCIPLINE), + batterBattedBall: indexBy(batterBB, adapter.__internals.BATTED_BALL), + pitcherDiscipline: indexBy(pitcher, adapter.__internals.PITCHER_DISCIPLINE), + pitcherBattedBall: indexBy(pitcherBB, adapter.__internals.BATTED_BALL), + pitchMix: indexPitchMix(mix), + counts: {}, + }; +} + +const BELL = { + 'last_name, first_name': 'Bell, Josh', player_id: '605137', pa: '387', + k_percent: '21.7', bb_percent: '7.5', whiff_percent: '24.8', swing_percent: '51', + oz_swing_percent: '30.6', barrel_batted_rate: '10.3', hard_hit_percent: '43.4', +}; +const SKUBAL = { + 'last_name, first_name': 'Skubal, Tarik', player_id: '669373', p_formatted_ip: '82.2', + k_percent: '30.5', whiff_percent: '32.1', groundballs_percent: '49', arm_angle: '46.9', +}; +const SKUBAL_MIX = { + 'last_name, first_name': 'Skubal, Tarik', pitcher_id: '669373', pitch_hand: 'L', + pitch_type: 'FF', pitch_type_name: '4-Seam Fastball', pitch_per: '0.371', + avg_speed: '96.7', pitcher_break_z_induced: '17.1', pitcher_break_x: '3.6', pitches_thrown: '463', +}; + +describe('adapter normalisation', () => { + it('flips Savant "Last, First" into a real name', () => { + expect(flipName('Bell, Josh')).toBe('Josh Bell'); + expect(flipName('Guerrero Jr., Vladimir')).toBe('Vladimir Guerrero Jr.'); + expect(flipName('Ohtani')).toBe('Ohtani'); + expect(flipName('')).toBeNull(); + }); + + it('normalises pitch usage from a FRACTION to a percentage', () => { + const [entry] = [...indexPitchMix([SKUBAL_MIX]).values()]; + expect(entry.pitches[0].usage_pct).toBe(37.1); // not 0.371 + expect(entry.throws).toBe('L'); + }); + + it('a missing metric is ABSENT, never 0', () => { + const [entry] = [...indexBy([{ 'last_name, first_name': 'X, Y', player_id: '1' }], BATTER_DISCIPLINE).values()]; + expect(entry.metrics.k_pct).toBeUndefined(); + expect(entry.metrics.whiff_pct).toBeUndefined(); + }); +}); + +describe('buildRows — derivation', () => { + const rows = () => svc.buildRows(2026, feeds({ + batter: [BELL], pitcher: [SKUBAL], mix: [SKUBAL_MIX], + }), { now: '2026-07-21T00:00:00.000Z' }); + + it('produces one row per player per role, keyed by the source id', () => { + const r = rows(); + expect(r).toHaveLength(2); + expect(r.find((x) => x.role === 'batter').source_id).toBe(605137); + expect(r.find((x) => x.role === 'pitcher').source_id).toBe(669373); + }); + + it('joins to our canonical player_key', () => { + const b = rows().find((x) => x.role === 'batter'); + expect(b.player_name).toBe('Josh Bell'); + expect(b.player_key).toBe(require('../../src/utils/playerName').nameKey('Josh Bell')); + }); + + it('carries pitcher handedness from the movement feed', () => { + expect(rows().find((x) => x.role === 'pitcher').throws).toBe('L'); + }); + + it('leaves batter handedness ABSENT (roster join, never guessed)', () => { + expect(rows().find((x) => x.role === 'batter').bats).toBeNull(); + }); + + it('flags thin samples rather than dropping or inflating them', () => { + const thin = svc.buildRows(2026, feeds({ + batter: [{ ...BELL, pa: '12' }], pitcher: [{ ...SKUBAL, p_formatted_ip: '2.1' }], + }), {}); + expect(thin.every((r) => r._sufficient === false)).toBe(true); + // Thin is STORED, not dropped — "thin" and "missing" are different claims. + expect(thin).toHaveLength(2); + expect(thin[0].sample_pa).toBe(12); + }); + + it('a player with no sample at all is insufficient, not zero', () => { + const [r] = svc.buildRows(2026, feeds({ batter: [{ 'last_name, first_name': 'A, B', player_id: '9' }] }), {}); + expect(r.sample_pa).toBeNull(); // NOT 0 + expect(r._sufficient).toBe(false); + expect(r.k_pct).toBeNull(); + }); + + it('keeps every raw metric in `metrics` so Layer 2/3 never needs a re-ingest', () => { + const b = rows().find((x) => x.role === 'batter'); + expect(b.metrics.chase_pct).toBe(30.6); + expect(b.chase_pct).toBe(30.6); + }); +}); + +describe('refreshSeason — the job', () => { + const okClient = () => { + const calls = []; + return { + calls, + from: () => ({ upsert: async (batch) => { calls.push(batch); return { error: null }; } }), + }; + }; + + it('backfill and refresh are the SAME idempotent call', async () => { + const fetchSeason = async () => feeds({ batter: [BELL], pitcher: [SKUBAL], mix: [SKUBAL_MIX] }); + const a = okClient(); const b = okClient(); + const r1 = await svc.refreshSeason({ supabase: a, fetchSeason, now: '2026-07-21T00:00:00.000Z' }); + const r2 = await svc.refreshSeason({ supabase: b, fetchSeason, now: '2026-07-21T00:00:00.000Z' }); + expect(r1.ok).toBe(true); + expect(r1.written).toBe(2); + expect(JSON.stringify(a.calls)).toBe(JSON.stringify(b.calls)); // identical → idempotent + }); + + it('upserts on the natural key so a re-run never duplicates', async () => { + let opts = null; + const sb = { from: () => ({ upsert: async (_b, o) => { opts = o; return { error: null }; } }) }; + await svc.refreshSeason({ supabase: sb, fetchSeason: async () => feeds({ batter: [BELL] }) }); + expect(opts.onConflict).toBe('sport,season,source_id'); + }); + + it('REFUSES to write when every feed is empty — a bad night cannot blank a good table', async () => { + const sb = okClient(); + const out = await svc.refreshSeason({ supabase: sb, fetchSeason: async () => feeds({}) }); + expect(out.ok).toBe(false); + expect(out.reason).toMatch(/refusing to write/); + expect(sb.calls).toHaveLength(0); + }); + + it('strips the internal flag before it reaches Postgres', async () => { + const sb = okClient(); + await svc.refreshSeason({ supabase: sb, fetchSeason: async () => feeds({ batter: [BELL] }) }); + expect(sb.calls[0][0]._sufficient).toBeUndefined(); + }); + + it('reports the join rate — the honest-absent rate for the mechanism tier', async () => { + const out = await svc.refreshSeason({ + supabase: okClient(), + fetchSeason: async () => feeds({ batter: [BELL, { player_id: '77', pa: '100' }] }), + }); + expect(out.joined).toBe(1); + expect(out.unjoined).toBe(1); // no name → no key → stored, joins later + }); +}); + +describe('staleness — never serve stale as fresh', () => { + it('fires past the max age', () => { + expect(svc.isStale({ updated_at: '2026-07-01T00:00:00Z', age_hours: 72 })).toBe(true); + expect(svc.isStale({ updated_at: '2026-07-20T00:00:00Z', age_hours: 6 })).toBe(false); + }); + + it('NEVER-BUILT is not STALE — different condition, different fix', () => { + // Paging on a fresh install teaches the operator to ignore the alarm. + expect(svc.isStale({ updated_at: null, age_hours: null })).toBe(false); + expect(svc.isStale(null)).toBe(false); + }); + + it('respects an explicit threshold', () => { + expect(svc.isStale({ updated_at: 'x', age_hours: 30 }, 24)).toBe(true); + expect(svc.isStale({ updated_at: 'x', age_hours: 30 }, 48)).toBe(false); + }); +}); + +describe('scheduler + route wiring', () => { + const fs = require('fs'); + const path = require('path'); + const read = (r) => fs.readFileSync(path.join(__dirname, '..', '..', r), 'utf8'); + + it('is server-scheduled with a kill switch', () => { + const s = read('src/snapshotScheduler.js'); + expect(s).toContain('STATCAST_HOUR_UTC'); + expect(s).toMatch(/process\.env\.STATCAST !== '0'/); + expect(s).toContain('refreshSeason'); + }); + + it('pages on BOTH a failed run and silent staleness', () => { + const s = read('src/snapshotScheduler.js'); + expect(s).toMatch(/Statcast refresh failed/); + expect(s).toMatch(/Statcast aggregates stale/); + }); + + it('is induce-able on demand (never wait on the cron)', () => { + const s = read('src/routes/internal.js'); + expect(s).toContain("router.post('/statcast/refresh'"); + expect(s).toContain("router.get('/statcast/status'"); + }); +}); diff --git a/web/public/sw.js b/web/public/sw.js index 7c0fc61..adce5af 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':'ab8abfd07f39ac406789faac7d61b363','url':'/_next/static/7Dodhuru02o3wduBgROGP/_buildManifest.js'},{'revision':'b6652df95db52feb4daf4eca35380933','url':'/_next/static/7Dodhuru02o3wduBgROGP/_ssgManifest.js'},{'revision':null,'url':'/_next/static/chunks/1079-cffc1eb37436de53.js'},{'revision':null,'url':'/_next/static/chunks/1393-e01c6861d0341a69.js'},{'revision':null,'url':'/_next/static/chunks/1896-a9d2dc75c88c85fb.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/3263-1fd6000d3a990905.js'},{'revision':null,'url':'/_next/static/chunks/4836-4871e0bacaaca435.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/5741-3085cade73716f0f.js'},{'revision':null,'url':'/_next/static/chunks/5838-7e0aa455e9f24259.js'},{'revision':null,'url':'/_next/static/chunks/6243-06350499fc86734c.js'},{'revision':null,'url':'/_next/static/chunks/7551-4c9aa7502ea6cc30.js'},{'revision':null,'url':'/_next/static/chunks/7602.2868ff821d53ee09.js'},{'revision':null,'url':'/_next/static/chunks/7918-b6bc29652564489b.js'},{'revision':null,'url':'/_next/static/chunks/8200-9a6d7728a5c09911.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-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/_not-found/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/about/page-70022fc79d67ea5a.js'},{'revision':null,'url':'/_next/static/chunks/app/account/page-9300f08c33aa8887.js'},{'revision':null,'url':'/_next/static/chunks/app/admin/page-43ddd38031c7119e.js'},{'revision':null,'url':'/_next/static/chunks/app/api/accuracy/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/admin/stats/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/books/%5B...path%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/checkout/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/combat/%5Bdate%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/content/%5B...path%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/desk-showcase/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/desk/pack/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/fight/%5Bid%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/founders/count/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/futures/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/gamelines/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/props/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/tonight/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hero-prop/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hotlist/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/intelligence/feed/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/accuracy/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/mine/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/model/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/lines/%5B...path%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/live/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/news/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/newsletter/subscribe/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/mlb/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/nba/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/soccer/%5Bleague%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/wnba/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/add-leg/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/calculate/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/grade/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/players/search/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/preferences/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/profiles/%5Bhandle%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/profiles/me/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/live/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/most-parlayed/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/top-graded/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/scan/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/injuries/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/lineups/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/pitchers/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/slips/parse/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/summary/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/cascade/%5Bplayer%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/depth/%5Bteam%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/leaders/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/lineup/%5Bteam%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/parlays-graded/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/pitcher/%5Bname%5D/arsenal/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/player/%5Bname%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/public/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/streaks/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stripe/portal/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/team/%5Babbr%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ticker/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/profile/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/recent-scans/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scan-meter/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scans/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/waitlist/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/webhook/nexapay/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/welcome-email/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/auth/callback/page-e6df9771a50edb87.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/%5Bslug%5D/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/compare/page-1119694e961d71c4.js'},{'revision':null,'url':'/_next/static/chunks/app/dashboard/page-aa1beeb392637aa1.js'},{'revision':null,'url':'/_next/static/chunks/app/desk/page-7acc556c00f487e5.js'},{'revision':null,'url':'/_next/static/chunks/app/explore/page-4c518cd2ef8bb2cd.js'},{'revision':null,'url':'/_next/static/chunks/app/fight/%5Bid%5D/page-308862cc7b686178.js'},{'revision':null,'url':'/_next/static/chunks/app/forgot-password/page-a251f52b4206e8d1.js'},{'revision':null,'url':'/_next/static/chunks/app/game/%5Bid%5D/page-0a74de29a6580a35.js'},{'revision':null,'url':'/_next/static/chunks/app/help/page-10e0eae5e4e1de7c.js'},{'revision':null,'url':'/_next/static/chunks/app/intelligence/page-af6b3ddd4f155539.js'},{'revision':null,'url':'/_next/static/chunks/app/invite/page-01dda8e223484025.js'},{'revision':null,'url':'/_next/static/chunks/app/layout-156f1e90da4ba847.js'},{'revision':null,'url':'/_next/static/chunks/app/ledger/page-d31795dedaf2ac88.js'},{'revision':null,'url':'/_next/static/chunks/app/login/page-869e21de85065bc1.js'},{'revision':null,'url':'/_next/static/chunks/app/marketplace/page-cbada49ae96a7527.js'},{'revision':null,'url':'/_next/static/chunks/app/methodology/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/not-found-aea5d97d52af5780.js'},{'revision':null,'url':'/_next/static/chunks/app/notifications/page-70022fc79d67ea5a.js'},{'revision':null,'url':'/_next/static/chunks/app/offline/page-a7a57ff039afc1af.js'},{'revision':null,'url':'/_next/static/chunks/app/onboarding/page-507c881a3cf2cdad.js'},{'revision':null,'url':'/_next/static/chunks/app/opengraph-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/page-42fce85acbf93cb7.js'},{'revision':null,'url':'/_next/static/chunks/app/parlay/page-9fb644e7cfb54cb7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/layout-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/opengraph-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/page-dc02d996495083aa.js'},{'revision':null,'url':'/_next/static/chunks/app/pricing/page-7719f6003ec52cfd.js'},{'revision':null,'url':'/_next/static/chunks/app/privacy/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/profile/page-8bb575ea4a91bfdb.js'},{'revision':null,'url':'/_next/static/chunks/app/report/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/responsible-gambling/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/scan/page-a0e172f0361a0d79.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/page-9bf003e5a54e5190.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/security/page-f0d118bb0bf17bf8.js'},{'revision':null,'url':'/_next/static/chunks/app/signup/page-d34a7133af025c69.js'},{'revision':null,'url':'/_next/static/chunks/app/slip/page-32a5d1ace27127d2.js'},{'revision':null,'url':'/_next/static/chunks/app/soccer/page-3ae10f80a7ebddf9.js'},{'revision':null,'url':'/_next/static/chunks/app/team/%5Babbr%5D/page-bde75cf1101ae726.js'},{'revision':null,'url':'/_next/static/chunks/app/terminal/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/terms/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/tracker/page-2ce2d278c7e0ed48.js'},{'revision':null,'url':'/_next/static/chunks/app/twitter-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/opengraph-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/page-252629d55ee3c82b.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/portrait/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/cancel/page-3702e818a6853705.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/desk/page-0709bc8c6f29ea65.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/success/page-dc7c14a4f1c96dbd.js'},{'revision':null,'url':'/_next/static/chunks/app/verify/page-b121fa98601397d8.js'},{'revision':null,'url':'/_next/static/chunks/app/welcome/page-028357260721a9f9.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-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/forbidden-a2e62102f89140a7.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-a2e62102f89140a7.js'},{'revision':'846118c33b2c0e922d7b3a7676f81f6f','url':'/_next/static/chunks/polyfills-42372ed130431b0a.js'},{'revision':null,'url':'/_next/static/chunks/webpack-c39c325c0a9c381a.js'},{'revision':null,'url':'/_next/static/css/fe8315bb5b899fa0.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.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.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.woff2'},{'revision':'e71a597e376ed91862e822b5a5de8c04','url':'/_next/static/media/db96af6b531dc71f-s.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':'300b6bcc84329321d40dec63416e9566','url':'/books/bet365.svg'},{'revision':'c5d3df8f35278d119bacd44726536a53','url':'/books/betmgm.svg'},{'revision':'c0898e8b017d76457549b49df00d78dd','url':'/books/betrivers.svg'},{'revision':'8acaa0c6c9c413fe01caf8f5d9cf1ac3','url':'/books/caesars.svg'},{'revision':'7fbceb80c3466f82e5cebed0f84d00f4','url':'/books/draftkings.svg'},{'revision':'d275072bd73625ea22826b370fed3697','url':'/books/fanduel.svg'},{'revision':'8457294d0c8dcb63396875c6ae594dc2','url':'/books/hardrockbet.svg'},{'revision':'77bafdb1e2a6ff85e34038ad06a9fa31','url':'/books/pinnacle.svg'},{'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':'1cd41b3d92ff160c4635a1ee75bbc34b','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':'ab8abfd07f39ac406789faac7d61b363','url':'/_next/static/X7on3Xl8rhEVp1FUAER24/_buildManifest.js'},{'revision':'b6652df95db52feb4daf4eca35380933','url':'/_next/static/X7on3Xl8rhEVp1FUAER24/_ssgManifest.js'},{'revision':null,'url':'/_next/static/chunks/1079-cffc1eb37436de53.js'},{'revision':null,'url':'/_next/static/chunks/1393-e01c6861d0341a69.js'},{'revision':null,'url':'/_next/static/chunks/1896-a9d2dc75c88c85fb.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/3263-1fd6000d3a990905.js'},{'revision':null,'url':'/_next/static/chunks/4836-4871e0bacaaca435.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/5741-3085cade73716f0f.js'},{'revision':null,'url':'/_next/static/chunks/5838-7e0aa455e9f24259.js'},{'revision':null,'url':'/_next/static/chunks/6243-06350499fc86734c.js'},{'revision':null,'url':'/_next/static/chunks/7551-4c9aa7502ea6cc30.js'},{'revision':null,'url':'/_next/static/chunks/7602.2868ff821d53ee09.js'},{'revision':null,'url':'/_next/static/chunks/7918-b6bc29652564489b.js'},{'revision':null,'url':'/_next/static/chunks/8200-9a6d7728a5c09911.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-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/_not-found/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/about/page-70022fc79d67ea5a.js'},{'revision':null,'url':'/_next/static/chunks/app/account/page-9300f08c33aa8887.js'},{'revision':null,'url':'/_next/static/chunks/app/admin/page-43ddd38031c7119e.js'},{'revision':null,'url':'/_next/static/chunks/app/api/accuracy/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/admin/stats/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/books/%5B...path%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/checkout/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/combat/%5Bdate%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/content/%5B...path%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/desk-showcase/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/desk/pack/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/fight/%5Bid%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/founders/count/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/futures/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/gamelines/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/props/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/%5Bid%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/games/tonight/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hero-prop/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/hotlist/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/intelligence/feed/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/accuracy/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/mine/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/model/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ledger/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/lines/%5B...path%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/live/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/news/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/newsletter/subscribe/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/mlb/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/nba/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/soccer/%5Bleague%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/odds/wnba/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/add-leg/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/calculate/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/parlay/grade/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/players/search/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/preferences/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/profiles/%5Bhandle%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/profiles/me/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/live/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/most-parlayed/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/props/top-graded/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/scan/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/injuries/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/lineups/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/pitchers/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/schedule/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/slips/parse/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/snapshot/summary/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/cascade/%5Bplayer%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/depth/%5Bteam%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/leaders/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/lineup/%5Bteam%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/parlays-graded/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/pitcher/%5Bname%5D/arsenal/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/player/%5Bname%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stats/public/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/streaks/%5Bsport%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/stripe/portal/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/team/%5Babbr%5D/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/ticker/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/profile/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/recent-scans/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scan-meter/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/user/scans/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/waitlist/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/webhook/nexapay/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/api/welcome-email/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/auth/callback/page-e6df9771a50edb87.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/%5Bslug%5D/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/blog/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/compare/page-1119694e961d71c4.js'},{'revision':null,'url':'/_next/static/chunks/app/dashboard/page-aa1beeb392637aa1.js'},{'revision':null,'url':'/_next/static/chunks/app/desk/page-7acc556c00f487e5.js'},{'revision':null,'url':'/_next/static/chunks/app/explore/page-4c518cd2ef8bb2cd.js'},{'revision':null,'url':'/_next/static/chunks/app/fight/%5Bid%5D/page-308862cc7b686178.js'},{'revision':null,'url':'/_next/static/chunks/app/forgot-password/page-a251f52b4206e8d1.js'},{'revision':null,'url':'/_next/static/chunks/app/game/%5Bid%5D/page-0a74de29a6580a35.js'},{'revision':null,'url':'/_next/static/chunks/app/help/page-10e0eae5e4e1de7c.js'},{'revision':null,'url':'/_next/static/chunks/app/intelligence/page-af6b3ddd4f155539.js'},{'revision':null,'url':'/_next/static/chunks/app/invite/page-01dda8e223484025.js'},{'revision':null,'url':'/_next/static/chunks/app/layout-156f1e90da4ba847.js'},{'revision':null,'url':'/_next/static/chunks/app/ledger/page-d31795dedaf2ac88.js'},{'revision':null,'url':'/_next/static/chunks/app/login/page-869e21de85065bc1.js'},{'revision':null,'url':'/_next/static/chunks/app/marketplace/page-cbada49ae96a7527.js'},{'revision':null,'url':'/_next/static/chunks/app/methodology/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/not-found-aea5d97d52af5780.js'},{'revision':null,'url':'/_next/static/chunks/app/notifications/page-70022fc79d67ea5a.js'},{'revision':null,'url':'/_next/static/chunks/app/offline/page-a7a57ff039afc1af.js'},{'revision':null,'url':'/_next/static/chunks/app/onboarding/page-507c881a3cf2cdad.js'},{'revision':null,'url':'/_next/static/chunks/app/opengraph-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/page-42fce85acbf93cb7.js'},{'revision':null,'url':'/_next/static/chunks/app/parlay/page-9fb644e7cfb54cb7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/layout-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/opengraph-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/player/%5Bname%5D/page-dc02d996495083aa.js'},{'revision':null,'url':'/_next/static/chunks/app/pricing/page-7719f6003ec52cfd.js'},{'revision':null,'url':'/_next/static/chunks/app/privacy/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/profile/page-8bb575ea4a91bfdb.js'},{'revision':null,'url':'/_next/static/chunks/app/report/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/responsible-gambling/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/scan/page-a0e172f0361a0d79.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/page-9bf003e5a54e5190.js'},{'revision':null,'url':'/_next/static/chunks/app/settings/security/page-f0d118bb0bf17bf8.js'},{'revision':null,'url':'/_next/static/chunks/app/signup/page-d34a7133af025c69.js'},{'revision':null,'url':'/_next/static/chunks/app/slip/page-32a5d1ace27127d2.js'},{'revision':null,'url':'/_next/static/chunks/app/soccer/page-3ae10f80a7ebddf9.js'},{'revision':null,'url':'/_next/static/chunks/app/team/%5Babbr%5D/page-bde75cf1101ae726.js'},{'revision':null,'url':'/_next/static/chunks/app/terminal/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/terms/page-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/tracker/page-2ce2d278c7e0ed48.js'},{'revision':null,'url':'/_next/static/chunks/app/twitter-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/opengraph-image/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/page-252629d55ee3c82b.js'},{'revision':null,'url':'/_next/static/chunks/app/u/%5Bhandle%5D/portrait/route-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/cancel/page-3702e818a6853705.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/desk/page-0709bc8c6f29ea65.js'},{'revision':null,'url':'/_next/static/chunks/app/upgrade/success/page-dc7c14a4f1c96dbd.js'},{'revision':null,'url':'/_next/static/chunks/app/verify/page-b121fa98601397d8.js'},{'revision':null,'url':'/_next/static/chunks/app/welcome/page-028357260721a9f9.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-a2e62102f89140a7.js'},{'revision':null,'url':'/_next/static/chunks/next/dist/client/components/builtin/forbidden-a2e62102f89140a7.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-a2e62102f89140a7.js'},{'revision':'846118c33b2c0e922d7b3a7676f81f6f','url':'/_next/static/chunks/polyfills-42372ed130431b0a.js'},{'revision':null,'url':'/_next/static/chunks/webpack-c39c325c0a9c381a.js'},{'revision':null,'url':'/_next/static/css/fe8315bb5b899fa0.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.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.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.woff2'},{'revision':'e71a597e376ed91862e822b5a5de8c04','url':'/_next/static/media/db96af6b531dc71f-s.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':'300b6bcc84329321d40dec63416e9566','url':'/books/bet365.svg'},{'revision':'c5d3df8f35278d119bacd44726536a53','url':'/books/betmgm.svg'},{'revision':'c0898e8b017d76457549b49df00d78dd','url':'/books/betrivers.svg'},{'revision':'8acaa0c6c9c413fe01caf8f5d9cf1ac3','url':'/books/caesars.svg'},{'revision':'7fbceb80c3466f82e5cebed0f84d00f4','url':'/books/draftkings.svg'},{'revision':'d275072bd73625ea22826b370fed3697','url':'/books/fanduel.svg'},{'revision':'8457294d0c8dcb63396875c6ae594dc2','url':'/books/hardrockbet.svg'},{'revision':'77bafdb1e2a6ff85e34038ad06a9fa31','url':'/books/pinnacle.svg'},{'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':'1cd41b3d92ff160c4635a1ee75bbc34b','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