;
! function() {
    try {
        var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof global ? global : "undefined" != typeof window ? window : "undefined" != typeof self ? self : {},
            n = (new e.Error).stack;
        n && ((e._debugIds || (e._debugIds = {}))[n] = "368feee6-0c09-ee61-9227-4da553407df3")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 510535, e => {
    "use strict";
    var t = e.i(655740),
        r = e.i(631222);
    let s = async ({
        seriesId: e,
        seriesSlug: s,
        closed: i,
        limit: n,
        order: l,
        ascending: a,
        active: o,
        archived: c,
        afterCursor: u
    }) => {
        let d = new URLSearchParams;
        if (e) d.set("series_id", String(e));
        else {
            if (!s) return {
                events: []
            };
            d.set("series_slug", s)
        }
        "boolean" == typeof i && d.set("closed", String(i)), "boolean" == typeof o && d.set("active", String(o)), "boolean" == typeof c && d.set("archived", String(c)), "boolean" == typeof a && d.set("ascending", String(a)), n && d.set("limit", String(n)), l && d.set("order", l), u && d.set("after_cursor", u);
        let {
            data: m
        } = await t.axios.get(`${r.GAMMA_API_URL}/events/keyset?${d.toString()}`);
        return {
            events: m.events ? ? [],
            nextCursor: m.next_cursor
        }
    };
    e.s(["getSeriesEvents", 0, s])
}, 678065, e => {
    "use strict";
    var t = e.i(162923),
        r = e.i(491163),
        s = e.i(510535);
    let i = /^([a-z0-9]+)-up(?:-or-down|down)-(5m|15m)-\d+$/;

    function n(e) {
        if (!e) return NaN;
        let t = Number(e);
        return !Number.isNaN(t) && t > 0 ? t < 1e12 ? 1e3 * t : t : new Date(e).getTime()
    }

    function l(e, t) {
        let r = e ? .markets ? .[0],
            s = n(r ? .eventStartTime ? ? r ? .startDate ? ? void 0),
            i = n(r ? .endDate),
            l = Number.isFinite(s) && Number.isFinite(i) && s <= t && i > t;
        return {
            isLive: l,
            isEnded: Number.isFinite(i) && i <= t,
            isUpcoming: Number.isFinite(s) && s > t
        }
    }

    function a(e, t) {
        return n(e.endDate) - n(t.endDate)
    }

    function o(e, t) {
        let {
            isLive: r
        } = l(e, t);
        return { ...e,
            isLive: r
        }
    }
    async function c(e, t) {
        let s = e.toLowerCase().match(i);
        if (!s) return null;
        let [, l, a] = s, o = "5m" === a ? 300 : 900, c = Math.floor(Math.floor(t / 1e3) / o) * o;
        for (let e of [c, c - o, c + o]) {
            let s = `${l}-updown-${a}-${e}`,
                i = await (0, r.getEvent)(s).catch(() => null);
            if (!i || i.closed || i.archived) continue;
            let o = i.markets ? .[0];
            if (!o) continue;
            let c = n(o.eventStartTime ? ? o.startDate ? ? void 0),
                u = n(o.endDate);
            if (Number.isFinite(c) && Number.isFinite(u) && c <= t && u > t) return i
        }
        return null
    }
    async function u(e, t, r) {
        let {
            events: i
        } = await (0, s.getSeriesEvents)({
            seriesSlug: e,
            closed: !1,
            active: !0,
            archived: !1,
            order: "endDate",
            ascending: !0,
            limit: 100
        });
        if (!i.length) return null;
        let n = i.filter(e => {
            if (!e.startDate || !e.endDate) return !1;
            let r = new Date(e.startDate).getTime(),
                s = new Date(e.endDate).getTime();
            return Number.isFinite(r) && Number.isFinite(s) && r <= t && s > t
        }).sort(a)[0];
        return n || ("live-only" === r ? null : i.filter(e => {
            if (!e.endDate) return !1;
            let r = new Date(e.endDate).getTime();
            return Number.isFinite(r) && r > t
        }).sort(a)[0] || null)
    }
    async function d(e) {
        let s, i = Date.now();
        if (!((s = (e ? .series ? .[0] ? .slug || e ? .slug || "").toLowerCase()) && (e ? .tags ? .some(e => "crypto" === e.slug) || t.HOURLY_UP_OR_DOWN_PREFIXES.some(e => s.startsWith(e))) && (s.includes("-hourly") || s.includes("-5m") || s.includes("-15m") || s.includes("-4h") || (0, t.getSeriesSettings)(s).useHourlyFiltering))) return e;
        let {
            isLive: n,
            isUpcoming: a
        } = l(e, i);
        if (n) return o(e, i);
        let d = await c(e ? .slug ? ? "", i);
        if (d) return o(d, i);
        let m = function(e) {
            let r = e ? .series ? .[0] ? .slug || e ? .seriesSlug;
            if (r) return r;
            let s = e ? .slug ? .toLowerCase();
            if (!s) return;
            let i = t.HOURLY_UP_OR_DOWN_PREFIXES.find(e => s.startsWith(e));
            if (i) return s.includes("-5m") ? `${i}-5m` : s.includes("-15m") ? `${i}-15m` : s.includes("-4h") ? `${i}-4h` : `${i}-hourly`;
            let n = s.indexOf("-hourly");
            if (n > 0) return s.slice(0, n + 7);
            let l = s.indexOf("-5m");
            if (l > 0) return s.slice(0, l + 3);
            let a = s.indexOf("-15m");
            if (a > 0) return s.slice(0, a + 4);
            let o = s.indexOf("-4h");
            return o > 0 ? s.slice(0, o + 3) : void 0
        }(e);
        if (!m) return o(e, i);
        let g = await u(m, i, "live-only");
        if (g || a || (g = await u(m, i, "live-or-upcoming")), !g || g.slug === e.slug) return o(e, i);
        let f = await (0, r.getEvent)(g.slug);
        return !f || f.closed || f.archived ? o(e, i) : o(f, i)
    }
    e.s(["resolveHourlyCryptoReplacement", 0, d])
}, 474811, e => {
    "use strict";
    e.s(["normalizeUpDownEvent", 0, e => {
        if (!e.tags ? .some(e => "up-or-down" === e.slug)) return e;
        let t = e.series ? .[0] ? .title;
        return t ? { ...e,
            title: t,
            markets: e.markets ? .map(e => ({ ...e,
                question: t
            }))
        } : e
    }])
}, 30223, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340);
    e.s(["useSetLoading", 0, function(e) {
        let s, i, n = (0, t.c)(4),
            {
                isStale: l,
                isFetching: a
            } = e,
            [o, c] = (0, r.useState)(!1);
        return n[0] !== a || n[1] !== l ? (s = () => {
            let e = null;
            return l && a ? e = setTimeout(() => {
                c(!0)
            }, 200) : c(!1), () => {
                e && clearTimeout(e)
            }
        }, i = [l, a], n[0] = a, n[1] = l, n[2] = s, n[3] = i) : (s = n[2], i = n[3]), (0, r.useEffect)(s, i), o
    }])
}, 776796, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        s = e.i(86831);

    function i(e) {
        let i, n, l, a, o, c, u, d, m, g, f, h, v, p, y = (0, r.c)(47),
            {
                title: x,
                desktopTitle: _,
                hideTags: S,
                collapseTagsFromLg: b,
                searchSlot: E,
                actionsSlot: w,
                tagsSlot: N,
                filtersSlot: T,
                content: k,
                className: j,
                contentClassName: A
            } = e,
            L = void 0 !== S && S,
            R = void 0 !== b && b,
            C = L || R ? "gap-5 lg:pt-5.5" : "";
        y[0] !== j || y[1] !== C ? (i = (0, s.cn)("flex flex-col gap-3 pt-3 items-center w-full lg:max-w-[1350px] lg:mx-auto lg:mb-4 lg:pt-2", C, j), y[0] = j, y[1] = C, y[2] = i) : i = y[2], y[3] !== x ? (n = x ? (0, t.jsx)("h1", {
            className: "sr-only",
            children: x
        }) : null, y[3] = x, y[4] = n) : n = y[4], y[5] !== w || y[6] !== E ? (l = (E || w) && (0, t.jsxs)("div", {
            className: "px-4 flex items-center gap-4 w-full",
            children: [E && (0, t.jsx)("div", {
                className: "min-w-0 flex-1",
                children: E
            }), w && (0, t.jsx)("div", {
                className: "flex gap-0.5 items-center",
                children: w
            })]
        }), y[5] = w, y[6] = E, y[7] = l) : l = y[7], y[8] !== L || y[9] !== N || y[10] !== x ? (a = L ? x ? (0, t.jsx)("div", {
            className: "w-full flex items-center mt-3.5 px-4",
            children: (0, t.jsx)("div", {
                "aria-hidden": !0,
                className: "font-medium text-lg",
                children: x
            })
        }) : void 0 : x || N ? (0, t.jsxs)("div", {
            className: "w-full flex items-center gap-1 mt-3.5",
            children: [x && (0, t.jsx)("div", {
                "aria-hidden": !0,
                className: "pl-4 font-medium text-lg sm:text-xl",
                children: x
            }), N && (0, t.jsx)("div", {
                className: "w-full min-w-0 overflow-x-auto no-scrollbar",
                children: N
            })]
        }) : void 0, y[8] = L, y[9] = N, y[10] = x, y[11] = a) : a = y[11], y[12] !== T ? (o = T && (0, t.jsx)("div", {
            className: "w-full overflow-x-auto px-4",
            children: T
        }), y[12] = T, y[13] = o) : o = y[13], y[14] !== l || y[15] !== a || y[16] !== o ? (c = (0, t.jsxs)("div", {
            className: "flex flex-col items-center w-full lg:hidden",
            children: [l, a, o]
        }), y[14] = l, y[15] = a, y[16] = o, y[17] = c) : c = y[17];
        let D = L || R ? "gap-0 px-0" : "";
        return y[18] !== D ? (u = (0, s.cn)("hidden lg:flex flex-col gap-2 w-full px-6", D), y[18] = D, y[19] = u) : u = y[19], y[20] !== w || y[21] !== _ || y[22] !== E || y[23] !== x ? (d = (x || _ || E || w) && (0, t.jsxs)("div", {
            className: "flex items-center justify-between w-full",
            children: [x ? (0, t.jsx)("div", {
                "aria-hidden": !0,
                className: "font-semibold text-heading-xl",
                children: x
            }) : _ ? (0, t.jsx)("h2", {
                className: "font-semibold text-heading-xl",
                children: _
            }) : (0, t.jsx)("div", {}), (E || w) && (0, t.jsxs)("div", {
                className: "flex gap-0.5 items-center ml-auto",
                children: [E, w]
            })]
        }), y[20] = w, y[21] = _, y[22] = E, y[23] = x, y[24] = d) : d = y[24], y[25] !== R || y[26] !== L || y[27] !== N ? (m = !L && N && !R && (0, t.jsx)("div", {
            className: "w-full min-w-0 overflow-x-auto pt-0.5 no-scrollbar",
            children: N
        }), y[25] = R, y[26] = L, y[27] = N, y[28] = m) : m = y[28], y[29] !== T ? (g = T && (0, t.jsx)("div", {
            className: "w-full overflow-x-auto",
            children: T
        }), y[29] = T, y[30] = g) : g = y[30], y[31] !== u || y[32] !== d || y[33] !== m || y[34] !== g ? (f = (0, t.jsxs)("div", {
            className: u,
            children: [d, m, g]
        }), y[31] = u, y[32] = d, y[33] = m, y[34] = g, y[35] = f) : f = y[35], y[36] !== A ? (h = (0, s.cn)("w-full", A), y[36] = A, y[37] = h) : h = y[37], y[38] !== k || y[39] !== h ? (v = (0, t.jsx)("div", {
            className: h,
            children: k
        }), y[38] = k, y[39] = h, y[40] = v) : v = y[40], y[41] !== f || y[42] !== v || y[43] !== i || y[44] !== n || y[45] !== c ? (p = (0, t.jsxs)("div", {
            className: i,
            children: [n, c, f, v]
        }), y[41] = f, y[42] = v, y[43] = i, y[44] = n, y[45] = c, y[46] = p) : p = y[46], p
    }
    var n = e.i(336896),
        l = e.i(416340),
        a = e.i(604777),
        o = e.i(635267),
        c = e.i(678274),
        u = e.i(448030),
        d = e.i(827681),
        m = e.i(863828),
        g = e.i(668122),
        f = e.i(79075),
        h = e.i(784521),
        v = e.i(305457);

    function p(e) {
        return e.onToggleWatchlist
    }

    function y() {
        let e, s, i, n = (0, r.c)(8),
            l = (0, u.useDiscoveryFeedStore)(x),
            a = (() => {
                let e, t, s = (0, r.c)(7),
                    {
                        setOpen: i,
                        setConnectorRoute: n
                    } = (0, m.useSiwx)();
                s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], s[0] = e) : e = s[0];
                let {
                    authenticated: l
                } = (0, h.useAccountContext)(e), a = (0, v.useAmplitudeAnalytics)(), o = (0, u.useDiscoveryFeedStore)(p);
                return s[1] !== a || s[2] !== l || s[3] !== n || s[4] !== i || s[5] !== o ? (t = () => {
                    if (l) o();
                    else {
                        let e = Date.now();
                        (0, f.markSignupPromptOpened)("favorite", {
                            now: e,
                            route: "login"
                        }), a.trackEvent(g.Events.SignupPromptOpened, (0, f.getSignupPromptOpenedEventProperties)({
                            source: "favorite",
                            route: "login"
                        })), a.trackEvent(g.Events.LoggedOutFavoriteButtonClick_Homepage), n(d.ConnectorRoute.LOGIN), i(!0)
                    }
                }, s[1] = a, s[2] = l, s[3] = n, s[4] = i, s[5] = o, s[6] = t) : t = s[6], t
            })();
        n[0] !== a ? (e = () => a(), n[0] = a, n[1] = e) : e = n[1];
        let o = `size-10 shrink-0 rounded-md flex items-center justify-center text-brand-300 cursor-pointer hover:bg-surface${l?" bg-surface":""}`;
        return n[2] !== l ? (s = (0, t.jsx)(c.Bookmark, {
            active: l
        }), n[2] = l, n[3] = s) : s = n[3], n[4] !== e || n[5] !== o || n[6] !== s ? (i = (0, t.jsx)("button", {
            type: "button",
            "aria-label": "Toggle watchlist",
            onClick: e,
            className: o,
            children: s
        }), n[4] = e, n[5] = o, n[6] = s, n[7] = i) : i = n[7], i
    }

    function x(e) {
        return e.isWatchlist
    }

    function _(e) {
        let i, n, l, a, o, c = (0, r.c)(20),
            {
                items: u,
                renderItem: d,
                isLoading: m,
                overlayVisible: g,
                emptyState: f,
                loadingState: h,
                footer: v,
                gridClassName: p,
                containerClassName: y,
                virtualizedRenderer: x
            } = e,
            _ = null !== u;
        c[0] !== y ? (i = (0, s.cn)("flex flex-col gap-3 w-full shrink-0 h-auto relative", y), c[0] = y, c[1] = i) : i = c[1];
        let S = void 0 !== g && g ? "opacity-20" : "opacity-0";
        return c[2] !== S ? (n = (0, s.cn)("w-full h-full inset-0 absolute transition-opacity bg-background z-10 pointer-events-none", S), c[2] = S, c[3] = n) : n = c[3], c[4] !== n ? (l = (0, t.jsx)("div", {
            className: n
        }), c[4] = n, c[5] = l) : l = c[5], c[6] !== f || c[7] !== v || c[8] !== p || c[9] !== _ || c[10] !== m || c[11] !== u || c[12] !== h || c[13] !== d || c[14] !== x ? (a = _ && u ? (0, t.jsx)(t.Fragment, {
            children: x ? x({
                items: u,
                renderItem: d,
                gridClassName: p,
                footer: v
            }) : (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)("div", {
                    className: p,
                    children: u.map((e, t) => d(e, t))
                }), v]
            })
        }) : m ? h : f, c[6] = f, c[7] = v, c[8] = p, c[9] = _, c[10] = m, c[11] = u, c[12] = h, c[13] = d, c[14] = x, c[15] = a) : a = c[15], c[16] !== i || c[17] !== l || c[18] !== a ? (o = (0, t.jsxs)("div", {
            className: i,
            children: [l, a]
        }), c[16] = i, c[17] = l, c[18] = a, c[19] = o) : o = c[19], o
    }
    var S = e.i(664318),
        b = e.i(122538),
        E = e.i(964974),
        w = e.i(312390),
        N = e.i(233522),
        T = e.i(865663),
        k = e.i(244656),
        j = e.i(102091),
        A = e.i(735794),
        L = e.i(562806),
        R = e.i(491163),
        C = e.i(30223),
        D = e.i(318594),
        F = e.i(510954),
        M = e.i(57096),
        P = e.i(655740),
        O = e.i(660006),
        q = e.i(213251),
        I = e.i(631222),
        K = e.i(678065),
        U = e.i(860106);
    let B = new URLSearchParams({
            active: "true",
            archived: "false",
            ascending: "true",
            closed: "false",
            featured_order: "true",
            order: "featuredOrder"
        }),
        W = `${I.GAMMA_API_URL}/events/keyset?${B}`,
        Q = async () => P.axios.get(W).then(async e => {
            let t = e.data.events.map(e => (0, U.parseEventWithMarkets)(e)),
                r = await Promise.all(t.map(e => (0, K.resolveHourlyCryptoReplacement)(e))).then(e => e.map(e => ({ ...e,
                    isLive: !!e.isLive
                })));
            return {
                events: (0, q.filterHiddenEvents)(r, e => e.slug),
                hasMore: !!e.data.next_cursor,
                totalResults: 0,
                tags: []
            }
        }).catch(e => ((0, O.handleError)(e, "getHomepageFeaturedEventsFetcher"), {
            events: [],
            hasMore: !1,
            totalResults: 0,
            tags: []
        }));

    function G(e) {
        return e.events
    }
    var H = e.i(330067),
        $ = e.i(193948),
        Y = e.i(806538),
        z = e.i(635672),
        V = e.i(399841),
        X = e.i(627287),
        J = e.i(635973),
        Z = e.i(177521),
        ee = e.i(864006);
    let et = e => ({
        _c: e.category,
        _s: e.sortBy,
        _sts: e.status,
        _r: e.recurrence,
        _q: void 0
    });
    var er = e.i(996076),
        es = e.i(474811),
        ei = e.i(476979);
    let en = async (e, t) => {
        try {
            let r = new URLSearchParams;
            e && r.set("limit", String(e)), t ? .ignorePagination && r.set("ignore_pagination", "true"), t ? .variant && r.set("variant", t.variant);
            let s = r.toString(),
                i = s ? `${I.GAMMA_API_URL}/recommendations?${s}` : `${I.GAMMA_API_URL}/recommendations`,
                {
                    data: n
                } = await P.axios.get(i, {
                    withCredentials: !0
                });
            if (!n ? .length) return [];
            return (0, R.cleanEvents)(n).map(e => (0, U.parseEventWithMarkets)(e)).map(e => {
                let t = e.seriesSlug || e.series ? .[0] ? .slug;
                if (!t || !(0, ei.isSportSupported)(t)) return e;
                let r = e.teams;
                if (!r ? .length) return e;
                try {
                    let {
                        homeTeam: t,
                        awayTeam: s
                    } = (0, er.resolveSportsTeamLabels)({
                        event: e,
                        teamsList: r
                    }), i = (0, er.buildResolvedTeams)(e, t, s);
                    return { ...e,
                        resolvedTeams: i
                    }
                } catch {
                    return e
                }
            }).map(e => {
                let t = e.live && !e.isLive ? { ...e,
                    isLive: !0
                } : e;
                return (0, es.normalizeUpDownEvent)(t)
            })
        } catch {
            return []
        }
    };

    function el(e) {
        return e
    }

    function ea(e, t) {
        return t.length
    }
    var eo = e.i(660635),
        ec = e.i(476001),
        eu = e.i(162923);
    let ed = e => ({ ...e,
            title: e.series[0].title,
            ...e.series[0].icon && {
                icon: e.series[0].icon
            },
            ...e.series[0].image && {
                image: e.series[0].image
            },
            ...e.series[0].volume && {
                volume: e.series[0].volume
            },
            ...e.series[0].liquidity && {
                liquidity: e.series[0].liquidity,
                liquidityAmm: e.series[0].liquidity,
                liquidityClob: e.series[0].liquidity
            },
            ...e.series[0].startDate && {
                startDate: e.series[0].startDate
            }
        }),
        em = (e, t = "") => !!e && !!e.series && Array.isArray(e.series) && 1 === e.series.length && !!e.series[0].events && e.series[0].events.length > 1 && !t;
    var eg = e.i(593332);

    function ef(e) {
        return (0, eg.getEventLeague)(e) || null
    }

    function eh(e) {
        if (e.startTime) return new Date(e.startTime);
        if (e.markets ? .length) {
            for (let t of e.markets)
                if (t.gameStartTime) return new Date(t.gameStartTime)
        }
        return e.startDate ? new Date(e.startDate) : null
    }

    function ev(e) {
        return e ? (0, ei.getSportPregameWindow)(e) : 720
    }

    function ep(e) {
        return e ? (0, ei.getSportPinVolumeFloor)(e) : 15e4
    }

    function ey(e, t) {
        var r;
        if (!0 === e.ended || !e.live) return !1;
        let s = eh(e);
        if (!s) return !1;
        let i = ((r = e.seriesSlug) ? (0, ei.getSportGameDuration)(r) : 180) + 15;
        return t > new Date(s.getTime() + 60 * (i + 180 + 10) * 1e3)
    }

    function ex(e, t) {
        let r = eh(e);
        if (!r || !0 === e.ended || !0 === e.closed) return !1;
        let s = new Date(r.getTime() + 18e5),
            i = !0 !== e.live;
        return t > s && i
    }

    function e_(e, t, r) {
        let s = e.tags;
        return !!Array.isArray(s) && s.some(e => String(e ? .id) === t || e ? .slug === r)
    }

    function eS(e, t) {
        let r = e_(e, "1", "sports"),
            s = e_(e, "64", "esports"),
            i = ei.IN_GAME_SPORTS_SLUGS.some(e => e === t);
        return r || s || i
    }

    function eb(e) {
        return !0 === e.live
    }

    function eE(e, t) {
        let r = eh(e);
        return r ? (r.getTime() - t.getTime()) / 6e4 : null
    }

    function ew(e, t) {
        let r = ev(t);
        return e >= -5 && e <= r
    }

    function eN(e) {
        return e.volume || 0
    }
    let eT = e => {
            if (!e) return !1;
            let t = e.slug ? .toLowerCase() ? ? "",
                r = e.series ? .[0] ? .slug ? .toLowerCase() ? ? "";
            return e.tags ? .some(e => "crypto" === e.slug) || (0, L.isCryptoMarketSlug)(t) || (0, L.isCryptoMarketSlug)(r)
        },
        ek = e => !!e ? .tags ? .length && e.tags.some(e => "1013" == `${e?.id??""}`);

    function ej(e) {
        if (!e.length) return () => !1;
        let t = new Set(e.map(e => e.id)),
            r = new Set(e.map(e => (e.series ? .[0] ? .slug || "").toLowerCase()).filter(Boolean)),
            s = new Set(e.map(e => eu.HOURLY_UP_OR_DOWN_PREFIXES.find(t => (e.slug || "").toLowerCase().startsWith(t)) || "").filter(Boolean));
        return e => {
            if (t.has(e.id)) return !0;
            let i = (e.series ? .[0] ? .slug || "").toLowerCase();
            if (i && r.has(i)) return !0;
            let n = (e.slug || "").toLowerCase();
            return !!(n && Array.from(s).some(e => n.startsWith(e)))
        }
    }
    let eA = {
            categorySlug: "sports",
            sortSpec: "volume",
            eventStatus: "active",
            limitPerType: "50"
        },
        eL = {
            categorySlug: "esports",
            sortSpec: "volume",
            eventStatus: "active",
            limitPerType: "50"
        };

    function eR() {
        return (0, R.getEventsWithQuery)(eL)
    }

    function eC() {
        return (0, R.getEventsWithQuery)(eA)
    }
    let eD = e => e ? .__midtermsRichCard === !0,
        eF = e => e ? .__marketIntegrityCard === !0;
    var eM = e.i(208956),
        eP = e.i(347465),
        eO = e.i(383140),
        eq = e.i(939022),
        eI = e.i(339776);
    let eK = 2 * Math.PI,
        eU = .45 * eO.DOT_PITCH,
        eB = "#A0A3B1",
        eW = {
            WA: eI.SAFE_D,
            CA: eI.SAFE_D,
            HI: eI.SAFE_D,
            MA: eI.SAFE_D,
            RI: eI.SAFE_D,
            DE: eI.SAFE_D,
            MD: eI.SAFE_D,
            CT: eI.SAFE_D,
            OR: eI.LIKELY_D,
            CO: eI.LIKELY_D,
            NM: eI.LIKELY_D,
            VA: eI.LIKELY_D,
            NJ: eI.LIKELY_D,
            MN: eI.LIKELY_D,
            IL: eI.LIKELY_D,
            VT: eI.LIKELY_D,
            NV: eI.LEAN_D,
            NH: eI.LEAN_D,
            ME: eI.LEAN_D,
            WI: eI.LEAN_D,
            PA: eI.LEAN_D,
            MI: eI.TOSSUP,
            NC: eI.TOSSUP,
            GA: eI.TOSSUP,
            AZ: eI.LEAN_R,
            OH: eI.LEAN_R,
            FL: eI.LEAN_R,
            TX: eI.LIKELY_R,
            IA: eI.LIKELY_R,
            MT: eI.LIKELY_R,
            AK: eI.LIKELY_R,
            ID: eI.SAFE_R,
            WY: eI.SAFE_R,
            UT: eI.SAFE_R,
            ND: eI.SAFE_R,
            SD: eI.SAFE_R,
            NE: eI.SAFE_R,
            KS: eI.SAFE_R,
            OK: eI.SAFE_R,
            AR: eI.SAFE_R,
            LA: eI.SAFE_R,
            MS: eI.SAFE_R,
            AL: eI.SAFE_R,
            TN: eI.SAFE_R,
            KY: eI.SAFE_R,
            WV: eI.SAFE_R,
            SC: eI.SAFE_R,
            IN: eI.SAFE_R,
            MO: eI.SAFE_R,
            NY: eB
        };

    function eQ() {
        let e, s, i, n, a, o = (0, r.c)(10),
            c = (0, l.useRef)(null),
            u = (0, l.useRef)(null),
            {
                paths: d,
                loading: m
            } = (0, eP.useStatePaths)();
        e: {
            let t;
            if (0 === d.length) {
                let t;
                o[0] === Symbol.for("react.memo_cache_sentinel") ? (t = [], o[0] = t) : t = o[0], e = t;
                break e
            }
            if (o[1] !== d) {
                let e = (0, eP.cleanRogueDots)((0, eP.rasterizeDots)(d)),
                    r = (0, eP.buildBorderSet)(e);
                t = e.filter((e, t) => !r.has(t)), o[1] = d, o[2] = t
            } else t = o[2];e = t
        }
        let g = e;
        if (o[3] !== g) {
            let e = (0, eI.resolveAllTierColors)();
            for (let t of (s = new Map, g)) {
                let r = eW[t.stateAbbr] ? ? eB,
                    i = e[r] ? ? r,
                    n = s.get(i);
                n || (n = [], s.set(i, n)), n.push(t)
            }
            o[3] = g, o[4] = s
        } else s = o[4];
        let f = s;
        return (o[5] !== g || o[6] !== f ? (i = () => {
            let e = c.current,
                t = u.current;
            if (!e || !t || 0 === g.length) return;
            let r = () => {
                let r = t.clientWidth,
                    s = t.clientHeight;
                if (0 === r || 0 === s) return;
                let i = window.devicePixelRatio || 1;
                e.width = Math.round(r * i), e.height = Math.round(s * i);
                let n = e.getContext("2d");
                if (!n) return;
                let l = {
                        x: 0,
                        y: 0,
                        w: eO.VW,
                        h: eO.VH
                    },
                    a = Math.max(eO.VW / r, eO.VH / s),
                    o = (0, eq.computeTransform)(r, s, l, {
                        s: 1,
                        x: 0,
                        y: 0
                    }, a);
                for (let [e, t] of (n.setTransform(i * o.scale, 0, 0, i * o.scale, i * o.tx, i * o.ty), n.globalAlpha = .55, f)) {
                    for (let r of (n.fillStyle = e, n.beginPath(), t)) n.moveTo(r.x + eU, r.y), n.arc(r.x, r.y, eU, 0, eK);
                    n.fill()
                }
            };
            r();
            let s = new ResizeObserver(r);
            return s.observe(t), () => s.disconnect()
        }, n = [g, f], o[5] = g, o[6] = f, o[7] = i, o[8] = n) : (i = o[7], n = o[8]), (0, l.useEffect)(i, n), m || 0 === g.length) ? null : (o[9] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("div", {
            ref: u,
            className: "absolute inset-0 pointer-events-none",
            children: (0, t.jsx)("canvas", {
                ref: c,
                className: "w-full h-full"
            })
        }), o[9] = a) : a = o[9], a)
    }
    let eG = (0, l.memo)(function() {
        let e, s, i, n, l, o, c, u = (0, r.c)(13),
            d = (0, a.useTranslations)();
        return u[0] !== d ? (e = d("midterms.card.title"), u[0] = d, u[1] = e) : e = u[1], u[2] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("br", {}), u[2] = s) : s = u[2], u[3] !== d ? (i = d("midterms.card.highlight"), u[3] = d, u[4] = i) : i = u[4], u[5] !== i ? (n = (0, t.jsx)("span", {
            className: "relative inline-block midterms-gradient-text",
            children: i
        }), u[5] = i, u[6] = n) : n = u[6], u[7] !== e || u[8] !== n ? (l = (0, t.jsx)("div", {
            className: "relative flex flex-col justify-start gap-2 p-5 md:p-6 flex-1 z-10",
            children: (0, t.jsxs)("h3", {
                className: "text-[24px] font-semibold leading-[1.1] tracking-[-0.02em] text-text-primary",
                children: [e, s, n]
            })
        }), u[7] = e, u[8] = n, u[9] = l) : l = u[9], u[10] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)("div", {
            className: "absolute right-0 left-0 scale-110 -bottom-1/2 h-full",
            children: (0, t.jsx)(eQ, {})
        }), u[10] = o) : o = u[10], u[11] !== l ? (c = (0, t.jsxs)(eM.default, {
            href: "/predictions/midterms",
            className: "relative flex flex-col rounded-xl overflow-hidden dark:hover:bg-neutral-25 min-h-[180px] h-full cursor-pointer transition hover:-translate-y-px hover:shadow-lg shadow-md shadow-black/4 hover:shadow-black/8 border",
            children: [l, o]
        }), u[11] = l, u[12] = c) : c = u[12], c
    });

    function eH() {
        let e, s = (0, r.c)(1);
        return s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)("div", {
            className: "absolute inset-0 overflow-hidden pointer-events-none",
            "aria-hidden": !0,
            children: (0, t.jsx)("div", {
                className: "absolute inset-0 grid grid-cols-[repeat(16,1fr)] grid-rows-[repeat(8,1fr)] gap-px opacity-60",
                children: Array.from({
                    length: 128
                }).map(e$)
            })
        }), s[0] = e) : e = s[0], e
    }

    function e$(e, r) {
        let s = 29 === r || 59 === r || 78 === r || 108 === r,
            i = 39 === r || 89 === r || 122 === r,
            n = 11 === r || 67 === r || 101 === r || 114 === r;
        return (0, t.jsx)("div", {
            className: s ? "bg-[#1452F0]" : i ? "bg-[#1452F0]/50" : n ? "bg-[#1452F0]/20" : "bg-black/[0.04] dark:bg-white/[0.02]"
        }, r)
    }
    eG.displayName = "MidtermsRichCard";
    let eY = (0, l.memo)(function() {
        let e, s, i, n, l = (0, r.c)(4);
        return l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(eH, {}), l[0] = e) : e = l[0], l[1] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("img", {
            src: "/static/images/market-integrity/icon.svg",
            alt: "",
            width: 72,
            height: 73,
            className: "shrink-0 dark:hidden"
        }), i = (0, t.jsx)("img", {
            src: "/static/images/market-integrity/icon-white.svg",
            alt: "",
            width: 72,
            height: 73,
            className: "shrink-0 hidden dark:block"
        }), l[1] = s, l[2] = i) : (s = l[1], i = l[2]), l[3] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsxs)("a", {
            href: "https://integrity.polymarket.com/",
            target: "_blank",
            rel: "noopener noreferrer",
            className: "relative flex items-center rounded-[15.2px] overflow-hidden min-h-[180px] h-full cursor-pointer transition hover:-translate-y-px hover:shadow-lg shadow-md shadow-black/4 hover:shadow-black/8 border border-border dark:border-[#242B32]",
            children: [e, (0, t.jsxs)("div", {
                className: "relative z-10 flex flex-col items-start justify-center gap-3 py-3 pl-5 md:pl-6 w-[300px] h-[177px]",
                children: [s, i, (0, t.jsxs)("h3", {
                    className: "font-semibold text-[24px] leading-[26.4px] tracking-[-0.48px]",
                    children: [(0, t.jsx)("span", {
                        className: "text-text-primary",
                        children: "Market Integrity"
                    }), (0, t.jsx)("br", {}), (0, t.jsx)("span", {
                        className: "text-text-primary/75",
                        children: "Rules & Standards"
                    })]
                })]
            })]
        }), l[3] = n) : n = l[3], n
    });
    eY.displayName = "MarketIntegrityCard";
    let ez = (0, l.memo)(e => {
        let s, i = (0, r.c)(2),
            {
                count: n
            } = e;
        return i[0] !== n ? (s = (0, t.jsx)(t.Fragment, {
            children: [...Array(n).keys()].map(e1)
        }), i[0] = n, i[1] = s) : s = i[1], s
    });
    ez.displayName = "SkeletonCards";
    let eV = (0, l.memo)(() => {
        let e, s, i = (0, r.c)(4),
            n = (0, a.useTranslations)();
        return i[0] !== n ? (e = n("search.noResultsFound"), i[0] = n, i[1] = e) : e = i[1], i[2] !== e ? (s = (0, t.jsx)("div", {
            className: "flex justify-center py-3 w-full",
            children: (0, t.jsx)("p", {
                className: "p-2 text-sm text-text-secondary",
                children: e
            })
        }), i[2] = e, i[3] = s) : s = i[3], s
    });
    eV.displayName = "NoResults";
    let eX = (0, l.memo)(() => {
        let e, s = (0, r.c)(1);
        return s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)("div", {
            className: "flex items-center gap-2",
            children: (0, t.jsx)("div", {
                className: "flex relative transition-all",
                children: (0, t.jsx)("span", {
                    className: "flex justify-center items-center w-full transition-all",
                    children: (0, t.jsx)(w.BeatLoader, {
                        color: "gray",
                        loading: !0,
                        size: 10
                    })
                })
            })
        }), s[0] = e) : e = s[0], e
    });
    eX.displayName = "LoadingIndicator";
    let eJ = (0, l.memo)(T.MarketCard),
        eZ = e => ({
            isTrending: e.isTrending,
            isWatchlist: e.isWatchlist,
            hideSports: e.hideSports,
            hideCrypto: e.hideCrypto,
            hideEarnings: e.hideEarnings,
            status: e.status,
            secondaryTagSlug: e.secondaryTagSlug,
            primaryTagSlug: e.primaryTagSlug
        }),
        e0 = (0, l.memo)(function({
            gridClassName: e,
            initialCategory: i,
            initialSortBy: a
        }) {
            let {
                isTrending: o,
                isWatchlist: c,
                hideSports: d,
                hideCrypto: m,
                hideEarnings: g,
                status: v,
                secondaryTagSlug: p,
                primaryTagSlug: y
            } = (0, u.useDiscoveryFeedStore)(eZ, N.shallow), x = (0, u.useBoundDiscoveryFeedStore)();
            (0, l.useEffect)(() => {
                x.persist.hasHydrated() || x.persist.rehydrate()
            }, [x]);
            let {
                authenticated: S
            } = (0, h.useAccountContext)(["authenticated"]), w = (0, V.useFeatureFlagVariant)("picked_for_you"), T = (0, l.useSyncExternalStore)(() => () => {}, () => !0, () => !1) && !!(0, z.getSessionHint)(), P = (0, n.useRouter)(), O = (0, l.useMemo)(() => {
                let e = P.asPath.split("?")[0].split("/")[1];
                return e && e in k.URL_SLUG_TO_PAGE ? k.URL_SLUG_TO_PAGE[e] : "home"
            }, [P.asPath]), I = "/crypto" === P.pathname, K = "politics" === P.query.category && (!P.query.slug || "midterms" === P.query.slug), {
                query: U
            } = (0, $.useMarketsContext)(["query"]), B = U ? ._q ? ? "", [W, er] = (0, l.useState)(Y.ITEMS_PER_PAGE), {
                eventPages: eg,
                hasNextPage: eM,
                fetchNextPage: eP,
                isPending: eO,
                isFetching: eq,
                isFetchingNextPage: eI,
                isStale: eK
            } = function({
                showFavorites: e = !1,
                initialCategory: t,
                initialSortBy: r
            } = {}) {
                let s = (0, u.useDiscoveryFeedStore)(et, N.shallow),
                    i = (0, ee.useLocale)(),
                    {
                        query: n
                    } = (0, $.useMarketsContext)(["query"]),
                    a = (0, l.useRef)(!1),
                    o = (0, l.useRef)(s._s);
                o.current !== s._s && (a.current = !0, o.current = s._s);
                let c = a.current ? s._s : r ? ? s._s,
                    d = {
                        categorySlug: s._c ? ? t,
                        sortSpec: c,
                        eventStatus: s._sts,
                        recurrence: s._r,
                        limitPerType: Z.DEFAULT_TAB_MARKET_COUNT.toString(),
                        searchQuery: s._q ? ? n ? ._q ? ? void 0,
                        locale: i,
                        optimized: !1
                    },
                    m = (0, R.createEventsQueryKey)(d, e),
                    {
                        data: g,
                        fetchNextPage: f,
                        hasNextPage: h,
                        isPending: v,
                        isFetching: p,
                        isStale: y,
                        isFetchingNextPage: x
                    } = (0, J.useInfiniteQuery)({
                        queryKey: m,
                        queryFn: async ({
                            pageParam: t
                        }) => {
                            let r = await (0, R.getEventsWithQuery)(d, t ? ? void 0, e, !0);
                            if (!t && "politics" === d.categorySlug) {
                                let e = await (0, R.getEvent)("balance-of-power-2026-midterms");
                                e && (r.events = [e, ...r.events.filter(e => "balance-of-power-2026-midterms" !== e.slug)])
                            }
                            return r
                        },
                        getNextPageParam: e => e.nextCursor ? ? void 0,
                        refetchOnWindowFocus: !1,
                        refetchOnReconnect: !1,
                        staleTime: 6e4,
                        initialPageParam: null
                    });
                return {
                    events: l.default.useMemo(() => g ? g.pages.flatMap(e => e.events) : void 0, [g]),
                    eventPages: l.default.useMemo(() => g ? .pages.map(e => e.events) || [], [g]),
                    fetchNextPage: f,
                    hasNextPage: h,
                    isFetchingNextPage: x,
                    isPending: v,
                    isFetching: p,
                    isStale: y
                }
            }({
                showFavorites: c,
                initialCategory: i,
                initialSortBy: a
            }), eU = "home" === O && o && "all" === p && !B && !c && "active" === v && !d && !m && !g, eB = null !== w && eU && (S || T), {
                events: eW,
                fetchNextPage: eQ,
                hasNextPage: eH,
                isFetchingNextPage: e$
            } = function(e) {
                let t, s, i, n, l, a = (0, r.c)(17),
                    {
                        enabled: o,
                        variant: c
                    } = e;
                a[0] !== c ? (t = ["homepage-recommendations-infinite", Z.DEFAULT_TAB_MARKET_COUNT, c], s = async e => {
                    let {
                        pageParam: t
                    } = e;
                    return en(Z.DEFAULT_TAB_MARKET_COUNT, {
                        ignorePagination: 0 === t,
                        variant: c ? ? void 0
                    })
                }, a[0] = c, a[1] = t, a[2] = s) : (t = a[1], s = a[2]), a[3] !== o || a[4] !== t || a[5] !== s ? (i = {
                    queryKey: t,
                    queryFn: s,
                    getNextPageParam: ea,
                    initialPageParam: 0,
                    refetchOnWindowFocus: !1,
                    refetchOnReconnect: !1,
                    staleTime: 6e4,
                    enabled: o
                }, a[3] = o, a[4] = t, a[5] = s, a[6] = i) : i = a[6];
                let {
                    data: u,
                    fetchNextPage: d,
                    hasNextPage: m,
                    isPending: g,
                    isFetching: f,
                    isFetchingNextPage: h,
                    isStale: v
                } = (0, J.useInfiniteQuery)(i);
                a[7] !== u ? (n = u ? u.pages.flatMap(el) : void 0, a[7] = u, a[8] = n) : n = a[8];
                let p = n;
                return a[9] !== p || a[10] !== d || a[11] !== m || a[12] !== f || a[13] !== h || a[14] !== g || a[15] !== v ? (l = {
                    events: p,
                    fetchNextPage: d,
                    hasNextPage: m,
                    isPending: g,
                    isFetching: f,
                    isFetchingNextPage: h,
                    isStale: v
                }, a[9] = p, a[10] = d, a[11] = m, a[12] = f, a[13] = h, a[14] = g, a[15] = v, a[16] = l) : l = a[16], l
            }({
                enabled: eB,
                variant: w
            }), e0 = (0, l.useMemo)(() => [y || (o ? "trending" : "home"), c ? "watchlist" : "markets", p, v, d ? "hide-sports" : "", m ? "hide-crypto" : "", g ? "hide-earnings" : "", B].filter(Boolean).join("|"), [B, m, g, d, o, c, y, p, v]), [e1, e2] = (0, l.useState)(e0), e3 = e1 !== e0;
            (0, l.useEffect)(() => {
                er(Y.ITEMS_PER_PAGE)
            }, [e0]);
            let {
                events: e5
            } = (e => {
                let t, s, i, n, l, a = (0, r.c)(9),
                    o = (0, D.useQueryClient)(),
                    c = e ? .enabled ? ? !0;
                a[0] !== o ? (t = () => o.getQueryData(F.queryKeys[M.QueryKey.Events].featured().queryKey), a[0] = o, a[1] = t) : t = a[1];
                let u = t;
                a[2] === Symbol.for("react.memo_cache_sentinel") ? (s = F.queryKeys[M.QueryKey.Events].featured(), a[2] = s) : s = a[2], a[3] === Symbol.for("react.memo_cache_sentinel") ? (i = ["data"], a[3] = i) : i = a[3], a[4] !== c || a[5] !== u ? (n = {
                    queryKey: s.queryKey,
                    queryFn: Q,
                    refetchOnWindowFocus: !1,
                    refetchOnReconnect: !1,
                    staleTime: 3e5,
                    initialData: u,
                    enabled: c,
                    notifyOnChangeProps: i,
                    select: G
                }, a[4] = c, a[5] = u, a[6] = n) : n = a[6];
                let {
                    data: d
                } = (0, E.useQuery)(n);
                return a[7] !== d ? (l = {
                    events: d
                }, a[7] = d, a[8] = l) : l = a[8], l
            })({
                enabled: !0
            }), e4 = (0, l.useMemo)(() => {
                if (!e5) return [];
                let e = e5;
                return "resolved" === v ? e = e.filter(e => e ? .closed === !0) : "active" === v && (e = e.filter(e => e ? .closed === !1)), d && (e = e.filter(e => !e ? .tags ? .some(e => "sports" === e.slug || "esports" === e.slug))), m && (e = e.filter(e => !(e => {
                    if (!e) return !1;
                    let t = e.slug ? .toLowerCase() ? ? "",
                        r = e.series ? .[0] ? .slug ? .toLowerCase() ? ? "";
                    return e.tags ? .some(e => "crypto" === e.slug) || (0, L.isCryptoMarketSlug)(t) || (0, L.isCryptoMarketSlug)(r)
                })(e))), g && (e = e.filter(e => !(e ? .tags ? .length && e.tags.some(e => "1013" == `${e?.id??""}`)))), e
            }, [e5, v, d, m, g]), {
                sportsEvents: e6
            } = function(e) {
                let t, s, i, n, l, a, o, c, u, d, m = (0, r.c)(21),
                    {
                        enabled: g
                    } = e,
                    f = (0, D.useQueryClient)();
                m[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, R.createEventsQueryKey)(eA, !1), m[0] = t) : t = m[0];
                let h = t;
                m[1] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, R.createEventsQueryKey)(eL, !1), m[1] = s) : s = m[1];
                let v = s;
                m[2] !== f ? (i = () => f.getQueryData(h), m[2] = f, m[3] = i) : i = m[3], m[4] !== g || m[5] !== i ? (n = {
                    queryKey: h,
                    queryFn: eC,
                    enabled: g,
                    staleTime: 2e4,
                    refetchOnWindowFocus: !1,
                    refetchOnReconnect: !1,
                    initialData: i
                }, m[4] = g, m[5] = i, m[6] = n) : n = m[6];
                let {
                    data: p
                } = (0, E.useQuery)(n);
                m[7] !== f ? (l = () => f.getQueryData(v), m[7] = f, m[8] = l) : l = m[8], m[9] !== g || m[10] !== l ? (a = {
                    queryKey: v,
                    queryFn: eR,
                    enabled: g,
                    staleTime: 2e4,
                    refetchOnWindowFocus: !1,
                    refetchOnReconnect: !1,
                    initialData: l
                }, m[9] = g, m[10] = l, m[11] = a) : a = m[11];
                let {
                    data: y
                } = (0, E.useQuery)(a);
                m[12] !== p ? .events ? (o = p ? .events ? ? [], m[12] = p ? .events, m[13] = o) : o = m[13], m[14] !== y ? .events ? (c = y ? .events ? ? [], m[14] = y ? .events, m[15] = c) : c = m[15], m[16] !== o || m[17] !== c ? (u = [...o, ...c], m[16] = o, m[17] = c, m[18] = u) : u = m[18];
                let x = u;
                return m[19] !== x ? (d = {
                    sportsEvents: x
                }, m[19] = x, m[20] = d) : d = m[20], d
            }({
                enabled: o && !U._q && !c && "active" === v && !d
            }), e7 = !d && e6.length > 0 ? e6 : [], e8 = (0, X.useServerDate)(), [e9, te] = (0, l.useState)(() => e8 ? (0, ec.getBtc5mTimestampFromMs)(new Date(e8).getTime()) : null);
            (0, l.useEffect)(() => {
                te((0, ec.getCurrentBtc5mTimestamp)())
            }, []), (0, l.useEffect)(() => {
                if (!ec.ENABLE_BTC_5M_HOMEPAGE_SLOT || !e9) return;
                let e = setTimeout(() => {
                    te((0, ec.getCurrentBtc5mTimestamp)())
                }, 3e5 - (0, eo.getServerNow)() % 3e5);
                return () => clearTimeout(e)
            }, [e9]);
            let tt = null != e9 ? (0, ec.getBtc5mSlug)(e9) : null,
                {
                    data: tr
                } = (0, E.useQuery)({
                    queryKey: ["btc-5m-market", tt],
                    queryFn: () => (0, R.getEvent)(tt ? ? ""),
                    enabled: ec.ENABLE_BTC_5M_HOMEPAGE_SLOT && null != tt,
                    staleTime: 3e5,
                    refetchOnWindowFocus: !1,
                    placeholderData: b.keepPreviousData
                }),
                ts = (0, l.useMemo)(() => {
                    if (tr) return (0, es.normalizeUpDownEvent)({ ...tr,
                        isLive: !0
                    })
                }, [tr]),
                ti = (0, l.useMemo)(() => ({
                    isTrending: o,
                    isWatchlist: c,
                    hideSports: d,
                    hideCrypto: m,
                    hideEarnings: g,
                    status: v,
                    secondaryTagSlug: p,
                    queryQ: U._q ? ? void 0
                }), [m, g, d, o, c, U._q, p, v]),
                tn = (0, l.useRef)(e7.length > 0 ? [...e7] : []),
                tl = (0, l.useRef)(ti);
            tl.current !== ti && (tl.current = ti, tn.current = []), e7.length > 0 && 0 === tn.current.length && (tn.current = [...e7]);
            let ta = tn.current,
                to = (0, l.useMemo)(() => (function({
                    eventPages: e,
                    featuredEvents: t,
                    sportsEvents: r,
                    options: s
                }) {
                    if (!e ? .length) return [];
                    let {
                        isTrending: i,
                        isWatchlist: n,
                        hideSports: l,
                        hideCrypto: a,
                        hideEarnings: o,
                        status: c,
                        secondaryTagSlug: u,
                        queryQ: d
                    } = s, m = new Set, g = new Set, f = [], h = i && "all" === u && !d && !n, v = i && !d && !n && "active" === c && !l && r.length > 0, p = (() => {
                        if (!h || !t ? .length) return [];
                        let e = [...t];
                        return "resolved" === c ? e = e.filter(e => e ? .closed === !0) : "active" === c && (e = e.filter(e => e ? .closed === !1)), l && (e = e.filter(e => !e ? .tags ? .some(e => "sports" === e.slug || "esports" === e.slug))), a && (e = e.filter(e => !eT(e))), o && (e = e.filter(e => !ek(e))), e
                    })(), y = ej(p), x = e => {
                        let t = e.filter(e => !!e && !(0, q.isHiddenEventSlug)(e ? .slug));
                        return l && (t = t.filter(e => !e.tags ? .some(e => "sports" === e.slug || "esports" === e.slug))), a && (t = t.filter(e => !eT(e))), o && (t = t.filter(e => !ek(e))), "resolved" === c ? t = t.filter(e => !0 === e.closed) : "active" === c && (t = t.filter(e => !1 === e.closed)), t
                    }, _ = e => {
                        for (let t of e) {
                            if (!t || t.id && m.has(t.id)) continue;
                            let e = t;
                            if (em(t)) {
                                let r = t.series ? .[0] ? .slug ? .toLowerCase();
                                if (r && g.has(r) || !Array.isArray(t.series ? .[0] ? .events)) continue;
                                e = ed(t)
                            }
                            if (!e ? .markets ? .length || 0 === (0, A.filterActiveMarkets)(e, {
                                    _sts: c
                                }).length) continue;
                            let r = (e.slug || "").toLowerCase(),
                                s = eu.HOURLY_UP_OR_DOWN_PREFIXES.some(e => r.startsWith(e)),
                                i = { ...e,
                                    isLive: !!s && !!e.isLive
                                };
                            f.push(i), i.id && m.add(i.id);
                            let n = i.series ? .[0] ? .slug ? .toLowerCase();
                            n && g.add(n)
                        }
                    };
                    for (let t = 0; t < e.length; t++) {
                        let s = e[t];
                        if (!s) continue;
                        let i = x(s),
                            n = h ? i.filter(e => !y(e)) : i;
                        if (0 === t) {
                            if (_(p.length > 0 ? [...p, ...n] : n), v && f.length > 0) {
                                let e = f.slice(0, 4),
                                    t = new Set(e.map(e => e.id).filter(Boolean)),
                                    s = (function(e, t = new Set) {
                                        let r = new Date,
                                            s = [],
                                            i = new Map,
                                            n = new Set;
                                        for (let s of e) {
                                            let e = s.id;
                                            if (!e || s.parentEventId || n.has(e) || (n.add(e), t.has(s.id))) continue;
                                            let l = ef(s);
                                            if (!l || !eS(s, l) || !0 === s.ended || !0 === s.closed || ey(s, r) || eN(s) < ep(l)) continue;
                                            let a = eE(s, r);
                                            if (null === a) continue;
                                            let o = eb(s),
                                                c = a < 0;
                                            (o && !ex(s, r) || ew(a, l) || c && !s.ended && !ex(s, r)) && (i.has(l) || i.set(l, []), i.get(l) ? .push(s))
                                        }
                                        for (let [e, t] of i) {
                                            let i = [...t].sort((e, t) => eN(t) - eN(e)),
                                                n = e ? (0, ei.getSportPinMaxPerSeries)(e) : 2,
                                                l = 1;
                                            if (i.length >= 2) {
                                                let e = eN(i[0]) >= 3e5 && eN(i[1]) >= 3e5,
                                                    t = new Date,
                                                    r = i.slice(0, 2).reduce((e, r) => {
                                                        let s = eE(r, t);
                                                        return e + +!!(eb(r) || null !== s && s <= 60)
                                                    }, 0);
                                                (e || r >= 2) && (l = Math.min(i.length, n))
                                            }
                                            for (let e = 0; e < Math.min(l, i.length); e++) {
                                                let t = i[e];
                                                if (!0 === t.ended || !0 === t.closed) continue;
                                                let n = eE(t, r);
                                                if (null === n) continue;
                                                let l = eb(t),
                                                    a = ef(t),
                                                    o = function(e, t, r, s) {
                                                        let i = Math.log1p(eN(e));
                                                        if (t) return i;
                                                        let n = ev(s);
                                                        return n <= 0 ? i : i + 10 * Math.max(0, Math.min(1, (n - Math.max(0, r)) / n))
                                                    }(t, l, n, a);
                                                s.push({
                                                    event: t,
                                                    score: o,
                                                    isLive: n < 0,
                                                    minutesToStart: n
                                                })
                                            }
                                        }
                                        return s.sort((e, t) => e.isLive && !t.isLive ? -1 : !e.isLive && t.isLive ? 1 : t.score - e.score), s.slice(0, 8)
                                    })([...f.filter(e => e && !t.has(e.id)), ...r].filter(e => (function(e, t = new Date) {
                                        if (e.parentEventId) return !1;
                                        let r = ef(e);
                                        if (!r || !eS(e, r) || e.closed || e.ended || ey(e, t) || eN(e) < ep(r)) return !1;
                                        let s = eE(e, t);
                                        return !(null === s || ex(e, t)) && (eb(e) || ew(s, r))
                                    })(e)), t).filter(e => e ? .event && !e.event.ended && !e.event.closed);
                                if (s.length > 0) {
                                    let t = new Set(s.map(e => e.event.id)),
                                        r = f.slice(4).filter(e => !t.has(e.id)).map(e => e_(e, "1", "sports") || e_(e, "64", "esports") ? { ...e,
                                            isLive: !1
                                        } : e),
                                        i = [...e, ...s.map(e => ({ ...e.event,
                                            isLive: function(e) {
                                                if (!ef(e) || e.closed || e.ended) return !1;
                                                let t = eh(e);
                                                if (!t) return !1;
                                                let r = new Date;
                                                return !(r <= t || ex(e, r) || ey(e, r))
                                            }(e.event),
                                            pinnedByPregame: !0
                                        })).filter(e => e ? .markets ? .length > 0 && (0, A.filterActiveMarkets)(e, {
                                            _sts: c
                                        }).length > 0), ...r],
                                        n = new Set,
                                        l = i.filter(e => {
                                            let t = e ? .id;
                                            return !t || !n.has(t) && (n.add(t), !0)
                                        });
                                    for (let e of (f.length = 0, f.push(...l), m.clear(), g.clear(), f)) {
                                        e.id && m.add(e.id);
                                        let t = e.series ? .[0] ? .slug ? .toLowerCase();
                                        t && g.add(t)
                                    }
                                }
                            }
                        } else _(n)
                    }
                    return f
                })({
                    eventPages: eg,
                    featuredEvents: e4,
                    sportsEvents: ta,
                    options: ti
                }), [eg, e4, ta, ti]),
                tc = (0, l.useMemo)(() => eO && U._q, [eO, U._q]),
                [tu, td] = (0, l.useState)([]),
                tm = (0, l.useMemo)(() => to.length ? to : null, [to]);
            (0, l.useEffect)(() => {
                if (tm ? .length) {
                    if (!e3) return void td(tm);
                    td(tm), e2(e0)
                }
            }, [tm, e0, e3]);
            let tg = (0, l.useMemo)(() => {
                    let e = null;
                    if (!e3 && tm ? .length ? e = tm : tu.length ? e = tu : tm ? .length && (e = tm), !e) return null;
                    if (K) e = [{
                        __midtermsRichCard: !0,
                        id: -999997,
                        slug: "midterms-rich-card-placeholder",
                        title: "2026 Midterm Elections",
                        markets: []
                    }, ...e = e.filter(e => !eD(e))];
                    else if (o && "all" === p && !U._q && !c) {
                        e = e.filter(e => !(0, ec.isBtc5mEvent)(e.slug) && !(0, ec.isBtc15mEvent)(e.slug));
                        let t = [];
                        ec.ENABLE_BTC_5M_HOMEPAGE_SLOT && ts && !m && t.push(ts), e = [{
                            __marketIntegrityCard: !0,
                            id: -999998,
                            slug: "market-integrity-card-placeholder",
                            title: "Market Integrity",
                            markets: []
                        }, ...e.slice(0, 1), ...t, ...e.slice(1)]
                    }
                    if (eB && eW ? .length) {
                        let t = Math.min(8, e.length),
                            r = e.slice(0, t),
                            s = new Set(r.map(e => e.id)),
                            i = ej(e4);
                        e = [...r, ...eW.filter(e => !s.has(e.id) && !i(e) && !!e ? .markets ? .length && (0, A.filterActiveMarkets)(e, {
                            _sts: v
                        }).length > 0 && !(0, q.isHiddenEventSlug)(e ? .slug))]
                    }
                    return e
                }, [tm, e3, tu, ts, o, p, U._q, c, m, K, eB, eW, e4, v]),
                tf = (0, l.useMemo)(() => !tg ? .length && (!!eO || !!eq && !eI), [tg, eO, eq, eI]),
                th = eB && !!eW ? .length,
                tv = tg ? .[0] && eF(tg[0]) ? 9 : 8,
                tp = (0, l.useCallback)(e => {
                    if (eU) {
                        if (e < tv) return "pinned_market";
                        if (eB) {
                            if (!th) return;
                            return "recs_baseline" === w ? "recommendation_baseline" : "recommendation"
                        }
                        return "volume_24hr"
                    }
                }, [eU, eB, th, w, tv]),
                ty = (0, l.useCallback)(e => eU && eB && !th && e >= tv, [eU, eB, th, tv]),
                tx = (0, l.useCallback)((e, r) => eF(r) ? (0, t.jsx)(eY, {}, "market-integrity-card") : eD(r) ? (0, t.jsx)(eG, {}, "midterms-rich-card") : (0, t.jsx)(eJ, {
                    event: r,
                    status: v,
                    position: e,
                    page: O,
                    cardSource: tp(e),
                    skipImpression: ty(e)
                }, `evt-${r?.id}`), [v, O, tp, ty]),
                t_ = eB ? eH : eM,
                tS = eB ? e$ : eI,
                tb = (0, l.useCallback)(() => {
                    !S || eO || (eB ? !e$ && eH && eQ() : !eI && eM && eP())
                }, [S, eO, eB, eI, eM, eP, e$, eH, eQ]),
                tE = (0, l.useMemo)(() => tg ? S ? tg : tg.slice(0, W) : null, [tg, S, W]),
                tw = (0, l.useMemo)(() => !!tg && !S && (tg.length > W || t_), [tg, S, W, t_]),
                tN = (0, l.useCallback)(() => {
                    let e = (0, f.getNextLoggedOutVisibleEventCount)({
                        currentVisibleCount: W,
                        pageSize: Y.ITEMS_PER_PAGE
                    });
                    er(e), tg && e >= tg.length && t_ && (eB ? e$ || eQ() : eI || eP())
                }, [W, tg, t_, eB, eI, eP, e$, eQ]),
                tT = (0, C.useSetLoading)({
                    isStale: eK,
                    isFetching: eq
                }),
                tk = (0, s.cn)("grid h-auto gap-3 grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4", e),
                tj = !tE && tc && tu.length > 0 ? tu : void 0,
                tA = (0, l.useCallback)((e, r) => (0, t.jsx)("div", {
                    children: eF(e) ? (0, t.jsx)(eY, {}) : eD(e) ? (0, t.jsx)(eG, {}) : (0, t.jsx)(eJ, {
                        event: e,
                        status: v,
                        position: r,
                        page: O,
                        cardSource: tp(r),
                        skipImpression: ty(r)
                    })
                }, `evt-${e?.id}`), [v, O, tp, ty]);
            return (0, t.jsx)(_, {
                items: tE ? ? tj ? ? null,
                renderItem: tA,
                isLoading: tf,
                overlayVisible: tT || e3,
                emptyState: (0, t.jsx)(eV, {}),
                loadingState: (0, t.jsx)("div", {
                    className: tk,
                    children: (0, t.jsx)(ez, {
                        count: 12
                    })
                }),
                footer: !S && tE && tw ? (0, t.jsx)(H.default, {
                    onShowMore: tN,
                    isFetchingNextPage: tS,
                    loadingContent: (0, t.jsx)(eX, {})
                }) : void 0,
                gridClassName: tk,
                containerClassName: (0, s.cn)("pt-px pb-10", I ? "px-3 lg:px-0" : "px-4 lg:px-6", e ? "lg:px-0!" : ""),
                virtualizedRenderer: S && tE ? ({
                    items: e,
                    gridClassName: r
                }) => (0, t.jsx)(j.VirtualGrid, {
                    data: e,
                    listClassName: r,
                    itemContent: tx,
                    useWindowScroll: !0,
                    increaseViewportBy: 1e3,
                    onEndReached: tb,
                    footer: (t_ || tS) && tE ? (0, t.jsx)("div", {
                        className: "w-full flex justify-center p-2 my-2",
                        children: tS && (0, t.jsx)(eX, {})
                    }) : void 0
                }, e1) : void 0
            })
        });

    function e1(e) {
        return (0, t.jsx)(S.Skeleton, {
            className: "w-full h-[172px]"
        }, e)
    }
    var e2 = e.i(233035),
        e3 = e.i(23128),
        e5 = e.i(435894),
        e4 = e.i(211721),
        e6 = e.i(673280),
        e7 = e.i(736556);
    let e8 = async () => {
        try {
            let {
                data: e
            } = await P.axios.get("/api/search/trending");
            return e
        } catch (e) {
            return console.error("Error getting trending searches", e), []
        }
    };
    var e9 = e.i(675215),
        te = e.i(649480),
        tt = e.i(301713),
        tr = e.i(922445),
        ts = e.i(444298);

    function ti() {
        let e, s, i, o, c, u, d, m, f, h, p, y, x, _, S, w, N, T, k, j, A, L, R, C, D, F, M, P = (0, r.c)(60),
            O = (0, a.useTranslations)(),
            q = (0, n.useRouter)(),
            I = (0, v.useAmplitudeAnalytics)(),
            K = (0, e9.useTrackingEmail)(),
            U = (0, l.useRef)(null),
            B = (0, l.useRef)(null);
        P[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["handleSearch", "handleSearchEnter", "setQuery", "query"], P[0] = e) : e = P[0];
        let {
            handleSearch: W,
            handleSearchEnter: Q,
            setQuery: G,
            query: H
        } = (0, $.useMarketsContext)(e), [Y, z] = (0, l.useState)(""), [V, X] = (0, l.useState)(!1), [J, Z] = (0, l.useState)(!1), ee = (0, l.useRef)("");
        P[1] === Symbol.for("react.memo_cache_sentinel") ? (s = ["search", "trending"], P[1] = s) : s = P[1];
        let et = V && !Y;
        P[2] !== et ? (i = {
            queryKey: s,
            queryFn: ta,
            placeholderData: b.keepPreviousData,
            select: tl,
            staleTime: 1e4,
            gcTime: 3e4,
            refetchOnWindowFocus: !1,
            retry: 1,
            enabled: et
        }, P[2] = et, P[3] = i) : i = P[3];
        let {
            data: er,
            isLoading: es
        } = (0, E.useQuery)(i);
        P[4] !== G ? (o = () => {
            z(""), G({
                _q: null
            })
        }, P[4] = G, P[5] = o) : o = P[5];
        let ei = o;
        P[6] !== H || P[7] !== q.isReady ? (c = () => {
            !q.isReady || H._q && z(H._q)
        }, P[6] = H, P[7] = q.isReady, P[8] = c) : c = P[8], P[9] !== q.isReady ? (u = [q.isReady], P[9] = q.isReady, P[10] = u) : u = P[10], (0, l.useEffect)(c, u), P[11] !== I || P[12] !== Y || P[13] !== K ? (d = () => {
            if (!Y) return;
            let e = setTimeout(() => {
                let e = Y.trim();
                e.length >= 3 && e !== ee.current && (ee.current = e, I.trackEvent(g.Events.SearchHomepage, {
                    query: e
                }), (0, te.trackMetaEvent)({
                    eventName: "Search",
                    params: {
                        search_string: e
                    },
                    email: K
                }), (0, tt.trackRedditEvent)({
                    eventName: "Search",
                    params: {
                        search_string: e
                    },
                    email: K
                }))
            }, 1e3);
            return () => {
                clearTimeout(e)
            }
        }, m = [Y, I, K], P[11] = I, P[12] = Y, P[13] = K, P[14] = d, P[15] = m) : (d = P[14], m = P[15]), (0, l.useEffect)(d, m), P[16] === Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
            ee.current = ""
        }, f = [], P[16] = f, P[17] = h) : (f = P[16], h = P[17]), (0, l.useEffect)(h, f), P[18] === Symbol.for("react.memo_cache_sentinel") ? (p = () => {
            let e = e => {
                B.current && !B.current.contains(e.target) && (X(!1), Z(!1))
            };
            return document.addEventListener("mousedown", e), () => {
                document.removeEventListener("mousedown", e)
            }
        }, y = [], P[18] = p, P[19] = y) : (p = P[18], y = P[19]), (0, l.useEffect)(p, y), P[20] !== J ? (x = () => {
            J && U.current && U.current.focus()
        }, _ = [J], P[20] = J, P[21] = x, P[22] = _) : (x = P[21], _ = P[22]), (0, l.useEffect)(x, _), P[23] === Symbol.for("react.memo_cache_sentinel") ? (S = e => {
            B.current ? .contains(e.relatedTarget) || (X(!1), Z(!1))
        }, P[23] = S) : S = P[23];
        let en = `hidden lg:block shrink-0 transition-all duration-200 overflow-hidden ${J?"lg:w-0 lg:opacity-0":"lg:w-10 lg:opacity-100"}`;
        P[24] === Symbol.for("react.memo_cache_sentinel") ? (w = (0, t.jsx)(e3.Button, {
            variant: "ghost",
            size: "icon",
            className: "transition-none size-10",
            onClick: () => Z(!0),
            children: (0, t.jsx)(e7.IconMagnifierOutline18, {})
        }), P[24] = w) : w = P[24], P[25] !== en ? (N = (0, t.jsx)("div", {
            className: en,
            children: w
        }), P[25] = en, P[26] = N) : N = P[26];
        let el = `relative w-full lg:transition-all lg:duration-300 lg:ease-out lg:overflow-hidden ${J?"lg:w-52 lg:opacity-100":"lg:w-0 lg:opacity-0"}`;
        return P[27] !== O ? (T = O("search.placeholder"), P[27] = O, P[28] = T) : T = P[28], P[29] === Symbol.for("react.memo_cache_sentinel") ? (k = () => X(!0), P[29] = k) : k = P[29], P[30] !== W ? (j = e => {
            let t = e.target.value;
            z(t), W(t)
        }, P[30] = W, P[31] = j) : j = P[31], P[32] !== I || P[33] !== Q || P[34] !== Y || P[35] !== K ? (A = e => {
            if ("Escape" === e.key) {
                X(!1), Z(!1), U.current ? .blur();
                return
            }
            if ("Enter" === e.key || "Return" === e.key) {
                if (e.preventDefault(), e.stopPropagation(), (0, tr.isNarrowViewport)()) {
                    X(!1), U.current ? .blur();
                    return
                }
                let t = Y.trim();
                t.length >= 3 && t !== ee.current && (ee.current = t, I.trackEvent(g.Events.SearchHomepage, {
                    query: t
                }), (0, te.trackMetaEvent)({
                    eventName: "Search",
                    params: {
                        search_string: t
                    },
                    email: K
                }), (0, tt.trackRedditEvent)({
                    eventName: "Search",
                    params: {
                        search_string: t
                    },
                    email: K
                })), Q(Y), X(!1), U.current ? .blur()
            }
        }, P[32] = I, P[33] = Q, P[34] = Y, P[35] = K, P[36] = A) : A = P[36], P[37] !== Y || P[38] !== T || P[39] !== j || P[40] !== A ? (L = (0, t.jsx)(e5.Input, {
            ref: U,
            variant: "filled",
            id: "homepage-search-input",
            placeholder: T,
            value: Y,
            onFocus: k,
            onChange: j,
            onKeyDown: A,
            autoComplete: "off",
            className: "w-full pl-10 h-10 peer lg:pl-9 lg:placeholder:ml-0.5 focus-visible:ring-0 placeholder:text-[15px] placeholder:font-[400] md:placeholder:text-sm border border-transparent focus-visible:border-input-outlined-border md:placeholder:font-medium"
        }), P[37] = Y, P[38] = T, P[39] = j, P[40] = A, P[41] = L) : L = P[41], P[42] === Symbol.for("react.memo_cache_sentinel") ? (R = (0, t.jsx)("div", {
            className: "flex text-text-tertiary justify-start pl-3 absolute items-center top-1/2 -translate-y-1/2 pointer-events-none",
            children: (0, t.jsx)(e7.IconMagnifierOutline18, {})
        }), P[42] = R) : R = P[42], P[43] !== ei || P[44] !== Y ? (C = Y ? (0, t.jsx)("button", {
            type: "button",
            onClick: ei,
            "aria-label": "Clear search",
            className: "p-1 flex items-center justify-center shrink-0 text-text-secondary cursor-pointer hover:text-text-tertiary absolute right-2 top-1/2 -translate-y-1/2",
            children: (0, t.jsx)(e4.IconXmarkOutline12, {})
        }) : null, P[43] = ei, P[44] = Y, P[45] = C) : C = P[45], P[46] !== el || P[47] !== L || P[48] !== C ? (D = (0, t.jsxs)("div", {
            className: el,
            children: [L, R, C]
        }), P[46] = el, P[47] = L, P[48] = C, P[49] = D) : D = P[49], P[50] !== V || P[51] !== es || P[52] !== Y || P[53] !== O || P[54] !== er ? (F = V && !Y && (0, t.jsxs)("div", {
            className: "absolute top-full left-0 right-0 lg:left-auto lg:right-0 lg:w-64 mt-1 bg-background text-text text-sm font-medium rounded-md border p-1.5 shadow-md z-50",
            children: [(0, t.jsx)("p", {
                className: "px-2.5 py-1.5 mb-1 text-sm font-medium text-text-secondary",
                children: O("navbar.trending")
            }), (0, t.jsx)("div", {
                className: "flex flex-col gap-1.5",
                children: es ? [void 0, void 0, void 0, void 0, void 0].map(tn) : er ? .map(e => (0, t.jsxs)(eM.default, {
                    href: `/predictions/${encodeURIComponent((0,ts.normalizeSearchQueryForUrl)(e.search_term))}`,
                    onClick: () => {
                        X(!1), z("")
                    },
                    className: "flex items-center gap-2 rounded-sm px-2.5 py-2 text-text hover:bg-neutral-50 cursor-pointer [&_svg]:text-text-secondary [&_svg]:shrink-0",
                    children: [(0, t.jsx)(e6.IconArrowTrendUpOutline18, {}), (0, t.jsx)("p", {
                        className: "text-sm",
                        children: e.search_term
                    })]
                }, e.search_term))
            })]
        }), P[50] = V, P[51] = es, P[52] = Y, P[53] = O, P[54] = er, P[55] = F) : F = P[55], P[56] !== N || P[57] !== D || P[58] !== F ? (M = (0, t.jsxs)("div", {
            className: "flex items-center relative w-full lg:w-auto",
            ref: B,
            onBlur: S,
            children: [N, D, F]
        }), P[56] = N, P[57] = D, P[58] = F, P[59] = M) : M = P[59], M
    }

    function tn(e, r) {
        return (0, t.jsx)("div", {
            className: "px-2.5 py-2",
            children: (0, t.jsx)(S.Skeleton, {
                className: "h-4 w-32"
            })
        }, r)
    }

    function tl(e) {
        return e.slice(0, 5)
    }

    function ta() {
        return e8()
    }
    var to = e.i(254380);

    function tc({
        active: e,
        className: t,
        activeClassName: r,
        inactiveClassName: i
    }) {
        return (0, s.cn)("inline-flex text-body-base font-medium cursor-pointer h-8 items-center justify-center whitespace-nowrap rounded-[6px] px-3", e ? "bg-bg-brand/10 dark:bg-bg-brand/20 text-text-brand" : "text-tabs-text hover:text-tabs-text-hover", e ? r : i, t)
    }

    function tu(e) {
        let i, n, a, o, c = (0, r.c)(12),
            {
                children: u,
                ariaLabel: d,
                className: m,
                listClassName: g,
                containerRef: f
            } = e,
            h = void 0 === d ? "Market tabs" : d,
            v = l.default.useRef(null),
            p = f ? ? v;
        return c[0] !== m ? (i = (0, s.cn)("flex overflow-x-auto snap-x scroll-px-3 snap-mandatory no-scrollbar px-4 lg:px-0", m), c[0] = m, c[1] = i) : i = c[1], c[2] !== g ? (n = (0, s.cn)("flex gap-x-1 h-9 items-center", g), c[2] = g, c[3] = n) : n = c[3], c[4] !== h || c[5] !== u || c[6] !== n ? (a = (0, t.jsx)("nav", {
            className: n,
            "aria-label": h,
            children: u
        }), c[4] = h, c[5] = u, c[6] = n, c[7] = a) : a = c[7], c[8] !== p || c[9] !== i || c[10] !== a ? (o = (0, t.jsx)(to.ScrollContainer, {
            showArrows: !0,
            className: i,
            containerRef: p,
            scrollDirection: "horizontal",
            children: a
        }), c[8] = p, c[9] = i, c[10] = a, c[11] = o) : o = c[11], o
    }
    var td = e.i(57194),
        tm = e.i(403591);
    let tg = {
            oscars: "/predictions/oscars/2026"
        },
        tf = e => ({
            primaryTagSlug: e.primaryTagSlug,
            secondaryTagSlug: e.secondaryTagSlug,
            onSecondaryTagChange: e.onSecondaryTagChange,
            sortBy: e.sortBy,
            status: e.status,
            recurrence: e.recurrence,
            isWatchlist: e.isWatchlist
        });

    function th() {
        let e, s, i, c, d, m, f, p, y, x, _, S, b, w, T, k, j, A, L, C = (0, r.c)(95),
            P = (0, D.useQueryClient)(),
            O = (0, n.useRouter)(),
            q = O.query.category,
            I = O.query.slug,
            K = (0, a.useTranslations)(),
            U = (0, ee.useLocale)(),
            B = (0, v.useAmplitudeAnalytics)();
        C[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], C[0] = e) : e = C[0];
        let {
            authenticated: W
        } = (0, h.useAccountContext)(e), {
            primaryTagSlug: Q,
            secondaryTagSlug: G,
            onSecondaryTagChange: H,
            sortBy: Y,
            status: z,
            recurrence: V,
            isWatchlist: X
        } = (0, u.useDiscoveryFeedStore)(tf, N.shallow);
        C[1] === Symbol.for("react.memo_cache_sentinel") ? (s = ["query"], C[1] = s) : s = C[1];
        let {
            query: J
        } = (0, $.useMarketsContext)(s), et = J._q ? ? void 0, er = "/[category]" === O.pathname || "/[category]/[slug]" === O.pathname, es = q ? o.CATEGORY_SLUG_MAPPINGS[q] : void 0, ei = er && q && "new" !== q ? es || q : void 0, en = ei || Q, el = !!ei, ea = el ? en : "all", eo = el ? I || "all" : G;
        C[2] !== U || C[3] !== ea ? (i = F.queryKeys[M.QueryKey.Tags].filteredTagsBySlug(ea, "active", U), C[2] = U, C[3] = ea, C[4] = i) : i = C[4], C[5] !== U || C[6] !== P || C[7] !== ea ? (c = () => P.getQueryData(F.queryKeys[M.QueryKey.Tags].filteredTagsBySlug(ea, "active", U).queryKey), C[5] = U, C[6] = P, C[7] = ea, C[8] = c) : c = C[8], C[9] !== i.queryKey || C[10] !== c ? (d = {
            queryKey: i.queryKey,
            queryFn: tm.getFilteredTagsBySlugFetcher,
            initialData: c,
            staleTime: 3e5,
            gcTime: 3e5
        }, C[9] = i.queryKey, C[10] = c, C[11] = d) : d = C[11];
        let {
            data: ec
        } = (0, E.useQuery)(d), eu = (0, l.useRef)(null);
        C[12] !== ec ? (m = ec ? ? [], C[12] = ec, C[13] = m) : m = C[13], C[14] !== m ? (f = m.filter(tv), C[14] = m, C[15] = f) : f = C[15];
        let ed = f;
        C[16] !== X || C[17] !== U || C[18] !== Q || C[19] !== P || C[20] !== V || C[21] !== et || C[22] !== G || C[23] !== Y || C[24] !== z ? (p = e => {
            if (!e || e === G) return;
            let t = {
                    categorySlug: "all" === e ? ["trending", "new"].includes(Q) ? void 0 : Q : e,
                    sortSpec: Y,
                    eventStatus: z,
                    recurrence: V,
                    limitPerType: Z.DEFAULT_TAB_MARKET_COUNT.toString(),
                    searchQuery: et,
                    locale: U
                },
                r = (0, R.createEventsQueryKey)(t, X);
            P.getQueryState(r) || P.prefetchInfiniteQuery({
                queryKey: r,
                queryFn: e => {
                    let {
                        pageParam: r
                    } = e;
                    return (0, R.getEventsWithQuery)(t, r ? ? void 0, X)
                },
                initialPageParam: null,
                staleTime: 6e4
            })
        }, C[16] = X, C[17] = U, C[18] = Q, C[19] = P, C[20] = V, C[21] = et, C[22] = G, C[23] = Y, C[24] = z, C[25] = p) : p = C[25];
        let em = p;
        C[26] !== B || C[27] !== W || C[28] !== ed || C[29] !== H ? (y = e => {
            e && (W && B.trackEvent(g.Events.SecondaryTagClick, {
                tag: e
            }), (0, l.startTransition)(() => H(e)), (0, td.scrollSelectedButtonIntoView)(eu, ed, e))
        }, C[26] = B, C[27] = W, C[28] = ed, C[29] = H, C[30] = y) : y = C[30];
        let eg = y;
        if (0 === ed.length) return null;
        if (el) {
            let e, r, s, i, n, l, a, o = `/${q}`,
                c = "all" === eo;
            if (C[31] !== c ? (e = tc({
                    active: c
                }), C[31] = c, C[32] = e) : e = C[32], C[33] !== B || C[34] !== W ? (r = () => W && B.trackEvent(g.Events.SecondaryTagClick, {
                    tag: "all"
                }), C[33] = B, C[34] = W, C[35] = r) : r = C[35], C[36] !== K ? (s = K("filters.all"), C[36] = K, C[37] = s) : s = C[37], C[38] !== s ? (i = (0, t.jsx)("span", {
                    className: "text-body-base font-medium",
                    children: s
                }), C[38] = s, C[39] = i) : i = C[39], C[40] !== e || C[41] !== r || C[42] !== i || C[43] !== o ? (n = (0, t.jsx)(eM.default, {
                    href: o,
                    className: e,
                    onClick: r,
                    children: i
                }), C[40] = e, C[41] = r, C[42] = i, C[43] = o, C[44] = n) : n = C[44], C[45] !== eo || C[46] !== B || C[47] !== W || C[48] !== q || C[49] !== ed) {
                let e;
                C[51] !== eo || C[52] !== B || C[53] !== W || C[54] !== q ? (e = e => (0, t.jsx)(eM.default, {
                    href: tg[e.slug] ? ? `/${q}/${e.slug}`,
                    className: tc({
                        active: eo === e.slug
                    }),
                    prefetch: !0,
                    onClick: () => W && B.trackEvent(g.Events.SecondaryTagClick, {
                        tag: e.slug
                    }),
                    children: e.label
                }, e.slug), C[51] = eo, C[52] = B, C[53] = W, C[54] = q, C[55] = e) : e = C[55], l = ed.map(e), C[45] = eo, C[46] = B, C[47] = W, C[48] = q, C[49] = ed, C[50] = l
            } else l = C[50];
            return C[56] !== n || C[57] !== l ? (a = (0, t.jsxs)(tu, {
                ariaLabel: "Market tags",
                containerRef: eu,
                children: [n, l]
            }), C[56] = n, C[57] = l, C[58] = a) : a = C[58], a
        }
        let ef = "all" === G;
        if (C[59] !== ef ? (x = tc({
                active: ef
            }), C[59] = ef, C[60] = x) : x = C[60], C[61] !== em ? (_ = () => em("all"), S = () => em("all"), b = () => em("all"), C[61] = em, C[62] = _, C[63] = S, C[64] = b) : (_ = C[62], S = C[63], b = C[64]), C[65] !== eg || C[66] !== G ? (w = () => {
                "all" !== G && eg("all")
            }, C[65] = eg, C[66] = G, C[67] = w) : w = C[67], C[68] !== K ? (T = K("filters.all"), C[68] = K, C[69] = T) : T = C[69], C[70] !== T ? (k = (0, t.jsx)("span", {
                className: "text-body-base font-medium",
                children: T
            }), C[70] = T, C[71] = k) : k = C[71], C[72] !== x || C[73] !== _ || C[74] !== S || C[75] !== b || C[76] !== w || C[77] !== k ? (j = (0, t.jsx)("button", {
                type: "button",
                className: x,
                onPointerEnter: _,
                onPointerDown: S,
                onFocus: b,
                onClick: w,
                children: k
            }), C[72] = x, C[73] = _, C[74] = S, C[75] = b, C[76] = w, C[77] = k, C[78] = j) : j = C[78], C[79] !== B || C[80] !== W || C[81] !== ed || C[82] !== eg || C[83] !== em || C[84] !== G) {
            let e;
            C[86] !== B || C[87] !== W || C[88] !== eg || C[89] !== em || C[90] !== G ? (e = e => {
                let r = tg[e.slug];
                if (r) return (0, t.jsx)(eM.default, {
                    href: r,
                    className: tc({
                        active: !1
                    }),
                    onClick: () => W && B.trackEvent(g.Events.SecondaryTagClick, {
                        tag: e.slug
                    }),
                    children: (0, t.jsx)("span", {
                        className: "text-body-base font-medium",
                        children: e.label
                    })
                }, e.slug);
                let s = G === e.slug;
                return (0, t.jsx)("button", {
                    type: "button",
                    className: tc({
                        active: s
                    }),
                    onPointerEnter: () => em(e.slug),
                    onPointerDown: () => em(e.slug),
                    onFocus: () => em(e.slug),
                    onClick: () => {
                        s || eg(e.slug)
                    },
                    children: (0, t.jsx)("span", {
                        className: "text-body-base font-medium",
                        children: e.label
                    })
                }, e.slug)
            }, C[86] = B, C[87] = W, C[88] = eg, C[89] = em, C[90] = G, C[91] = e) : e = C[91], A = ed.map(e), C[79] = B, C[80] = W, C[81] = ed, C[82] = eg, C[83] = em, C[84] = G, C[85] = A
        } else A = C[85];
        return C[92] !== j || C[93] !== A ? (L = (0, t.jsxs)(tu, {
            ariaLabel: "Market tabs",
            containerRef: eu,
            children: [j, A]
        }), C[92] = j, C[93] = A, C[94] = L) : L = C[94], L
    }

    function tv(e) {
        return "breaking-news" !== e.slug
    }
    var tp = e.i(76095);
    e.s(["default", 0, function(e) {
        let s, c, u, d, m, g, f, h, v, p, x = (0, r.c)(33),
            {
                showCategoryFilters: _,
                hideTags: S,
                collapseTagsFromLg: b,
                gridClassName: E,
                title: w,
                category: N,
                initialCategory: T,
                initialSortBy: k
            } = e,
            j = void 0 === _ || _,
            A = void 0 !== S && S,
            L = void 0 !== b && b,
            R = (0, a.useTranslations)(),
            C = (0, n.useRouter)(),
            [D, F] = (0, l.useState)(!1);
        if (x[0] !== N || x[1] !== C.asPath || x[2] !== R || x[3] !== w) {
            let e;
            e: {
                let t = C.asPath.split("?")[0].split("/")[1];
                if (t && t in o.CATEGORY_SLUG_MAPPINGS) {
                    e = t;
                    break e
                }
                e = N
            }
            let t = e;
            t: {
                if (w) {
                    s = w;
                    break t
                }
                if (!t) {
                    s = void 0;
                    break t
                }
                if ((0, o.isCoreCategorySlug)(t)) {
                    let e, r = o.CATEGORY_TITLE_KEYS[t];
                    x[5] !== R || x[6] !== r ? (e = R(r), x[5] = R, x[6] = r, x[7] = e) : e = x[7], s = e;
                    break t
                }
                s = (0, tp.toAdjustedTitleCase)((0, ts.tagToReadableString)(t))
            }
            x[0] = N, x[1] = C.asPath, x[2] = R, x[3] = w, x[4] = s
        } else s = x[4];
        let M = s;
        return x[8] !== M || x[9] !== R ? (c = M ? ? R("homepageV2.allMarkets"), x[8] = M, x[9] = R, x[10] = c) : c = x[10], x[11] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, t.jsx)(ti, {}), x[11] = u) : u = x[11], x[12] !== D ? (d = (0, t.jsx)(e2.FilterButton, {
            filtersOpen: D,
            setFiltersOpen: F
        }), x[12] = D, x[13] = d) : d = x[13], x[14] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, t.jsx)(y, {}), x[14] = m) : m = x[14], x[15] !== d ? (g = (0, t.jsxs)(t.Fragment, {
            children: [d, m]
        }), x[15] = d, x[16] = g) : g = x[16], x[17] === Symbol.for("react.memo_cache_sentinel") ? (f = (0, t.jsx)(th, {}), x[17] = f) : f = x[17], x[18] !== D || x[19] !== j ? (h = (0, t.jsx)(e2.Filters, {
            open: D,
            hasSports: j,
            hasCrypto: j,
            hasEarnings: j,
            className: "pt-2.5 lg:pt-2"
        }), x[18] = D, x[19] = j, x[20] = h) : h = x[20], x[21] !== E || x[22] !== T || x[23] !== k ? (v = (0, t.jsx)(e0, {
            initialCategory: T,
            initialSortBy: k,
            gridClassName: E
        }), x[21] = E, x[22] = T, x[23] = k, x[24] = v) : v = x[24], x[25] !== L || x[26] !== A || x[27] !== M || x[28] !== h || x[29] !== v || x[30] !== c || x[31] !== g ? (p = (0, t.jsx)(i, {
            title: M,
            desktopTitle: c,
            hideTags: A,
            collapseTagsFromLg: L,
            searchSlot: u,
            actionsSlot: g,
            tagsSlot: f,
            filtersSlot: h,
            content: v
        }), x[25] = L, x[26] = A, x[27] = M, x[28] = h, x[29] = v, x[30] = c, x[31] = g, x[32] = p) : p = x[32], p
    }], 776796)
}]);

//# debugId=368feee6-0c09-ee61-9227-4da553407df3