/* BT search v1 (2026-11-18): Search row in the mobile menu + "Tools" shortcuts inside Ghost's search window */ (function () { if (window.btSearchV1) return; window.btSearchV1 = 1; var B = 'https://baseballthings.com'; var T = [ ['Hot Stove GM', '/hot-stove-gm/', 'Build the Mariners offseason yourself', 'gm general manager offseason simulator sim mock'], ['Hot Stove Tracker', '/hot-stove-tracker/', 'Every MLB move this offseason', 'moves signings trades deals offseason hot stove'], ['Free Agent Tracker', '/free-agent-tracker/', 'Every MLB and MiLB free agent', 'fa free agents agency signings available'], ['Arbitration Tracker', '/arbitration-tracker/', 'Arbitration-eligible players and salaries', 'arb arbitration salary salaries eligible'], ['Contention Index', '/contention-index/', 'All 30 clubs ranked on contention', 'contention playoff rankings teams index power'], ['Trade Tree', '/mariners-dipoto-trade-tree/', 'Every Dipoto trade and what it became', 'trades trade tree dipoto'], ['Contract Value Board', '/mariners-dipoto-contract-board/', 'Mariners contracts graded by value', 'contracts contract value extensions'], ['Rule 5 Tracker', '/rule-5-tracker/', 'Rule 5 eligibility for all 30 teams', 'rule 5 five draft protected 40-man forty eligible'], ['Draft Scorecard', '/mariners-draft-dipoto-hunter/', 'Mariners drafts under Dipoto and Hunter', 'draft drafts scorecard hunter picks'], ['Player Comparison', '/mlb-player-compare/', 'Compare MLB players side by side', 'compare comparison stats versus vs'], ['Prospect Rankings Live', '/prospect-rankings-live/', 'Mariners prospect rankings, kept current', 'prospects prospect rankings top farm'], ['Prospect Leaderboards', '/prospects-stats-leaderboards-2026/', 'Minor league stat leaderboards', 'leaderboards leaders stats minors milb minor league prospects'], ['Fall & Winter Ball', '/prospects-afl-winter-stats/', 'Arizona Fall League and winter ball stats', 'afl arizona fall winter ball league stats'], ['Mariners Roster', '/mariners-roster/', 'The current 40-man roster', 'roster 40-man forty mariners'], ['Depth Chart', '/mariners-depth-chart/', 'Mariners depth chart by position', 'depth chart lineup rotation bullpen'], ['Transactions', '/transactions/', 'Every roster move, as it happens', 'transactions moves news'], ['Players A–Z', '/players/', 'Player pages for every 40-man roster', 'players player pages a-z'], ['MLB Teams', '/teams/', 'All 30 clubs', 'teams clubs mlb'], ['Series Preview', '/series-preview/', 'The next Mariners series, previewed', 'series preview schedule matchup'], ['Subscribe', '/subscribe/', 'Plans and prices', 'subscribe plans membership price prices join sign up'], ['Patreon', '/patreon/', 'Support Baseball Things on Patreon', 'patreon support'] ]; function norm(s) { return (s || '').toLowerCase().replace(/[–—]/g, '-').replace(/[^a-z0-9\- ]+/g, ' ').replace(/\s+/g, ' ').trim(); } function match(q) { q = norm(q); if (q.length < 2) return []; var qw = q.split(' '), out = []; T.forEach(function (t) { var name = norm(t[0]), words = (name + ' ' + norm(t[3])).split(' '), score = 0; if (name === q) score = 100; else if (q.length <= 3 && words.indexOf(q) > -1) score = 90; else if (name.indexOf(q) === 0) score = 80; else if (name.indexOf(q) > -1) score = 60; else if (words.indexOf(q) > -1) score = 50; else if (qw.every(function (w) { return words.some(function (x) { return x.indexOf(w) === 0; }); })) score = 40; if (score) out.push([score, t]); }); out.sort(function (a, b) { return b[0] - a[0]; }); return out.slice(0, 4).map(function (x) { return x[1]; }); } function esc(s) { return s.replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); } /* Tools group inside the search window (Ghost's search runs in a same-origin iframe) */ function render(d) { var dlg = d.querySelector('[role=dialog]'), inp = d.querySelector('input'); if (!dlg || !inp) return; var box = d.getElementById('bt-tools'); var hits = match(inp.value); if (!hits.length) { if (box) box.remove(); return; } if (!box) { box = d.createElement('div'); box.id = 'bt-tools'; box.setAttribute('style', 'border-top:1px solid #e5e5e5;padding:12px 0 6px;background:#fff;position:relative;z-index:5'); } var anchor = dlg.firstElementChild; if (box.parentNode !== dlg || box.previousElementSibling !== anchor) dlg.insertBefore(box, anchor ? anchor.nextSibling : dlg.firstChild); var key = hits.map(function (t) { return t[1]; }).join(); if (box.getAttribute('data-k') === key) return; box.setAttribute('data-k', key); var pad = d.defaultView.innerWidth >= 640 ? '28px' : '16px'; box.innerHTML = '