(() => { const B = [ { time: "8:00", date: "2025-11-29", team1: 1, team2: 2, refTeam: 3, court: 1, division: "B", location: "Reckord Armory" }, { time: "8:00", date: "2025-11-29", team1: 4, team2: 5, refTeam: 6, court: 2, division: "B", location: "Reckord Armory" }, { time: "8:00", date: "2025-11-29", team1: 10, team2: 11, refTeam: 12, court: 3, division: "B", location: "Reckord Armory" }, { time: "8:00", date: "2025-11-29", team1: 13, team2: 14, refTeam: 15, court: 4, division: "B", location: "Reckord Armory" }, { time: "8:00", date: "2025-11-29", team1: 19, team2: 20, refTeam: 21, court: 5, division: "B", location: "Reckord Armory" }, { time: "8:00", date: "2025-11-29", team1: 22, team2: 23, refTeam: 24, court: 6, division: "B", location: "Reckord Armory" }, { time: "8:00", date: "2025-11-29", team1: 53, team2: 54, refTeam: 55, court: 7, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "8:00", date: "2025-11-29", team1: 57, team2: 58, refTeam: 59, court: 8, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "8:40", date: "2025-11-29", team1: 1, team2: 3, refTeam: 2, court: 1, division: "B", location: "Reckord Armory" }, { time: "8:40", date: "2025-11-29", team1: 7, team2: 8, refTeam: 9, court: 2, division: "B", location: "Reckord Armory" }, { time: "8:40", date: "2025-11-29", team1: 10, team2: 12, refTeam: 11, court: 3, division: "B", location: "Reckord Armory" }, { time: "8:40", date: "2025-11-29", team1: 16, team2: 17, refTeam: 18, court: 4, division: "B", location: "Reckord Armory" }, { time: "8:40", date: "2025-11-29", team1: 19, team2: 21, refTeam: 20, court: 5, division: "B", location: "Reckord Armory" }, { time: "8:40", date: "2025-11-29", team1: 25, team2: 26, refTeam: 27, court: 6, division: "B", location: "Reckord Armory" }, { time: "8:40", date: "2025-11-29", team1: 55, team2: 56, refTeam: 54, court: 7, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "8:40", date: "2025-11-29", team1: 59, team2: 60, refTeam: 58, court: 8, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "9:20", date: "2025-11-29", team1: 4, team2: 6, refTeam: 5, court: 1, division: "B", location: "Reckord Armory" }, { time: "9:20", date: "2025-11-29", team1: 7, team2: 9, refTeam: 8, court: 2, division: "B", location: "Reckord Armory" }, { time: "9:20", date: "2025-11-29", team1: 13, team2: 15, refTeam: 14, court: 3, division: "B", location: "Reckord Armory" }, { time: "9:20", date: "2025-11-29", team1: 16, team2: 18, refTeam: 17, court: 4, division: "B", location: "Reckord Armory" }, { time: "9:20", date: "2025-11-29", team1: 22, team2: 24, refTeam: 23, court: 5, division: "B", location: "Reckord Armory" }, { time: "9:20", date: "2025-11-29", team1: 25, team2: 27, refTeam: 26, court: 6, division: "B", location: "Reckord Armory" }, { time: "9:20", date: "2025-11-29", team1: 54, team2: 56, refTeam: 53, court: 7, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "9:20", date: "2025-11-29", team1: 58, team2: 60, refTeam: 57, court: 8, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "10:00", date: "2025-11-29", team1: 5, team2: 6, refTeam: 4, court: 1, division: "B", location: "Reckord Armory" }, { time: "10:00", date: "2025-11-29", team1: 2, team2: 3, refTeam: 1, court: 2, division: "B", location: "Reckord Armory" }, { time: "10:00", date: "2025-11-29", team1: 14, team2: 15, refTeam: 13, court: 3, division: "B", location: "Reckord Armory" }, { time: "10:00", date: "2025-11-29", team1: 11, team2: 12, refTeam: 10, court: 4, division: "B", location: "Reckord Armory" }, { time: "10:00", date: "2025-11-29", team1: 23, team2: 24, refTeam: 22, court: 5, division: "B", location: "Reckord Armory" }, { time: "10:00", date: "2025-11-29", team1: 20, team2: 21, refTeam: 19, court: 6, division: "B", location: "Reckord Armory" }, { time: "10:00", date: "2025-11-29", team1: 53, team2: 55, refTeam: 56, court: 7, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "10:00", date: "2025-11-29", team1: 57, team2: 59, refTeam: 60, court: 8, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "10:40", date: "2025-11-29", team1: 8, team2: 9, refTeam: 5, court: 1, division: "B", location: "Reckord Armory" }, { time: "10:40", date: "2025-11-29", team1: 1, team2: 4, refTeam: 7, court: 2, division: "B", location: "Reckord Armory" }, { time: "10:40", date: "2025-11-29", team1: 17, team2: 18, refTeam: 14, court: 3, division: "B", location: "Reckord Armory" }, { time: "10:40", date: "2025-11-29", team1: 10, team2: 13, refTeam: 16, court: 4, division: "B", location: "Reckord Armory" }, { time: "10:40", date: "2025-11-29", team1: 26, team2: 27, refTeam: 23, court: 5, division: "B", location: "Reckord Armory" }, { time: "10:40", date: "2025-11-29", team1: 19, team2: 22, refTeam: 25, court: 6, division: "B", location: "Reckord Armory" }, { time: "10:40", date: "2025-11-29", team1: 53, team2: 57, refTeam: 55, court: 7, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "10:40", date: "2025-11-29", team1: 54, team2: 58, refTeam: 59, court: 8, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "11:20", date: "2025-11-29", team1: 2, team2: 5, refTeam: 8, court: 1, division: "B", location: "Reckord Armory" }, { time: "11:20", date: "2025-11-29", team1: 1, team2: 7, refTeam: 4, court: 2, division: "B", location: "Reckord Armory" }, { time: "11:20", date: "2025-11-29", team1: 11, team2: 14, refTeam: 17, court: 3, division: "B", location: "Reckord Armory" }, { time: "11:20", date: "2025-11-29", team1: 10, team2: 16, refTeam: 13, court: 4, division: "B", location: "Reckord Armory" }, { time: "11:20", date: "2025-11-29", team1: 20, team2: 23, refTeam: 26, court: 5, division: "B", location: "Reckord Armory" }, { time: "11:20", date: "2025-11-29", team1: 19, team2: 25, refTeam: 22, court: 6, division: "B", location: "Reckord Armory" }, { time: "11:20", date: "2025-11-29", team1: 55, team2: 59, refTeam: 54, court: 7, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "11:20", date: "2025-11-29", team1: 56, team2: 60, refTeam: 58, court: 8, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "12:00", date: "2025-11-29", team1: 2, team2: 8, refTeam: 7, court: 1, division: "B", location: "Reckord Armory" }, { time: "12:00", date: "2025-11-29", team1: 3, team2: 6, refTeam: 9, court: 2, division: "B", location: "Reckord Armory" }, { time: "12:00", date: "2025-11-29", team1: 11, team2: 17, refTeam: 16, court: 3, division: "B", location: "Reckord Armory" }, { time: "12:00", date: "2025-11-29", team1: 12, team2: 15, refTeam: 18, court: 4, division: "B", location: "Reckord Armory" }, { time: "12:00", date: "2025-11-29", team1: 20, team2: 26, refTeam: 25, court: 5, division: "B", location: "Reckord Armory" }, { time: "12:00", date: "2025-11-29", team1: 21, team2: 24, refTeam: 27, court: 6, division: "B", location: "Reckord Armory" }, { time: "12:00", date: "2025-11-29", team1: 53, team2: 59, refTeam: 56, court: 7, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "12:00", date: "2025-11-29", team1: 55, team2: 57, refTeam: 60, court: 8, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "12:40", date: "2025-11-29", team1: 4, team2: 7, refTeam: 1, court: 1, division: "B", location: "Reckord Armory" }, { time: "12:40", date: "2025-11-29", team1: 3, team2: 9, refTeam: 6, court: 2, division: "B", location: "Reckord Armory" }, { time: "12:40", date: "2025-11-29", team1: 13, team2: 16, refTeam: 10, court: 3, division: "B", location: "Reckord Armory" }, { time: "12:40", date: "2025-11-29", team1: 12, team2: 18, refTeam: 15, court: 4, division: "B", location: "Reckord Armory" }, { time: "12:40", date: "2025-11-29", team1: 22, team2: 25, refTeam: 19, court: 5, division: "B", location: "Reckord Armory" }, { time: "12:40", date: "2025-11-29", team1: 21, team2: 27, refTeam: 24, court: 6, division: "B", location: "Reckord Armory" }, { time: "12:40", date: "2025-11-29", team1: 54, team2: 60, refTeam: 53, court: 7, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "12:40", date: "2025-11-29", team1: 56, team2: 58, refTeam: 57, court: 8, division: "Mod A1", location: "Ritchie Coliseum" }, { time: "13:20", date: "2025-11-29", team1: 5, team2: 8, refTeam: 2, court: 1, division: "B", location: "Reckord Armory" }, { time: "13:20", date: "2025-11-29", team1: 6, team2: 9, refTeam: 3, court: 2, division: "B", location: "Reckord Armory" }, { time: "13:20", date: "2025-11-29", team1: 14, team2: 17, refTeam: 11, court: 3, division: "B", location: "Reckord Armory" }, { time: "13:20", date: "2025-11-29", team1: 15, team2: 18, refTeam: 12, court: 4, division: "B", location: "Reckord Armory" }, { time: "13:20", date: "2025-11-29", team1: 23, team2: 26, refTeam: 20, court: 5, division: "B", location: "Reckord Armory" }, { time: "13:20", date: "2025-11-29", team1: 24, team2: 27, refTeam: 21, court: 6, division: "B", location: "Reckord Armory" }, { time: "13:20", date: "2025-11-29", team1: 28, team2: 31, refTeam: 29, court: 7, division: "BB", location: "Ritchie Coliseum" }, { time: "13:20", date: "2025-11-29", team1: 34, team2: 30, refTeam: 33, court: 8, division: "BB", location: "Ritchie Coliseum" }, { time: "14:00", date: "2025-11-29", team1: 35, team2: 36, refTeam: 37, court: 1, division: "BB", location: "Reckord Armory" }, { time: "14:00", date: "2025-11-29", team1: 38, team2: 39, refTeam: 40, court: 2, division: "BB", location: "Reckord Armory" }, { time: "14:00", date: "2025-11-29", team1: 41, team2: 42, refTeam: 43, court: 3, division: "BB", location: "Reckord Armory" }, { time: "14:00", date: "2025-11-29", team1: 44, team2: 45, refTeam: 46, court: 4, division: "BB", location: "Reckord Armory" }, { time: "14:00", date: "2025-11-29", team1: 47, team2: 48, refTeam: 49, court: 5, division: "BB", location: "Reckord Armory" }, { time: "14:00", date: "2025-11-29", team1: 50, team2: 51, refTeam: 52, court: 6, division: "BB", location: "Reckord Armory" }, { time: "14:00", date: "2025-11-29", team1: 28, team2: 32, refTeam: 31, court: 7, division: "BB", location: "Ritchie Coliseum" }, { time: "14:00", date: "2025-11-29", team1: 29, team2: 33, refTeam: 34, court: 8, division: "BB", location: "Ritchie Coliseum" }, { time: "14:40", date: "2025-11-29", team1: 35, team2: 37, refTeam: 36, court: 1, division: "BB", location: "Reckord Armory" }, { time: "14:40", date: "2025-11-29", team1: 38, team2: 40, refTeam: 39, court: 2, division: "BB", location: "Reckord Armory" }, { time: "14:40", date: "2025-11-29", team1: 41, team2: 43, refTeam: 42, court: 3, division: "BB", location: "Reckord Armory" }, { time: "14:40", date: "2025-11-29", team1: 44, team2: 46, refTeam: 45, court: 4, division: "BB", location: "Reckord Armory" }, { time: "14:40", date: "2025-11-29", team1: 47, team2: 49, refTeam: 48, court: 5, division: "BB", location: "Reckord Armory" }, { time: "14:40", date: "2025-11-29", team1: 50, team2: 52, refTeam: 51, court: 6, division: "BB", location: "Reckord Armory" }, { time: "14:40", date: "2025-11-29", team1: 31, team2: 34, refTeam: 28, court: 7, division: "BB", location: "Ritchie Coliseum" }, { time: "14:40", date: "2025-11-29", team1: 30, team2: 33, refTeam: 32, court: 8, division: "BB", location: "Ritchie Coliseum" }, { time: "15:20", date: "2025-11-29", team1: 36, team2: 37, refTeam: 35, court: 1, division: "BB", location: "Reckord Armory" }, { time: "15:20", date: "2025-11-29", team1: 39, team2: 40, refTeam: 38, court: 2, division: "BB", location: "Reckord Armory" }, { time: "15:20", date: "2025-11-29", team1: 42, team2: 43, refTeam: 41, court: 3, division: "BB", location: "Reckord Armory" }, { time: "15:20", date: "2025-11-29", team1: 45, team2: 46, refTeam: 44, court: 4, division: "BB", location: "Reckord Armory" }, { time: "15:20", date: "2025-11-29", team1: 48, team2: 49, refTeam: 47, court: 5, division: "BB", location: "Reckord Armory" }, { time: "15:20", date: "2025-11-29", team1: 51, team2: 52, refTeam: 50, court: 6, division: "BB", location: "Reckord Armory" }, { time: "15:20", date: "2025-11-29", team1: 28, team2: 34, refTeam: 31, court: 7, division: "BB", location: "Ritchie Coliseum" }, { time: "15:20", date: "2025-11-29", team1: 32, team2: 29, refTeam: 30, court: 8, division: "BB", location: "Ritchie Coliseum" }, { time: "16:00", date: "2025-11-29", team1: 35, team2: 39, refTeam: 40, court: 1, division: "BB", location: "Reckord Armory" }, { time: "16:00", date: "2025-11-29", team1: 36, team2: 38, refTeam: 37, court: 2, division: "BB", location: "Reckord Armory" }, { time: "16:00", date: "2025-11-29", team1: 41, team2: 45, refTeam: 46, court: 3, division: "BB", location: "Reckord Armory" }, { time: "16:00", date: "2025-11-29", team1: 42, team2: 44, refTeam: 43, court: 4, division: "BB", location: "Reckord Armory" }, { time: "16:00", date: "2025-11-29", team1: 47, team2: 51, refTeam: 52, court: 5, division: "BB", location: "Reckord Armory" }, { time: "16:00", date: "2025-11-29", team1: 48, team2: 50, refTeam: 49, court: 6, division: "BB", location: "Reckord Armory" }, { time: "16:00", date: "2025-11-29", team1: 33, team2: 32, refTeam: 34, court: 7, division: "BB", location: "Ritchie Coliseum" }, { time: "16:00", date: "2025-11-29", team1: 31, team2: 30, refTeam: 29, court: 8, division: "BB", location: "Ritchie Coliseum" }, { time: "16:40", date: "2025-11-29", team1: 35, team2: 40, refTeam: 36, court: 1, division: "BB", location: "Reckord Armory" }, { time: "16:40", date: "2025-11-29", team1: 37, team2: 38, refTeam: 39, court: 2, division: "BB", location: "Reckord Armory" }, { time: "16:40", date: "2025-11-29", team1: 41, team2: 46, refTeam: 42, court: 3, division: "BB", location: "Reckord Armory" }, { time: "16:40", date: "2025-11-29", team1: 43, team2: 44, refTeam: 45, court: 4, division: "BB", location: "Reckord Armory" }, { time: "16:40", date: "2025-11-29", team1: 47, team2: 52, refTeam: 48, court: 5, division: "BB", location: "Reckord Armory" }, { time: "16:40", date: "2025-11-29", team1: 49, team2: 50, refTeam: 51, court: 6, division: "BB", location: "Reckord Armory" }, { time: "16:40", date: "2025-11-29", team1: 33, team2: 34, refTeam: 32, court: 7, division: "BB", location: "Ritchie Coliseum" }, { time: "16:40", date: "2025-11-29", team1: 28, team2: 29, refTeam: 30, court: 8, division: "BB", location: "Ritchie Coliseum" }, { time: "17:20", date: "2025-11-29", team1: 36, team2: 40, refTeam: 35, court: 1, division: "BB", location: "Reckord Armory" }, { time: "17:20", date: "2025-11-29", team1: 37, team2: 39, refTeam: 38, court: 2, division: "BB", location: "Reckord Armory" }, { time: "17:20", date: "2025-11-29", team1: 42, team2: 46, refTeam: 41, court: 3, division: "BB", location: "Reckord Armory" }, { time: "17:20", date: "2025-11-29", team1: 43, team2: 45, refTeam: 44, court: 4, division: "BB", location: "Reckord Armory" }, { time: "17:20", date: "2025-11-29", team1: 48, team2: 52, refTeam: 47, court: 5, division: "BB", location: "Reckord Armory" }, { time: "17:20", date: "2025-11-29", team1: 49, team2: 51, refTeam: 50, court: 6, division: "BB", location: "Reckord Armory" }, { time: "17:20", date: "2025-11-29", team1: 32, team2: 31, refTeam: 33, court: 7, division: "BB", location: "Ritchie Coliseum" }, { time: "17:20", date: "2025-11-29", team1: 30, team2: 29, refTeam: 28, court: 8, division: "BB", location: "Ritchie Coliseum" } ], O = [ { id: 1, name: "DC District Tips", division: "B" }, { id: 2, name: "NY Baddies NYC", division: "B" }, { id: 3, name: "SC Hotrods", division: "B" }, { id: 4, name: "NY Dyosas", division: "B" }, { id: 5, name: "DC Charcoochierie", division: "B" }, { id: 6, name: "BAL Volley of the Dolls", division: "B" }, { id: 7, name: "MGT Mean Gurlz", division: "B" }, { id: 8, name: "RAL Real Hot Girls Hit", division: "B" }, { id: 9, name: "DMV Kitten Nuggets", division: "B" }, { id: 10, name: "DC Good Boys", division: "B" }, { id: 11, name: "NY One Piece", division: "B" }, { id: 12, name: "CLT Like It Tight", division: "B" }, { id: 13, name: "PIT Girl Car", division: "B" }, { id: 14, name: "DC Total Chaos", division: "B" }, { id: 15, name: "NO Krewe", division: "B" }, { id: 16, name: "NY Pisco Sour", division: "B" }, { id: 17, name: "STL Punk Block Princesses", division: "B" }, { id: 18, name: "DC Cherry Blossom Buds", division: "B" }, { id: 19, name: "DMV Brother Husbands", division: "B" }, { id: 20, name: "NY Fiyerhoes", division: "B" }, { id: 21, name: "Conegliano Imoco", division: "B" }, { id: 22, name: "USA Bakla Ka!", division: "B" }, { id: 23, name: "DC Pink Flamingos", division: "B" }, { id: 24, name: "PIT Yellowjackets", division: "B" }, { id: 25, name: "NY Queen Bees", division: "B" }, { id: 26, name: "PHL Greased Poles", division: "B" }, { id: 27, name: "DC Volley Partons", division: "B" }, { id: 28, name: "DC 2 Hot 2 Handle", division: "BB" }, { id: 29, name: "NY Beef Steak", division: "BB" }, { id: 30, name: "DC Up", division: "BB" }, { id: 31, name: "NY Xtreme 2.0", division: "BB" }, { id: 32, name: "Miami Belugas", division: "BB" }, { id: 33, name: "Conegliano Imoco", division: "BB" }, { id: 34, name: "NY Delulu", division: "BB" }, { id: 35, name: "DC Dig Me Down", division: "BB" }, { id: 36, name: "NY Nasty Girls", division: "BB" }, { id: 37, name: "Guam Pacific Vipers", division: "BB" }, { id: 38, name: "DC Block Me Harder, Blanc", division: "BB" }, { id: 39, name: "NY Sour Patch", division: "BB" }, { id: 40, name: "Steel City Avengers", division: "BB" }, { id: 41, name: "DC Train WREQ", division: "BB" }, { id: 42, name: "NY Xtreme", division: "BB" }, { id: 43, name: "Boston Jolly-Bs", division: "BB" }, { id: 44, name: "Baltimore Beach Babes", division: "BB" }, { id: 45, name: "NY J + The Machine", division: "BB" }, { id: 46, name: "JB Andrews MISFITS", division: "BB" }, { id: 47, name: "DC Big Mac Sauce", division: "BB" }, { id: 48, name: "NYC Accla", division: "BB" }, { id: 49, name: "Richmond Replicas", division: "BB" }, { id: 50, name: "Baltimore By The Balls", division: "BB" }, { id: 51, name: "NY Caribbean Mix", division: "BB" }, { id: 52, name: "East Coast Kinda Fit, Kinda Fat", division: "BB" }, { id: 53, name: "NY Pho3nix", division: "Mod A1" }, { id: 54, name: "DC Barbz", division: "Mod A1" }, { id: 55, name: "DC Unstable Unicorns", division: "Mod A1" }, { id: 56, name: "NY Hazzoo", division: "Mod A1" }, { id: 57, name: "Westview Nutty Nutmegs", division: "Mod A1" }, { id: 58, name: "NYC Teen Titans", division: "Mod A1" }, { id: 59, name: "RAL Douched & Dangerous", division: "Mod A1" }, { id: 60, name: "NY Xtreme", division: "Mod A1" } ], J = new Map(O.map((e) => [e.id, e])), W = M( B.map((e) => e.division) ), Q = M( B.map((e) => e.location) ), Z = Array.from( new Set(B.map((e) => e.court)) ).sort((e, t) => e - t); M(B.map((e) => e.date)); const T = te(B), ee = Array.from( new Set(B.map((e) => e.time)) ).sort((e, t) => D(e) - D(t)); function te(e) { const t = /* @__PURE__ */ new Map(); return e.forEach((o) => { t.has(o.court) || t.set(o.court, o.location); }), Array.from(t.entries()).sort((o, i) => o[0] - i[0]).map(([o, i]) => ({ court: o, location: i })); } function ie(e) { const t = /* @__PURE__ */ new Map(); return e.forEach((o) => { const i = `${o.time}-${o.court}`; t.has(i) || t.set(i, []), t.get(i).push(o); }), t; } function oe(e) { const t = new Set(e.map((i) => i.court)), o = T.filter((i) => t.has(i.court)); return o.length ? o : T; } function M(e) { return Array.from(new Set(e)).sort( (t, o) => t.localeCompare(o, void 0, { numeric: !0 }) ); } function ae(e) { const [t, o] = e.split(":"), i = Number(t), r = Number(o); if (Number.isNaN(i) || Number.isNaN(r)) return e; const m = /* @__PURE__ */ new Date(); return m.setHours(i, r, 0, 0), new Intl.DateTimeFormat("en-US", { hour: "numeric", minute: "2-digit" }).format(m); } function D(e) { const [t, o] = e.split(":").map(Number); return t * 60 + o; } function j(e) { var t; return ((t = J.get(e)) == null ? void 0 : t.name) ?? `Team ${e}`; } const d = { divisions: /* @__PURE__ */ new Set(), locations: /* @__PURE__ */ new Set(), teams: /* @__PURE__ */ new Set(), courts: /* @__PURE__ */ new Set() }, L = ["teams", "divisions", "courts", "locations"], x = "filters", _ = { teams: { label: "Teams", collapsed: !0, options: [...O].sort((e, t) => e.name.localeCompare(t.name)).map((e) => ({ label: `${e.name} - ${e.division}`, value: String(e.id) })) }, divisions: { label: "Divisions", collapsed: !0, options: W.map((e) => ({ label: e, value: e })) }, courts: { label: "Courts", collapsed: !0, options: Z.map((e) => ({ label: `Court ${e}`, value: String(e) })) }, locations: { label: "Locations", collapsed: !0, options: Q.map((e) => ({ label: e, value: e })) } }; function re(e, t) { const o = _[e].options.find( (i) => i.value === t ); return (o == null ? void 0 : o.label) ?? t; } function z(e) { const t = typeof window < "u" ? window.location.search : "", i = new URLSearchParams(t).get(x), r = me(); return i && i.split("|").forEach((m) => { if (!m) return; const [s, l = ""] = m.split(":", 2); !le(s) || !l || l.split(",").forEach((v) => { if (v) try { r[s].add(decodeURIComponent(v)); } catch { } }); }), ce(r); } function ne() { if (typeof window > "u") return; const e = de(), t = new URL(window.location.href), o = t.searchParams.get(x); if (e) { if (o === e) return; t.searchParams.set(x, e); } else { if (!o) return; t.searchParams.delete(x); } const i = `${t.pathname}${t.search}${t.hash}`; window.history.replaceState(window.history.state, "", i); } function me() { return { divisions: /* @__PURE__ */ new Set(), locations: /* @__PURE__ */ new Set(), teams: /* @__PURE__ */ new Set(), courts: /* @__PURE__ */ new Set() }; } function ce(e) { let t = !1; return L.forEach((o) => { const i = e[o], r = d[o]; se(r, i) || (t = !0, r.clear(), i.forEach((m) => r.add(m))); }), t; } function de() { const e = []; return L.forEach((t) => { if (!d[t].size) return; const o = Array.from(d[t]).sort((i, r) => i.localeCompare(r)).map((i) => encodeURIComponent(i)); e.push(`${t}:${o.join(",")}`); }), e.length ? e.join("|") : null; } function se(e, t) { if (e.size !== t.size) return !1; for (const o of e) if (!t.has(o)) return !1; return !0; } function le(e) { return L.includes(e); } let E = null, k = null, N = null; function ue() { const e = document.createElement("section"); e.className = "tc-calendar", N = e, V(T.length); const t = G("tc-row--header"); E = t; const o = document.createElement("div"); return o.className = "tc-cell tc-cell--header tc-cell--time", o.textContent = "Time", t.appendChild(o), T.forEach((i) => { const r = document.createElement("div"); r.className = "tc-cell tc-cell--header"; const m = document.createElement("div"); m.className = "tc-court-name", m.textContent = `Court ${i.court}`; const s = document.createElement("div"); s.className = "tc-court-location", s.textContent = i.location, r.append(m, s), t.appendChild(r); }), e.appendChild(t), k = document.createElement("div"), k.className = "tc-body", e.appendChild(k), e; } function pe() { const e = k; if (!e) return; if (e.innerHTML = "", !B.length) { e.appendChild( F("No matches have been scheduled yet.") ); return; } const t = B.filter(he); if (!t.length) { e.appendChild( F( "No matches match the current filters. Try clearing some selections." ) ); return; } const o = ee, i = ie(t), r = oe(t); V(r.length), ve(r), o.forEach((m) => { const s = G(), l = document.createElement("div"); l.className = "tc-cell tc-cell--time", l.textContent = ae(m), s.appendChild(l), r.forEach((v) => { const u = document.createElement("div"); u.className = "tc-cell"; const A = `${m}-${v.court}`, f = i.get(A) ?? []; f.length ? f.sort((h, p) => h.division.localeCompare(p.division)).forEach((h) => { u.appendChild(fe(h)); }) : (u.classList.add("tc-cell--empty"), u.textContent = "—"), s.appendChild(u); }), e.appendChild(s); }); } function G(e) { const t = document.createElement("div"); return t.className = "tc-row", e && t.classList.add(e), t; } function ve(e) { if (!E) return; const t = Array.from(E.children), o = new Set(e.map((i) => i.court)); T.forEach((i, r) => { const m = t[r + 1]; m && (m.style.display = o.has(i.court) ? "" : "none"); }); } function V(e) { if (!N) return; const t = Math.max(0, e); N.dataset.columns = String(t); } function F(e) { const t = document.createElement("div"); return t.className = "tc-empty-message", t.textContent = e, t; } function fe(e) { const t = document.createElement("article"); t.className = "tc-match"; const o = document.createElement("div"); o.className = "tc-match__teams", o.append(Y(e.team1), Y(e.team2)); const i = document.createElement("div"); i.className = "tc-match__meta"; const r = document.createElement("span"); r.className = "tc-match__division", r.textContent = e.division; const m = document.createElement("span"); return m.className = "tc-match__ref", m.textContent = `Ref: ${j(e.refTeam)}`, K(e.refTeam) && m.classList.add("active"), i.append(r, m), t.append(o, i), t; } function Y(e) { const t = document.createElement("span"); return t.className = "tc-match__team", t.textContent = j(e), K(e) && t.classList.add("active"), t; } function K(e) { return d.teams.size > 0 && d.teams.has(String(e)); } function he(e) { return !(d.divisions.size && !d.divisions.has(e.division) || d.locations.size && !d.locations.has(e.location) || d.courts.size && !d.courts.has(String(e.court)) || d.teams.size && !d.teams.has(String(e.team1)) && !d.teams.has(String(e.team2)) && !d.teams.has(String(e.refTeam))); } const c = { grey: { 1e3: "var(--_primitives---grey--1000)", 900: "var(--_primitives---grey--900)", 800: "var(--_primitives---grey--800)", 700: "var(--_primitives---grey--700)", 600: "var(--_primitives---grey--600)", 500: "var(--_primitives---grey--500)", 400: "var(--_primitives---grey--400)", 300: "var(--_primitives---grey--300)", 200: "var(--_primitives---grey--200)", 100: "var(--_primitives---grey--100)", 50: "var(--_primitives---grey--50)", 0: "var(--_primitives---grey--0)" }, red: { 600: "var(--_primitives---red--600)", 500: "var(--_primitives---red--500)", 400: "var(--_primitives---red--400)", 300: "var(--_primitives---red--300)", 200: "var(--_primitives---red--200)", 100: "var(--_primitives---red--100)" }, orange: { 600: "var(--_primitives---orange--600)", 500: "var(--_primitives---orange--500)", 400: "var(--_primitives---orange--400)", 300: "var(--_primitives---orange--300)", 200: "var(--_primitives---orange--200)", 100: "var(--_primitives---orange--100)" }, yellow: { 600: "var(--_primitives---yellow--600)", 500: "var(--_primitives---yellow--500)", 400: "var(--_primitives---yellow--400)", 300: "var(--_primitives---yellow--300)", 200: "var(--_primitives---yellow--200)", 100: "var(--_primitives---yellow--100)" }, green: { 600: "var(--_primitives---green--600)", 500: "var(--_primitives---green--500)", 400: "var(--_primitives---green--400)", 300: "var(--_primitives---green--300)", 200: "var(--_primitives---green--200)", 100: "var(--_primitives---green--100)" }, skyBlue: { 600: "var(--_primitives---sky-blue--600)", 500: "var(--_primitives---sky-blue--500)", 400: "var(--_primitives---sky-blue--400)", 300: "var(--_primitives---sky-blue--300)", 200: "var(--_primitives---sky-blue--200)", 100: "var(--_primitives---sky-blue--100)" }, blue: { 600: "var(--_primitives---blue--600)", 500: "var(--_primitives---blue--500)", 400: "var(--_primitives---blue--400)", 300: "var(--_primitives---blue--300)", 200: "var(--_primitives---blue--200)", 100: "var(--_primitives---blue--100)" }, purple: { 600: "var(--_primitives---purple--600)", 500: "var(--_primitives---purple--500)", 400: "var(--_primitives---purple--400)", 300: "var(--_primitives---purple--300)", 200: "var(--_primitives---purple--200)", 100: "var(--_primitives---purple--100)" }, pink: { 600: "var(--_primitives---pink--600)", 500: "var(--_primitives---pink--500)", 400: "var(--_primitives---pink--400)", 300: "var(--_primitives---pink--300)", 200: "var(--_primitives---pink--200)", 100: "var(--_primitives---pink--100)" } }, g = { text: { tiny: "0.75rem", small: "var(--text--small)", regular: "var(--text--regular)", medium: "var(--text--medium)", large: "var(--text--large)" }, heading: { small: "var(--heading--small)", medium: "var(--heading--medium)", large: "var(--heading--large)", xlarge: "var(--heading--xlarge)" } }, R = { small: "var(--radius--small)", medium: "var(--radius--medium)", massive: "var(--radius--massive)" }, a = "dcpvl-tournament-calendar", U = "dcpvl-tournament-calendar-styles", Be = "minmax(13.75rem, 1fr)", n = { pageBg: c.grey[50], surface: c.grey[0], textPrimary: c.grey[1e3], textSecondary: c.grey[700], border: c.grey[200], borderMuted: c.grey[300], accent: c.skyBlue[500], accentSoft: c.skyBlue[100], chipBg: c.red[400], chipText: c.grey[0], matchBg: c.grey[100], matchBorder: c.grey[200], matchText: c.grey[1e3], emptyText: c.grey[500], headerRowBg: c.grey[800], headerCellBg: c.grey[800], timeBg: c.grey[800], cellPadding: "0.5rem" }; let H = !1; const y = /* @__PURE__ */ new Set(); function q(e, t) { e.innerHTML = "", Object.keys(_).forEach((r) => { e.appendChild(ye(r, t)); }); const o = document.createElement("div"); o.className = "tc-filter-controls"; const i = document.createElement("button"); i.type = "button", i.textContent = "Clear All Filters", i.addEventListener("click", () => { Object.keys(d).forEach( (r) => d[r].clear() ), t.onChange(), q(e, t); }), o.appendChild(i), e.appendChild(o), Te(); } function ge(e, t = {}) { e.innerHTML = ""; const o = []; if (Object.keys(d).forEach((i) => { d[i].forEach((r) => { o.push({ key: i, value: r, label: `${_[i].label.replace(/s$/, "")}: ${re( i, r )}` }); }); }), !o.length) { const i = document.createElement("span"); i.className = "tc-active-filters__empty", i.textContent = "No filters selected. Showing all matches.", e.appendChild(i); return; } o.forEach((i) => { const r = document.createElement("button"); r.type = "button", r.className = "tc-chip", r.setAttribute("aria-label", `Remove ${i.label}`), r.title = `Remove ${i.label}`; const m = document.createElement("span"); m.className = "tc-chip__label", m.textContent = i.label; const s = document.createElement("span"); s.className = "tc-chip__icon", s.setAttribute("aria-hidden", "true"), s.textContent = "×", r.append(m, s), r.addEventListener("click", () => { var l; d[i.key].delete(i.value), (l = t.onChipRemoved) == null || l.call(t); }), e.appendChild(r); }); } function ye(e, t) { const o = _[e], i = document.createElement("div"); i.className = "tc-filter-group"; const r = y.has(e) || !y.size && !o.collapsed; r ? (i.classList.add("tc-filter-group--open"), y.add(e)) : y.delete(e); const m = document.createElement("button"); m.type = "button", m.className = "tc-filter-toggle", m.textContent = `${o.label} (${o.options.length})`, m.setAttribute("aria-haspopup", "listbox"), m.setAttribute("aria-expanded", String(r)), m.addEventListener("click", (u) => { u.stopPropagation(), i.classList.contains("tc-filter-group--open") ? (i.classList.remove("tc-filter-group--open"), m.setAttribute("aria-expanded", "false"), y.delete(e)) : (X(), i.classList.add("tc-filter-group--open"), m.setAttribute("aria-expanded", "true"), y.add(e)); }), i.appendChild(m); const s = document.createElement("div"); s.className = "tc-filter-panel", i.appendChild(s); const l = document.createElement("input"); l.type = "search", l.className = "tc-filter-search", l.placeholder = o.options.length ? `Search ${o.label.toLowerCase()}` : "No options available", l.disabled = !o.options.length, s.appendChild(l); const v = document.createElement("div"); if (v.className = "tc-filter-options", s.appendChild(v), o.options.length) { o.options.forEach((f) => { const h = document.createElement("label"); h.className = "tc-filter-option"; const p = document.createElement("input"); p.type = "checkbox", p.value = f.value, p.checked = d[e].has(f.value), p.addEventListener("change", () => { p.checked ? d[e].add(f.value) : d[e].delete(f.value), t.onChange(); }); const $ = document.createElement("span"); $.textContent = f.label, h.append(p, $), v.appendChild(h); }); const u = Array.from(v.children), A = (f) => { const h = f.trim().toLowerCase(); u.forEach((p) => { var P; const $ = ((P = p.textContent) == null ? void 0 : P.toLowerCase()) ?? ""; p.style.display = $.includes(h) ? "" : "none"; }); }; l.addEventListener("input", () => A(l.value)); } else { const u = document.createElement("p"); u.textContent = "No options yet.", u.style.color = n.textSecondary, u.style.margin = "0", v.appendChild(u); } return i; } function Te() { H || (H = !0, document.addEventListener("click", (e) => { const t = e.target; t != null && t.closest(`#${a} .tc-filter-group`) || X(); })); } function X() { document.querySelectorAll(`#${a} .tc-filter-group--open`).forEach((e) => { var t; e.classList.remove("tc-filter-group--open"), (t = e.querySelector(".tc-filter-toggle")) == null || t.setAttribute("aria-expanded", "false"); }), y.clear(); } function Re() { const e = document.createElement("header"); e.className = "tc-header"; const t = document.createElement("h1"); return t.textContent = "Pool Play Schedule", e.appendChild(t), e; } function Ce() { let e = document.getElementById(a); return e ? (e.innerHTML = "", e) : (e = document.createElement("section"), e.id = a, document.body.appendChild(e), e); } const be = "4rem", Ae = Math.max(1, T.length), $e = ke(Ae); function xe() { if (document.getElementById(U)) return; const e = document.createElement("style"); e.id = U, e.textContent = ` .page-wrapper {max-width:100dvw; overflow:hidden;} #${a} { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: ${n.textPrimary}; background: ${n.pageBg}; padding: 1.5rem 1.5rem 0 1.5rem; box-shadow: 0 10px 25px color-mix(in srgb, ${n.textPrimary} 12%, transparent); display: flex; flex-direction: column; gap: 1rem; font-size: ${g.text.tiny}; } #${a} * { box-sizing: border-box; } #${a} .tc-header { display: flex; flex-direction: row; gap: 1rem; align-items: center; } #${a} .tc-header h1 { margin: 0; font-size: ${g.heading.small}; } #${a} .tc-header p { margin: 0.25rem 0 0; color: ${n.textSecondary}; } #${a} .tc-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.5rem; } #${a} .tc-filter-group { position: relative; background: ${n.surface}; border: 1px solid ${n.border}; border-radius: ${R.medium}; padding: ${n.cellPadding}; display: flex; flex-direction: column; gap: 0.35rem; } #${a} .tc-filter-toggle { width: 100%; cursor: pointer; font-weight: 600; color: ${n.textPrimary}; border: none; background: transparent; display: flex; align-items: center; justify-content: space-between; } #${a} .tc-filter-toggle::after { content: '▾'; font-size: 0.9rem; color: ${n.textPrimary}; } #${a} .tc-filter-group--open .tc-filter-toggle::after { content: '▴'; } #${a} .tc-filter-panel { position: absolute; top: calc(100% + 0.35rem); left: 0; right: 0; display: none; flex-direction: column; gap: 0.5rem; background: ${n.surface}; border: 1px solid ${n.borderMuted}; border-radius: ${R.medium}; padding: 0.75rem; box-shadow: 0 12px 30px color-mix(in srgb, ${n.textPrimary} 15%, transparent); z-index: 10; } #${a} .tc-filter-group--open .tc-filter-panel { display: flex; } #${a} .tc-filter-search { width: 100%; border: 1px solid ${n.borderMuted}; border-radius: ${R.small}; padding: 0.4rem 0.65rem; font-size: 16px; background: ${n.pageBg}; color: ${n.textPrimary}; } #${a} .tc-filter-options { display: flex; flex-direction: column; gap: 0.35rem; max-height: 220px; overflow-y: auto; } #${a} .tc-filter-option { display: flex; align-items: center; gap: 0.5rem; font-size: ${g.text.tiny}; color: ${n.textPrimary}; cursor: pointer; } #${a} .tc-filter-option span { color: inherit; } #${a} .tc-filter-option input { width: 1rem; height: 1rem; accent-color: ${n.accent}; } #${a} .tc-filter-controls { display: flex; justify-content: flex-end; } #${a} .tc-filter-controls button { background: transparent; border: 1px solid ${n.borderMuted}; border-radius: 999px; padding: 0.45rem 1rem; font-weight: 600; cursor: pointer; color: ${n.textPrimary}; } #${a} .tc-active-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; } #${a} .tc-active-filters__empty { color: ${n.textSecondary}; font-size: ${g.text.tiny}; } #${a} .tc-chip { border: none; background: ${n.chipBg}; color: ${n.chipText}; border-radius: 999px; padding: 0.35rem 0.75rem; font-size: ${g.text.tiny}; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; line-height: 1; } #${a} .tc-chip__label { white-space: nowrap; } #${a} .tc-chip__icon { font-size: 0.65rem; opacity: 0.85; display: inline-flex; align-items: center; justify-content: center; } #${a} .tc-calendar { overflow-x: auto; margin-left: -1.5rem; margin-right: -1.5rem; background: ${n.surface}; --tc-first-column-width: ${be}; --tc-base-column-width: ${Be}; } #${a} .tc-body { display: block; } #${a} .tc-row { display: grid; grid-template-columns: var(--tc-first-column-width); } ${$e} #${a} .tc-row--header { top: 0; z-index: 3; background: ${n.headerRowBg}; color: ${c.grey[100]}; } #${a} .tc-row--header .tc-cell { top: 0; z-index: 4; } #${a} .tc-cell { border-bottom: 1px solid ${n.border}; border-right: 1px solid ${n.border}; min-height: none; font-size: ${g.text.tiny}; display: flex; align-items: stretch; flex-direction: column; } #${a} .tc-cell:last-child { border-right: none; } #${a} .tc-cell--header { font-weight: 600; padding: ${n.cellPadding}; background: ${n.headerCellBg}; border-bottom: 1px solid ${c.grey[600]}; border-right: 1px solid ${c.grey[600]}; } #${a} .tc-cell--time { background: ${n.timeBg}; padding: ${n.cellPadding}; font-weight: 600; text-align: center; display: flex; align-items: center; justify-content: center; color: ${c.grey[100]}; border-bottom: 1px solid ${c.grey[600]}; border-right: 1px solid ${c.grey[600]}; left: 0; z-index: 3; } #${a} .tc-cell--empty { color: ${n.emptyText}; font-style: italic; display: flex; align-items: center; justify-content: center; } #${a} .tc-match { background: ${n.matchBg}; color: ${n.matchText}; padding: ${n.cellPadding}; margin: ${n.cellPadding}; border-radius: ${R.small}; display: flex; flex-direction: column; gap: 0.35rem; box-shadow: 0 2px 10px color-mix(in srgb, ${c.grey[300]} 35%, transparent); position: relative; border: 1px solid ${n.matchBorder}; height:100%; } #${a} .tc-match + .tc-match { margin-top: 0.5rem; } #${a} .tc-match__teams { display: flex; flex-direction: column; flex-wrap: wrap; gap: 0.35rem; align-items: baseline; font-weight: 600; } #${a} .tc-match__team { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #${a} .tc-match__ref { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #${a} .active { color: ${c.red[400]}; font-weight: 800; } #${a} .tc-match__division{ position: absolute; top: ${n.cellPadding}; right: ${n.cellPadding}; min-width: 1rem; height: 1rem; background: ${n.pageBg}; text-align:center; padding: 0 0.25rem; border-radius: ${R.small}; } #${a} .tc-match__meta { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: ${g.text.tiny}; opacity: 0.85; } #${a} .tc-empty-message { text-align: center; padding: 2rem; color: ${n.textSecondary}; } #${a} .tc-court-name { font-weight: 600; } #${a} .tc-court-location { font-weight: 400; } @media (max-width: 768px) { #${a} .tc-filters { grid-template-columns: 1fr; } #${a} .tc-calendar { --tc-first-column-width: 3rem; --tc-base-column-width: minmax(12rem, 1fr); margin-left: -0.5rem; margin-right: -0.5rem; } #${a} { padding: 0.5rem 0.5rem 0 0.5rem; gap: 0.5rem; } #${a} .tc-filter-group { padding: 0.25rem; } #${a} .tc-filter-controls { width:100%; } #${a} .tc-filter-controls button { width:100%; } } `, document.head.appendChild(e); } function ke(e) { const t = ` #${a} .tc-calendar[data-columns='0'] .tc-row { grid-template-columns: var(--tc-first-column-width); } `, o = Array.from({ length: e }, (i, r) => { const m = r + 1; return ` #${a} .tc-calendar[data-columns='${m}'] .tc-row { grid-template-columns: var(--tc-first-column-width) repeat(${m}, var(--tc-base-column-width)); } `; }).join(""); return t + o; } let C = null, b = null; const I = () => { xe(); const e = Ce(); e.appendChild(Re()), C = document.createElement("section"), C.className = "tc-filters", e.appendChild(C), b = document.createElement("div"), b.className = "tc-active-filters", e.appendChild(b), e.appendChild(ue()), z(), S(), w({ skipUrlSync: !0 }), window.addEventListener("popstate", () => { z() && (S(), w({ skipUrlSync: !0 })); }); }; document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", I) : I(); function S() { C && q(C, { onChange: w }); } function w(e = {}) { e.skipUrlSync || ne(), we(), pe(); } function we() { b && ge(b, { onChipRemoved: () => { S(), w(); } }); } })()