;
! 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] = "620d6562-9210-77cf-f55c-dccd6451e3ce")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 336593, 913182, 877965, 940472, 996065, 183592, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(964974),
        s = e.i(749654),
        i = e.i(192842);

    function n(e, t, r) {
        let n = (0, i.toDate)(e, r ? .in);
        return isNaN(t) ? (0, s.constructFrom)(r ? .in || e, NaN) : (t && n.setDate(n.getDate() + t), n)
    }

    function a(e, t, r) {
        let n = (0, i.toDate)(e, r ? .in);
        if (isNaN(t)) return (0, s.constructFrom)(r ? .in || e, NaN);
        if (!t) return n;
        let a = n.getDate(),
            o = (0, s.constructFrom)(r ? .in || e, n.getTime());
        return (o.setMonth(n.getMonth() + t + 1, 0), a >= o.getDate()) ? o : (n.setFullYear(o.getFullYear(), o.getMonth(), a), n)
    }

    function o(e, t, r) {
        let {
            years: o = 0,
            months: l = 0,
            weeks: u = 0,
            days: c = 0,
            hours: d = 0,
            minutes: p = 0,
            seconds: h = 0
        } = t, m = (0, i.toDate)(e, r ? .in), f = l || o ? a(m, l + 12 * o) : m, g = c || u ? n(f, c + 7 * u) : f;
        return (0, s.constructFrom)(r ? .in || e, +g + 1e3 * (h + 60 * (p + 60 * d)))
    }

    function l(e, t, r) {
        return a(e, -t, r)
    }

    function u(e, t, r) {
        let {
            years: i = 0,
            months: a = 0,
            weeks: o = 0,
            days: u = 0,
            hours: c = 0,
            minutes: d = 0,
            seconds: p = 0
        } = t, h = n(l(e, a + 12 * i, r), -(u + 7 * o), r);
        return (0, s.constructFrom)(r ? .in || e, h - 1e3 * (p + 60 * (d + 60 * c)))
    }
    e.s(["addDays", 0, n], 913182), e.s(["addMonths", 0, a], 877965), e.s(["add", 0, o], 940472), e.s(["subMonths", 0, l], 996065), e.s(["sub", 0, u], 183592);
    var c = e.i(476979),
        d = e.i(593332),
        p = e.i(655740),
        h = e.i(631222);
    let m = ["100639", "1"],
        f = async e => {
            try {
                let t = new URLSearchParams;
                for (let e of m) t.append("tag_id", e);
                for (let [r, s] of (t.append("active", "true"), t.append("closed", "false"), t.append("order", "startTime"), t.append("ascending", "true"), t.append("limit", "200"), Object.entries(e))) t.append(r, s);
                return ((await p.axios.get(`${h.GAMMA_API_URL}/events/keyset?${t.toString()}`)).data.events || []).map(e => e.slug)
            } catch {
                return []
            }
        },
        g = async () => {
            let e = new Date,
                t = u(e, {
                    hours: 1
                }),
                r = o(e, {
                    minutes: 5
                }),
                [s, i, n] = await Promise.all([f({
                    live: "true"
                }), f({
                    start_time_min: t.toISOString(),
                    start_time_max: r.toISOString()
                }), f({
                    start_time_min: e.toISOString(),
                    start_time_max: o(e, {
                        hours: 24
                    }).toISOString()
                })]),
                a = new Set([...s, ...i]),
                l = e => (0, c.isEsportsSlug)((0, d.parseSportsSlug)(e).sport);
            return {
                live: [...a].filter(l).length,
                upcoming: n.filter(l).length
            }
        };

    function k() {
        return {}
    }

    function y() {
        return {}
    }

    function S() {
        return {}
    }

    function w() {
        return {}
    }
    e.s(["useEsportsEventCounts", 0, function() {
        let e, s = (0, t.c)(1);
        s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
            queryKey: ["esportsEventCounts"],
            queryFn: g,
            staleTime: 0,
            gcTime: 3e5,
            refetchOnMount: "always",
            refetchOnWindowFocus: !1,
            refetchOnReconnect: !1
        }, s[0] = e) : e = s[0];
        let {
            data: i
        } = (0, r.useQuery)(e);
        return i
    }, "useLatestEventDates", 0, function() {
        let e, s = (0, t.c)(1);
        s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
            queryKey: ["sportsLatestEventDates"],
            queryFn: w,
            staleTime: 1 / 0,
            gcTime: 1 / 0,
            refetchOnMount: !1,
            refetchOnWindowFocus: !1,
            refetchOnReconnect: !1
        }, s[0] = e) : e = s[0];
        let {
            data: i
        } = (0, r.useQuery)(e);
        return i
    }, "useParentToChildEventIds", 0, function() {
        let e, s = (0, t.c)(1);
        s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
            queryKey: ["parentToChildEventIds"],
            queryFn: k,
            staleTime: 1 / 0,
            gcTime: 1 / 0,
            refetchOnMount: !1,
            refetchOnWindowFocus: !1,
            refetchOnReconnect: !1
        }, s[0] = e) : e = s[0];
        let {
            data: i
        } = (0, r.useQuery)(e);
        return i
    }, "usePopularCounts", 0, function() {
        let e, s = (0, t.c)(1);
        s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
            queryKey: ["sportsPopularCounts"],
            queryFn: y,
            staleTime: 1 / 0,
            gcTime: 1 / 0,
            refetchOnMount: !1,
            refetchOnWindowFocus: !1,
            refetchOnReconnect: !1
        }, s[0] = e) : e = s[0];
        let {
            data: i
        } = (0, r.useQuery)(e);
        return i
    }, "useSportsVolumes", 0, function() {
        let e, s = (0, t.c)(1);
        s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
            queryKey: ["sportsVolumes"],
            queryFn: S,
            staleTime: 1 / 0,
            gcTime: 1 / 0,
            refetchOnMount: !1,
            refetchOnWindowFocus: !1,
            refetchOnReconnect: !1
        }, s[0] = e) : e = s[0];
        let {
            data: i
        } = (0, r.useQuery)(e);
        return i
    }], 336593)
}, 756900, 755330, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        s = e.i(215959),
        i = e.i(416340),
        n = e.i(149285),
        a = e.i(86831);
    let o = (0, e.i(322324).create)(e => ({
        isStreaming: !1,
        stream: null,
        pipVisible: !0,
        startStreaming: (t, r = !0) => e({
            isStreaming: !0,
            stream: t,
            pipVisible: r
        }),
        stopStreaming: () => e({
            isStreaming: !1,
            stream: null,
            pipVisible: !0
        }),
        setPipVisible: t => e({
            pipVisible: t
        })
    }));

    function l() {
        let e, t = (0, r.c)(7),
            s = o(m),
            i = o(h),
            n = o(p),
            a = o(d),
            l = o(c),
            f = o(u);
        return t[0] !== n || t[1] !== l || t[2] !== f || t[3] !== s || t[4] !== i || t[5] !== a ? (e = {
            startStreaming: s,
            stopStreaming: i,
            isStreaming: n,
            stream: a,
            pipVisible: l,
            setPipVisible: f
        }, t[0] = n, t[1] = l, t[2] = f, t[3] = s, t[4] = i, t[5] = a, t[6] = e) : e = t[6], e
    }

    function u(e) {
        return e.setPipVisible
    }

    function c(e) {
        return e.pipVisible
    }

    function d(e) {
        return e.stream
    }

    function p(e) {
        return e.isStreaming
    }

    function h(e) {
        return e.stopStreaming
    }

    function m(e) {
        return e.startStreaming
    }
    e.s(["useLivestream", 0, l], 755330);
    let f = () => {
            let e, s = (0, r.c)(1);
            return s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsxs)("svg", {
                xmlns: "http://www.w3.org/2000/svg",
                viewBox: "0 0 24 24",
                fill: "none",
                stroke: "currentColor",
                strokeWidth: "2",
                strokeLinecap: "round",
                strokeLinejoin: "round",
                width: "16",
                height: "16",
                children: [(0, t.jsx)("path", {
                    d: "M18 6 6 18"
                }), (0, t.jsx)("path", {
                    d: "m6 6 12 12"
                })]
            }), s[0] = e) : e = s[0], e
        },
        g = e => {
            let s, i, n = (0, r.c)(5),
                {
                    stream: a
                } = e;
            if ("iframe" === a.type) {
                let e;
                return n[0] !== a.src ? (e = (0, t.jsx)("iframe", {
                    title: "Livestream",
                    src: a.src,
                    className: "w-full h-full rounded-lg",
                    allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
                    allowFullScreen: !0,
                    referrerPolicy: "strict-origin-when-cross-origin"
                }), n[0] = a.src, n[1] = e) : e = n[1], e
            }
            return n[2] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("track", {
                kind: "captions"
            }), n[2] = s) : s = n[2], n[3] !== a.src ? (i = (0, t.jsx)("video", {
                src: a.src,
                className: "w-full h-full rounded-lg",
                controls: !0,
                autoPlay: !0,
                playsInline: !0,
                children: s
            }), n[3] = a.src, n[4] = i) : i = n[4], i
        };

    function k(e, t, r) {
        return Math.max(t, Math.min(r, e))
    }
    let y = () => {
        let e, o, u, c, d, p, h, m, y, S, w, v, _, b, M, T, A, I, x, D, C, E, P, F, L, B, O, H, N, R, W, z, $, q, j, U, V, K = (0, r.c)(69),
            {
                isStreaming: Q,
                stream: G,
                stopStreaming: Y,
                pipVisible: X
            } = l(),
            [J, Z] = i.default.useState(!1);
        K[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
            x: 0,
            y: 0
        }, K[0] = e) : e = K[0];
        let [ee, et] = i.default.useState(e);
        K[1] === Symbol.for("react.memo_cache_sentinel") ? (o = {
            width: 400,
            height: 225
        }, K[1] = o) : o = K[1];
        let [er, es] = i.default.useState(o), [ei, en] = i.default.useState(!1), ea = i.default.useRef(!1), eo = i.default.useRef(!1);
        K[2] === Symbol.for("react.memo_cache_sentinel") ? (u = {
            mx: 0,
            my: 0,
            px: 0,
            py: 0,
            w: 0,
            h: 0
        }, K[2] = u) : u = K[2];
        let el = i.default.useRef(u),
            eu = i.default.useRef(0),
            ec = i.default.useRef(null);
        K[3] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
            Z(!0)
        }, d = [], K[3] = c, K[4] = d) : (c = K[3], d = K[4]), i.default.useEffect(c, d), K[5] !== Q ? (p = () => {
            let e, t, r, s;
            if (!Q) return;
            let i = (e = window.innerWidth, t = window.innerHeight, s = Math.round(.5625 * (r = Math.min(400, e - 16))), {
                x: e - r - 8,
                y: t - s - 8,
                width: r,
                height: s
            });
            et({
                x: i.x,
                y: i.y
            }), es({
                width: i.width,
                height: i.height
            })
        }, h = [Q], K[5] = Q, K[6] = p, K[7] = h) : (p = K[6], h = K[7]), i.default.useEffect(p, h), K[8] === Symbol.for("react.memo_cache_sentinel") ? (m = () => () => {
            eu.current && cancelAnimationFrame(eu.current)
        }, y = [], K[8] = m, K[9] = y) : (m = K[8], y = K[9]), i.default.useEffect(m, y), K[10] === Symbol.for("react.memo_cache_sentinel") ? (S = () => {
            eu.current = 0, ec.current && (et(ec.current.pos), es(ec.current.size), ec.current = null)
        }, K[10] = S) : S = K[10];
        let ed = S;
        K[11] !== Y ? (w = e => {
            e.stopPropagation(), Y()
        }, K[11] = Y, K[12] = w) : w = K[12];
        let ep = w;
        K[13] === Symbol.for("react.memo_cache_sentinel") ? (v = e => {
            if (ea.current) {
                let {
                    mx: t,
                    my: r,
                    px: s,
                    py: i,
                    w: n,
                    h: a
                } = el.current;
                ec.current = {
                    pos: {
                        x: k(s + e.clientX - t, 0, window.innerWidth - n),
                        y: k(i + e.clientY - r, 0, window.innerHeight - a)
                    },
                    size: {
                        width: n,
                        height: a
                    }
                }
            }
            if (eo.current) {
                let {
                    mx: t,
                    my: r,
                    px: s,
                    py: i,
                    w: n,
                    h: a
                } = el.current, o = k(n + t - e.clientX, 280, 960), l = k(a + r - e.clientY, 158, 540);
                ec.current = {
                    pos: {
                        x: Math.max(0, s - (o - n)),
                        y: Math.max(0, i - (l - a))
                    },
                    size: {
                        width: o,
                        height: l
                    }
                }
            }
            ec.current && !eu.current && (eu.current = requestAnimationFrame(ed))
        }, K[13] = v) : v = K[13];
        let eh = v;
        K[14] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => {
            (ea.current || eo.current) && (ea.current = !1, eo.current = !1, en(!1), eu.current && (cancelAnimationFrame(eu.current), eu.current = 0), ec.current && (et(ec.current.pos), es(ec.current.size), ec.current = null))
        }, K[14] = _) : _ = K[14];
        let em = _;
        K[15] !== ee.x || K[16] !== ee.y || K[17] !== er.height || K[18] !== er.width ? (b = e => {
            e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), ea.current = !0, en(!0), el.current = {
                mx: e.clientX,
                my: e.clientY,
                px: ee.x,
                py: ee.y,
                w: er.width,
                h: er.height
            }
        }, K[15] = ee.x, K[16] = ee.y, K[17] = er.height, K[18] = er.width, K[19] = b) : b = K[19];
        let ef = b;
        K[20] !== ee.x || K[21] !== ee.y || K[22] !== er.height || K[23] !== er.width ? (M = e => {
            e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), eo.current = !0, en(!0), el.current = {
                mx: e.clientX,
                my: e.clientY,
                px: ee.x,
                py: ee.y,
                w: er.width,
                h: er.height
            }
        }, K[20] = ee.x, K[21] = ee.y, K[22] = er.height, K[23] = er.width, K[24] = M) : M = K[24];
        let eg = M;
        if (!Q || !G || !J) return null;
        K[25] === Symbol.for("react.memo_cache_sentinel") ? (T = (0, a.cn)("fixed flex flex-col rounded-xl shadow-2xl bg-neutral-900", "border border-neutral-800 overflow-hidden select-none"), K[25] = T) : T = K[25];
        let ek = X ? "auto" : "none";
        K[26] !== ee.x || K[27] !== ee.y || K[28] !== er.height || K[29] !== er.width || K[30] !== ek ? (A = {
            zIndex: 0x5f5e0ff,
            left: ee.x,
            top: ee.y,
            width: er.width,
            height: er.height,
            pointerEvents: ek
        }, K[26] = ee.x, K[27] = ee.y, K[28] = er.height, K[29] = er.width, K[30] = ek, K[31] = A) : A = K[31], K[32] === Symbol.for("react.memo_cache_sentinel") ? (I = {
            opacity: 0,
            scale: .9
        }, K[32] = I) : I = K[32];
        let ey = +!!X,
            eS = X ? 1 : .95;
        K[33] !== ey || K[34] !== eS ? (x = {
            opacity: ey,
            scale: eS
        }, K[33] = ey, K[34] = eS, K[35] = x) : x = K[35], K[36] === Symbol.for("react.memo_cache_sentinel") ? (D = {
            opacity: 0,
            scale: .9
        }, C = {
            duration: .3,
            ease: "easeInOut"
        }, K[36] = D, K[37] = C) : (D = K[36], C = K[37]);
        let ew = ei ? "grabbing" : "grab";
        K[38] !== ew ? (E = {
            cursor: ew,
            touchAction: "none"
        }, K[38] = ew, K[39] = E) : E = K[39], K[40] !== ef || K[41] !== E ? (P = (0, t.jsx)("div", {
            onPointerDown: ef,
            onPointerMove: eh,
            onPointerUp: em,
            onLostPointerCapture: em,
            className: "absolute top-0 inset-x-0 h-8 z-10",
            style: E
        }), K[40] = ef, K[41] = E, K[42] = P) : P = K[42], K[43] === Symbol.for("react.memo_cache_sentinel") ? (F = {
            cursor: "nwse-resize",
            touchAction: "none"
        }, L = (0, t.jsx)("div", {
            className: "absolute inset-0 rounded-br-lg bg-black/60 group-hover:bg-black/80 transition-colors"
        }), K[43] = F, K[44] = L) : (F = K[43], L = K[44]), K[45] === Symbol.for("react.memo_cache_sentinel") ? (B = (0, t.jsxs)("svg", {
            width: "8",
            height: "8",
            viewBox: "0 0 8 8",
            className: "absolute top-2 left-2 text-white",
            children: [(0, t.jsx)("path", {
                d: "M8 0L0 8",
                stroke: "currentColor",
                strokeWidth: "1.5"
            }), (0, t.jsx)("path", {
                d: "M5 0L0 5",
                stroke: "currentColor",
                strokeWidth: "1.5"
            })]
        }), K[45] = B) : B = K[45], K[46] !== eg ? (O = (0, t.jsxs)("div", {
            onPointerDown: eg,
            onPointerMove: eh,
            onPointerUp: em,
            onLostPointerCapture: em,
            className: "absolute top-0 left-0 w-6 h-6 z-30 group",
            style: F,
            children: [L, B]
        }), K[46] = eg, K[47] = O) : O = K[47], K[48] === Symbol.for("react.memo_cache_sentinel") ? (H = (0, t.jsx)("div", {
            className: "absolute top-0 left-0 w-8 h-8 z-20",
            style: {
                cursor: "nwse-resize",
                touchAction: "none"
            }
        }), K[48] = H) : H = K[48], K[49] === Symbol.for("react.memo_cache_sentinel") ? (N = (0, t.jsx)("div", {
            className: "absolute top-0 right-0 w-8 h-8 z-20",
            style: {
                cursor: "nesw-resize",
                touchAction: "none"
            }
        }), K[49] = N) : N = K[49], K[50] === Symbol.for("react.memo_cache_sentinel") ? (R = (0, t.jsx)("div", {
            className: "absolute bottom-0 left-0 w-8 h-8 z-20",
            style: {
                cursor: "nesw-resize",
                touchAction: "none"
            }
        }), K[50] = R) : R = K[50], K[51] === Symbol.for("react.memo_cache_sentinel") ? (W = (0, t.jsx)("div", {
            className: "absolute bottom-0 right-0 w-8 h-8 z-20",
            style: {
                cursor: "nwse-resize",
                touchAction: "none"
            }
        }), K[51] = W) : W = K[51], K[52] === Symbol.for("react.memo_cache_sentinel") ? (z = (0, t.jsx)(f, {}), K[52] = z) : z = K[52], K[53] !== ep ? ($ = (0, t.jsx)("button", {
            type: "button",
            onClick: ep,
            className: "absolute top-2 right-2 p-1 rounded-full bg-black/60 text-white hover:bg-black/80 cursor-pointer z-20",
            children: z
        }), K[53] = ep, K[54] = $) : $ = K[54];
        let ev = ei && "pointer-events-none";
        return K[55] !== ev ? (q = (0, a.cn)("flex-1 w-full h-full", ev), K[55] = ev, K[56] = q) : q = K[56], K[57] !== G ? (j = (0, t.jsx)(g, {
            stream: G
        }), K[57] = G, K[58] = j) : j = K[58], K[59] !== q || K[60] !== j ? (U = (0, t.jsx)("div", {
            className: q,
            children: j
        }), K[59] = q, K[60] = j, K[61] = U) : U = K[61], K[62] !== A || K[63] !== x || K[64] !== P || K[65] !== O || K[66] !== $ || K[67] !== U ? (V = (0, n.createPortal)((0, t.jsxs)(s.motion.div, {
            className: T,
            style: A,
            initial: I,
            animate: x,
            exit: D,
            transition: C,
            children: [P, O, H, N, R, W, $, U]
        }), document.body), K[62] = A, K[63] = x, K[64] = P, K[65] = O, K[66] = $, K[67] = U, K[68] = V) : V = K[68], V
    };
    e.s(["Livestream", 0, e => {
        let s, i, n = (0, r.c)(3),
            {
                children: a
            } = e;
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)(y, {}), n[0] = s) : s = n[0], n[1] !== a ? (i = (0, t.jsxs)(t.Fragment, {
            children: [a, s]
        }), n[1] = a, n[2] = i) : i = n[2], i
    }], 756900)
}, 488758, 187261, 488224, e => {
    "use strict";
    e.s(["SportsItemContextProvider", () => x, "useSportsItemContext", () => D], 488758);
    var t, r = e.i(221628),
        s = e.i(999061),
        i = e.i(416340),
        n = e.i(233522),
        a = e.i(100825),
        o = e.i(593332),
        l = e.i(476979),
        u = e.i(575339),
        c = e.i(165974),
        d = e.i(206617),
        p = ((t = {}).Book = "Order Book", t.Chart = "Graph", t.History = "History", t.About = "About", t);
    e.s(["SportsDetailTab", () => p], 187261);
    let h = ({
            index: e,
            state: t
        }) => e >= 0 && e < t.tabs.length ? t.tabs[e] : t.tabs[0],
        m = {
            [p.Book]: 1,
            [p.Chart]: 2,
            [p.History]: 3,
            [p.About]: 4
        };
    var f = e.i(909420);
    let g = ({
            event: e,
            variant: t,
            store: r,
            findInitialSpreadsAndTotals: s
        }) => {
            if (("spreads" === t || "totals" === t || "child_moneyline" === t || "first_half_spreads" === t || "first_half_totals" === t || "first_innings_totals" === t || "second_innings_totals" === t || "first_half_moneyline" === t || "tennis_first_set_totals" === t || "tennis_set_totals" === t || "tennis_match_totals" === t || "tennis_set_handicap" === t || "map_handicap" === t || "round_handicap_match" === t || "kill_handicap_match" === t || "tower_handicap_match" === t || "drake_handicap_match" === t || "nashor_handicap_match" === t || "inhibitor_handicap_match" === t || "barrack_handicap_match" === t || "round_over_under_match" === t) && s && r) {
                let s = r.getState().marketsSections ? .[e.slug];
                if (s) {
                    if ("first_half_spreads" === t && s.firstHalfSpreads ? .length) {
                        let t = e.markets.find(e => e.slug === s.firstHalfSpreads[0].market);
                        if (t) return t
                    }
                    if ("first_half_totals" === t && s.firstHalfTotals ? .length) {
                        let t = e.markets.find(e => e.slug === s.firstHalfTotals[0].market);
                        if (t) return t
                    }
                    if ("first_innings_totals" === t && s.firstInningsTotals ? .length) {
                        let t = e.markets.find(e => e.slug === s.firstInningsTotals[0].market);
                        if (t) return t
                    }
                    if ("second_innings_totals" === t && s.secondInningsTotals ? .length) {
                        let t = e.markets.find(e => e.slug === s.secondInningsTotals[0].market);
                        if (t) return t
                    }
                    if ("first_half_moneyline" === t && s.firstHalfMoneyline) {
                        let t = s.firstHalfMoneyline;
                        if ("binary" === t.type) {
                            let r = e.markets.find(e => e.slug === t.market);
                            if (r) return r
                        } else if ("neg-risk" === t.type && t.markets.length > 0) {
                            let r = e.markets.find(e => e.slug === t.markets[0]);
                            if (r) return r
                        }
                    }
                }
                let i = r.getState().marketsSectionsState ? .[e.slug];
                if (i) {
                    let {
                        spreads: r,
                        totals: s,
                        childMoneyline: n,
                        firstSetTotals: a,
                        firstSetWinner: o,
                        setTotals: l,
                        matchTotals: u,
                        setHandicap: c,
                        cricketMatchToGoTill: d,
                        mapHandicap: p,
                        roundHandicap: h,
                        killHandicap: m,
                        towerHandicap: f,
                        drakeHandicap: g,
                        nashorHandicap: k,
                        inhibitorHandicap: y,
                        barrackHandicap: S,
                        roundTotal: w
                    } = i;
                    if ("spreads" === t && r) {
                        let t = e.markets.find(e => e.slug === r.market);
                        if (t) return t
                    }
                    if ("totals" === t && s) {
                        let t = e.markets.find(e => e.slug === s.market);
                        if (t) return t
                    }
                    if ("child_moneyline" === t && n) {
                        let t = e.markets.find(e => e.slug === n.market);
                        if (t) return t
                    }
                    if (a && "tennis_first_set_totals" === t) {
                        let t = e.markets.find(e => e.slug === a.market);
                        if (t) return t
                    }
                    if (o && "tennis_first_set_winner" === t) {
                        let t = e.markets.find(e => e.slug === o.market);
                        if (t) return t
                    }
                    if (l && "tennis_set_totals" === t) {
                        let t = e.markets.find(e => e.slug === l.market);
                        if (t) return t
                    }
                    if (u && "tennis_match_totals" === t) {
                        let t = e.markets.find(e => e.slug === u.market);
                        if (t) return t
                    }
                    if (c && "tennis_set_handicap" === t) {
                        let t = e.markets.find(e => e.slug === c.market);
                        if (t) return t
                    }
                    if (d ? .length && "cricket_match_to_go_till" === t) {
                        let t = e.markets.find(e => e.slug === d[0].market);
                        if (t) return t
                    }
                    if (p && "map_handicap" === t) {
                        let t = e.markets.find(e => e.slug === p.market);
                        if (t) return t
                    }
                    if (h && "round_handicap_match" === t) {
                        let t = e.markets.find(e => e.slug === h.market);
                        if (t) return t
                    }
                    if (m && "kill_handicap_match" === t) {
                        let t = e.markets.find(e => e.slug === m.market);
                        if (t) return t
                    }
                    if (f && "tower_handicap_match" === t) {
                        let t = e.markets.find(e => e.slug === f.market);
                        if (t) return t
                    }
                    if (g && "drake_handicap_match" === t) {
                        let t = e.markets.find(e => e.slug === g.market);
                        if (t) return t
                    }
                    if (k && "nashor_handicap_match" === t) {
                        let t = e.markets.find(e => e.slug === k.market);
                        if (t) return t
                    }
                    if (y && "inhibitor_handicap_match" === t) {
                        let t = e.markets.find(e => e.slug === y.market);
                        if (t) return t
                    }
                    if (S && "barrack_handicap_match" === t) {
                        let t = e.markets.find(e => e.slug === S.market);
                        if (t) return t
                    }
                    if (w && "round_over_under_match" === t) {
                        let t = e.markets.find(e => e.slug === w.market);
                        if (t) return t
                    }
                }
            }
            let i = (e.markets ? ? []).filter(e => (e.sportsMarketType ? ? "moneyline") === ("card" === t ? "moneyline" : t));
            return i.length && ("spreads" === t || "totals" === t || "child_moneyline" === t || "first_half_spreads" === t || "first_half_totals" === t || "first_innings_totals" === t || "second_innings_totals" === t || "first_half_moneyline" === t || "tennis_first_set_totals" === t || "tennis_set_totals" === t || "tennis_match_totals" === t || "tennis_set_handicap" === t || "map_handicap" === t || "round_handicap_match" === t || "kill_handicap_match" === t || "tower_handicap_match" === t || "drake_handicap_match" === t || "nashor_handicap_match" === t || "inhibitor_handicap_match" === t || "barrack_handicap_match" === t || "round_over_under_match" === t) ? (0, f.sortLineMarkets)(i)[0] : (i.length ? i : e.markets ? ? []).slice().sort((e, t) => {
                let r = (0, f.getLineLiquidity)(e) + (0, f.getLineVolume)(e);
                return (0, f.getLineLiquidity)(t) + (0, f.getLineVolume)(t) - r
            })[0]
        },
        k = i.default.createContext(null),
        y = () => i.default.useContext(k),
        S = (e, t) => {
            let r = y();
            if (!r) throw Error("useSportsItemStore must be used within a SportsItemStoreProvider");
            return (0, u.useStoreWithEqualityFn)(r, e, t)
        };
    e.s(["SportsItemStoreProvider", 0, e => {
        let t, n, a = (0, s.c)(7),
            {
                initialState: o,
                findInitialSpreadsAndTotals: l,
                store: f,
                children: y
            } = e;
        a[0] !== l || a[1] !== o || a[2] !== f ? (t = () => (({
            initialState: e,
            findInitialSpreadsAndTotals: t,
            store: r
        }) => (0, u.createWithEqualityFn)()((0, c.immer)(s => ({ ...(({
                initialState: e,
                findInitialSpreadsAndTotals: t,
                store: r
            }) => {
                let {
                    event: s,
                    variant: i,
                    orientation: n,
                    ...a
                } = e;
                return {
                    event: s,
                    isNegRisk: (0, d.getIsNegRiskSportsEvent)(s),
                    variant: i,
                    orientation: n,
                    market: e.market ? ? g({
                        event: s,
                        variant: i,
                        findInitialSpreadsAndTotals: t,
                        store: r
                    }),
                    tab: e.event.markets[0].closed ? p.Chart : p.Book,
                    tabs: [...e.event.markets[0].closed ? [] : [p.Book], p.Chart, ..."card" !== i ? [p.About] : []],
                    preventAccordionHover: !1,
                    positionsAccordionState: "",
                    ordersAccordionState: "",
                    preventPositionsAccordionHover: !1,
                    preventOrdersAccordionHover: !1,
                    ...a
                }
            })({
                initialState: e,
                findInitialSpreadsAndTotals: t,
                store: r
            }),
            setTab: e => {
                s(t => {
                    t.tab = e
                })
            },
            setTabFromIndex: e => {
                s(t => {
                    t.tab = h({
                        index: e,
                        state: t
                    })
                })
            },
            setTabs: e => {
                s(t => {
                    let r = t.tabs;
                    if (t.tabs = e, !e.includes(t.tab)) {
                        let e = h({
                            index: r.indexOf(t.tab) - 1,
                            state: t
                        });
                        t.tab = e
                    }
                })
            },
            addTab: e => {
                s(t => {
                    t.tabs.includes(e) || (t.tabs = [...t.tabs, e].sort((e, t) => m[e] - m[t]))
                })
            },
            removeTab: e => {
                s(t => {
                    let r = t.tabs;
                    if (t.tabs = t.tabs.filter(t => t !== e), t.tab === e) {
                        let s = h({
                            index: r.indexOf(e) - 1,
                            state: t
                        });
                        t.tab = s
                    }
                })
            },
            removeTabs: e => {
                s(t => {
                    t.tabs = t.tabs.filter(t => !e.includes(t))
                })
            },
            setPreventAccordionHover: e => {
                s(t => {
                    t.preventAccordionHover = e
                })
            },
            updateEvent: e => {
                s(t => {
                    let r = e.market;
                    (!r || ("spreads" === t.variant || "totals" === t.variant) && e.findInitialSpreadsAndTotals && e.store) && (r = g({
                        event: e.event,
                        variant: t.variant,
                        findInitialSpreadsAndTotals: e.findInitialSpreadsAndTotals,
                        store: e.store
                    })), t.event = e.event, t.market = r, t.isNegRisk = (0, d.getIsNegRiskSportsEvent)(e.event)
                })
            },
            handleOverlayChange: e => {
                s(t => {
                    let r = e.market;
                    (!r || ("spreads" === t.variant || "totals" === t.variant || "child_moneyline" === t.variant) && e.findInitialSpreadsAndTotals && e.store) && (r = g({
                        event: e.event,
                        variant: t.variant,
                        findInitialSpreadsAndTotals: e.findInitialSpreadsAndTotals,
                        store: e.store
                    })), t.event = e.event, t.market = r, t.isNegRisk = (0, d.getIsNegRiskSportsEvent)(e.event), e.tabsToAdd ? .length && e.tabsToAdd.forEach(e => {
                        t.addTab(e)
                    }), e.tabsToRemove ? .length && e.tabsToRemove.forEach(e => {
                        t.removeTab(e)
                    })
                })
            },
            setPositionsAccordionState: e => {
                s(t => {
                    t.positionsAccordionState = e
                })
            },
            setOrdersAccordionState: e => {
                s(t => {
                    t.ordersAccordionState = e
                })
            },
            setPreventPositionsAccordionHover: e => {
                s(t => {
                    t.preventPositionsAccordionHover = e
                })
            },
            setPreventOrdersAccordionHover: e => {
                s(t => {
                    t.preventOrdersAccordionHover = e
                })
            }
        }))))({
            initialState: o,
            findInitialSpreadsAndTotals: l,
            store: f
        }), a[0] = l, a[1] = o, a[2] = f, a[3] = t) : t = a[3];
        let [S] = i.default.useState(t);
        return a[4] !== y || a[5] !== S ? (n = (0, r.jsx)(k.Provider, {
            value: S,
            children: y
        }), a[4] = y, a[5] = S, a[6] = n) : n = a[6], n
    }, "useBoundSportsItemStore", 0, y, "useSportsItemStore", 0, S], 488224);
    var w = e.i(289981);
    let v = "var(--color-brand-500)",
        _ = e => [e[0].color || v, e[1].color || v];

    function b(e) {
        return !(e.sportsMarketType && w.IGNORED_SPORTS_MARKET_TYPES.includes(e.sportsMarketType)) && (e.sportsMarketType ? ? "moneyline") === "moneyline"
    }

    function M(e, t) {
        return t.team && ("home" === t.negRiskSportsMarketType ? e.home = t.team : "away" === t.negRiskSportsMarketType && (e.away = t.team)), e
    }
    let T = ["score", "gameState", "delayedStatus", "elapsed"],
        A = i.default.createContext({}),
        I = e => ({
            market: e.market,
            event: e.event,
            isNegRisk: e.isNegRisk,
            mode: e.orientation,
            variant: e.variant
        }),
        x = e => {
            let t, i, u, c, d, p, h, m = (0, s.c)(47),
                {
                    children: f
                } = e,
                {
                    event: g,
                    isNegRisk: k,
                    mode: y,
                    variant: w
                } = S(I, n.shallow),
                {
                    score: v,
                    gameState: x,
                    delayedStatus: D,
                    elapsed: P
                } = (0, a.useSportsGameSelector)(g.slug, T),
                F = (0, a.useMoneylineMarket)(g.slug),
                L = (0, a.useFirstHalfMoneyline)(g.slug),
                B = ("first_half_moneyline" === w && L ? L.market : F) ? ? g.markets[0],
                O = (0, a.useScores)(g.slug),
                {
                    teams: H,
                    colors: N
                } = (e => {
                    let t, r = (0, s.c)(4),
                        i = (0, a.useScores)(e.slug);
                    if (r[0] !== e.markets || r[1] !== i) {
                        e: {
                            let s, n = e.markets.filter(b);
                            if (1 === n.length) {
                                let e = n[0];
                                if (e.teams && 2 === e.teams.length) {
                                    let r = [{ ...e.teams[0],
                                        score: i[0]
                                    }, { ...e.teams[1],
                                        score: i[1]
                                    }];
                                    t = {
                                        teams: r,
                                        colors: _(r)
                                    };
                                    break e
                                }
                            }
                            if (3 === n.length) {
                                let {
                                    home: e,
                                    away: r
                                } = n.reduce(M, {
                                    home: void 0,
                                    away: void 0
                                });
                                if (e && r) {
                                    let s = [{ ...e,
                                        score: i[0]
                                    }, { ...r,
                                        score: i[1]
                                    }];
                                    t = {
                                        teams: s,
                                        colors: _(s)
                                    };
                                    break e
                                }
                            }
                            r[3] === Symbol.for("react.memo_cache_sentinel") ? (s = {
                                teams: void 0,
                                colors: void 0
                            }, r[3] = s) : s = r[3],
                            t = s
                        }
                        r[0] = e.markets,
                        r[1] = i,
                        r[2] = t
                    }
                    else t = r[2];
                    return t
                })(g);
            e: {
                if (x === o.GameState.Finished) {
                    if (O[0] > O[1]) {
                        t = 0;
                        break e
                    }
                    if (O[0] < O[1]) {
                        t = 1;
                        break e
                    }
                }
                t = void 0
            }
            let R = t,
                W = l.sportMap[(0, o.canonicalSportSlug)(g.seriesSlug ? ? "")] ? .sportId,
                z = W === l.SportId.Tennis,
                $ = W === l.SportId.Esports,
                q = W === l.SportId.UFC,
                j = W === l.SportId.Chess;
            m[0] !== g.markets ? (i = g.markets.reduce(C, {
                hasSpreadsMarkets: !1,
                hasTotalsMarkets: !1,
                hasNRFIMarkets: !1,
                hasBTTSMarkets: !1
            }), m[0] = g.markets, m[1] = i) : i = m[1];
            let {
                hasSpreadsMarkets: U,
                hasTotalsMarkets: V,
                hasNRFIMarkets: K,
                hasBTTSMarkets: Q
            } = i;
            t: {
                let e, t, r;
                if (k) {
                    let e;
                    m[2] !== g.markets ? (e = g.markets.reduce(E, {
                        slugToMarketIdxMap: {},
                        conditionIdToIdxMarketMap: {}
                    }), m[2] = g.markets, m[3] = e) : e = m[3], u = e;
                    break t
                }
                m[4] !== B.slug ? (e = {
                    [B.slug]: 0
                }, m[4] = B.slug, m[5] = e) : e = m[5],
                m[6] !== B.conditionId ? (t = {
                    [B.conditionId]: 0
                }, m[6] = B.conditionId, m[7] = t) : t = m[7],
                m[8] !== e || m[9] !== t ? (r = {
                    slugToMarketIdxMap: e,
                    conditionIdToIdxMarketMap: t
                }, m[8] = e, m[9] = t, m[10] = r) : r = m[10],
                u = r
            }
            let {
                slugToMarketIdxMap: G,
                conditionIdToIdxMarketMap: Y
            } = u;
            m[11] !== Y || m[12] !== g.markets || m[13] !== B || m[14] !== G ? (c = e => {
                let {
                    slug: t,
                    conditionId: r
                } = e;
                if (t) {
                    let e = g.markets[G[t.toLowerCase()]];
                    if (e) return e
                }
                if (r) {
                    let e = g.markets[Y[r.toLowerCase()]];
                    if (e) return e
                }
                return B
            }, m[11] = Y, m[12] = g.markets, m[13] = B, m[14] = G, m[15] = c) : c = m[15];
            let X = c;
            m[16] !== g.markets ? (d = g.markets ? ? [], m[16] = g.markets, m[17] = d) : d = m[17], m[18] !== N || m[19] !== Y || m[20] !== D || m[21] !== P || m[22] !== g || m[23] !== x || m[24] !== X || m[25] !== Q || m[26] !== K || m[27] !== U || m[28] !== V || m[29] !== j || m[30] !== $ || m[31] !== k || m[32] !== z || m[33] !== q || m[34] !== y || m[35] !== B || m[36] !== v || m[37] !== O || m[38] !== G || m[39] !== W || m[40] !== d || m[41] !== H || m[42] !== R ? (p = {
                winningTeamIndex: R,
                mode: y,
                market: B,
                markets: d,
                event: g,
                isNegRisk: k,
                getSportsItemMarket: X,
                slugToMarketIdxMap: G,
                conditionIdToIdxMarketMap: Y,
                teams: H,
                gameState: x,
                colors: N,
                score: v,
                elapsed: P,
                delayedStatus: D,
                scores: O,
                moneylineMarket: B,
                hasSpreadsMarkets: U,
                hasTotalsMarkets: V,
                hasNRFIMarkets: K,
                hasBTTSMarkets: Q,
                sportId: W,
                isTennis: z,
                isEsports: $,
                isUFC: q,
                isChess: j
            }, m[18] = N, m[19] = Y, m[20] = D, m[21] = P, m[22] = g, m[23] = x, m[24] = X, m[25] = Q, m[26] = K, m[27] = U, m[28] = V, m[29] = j, m[30] = $, m[31] = k, m[32] = z, m[33] = q, m[34] = y, m[35] = B, m[36] = v, m[37] = O, m[38] = G, m[39] = W, m[40] = d, m[41] = H, m[42] = R, m[43] = p) : p = m[43];
            let J = p;
            return m[44] !== f || m[45] !== J ? (h = (0, r.jsx)(A.Provider, {
                value: J,
                children: f
            }), m[44] = f, m[45] = J, m[46] = h) : h = m[46], h
        },
        D = () => i.default.useContext(A);

    function C(e, t) {
        return (0, w.isSpreadMarket)(t.sportsMarketType) && (e.hasSpreadsMarkets = !0), (0, w.isTotalMarket)(t.sportsMarketType) && (e.hasTotalsMarkets = !0), "nrfi" === t.sportsMarketType && (e.hasNRFIMarkets = !0), "both_teams_to_score" === t.sportsMarketType && (e.hasBTTSMarkets = !0), e
    }

    function E(e, t, r) {
        return e.slugToMarketIdxMap[t.slug.toLowerCase()] = r, e.conditionIdToIdxMarketMap[t.conditionId.toLowerCase()] = r, e
    }
}, 711960, 339393, 832655, 950495, 927944, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(567692),
        s = e.i(416340);
    let i = ({
        assetId: e,
        state: t
    }) => {
        let r = t.byAsset[e] ? .tickSizes ? .market;
        if (void 0 !== r && (.01 === r || .001 === r)) return r
    };
    e.s(["useGetTickSize", 0, () => {
        let e = (0, r.useBoundBookStore)();
        return s.useCallback(({
            assetId: t,
            fallback: r
        }) => i({
            assetId: t,
            state: e.getState()
        }) ? ? r, [])
    }, "useLatestTickSize", 0, (e, s) => {
        let n, a = (0, t.c)(3);
        a[0] !== e || a[1] !== s ? (n = t => i({
            assetId: e,
            state: t
        }) ? ? s, a[0] = e, a[1] = s, a[2] = n) : n = a[2];
        let o = n;
        return (0, r.useBooksStore)(o)
    }], 711960), e.s(["useDeferredMounted", 0, (e = {
        wait: 0,
        enabled: !0
    }) => {
        let [t, r] = s.default.useState(!1), {
            wait: i,
            enabled: n = !0
        } = e;
        return s.default.useEffect(() => {
            if (n) {
                let e = !0,
                    t = setTimeout(() => {
                        e && r(!0)
                    }, i);
                return () => {
                    e = !1, clearTimeout(t)
                }
            }
        }, [i, n]), t
    }], 339393);
    var n = e.i(274466),
        a = e.i(533066),
        a = a,
        o = e.i(262614),
        l = e.i(687112),
        u = e.i(797055),
        c = e.i(563423);
    let d = function(e, t) {
        c.default && !(0, u.isFunction)(e) && console.error("useDebounceFn expected parameter is a function, got ".concat(typeof e));
        var r, i = (0, o.default)(e),
            d = null != (r = null == t ? void 0 : t.wait) ? r : 1e3,
            p = (0, s.useMemo)(function() {
                return (0, a.default)(function() {
                    for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                    return i.current.apply(i, (0, n.__spreadArray)([], (0, n.__read)(e), !1))
                }, d, t)
            }, []);
        return (0, l.default)(function() {
            p.cancel()
        }), {
            run: p,
            cancel: p.cancel,
            flush: p.flush
        }
    };
    e.s(["default", 0, d], 832655);
    var p = e.i(462787);
    e.s(["useDebounceEffect", 0, function(e, t, r) {
        var i = (0, n.__read)((0, s.useState)({}), 2),
            a = i[0],
            o = i[1],
            l = d(function() {
                o({})
            }, r).run;
        (0, s.useEffect)(function() {
            return l()
        }, t), (0, p.default)(e, [a])
    }], 950495), e.s(["useMount", 0, function(e) {
        c.default && !(0, u.isFunction)(e) && console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof e, '".')), (0, s.useEffect)(function() {
            var t = null == e ? void 0 : e();
            if (!t || "object" != typeof t || "function" != typeof t.then) return t
        }, [])
    }], 927944)
}, 210308, e => {
    "use strict";
    var t = e.i(239768),
        r = e.i(416340);
    e.s(["useDeepCompareMemo", 0, function(e, s) {
        let i, n;
        return r.default.useMemo(e, (i = r.default.useRef(s), n = r.default.useRef(0), (0, t.dequal)(s, i.current) || (i.current = s, n.current += 1), r.default.useMemo(() => i.current, [n.current])))
    }])
}, 218714, 464152, 924706, 429411, 376966, 451058, e => {
    "use strict";
    var t = e.i(567692),
        r = e.i(416340);
    e.s(["useBookGarbageCollection", 0, (e, s = 3e5) => {
        let i = (0, t.useBoundBookStore)(),
            n = r.useRef(null),
            a = r.useCallback(async () => {
                if (!e.current) return;
                let {
                    subscribed: t,
                    polling: r
                } = await e.current.getActiveAssets();
                i.getState().garbageCollect({
                    purge: {
                        type: "all",
                        view: "all"
                    },
                    keep: [...t, ...r],
                    maxAgeMs: 3e5
                })
            }, [i]);
        return r.useCallback(() => (n.current = setInterval(() => a(), s), () => {
            n.current && clearInterval(n.current)
        }), [s, a])
    }], 218714);
    var s = e.i(999061),
        i = e.i(553512);
    let n = (e, t) => {
        let s = r.useMemo(() => {
                let {
                    wait: e = 0,
                    mode: r = "trailing"
                } = t ? ? {};
                return {
                    wait: e,
                    mode: r
                }
            }, [t]),
            n = r.useRef(new Map),
            a = r.useCallback(() => {
                let t = Array.from(n.current.values());
                n.current.clear(), t.length && e(t)
            }, [e]),
            o = r.useMemo(() => (0, i.debounce)(a, s), [a, s]),
            l = r.useCallback(e => {
                (Array.isArray(e) ? e.map(({
                    id: e,
                    data: t
                }) => ({
                    id: e,
                    data: t
                })) : [{
                    id: e.id,
                    data: e.data
                }]).forEach(({
                    id: e,
                    data: t
                }) => {
                    n.current.set(e, t)
                }), o()
            }, [o]),
            u = r.useCallback(e => {
                (Array.isArray(e) ? e : [e]).forEach(e => {
                    n.current.has(e) && n.current.delete(e)
                })
            }, []);
        return r.useMemo(() => ({
            enqueue: l,
            dequeue: u
        }), [l, u])
    };
    e.s(["useAggregatedDebounce", 0, n], 464152);
    let a = ({
        assetIds: e,
        type: t = "book",
        key: r = "",
        mode: s
    }) => e.map(e => ({
        id: `${e}-${t}-${r}`,
        data: {
            assetId: e,
            type: t,
            mode: s,
            key: r,
            timestamp: Date.now()
        }
    }));

    function o(e) {
        return {
            mode: "add",
            assetId: e.assetId,
            key: e.key
        }
    }

    function l(e) {
        return {
            mode: "remove",
            assetId: e.assetId,
            key: e.key
        }
    }

    function u(e) {
        return {
            mode: "add",
            assetId: e.assetId,
            key: e.key
        }
    }

    function c(e) {
        return {
            mode: "remove",
            assetId: e.assetId,
            key: e.key
        }
    }
    e.s(["usePollBooks", 0, (e, t) => {
        let r, i, d, p, h, m, f, g, k = (0, s.c)(20);
        k[0] !== e || k[1] !== t ? (r = r => {
            if (!t) return;
            let s = (e => {
                    let t = new Map;
                    for (let r of e) {
                        let e = `${r.type}-${r.assetId}-${r.key}`,
                            s = t.get(e);
                        (!s || r.timestamp >= s.timestamp) && t.set(e, r)
                    }
                    return Array.from(t.values()).reduce((e, {
                        assetId: t,
                        type: r,
                        mode: s,
                        key: i
                    }) => ("add" === s ? e.adding[r].push({
                        assetId: t,
                        key: i
                    }) : "remove" === s && e.removing[r].push({
                        assetId: t,
                        key: i
                    }), e), {
                        adding: {
                            book: [],
                            minified: []
                        },
                        removing: {
                            book: [],
                            minified: []
                        }
                    })
                })(r),
                i = [];
            if (s.adding.book.length || s.removing.book.length) {
                let e = s.adding.book.map(o),
                    t = s.removing.book.map(l);
                i.push({
                    type: "book",
                    data: [...e, ...t]
                })
            }
            if (s.adding.minified.length || s.removing.minified.length) {
                let e = s.adding.minified.map(u),
                    t = s.removing.minified.map(c);
                i.push({
                    type: "minified",
                    data: [...e, ...t]
                })
            }
            i.length && e.current ? .updatePolling(i)
        }, k[0] = e, k[1] = t, k[2] = r) : r = k[2];
        let y = r;
        k[3] === Symbol.for("react.memo_cache_sentinel") ? (i = {
            wait: 100,
            mode: "trailing"
        }, k[3] = i) : i = k[3];
        let {
            enqueue: S
        } = n(y, i);
        k[4] !== S ? (d = (e, t, r) => {
            let s = void 0 === t ? "book" : t,
                i = void 0 === r ? "" : r;
            S({
                id: `${e}-${s}-${i}`,
                data: {
                    assetId: e,
                    type: s,
                    mode: "add",
                    key: i,
                    timestamp: Date.now()
                }
            })
        }, k[4] = S, k[5] = d) : d = k[5];
        let w = d;
        k[6] !== S ? (p = (e, t, r) => {
            S(a({
                assetIds: e,
                type: void 0 === t ? "book" : t,
                key: void 0 === r ? "" : r,
                mode: "add"
            }))
        }, k[6] = S, k[7] = p) : p = k[7];
        let v = p;
        k[8] !== S ? (h = (e, t, r) => {
            let s = void 0 === t ? "book" : t,
                i = void 0 === r ? "" : r;
            S({
                id: `${e}-${s}-${i}`,
                data: {
                    assetId: e,
                    type: s,
                    mode: "remove",
                    key: i,
                    timestamp: Date.now()
                }
            })
        }, k[8] = S, k[9] = h) : h = k[9];
        let _ = h;
        k[10] !== S ? (m = (e, t, r) => {
            S(a({
                assetIds: e,
                type: void 0 === t ? "book" : t,
                key: void 0 === r ? "" : r,
                mode: "remove"
            }))
        }, k[10] = S, k[11] = m) : m = k[11];
        let b = m;
        k[12] !== e ? (f = () => {
            e.current ? .clearPolling()
        }, k[12] = e, k[13] = f) : f = k[13];
        let M = f;
        return k[14] !== M || k[15] !== w || k[16] !== v || k[17] !== _ || k[18] !== b ? (g = {
            startPollingBook: w,
            startPollingBooks: v,
            stopPollingBook: _,
            stopPollingBooks: b,
            clearPollingBooks: M
        }, k[14] = M, k[15] = w, k[16] = v, k[17] = _, k[18] = b, k[19] = g) : g = k[19], g
    }], 924706);
    var d = e.i(339393),
        p = e.i(195453);

    function h(e) {
        let t = r.default.useRef(e);
        return r.default.useEffect(() => {
            t.current = e
        }), r.default.useMemo(() => (...e) => t.current ? .(...e), [])
    }

    function m(e) {
        return {
            id: e.id,
            data: {
                id: e.id,
                tickSize: e.tickSize
            }
        }
    }

    function f(e) {
        return {
            id: e.id,
            data: {
                id: e.id,
                tickSize: e.tickSize
            }
        }
    }

    function g(e) {
        return {
            id: e.id,
            data: {
                id: e.id,
                tickSize: e.tickSize
            }
        }
    }
    e.s(["useCallbackRef", 0, h], 429411), e.s(["useQueueFetchBooks", 0, (e, t) => {
        let i, a, o, l, u, c, k, y, S, w, v, _, b, M, T, A, I = (0, s.c)(36);
        I[0] === Symbol.for("react.memo_cache_sentinel") ? (i = {
            wait: 1e3
        }, I[0] = i) : i = I[0];
        let x = (0, d.useDeferredMounted)(i) && t;
        I[1] === Symbol.for("react.memo_cache_sentinel") ? (a = [], I[1] = a) : a = I[1];
        let D = r.useRef(a);
        I[2] === Symbol.for("react.memo_cache_sentinel") ? (o = [], I[2] = o) : o = I[2];
        let C = r.useRef(o);
        I[3] === Symbol.for("react.memo_cache_sentinel") ? (l = [], I[3] = l) : l = I[3];
        let E = r.useRef(l);
        I[4] !== e || I[5] !== t ? (u = r => {
            if (!t) return;
            let s = (0, p.uniqBy)(r, "id");
            s.length && e.current ? .queueFetchBooks({
                type: "asset",
                assets: s
            })
        }, I[4] = e, I[5] = t, I[6] = u) : u = I[6];
        let P = u;
        I[7] !== e || I[8] !== t ? (c = r => {
            if (!t) return;
            let s = (0, p.uniqBy)(r, "id");
            s.length && e.current ? .queueFetchMinifiedBooks({
                type: "asset",
                assets: s
            })
        }, I[7] = e, I[8] = t, I[9] = c) : c = I[9];
        let F = c;
        I[10] !== e || I[11] !== t ? (k = r => {
            if (!t) return;
            let s = (0, p.uniqBy)(r, "id");
            s.length && e.current ? .queueFetchLastPrices({
                type: "asset",
                assets: s
            })
        }, I[10] = e, I[11] = t, I[12] = k) : k = I[12];
        let L = k,
            B = h(P),
            O = h(F),
            H = h(L);
        I[13] === Symbol.for("react.memo_cache_sentinel") ? (y = {
            wait: 250,
            mode: "trailing"
        }, I[13] = y) : y = I[13];
        let {
            enqueue: N
        } = n(P, y);
        I[14] === Symbol.for("react.memo_cache_sentinel") ? (S = {
            wait: 250,
            mode: "trailing"
        }, I[14] = S) : S = I[14];
        let {
            enqueue: R
        } = n(F, S);
        I[15] === Symbol.for("react.memo_cache_sentinel") ? (w = {
            wait: 250,
            mode: "trailing"
        }, I[15] = w) : w = I[15];
        let {
            enqueue: W
        } = n(L, w);
        I[16] !== N || I[17] !== x ? (v = e => {
            x ? N(e.map(m)) : D.current.push(...e)
        }, I[16] = N, I[17] = x, I[18] = v) : v = I[18];
        let z = v;
        I[19] !== R || I[20] !== x ? (_ = e => {
            x ? R(e.map(f)) : C.current.push(...e)
        }, I[19] = R, I[20] = x, I[21] = _) : _ = I[21];
        let $ = _;
        I[22] !== W || I[23] !== x ? (b = e => {
            x ? W(e.map(g)) : E.current.push(...e)
        }, I[22] = W, I[23] = x, I[24] = b) : b = I[24];
        let q = b;
        return I[25] !== B || I[26] !== H || I[27] !== O || I[28] !== x || I[29] !== t ? (M = () => {
            x && t && (D.current.length && (B(D.current), D.current = []), C.current.length && (O(C.current), C.current = []), E.current.length && (H(E.current), E.current = []))
        }, T = [x, t, B, O, H], I[25] = B, I[26] = H, I[27] = O, I[28] = x, I[29] = t, I[30] = M, I[31] = T) : (M = I[30], T = I[31]), r.useEffect(M, T), I[32] !== z || I[33] !== q || I[34] !== $ ? (A = {
            queueFetchBooks: z,
            queueFetchMinifiedBooks: $,
            queueFetchLastPrices: q
        }, I[32] = z, I[33] = q, I[34] = $, I[35] = A) : A = I[35], A
    }], 376966);
    var k = e.i(221628),
        y = e.i(575339),
        S = e.i(322324),
        w = e.i(165974),
        v = e.i(970863);
    let _ = ({
            state: e,
            market: t
        }) => {
            let r = e.pinnedAssetId ? ? void 0,
                s = Date.now(),
                i = (0, v.getAssetId)(t);
            if (i && (e.pinnedAssetId = i, e.pinnedByAssetId[i] = !0, e.byAssetId[i] = (0, v.sliceMarket)(t), e.lastSeenByAssetId[i] = s, e.retentionUntilByAssetId[i] = void 0, r && r !== i)) {
                delete e.pinnedByAssetId[r];
                let t = s + e.retentionMs;
                e.retentionUntilByAssetId[r] = t
            }
        },
        b = ({
            state: e
        }) => {
            let t = Date.now();
            for (let r = 0; r < e.pendingOps.length; r++) {
                let s = e.pendingOps[r],
                    i = (0, v.getAssetId)(s.market);
                if (i) {
                    if ("add" === s.type) e.byAssetId[i] = (0, v.sliceMarket)(s.market), e.sourcesByAssetId[i] || (e.sourcesByAssetId[i] = {}), e.sourcesByAssetId[i][s.sourceId] = s.priority, e.lastSeenByAssetId[i] = t, e.retentionUntilByAssetId[i] = void 0;
                    else if ("remove" === s.type) {
                        let r = e.sourcesByAssetId[i];
                        r && void 0 !== r[s.sourceId] && (delete r[s.sourceId], 0 !== Object.keys(r).length || e.pinnedByAssetId[i] || (e.retentionUntilByAssetId[i] = t + e.retentionMs))
                    }
                }
            }
            e.pendingOps = [], Object.keys(e.byAssetId).forEach(r => {
                let s = !!Object.keys(e.sourcesByAssetId[r] || {}).length,
                    i = !!e.pinnedByAssetId[r],
                    n = e.retentionUntilByAssetId[r] || 0;
                !s && !i && n > 0 && n < t && (e.byAssetId[r] && delete e.byAssetId[r], e.sourcesByAssetId[r] && delete e.sourcesByAssetId[r], e.lastSeenByAssetId[r] && delete e.lastSeenByAssetId[r], e.retentionUntilByAssetId[r] && delete e.retentionUntilByAssetId[r])
            });
            let r = [];
            Object.keys(e.byAssetId).forEach(s => {
                let i = !!e.pinnedByAssetId[s],
                    n = e.sourcesByAssetId[s] || {},
                    a = Object.keys(n).length > 0,
                    o = (e.retentionUntilByAssetId[s] || 0) > t;
                if (i || a || o) {
                    let t = 0;
                    t = i ? 1 / 0 : a ? Math.max(...Object.values(n).map(e => "number" == typeof e ? e : 0), 0) : 0, r.push({
                        id: s,
                        priority: t,
                        lastSeen: e.lastSeenByAssetId[s] || 0
                    })
                }
            }), r.sort((e, t) => e.priority === t.priority ? t.lastSeen - e.lastSeen : t.priority - e.priority);
            let s = r.slice(0, e.capacity).map(e => e.id).map(t => e.byAssetId[t]);
            e.activeMarkets = [...s].sort((e, t) => {
                let r = (0, v.getAssetId)(e),
                    s = (0, v.getAssetId)(t);
                return r.localeCompare(s)
            }), e.flushTimerId = null
        },
        M = ({
            state: e
        }) => {
            e.flushTimerId && clearTimeout(e.flushTimerId), e.byAssetId = {}, e.sourcesByAssetId = {}, e.pinnedAssetId = null, e.pinnedByAssetId = {}, e.lastSeenByAssetId = {}, e.retentionUntilByAssetId = {}, e.activeMarkets = [], e.flushTimerId = null, e.pendingOps = []
        },
        T = r.default.createContext(null),
        A = () => {
            let e = r.default.useContext(T);
            if (!e) throw Error("useBoundBookConnectionStore must be used within a BookConnectionStoreProvider");
            return e
        };
    e.s(["BookConnectionStoreProvider", 0, e => {
        let t, i, n = (0, s.c)(5),
            {
                initialState: a,
                children: o
            } = e;
        n[0] !== a ? (t = () => (0, S.create)()((0, w.immer)((e, t) => ({
            byAssetId: {},
            sourcesByAssetId: {},
            pinnedAssetId: null,
            pinnedByAssetId: {},
            lastSeenByAssetId: {},
            retentionUntilByAssetId: {},
            activeMarkets: [],
            capacity: 48,
            pushThrottleMs: 100,
            popThrottleMs: 800,
            retentionMs: 0,
            flushTimerId: null,
            pendingOps: [],
            ...a,
            update: ({
                adding: t,
                removing: r,
                sourceId: s,
                priority: i,
                clear: n = !1
            }) => {
                e(e => {
                    n && M({
                        state: e
                    });
                    let a = n || 0 === e.pushThrottleMs;
                    t.forEach(t => {
                        t.pin ? (_({
                            state: e,
                            market: t
                        }), a = !0) : (({
                            state: e,
                            market: t,
                            sourceId: r,
                            priority: s
                        }) => {
                            (0, v.getAssetId)(t) && e.pendingOps.push({
                                type: "add",
                                sourceId: r,
                                priority: s,
                                market: t,
                                timestamp: Date.now()
                            })
                        })({
                            state: e,
                            market: t,
                            sourceId: t.sourceId ? ? s,
                            priority: i
                        })
                    }), r.forEach(t => {
                        (({
                            state: e,
                            market: t,
                            sourceId: r
                        }) => {
                            e.pendingOps.push({
                                type: "remove",
                                sourceId: r,
                                market: t,
                                timestamp: Date.now()
                            })
                        })({
                            state: e,
                            market: t,
                            sourceId: t.sourceId ? ? s
                        })
                    }), a ? b({
                        state: e
                    }) : e.scheduleFlush({
                        isPush: !0
                    })
                })
            },
            pin: t => {
                e(e => {
                    _({
                        state: e,
                        market: t
                    }), b({
                        state: e
                    })
                })
            },
            setCapacity: t => {
                e(e => {
                    e.capacity = t, b({
                        state: e
                    })
                })
            },
            setHysteresis: ({
                pushThrottleMs: t,
                popThrottleMs: r,
                retentionMs: s
            }) => {
                e(e => {
                    "number" == typeof t && (e.pushThrottleMs = t), "number" == typeof r && (e.popThrottleMs = r), "number" == typeof s && (e.retentionMs = s)
                })
            },
            scheduleFlush: ({
                isPush: r
            }) => {
                e(e => {
                    (({
                        state: e,
                        get: t,
                        isPush: r
                    }) => {
                        let s = r ? e.pushThrottleMs : e.popThrottleMs;
                        e.flushTimerId && clearTimeout(e.flushTimerId), e.flushTimerId = setTimeout(() => b({
                            state: t()
                        }), s)
                    })({
                        state: e,
                        get: t,
                        isPush: r
                    })
                })
            },
            flushNow: () => {
                e(e => {
                    b({
                        state: e
                    })
                })
            },
            reset: () => {
                e(e => {
                    M({
                        state: e
                    })
                })
            },
            setConfig: ({
                capacity: t,
                pushThrottleMs: r,
                popThrottleMs: s,
                retentionMs: i
            }) => {
                e(e => {
                    void 0 !== t && (e.capacity = t), void 0 !== r && (e.pushThrottleMs = r), void 0 !== s && (e.popThrottleMs = s), void 0 !== i && (e.retentionMs = i)
                })
            }
        }))), n[0] = a, n[1] = t) : t = n[1];
        let [l] = r.default.useState(t);
        return n[2] !== o || n[3] !== l ? (i = (0, k.jsx)(T.Provider, {
            value: l,
            children: o
        }), n[2] = o, n[3] = l, n[4] = i) : i = n[4], i
    }, "useBookConnectionStore", 0, (e, t) => {
        let r = A();
        return (0, y.useStoreWithEqualityFn)(r, e, t)
    }, "useBoundBookConnectionStore", 0, A], 451058)
}, 488549, 79126, e => {
    "use strict";
    var t = e.i(740594),
        r = e.i(970863),
        s = e.i(196593),
        i = e.i(156591);
    let n = {
            rate: .25,
            exponent: 2,
            takerOnly: !1,
            rebateRate: 0
        },
        a = {
            sports_fees: {
                rate: .0175,
                exponent: 1,
                takerOnly: !1,
                rebateRate: 0
            },
            crypto_15_min: {
                rate: .25,
                exponent: 2,
                takerOnly: !1,
                rebateRate: 0
            },
            crypto_5_min: {
                rate: .25,
                exponent: 2,
                takerOnly: !1,
                rebateRate: 0
            }
        },
        o = e => {
            let t = e ? .feeSchedule;
            if ("number" == typeof t ? .rate && "number" == typeof t ? .exponent) return {
                rate: t.rate,
                exponent: t.exponent,
                takerOnly: t.takerOnly ? ? n.takerOnly,
                rebateRate: t.rebateRate ? ? n.rebateRate
            };
            let r = e ? .feeType;
            return r && r in a ? a[r] : n
        },
        l = (e, t, r) => {
            if (e <= 0 || e > 1 || t <= 0) return {
                quantity: 0,
                usdc: 0
            };
            let {
                rate: s,
                exponent: i
            } = o(r), n = ((e, t) => {
                if (!Number.isFinite(e)) return 0;
                let r = 10 ** t;
                return Math.round(e * r) / r
            })(t * s * (e * (1 - e)) ** i, 4);
            return {
                quantity: n / e,
                usdc: n
            }
        };
    e.s(["calculateOrderFee", 0, l, "computeFeeAdjustedLimitSize", 0, (e, t, r, s, i) => t <= 0 ? e : ((e, t, r) => {
        if (e <= 0 || t <= 0 || t > 1 || Number.isNaN(t)) return e;
        let {
            rate: s,
            exponent: i
        } = o(r), n = s * (t * (1 - t)) ** i / t;
        return n >= 1 ? e : e / (1 - n)
    })(t, s, i) + r], 79126);
    var u = e.i(458164);
    let c = (e, t) => (0, i.getPrecisionFromTickSize)(e) > t ? ((e, t = 2) => "0" === e || 0 === e ? "0" : (0, s.nDecimals)(e, t))(e, t) : e.toString(),
        d = (e, t, r, s) => r ? l(e, t, s) : {
            quantity: 0,
            usdc: 0
        },
        p = (e, t, r) => {
            let s = t,
                i = 0;
            for (let t of e)
                if (parseFloat(t.price) <= r) {
                    let e = parseFloat(t.size);
                    if (e >= s) {
                        i += s;
                        break
                    }
                    i += e, s -= e
                }
            return {
                marketableSize: i,
                unmarketableSize: t - i
            }
        },
        h = r.getAssetId;
    e.s(["calculateWorstBuyPrice", 0, (e, t, r, s = .01) => {
        let n, a;
        if (!Array.isArray(e)) return 0;
        let o = parseFloat(t);
        for (let t = 0; t < e.length; t += 1) {
            let r = e[t],
                s = parseFloat(r.netValue);
            if (a && s < a) throw Error("Ask values are unreliable");
            if (s >= o) {
                n = r;
                break
            }
            a = s
        }
        let l = parseFloat(n ? .price ? ? "0");
        return 0 === l ? 0 : Math.min(l * (1 + r / 100), parseFloat((1 - s).toFixed((0, i.getPrecisionFromTickSize)(s))))
    }, "calculateWorstSellPrice", 0, (e, t, r, s = .01) => {
        let i, n;
        if (!Array.isArray(e)) return 0;
        let a = parseFloat(t);
        for (let t = 0; t < e.length; t += 1) {
            let r = e[t],
                s = parseFloat(r.netSize);
            if (n && s < n) throw Error("Bid values are unreliable");
            if (s >= a) {
                i = r;
                break
            }
            n = s
        }
        let o = parseFloat(i ? .price ? ? "0");
        return 0 === o ? 0 : Math.max(o * (1 - r / 100), s)
    }, "cleanPrice", 0, e => "auto_redeem" === e.event_type ? e : { ...e,
        price: c(e.price, 6)
    }, "cleanValueIfNeeded", 0, c, "getAssetId", 0, h, "getLimitOrderInfo", 0, (e, r, s, i, n, a, o = !0, l) => Array.isArray(e) && Array.isArray(r) && i && n === u.OrderType.Limit ? a === t.Side.BUY ? ((e, t, r, s, i) => {
        let {
            marketableSize: n,
            unmarketableSize: a
        } = p(e, parseFloat(r), t), o = d(t, n, s, i), l = a + (n - o.quantity), u = t * (a + n) / l;
        return {
            averagePrice: Number.isFinite(u) ? u : 0,
            sharesReceived: l,
            usdcReceived: 0,
            withinRange: !0,
            hasMarketablePortion: n > 0,
            feeValue: o.usdc
        }
    })(r, s, i, o, l) : ((e, t, r, s, i) => {
        let {
            marketableSize: n,
            unmarketableSize: a
        } = ((e, t, r) => {
            let s = t,
                i = 0;
            for (let t of e)
                if (parseFloat(t.price) >= r) {
                    let e = parseFloat(t.size);
                    if (e >= s) {
                        i += s;
                        break
                    }
                    i += e, s -= e
                }
            return {
                marketableSize: i,
                unmarketableSize: t - i
            }
        })(e, parseFloat(r), t), o = d(t, n, s, i), l = (a + (n - o.quantity)) * t, u = l / (a + n);
        return {
            averagePrice: Number.isFinite(u) ? u : 0,
            sharesReceived: 0,
            usdcReceived: l,
            withinRange: !0,
            hasMarketablePortion: n > 0,
            feeValue: o.usdc
        }
    })(e, s, i, o, l) : {
        averagePrice: 0,
        sharesReceived: 0,
        usdcReceived: 0,
        withinRange: !1,
        hasMarketablePortion: !1,
        feeValue: 0
    }, "getMarketOrderInfo", 0, (e, r, s, i, n, a = !0, o) => Array.isArray(e) && Array.isArray(r) && s && i === u.OrderType.Market ? n === t.Side.BUY ? ((e, t, r, s) => {
        let i = parseFloat(t),
            n = i,
            a = 0,
            o = 0;
        for (let t of e) {
            let e = parseFloat(t.price),
                r = parseFloat(t.size),
                s = parseFloat(t.value);
            if (o += s, s > n) {
                a += n / e;
                break
            }
            a += r, n -= s
        }
        if (i > o) return {
            averagePrice: 1,
            sharesReceived: a,
            usdcReceived: 0,
            feeValue: 0
        };
        let l = i / a;
        if (!Number.isFinite(l)) return {
            averagePrice: 0,
            sharesReceived: 0,
            usdcReceived: 0,
            feeValue: 0
        };
        let u = d(l, a, r, s),
            c = a - u.quantity,
            p = i / c;
        return {
            averagePrice: Number.isFinite(p) ? p : 0,
            sharesReceived: c,
            usdcReceived: 0,
            feeValue: u.usdc
        }
    })(r, s, a, o) : ((e, t, r, s) => {
        let i = parseFloat(t),
            n = i,
            a = 0,
            o = 0;
        for (let t of e) {
            let e = parseFloat(t.price),
                r = parseFloat(t.size),
                s = parseFloat(t.value);
            if (o += r, r > n) {
                a += n * e;
                break
            }
            a += s, n -= r
        }
        if (i > o) return {
            averagePrice: 0,
            sharesReceived: 0,
            usdcReceived: a,
            feeValue: 0
        };
        let l = d(a / parseFloat(t), i, r, s),
            u = a - l.usdc,
            c = u / i;
        return {
            averagePrice: Number.isFinite(c) ? c : 0,
            sharesReceived: 0,
            usdcReceived: u,
            feeValue: l.usdc
        }
    })(e, s, a, o) : {
        averagePrice: 0,
        sharesReceived: 0,
        usdcReceived: 0,
        feeValue: 0
    }, "getMarketablePortionOfLimitBuy", 0, p], 488549)
}, 867285, e => {
    e.v(function(t, r) {
        return e.b(t, "static/chunks/turbopack-worker-0sjn--fhq~1cg.js", ["static/chunks/0.qeyoqzsnzbj.js", "static/chunks/0~fgmezipkw7a.js", "static/chunks/0sfw8wqcwxapa.js", "static/chunks/0g2xw8z0vyswt.js", "static/chunks/049td.mqgmua3.js", "static/chunks/turbopack-0f1e065de5tjx.js"], r)
    })
}, 635868, 695097, e => {
    "use strict";
    e.s(["BookContextProvider", () => D, "useBookContext", () => C], 635868);
    var t = e.i(221628),
        r = e.i(999061),
        s = e.i(567692),
        i = e.i(723823),
        n = e.i(339393),
        a = e.i(950495),
        o = e.i(927944),
        l = e.i(213333),
        u = e.i(416340),
        c = e.i(134709),
        d = e.i(399336),
        p = e.i(6204),
        h = e.i(354712),
        m = e.i(210308),
        f = e.i(218714),
        g = e.i(924706),
        k = e.i(376966),
        y = e.i(464152),
        S = e.i(451058),
        w = e.i(488549);

    function v(e, t) {
        return "subscribe" === t.type && (e.adding.push({ ...t.market,
            pin: t.pin,
            sourceId: t.id
        }), t.clear && (e.clear = !0)), "unsubscribe" === t.type && (e.removing.push({ ...t.market,
            sourceId: t.id
        }), e.minimizing.push((0, w.getAssetId)(t.market))), e
    }
    var _ = e.i(552470);

    function b() {
        globalThis.__bookWorkerApi ? .terminate(), globalThis.__bookWorkerApi = void 0, globalThis.__bookWorker ? .terminate(), globalThis.__bookWorker = void 0
    }

    function M(t = !1) {
        return (!globalThis.__bookWorker || t) && (b(), globalThis.__bookWorker = e.r(867285)(Worker), globalThis.__bookWorkerApi = _.wrap(globalThis.__bookWorker), window.addEventListener("pagehide", () => {
            b()
        }, {
            once: !0
        })), {
            worker: globalThis.__bookWorker,
            api: globalThis.__bookWorkerApi
        }
    }
    let T = u.default.createContext({}),
        A = () => u.default.useContext(T);

    function I() {}
    e.s(["BooksContextProvider", 0, e => {
        let n, a, o, l, c = (0, r.c)(29),
            {
                children: d
            } = e,
            {
                bookWorkerReady: p,
                bookWorkerApiRef: h,
                bookWorkerSetup: m,
                setBookWorkerSetup: w,
                resetBookWorker: _
            } = (() => {
                let [e, t] = u.default.useState(!1), [r, s] = u.default.useState(!1), i = u.default.useRef(void 0), n = u.default.useRef(void 0);
                u.default.useEffect(() => {
                    let {
                        worker: e,
                        api: r
                    } = M();
                    i.current = e, n.current = r, t(!0)
                }, []), u.default.useEffect(() => () => {
                    b()
                }, []);
                let a = u.default.useCallback(() => {
                    t(!1), s(!1);
                    let {
                        worker: e,
                        api: r
                    } = M(!0);
                    i.current = e, n.current = r, setTimeout(() => {
                        t(!0)
                    }, 500)
                }, []);
                return {
                    bookWorkerReady: e,
                    bookWorkerSetup: r,
                    bookWorkerApiRef: n,
                    setBookWorkerSetup: s,
                    resetBookWorker: a
                }
            })(),
            {
                areBooksFetching: A,
                areLastPricesFetching: x
            } = (0, i.useBooksFetchingStatus)(),
            {
                startPollingBook: D,
                startPollingBooks: C,
                stopPollingBook: E,
                stopPollingBooks: P,
                clearPollingBooks: F
            } = (0, g.usePollBooks)(h, m),
            {
                queueFetchBooks: L,
                queueFetchMinifiedBooks: B,
                queueFetchLastPrices: O
            } = (0, k.useQueueFetchBooks)(h, m),
            {
                subscribeToBook: H,
                unsubscribeFromBook: N,
                subscribeToBooks: R,
                unsubscribeFromBooks: W,
                updateSubscription: z
            } = (() => {
                let e, t, i, n, a, o, l, u, c = (0, r.c)(23),
                    d = (0, S.useBoundBookConnectionStore)(),
                    p = (0, s.useBoundBookStore)();
                c[0] !== p || c[1] !== d ? (e = e => {
                    let {
                        adding: t,
                        removing: r,
                        minimizing: s,
                        clear: i
                    } = e.reduce(v, {
                        adding: [],
                        removing: [],
                        minimizing: [],
                        clear: !1
                    });
                    d.getState().update({
                        adding: t,
                        removing: r,
                        sourceId: "",
                        priority: 1,
                        clear: i
                    }), setTimeout(() => {
                        p.getState().minimizeViews(s)
                    }, 1e3)
                }, c[0] = p, c[1] = d, c[2] = e) : e = c[2];
                let h = e;
                c[3] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                    wait: 100,
                    mode: "trailing"
                }, c[3] = t) : t = c[3];
                let {
                    enqueue: m,
                    dequeue: f
                } = (0, y.useAggregatedDebounce)(h, t);
                c[4] !== f || c[5] !== m ? (i = (e, t, r, s) => {
                    let i = void 0 === t ? "" : t,
                        n = `subscribe-${i}-${e.slug}`;
                    f(`unsubscribe-${i}-${e.slug}`), m([{
                        id: n,
                        data: {
                            type: "subscribe",
                            market: e,
                            id: i,
                            clear: void 0 !== r && r,
                            pin: void 0 !== s && s
                        }
                    }])
                }, c[4] = f, c[5] = m, c[6] = i) : i = c[6];
                let g = i;
                c[7] !== f || c[8] !== m ? (n = (e, t) => {
                    let r = void 0 === t ? "" : t,
                        s = `unsubscribe-${r}-${e.slug}`;
                    f(`subscribe-${r}-${e.slug}`), m({
                        id: s,
                        data: {
                            type: "unsubscribe",
                            market: e,
                            id: r
                        }
                    })
                }, c[7] = f, c[8] = m, c[9] = n) : n = c[9];
                let k = n;
                c[10] !== g ? (a = (e, t, r, s) => {
                    let i = void 0 === t ? "" : t,
                        n = void 0 !== r && r,
                        a = void 0 !== s && s;
                    e.forEach(e => {
                        g(e, i, n, a)
                    })
                }, c[10] = g, c[11] = a) : a = c[11];
                let w = a;
                c[12] !== k ? (o = (e, t) => {
                    let r = void 0 === t ? "" : t;
                    e.forEach(e => {
                        k(e, r)
                    })
                }, c[12] = k, c[13] = o) : o = c[13];
                let _ = o;
                c[14] !== g || c[15] !== k ? (l = (e, t, r, s) => {
                    let i = void 0 === r ? "" : r,
                        n = void 0 !== s && s;
                    e.forEach(e => {
                        g(e.market, i, n, e.pin)
                    }), t.forEach(e => {
                        k(e.market, i)
                    })
                }, c[14] = g, c[15] = k, c[16] = l) : l = c[16];
                let b = l;
                return c[17] !== g || c[18] !== w || c[19] !== k || c[20] !== _ || c[21] !== b ? (u = {
                    subscribeToBook: g,
                    unsubscribeFromBook: k,
                    subscribeToBooks: w,
                    unsubscribeFromBooks: _,
                    updateSubscription: b
                }, c[17] = g, c[18] = w, c[19] = k, c[20] = _, c[21] = b, c[22] = u) : u = c[22], u
            })(),
            $ = (0, f.useBookGarbageCollection)(h, 3e5);
        c[0] !== p || c[1] !== $ ? (n = () => {
            let e = I;
            return p && (e = $()), () => e()
        }, c[0] = p, c[1] = $, c[2] = n) : n = c[2], c[3] !== p ? (a = [p], c[3] = p, c[4] = a) : a = c[4], u.default.useEffect(n, a), c[5] !== A || c[6] !== x || c[7] !== h || c[8] !== p || c[9] !== m || c[10] !== F || c[11] !== L || c[12] !== O || c[13] !== B || c[14] !== _ || c[15] !== w || c[16] !== D || c[17] !== C || c[18] !== E || c[19] !== P || c[20] !== H || c[21] !== R || c[22] !== N || c[23] !== W || c[24] !== z ? (o = {
            areBooksRefetching: A,
            areLastPricesRefetching: x,
            queueFetchBooks: L,
            queueFetchLastPrices: O,
            queueFetchMinifiedBooks: B,
            startPollingBook: D,
            startPollingBooks: C,
            stopPollingBook: E,
            stopPollingBooks: P,
            clearPollingBooks: F,
            subscribeToBook: H,
            unsubscribeFromBook: N,
            subscribeToBooks: R,
            unsubscribeFromBooks: W,
            updateSubscription: z,
            bookWorkerApiRef: h,
            bookWorkerReady: p,
            bookWorkerSetup: m,
            setBookWorkerSetup: w,
            resetBookWorker: _
        }, c[5] = A, c[6] = x, c[7] = h, c[8] = p, c[9] = m, c[10] = F, c[11] = L, c[12] = O, c[13] = B, c[14] = _, c[15] = w, c[16] = D, c[17] = C, c[18] = E, c[19] = P, c[20] = H, c[21] = R, c[22] = N, c[23] = W, c[24] = z, c[25] = o) : o = c[25];
        let q = o;
        return c[26] !== d || c[27] !== q ? (l = (0, t.jsx)(T.Provider, {
            value: q,
            children: d
        }), c[26] = d, c[27] = q, c[28] = l) : l = c[28], l
    }, "useBooksContext", 0, A], 695097);
    let x = (0, h.createSplitContext)("BookContext", {
            bookWorkerReady: !1,
            bookWorkerApiRef: void 0,
            isBookRefreshing: !1,
            isLastPriceRefetching: !1,
            refetchBook: () => {
                throw Error("refetchBook not implemented")
            },
            refetchQuery: () => {
                throw Error("refetchQuery not implemented")
            },
            subscribe: () => {
                throw Error("subscribe not implemented")
            },
            unsubscribe: () => {
                throw Error("unsubscribe not implemented")
            },
            poll: () => {
                throw Error("poll not implemented")
            },
            stopPolling: () => {
                throw Error("stopPolling not implemented")
            },
            queueFetchBook: () => {
                throw Error("queueFetchBook not implemented")
            },
            queueFetchMinifiedBook: () => {
                throw Error("queueFetchMinifiedBook not implemented")
            },
            queueFetchLastPrice: () => {
                throw Error("queueFetchLastPrice not implemented")
            },
            market: void 0
        }),
        D = e => {
            let h, f, g, k, y, S, v, _, b, M, T, I, D, C, F, L, B, O, H, N, R, W, z, $, q, j, U, V, K, Q = (0, r.c)(101),
                {
                    market: G,
                    prefetch: Y,
                    poll: X,
                    subscribe: J,
                    defer: Z,
                    deferMs: ee,
                    id: et,
                    children: er
                } = e,
                es = void 0 === X ? "never" : X,
                ei = void 0 === J ? "never" : J,
                en = void 0 === Z ? "never" : Z;
            Q[0] === Symbol.for("react.memo_cache_sentinel") ? (h = ["virtualized", "isSportsPage"], Q[0] = h) : h = Q[0];
            let {
                virtualized: ea,
                isSportsPage: eo
            } = (0, p.useSportsContext)(h);
            Q[1] === Symbol.for("react.memo_cache_sentinel") ? (f = ["activeMarket"], Q[1] = f) : f = Q[1];
            let {
                activeMarket: el
            } = (0, d.useEventActiveMarketContext)(f);
            Q[2] !== et ? (g = () => et ? ? crypto.randomUUID(), Q[2] = et, Q[3] = g) : g = Q[3];
            let [eu] = u.default.useState(g), ec = el ? .slug === G.slug;
            e: {
                if (!eo || "never" === en) {
                    k = 0;
                    break e
                }
                if ("always" === en || "after-virtualized" === en && !ea) {
                    k = void 0 === ee ? 2e3 : ee;
                    break e
                }
                k = 0
            }
            let ed = k;
            Q[4] !== ed ? (y = {
                wait: ed
            }, Q[4] = ed, Q[5] = y) : y = Q[5];
            let ep = (0, n.useDeferredMounted)(y),
                eh = (0, c.default)(),
                em = u.default.useRef(null),
                ef = u.default.useRef(null),
                eg = u.default.useRef(null);
            Q[6] === Symbol.for("react.memo_cache_sentinel") ? (S = new Set, Q[6] = S) : S = Q[6];
            let ek = u.default.useRef(S),
                {
                    bookWorkerReady: ey,
                    bookWorkerApiRef: eS,
                    startPollingBook: ew,
                    stopPollingBook: ev,
                    subscribeToBook: e_,
                    unsubscribeFromBook: eb,
                    unsubscribeFromBooks: eM,
                    updateSubscription: eT
                } = A();
            Q[7] !== G ? (v = (0, w.getAssetId)(G), Q[7] = G, Q[8] = v) : v = Q[8];
            let eA = v,
                eI = (0, l.usePrevious)(G),
                {
                    isBookFetching: ex,
                    isLastPriceFetching: eD
                } = (0, i.useIsBookFetching)(eA),
                {
                    queueFetchBook: eC,
                    queueFetchMinifiedBook: eE
                } = ((e, t) => {
                    let s, i, n, a, o, l, c, d = (0, r.c)(23),
                        p = void 0 === t ? "minified" : t,
                        [h, f] = u.default.useState(!1);
                    d[0] !== e ? (s = (0, w.getAssetId)(e), d[0] = e, d[1] = s) : s = d[1], d[2] !== e.orderPriceMinTickSize || d[3] !== s ? (i = {
                        assetId: s,
                        tickSize: e.orderPriceMinTickSize
                    }, d[2] = e.orderPriceMinTickSize, d[3] = s, d[4] = i) : i = d[4];
                    let {
                        tickSize: g,
                        assetId: k
                    } = i, {
                        queueFetchBooks: y,
                        queueFetchMinifiedBooks: S
                    } = A();
                    d[5] !== k || d[6] !== y || d[7] !== g ? (n = () => {
                        f(!0), setTimeout(() => f(!1), 250), y([{
                            id: k,
                            tickSize: g
                        }])
                    }, d[5] = k, d[6] = y, d[7] = g, d[8] = n) : n = d[8];
                    let v = n;
                    d[9] !== k || d[10] !== S || d[11] !== g ? (a = () => {
                        f(!0), setTimeout(() => f(!1), 250), S([{
                            id: k,
                            tickSize: g
                        }])
                    }, d[9] = k, d[10] = S, d[11] = g, d[12] = a) : a = d[12];
                    let _ = a;
                    d[13] !== p || d[14] !== v || d[15] !== _ ? (o = () => {
                        "book" === p && v(), "minified" === p && _()
                    }, d[13] = p, d[14] = v, d[15] = _, d[16] = o) : o = d[16];
                    let b = o;
                    return d[17] !== h || d[18] !== v || d[19] !== _ || d[20] !== b ? (l = () => ({
                        isPending: !1,
                        isRefetching: h,
                        isFetching: h,
                        refetch: b,
                        queueFetchBook: v,
                        queueFetchMinifiedBook: _
                    }), c = [h, b, v, _], d[17] = h, d[18] = v, d[19] = _, d[20] = b, d[21] = l, d[22] = c) : (l = d[21], c = d[22]), (0, m.useDeepCompareMemo)(l, c)
                })(G, "minified"),
                {
                    queueFetchLastPrice: eP
                } = (e => {
                    let t, s, i, n, a, o = (0, r.c)(13),
                        [l, c] = u.default.useState(!1);
                    o[0] !== e ? (t = (0, w.getAssetId)(e), o[0] = e, o[1] = t) : t = o[1], o[2] !== e.orderPriceMinTickSize || o[3] !== t ? (s = {
                        assetId: t,
                        tickSize: e.orderPriceMinTickSize
                    }, o[2] = e.orderPriceMinTickSize, o[3] = t, o[4] = s) : s = o[4];
                    let {
                        assetId: d,
                        tickSize: p
                    } = s, {
                        queueFetchLastPrices: h
                    } = A();
                    o[5] !== d || o[6] !== h || o[7] !== p ? (i = () => {
                        c(!0), setTimeout(() => c(!1), 250), h([{
                            id: d,
                            tickSize: p
                        }])
                    }, o[5] = d, o[6] = h, o[7] = p, o[8] = i) : i = o[8];
                    let f = i;
                    return o[9] !== l || o[10] !== f ? (n = () => ({
                        isPending: !1,
                        isRefetching: l,
                        isFetching: l,
                        refetch: f,
                        queueFetchLastPrice: f
                    }), a = [l, f], o[9] = l, o[10] = f, o[11] = n, o[12] = a) : (n = o[11], a = o[12]), (0, m.useDeepCompareMemo)(n, a)
                })(G);
            Q[9] !== Y ? (_ = Y ? ? {}, Q[9] = Y, Q[10] = _) : _ = Q[10];
            let {
                book: eF,
                lastPrice: eL
            } = _, eB = void 0 === eF ? "never" : eF, eO = void 0 === eL ? "never" : eL;
            Q[11] !== ec || Q[12] !== es ? (b = ("always" === es || "when-inactive" === es && !ec) && {
                book: "once-when-stale"
            }, Q[11] = ec, Q[12] = es, Q[13] = b) : b = Q[13], Q[14] !== eB || Q[15] !== eO || Q[16] !== b ? (M = {
                book: eB,
                last: eO,
                ...b
            }, Q[14] = eB, Q[15] = eO, Q[16] = b, Q[17] = M) : M = Q[17];
            let eH = M;
            t: {
                if (!Y ? .dependency) {
                    T = eA;
                    break t
                }
                T = `${eA}-${Y.dependency??"dep"}`
            }
            let eN = T,
                eR = (0, s.useBooksStore)(E),
                eW = (0, i.useShouldInitializeEntity)("asset", "all", eA, eH, eN);
            Q[18] !== eC || Q[19] !== eP ? (I = () => {
                eC(), eP()
            }, Q[18] = eC, Q[19] = eP, Q[20] = I) : I = Q[20];
            let ez = I;
            Q[21] !== eu || Q[22] !== G || Q[23] !== e_ ? (D = e => {
                e_(G, `book-context-${eu}`, !1, void 0 !== e && e)
            }, Q[21] = eu, Q[22] = G, Q[23] = e_, Q[24] = D) : D = Q[24];
            let e$ = D;
            Q[25] !== eu || Q[26] !== G || Q[27] !== eb ? (C = () => {
                eb(G, `book-context-${eu}`)
            }, Q[25] = eu, Q[26] = G, Q[27] = eb, Q[28] = C) : C = Q[28];
            let eq = C;
            Q[29] !== eA || Q[30] !== eu || Q[31] !== ew ? (F = e => {
                ew(eA, void 0 === e ? "book" : e, `book-context-${eu}`)
            }, Q[29] = eA, Q[30] = eu, Q[31] = ew, Q[32] = F) : F = Q[32];
            let ej = F;
            Q[33] !== eA || Q[34] !== eu || Q[35] !== ev ? (L = e => {
                ev(eA, void 0 === e ? "book" : e, `book-context-${eu}`)
            }, Q[33] = eA, Q[34] = eu, Q[35] = ev, Q[36] = L) : L = Q[36];
            let eU = L;
            Q[37] !== eA || Q[38] !== eR || Q[39] !== ec || Q[40] !== es || Q[41] !== eP || Q[42] !== eE || Q[43] !== ep || Q[44] !== eW ? (B = () => {
                if (ep) {
                    let e;
                    eW.book && ("never" === es || "when-inactive" === es && !ec) && (eE(), e = "book"), eW.last && (eP(), e = "book" === e ? "all" : "last-price"), e && eR("asset", e, eA, Date.now())
                }
            }, Q[37] = eA, Q[38] = eR, Q[39] = ec, Q[40] = es, Q[41] = eP, Q[42] = eE, Q[43] = ep, Q[44] = eW, Q[45] = B) : B = Q[45], Q[46] !== ep || Q[47] !== eW ? (O = [eW, ep], Q[46] = ep, Q[47] = eW, Q[48] = O) : O = Q[48], u.default.useEffect(B, O), Q[49] !== eA || Q[50] !== eu || Q[51] !== ec || Q[52] !== G.slug || Q[53] !== es || Q[54] !== eI || Q[55] !== ep || Q[56] !== ew || Q[57] !== ev ? (H = () => {
                if (ep && eI ? .slug !== G.slug && "never" !== es && ("always" !== es && ("when-inactive" !== es || ec) || (ew(eA, "minified", `book-context-${eu}`), ef.current = () => {
                        ev(eA, "minified", `book-context-${eu}`)
                    }, ek.current.add(eA)), "when-inactive" === es && ec && ek.current.has(eA) && (ek.current.delete(eA), ev(eA, "minified", `book-context-${eu}`))), "never" === es && (ek.current.has(eA) && (ek.current.delete(eA), ev(eA, "minified", `book-context-${eu}`)), eI)) {
                    let e = (0, w.getAssetId)(eI);
                    eA !== e && ek.current.has(e) && (ek.current.delete(e), ev(e, "minified", `book-context-${eu}`))
                }
            }, Q[49] = eA, Q[50] = eu, Q[51] = ec, Q[52] = G.slug, Q[53] = es, Q[54] = eI, Q[55] = ep, Q[56] = ew, Q[57] = ev, Q[58] = H) : H = Q[58], Q[59] !== ec || Q[60] !== G.slug || Q[61] !== es || Q[62] !== ep ? (N = [G.slug, es, ec, ep], Q[59] = ec, Q[60] = G.slug, Q[61] = es, Q[62] = ep, Q[63] = N) : N = Q[63], u.default.useEffect(H, N), Q[64] !== eu || Q[65] !== ec || Q[66] !== G || Q[67] !== eI || Q[68] !== ep || Q[69] !== ei || Q[70] !== eM || Q[71] !== eT ? (R = () => {
                if (ep && eI ? .slug !== G.slug) {
                    let e = [],
                        t = [];
                    "always" === ei && e.push({
                        market: G,
                        pin: !1
                    }), "when-active" === ei && ec && e.push({
                        market: G,
                        pin: !0
                    }), "when-active" !== ei || ec || t.push({
                        market: G
                    }), ec && eI && eI.slug !== G.slug && t.push({
                        market: eI
                    }), (e.length > 0 || t.length > 0) && (eT(e, t, `book-context-${eu}`, !1), em.current = () => {
                        eM(e.map(P), `book-context-${eu}`)
                    })
                }
            }, Q[64] = eu, Q[65] = ec, Q[66] = G, Q[67] = eI, Q[68] = ep, Q[69] = ei, Q[70] = eM, Q[71] = eT, Q[72] = R) : R = Q[72], Q[73] !== ec || Q[74] !== G.slug || Q[75] !== ep || Q[76] !== ei ? (W = [G.slug, ei, ec, ep], Q[73] = ec, Q[74] = G.slug, Q[75] = ep, Q[76] = ei, Q[77] = W) : W = Q[77], Q[78] === Symbol.for("react.memo_cache_sentinel") ? (z = {
                wait: 10,
                trailing: !0
            }, Q[78] = z) : z = Q[78], (0, a.useDebounceEffect)(R, W, z), Q[79] === Symbol.for("react.memo_cache_sentinel") ? ($ = () => {
                em.current && em.current(), ef.current && ef.current()
            }, Q[79] = $) : $ = Q[79];
            let eV = $;
            Q[80] === Symbol.for("react.memo_cache_sentinel") ? (q = () => {
                eg.current = eV
            }, Q[80] = q) : q = Q[80], (0, o.useMount)(q), Q[81] === Symbol.for("react.memo_cache_sentinel") ? (j = () => () => {
                eg.current && eg.current()
            }, Q[81] = j) : j = Q[81], Q[82] !== eh ? (U = [eh], Q[82] = eh, Q[83] = U) : U = Q[83], u.default.useEffect(j, U), Q[84] !== eS || Q[85] !== ey || Q[86] !== ex || Q[87] !== eD || Q[88] !== G || Q[89] !== eC || Q[90] !== eP || Q[91] !== eE || Q[92] !== ez || Q[93] !== ej || Q[94] !== eU || Q[95] !== e$ || Q[96] !== eq ? (V = {
                isBookRefreshing: ex,
                refetchBook: ez,
                refetchQuery: ez,
                bookWorkerApiRef: eS,
                bookWorkerReady: ey,
                queueFetchBook: eC,
                queueFetchMinifiedBook: eE,
                queueFetchLastPrice: eP,
                isLastPriceRefetching: eD,
                market: G,
                subscribe: e$,
                unsubscribe: eq,
                poll: ej,
                stopPolling: eU
            }, Q[84] = eS, Q[85] = ey, Q[86] = ex, Q[87] = eD, Q[88] = G, Q[89] = eC, Q[90] = eP, Q[91] = eE, Q[92] = ez, Q[93] = ej, Q[94] = eU, Q[95] = e$, Q[96] = eq, Q[97] = V) : V = Q[97];
            let eK = V;
            return Q[98] !== er || Q[99] !== eK ? (K = (0, t.jsx)(x.Provider, {
                values: eK,
                children: er
            }), Q[98] = er, Q[99] = eK, Q[100] = K) : K = Q[100], K
        },
        C = e => (0, h.useSplitContext)(x, e);

    function E(e) {
        return e.initializeEntity
    }

    function P(e) {
        return e.market
    }
}, 459225, e => {
    "use strict";
    var t = e.i(328113),
        r = e.i(416340),
        s = e.i(3643),
        i = e.i(650485);
    let n = e => {
        let t = Array.isArray(e.outcomePrices) ? 100 * parseFloat(e.outcomePrices[0]) : 0,
            {
                lastPrice: r,
                showLastPrice: i
            } = (0, s.getPercentChanceFromMarket)(e);
        return i ? (void 0 !== r && (t = r), { ...e,
            sortKey: t
        }) : { ...e,
            sortKey: 0
        }
    };
    e.s(["parseMarketWithSortKey", 0, n, "useSortedMarkets", 0, e => {
        let s = (0, t.useLatest)(e);
        return r.default.useMemo(() => {
            if (!s.current) return {
                markets: [],
                resolvedMarkets: [],
                lowChanceMarkets: []
            };
            let e = !s.current.showAllOutcomes,
                t = (s.current.markets ? ? []).filter(e => !!e).reduce((t, r) => {
                    if (!s.current || !r.active) return t;
                    if (s.current.closed) return t.expandedMarkets.push({ ...r,
                        sortKey: 0
                    }), t;
                    if (r.closed) return t.resolvedMarkets.push({ ...r,
                        sortKey: 0
                    }), t;
                    let i = n(r);
                    return e && !i.showGmpOutcome && s.current.negRisk && i.sortKey >= 0 && i.sortKey < 1 ? t.lowChanceMarkets.push(i) : t.expandedMarkets.push(i), t
                }, {
                    expandedMarkets: [],
                    resolvedMarkets: [],
                    lowChanceMarkets: []
                });
            return {
                markets: t.expandedMarkets.sort((e, t) => (0, i.aggregatedSort)(e, t, s.current)),
                resolvedMarkets: t.resolvedMarkets.sort((e, t) => (0, i.aggregatedSort)(e, t, s.current)),
                lowChanceMarkets: t.lowChanceMarkets.sort((e, t) => (0, i.aggregatedSort)(e, t, s.current))
            }
        }, [s, e.id])
    }])
}, 866192, 144333, 502475, e => {
    "use strict";
    var t = e.i(444298),
        r = e.i(196593);
    let s = (e, t = !0) => {
            if ("scalar" !== e.market_type) throw Error("This market is not scalar");
            let s = e.upper_bound ? parseFloat(e.upper_bound) : 0,
                i = e.lower_bound ? parseFloat(e.lower_bound) : 0,
                n = i + (e ? parseFloat(e.outcomePrices[0]) : 0) * (s - i);
            return t ? ((e, t, s = t.format_type, i) => "decimal_not_money" === s ? (0, r.formatNumbers)(e.toString(), i) : "decimal" === s ? `$${(0,r.formatNumbers)(e.toString(),i)}` : "number" === s ? (0, r.suffixNumber)(e.toString()) : "eth" === s ? `${(0,r.suffixNumber)(e.toString())} \u039E` : `$${(0,r.suffixNumber)(e)}`)(n, e) : n.toString()
        },
        i = (e, r) => e && e.outcomes && e.outcomes[r] ? (0, t.capitalize)(e.outcomes[r]) : "Unknown Outcome",
        n = (e, t) => Number(e).toFixed(t).toString(),
        a = (e, t) => e && Array.isArray(e.outcomePrices) ? e.outcomePrices.findIndex(e => "1.00" === parseFloat(e).toFixed(2) || t && parseFloat(e) > .5) : 0;
    e.s(["displayOutcomeString", 0, (e, t) => {
        let r = "";
        for (let s = 0; s < e.outcomes.length; s += 1) r = `${r} ${i(e,s)}: ${n(e.outcomePrices[s],t)}`, s !== e.outcomes.length - 1 && (r = `${r}, `);
        return r
    }, "findWinningIndex", 0, a, "findWinningSportsMarketOfType", 0, (e, t) => {
        let r = t ? ? "moneyline",
            s = e.filter(e => (e.sportsMarketType ? ? "moneyline") === r);
        if (s.length) return s.find(e => !0 === e.negRisk && 1 === parseFloat(e.outcomePrices ? .[0] ? ? "0"))
    }, "getResolutionNameShort", 0, (e, t) => {
        if (e && e.outcomes && e.outcomePrices) {
            if ("scalar" === e.market_type) return `${s(e,!0)}`;
            let r = a(e);
            if (r > -1) return `${i(e,r)}`;
            let o = "";
            for (let r = 0; r < e.outcomes.length; r += 1) o = `${o} ${i(e,r)}: ${n(e.outcomePrices[r],t)}`, r !== e.outcomes.length - 1 && (o = `${o}, `);
            return o
        }
        return "Unknown Outcome"
    }, "getResolutionNameWithoutValue", 0, (e, t, r) => {
        if (e && e.outcomes && e.outcomePrices) {
            if ("scalar" === e.market_type) return `${s(e,!0)} (${e.outcomes[0]}: 
                ${n(e.outcomePrices[0],t)}, 
                ${e.outcomes[1]}: ${n(e.outcomePrices[1],t)})`;
            let o = a(e, r);
            if (o > -1) return `${i(e,o)}`;
            let l = "";
            for (let r = 0; r < e.outcomes.length; r += 1) l = `${l} ${i(e,r)}: ${n(e.outcomePrices[r],t)}`, r !== e.outcomes.length - 1 && (l = `${l}, `);
            return l
        }
        return "Unknown Outcome"
    }, "outcomeNameFromIndex", 0, i], 866192);
    var o = e.i(999061),
        l = e.i(122538),
        u = e.i(601550),
        c = e.i(964974),
        d = e.i(318594),
        p = e.i(416340),
        h = e.i(965572);
    let m = function(e, t) {
        return (0, h.default)(e, t)
    };
    e.s(["isEqual", 0, m], 144333);
    var f = e.i(778983),
        g = e.i(510954),
        k = e.i(57096),
        y = e.i(53950);
    let S = ({
        conditionId: e,
        outcomeIndex: t
    }) => `${e.toLowerCase()}:${t}`;

    function w(e) {
        if ("string" != typeof e) return !1;
        try {
            return BigInt(e) > 0 n
        } catch {
            return !1
        }
    }

    function v(e) {
        return "number" == typeof e && Number.isFinite(e) ? e : 0
    }
    let _ = e => `pm_optimistic_positions:${e.toLowerCase()}`,
        b = e => {
            if (!e) return new Map;
            try {
                let t = window.localStorage.getItem(_(e));
                if (!t) return new Map;
                let r = JSON.parse(t);
                if (!Array.isArray(r)) return new Map;
                return new Map(r)
            } catch {
                return new Map
            }
        },
        M = e => {
            if (e && "object" == typeof e) return e
        },
        T = e => !!e && "object" == typeof e && "string" == typeof e.conditionId && "number" == typeof e.outcomeIndex && "number" == typeof e.size,
        A = ({
            queryClient: e,
            positions: t,
            proxyAddress: r,
            source: s,
            transactionMeta: i
        }) => {
            if (!r) return;
            let n = g.queryKeys[k.QueryKey.Positions].optimistic(r).queryKey;
            e.setQueryData(n, n => {
                let a = new Map(n),
                    o = r ? e.getQueryData(g.queryKeys[k.QueryKey.Markets].positions(r).queryKey) : void 0,
                    l = e.getQueryData(g.queryKeys[k.QueryKey.Markets].trackedPositions().queryKey),
                    u = new Map,
                    c = e => {
                        e ? .conditionId && u.set(e.conditionId.toLowerCase(), e)
                    };
                return o ? .forEach(c), l ? .forEach(c), n ? .forEach(e => {
                    c(e.market)
                }), t.forEach(t => {
                    var c;
                    let d = t.market.id.toLowerCase(),
                        p = S({
                            conditionId: d,
                            outcomeIndex: t.outcomeIndex
                        }),
                        h = n ? .get(p),
                        g = (c = t.market) && "object" == typeof c && "string" == typeof c.conditionId && Array.isArray(c.outcomes) ? t.market : void 0,
                        w = (() => {
                            if (g) return;
                            let e = M(t.market);
                            if ("string" == typeof e ? .id) return {
                                conditionId: e.id,
                                question: "",
                                image: "",
                                slug: "",
                                closed: "boolean" == typeof e.closed && e.closed,
                                marketMakerAddress: "",
                                clobTokenIds: [],
                                active: !0,
                                outcomes: [],
                                outcomePrices: Array.isArray(e.outcomeTokenPrices) ? e.outcomeTokenPrices : [],
                                end_date: void 0,
                                events: [],
                                negRisk: "boolean" == typeof e.negRisk && e.negRisk,
                                groupItemTitle: null
                            }
                        })(),
                        v = (() => {
                            try {
                                let r = Number.parseInt(t.outcomeIndex, 10);
                                if (!Number.isFinite(r)) return;
                                for (let [, t] of e.getQueriesData({
                                        predicate: e => e.queryKey[0] === k.QueryKey.Positions
                                    }))
                                    if (t) {
                                        if (Array.isArray(t)) {
                                            let e = t.find(e => T(e) && e.conditionId.toLowerCase() === d && e.outcomeIndex === r);
                                            if (e && T(e)) return (0, f.formatPartialPositionMarket)(e)
                                        }
                                        if ("object" == typeof t && null !== t && "pages" in t) {
                                            let e = t.pages;
                                            if (!Array.isArray(e)) continue;
                                            for (let t of e) {
                                                if (!Array.isArray(t)) continue;
                                                let e = t.find(e => T(e) && e.conditionId.toLowerCase() === d && e.outcomeIndex === r);
                                                if (e && T(e)) return (0, f.formatPartialPositionMarket)(e)
                                            }
                                        }
                                    }
                            } catch {}
                        })(),
                        _ = h ? .market ? ? u.get(d) ? ? g ? ? v ? ? w;
                    if (w && _ === w && y.logger.info("[useOptimisticPositions] using PositionMarket.id fallback for missing market", {
                            source: s,
                            key: p,
                            conditionId: d,
                            proxyAddress: r,
                            positionOutcomeIndex: t.outcomeIndex,
                            hasExistingEntry: !!h,
                            optimisticCacheSize: n ? .size ? ? 0
                        }), !_) {
                        let a, u = e.getQueriesData({
                                predicate: e => e.queryKey[0] === k.QueryKey.Positions
                            }).length,
                            c = Number.parseInt(t.outcomeIndex, 10),
                            m = (() => {
                                if (!i) return;
                                let e = "string" == typeof i.conditionId ? i.conditionId.toLowerCase() : void 0;
                                if ((!e || e === d) && (!(Number.isFinite(c) && "number" == typeof i.outcomeIndex && Number.isFinite(i.outcomeIndex)) || i.outcomeIndex === c)) return i
                            })(),
                            f = (a = M(t.market), {
                                hasOutcomes: Array.isArray(a ? .outcomes),
                                hasQuestion: "string" == typeof a ? .question,
                                hasSlug: "string" == typeof a ? .slug,
                                hasConditionId: "string" == typeof a ? .conditionId,
                                hasClobTokenIds: Array.isArray(a ? .clobTokenIds)
                            }),
                            S = {
                                source: s,
                                key: p,
                                conditionId: d,
                                proxyAddress: r,
                                positionOutcomeIndex: t.outcomeIndex,
                                positionOutcomeIndexParsed: c,
                                hasExistingEntry: !!h,
                                hasExistingMarket: !!h ? .market,
                                cachedPositionMarketsCount: o ? .length ? ? 0,
                                cachedTrackedMarketsCount: l ? .length ? ? 0,
                                optimisticCacheSize: n ? .size ? ? 0,
                                positionsQueryCount: u,
                                transactionMeta: m,
                                hasMarketFromPosition: !!g,
                                hasMarketFromPositionsCache: !!v,
                                positionMarketShape: f
                            };
                        console.warn("[useOptimisticPositions] market not preseeded", { ...S
                        }), y.logger.warn("[useOptimisticPositions] missing market for optimistic update", { ...S
                        });
                        return
                    }
                    h ? .isDirty && h ? .position && m(h.position, t) || a.set(p, {
                        isDirty: !0,
                        updatedAt: Date.now(),
                        position: t,
                        market: _
                    })
                }), a
            })
        },
        I = ({
            queryClient: e,
            partialPositionMarket: t,
            proxyAddress: r
        }) => {
            if (!r) return;
            let s = g.queryKeys[k.QueryKey.Positions].optimistic(r).queryKey;
            e.setQueryData(s, e => {
                let r = new Map(e);
                return ["0", "1"].forEach(s => {
                    let i = S({
                        conditionId: t.conditionId,
                        outcomeIndex: s
                    });
                    e ? .has(i) || r.set(i, {
                        isDirty: !0,
                        updatedAt: Date.now(),
                        position: void 0,
                        market: t
                    })
                }), r
            })
        },
        x = async ({
            queryClient: e,
            positionDbItems: t,
            proxyAddress: s
        }) => {
            if (!s) return;
            let i = g.queryKeys[k.QueryKey.Positions].optimistic(s).queryKey;
            await e.cancelQueries({
                queryKey: i
            }), e.setQueryData(i, e => {
                let i = Date.now(),
                    n = i - 6e4,
                    a = new Map(e ? ? []),
                    o = new Set;
                return t.forEach(t => {
                    let l = (0, f.formatTrackedMarketPosition)(t),
                        u = (0, f.formatPartialPositionMarket)(t),
                        c = Number.isFinite(t.size) ? t.size : 0,
                        d = Number.isFinite(t.avgPrice) ? t.avgPrice : 0,
                        p = Number.isFinite(t.totalBought) ? t.totalBought : 0,
                        h = c > 0 && (d <= 0 || p <= 0),
                        m = S({
                            conditionId: l.market.id,
                            outcomeIndex: l.outcomeIndex
                        });
                    o.add(m);
                    let g = e ? .get(m),
                        k = (() => {
                            if (!g ? .position) return !1;
                            let {
                                position: e
                            } = g, t = e.trackedPositionMetadata ? .valueBought ? .optimistic, r = e.trackedPositionMetadata ? .totalValueBought ? .optimistic;
                            return w(e.valueBought) || w(e.totalValueBought) || "number" == typeof t && Number.isFinite(t) && t > 0 || "number" == typeof r && Number.isFinite(r) && r > 0
                        })();
                    if (g ? .position && h && k) {
                        let e = g.position.trackedPositionMetadata,
                            t = v(e ? .netQuantity ? .optimistic),
                            r = v(e ? .quantityBought ? .optimistic),
                            n = v(e ? .totalQuantityBought ? .optimistic),
                            o = t - c,
                            h = Math.max(r - c, 0),
                            f = Math.max(n - c, 0),
                            k = e ? { ...e,
                                quantityBought: { ...e.quantityBought,
                                    current: c,
                                    pending: h,
                                    optimistic: c + h
                                },
                                totalQuantityBought: { ...e.totalQuantityBought,
                                    current: c,
                                    pending: f,
                                    optimistic: c + f
                                },
                                netQuantity: { ...e.netQuantity,
                                    current: c,
                                    pending: o,
                                    optimistic: c + o
                                }
                            } : void 0,
                            S = g.position.valueBought,
                            w = g.position.totalValueBought,
                            _ = { ...l,
                                ..."string" == typeof S && "0" !== S && {
                                    valueBought: S,
                                    netValue: S
                                },
                                ..."string" == typeof w && "0" !== w && {
                                    totalValueBought: w
                                },
                                ...k && {
                                    trackedPositionMetadata: k
                                }
                            };
                        y.logger.warn("[useOptimisticPositions] ignoring incomplete server cost basis", {
                            proxyAddress: s,
                            key: m,
                            conditionId: l.market.id,
                            outcomeIndex: l.outcomeIndex,
                            server: {
                                size: c,
                                avgPrice: d,
                                totalBought: p
                            },
                            optimistic: {
                                isDirty: g.isDirty,
                                updatedAt: g.updatedAt,
                                valueBought: g.position.valueBought,
                                totalValueBought: g.position.totalValueBought,
                                trackedValueBought: g.position.trackedPositionMetadata ? .valueBought,
                                trackedTotalValueBought: g.position.trackedPositionMetadata ? .totalValueBought
                            }
                        }), a.set(m, {
                            isDirty: !0,
                            updatedAt: i,
                            position: _,
                            market: u
                        });
                        return
                    }
                    let _ = Number.isFinite(t.size) && t.size > 0 && (!Number.isFinite(t.avgPrice) || 0 === t.avgPrice),
                        b = g ? .position ? .valueBought,
                        M = g ? .position ? .totalValueBought,
                        T = _ && "string" == typeof b && "0" !== b,
                        A = _ && "string" == typeof M && "0" !== M,
                        I = T || A ? { ...l,
                            ...T && {
                                valueBought: b,
                                netValue: b
                            },
                            ...A && {
                                totalValueBought: M
                            },
                            ...g ? .position ? .trackedPositionMetadata && {
                                trackedPositionMetadata: g.position.trackedPositionMetadata
                            }
                        } : l,
                        x = Number.isFinite(t.size) && t.size > 0 && Number.isFinite(t.avgPrice) && t.avgPrice > 0 && g ? .position ? .trackedPositionMetadata,
                        D = (() => {
                            if (!x) return I;
                            let e = g ? .position ? .trackedPositionMetadata;
                            if (!e) return I;
                            let r = t.size,
                                s = Number.isFinite(t.totalBought) ? t.totalBought : t.size,
                                i = r * t.avgPrice,
                                n = s * t.avgPrice,
                                a = Math.max(v(e.quantityBought ? .optimistic) - r, 0),
                                o = Math.max(v(e.totalQuantityBought ? .optimistic) - s, 0),
                                l = v(e.netQuantity ? .optimistic) - r,
                                u = Math.max(v(e.valueBought ? .optimistic) - i, 0),
                                c = Math.max(v(e.totalValueBought ? .optimistic) - n, 0),
                                d = { ...e,
                                    quantityBought: { ...e.quantityBought,
                                        current: r,
                                        pending: a,
                                        optimistic: r + a
                                    },
                                    totalQuantityBought: { ...e.totalQuantityBought,
                                        current: s,
                                        pending: o,
                                        optimistic: s + o
                                    },
                                    netQuantity: { ...e.netQuantity,
                                        current: r,
                                        pending: l,
                                        optimistic: r + l
                                    },
                                    valueBought: { ...e.valueBought,
                                        current: i,
                                        pending: u,
                                        optimistic: i + u
                                    },
                                    totalValueBought: { ...e.totalValueBought,
                                        current: n,
                                        pending: c,
                                        optimistic: n + c
                                    }
                                };
                            return { ...I,
                                trackedPositionMetadata: d
                            }
                        })();
                    if (g ? .isDirty) {
                        var C;
                        let e = (e => {
                                let t = e ? .trackedPositionMetadata ? .netQuantity ? .optimistic;
                                if ("number" == typeof t && Number.isFinite(t)) return Math.max(t, 0);
                                if (e ? .netQuantity) try {
                                    let t = Number.parseFloat((0, r.formatUSDCUnits)(BigInt(e.netQuantity)));
                                    return Number.isFinite(t) ? t : void 0
                                } catch {
                                    return
                                }
                            })(g.position),
                            s = (C = Number.isFinite(t.size) ? t.size : void 0, "number" == typeof C && !!Number.isFinite(C) && "number" == typeof e && !!Number.isFinite(e) && .1 >= Math.abs(C - e)),
                            o = D.trackedPositionMetadata ? .netQuantity ? .pending,
                            l = "number" == typeof o && Number.isFinite(o) && Math.abs(o) > .01;
                        return s && !l || g.updatedAt <= n ? void a.set(m, {
                            isDirty: !1,
                            updatedAt: i,
                            position: D,
                            market: u
                        }) : void a.set(m, { ...g,
                            market: u
                        })
                    }
                    g && g.isDirty || a.set(m, {
                        isDirty: !1,
                        updatedAt: i,
                        position: D,
                        market: u
                    })
                }), e && e.forEach((e, t) => {
                    e.isDirty && !o.has(t) && e.updatedAt <= n && a.delete(t)
                }), a
            })
        },
        D = async ({
            queryClient: e,
            positionPrice: t,
            proxyAddress: r
        }) => {
            if (!r) return;
            let s = g.queryKeys[k.QueryKey.Positions].optimistic(r).queryKey;
            await e.cancelQueries({
                queryKey: s
            }), e.setQueryData(s, e => {
                if (!e) return e;
                let r = Array.from(e ? .values()).find(e => {
                    let r = e.market.clobTokenIds ? .indexOf(t.clobTokenId);
                    return -1 !== r && e ? .position ? .outcomeIndex === String(r)
                });
                if (!r) return e;
                let s = r.position,
                    i = s.latestPrices ? ? s.market.outcomeTokenPrices.map(e => parseFloat(e)),
                    n = ["0" === s.outcomeIndex ? parseFloat(t.newPrice.price) : i[0], "1" === s.outcomeIndex ? parseFloat(t.newPrice.price) : i[1]],
                    a = new Map(e);
                return a.set(S({
                    conditionId: s.market.id,
                    outcomeIndex: s.outcomeIndex
                }), {
                    isDirty: !0,
                    updatedAt: Date.now(),
                    position: { ...s,
                        latestPrices: n
                    },
                    market: r.market
                }), a
            })
        };
    async function C(e) {}
    async function E(e) {}
    async function P(e) {}
    async function F(e) {}

    function L(e, t) {
        if (!e) return t;
        if (!(e instanceof Map) || !(t instanceof Map)) return (0, l.replaceEqualDeep)(e, t);
        let r = Array.from(e.keys()),
            s = Array.from(t.keys());
        return r.length !== s.length || s.some(r => !e.has(r) || e.get(r) ? .updatedAt !== t.get(r) ? .updatedAt) ? t : e
    }
    e.s(["default", 0, function(e) {
        let t, r, s, i, n, a, l, h, m, f, y, S, w, v, M, T, B = (0, o.c)(46),
            {
                proxyAddress: O,
                select: H
            } = e,
            N = (0, d.useQueryClient)();
        B[0] !== O ? (t = g.queryKeys[k.QueryKey.Positions].optimistic(O ? ? ""), B[0] = O, B[1] = t) : t = B[1];
        let R = t.queryKey;
        B[2] !== O ? (r = () => b(O), B[2] = O, B[3] = r) : r = B[3];
        let W = !!O;
        B[4] !== R || B[5] !== H || B[6] !== r || B[7] !== W ? (s = {
            queryKey: R,
            queryFn: r,
            enabled: W,
            gcTime: 1 / 0,
            staleTime: 1 / 0,
            refetchOnReconnect: !1,
            refetchOnWindowFocus: !1,
            select: H,
            structuralSharing: L
        }, B[4] = R, B[5] = H, B[6] = r, B[7] = W, B[8] = s) : s = B[8];
        let {
            data: z
        } = (0, c.useQuery)(s);
        B[9] !== z || B[10] !== R || B[11] !== O || B[12] !== N ? (i = () => {
            if (!O || void 0 === z) return;
            let e = N.getQueryData(R);
            e instanceof Map && ((e, t) => {
                if (e) try {
                    if (!t || 0 === t.size) return void window.localStorage.removeItem(_(e));
                    let r = Array.from(t.entries()).filter(([, e]) => e.isDirty),
                        s = _(e);
                    if (!r.length) return void window.localStorage.removeItem(s);
                    let i = JSON.stringify(r.sort(([e], [t]) => e.localeCompare(t)));
                    if (window.localStorage.getItem(s) === i) return;
                    window.localStorage.setItem(s, i)
                } catch {}
            })(O, e)
        }, n = [z, O, N, R], B[9] = z, B[10] = R, B[11] = O, B[12] = N, B[13] = i, B[14] = n) : (i = B[13], n = B[14]), (0, p.useEffect)(i, n), B[15] !== R || B[16] !== O || B[17] !== N ? (a = () => {
            if (!O) return;
            let e = _(O),
                t = t => {
                    if (t.key !== e) return;
                    let r = b(O);
                    N.setQueryData(R, e => (({
                        prev: e,
                        stored: t
                    }) => {
                        if (!e) return t.size ? new Map(t) : e;
                        let r = new Map(e),
                            s = !1,
                            i = new Set(t.keys()),
                            n = Array.from(t.values()).reduce((e, t) => t.updatedAt > e ? t.updatedAt : e, 0);
                        return e.forEach((e, t) => {
                            !e.isDirty || i.has(t) || e.updatedAt > n || (r.delete(t), s = !0)
                        }), t.forEach((e, t) => {
                            let i = r.get(t);
                            if (!i) {
                                r.set(t, e), s = !0;
                                return
                            }
                            i.updatedAt >= e.updatedAt || (r.set(t, e), s = !0)
                        }), s ? r : e
                    })({
                        prev: e,
                        stored: r
                    }))
                };
            return window.addEventListener("storage", t), () => window.removeEventListener("storage", t)
        }, l = [O, N, R], B[15] = R, B[16] = O, B[17] = N, B[18] = a, B[19] = l) : (a = B[18], l = B[19]), (0, p.useEffect)(a, l), B[20] !== O || B[21] !== N ? (h = e => x({
            queryClient: N,
            proxyAddress: O,
            positionDbItems: e
        }), B[20] = O, B[21] = N, B[22] = h) : h = B[22];
        let $ = h;
        B[23] !== $ ? (m = {
            retry: !1,
            mutationFn: F,
            onMutate: $
        }, B[23] = $, B[24] = m) : m = B[24];
        let {
            mutate: q
        } = (0, u.useMutation)(m);
        B[25] !== O || B[26] !== N ? (f = e => D({
            queryClient: N,
            positionPrice: e,
            proxyAddress: O
        }), B[25] = O, B[26] = N, B[27] = f) : f = B[27];
        let j = f;
        B[28] !== j ? (y = {
            retry: !1,
            mutationFn: P,
            onMutate: j
        }, B[28] = j, B[29] = y) : y = B[29];
        let {
            mutate: U
        } = (0, u.useMutation)(y);
        B[30] !== O || B[31] !== N ? (S = e => A({
            queryClient: N,
            positions: e,
            proxyAddress: O,
            source: "useOptimisticPositions.mutate"
        }), B[30] = O, B[31] = N, B[32] = S) : S = B[32];
        let V = S;
        B[33] !== V ? (w = {
            retry: !1,
            mutationFn: E,
            onMutate: V
        }, B[33] = V, B[34] = w) : w = B[34];
        let {
            mutate: K
        } = (0, u.useMutation)(w);
        B[35] !== O || B[36] !== N ? (v = e => I({
            queryClient: N,
            partialPositionMarket: e,
            proxyAddress: O
        }), B[35] = O, B[36] = N, B[37] = v) : v = B[37];
        let Q = v;
        B[38] !== Q ? (M = {
            retry: !1,
            mutationFn: C,
            onMutate: Q
        }, B[38] = Q, B[39] = M) : M = B[39];
        let {
            mutateAsync: G
        } = (0, u.useMutation)(M);
        return B[40] !== z || B[41] !== G || B[42] !== U || B[43] !== K || B[44] !== q ? (T = {
            optimisticPositions: z,
            upsertPositionDbItems: q,
            syncPositionPrices: U,
            updateOptimisticPositions: K,
            addPartialPositionMarket: G
        }, B[40] = z, B[41] = G, B[42] = U, B[43] = K, B[44] = q, B[45] = T) : T = B[45], T
    }, "getConditionIdsSelector", 0, function(e) {
        return t => e.flatMap(e => [S({
            conditionId: e,
            outcomeIndex: "0"
        }), S({
            conditionId: e,
            outcomeIndex: "1"
        })]).reduce((e, r) => {
            let s = t.get(r);
            return s && e.set(r, s), e
        }, new Map)
    }, "getOptimisticPositions", 0, function({
        queryClient: e,
        proxyAddress: t,
        select: r
    }) {
        if (!t) return;
        let s = e.getQueryData(g.queryKeys[k.QueryKey.Positions].optimistic(t).queryKey);
        return s ? r(s) : void 0
    }, "getPartialPositionMarketSelector", 0, function(e) {
        return t => Array.from(t.values()).reduce((t, r) => (r.market && (e ? "conditionId" in e ? r.market.conditionId === e.conditionId && t.push(r.market) : "tokenId" in e && (r.market.clobTokenIds ? ? []).includes(e.tokenId) && t.push(r.market) : t.push(r.market)), t), [])
    }, "getTrackedMarketPositionSelector", 0, function(e, t) {
        return r => r.get(S({
            conditionId: e,
            outcomeIndex: t
        })) ? .position
    }, "getTrackedMarketPositionsSelector", 0, function(e) {
        return t => e ? [S({
            conditionId: e,
            outcomeIndex: "0"
        }), S({
            conditionId: e,
            outcomeIndex: "1"
        })].reduce((e, r) => {
            let s = t.get(r);
            return s ? .position && e.push(s.position), e
        }, []) : Array.from(t.values()).reduce((e, t) => (t.position && e.push(t.position), e), [])
    }, "makeOptimisticPositionKey", 0, S, "optimisticPositionConditionIdsSelector", 0, function(e) {
        let t = new Set;
        return e.forEach(e => {
            let r = e.market ? .conditionId;
            r && t.add(r)
        }), Array.from(t)
    }, "pendingTrackedMarketPositionCountSelector", 0, function(e) {
        let t = 0;
        return e.forEach(e => {
            e.position ? .isPending && (t += 1)
        }), t
    }, "renderPositionsToUI", 0, ({
        basePositions: e,
        optimisticPositions: t,
        appendOptimisticMissing: r = !0
    }) => {
        if (!t || !t.size) return e;
        let s = Date.now(),
            i = new Set,
            n = e.map(e => {
                let r = S({
                    conditionId: e.market.id,
                    outcomeIndex: e.outcomeIndex
                });
                i.add(r);
                let n = t.get(r);
                return (!(n ? .isDirty && s - n.updatedAt > 6e4) && n ? .isDirty ? n.position : void 0) ? ? e
            });
        return r && t.forEach((e, t) => {
            i.has(t) || !(e.isDirty && s - e.updatedAt > 6e4) && e.position && e.position && n.push(e.position)
        }), n
    }, "seedPartialPositionMarket", 0, I, "updateOptimisticPositions", 0, A], 502475)
}, 93641, 982032, e => {
    "use strict";
    var t = e.i(871859),
        r = e.i(376327),
        s = e.i(150379),
        i = e.i(682832),
        n = e.i(556800);
    let a = function(e, t, a) {
        if (!(0, n.default)(a)) return !1;
        var o = typeof t;
        return ("number" == o ? !!((0, s.default)(a) && (0, i.default)(t, a.length)) : "string" == o && t in a) && (0, r.default)(a[t], e)
    };
    var o = e.i(844732),
        l = 1 / 0;
    let u = function(e) {
        var t, r = (t = e) ? (t = (0, o.default)(t)) === l || t === -l ? (t < 0 ? -1 : 1) * 17976931348623157e292 : t == t ? t : 0 : 0 === t ? t : 0,
            s = r % 1;
        return r == r ? s ? r - s : r : 0
    };
    e.s(["default", 0, u], 982032);
    var c = Math.ceil,
        d = Math.max;
    e.s(["chunk", 0, function(e, r, s) {
        r = (s ? a(e, r, s) : void 0 === r) ? 1 : d(u(r), 0);
        var i = null == e ? 0 : e.length;
        if (!i || r < 1) return [];
        for (var n = 0, o = 0, l = Array(c(i / r)); n < i;) l[o++] = (0, t.default)(e, n, n += r);
        return l
    }], 93641)
}, 116003, e => {
    "use strict";
    var t = e.i(122538),
        r = e.i(964974),
        s = e.i(93641),
        i = e.i(416340),
        n = e.i(778983),
        a = e.i(344558),
        o = e.i(510954),
        l = e.i(57096),
        u = e.i(655740),
        c = e.i(631222),
        d = e.i(502475);
    let p = async e => {
        let {
            proxyAddress: t,
            ids: r,
            idType: i
        } = (e => {
            let [t, r, s, i, n] = e;
            return {
                proxyAddress: s,
                idType: i,
                ids: JSON.parse(n)
            }
        })(e.queryKey), n = "conditionId" === i ? 20 : 100;
        if (a.EXCLUDED_WALLETS.has(t)) return [];
        if (r.length > n) {
            let e = (0, s.chunk)(r, n);
            return (await Promise.all(e.map(async e => {
                let {
                    data: r
                } = await u.axios.get(`${c.DATA_API}/positions?${new URLSearchParams({user:t,sizeThreshold:".1",["conditionId"===i?"market":"eventId"]:e.join(","),limit:"200"})}`);
                return r
            }))).flat()
        }
        let {
            data: o
        } = await u.axios.get(`${c.DATA_API}/positions?${new URLSearchParams({user:t,sizeThreshold:".1",["conditionId"===i?"market":"eventId"]:r.join(","),limit:"200"})}`);
        return o
    };
    e.s(["default", 0, ({
        proxyAddress: e,
        eventIds: s,
        conditionIds: a,
        refetchInterval: u = 4e3
    }) => {
        let c = (0, i.useMemo)(() => (0, d.getConditionIdsSelector)(a), [a]),
            {
                optimisticPositions: h,
                upsertPositionDbItems: m,
                updateOptimisticPositions: f
            } = (0, d.default)({
                proxyAddress: e,
                select: c
            }),
            g = i.default.useMemo(() => {
                let t = Array.isArray(s) && s.filter(Boolean).length > 0,
                    r = t ? s : a;
                return o.queryKeys[l.QueryKey.Positions].byIds(e ? ? "", t ? "eventId" : "conditionId", r.sort())
            }, [a, s, e]),
            {
                data: k,
                refetch: y,
                isPending: S,
                isLoading: w,
                isFetching: v
            } = (0, r.useQuery)({
                queryKey: g.queryKey,
                enabled: !!e && (Array.isArray(s) && s.filter(Boolean).length > 0 || a.length > 0),
                queryFn: p,
                refetchOnReconnect: !0,
                refetchOnWindowFocus: !0,
                refetchInterval: u,
                refetchIntervalInBackground: !1,
                gcTime: 6e4,
                staleTime: 15e3,
                placeholderData: t.keepPreviousData
            }),
            _ = (0, i.useRef)(null),
            b = (0, i.useRef)(0);
        (0, i.useEffect)(() => {
            _.current = null, b.current = 0
        }, [e]), (0, i.useEffect)(() => {
            Array.isArray(k) && k.length > 0 && (_.current = k, b.current = Date.now())
        }, [k]);
        let M = (0, i.useMemo)(() => {
            if (Array.isArray(k) && 0 === k.length) {
                let e = Date.now() - b.current;
                if (_.current && e < 2e4) return _.current
            }
            return k
        }, [k]);
        (0, i.useEffect)(() => {
            k && m(k)
        }, [k, m]);
        let T = (0, i.useMemo)(() => {
                let t = (M ? ? []).map(e => (0, n.formatTrackedMarketPosition)(e));
                if (M || h && h.size) return (0, d.renderPositionsToUI)({
                    basePositions: t,
                    optimisticPositions: h,
                    source: "usePositions",
                    proxyAddress: e
                })
            }, [M, h, e]),
            A = (0, i.useCallback)((e, t = !1) => {
                f(e)
            }, [f]);
        return {
            queryKey: g,
            positions: T,
            refetch: (0, i.useCallback)(async e => {
                await y(e)
            }, [y]),
            isPending: S,
            isLoading: w,
            isFetching: v,
            updatePositions: A
        }
    }])
}, 399336, 269101, 987222, 562806, 847979, 162923, 891685, e => {
    "use strict";
    e.s(["EventActiveMarketContextProvider", () => eD, "useEventActiveMarket", () => eP, "useEventActiveMarketContext", () => eC, "useEventActiveMarketContextValue", () => eE], 399336);
    var t = e.i(221628),
        r = e.i(999061),
        s = e.i(970863);
    e.i(304697);
    var i = e.i(179645),
        n = e.i(491636),
        a = e.i(711960),
        o = e.i(416340),
        l = e.i(635868),
        u = e.i(459225),
        c = e.i(866192);
    e.s(["EventContextProvider", () => eT, "useEventContext", () => eA], 891685);
    var d = e.i(525962),
        p = e.i(328113),
        h = e.i(101008),
        m = e.i(514687),
        f = e.i(827681),
        g = e.i(863828),
        k = e.i(784521),
        y = e.i(400819);
    e.s(["EventPositionsContextProvider", () => M, "useEventPositionsContext", () => T], 269101);
    var S = e.i(502475),
        w = e.i(116003),
        v = e.i(336593),
        _ = e.i(354712);
    let b = (0, _.createSplitContext)("EventPositionsContext", {
            positions: void 0,
            refetchPositions: () => {
                throw Error("EventPositionsContext must export  `refetchMarketPositions` function")
            },
            updatePositions: () => {
                throw Error("EventPositionsContext must export  `updatePositions` function")
            },
            isPending: !1,
            isLoading: !1,
            isFetching: !1
        }),
        M = e => {
            let s, i, n, a, l, u, c, d, p, h, m, f, g, y, _, M, T, x, E = (0, r.c)(54),
                {
                    children: P
                } = e;
            E[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["proxyAddress"], E[0] = s) : s = E[0];
            let {
                proxyAddress: F
            } = (0, k.useAccountContext)(s);
            E[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["event", "events"], E[1] = i) : i = E[1];
            let {
                event: L,
                events: B
            } = eA(i), O = (0, v.useParentToChildEventIds)();
            if (E[2] !== L || E[3] !== B || E[4] !== O) {
                let e = B && B.length > 0 ? B.map(A) : [L.id],
                    t = B && B.length > 0 ? B.map(I) : [L.slug],
                    r = [];
                O && t.forEach(e => {
                    let t = O[e];
                    t && r.push(...t)
                }), n = [...e, ...r], E[2] = L, E[3] = B, E[4] = O, E[5] = n
            } else n = E[5];
            let H = n;
            E[6] !== L || E[7] !== B ? (a = B && B.length > 0 ? B.flatMap(D) : L.markets.map(C), E[6] = L, E[7] = B, E[8] = a) : a = E[8];
            let N = a;
            E[9] !== F ? (l = {
                proxyAddress: F,
                select: S.optimisticPositionConditionIdsSelector
            }, E[9] = F, E[10] = l) : l = E[10];
            let {
                optimisticPositions: R
            } = (0, S.default)(l);
            E[11] !== N ? (u = new Set(N), E[11] = N, E[12] = u) : u = E[12];
            let W = u;
            if (E[13] !== R ? (c = R ? ? [], E[13] = R, E[14] = c) : c = E[14], E[15] !== W || E[16] !== c) {
                let e;
                E[18] !== W ? (e = e => !W.has(e), E[18] = W, E[19] = e) : e = E[19], d = c.filter(e), E[15] = W, E[16] = c, E[17] = d
            } else d = E[17];
            let z = d;
            E[20] !== N || E[21] !== H || E[22] !== F ? (p = {
                proxyAddress: F,
                eventIds: H,
                conditionIds: N,
                refetchInterval: !1
            }, E[20] = N, E[21] = H, E[22] = F, E[23] = p) : p = E[23];
            let {
                positions: $,
                refetch: q,
                updatePositions: j,
                isPending: U,
                isLoading: V,
                isFetching: K
            } = (0, w.default)(p);
            E[24] !== F || E[25] !== z ? (h = {
                proxyAddress: F,
                eventIds: void 0,
                conditionIds: z,
                refetchInterval: !1
            }, E[24] = F, E[25] = z, E[26] = h) : h = E[26];
            let {
                positions: Q,
                refetch: G,
                updatePositions: Y,
                isPending: X,
                isLoading: J,
                isFetching: Z
            } = (0, w.default)(h);
            e: {
                let e, t, r;
                if (!$ && !Q) {
                    m = void 0;
                    break e
                }
                E[27] !== $ ? (e = $ ? ? [], E[27] = $, E[28] = e) : e = E[28],
                E[29] !== Q ? (t = Q ? ? [], E[29] = Q, E[30] = t) : t = E[30],
                E[31] !== e || E[32] !== t ? (r = [...e, ...t], E[31] = e, E[32] = t, E[33] = r) : r = E[33],
                m = r
            }
            let ee = m,
                et = U || X,
                er = V || J,
                es = K || Z;
            E[34] !== q || E[35] !== G ? (f = async e => {
                await Promise.all([q(e), G(e)])
            }, E[34] = q, E[35] = G, E[36] = f) : f = E[36];
            let ei = f;
            E[37] !== j || E[38] !== Y ? (g = (e, t) => {
                j(e, t), Y(e, t)
            }, E[37] = j, E[38] = Y, E[39] = g) : g = E[39];
            let en = g,
                ea = (0, o.useRef)(null);
            E[40] !== ei ? (y = async (e, t) => {
                let r = void 0 === t ? 0 : t;
                r ? (ea.current && clearTimeout(ea.current), ea.current = setTimeout(() => ei(e), r)) : ei(e)
            }, E[40] = ei, E[41] = y) : y = E[41];
            let eo = y;
            E[42] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => () => {
                ea.current && clearTimeout(ea.current)
            }, M = [], E[42] = _, E[43] = M) : (_ = E[42], M = E[43]), (0, o.useEffect)(_, M), E[44] !== es || E[45] !== er || E[46] !== et || E[47] !== ee || E[48] !== eo || E[49] !== en ? (T = {
                positions: ee,
                refetchPositions: eo,
                updatePositions: en,
                isPending: et,
                isLoading: er,
                isFetching: es
            }, E[44] = es, E[45] = er, E[46] = et, E[47] = ee, E[48] = eo, E[49] = en, E[50] = T) : T = E[50];
            let el = T;
            return E[51] !== P || E[52] !== el ? (x = (0, t.jsx)(b.Provider, {
                values: el,
                children: P
            }), E[51] = P, E[52] = el, E[53] = x) : x = E[53], x
        },
        T = e => (0, _.useSplitContext)(b, e);

    function A(e) {
        return e.id
    }

    function I(e) {
        return e.slug
    }

    function x(e) {
        return e.conditionId
    }

    function D(e) {
        return e.markets.map(x)
    }

    function C(e) {
        return e.conditionId
    }
    var E = e.i(684686),
        P = e.i(730474),
        F = e.i(799471);
    let L = () => {
        let e, s, i, n, a, l, u = (0, r.c)(32),
            {
                showApprovalModal: c,
                setShowApprovalModal: S
            } = (0, P.useModalStore)(),
            {
                route: w
            } = (0, g.useSiwx)(),
            {
                clob: v
            } = (0, y.useClobCredentialContext)();
        u[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticationType", "walletMode", "authenticated", "proxyAddress", "closedDynamic", "isMigrationActive"], u[0] = e) : e = u[0];
        let {
            authenticationType: _,
            walletMode: b,
            authenticated: M,
            proxyAddress: A,
            closedDynamic: I,
            isMigrationActive: x
        } = (0, k.useAccountContext)(e);
        u[1] === Symbol.for("react.memo_cache_sentinel") ? (s = ["positions"], u[1] = s) : s = u[1];
        let {
            positions: D
        } = T(s), C = (0, E.useGeoStore)(B), L = (0, E.useGeoStore)(O);
        u[2] !== I || u[3] !== L || u[4] !== A ? (i = (0, F.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(A, L, I), u[2] = I, u[3] = L, u[4] = A, u[5] = i) : i = u[5];
        let H = i,
            N = (0, p.useLatest)(v),
            R = !!D;
        return u[6] !== M || u[7] !== _ || u[8] !== N || u[9] !== C || u[10] !== R || u[11] !== x || u[12] !== H || u[13] !== D || u[14] !== w || u[15] !== S || u[16] !== b ? (n = () => {
            let e;
            return w === f.AuthRoute.ONBOARDING ? void S(!1) : (M && R && !x && (e = setTimeout(() => {
                C && "magic" !== _ && (H.canApprove && H.canCreateApiKey || D.length) && (0, h.mustGenerateApiKeys)(N.current, b) && S(!0)
            }, 2e3)), () => clearTimeout(e))
        }, u[6] = M, u[7] = _, u[8] = N, u[9] = C, u[10] = R, u[11] = x, u[12] = H, u[13] = D, u[14] = w, u[15] = S, u[16] = b, u[17] = n) : n = u[17], u[18] !== M || u[19] !== _ || u[20] !== N || u[21] !== C || u[22] !== R || u[23] !== x || u[24] !== H || u[25] !== w || u[26] !== S || u[27] !== b ? (a = [M, N, C, _, H, R, x, b, w, S], u[18] = M, u[19] = _, u[20] = N, u[21] = C, u[22] = R, u[23] = x, u[24] = H, u[25] = w, u[26] = S, u[27] = b, u[28] = a) : a = u[28], (0, o.useEffect)(n, a), u[29] !== S || u[30] !== c ? (l = c ? (0, t.jsx)(d.Modal, {
            open: c,
            onOpenChange: S,
            children: (0, t.jsx)(m.default, {})
        }) : null, u[29] = S, u[30] = c, u[31] = l) : l = u[31], l
    };

    function B(e) {
        return e.hasFetchedLocation
    }

    function O(e) {
        return e.permissions
    }
    var H = e.i(206617);
    let N = /-up(?:-or-down|down)(?:-|$)/i,
        R = /-up(?:-or-down|down)-15m-\d+$/i,
        W = /-up(?:-or-down|down)-5m-\d+$/i,
        z = /-up(?:-or-down|down)-(?:5m|15m)-\d+$/i,
        $ = /-up(?:-or-down|down)-\w+-\d+-\d{4}-\d{1,2}(?:am|pm)-et$/i,
        q = /-up(?:-or-down|down)-4h-\d+$/i,
        j = /-up-or-down-on-[a-z]+-\d+(?:-\d{4})?$/i,
        U = e => !!e && R.test(e.toLowerCase()),
        V = e => !!e && W.test(e.toLowerCase()),
        K = e => !!e && q.test(e.toLowerCase()),
        Q = e => [`${e}-up-or-down`, `${e}-updown`],
        G = e => e.replace(/-updown\b/i, "-up-or-down"),
        Y = e => /-updown/i.test(e) ? "updown" : "up-or-down";
    e.s(["FIFTEEN_MINUTE_UP_DOWN_SUFFIX", 0, R, "FOUR_HOUR_UP_DOWN_SUFFIX", 0, q, "getUpDownPatternVariants", 0, Q, "getUpDownVariantFromPattern", 0, Y, "isUpDownSlug", 0, e => !!e && N.test(e.toLowerCase()), "matchesDailyUpDown", 0, e => !!e && j.test(e.toLowerCase()), "matchesFifteenMinuteUpDown", 0, U, "matchesFiveMinuteUpDown", 0, V, "matchesFourHourUpDown", 0, K, "matchesHourlyUpDown", 0, e => !!e && $.test(e.toLowerCase()), "matchesShortDurationUpDown", 0, e => !!e && z.test(e.toLowerCase()), "toCanonicalUpDownPattern", 0, G], 987222);
    let X = ["presidential-election-winner-2028", "republican-presidential-nominee-2028", "democratic-presidential-nominee-2028", "which-party-wins-2028-us-presidential-election"],
        J = {
            bitcoin: {
                displayName: "Bitcoin",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/BTC+fullsize.png",
                decimalPlaces: 2
            },
            ethereum: {
                displayName: "Ethereum",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/ETH+fullsize.jpg",
                decimalPlaces: 2
            },
            solana: {
                displayName: "Solana",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/SOL+fullsize.png",
                decimalPlaces: 2
            },
            xrp: {
                displayName: "XRP",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/XRP+fullsize.PNG",
                decimalPlaces: 4
            },
            dogecoin: {
                displayName: "Dogecoin",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/dogecoin-9ae840dfa3.png",
                decimalPlaces: 4
            },
            hype: {
                displayName: "Hyperliquid",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/hyperliquid-16f0eafaeb.png",
                decimalPlaces: 4
            },
            bnb: {
                displayName: "BNB",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/bnb%20logo-247a9f7a39.png",
                decimalPlaces: 4
            }
        },
        Z = {
            "up-or-down": ["bitcoin", "ethereum", "xrp", "solana", "dogecoin", "hype", "bnb"],
            price: ["bitcoin", "ethereum", "solana", "xrp"],
            above: ["bitcoin", "ethereum", "solana", "xrp"],
            "what-price-will-hit": ["bitcoin", "ethereum", "solana", "xrp", "dogecoin"],
            "multistrike-4h": ["bitcoin", "ethereum", "solana", "xrp"]
        },
        ee = {
            above: "Above",
            price: "Price",
            "up-or-down": "Up or Down",
            "what-price-will-hit": "Price Target",
            "multistrike-4h": "Multistrike 4H"
        },
        et = {
            bitcoin: ["bitcoin", "btc"],
            ethereum: ["ethereum", "eth"],
            solana: ["solana", "sol"],
            xrp: ["xrp"],
            dogecoin: ["dogecoin", "doge"],
            hype: ["hype"],
            bnb: ["bnb"]
        },
        er = (e, t, r) => {
            switch (t) {
                case "up-or-down":
                    {
                        let t = r ? .upDownVariant === "updown" ? "updown" : "up-or-down";
                        return `${e}-${t}`
                    }
                case "price":
                    return `${e}-price`;
                case "above":
                    return `${e}-above`;
                case "what-price-will-hit":
                    return `what-price-will-${e}-hit`;
                case "multistrike-4h":
                    return `${e}-multistrike-4h`;
                default:
                    return `${e}-${t}`
            }
        },
        es = e => {
            if (!e) return null;
            let t = Object.keys(Z),
                r = Object.keys(J),
                s = t.flatMap(t => r.flatMap(r => et[r].flatMap(s => {
                    let i = er(s, t);
                    return ("up-or-down" === t ? Q(s) : [er(s, t)]).filter(t => e.startsWith(t)).map(e => ({
                        crypto: r,
                        marketType: t,
                        slugPrefix: s,
                        pattern: i,
                        matchedSlugPattern: e
                    }))
                })));
            if (0 === s.length) return null;
            let {
                crypto: i,
                marketType: n,
                pattern: a,
                matchedSlugPattern: o,
                slugPrefix: l
            } = s.sort((e, t) => t.pattern.length - e.pattern.length)[0], u = "up-or-down" === n && /-[0-9]+(am|pm)-et$/.test(e), c = "up-or-down" === n && /-up-or-down-on-/.test(e) && !u, d = "up-or-down" === n && R.test(e), p = "up-or-down" === n && q.test(e), h = "price" === n && /-price-.*-5pm-et/.test(e), m = "up-or-down" === n ? Y(o) : null;
            return {
                crypto: i,
                marketType: n,
                matchedPattern: G(a),
                matchedSlugPattern: o,
                slugPrefix: l,
                decimalPlaces: J[i].decimalPlaces,
                isHourlyUpOrDown: u,
                isDailyUpOrDown: c,
                isFifteenMinuteUpOrDown: d,
                isFourHourUpOrDown: p,
                isDailyBrackets: h,
                upDownSlugVariant: m
            }
        },
        ei = e => {
            let t = es(e);
            if (!t) return [];
            let {
                crypto: r,
                marketType: s,
                matchedPattern: i,
                matchedSlugPattern: n,
                slugPrefix: a,
                isDailyBrackets: o,
                upDownSlugVariant: l
            } = t, u = "";
            if (o) {
                let t = e.match(/-([a-z]+-\d+-5pm-et)$/);
                t && (u = `-${t[1]}`)
            } else if ("multistrike-4h" === s) {
                let t = e.match(/-(\d{10})/);
                t && (u = `-${t[1]}`)
            } else {
                let t = n ? .length ? ? i.length;
                u = e.substring(t)
            }
            if (o && !u) return [];
            let c = t.isFifteenMinuteUpOrDown || t.isFourHourUpOrDown ? ["bitcoin", "ethereum", "solana", "xrp"] : Z[s] || [],
                d = et[r].indexOf(a);
            return c.filter(e => e !== r).map(e => {
                let r, i = et[e];
                r = "up-or-down" === s && "updown" === l && i.length > 1 || "multistrike-4h" === s ? i[1] || i[0] : i[d] || i[0];
                let n = "up-or-down" === s ? er(r, s, {
                    upDownVariant: l ? ? "up-or-down"
                }) : er(r, s);
                return {
                    crypto: e,
                    marketType: s,
                    slug: n + u,
                    decimalPlaces: J[e].decimalPlaces,
                    isHourlyUpOrDown: t.isHourlyUpOrDown,
                    isDailyUpOrDown: t.isDailyUpOrDown,
                    isFifteenMinuteUpOrDown: t.isFifteenMinuteUpOrDown,
                    isFourHourUpOrDown: t.isFourHourUpOrDown,
                    isDailyBrackets: t.isDailyBrackets
                }
            })
        },
        en = e => ee[e],
        ea = e => null !== es(e) || /^(bnb|hype|hyperliquid)-(?:up-or-down|updown)(?:-|$)/.test(e),
        eo = e => {
            let t = es(e);
            if (!t) return null;
            let r = ei(e),
                s = J[t.crypto];
            return {
                currentCrypto: t.crypto,
                currentMarketType: t.marketType,
                currentCryptoDisplay: s.displayName,
                currentMarketTypeDisplay: en(t.marketType),
                currentDecimalPlaces: s.decimalPlaces,
                isHourlyUpOrDown: t.isHourlyUpOrDown,
                isDailyUpOrDown: t.isDailyUpOrDown,
                isFifteenMinuteUpOrDown: t.isFifteenMinuteUpOrDown,
                isFourHourUpOrDown: t.isFourHourUpOrDown,
                isDailyBrackets: t.isDailyBrackets,
                recommendedMarkets: r.map(e => ({
                    slug: e.slug,
                    crypto: e.crypto,
                    cryptoDisplay: J[e.crypto].displayName,
                    marketTypeDisplay: en(e.marketType),
                    decimalPlaces: e.decimalPlaces,
                    logo: J[e.crypto].logo
                }))
            }
        };
    e.s(["CRYPTO_CONFIG", 0, J, "getCleanCryptoTitle", 0, e => {
        let t = es(e);
        if (!t) return null;
        let r = J[t.crypto].displayName,
            s = en(t.marketType);
        return "what-price-will-hit" === t.marketType ? `${r} Price Target` : `${r} ${s}`
    }, "getCryptoMarketSettings", 0, e => {
        let t = es(e);
        return t ? {
            crypto: t.crypto,
            marketType: t.marketType,
            decimalPlaces: t.decimalPlaces,
            shouldShowLockedPrice: t.isHourlyUpOrDown,
            shouldShowDetailedTime: !0,
            timezone: "America/New_York",
            isDailyUpOrDown: t.isDailyUpOrDown,
            isDailyBrackets: t.isDailyBrackets
        } : null
    }, "getMarketDateTimeFromTitle", 0, (e, t) => {
        let r = es(t);
        if (!r || !e) return null;
        let {
            matchedPattern: s
        } = r, i = s.replace(/-/g, " "), n = e.toLowerCase().indexOf(i);
        if (-1 === n) return null;
        let a = e.substring(n + i.length).replace(/^[\s\-–]+/, "").trim();
        return a.toLowerCase().startsWith("on ") && (a = a.substring(3).trim()), a.endsWith("?") && (a = a.slice(0, -1).trim()), a || null
    }, "getRecommendedCryptoMarkets", 0, ei, "getRecommendedPresidentialSlugs", 0, e => X.filter(t => t !== e), "isCryptoMarketSlug", 0, ea, "isPresidentialEventSlug", 0, e => X.includes(e), "shouldHideSeriesPills", 0, e => {
        let t = eo(e);
        return !!(t && (t.isHourlyUpOrDown || t.isDailyUpOrDown || t.isFifteenMinuteUpOrDown || t.isFourHourUpOrDown || t.isDailyBrackets || "multistrike-4h" === t.currentMarketType))
    }, "shouldShowRecommendedPills", 0, e => {
        let t = eo(e);
        return !!(t && (t.isHourlyUpOrDown || t.isDailyUpOrDown || t.isFifteenMinuteUpOrDown || t.isFourHourUpOrDown || t.isDailyBrackets || "multistrike-4h" === t.currentMarketType || "what-price-will-hit" === t.currentMarketType || "above" === t.currentMarketType || "price" === t.currentMarketType))
    }], 562806);
    let el = {
            apple: {
                displayName: "Apple",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/AAPL-713b5653bf.png"
            },
            tesla: {
                displayName: "Tesla",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/TSLA-40a1802b87.png"
            },
            microsoft: {
                displayName: "Microsoft",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/MSFT-cd23e61be3.png"
            },
            google: {
                displayName: "Google",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/GOOGL-7fe0a5d07a.png"
            },
            amazon: {
                displayName: "Amazon",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/AMZN-5006eff817.png"
            },
            meta: {
                displayName: "Meta",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/META-622662a9c8.png"
            },
            nvidia: {
                displayName: "Nvidia",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/NVDA-5ed1aee9b6.png"
            },
            netflix: {
                displayName: "Netflix",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/NFLX-b9e0cf2a1f.png"
            },
            palantir: {
                displayName: "Palantir",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/PLTR-a540a5c546.png"
            },
            opendoor: {
                displayName: "Opendoor",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/OPEN-9be1f20562.png"
            },
            rocketlab: {
                displayName: "Rocket Lab",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/RKLB-ae9189e938.png"
            },
            airbnb: {
                displayName: "Airbnb",
                logo: "https://polymarket-upload.s3.us-east-2.amazonaws.com/ABNB-ec19067f5a.png"
            },
            coinbase: {
                displayName: "Coinbase",
                logo: "https://images.polymarket.com/coinbase-stock-d8abe3f599.png"
            },
            hood: {
                displayName: "Robinhood",
                logo: "https://images.polymarket.com/robinhood-logo-a2555803f0.png"
            },
            qqq: {
                displayName: "QQQ",
                logo: ""
            },
            spy: {
                displayName: "SPY",
                logo: ""
            },
            ewy: {
                displayName: "EWY",
                logo: ""
            },
            vxx: {
                displayName: "VXX",
                logo: ""
            },
            eurusd: {
                displayName: "EUR/USD",
                logo: ""
            },
            gbpusd: {
                displayName: "GBP/USD",
                logo: ""
            },
            usdcad: {
                displayName: "USD/CAD",
                logo: ""
            },
            usdjpy: {
                displayName: "USD/JPY",
                logo: ""
            },
            usdkrw: {
                displayName: "USD/KRW",
                logo: ""
            },
            gold: {
                displayName: "Gold",
                logo: ""
            },
            silver: {
                displayName: "Silver",
                logo: ""
            },
            oil: {
                displayName: "Oil",
                logo: ""
            },
            copper: {
                displayName: "Copper",
                logo: ""
            },
            naturalgas: {
                displayName: "Natural Gas",
                logo: ""
            }
        },
        eu = {
            apple: ["aapl"],
            tesla: ["tsla"],
            microsoft: ["msft"],
            google: ["googl"],
            amazon: ["amzn"],
            meta: ["meta"],
            nvidia: ["nvda"],
            netflix: ["nflx"],
            palantir: ["pltr"],
            opendoor: ["open"],
            rocketlab: ["rklb"],
            airbnb: ["abnb"],
            coinbase: ["coin"],
            hood: ["hood"],
            qqq: ["qqq"],
            spy: ["spy"],
            ewy: ["ewy"],
            vxx: ["vxx"],
            eurusd: ["eurusd"],
            gbpusd: ["gbpusd"],
            usdcad: ["usdcad"],
            usdjpy: ["usdjpy"],
            usdkrw: ["usdkrw"],
            gold: ["xauusd"],
            silver: ["xagusd"],
            oil: ["wti"],
            copper: [],
            naturalgas: ["ng"]
        },
        ec = {
            "up-or-down": ["apple", "tesla", "microsoft", "google", "amazon", "meta", "nvidia", "netflix", "palantir", "opendoor", "rocketlab", "airbnb", "coinbase", "hood", "qqq", "spy", "ewy", "vxx"]
        },
        ed = {
            "up-or-down": "Up or Down"
        },
        ep = [{
            pattern: /^wti[fghjkmnquvxz]\d/,
            equity: "oil"
        }, {
            pattern: /^cc[fghjkmnquvxz]\d/,
            equity: "copper"
        }, {
            pattern: /^ngd[fghjkmnquvxz]\d/,
            equity: "naturalgas"
        }],
        eh = e => {
            if (!e) return null;
            let t = Object.keys(eu).flatMap(t => eu[t].flatMap(r => e.startsWith(`${r}-up-or-down`) ? [{
                equity: t,
                marketType: "up-or-down",
                slugPrefix: r,
                decimalPlaces: 2,
                isDailyUpOrDown: /-up-or-down-on-/.test(e)
            }] : []));
            if (t.length > 0) return t[0];
            for (let {
                    pattern: t,
                    equity: r
                } of ep)
                if (t.test(e) && e.includes("-up-or-down")) return {
                    equity: r,
                    marketType: "up-or-down",
                    slugPrefix: e.split("-up-or-down")[0],
                    decimalPlaces: 2,
                    isDailyUpOrDown: /-up-or-down-on-/.test(e)
                };
            return null
        },
        em = e => null !== eh(e),
        ef = e => ed[e];
    e.s(["EQUITY_CONFIG", 0, el, "getCleanEquityTitle", 0, e => {
        let t = eh(e);
        if (!t) return null;
        let r = el[t.equity].displayName,
            s = ef(t.marketType);
        return `${r} ${s}`
    }, "getEquityMarketSettings", 0, e => {
        let t = eh(e);
        return t ? {
            equity: t.equity,
            marketType: t.marketType,
            decimalPlaces: t.decimalPlaces,
            shouldShowLockedPrice: !1,
            shouldShowDetailedTime: !0,
            timezone: "America/New_York",
            isDailyUpOrDown: t.isDailyUpOrDown
        } : null
    }, "getRecommendedEquityMarkets", 0, e => {
        let t = eh(e);
        if (!t) return [];
        let {
            equity: r,
            marketType: s,
            slugPrefix: i
        } = t, n = e.substring(i.length), a = ec[s] || [], o = eu[r].indexOf(i);
        return a.filter(e => e !== r).map(e => {
            let r = eu[e],
                i = r[o] || r[0];
            return {
                equity: e,
                marketType: s,
                slug: `${i}` + n,
                decimalPlaces: 2,
                isDailyUpOrDown: t.isDailyUpOrDown
            }
        })
    }, "isEquityMarketSlug", 0, em, "shouldShowRecommendedPills", 0, e => {
        let t = (e => {
            let t = eh(e);
            if (!t) return null;
            let r = el[t.equity];
            return {
                currentEquity: t.equity,
                currentMarketType: t.marketType,
                currentEquityDisplay: r.displayName,
                currentMarketTypeDisplay: ef(t.marketType),
                currentDecimalPlaces: 2,
                isDailyUpOrDown: t.isDailyUpOrDown,
                logo: r.logo
            }
        })(e);
        return !!(t && t.isDailyUpOrDown)
    }], 847979);
    var eg = e.i(255760),
        ek = e.i(96515);
    let ey = ["bitcoin-up-or-down", "bitcoin-updown", "btc-up-or-down", "btc-updown", "ethereum-up-or-down", "ethereum-updown", "eth-up-or-down", "eth-updown", "xrp-up-or-down", "xrp-updown", "solana-up-or-down", "solana-updown", "sol-up-or-down", "sol-updown", "dogecoin-up-or-down", "dogecoin-updown", "doge-up-or-down", "doge-updown", "hype-up-or-down", "hype-updown", "bnb-up-or-down", "bnb-updown"],
        eS = ["bitcoin-up-or-down", "bitcoin-updown", "btc-up-or-down", "btc-updown", "ethereum-up-or-down", "ethereum-updown", "eth-up-or-down", "eth-updown", "xrp-up-or-down", "xrp-updown", "solana-up-or-down", "solana-updown", "sol-up-or-down", "sol-updown", "dogecoin-up-or-down", "dogecoin-updown", "doge-up-or-down", "doge-updown", "hype-up-or-down", "hype-updown", "bnb-up-or-down", "bnb-updown", "aapl-up-or-down", "tsla-up-or-down", "msft-up-or-down", "googl-up-or-down", "amzn-up-or-down", "meta-up-or-down", "nvda-up-or-down", "nflx-up-or-down", "pltr-up-or-down", "open-up-or-down", "rklb-up-or-down", "abnb-up-or-down", "coin-up-or-down", "hood-up-or-down", "qqq-up-or-down", "spy-up-or-down", "ewy-up-or-down", "vxx-up-or-down", "eurusd-up-or-down", "gbpusd-up-or-down", "usdcad-up-or-down", "usdjpy-up-or-down", "usdkrw-up-or-down", "xauusd-up-or-down", "xagusd-up-or-down", "wti-up-or-down", "ng-up-or-down"],
        ew = [...ey, "dogecoin-up-or-down", "dogecoin-updown", "doge-up-or-down", "doge-updown", "hyperliquid-up-or-down", "dogecoin-up-or-down", "fartcoin-up-or-down", "wti-up-or-down", "ng-up-or-down", "ethereum-price", "bitcoin-price", "solana-price", "xrp-price", "ethereum-above", "bitcoin-above", "btc-above", "eth-above", "sol-above", "solana-above", "xrp-above", "what-price-will-xrp-hit", "what-price-will-bitcoin-hit", "what-price-will-solana-hit", "what-price-will-ethereum-hit", "what-price-will-dogecoin-hit", "btc-multistrike-4h", "eth-multistrike-4h", "sol-multistrike-4h", "xrp-multistrike-4h", "bitcoin-multistrike-4h", "ethereum-multistrike-4h", "solana-multistrike-4h", "nvda-up-or-down", "aapl-up-or-down", "tsla-up-or-down", "meta-up-or-down", "msft-up-or-down", "googl-up-or-down", "amzn-up-or-down", "spx-up-or-down", "hsi-up-or-down", "rut-up-or-down", "pltr-up-or-down", "open-up-or-down", "rklb-up-or-down-on", "abnb-up-or-down", "ndx-up-or-down", "nik-up-or-down", "ukx-up-or-down", "dax-up-or-down", "nya-up-or-down", "gc-f-up-or-down", "nflx-up-or-down", "si-f-up-or-down", "cl-f-up-or-down", "dji-up-or-down", "coin-up-or-down", "hood-up-or-down", "qqq-up-or-down", "spy-up-or-down", "ewy-up-or-down", "vxx-up-or-down", "eurusd-up-or-down", "gbpusd-up-or-down", "usdcad-up-or-down", "usdjpy-up-or-down", "usdkrw-up-or-down", "xauusd-up-or-down", "xagusd-up-or-down", "aapl-above", "nvda-above", "tsla-above", "meta-above", "msft-above", "googl-above", "amzn-above", "nflx-above", "rklb-above", "open-above", "pltr-above", "abnb-above", "what-price-will-meta-hit", "what-price-will-tesla-hit", "what-price-will-amazon-hit", "what-price-will-netflix-hit", "what-price-will-microsoft-hit", "what-price-will-apple-hit", "what-price-will-google-hit", "what-price-will-tsla-hit", "what-price-will-amzn-hit", "what-price-will-nflx-hit", "what-price-will-msft-hit", "what-price-will-pltr-hit", "what-price-will-rklb-hit", "what-price-will-aapl-hit", "what-price-will-googl-hit", "what-price-will-abnb-hit", "what-price-will-nvda-hit", "what-price-will-open-hit"],
        ev = (e = "") => {
            let t = ey.some(t => e.startsWith(t)) && /-[0-9]+(am|pm)-et$/.test(e),
                r = /^(wti|cc|ng|ngd)([fghjkmnquvxz]\d)?-up-or-down-on-/.test(e),
                s = (eS.some(t => e.startsWith(t)) || r) && /-up-or-down-on-/.test(e) && !t,
                i = (e.startsWith("ethereum-price") || e.startsWith("bitcoin-price")) && /-price-.*-5pm-et/.test(e),
                n = ey.some(t => e.startsWith(t)) && e.includes("-15m"),
                a = ey.some(t => e.startsWith(t)) && e.includes("-5m"),
                o = ey.some(t => e.startsWith(t)) && e.includes("-4h"),
                l = /-[0-9]+(am|pm)(-et)?$/i.test(e),
                u = e.includes("-multistrike-4h"),
                c = ew.some(t => e.startsWith(t)) || r;
            return {
                timezone: "America/New_York",
                shouldShowDetailedTime: c,
                useHourlyFiltering: (l || u || o || n || a) && c,
                shouldShowLockedPrice: t || s || i || u || n || a || o,
                decimalPlaces: e.includes("doge") || e.includes("dogecoin") ? 6 : e.includes("xrp") || e.includes("hype") || e.includes("bnb") || /^(eurusd|gbpusd|usdcad)/.test(e) ? 4 : (e.startsWith("usdjpy") || e.startsWith("usdkrw"), 2)
            }
        },
        e_ = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
    e.s(["ALLOWED_PREFIXES", 0, ew, "HOURLY_UP_OR_DOWN_PREFIXES", 0, ey, "constructPastMarketSlug", 0, function(e, t, r, s) {
        let n = new Date(t),
            a = new Date(r),
            o = n.getTime(),
            l = new i.TZDate(n, "America/New_York"),
            [u] = e.split("-");
        if ("fiveminute" === s) {
            let e = Math.floor(o / 1e3);
            return `${u}-updown-5m-${e}`
        }
        if ("fifteen" === s) {
            let e = Math.floor(o / 1e3);
            return `${u}-updown-15m-${e}`
        }
        if ("fourhour" === s) {
            let e = Math.floor(o / 1e3);
            return `${u}-updown-4h-${e}`
        }
        if ("hourly" === s) {
            let e = e_[l.getMonth()],
                t = l.getDate(),
                r = l.getHours(),
                s = r >= 12 ? "pm" : "am";
            return r > 12 && (r -= 12), 0 === r && (r = 12), `${u}-up-or-down-${e}-${t}-${r}${s}-et`
        }
        if ("daily" === s) {
            let e = e_[a.getUTCMonth()],
                t = a.getUTCDate(),
                r = a.getUTCFullYear();
            return `${u}-up-or-down-on-${e}-${t}-${r}`
        }
        return "#"
    }, "findMatchingPastEvent", 0, function(e, t, r) {
        if (!t.length) return null;
        let s = new Date(e.startTime).getTime();
        for (let e of t) {
            let t = e.markets ? .[0] ? .eventStartTime ? new Date(e.markets[0].eventStartTime).getTime() : e.startTime ? new Date(e.startTime).getTime() : 0;
            if (t) {
                if (r) {
                    if (new Date(s).setUTCHours(0, 0, 0, 0) === new Date(t).setUTCHours(0, 0, 0, 0)) return e
                } else if (6e4 > Math.abs(s - t)) return e
            }
        }
        return null
    }, "getSeriesSettings", 0, ev], 162923);
    var eb = e.i(6204);
    let eM = (0, _.createSplitContext)("EventContext", {
            event: void 0,
            isRefreshingAllBooks: !1,
            markets: [],
            events: void 0,
            resolvedMarkets: [],
            lowChanceMarkets: [],
            lowChanceMarketsOpen: !1,
            resolvedMarketsOpen: !1,
            isNegRiskSportsEvent: !1,
            isPastVisible: !1,
            eventSettings: {
                priceMarketSettings: {
                    priceMarketsUiEnabled: !1
                },
                seriesSettings: {
                    timezone: "",
                    shouldShowDetailedTime: !1,
                    useHourlyFiltering: !1,
                    shouldShowLockedPrice: !1,
                    decimalPlaces: 2
                }
            },
            hasHoldingRewards: !1,
            categoryBreadcrumb: null,
            hitMarketChartData: null,
            setIsRefreshingAllBooks: e => {
                throw Error("EventContext must export an `setIsRefreshingAllBooks` function.")
            },
            setLowChanceMarketsOpen: () => {},
            setResolvedMarketsOpen: () => {},
            setIsPastVisible: () => {}
        }),
        eT = e => {
            let s, i, n, a, l, c, d, p, h, m, f, g, k, y, S, w, v = (0, r.c)(46),
                {
                    children: _,
                    event: b,
                    events: T,
                    market: A,
                    disableAutoSelectDefaultMarket: I,
                    marketToEventIdMap: x,
                    slugToEventIdMap: D,
                    isInitialEventHidden: C,
                    categoryBreadcrumb: E,
                    hitMarketChartData: P
                } = e,
                F = void 0 !== I && I,
                B = void 0 === E ? null : E,
                O = void 0 === P ? null : P,
                [N, R] = (0, o.useState)(b),
                [W, z] = o.default.useState(void 0 !== C && C);
            v[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["isSportsPage"], v[0] = s) : s = v[0];
            let {
                isSportsPage: $
            } = (0, eb.useSportsContext)(s), {
                markets: q,
                resolvedMarkets: j,
                lowChanceMarkets: Q
            } = (0, u.useSortedMarkets)(N), G = (y = (0, r.c)(3), S = o.default.useMemo(() => ev(N.slug), [N]), w = o.default.useMemo(() => {
                let e = (({
                    event: e
                }) => {
                    let t = (({
                            event: e
                        }) => {
                            let {
                                slug: t
                            } = e;
                            if (K(t)) {
                                let [e] = t.split("-"), r = (0, eg.getAssetNames)(e);
                                if (r.abbreviation && r.name) return {
                                    success: !0,
                                    month: new Date().getMonth(),
                                    day: new Date().getDate(),
                                    hours: new Date().getHours(),
                                    tz: "et",
                                    variant: "fourhour",
                                    ...r
                                }
                            }
                            if (V(t)) {
                                let [e] = t.split("-"), r = (0, eg.getAssetNames)(e);
                                if (r.abbreviation && r.name) return {
                                    success: !0,
                                    month: new Date().getMonth(),
                                    day: new Date().getDate(),
                                    hours: new Date().getHours(),
                                    tz: "et",
                                    variant: "fiveminute",
                                    ...r
                                }
                            }
                            if (U(t)) {
                                let [e] = t.split("-"), r = (0, eg.getAssetNames)(e);
                                if (r.abbreviation && r.name) return {
                                    success: !0,
                                    month: new Date().getMonth(),
                                    day: new Date().getDate(),
                                    hours: new Date().getHours(),
                                    tz: "et",
                                    variant: "fifteen",
                                    ...r
                                }
                            }
                            let r = t.match(/^(bitcoin|ethereum|xrp|solana|dogecoin|hype|bnb)-up-or-down-on-([a-z]+)-(\d+)(?:-(\d{4}))?$/) || t.match(/^(aapl|tsla|msft|googl|amzn|meta|nvda|nflx|pltr|open|rklb|abnb|coin|hood|qqq|spy|ewy|vxx|eurusd|gbpusd|usdcad|usdjpy|usdkrw|xauusd|xagusd|wti|ng)-up-or-down-on-([a-z]+)-(\d+)-(\d+)$/) || t.match(/^(wti[fghjkmnquvxz]\d|cc[fghjkmnquvxz]\d|ng[d]?[fghjkmnquvxz]\d)-up-or-down-on-([a-z]+)-(\d+)-(\d+)$/);
                            if (r) {
                                let [, e, t, s] = r, i = (0, eg.getAssetNames)(e);
                                if (i.abbreviation && i.name) {
                                    let e = ek.PRICE_MARKET_MONTH_MAP[t.toLowerCase()],
                                        r = parseInt(s, 10);
                                    if (!Number.isNaN(e) && !Number.isNaN(r)) return {
                                        success: !0,
                                        month: e,
                                        day: r,
                                        hours: 12,
                                        tz: "et",
                                        variant: "daily",
                                        ...i
                                    }
                                }
                            }
                            let s = t.match(/^(bitcoin|ethereum)-price-([a-z]+)-(\d+)-5pm-et$/);
                            if (s) {
                                let [, e, t, r] = s, i = (0, eg.getAssetNames)(e);
                                if (i.abbreviation && i.name) {
                                    let e = ek.PRICE_MARKET_MONTH_MAP[t.toLowerCase()],
                                        s = parseInt(r, 10);
                                    if (!Number.isNaN(e) && !Number.isNaN(s)) return {
                                        success: !0,
                                        month: e,
                                        day: s,
                                        hours: 17,
                                        tz: "et",
                                        variant: "daily",
                                        ...i
                                    }
                                }
                            }
                            let [i, , , , n, a, o, l] = e.slug.split("-"), u = (0, eg.getAssetNames)(i);
                            if (i && n && a && o && l && u.abbreviation && u.name) {
                                let e = o.includes("am"),
                                    t = o.replace("am", "").replace("pm", ""),
                                    r = ek.PRICE_MARKET_MONTH_MAP[n.toLowerCase()],
                                    s = parseInt(a, 10),
                                    i = parseInt(t, 10);
                                if (12 === i && e ? i = 0 : 12 !== i || e ? e || (i += 12) : i = 12, !Number.isNaN(r) && !Number.isNaN(s) && !Number.isNaN(i)) return {
                                    success: !0,
                                    month: r,
                                    day: s,
                                    hours: i,
                                    tz: l,
                                    variant: "hourly",
                                    ...u
                                }
                            }
                            return {
                                success: !1,
                                asset: null
                            }
                        })({
                            event: e
                        }),
                        r = ea(e.slug) ? "crypto" : em(e.slug) ? "equity" : null;
                    if (t.success) {
                        let s, i, {
                            success: n,
                            asset: a,
                            month: o,
                            day: l,
                            hours: u,
                            tz: c,
                            variant: d,
                            ...p
                        } = t;
                        if ("fifteen" === d || "fiveminute" === d || "fourhour" === d) {
                            let t = e.markets.find(e => e.eventStartTime && e.endDate),
                                s = t ? .eventStartTime,
                                i = t ? .endDate;
                            return {
                                success: !0,
                                timestamp: s ? new Date(s).getTime() : Date.now(),
                                etDate: s ? new Date(s) : new Date,
                                utcDate: s ? new Date(s) : new Date,
                                variant: d,
                                hasStarted: !!s && Date.now() >= new Date(s).getTime(),
                                hasEnded: !!i && new Date(i).getTime() < Date.now(),
                                eventStartTime: s,
                                assetType: r,
                                ...p
                            }
                        }
                        let h = new Date,
                            m = h.getFullYear(),
                            f = h.getMonth(),
                            g = h.getDate();
                        h.setMonth(o), h.setDate(l), h.setHours(u), h.setMinutes(0), h.setSeconds(0), h.setMilliseconds(0), (o < f || o === f && l < g) && h.setFullYear(m + 1);
                        let k = (s = new Date(h.getFullYear(), 0, 1), i = new Date(h.getFullYear(), 6, 1), h.getTimezoneOffset() < Math.max(s.getTimezoneOffset(), i.getTimezoneOffset())) ? 4 : 5,
                            y = new Date(h.getTime() + 60 * k * 6e4),
                            S = (({
                                event: e
                            }) => {
                                let t = e.markets.find(e => e.eventStartTime),
                                    r = e.markets.some(e => {
                                        var t;
                                        return !!(t = e.endDate) && new Date(t).getTime() < Date.now()
                                    });
                                return {
                                    hasStarted: (e => {
                                        if (!e) return !1;
                                        try {
                                            let t = Date.now(),
                                                r = new Date(e).getTime();
                                            return t >= r
                                        } catch {
                                            return !1
                                        }
                                    })(t ? .eventStartTime),
                                    hasEnded: r,
                                    eventStartTime: t ? .eventStartTime
                                }
                            })({
                                event: e
                            }),
                            w = S.eventStartTime || y.getTime().toString(),
                            v = S.hasStarted || Date.now() >= y.getTime();
                        return {
                            success: !0,
                            timestamp: y.getTime(),
                            etDate: h,
                            utcDate: y,
                            variant: d,
                            hasStarted: v,
                            hasEnded: S.hasEnded,
                            eventStartTime: w,
                            assetType: r,
                            ...p
                        }
                    }
                    return {
                        success: !1
                    }
                })({
                    event: N
                });
                if (e.success) {
                    let {
                        success: t,
                        ...r
                    } = e;
                    if (S.shouldShowLockedPrice || "fifteen" === r.variant || "fiveminute" === r.variant || "fourhour" === r.variant) return {
                        priceMarketsUiEnabled: !0,
                        ...r
                    }
                }
                return {
                    priceMarketsUiEnabled: !1
                }
            }, [N, S]), y[0] !== w || y[1] !== S ? (k = {
                seriesSettings: S,
                priceMarketSettings: w
            }, y[0] = w, y[1] = S, y[2] = k) : k = y[2], k);
            v[1] !== N.updatedAt || v[2] !== b || v[3] !== $ ? (i = () => {
                !$ && b && b.updatedAt !== N.updatedAt && R(b)
            }, v[1] = N.updatedAt, v[2] = b, v[3] = $, v[4] = i) : i = v[4], v[5] !== b ? (n = [b], v[5] = b, v[6] = n) : n = v[6], (0, o.useEffect)(i, n), v[7] !== N ? (a = (0, H.getIsNegRiskSportsEvent)(N), v[7] = N, v[8] = a) : a = v[8];
            let Y = a;
            v[9] !== N.markets ? (l = N.markets.length > 0 && N.markets.every(eI), v[9] = N.markets, v[10] = l) : l = v[10];
            let X = l,
                [J, Z] = (0, o.useState)(!1),
                [ee, et] = (0, o.useState)(!1),
                [er, es] = (0, o.useState)(!1);
            v[11] !== Q || v[12] !== q || v[13] !== j ? (c = [...q, ...Q, ...j], v[11] = Q, v[12] = q, v[13] = j, v[14] = c) : c = v[14], v[15] !== N || v[16] !== c ? (d = { ...N,
                markets: c
            }, v[15] = N, v[16] = c, v[17] = d) : d = v[17];
            let ei = d;
            v[18] !== B || v[19] !== G || v[20] !== ei || v[21] !== T || v[22] !== X || v[23] !== O || v[24] !== Y || v[25] !== W || v[26] !== J || v[27] !== Q || v[28] !== ee || v[29] !== q || v[30] !== j || v[31] !== er ? (p = {
                event: ei,
                markets: q,
                resolvedMarkets: j,
                lowChanceMarkets: Q,
                events: T,
                isRefreshingAllBooks: J,
                setIsRefreshingAllBooks: Z,
                lowChanceMarketsOpen: ee,
                setLowChanceMarketsOpen: et,
                resolvedMarketsOpen: er,
                setResolvedMarketsOpen: es,
                isNegRiskSportsEvent: Y,
                isPastVisible: W,
                setIsPastVisible: z,
                eventSettings: G,
                hasHoldingRewards: X,
                categoryBreadcrumb: B,
                hitMarketChartData: O
            }, v[18] = B, v[19] = G, v[20] = ei, v[21] = T, v[22] = X, v[23] = O, v[24] = Y, v[25] = W, v[26] = J, v[27] = Q, v[28] = ee, v[29] = q, v[30] = j, v[31] = er, v[32] = p) : p = v[32];
            let en = p,
                eo = $ ? R : void 0;
            return v[33] === Symbol.for("react.memo_cache_sentinel") ? (h = (0, t.jsx)(L, {}), v[33] = h) : h = v[33], v[34] !== _ ? (m = (0, t.jsxs)(M, {
                children: [h, _]
            }), v[34] = _, v[35] = m) : m = v[35], v[36] !== F || v[37] !== A || v[38] !== x || v[39] !== D || v[40] !== eo || v[41] !== m ? (f = (0, t.jsx)(eD, {
                market: A,
                disableAutoSelectDefaultMarket: F,
                marketToEventIdMap: x,
                slugToEventIdMap: D,
                onSetEvent: eo,
                children: m
            }), v[36] = F, v[37] = A, v[38] = x, v[39] = D, v[40] = eo, v[41] = m, v[42] = f) : f = v[42], v[43] !== f || v[44] !== en ? (g = (0, t.jsx)(eM.Provider, {
                values: en,
                children: f
            }), v[43] = f, v[44] = en, v[45] = g) : g = v[45], g
        },
        eA = e => (0, _.useSplitContext)(eM, e);

    function eI(e) {
        return !0 === e.holdingRewardsEnabled
    }
    let ex = (0, _.createSplitContext)("EventActiveMarketContext", {
            activeMarket: void 0,
            activeMarketTickSize: .01,
            setActiveMarket: e => {
                throw Error("EventActiveMarketContext must export an `setActiveMarket` function.")
            },
            setActiveMarketFromSlug: e => {
                throw Error("EventActiveMarketContext must export an `setActiveMarketFromSlug` function.")
            },
            accordionMarketSlug: void 0,
            setAccordionMarketSlug: e => {
                throw Error("EventContext must export an `setAccordionMarketSlug` function.")
            },
            eventDeployedAt: void 0,
            initialSlugParam: null
        }),
        eD = ({
            children: e,
            market: r,
            disableAutoSelectDefaultMarket: l = !1,
            marketToEventIdMap: d,
            slugToEventIdMap: p,
            onSetEvent: h
        }) => {
            let {
                event: m,
                events: f
            } = eA(["event", "events"]), [g, k] = (0, o.useState)(r), y = (0, a.useLatestTickSize)((0, s.getAssetId)(g), g.orderPriceMinTickSize), [S, w] = (0, o.useState)(), {
                markets: v
            } = (0, u.useSortedMarkets)(m), {
                isSportsPage: _
            } = (0, eb.useSportsContext)(["isSportsPage"]), [b] = (0, o.useState)(() => {
                let e;
                return new URL(window.location.href).searchParams.get("marketSlug") ? ? ("event" === (e = window.location.pathname.split("/").filter(Boolean))[0] && e.length >= 3 ? e[2] : null) ? ? (() => {
                    try {
                        let e = document.cookie.split("; ").find(e => e.startsWith("pm_trade_redirect_params="));
                        if (!e) return null;
                        return new URLSearchParams(decodeURIComponent(e.substring(25))).get("marketSlug")
                    } catch {
                        return null
                    }
                })()
            }), M = (0, o.useMemo)(() => ((e, t, r) => {
                try {
                    let s = e || t || r;
                    if (!s) return;
                    let a = new i.TZDate(new Date(s), "America/New_York");
                    return `${(0,n.format)(a,"PPp")} ET`
                } catch {
                    return
                }
            })(g ? .deployingTimestamp, m ? .deployingTimestamp, m ? .creationDate), [g ? .deployingTimestamp, m ? .deployingTimestamp, m ? .creationDate]), T = (0, o.useCallback)(e => {
                if (!Array.isArray(f) || !d) return void k(e);
                let t = d[e.id.toString()] ? ? (e.events.length && e.events[0].id ? e.events[0].id.toString() : void 0);
                if (!t || t === m.id.toString()) return void k(e);
                let r = f.find(e => e.id.toString() === t);
                r && h && h(r), k(e)
            }, [f, m.id, d, k, h]);
            (0, o.useEffect)(() => {
                Array.isArray(f) && r && g && r.slug !== g.slug ? T(r) : l || !(v.length > 0) || b || (_ ? T((0, c.findWinningSportsMarketOfType)(v, "moneyline") ? ? r) : T(v[0]))
            }, [r ? .slug, _, l]);
            let A = (0, o.useCallback)(() => {
                    let e = m.markets.toSorted((e, t) => e.groupItemThreshold - t.groupItemThreshold),
                        t = e.filter(e => !e.closed),
                        r = e[0];
                    if (m.negRisk && (m.closed || m.archived)) {
                        let t = e.find(e => 1 === parseFloat(e.outcomePrices ? .[0] ? ? "0"));
                        if (t) return T(t), t
                    }
                    let s = (0, c.findWinningSportsMarketOfType)(e, "moneyline");
                    return s ? (T(s), s) : t.length > 0 ? (T(t[0]), t[0]) : (T(r), r)
                }, [m.markets, m.negRisk, m.closed, m.archived]),
                I = (0, o.useCallback)(e => {
                    let t;
                    if (Array.isArray(f) && p) {
                        let r = p[e];
                        if (r && r !== m.id.toString()) {
                            let s = f.find(e => e.id.toString() === r);
                            s && (h && h(s), t = s.markets.find(t => t.slug === e))
                        } else t = m.markets.find(t => t.slug === e)
                    } else t = m.markets.find(t => t.slug === e);
                    if (t) return T(t), S && w(t.slug), t;
                    let r = A();
                    return S && w(S), r
                }, [m.markets, S, A]),
                x = (0, o.useMemo)(() => ({
                    activeMarket: { ...g,
                        orderPriceMinTickSize: y
                    },
                    activeMarketTickSize: y,
                    accordionMarketSlug: S,
                    setActiveMarket: T,
                    setActiveMarketFromSlug: I,
                    setAccordionMarketSlug: w,
                    eventDeployedAt: M,
                    initialSlugParam: b
                }), [g, S, T, I, w, M, y]);
            return (0, t.jsx)(ex.Provider, {
                values: x,
                children: e
            })
        },
        eC = e => (0, _.useSplitContext)(ex, e),
        eE = () => (0, _.useSplitContextValue)(ex),
        eP = () => {
            let e, t, s, i = (0, r.c)(2);
            i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], i[0] = e) : e = i[0];
            let {
                activeMarket: n
            } = eC(e);
            i[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["market"], i[1] = t) : t = i[1];
            let {
                market: a
            } = (0, l.useBookContext)(t);
            e: {
                if (n && Object.keys(n).length > 0) {
                    s = n;
                    break e
                }
                s = a
            }
            return s
        }
}, 826341, 321116, e => {
    "use strict";

    function t(e) {
        return Array.isArray ? Array.isArray(e) : "[object Array]" === l(e)
    }

    function r(e) {
        return null == e ? "" : function(e) {
            if ("string" == typeof e) return e;
            if ("bigint" == typeof e) return e.toString();
            let t = e + "";
            return "0" == t && 1 / e == -1 / 0 ? "-0" : t
        }(e)
    }

    function s(e) {
        return "string" == typeof e
    }

    function i(e) {
        return "number" == typeof e
    }

    function n(e) {
        return "object" == typeof e
    }

    function a(e) {
        return null != e
    }

    function o(e) {
        return !e.trim().length
    }

    function l(e) {
        return null == e ? void 0 === e ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e)
    }
    let u = Object.prototype.hasOwnProperty;
    class c {
        constructor(e) {
            this._keys = [], this._keyMap = {};
            let t = 0;
            e.forEach(e => {
                let r = d(e);
                this._keys.push(r), this._keyMap[r.id] = r, t += r.weight
            }), this._keys.forEach(e => {
                e.weight /= t
            })
        }
        get(e) {
            return this._keyMap[e]
        }
        keys() {
            return this._keys
        }
        toJSON() {
            return JSON.stringify(this._keys)
        }
    }

    function d(e) {
        let r = null,
            i = null,
            n = null,
            a = 1,
            o = null;
        if (s(e) || t(e)) n = e, r = p(e), i = h(e);
        else {
            if (!u.call(e, "name")) throw Error("Missing name property in key");
            let t = e.name;
            if (n = t, u.call(e, "weight") && (a = e.weight) <= 0) throw Error(`Property 'weight' in key '${t}' must be a positive integer`);
            r = p(t), i = h(t), o = e.getFn
        }
        return {
            path: r,
            id: i,
            weight: a,
            src: n,
            getFn: o
        }
    }

    function p(e) {
        return t(e) ? e : e.split(".")
    }

    function h(e) {
        return t(e) ? e.join(".") : e
    }
    let m = Object.freeze({
            isCaseSensitive: !1,
            ignoreDiacritics: !1,
            includeScore: !1,
            keys: [],
            shouldSort: !0,
            sortFn: (e, t) => e.score === t.score ? e.idx < t.idx ? -1 : 1 : e.score < t.score ? -1 : 1,
            includeMatches: !1,
            findAllMatches: !1,
            minMatchCharLength: 1,
            location: 0,
            threshold: .6,
            distance: 100,
            useExtendedSearch: !1,
            useTokenSearch: !1,
            getFn: function(e, o) {
                let u = [],
                    c = !1,
                    d = (e, o, p, h) => {
                        if (a(e))
                            if (o[p]) {
                                var m, f;
                                let g = e[o[p]];
                                if (!a(g)) return;
                                if (p === o.length - 1 && (s(g) || i(g) || !0 === (m = g) || !1 === m || n(f = m) && null !== f && "[object Boolean]" == l(m) || "bigint" == typeof g)) u.push(void 0 !== h ? {
                                    v: r(g),
                                    i: h
                                } : r(g));
                                else if (t(g)) {
                                    c = !0;
                                    for (let e = 0, t = g.length; e < t; e += 1) d(g[e], o, p + 1, e)
                                } else o.length && d(g, o, p + 1, h)
                            } else u.push(void 0 !== h ? {
                                v: e,
                                i: h
                            } : e)
                    };
                return d(e, s(o) ? o.split(".") : o, 0), c ? u : u[0]
            },
            ignoreLocation: !1,
            ignoreFieldNorm: !1,
            fieldNormWeight: 1
        }),
        f = /[^ ]+/g;
    class g {
        constructor({
            getFn: e = m.getFn,
            fieldNormWeight: t = m.fieldNormWeight
        } = {}) {
            this.norm = function(e = 1, t = 3) {
                let r = new Map,
                    s = Math.pow(10, t);
                return {
                    get(t) {
                        let i = t.match(f).length;
                        if (r.has(i)) return r.get(i);
                        let n = parseFloat(Math.round(1 / Math.pow(i, .5 * e) * s) / s);
                        return r.set(i, n), n
                    },
                    clear() {
                        r.clear()
                    }
                }
            }(t, 3), this.getFn = e, this.isCreated = !1, this.docs = [], this.keys = [], this._keysMap = {}, this.setIndexRecords()
        }
        setSources(e = []) {
            this.docs = e
        }
        setIndexRecords(e = []) {
            this.records = e
        }
        setKeys(e = []) {
            this.keys = e, this._keysMap = {}, e.forEach((e, t) => {
                this._keysMap[e.id] = t
            })
        }
        create() {
            !this.isCreated && this.docs.length && (this.isCreated = !0, s(this.docs[0]) ? this.docs.forEach((e, t) => {
                this._addString(e, t)
            }) : this.docs.forEach((e, t) => {
                this._addObject(e, t)
            }), this.norm.clear())
        }
        add(e) {
            let t = this.size();
            s(e) ? this._addString(e, t) : this._addObject(e, t)
        }
        removeAt(e) {
            this.records.splice(e, 1);
            for (let t = e, r = this.size(); t < r; t += 1) this.records[t].i -= 1
        }
        removeAll(e) {
            for (let t = e.length - 1; t >= 0; t -= 1) this.records.splice(e[t], 1);
            for (let e = 0, t = this.records.length; e < t; e += 1) this.records[e].i = e
        }
        getValueForItemAtKeyId(e, t) {
            return e[this._keysMap[t]]
        }
        size() {
            return this.records.length
        }
        _addString(e, t) {
            if (!a(e) || o(e)) return;
            let r = {
                v: e,
                i: t,
                n: this.norm.get(e)
            };
            this.records.push(r)
        }
        _addObject(e, i) {
            let n = {
                i: i,
                $: {}
            };
            this.keys.forEach((i, l) => {
                let u = i.getFn ? i.getFn(e) : this.getFn(e, i.path);
                if (a(u)) {
                    if (t(u)) {
                        let e = [];
                        for (let t = 0, i = u.length; t < i; t += 1) {
                            let i = u[t];
                            if (a(i)) {
                                if (s(i)) {
                                    if (!o(i)) {
                                        let r = {
                                            v: i,
                                            i: t,
                                            n: this.norm.get(i)
                                        };
                                        e.push(r)
                                    }
                                } else if (a(i.v)) {
                                    let t = s(i.v) ? i.v : r(i.v);
                                    if (!o(t)) {
                                        let r = {
                                            v: t,
                                            i: i.i,
                                            n: this.norm.get(t)
                                        };
                                        e.push(r)
                                    }
                                }
                            }
                        }
                        n.$[l] = e
                    } else if (s(u) && !o(u)) {
                        let e = {
                            v: u,
                            n: this.norm.get(u)
                        };
                        n.$[l] = e
                    }
                }
            }), this.records.push(n)
        }
        toJSON() {
            return {
                keys: this.keys.map(({
                    getFn: e,
                    ...t
                }) => t),
                records: this.records
            }
        }
    }

    function k(e, t, {
        getFn: r = m.getFn,
        fieldNormWeight: s = m.fieldNormWeight
    } = {}) {
        let i = new g({
            getFn: r,
            fieldNormWeight: s
        });
        return i.setKeys(e.map(d)), i.setSources(t), i.create(), i
    }

    function y(e) {
        if (e.length <= 1) return e;
        e.sort((e, t) => e[0] - t[0] || e[1] - t[1]);
        let t = [e[0]];
        for (let r = 1, s = e.length; r < s; r += 1) {
            let s = t[t.length - 1],
                i = e[r];
            i[0] <= s[1] + 1 ? s[1] = Math.max(s[1], i[1]) : t.push(i)
        }
        return t
    }
    let S = {
            ł: "l",
            Ł: "L",
            đ: "d",
            Đ: "D",
            ø: "o",
            Ø: "O",
            ħ: "h",
            Ħ: "H",
            ŧ: "t",
            Ŧ: "T",
            ı: "i",
            ß: "ss"
        },
        w = RegExp("[" + Object.keys(S).join("") + "]", "g"),
        v = String.prototype.normalize ? e => e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "").replace(w, e => S[e]) : e => e;
    class _ {
        constructor(e, {
            location: t = m.location,
            threshold: r = m.threshold,
            distance: s = m.distance,
            includeMatches: i = m.includeMatches,
            findAllMatches: n = m.findAllMatches,
            minMatchCharLength: a = m.minMatchCharLength,
            isCaseSensitive: o = m.isCaseSensitive,
            ignoreDiacritics: l = m.ignoreDiacritics,
            ignoreLocation: u = m.ignoreLocation
        } = {}) {
            if (this.options = {
                    location: t,
                    threshold: r,
                    distance: s,
                    includeMatches: i,
                    findAllMatches: n,
                    minMatchCharLength: a,
                    isCaseSensitive: o,
                    ignoreDiacritics: l,
                    ignoreLocation: u
                }, e = o ? e : e.toLowerCase(), e = l ? v(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length) return;
            const c = (e, t) => {
                    this.chunks.push({
                        pattern: e,
                        alphabet: function(e) {
                            let t = {};
                            for (let r = 0, s = e.length; r < s; r += 1) {
                                let i = e.charAt(r);
                                t[i] = (t[i] || 0) | 1 << s - r - 1
                            }
                            return t
                        }(e),
                        startIndex: t
                    })
                },
                d = this.pattern.length;
            if (d > 32) {
                let e = 0;
                const t = d % 32,
                    r = d - t;
                for (; e < r;) c(this.pattern.substr(e, 32), e), e += 32;
                if (t) {
                    const e = d - 32;
                    c(this.pattern.substr(e), e)
                }
            } else c(this.pattern, 0)
        }
        searchIn(e) {
            let {
                isCaseSensitive: t,
                ignoreDiacritics: r,
                includeMatches: s
            } = this.options;
            if (e = t ? e : e.toLowerCase(), e = r ? v(e) : e, this.pattern === e) {
                let t = {
                    isMatch: !0,
                    score: 0
                };
                return s && (t.indices = [
                    [0, e.length - 1]
                ]), t
            }
            let {
                location: i,
                distance: n,
                threshold: a,
                findAllMatches: o,
                minMatchCharLength: l,
                ignoreLocation: u
            } = this.options, c = [], d = 0, p = !1;
            this.chunks.forEach(({
                pattern: t,
                alphabet: r,
                startIndex: h
            }) => {
                let {
                    isMatch: f,
                    score: g,
                    indices: k
                } = function(e, t, r, {
                    location: s = m.location,
                    distance: i = m.distance,
                    threshold: n = m.threshold,
                    findAllMatches: a = m.findAllMatches,
                    minMatchCharLength: o = m.minMatchCharLength,
                    includeMatches: l = m.includeMatches,
                    ignoreLocation: u = m.ignoreLocation
                } = {}) {
                    let c;
                    if (t.length > 32) throw Error("Pattern length exceeds max of 32.");
                    let d = t.length,
                        p = e.length,
                        h = Math.max(0, Math.min(s, p)),
                        f = n,
                        g = h,
                        k = (e, t) => {
                            let r = e / d;
                            if (u) return r;
                            let s = Math.abs(h - t);
                            return i ? r + s / i : s ? 1 : r
                        },
                        y = o > 1 || l,
                        S = y ? Array(p) : [];
                    for (;
                        (c = e.indexOf(t, g)) > -1;)
                        if (f = Math.min(k(0, c), f), g = c + d, y) {
                            let e = 0;
                            for (; e < d;) S[c + e] = 1, e += 1
                        }
                    g = -1;
                    let w = [],
                        v = 1,
                        _ = d + p,
                        b = 1 << d - 1;
                    for (let t = 0; t < d; t += 1) {
                        let s = 0,
                            i = _;
                        for (; s < i;) k(t, h + i) <= f ? s = i : _ = i, i = Math.floor((_ - s) / 2 + s);
                        _ = i;
                        let n = Math.max(1, h - i + 1),
                            o = a ? p : Math.min(h + i, p) + d,
                            l = Array(o + 2);
                        l[o + 1] = (1 << t) - 1;
                        for (let s = o; s >= n; s -= 1) {
                            let i = s - 1,
                                a = r[e[i]];
                            if (y && (S[i] = +!!a), l[s] = (l[s + 1] << 1 | 1) & a, t && (l[s] |= (w[s + 1] | w[s]) << 1 | 1 | w[s + 1]), l[s] & b && (v = k(t, i)) <= f) {
                                if (f = v, (g = i) <= h) break;
                                n = Math.max(1, 2 * h - g)
                            }
                        }
                        if (k(t + 1, h) > f) break;
                        w = l
                    }
                    let M = {
                        isMatch: g >= 0,
                        score: Math.max(.001, v)
                    };
                    if (y) {
                        let e = function(e = [], t = m.minMatchCharLength) {
                            let r = [],
                                s = -1,
                                i = -1,
                                n = 0;
                            for (let a = e.length; n < a; n += 1) {
                                let a = e[n];
                                a && -1 === s ? s = n : a || -1 === s || ((i = n - 1) - s + 1 >= t && r.push([s, i]), s = -1)
                            }
                            return e[n - 1] && n - s >= t && r.push([s, n - 1]), r
                        }(S, o);
                        e.length ? l && (M.indices = e) : M.isMatch = !1
                    }
                    return M
                }(e, t, r, {
                    location: i + h,
                    distance: n,
                    threshold: a,
                    findAllMatches: o,
                    minMatchCharLength: l,
                    includeMatches: s,
                    ignoreLocation: u
                });
                f && (p = !0), d += g, f && k && c.push(...k)
            });
            let h = {
                isMatch: p,
                score: p ? d / this.chunks.length : 1
            };
            return p && s && (h.indices = y(c)), h
        }
    }
    class b {
        constructor(e) {
            this.pattern = e
        }
        static isMultiMatch(e) {
            return M(e, this.multiRegex)
        }
        static isSingleMatch(e) {
            return M(e, this.singleRegex)
        }
        search(e) {
            return {
                isMatch: !1,
                score: 1
            }
        }
    }

    function M(e, t) {
        let r = e.match(t);
        return r ? r[1] : null
    }
    class T extends b {
        constructor(e, {
            location: t = m.location,
            threshold: r = m.threshold,
            distance: s = m.distance,
            includeMatches: i = m.includeMatches,
            findAllMatches: n = m.findAllMatches,
            minMatchCharLength: a = m.minMatchCharLength,
            isCaseSensitive: o = m.isCaseSensitive,
            ignoreDiacritics: l = m.ignoreDiacritics,
            ignoreLocation: u = m.ignoreLocation
        } = {}) {
            super(e), this._bitapSearch = new _(e, {
                location: t,
                threshold: r,
                distance: s,
                includeMatches: i,
                findAllMatches: n,
                minMatchCharLength: a,
                isCaseSensitive: o,
                ignoreDiacritics: l,
                ignoreLocation: u
            })
        }
        static get type() {
            return "fuzzy"
        }
        static get multiRegex() {
            return /^"(.*)"$/
        }
        static get singleRegex() {
            return /^(.*)$/
        }
        search(e) {
            return this._bitapSearch.searchIn(e)
        }
    }
    class A extends b {
        constructor(e) {
            super(e)
        }
        static get type() {
            return "include"
        }
        static get multiRegex() {
            return /^'"(.*)"$/
        }
        static get singleRegex() {
            return /^'(.*)$/
        }
        search(e) {
            let t, r = 0,
                s = [],
                i = this.pattern.length;
            for (;
                (t = e.indexOf(this.pattern, r)) > -1;) r = t + i, s.push([t, r - 1]);
            let n = !!s.length;
            return {
                isMatch: n,
                score: +!n,
                indices: s
            }
        }
    }
    let I = [class extends b {
            constructor(e) {
                super(e)
            }
            static get type() {
                return "exact"
            }
            static get multiRegex() {
                return /^="(.*)"$/
            }
            static get singleRegex() {
                return /^=(.*)$/
            }
            search(e) {
                let t = e === this.pattern;
                return {
                    isMatch: t,
                    score: +!t,
                    indices: [0, this.pattern.length - 1]
                }
            }
        }, A, class extends b {
            constructor(e) {
                super(e)
            }
            static get type() {
                return "prefix-exact"
            }
            static get multiRegex() {
                return /^\^"(.*)"$/
            }
            static get singleRegex() {
                return /^\^(.*)$/
            }
            search(e) {
                let t = e.startsWith(this.pattern);
                return {
                    isMatch: t,
                    score: +!t,
                    indices: [0, this.pattern.length - 1]
                }
            }
        }, class extends b {
            constructor(e) {
                super(e)
            }
            static get type() {
                return "inverse-prefix-exact"
            }
            static get multiRegex() {
                return /^!\^"(.*)"$/
            }
            static get singleRegex() {
                return /^!\^(.*)$/
            }
            search(e) {
                let t = !e.startsWith(this.pattern);
                return {
                    isMatch: t,
                    score: +!t,
                    indices: [0, e.length - 1]
                }
            }
        }, class extends b {
            constructor(e) {
                super(e)
            }
            static get type() {
                return "inverse-suffix-exact"
            }
            static get multiRegex() {
                return /^!"(.*)"\$$/
            }
            static get singleRegex() {
                return /^!(.*)\$$/
            }
            search(e) {
                let t = !e.endsWith(this.pattern);
                return {
                    isMatch: t,
                    score: +!t,
                    indices: [0, e.length - 1]
                }
            }
        }, class extends b {
            constructor(e) {
                super(e)
            }
            static get type() {
                return "suffix-exact"
            }
            static get multiRegex() {
                return /^"(.*)"\$$/
            }
            static get singleRegex() {
                return /^(.*)\$$/
            }
            search(e) {
                let t = e.endsWith(this.pattern);
                return {
                    isMatch: t,
                    score: +!t,
                    indices: [e.length - this.pattern.length, e.length - 1]
                }
            }
        }, class extends b {
            constructor(e) {
                super(e)
            }
            static get type() {
                return "inverse-exact"
            }
            static get multiRegex() {
                return /^!"(.*)"$/
            }
            static get singleRegex() {
                return /^!(.*)$/
            }
            search(e) {
                let t = -1 === e.indexOf(this.pattern);
                return {
                    isMatch: t,
                    score: +!t,
                    indices: [0, e.length - 1]
                }
            }
        }, T],
        x = I.length,
        D = new Set([T.type, A.type]),
        C = [];

    function E(...e) {
        C.push(...e)
    }

    function P(e, t) {
        for (let r = 0, s = C.length; r < s; r += 1) {
            let s = C[r];
            if (s.condition(e, t)) return new s(e, t)
        }
        return new _(e, t)
    }
    let F = "$and",
        L = "$path",
        B = e => !!(e[F] || e.$or),
        O = e => ({
            [F]: Object.keys(e).map(t => ({
                [t]: e[t]
            }))
        });

    function H(e, r, {
        auto: i = !0
    } = {}) {
        let a = e => {
            if (s(e)) {
                let t = {
                    keyId: null,
                    pattern: e
                };
                return i && (t.searcher = P(e, r)), t
            }
            let o = Object.keys(e),
                l = !!e[L];
            if (!l && o.length > 1 && !B(e)) return a(O(e));
            if (!t(e) && n(e) && !B(e)) {
                let t = l ? e[L] : o[0],
                    n = l ? e.$val : e[t];
                if (!s(n)) throw Error(`Invalid value for key ${t}`);
                let a = {
                    keyId: h(t),
                    pattern: n
                };
                return i && (a.searcher = P(n, r)), a
            }
            let u = {
                children: [],
                operator: o[0]
            };
            return o.forEach(r => {
                let s = e[r];
                t(s) && s.forEach(e => {
                    u.children.push(a(e))
                })
            }), u
        };
        return B(e) || (e = O(e)), a(e)
    }

    function N(e, {
        ignoreFieldNorm: t = m.ignoreFieldNorm
    }) {
        let r = 1;
        return e.forEach(({
            key: e,
            norm: s,
            score: i
        }) => {
            let n = e ? e.weight : null;
            r *= Math.pow(0 === i && n ? Number.EPSILON : i, (n || 1) * (t ? 1 : s))
        }), r
    }
    class R {
        constructor(e) {
            this.limit = e, this.heap = []
        }
        get size() {
            return this.heap.length
        }
        shouldInsert(e) {
            return this.size < this.limit || e < this.heap[0].score
        }
        insert(e) {
            this.size < this.limit ? (this.heap.push(e), this._bubbleUp(this.size - 1)) : e.score < this.heap[0].score && (this.heap[0] = e, this._sinkDown(0))
        }
        extractSorted(e) {
            return this.heap.sort(e)
        }
        _bubbleUp(e) {
            let t = this.heap;
            for (; e > 0;) {
                let r = e - 1 >> 1;
                if (t[e].score <= t[r].score) break;
                let s = t[e];
                t[e] = t[r], t[r] = s, e = r
            }
        }
        _sinkDown(e) {
            let t = this.heap,
                r = t.length,
                s = e;
            do {
                let i = 2 * (e = s) + 1,
                    n = 2 * e + 2;
                if (i < r && t[i].score > t[s].score && (s = i), n < r && t[n].score > t[s].score && (s = n), s !== e) {
                    let r = t[e];
                    t[e] = t[s], t[s] = r
                }
            } while (s !== e)
        }
    }

    function W(e, t) {
        let r = e.matches;
        t.matches = [], a(r) && r.forEach(e => {
            if (!a(e.indices) || !e.indices.length) return;
            let {
                indices: r,
                value: s
            } = e, i = {
                indices: r,
                value: s
            };
            e.key && (i.key = e.key.src), e.idx > -1 && (i.refIndex = e.idx), t.matches.push(i)
        })
    }

    function z(e, t) {
        t.score = e.score
    }
    let $ = /\b\w+\b/g;

    function q({
        isCaseSensitive: e = !1,
        ignoreDiacritics: t = !1
    } = {}) {
        return {
            tokenize: r => (e || (r = r.toLowerCase()), t && (r = v(r)), r.match($) || [])
        }
    }

    function j(e, t) {
        for (let [r, s] of e.terms) {
            let i = s.filter(e => e.docIdx !== t),
                n = s.length - i.length;
            n > 0 && (e.fieldCount -= n, e.df.set(r, (e.df.get(r) || 0) - n), 0 === i.length ? (e.terms.delete(r), e.df.delete(r)) : e.terms.set(r, i))
        }
    }
    class U {
        constructor(e, t, r) {
            this.options = { ...m,
                ...t
            }, this.options.useExtendedSearch, this.options.useTokenSearch, this._keyStore = new c(this.options.keys), this._docs = e, this._myIndex = null, this._invertedIndex = null, this.setCollection(e, r), this._lastQuery = null, this._lastSearcher = null
        }
        _getSearcher(e) {
            if (this._lastQuery === e) return this._lastSearcher;
            let t = P(e, this._invertedIndex ? { ...this.options,
                _invertedIndex: this._invertedIndex
            } : this.options);
            return this._lastQuery = e, this._lastSearcher = t, t
        }
        setCollection(e, t) {
            if (this._docs = e, t && !(t instanceof g)) throw Error("Incorrect 'index' type");
            if (this._myIndex = t || k(this.options.keys, this._docs, {
                    getFn: this.options.getFn,
                    fieldNormWeight: this.options.fieldNormWeight
                }), this.options.useTokenSearch) {
                let e = q({
                    isCaseSensitive: this.options.isCaseSensitive,
                    ignoreDiacritics: this.options.ignoreDiacritics
                });
                this._invertedIndex = function(e, t, r) {
                    let s = new Map,
                        i = new Map,
                        n = 0;

                    function a(e, t, a, o) {
                        let l = r.tokenize(e);
                        if (!l.length) return;
                        n++;
                        let u = new Map;
                        for (let e of l) u.set(e, (u.get(e) || 0) + 1);
                        for (let [e, r] of u) {
                            let n = {
                                    docIdx: t,
                                    keyIdx: a,
                                    subIdx: o,
                                    tf: r
                                },
                                l = s.get(e);
                            l || (l = [], s.set(e, l)), l.push(n), i.set(e, (i.get(e) || 0) + 1)
                        }
                    }
                    for (let r of e) {
                        let {
                            i: e,
                            v: s,
                            $: i
                        } = r;
                        if (void 0 !== s) {
                            a(s, e, -1, -1);
                            continue
                        }
                        if (i)
                            for (let r = 0; r < t; r++) {
                                let t = i[r];
                                if (t)
                                    if (Array.isArray(t))
                                        for (let s of t) a(s.v, e, r, s.i ? ? -1);
                                    else a(t.v, e, r, -1)
                            }
                    }
                    return {
                        terms: s,
                        fieldCount: n,
                        df: i
                    }
                }(this._myIndex.records, this._myIndex.keys.length, e)
            }
        }
        add(e) {
            if (a(e) && (this._docs.push(e), this._myIndex.add(e), this._invertedIndex)) {
                let e = this._myIndex.records[this._myIndex.records.length - 1],
                    t = q({
                        isCaseSensitive: this.options.isCaseSensitive,
                        ignoreDiacritics: this.options.ignoreDiacritics
                    });
                ! function(e, t, r, s) {
                    let {
                        i: i,
                        v: n,
                        $: a
                    } = t;

                    function o(t, r, n) {
                        let a = s.tokenize(t);
                        if (!a.length) return;
                        e.fieldCount++;
                        let o = new Map;
                        for (let e of a) o.set(e, (o.get(e) || 0) + 1);
                        for (let [t, s] of o) {
                            let a = {
                                    docIdx: i,
                                    keyIdx: r,
                                    subIdx: n,
                                    tf: s
                                },
                                o = e.terms.get(t);
                            o || (o = [], e.terms.set(t, o)), o.push(a), e.df.set(t, (e.df.get(t) || 0) + 1)
                        }
                    }
                    if (void 0 !== n) return o(n, -1, -1);
                    if (a)
                        for (let e = 0; e < r; e++) {
                            let t = a[e];
                            if (t)
                                if (Array.isArray(t))
                                    for (let r of t) o(r.v, e, r.i ? ? -1);
                                else o(t.v, e, -1)
                        }
                }(this._invertedIndex, e, this._myIndex.keys.length, t)
            }
        }
        remove(e = () => !1) {
            let t = [],
                r = [];
            for (let s = 0, i = this._docs.length; s < i; s += 1) e(this._docs[s], s) && (t.push(this._docs[s]), r.push(s));
            if (r.length) {
                if (this._invertedIndex)
                    for (let e of r) j(this._invertedIndex, e);
                for (let e = r.length - 1; e >= 0; e -= 1) this._docs.splice(r[e], 1);
                this._myIndex.removeAll(r)
            }
            return t
        }
        removeAt(e) {
            this._invertedIndex && j(this._invertedIndex, e);
            let t = this._docs.splice(e, 1)[0];
            return this._myIndex.removeAt(e), t
        }
        getIndex() {
            return this._myIndex
        }
        search(e, t) {
            let r, {
                    limit: n = -1
                } = t || {},
                {
                    includeMatches: a,
                    includeScore: o,
                    shouldSort: l,
                    sortFn: u,
                    ignoreFieldNorm: c
                } = this.options;
            if (s(e) && !e.trim()) {
                let e = this._docs.map((e, t) => ({
                    item: e,
                    refIndex: t
                }));
                return i(n) && n > -1 && (e = e.slice(0, n)), e
            }
            if (i(n) && n > 0 && s(e)) {
                let t = new R(n);
                s(this._docs[0]) ? this._searchStringList(e, {
                    heap: t,
                    ignoreFieldNorm: c
                }) : this._searchObjectList(e, {
                    heap: t,
                    ignoreFieldNorm: c
                }), r = t.extractSorted(u)
            } else ! function(e, {
                ignoreFieldNorm: t = m.ignoreFieldNorm
            }) {
                e.forEach(e => {
                    e.score = N(e.matches, {
                        ignoreFieldNorm: t
                    })
                })
            }(r = s(e) ? s(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e), {
                ignoreFieldNorm: c
            }), l && r.sort(u), i(n) && n > -1 && (r = r.slice(0, n));
            return function(e, t, {
                includeMatches: r = m.includeMatches,
                includeScore: s = m.includeScore
            } = {}) {
                let i = [];
                return r && i.push(W), s && i.push(z), e.map(e => {
                    let {
                        idx: r
                    } = e, s = {
                        item: t[r],
                        refIndex: r
                    };
                    return i.length && i.forEach(t => {
                        t(e, s)
                    }), s
                })
            }(r, this._docs, {
                includeMatches: a,
                includeScore: o
            })
        }
        _searchStringList(e, {
            heap: t,
            ignoreFieldNorm: r
        } = {}) {
            let s = this._getSearcher(e),
                {
                    records: i
                } = this._myIndex,
                n = t ? null : [];
            return i.forEach(({
                v: e,
                i: i,
                n: o
            }) => {
                if (!a(e)) return;
                let {
                    isMatch: l,
                    score: u,
                    indices: c
                } = s.searchIn(e);
                if (l) {
                    let s = {
                        item: e,
                        idx: i,
                        matches: [{
                            score: u,
                            value: e,
                            norm: o,
                            indices: c
                        }]
                    };
                    t ? (s.score = N(s.matches, {
                        ignoreFieldNorm: r
                    }), t.shouldInsert(s.score) && t.insert(s)) : n.push(s)
                }
            }), n
        }
        _searchLogical(e) {
            let t = H(e, this.options),
                r = (e, t, s) => {
                    if (!("children" in e)) {
                        let r, {
                            keyId: i,
                            searcher: n
                        } = e;
                        return (null === i ? (r = [], this._myIndex.keys.forEach((e, s) => {
                            r.push(...this._findMatches({
                                key: e,
                                value: t[s],
                                searcher: n
                            }))
                        })) : r = this._findMatches({
                            key: this._keyStore.get(i),
                            value: this._myIndex.getValueForItemAtKeyId(t, i),
                            searcher: n
                        }), r && r.length) ? [{
                            idx: s,
                            item: t,
                            matches: r
                        }] : []
                    }
                    let {
                        children: i,
                        operator: n
                    } = e, a = [];
                    for (let e = 0, o = i.length; e < o; e += 1) {
                        let o = r(i[e], t, s);
                        if (o.length) a.push(...o);
                        else if (n === F) return []
                    }
                    return a
                },
                s = this._myIndex.records,
                i = new Map,
                n = [];
            return s.forEach(({
                $: e,
                i: s
            }) => {
                if (a(e)) {
                    let a = r(t, e, s);
                    a.length && (i.has(s) || (i.set(s, {
                        idx: s,
                        item: e,
                        matches: []
                    }), n.push(i.get(s))), a.forEach(({
                        matches: e
                    }) => {
                        i.get(s).matches.push(...e)
                    }))
                }
            }), n
        }
        _searchObjectList(e, {
            heap: t,
            ignoreFieldNorm: r
        } = {}) {
            let s = this._getSearcher(e),
                {
                    keys: i,
                    records: n
                } = this._myIndex,
                o = t ? null : [];
            return n.forEach(({
                $: e,
                i: n
            }) => {
                if (!a(e)) return;
                let l = [],
                    u = !1,
                    c = !1;
                if (i.forEach((t, r) => {
                        let i = this._findMatches({
                            key: t,
                            value: e[r],
                            searcher: s
                        });
                        i.length ? (l.push(...i), i[0].hasInverse && (c = !0)) : u = !0
                    }), (!c || !u) && l.length) {
                    let s = {
                        idx: n,
                        item: e,
                        matches: l
                    };
                    t ? (s.score = N(s.matches, {
                        ignoreFieldNorm: r
                    }), t.shouldInsert(s.score) && t.insert(s)) : o.push(s)
                }
            }), o
        }
        _findMatches({
            key: e,
            value: r,
            searcher: s
        }) {
            if (!a(r)) return [];
            let i = [];
            if (t(r)) r.forEach(({
                v: t,
                i: r,
                n: n
            }) => {
                if (!a(t)) return;
                let {
                    isMatch: o,
                    score: l,
                    indices: u,
                    hasInverse: c
                } = s.searchIn(t);
                o && i.push({
                    score: l,
                    key: e,
                    value: t,
                    idx: r,
                    norm: n,
                    indices: u,
                    hasInverse: c
                })
            });
            else {
                let {
                    v: t,
                    n: n
                } = r, {
                    isMatch: a,
                    score: o,
                    indices: l,
                    hasInverse: u
                } = s.searchIn(t);
                a && i.push({
                    score: o,
                    key: e,
                    value: t,
                    norm: n,
                    indices: l,
                    hasInverse: u
                })
            }
            return i
        }
    }
    U.version = "7.3.0", U.createIndex = k, U.parseIndex = function(e, {
        getFn: t = m.getFn,
        fieldNormWeight: r = m.fieldNormWeight
    } = {}) {
        let {
            keys: s,
            records: i
        } = e, n = new g({
            getFn: t,
            fieldNormWeight: r
        });
        return n.setKeys(s), n.setIndexRecords(i), n
    }, U.config = m, U.match = function(e, t, r) {
        return P(e, { ...m,
            ...r
        }).searchIn(t)
    }, U.parseQuery = H, E(class {
        constructor(e, {
            isCaseSensitive: t = m.isCaseSensitive,
            ignoreDiacritics: r = m.ignoreDiacritics,
            includeMatches: s = m.includeMatches,
            minMatchCharLength: i = m.minMatchCharLength,
            ignoreLocation: n = m.ignoreLocation,
            findAllMatches: a = m.findAllMatches,
            location: o = m.location,
            threshold: l = m.threshold,
            distance: u = m.distance
        } = {}) {
            this.query = null, this.options = {
                isCaseSensitive: t,
                ignoreDiacritics: r,
                includeMatches: s,
                minMatchCharLength: i,
                findAllMatches: a,
                ignoreLocation: n,
                location: o,
                threshold: l,
                distance: u
            }, e = t ? e : e.toLowerCase(), e = r ? v(e) : e, this.pattern = e, this.query = function(e, t = {}) {
                return e.replace(/\\\|/g, "\0").split("|").map(e => {
                    let r = (function(e) {
                            let t = [],
                                r = e.length,
                                s = 0;
                            for (; s < r;) {
                                for (; s < r && " " === e[s];) s++;
                                if (s >= r) break;
                                let i = s;
                                for (; i < r && " " !== e[i] && '"' !== e[i];) i++;
                                if (i < r && '"' === e[i]) {
                                    for (i++; i < r;) {
                                        if ('"' === e[i]) {
                                            let t = i + 1;
                                            if (t >= r || " " === e[t]) {
                                                i++;
                                                break
                                            }
                                            if ("$" === e[t] && (t + 1 >= r || " " === e[t + 1])) {
                                                i += 2;
                                                break
                                            }
                                        }
                                        i++
                                    }
                                    t.push(e.substring(s, i)), s = i
                                } else {
                                    for (; i < r && " " !== e[i];) i++;
                                    t.push(e.substring(s, i)), s = i
                                }
                            }
                            return t
                        })(e.replace(/\u0000/g, "|").trim()).filter(e => e && !!e.trim()),
                        s = [];
                    for (let e = 0, i = r.length; e < i; e += 1) {
                        let i = r[e],
                            n = !1,
                            a = -1;
                        for (; !n && ++a < x;) {
                            let e = I[a],
                                r = e.isMultiMatch(i);
                            r && (s.push(new e(r, t)), n = !0)
                        }
                        if (!n)
                            for (a = -1; ++a < x;) {
                                let e = I[a],
                                    r = e.isSingleMatch(i);
                                if (r) {
                                    s.push(new e(r, t));
                                    break
                                }
                            }
                    }
                    return s
                })
            }(this.pattern, this.options)
        }
        static condition(e, t) {
            return t.useExtendedSearch
        }
        searchIn(e) {
            let t = this.query;
            if (!t) return {
                isMatch: !1,
                score: 1
            };
            let {
                includeMatches: r,
                isCaseSensitive: s,
                ignoreDiacritics: i
            } = this.options;
            e = s ? e : e.toLowerCase(), e = i ? v(e) : e;
            let n = 0,
                a = [],
                o = 0,
                l = !1;
            for (let s = 0, i = t.length; s < i; s += 1) {
                let i = t[s];
                a.length = 0, n = 0, l = !1;
                for (let t = 0, s = i.length; t < s; t += 1) {
                    let s = i[t],
                        {
                            isMatch: u,
                            indices: c,
                            score: d
                        } = s.search(e);
                    if (u) {
                        n += 1, o += d;
                        let e = s.constructor.type;
                        e.startsWith("inverse") && (l = !0), r && (D.has(e) ? a.push(...c) : a.push(c))
                    } else {
                        o = 0, n = 0, a.length = 0, l = !1;
                        break
                    }
                }
                if (n) {
                    let e = {
                        isMatch: !0,
                        score: o / n
                    };
                    return l && (e.hasInverse = !0), r && (e.indices = y(a)), e
                }
            }
            return {
                isMatch: !1,
                score: 1
            }
        }
    }), E(class {
        static condition(e, t) {
            return t.useTokenSearch
        }
        constructor(e, t) {
            this.options = t, this.analyzer = q({
                isCaseSensitive: t.isCaseSensitive,
                ignoreDiacritics: t.ignoreDiacritics
            });
            const r = this.analyzer.tokenize(e),
                {
                    df: s,
                    fieldCount: i
                } = t._invertedIndex;
            for (const e of (this.termSearchers = [], this.idfWeights = [], r)) {
                this.termSearchers.push(new _(e, {
                    location: t.location,
                    threshold: t.threshold,
                    distance: t.distance,
                    includeMatches: t.includeMatches,
                    findAllMatches: t.findAllMatches,
                    minMatchCharLength: t.minMatchCharLength,
                    isCaseSensitive: t.isCaseSensitive,
                    ignoreDiacritics: t.ignoreDiacritics,
                    ignoreLocation: !0
                }));
                const r = s.get(e) || 0,
                    n = Math.log(1 + (i - r + .5) / (r + .5));
                this.idfWeights.push(n)
            }
        }
        searchIn(e) {
            if (!this.termSearchers.length) return {
                isMatch: !1,
                score: 1
            };
            let t = [],
                r = 0,
                s = 0,
                i = 0;
            for (let n = 0; n < this.termSearchers.length; n++) {
                let a = this.termSearchers[n].searchIn(e),
                    o = this.idfWeights[n];
                s += o, a.isMatch && (i++, r += o * (1 - a.score), a.indices && t.push(...a.indices))
            }
            if (0 === i) return {
                isMatch: !1,
                score: 1
            };
            let n = {
                isMatch: !0,
                score: Math.max(.001, s > 0 ? 1 - r / s : 0)
            };
            return this.options.includeMatches && t.length && (n.indices = y(t)), n
        }
    }), U.use = function(...e) {
        e.forEach(e => E(e))
    }, e.s(["default", 0, U], 321116);
    let V = e => e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim(),
        K = e => {
            let t = e.bestLines ? .find(e => "tier" === e.lineType);
            return t ? .line ? ? null
        },
        Q = {
            s: 1,
            a: 2,
            b: 3,
            c: 4,
            d: 5
        },
        G = e => e.eventMetadata ? .league;
    e.s(["createEventSelector", 0, e => t => e.reduce((e, r) => (e[r] = t ? .[r], e), {}), "createGameSelector", 0, e => t => e.reduce((e, r) => (e[r] = t ? .[r], e), {}), "doesEventMatchSearch", 0, (e, t) => {
        if (!e) return !1;
        if (!t.trim()) return !0;
        let r = V(t),
            s = [e.title ? ? "", e.slug ? ? ""];
        for (let t of e.markets ? ? []) {
            if (t.question && s.push(t.question), t.groupItemTitle && s.push(t.groupItemTitle), t.outcomes)
                for (let e of t.outcomes) s.push(e);
            if (t.teams)
                for (let e of t.teams) e.name && s.push(e.name), e.abbreviation && s.push(e.abbreviation), e.alias && s.push(e.alias)
        }
        let i = V(s.join(" "));
        if (i.includes(r)) return !0;
        let n = i.split(/\s+/).filter(Boolean),
            a = r.split(/\s+/).filter(Boolean),
            o = new U(n, {
                threshold: .4
            });
        return a.every(e => o.search(e).length > 0)
    }, "doesEventMatchTier", 0, (e, t) => {
        if (!e) return !1;
        if ("all" === t) return !0;
        let r = Q[t],
            s = K(e);
        return null !== s && s === r
    }, "doesEventMatchTournament", 0, (e, t) => !!e && ("all" === t || G(e) === t), "eventsSelector", 0, e => {
        var t, r;
        return t = ((e, t) => {
            if ("all" === t) return e;
            let r = Q[t];
            return e.filter(e => {
                let t = K(e);
                return null !== t && t === r
            })
        })(Object.values(e.events), e.tierFilter), "all" === (r = e.tournamentFilter) ? t : t.filter(e => G(e) === r)
    }, "getAvailableTournaments", 0, e => {
        let t = new Set;
        for (let r of Object.values(e)) {
            let e = G(r);
            e && t.add(e)
        }
        return [...t].sort()
    }, "teamColorsSelector", 0, e => {
        if (e.home ? .color && e.away ? .color) return [e.home.color, e.away.color]
    }], 826341)
}, 840216, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        s = e.i(604777),
        i = e.i(416340),
        n = e.i(575339),
        a = e.i(593332),
        o = e.i(336896),
        l = e.i(461327),
        u = e.i(165974),
        c = e.i(996076),
        d = e.i(935786),
        p = e.i(476979);
    let h = (e, t) => ({ ...t,
            oddsFormat: e.oddsFormat ? ? t.oddsFormat,
            cardView: e.cardView ? ? t.cardView,
            sportsViewSetting: e.sportsViewSetting ? ? t.sportsViewSetting
        }),
        m = ({
            sportSlug: e,
            state: t
        }) => {
            let {
                dragItems: r,
                hiddenDragItems: s,
                eventOrder: i
            } = (0, c.getCachedDragItemsFromStoreCache)({
                events: t.events,
                sections: t.sections,
                sportSlug: e,
                mode: "desktop",
                sportsHeaders: t.sportsHeaders
            });
            t.dragItems = r, t.hiddenDragItems = s, t.eventOrder = i
        },
        f = e => (0, n.createWithEqualityFn)()((0, l.persist)((0, u.immer)((t, r) => ({ ...(e => {
                var t;
                let r, s = e.events ? ? {},
                    i = Object.values(s).reduce((e, t) => {
                        try {
                            let r = !1;
                            if (Array.isArray(t.markets) && t.markets.forEach(s => {
                                    let i = s.gameId;
                                    i && (e[i.toString()] = t.slug, r = !0)
                                }), !r) {
                                let r = t.gameId ? .toString();
                                r && (e[r] = t.slug)
                            }
                        } catch {}
                        return e
                    }, {}),
                    n = e ? .sections ? ? {
                        live: {},
                        soon: {},
                        delayed: {},
                        expanded: {},
                        hidden: {}
                    },
                    {
                        sportSlug: o
                    } = e,
                    {
                        dragItems: l,
                        hiddenDragItems: u,
                        eventOrder: h
                    } = (0, c.getCachedDragItemsFromStoreCache)({
                        events: s,
                        sections: n,
                        sportSlug: o,
                        sportsHeaders: e.sportsHeaders
                    }),
                    {
                        marketsSections: m,
                        marketsSectionsState: f
                    } = (0, c.getSportsMarketsForEvents)({
                        events: s,
                        initialSpreadMarket: e.initialSpreadMarket,
                        initialTotalMarket: e.initialTotalMarket
                    });
                return {
                    summary: e ? .summary ? ? void 0,
                    games: e ? .games ? ? {},
                    events: s,
                    parentToChildEventIds: e ? .parentToChildEventIds ? ? {},
                    teams: e ? .teams ? ? {},
                    gameIdToSlug: i,
                    sections: n,
                    status: (r = (t = { ...e,
                        events: s
                    }).events && t.teams && t.games, t.sportSlug === a.SportSlug.LIVE && r || t.secondarySlug === a.SecondarySlug.GAMES && r && (t.summary || (0, p.isSportCategory)(t.sportSlug)) ? "success" : "pending"),
                    fetchStatus: "idle",
                    error: void 0,
                    sportSlug: o,
                    secondarySlug: e ? .secondarySlug,
                    week: e ? .week ? ? (e ? .summary ? (0, d.getLatestWeek)(e.summary) : void 0),
                    evt: e ? .evt,
                    oddsFormat: "price",
                    cardView: "aggregate",
                    dragItems: l,
                    hiddenDragItems: u,
                    eventOrder: h,
                    marketsSections: m,
                    marketsSectionsState: f,
                    overlayAccordionValue: "",
                    gamesAccordionValue: "",
                    sportsViewSetting: "aggregate",
                    tierFilter: "all",
                    tournamentFilter: e ? .tournamentFilter ? ? "all",
                    searchQuery: "",
                    sportsHeaders: e ? .sportsHeaders
                }
            })(e),
            applyUpdates: e => {
                t(t => {
                    e.forEach(e => {
                        let r = (() => {
                            if (e.slug) return e.slug;
                            if (e.gameId) {
                                let r = e.gameId.toString();
                                return t.gameIdToSlug[r]
                            }
                        })();
                        if (!r) return;
                        let {
                            slug: s,
                            ...i
                        } = e, {
                            home: n,
                            away: o
                        } = (0, c.parseScore)(i.score), l = (0, c.hasGameStarted)({
                            update: { ...e,
                                slug: r
                            },
                            state: t
                        }), u = (0, c.hasGameEnded)({
                            update: { ...e,
                                slug: r
                            },
                            state: t
                        });
                        l ? (({
                            update: e,
                            state: t
                        }) => {
                            let {
                                slug: r,
                                ...s
                            } = e;
                            if (t.games[r] = { ...t.games[r],
                                    ...s,
                                    gameState: a.GameState.Live
                                }, t.events[r]) {
                                let e = (0, c.applyGameStateToEvent)({
                                    event: t.events[r],
                                    game: t.games[r]
                                });
                                t.events[r] = e
                            }
                            t.sections = (0, c.createSportsSections)({
                                events: t.events,
                                teams: (0, c.convertTeamsRecordToTeamMap)(t.teams),
                                games: t.games,
                                sportSlug: t.sportSlug
                            }), m({
                                sportSlug: t.sportSlug,
                                state: t
                            })
                        })({
                            update: { ...e,
                                slug: r
                            },
                            state: t
                        }) : u ? (({
                            update: e,
                            state: t
                        }) => {
                            let {
                                slug: r,
                                ...s
                            } = e, i = "POST" === e.period;
                            if (t.games[r] = { ...t.games[r],
                                    ...s,
                                    gameState: i ? a.GameState.Postponed : a.GameState.Finished,
                                    result: i ? void 0 : (0, c.getGameResult)(e)
                                }, t.events[r]) {
                                let e = (0, c.applyGameStateToEvent)({
                                    event: t.events[r],
                                    game: t.games[r]
                                });
                                t.events[r] = e
                            }
                            i && (t.sections = (0, c.createSportsSections)({
                                events: t.events,
                                teams: (0, c.convertTeamsRecordToTeamMap)(t.teams),
                                games: t.games,
                                sportSlug: t.sportSlug
                            })), m({
                                sportSlug: t.sportSlug,
                                state: t
                            })
                        })({
                            update: { ...e,
                                slug: r
                            },
                            state: t
                        }) : t.games[r] && (t.games[r] = { ...t.games[r],
                            ...i
                        }), t.teams[r] && (t.teams[r].home.score = n, t.teams[r].away.score = o)
                    })
                })
            },
            setOddsFormat: e => {
                t(t => {
                    t.oddsFormat = e
                })
            },
            setWeek: e => {
                let {
                    sportSlug: t,
                    secondarySlug: s
                } = r(), i = `/sports/${t}`;
                s && (i += `/${s}`), e.week && (i += `/week/${e.week}`), setTimeout(() => {
                    o.default.push(i)
                }, 0)
            },
            setDragItems: e => {
                t(t => {
                    let {
                        mode: r,
                        ...s
                    } = e;
                    (({
                        sections: e,
                        mode: t,
                        state: r,
                        sportsHeaders: s
                    }) => {
                        let {
                            dragItems: i,
                            hiddenDragItems: n,
                            eventOrder: a
                        } = (0, c.getCachedDragItems)(r.sportSlug, t, (0, c.convertSectionsToSportEvents)({
                            sections: e,
                            events: r.events
                        }), s);
                        r.dragItems = i, r.hiddenDragItems = n, r.eventOrder = a
                    })({
                        sections: s,
                        mode: r,
                        state: t,
                        sportsHeaders: t.sportsHeaders
                    })
                })
            },
            setLine: e => {
                t(t => {
                    t.marketsSectionsState[e.slug] && ("child_moneyline" === e.type ? t.marketsSectionsState[e.slug].childMoneyline = e.line : "first_half_spreads" === e.type ? t.marketsSectionsState[e.slug].firstHalfSpreads = e.line : "first_half_totals" === e.type ? t.marketsSectionsState[e.slug].firstHalfTotals = e.line : "first_innings_totals" === e.type ? t.marketsSectionsState[e.slug].firstInningsTotals = e.line : "second_innings_totals" === e.type ? t.marketsSectionsState[e.slug].secondInningsTotals = e.line : "spreads" === e.type ? t.marketsSectionsState[e.slug].spreads = e.line : "totals" === e.type ? t.marketsSectionsState[e.slug].totals = e.line : "nrfi" === e.type ? t.marketsSectionsState[e.slug].nrfi = e.line : "tennis_first_set_totals" === e.type ? t.marketsSectionsState[e.slug].firstSetTotals = e.line : "tennis_match_totals" === e.type ? t.marketsSectionsState[e.slug].matchTotals = e.line : "tennis_set_totals" === e.type ? t.marketsSectionsState[e.slug].setTotals = e.line : "tennis_set_handicap" === e.type ? t.marketsSectionsState[e.slug].setHandicap = e.line : "shooter_rounds_total" === e.type ? t.marketsSectionsState[e.slug].shooterRoundTotals = e.line : "team_totals" === e.type && e.line ? .teamId ? t.marketsSectionsState[e.slug].teamTotals[e.line.teamId] = e.line : "map_handicap" === e.type ? t.marketsSectionsState[e.slug].mapHandicap = e.line : "round_handicap_match" === e.type ? t.marketsSectionsState[e.slug].roundHandicap = e.line : "kill_handicap_match" === e.type ? t.marketsSectionsState[e.slug].killHandicap = e.line : "tower_handicap_match" === e.type ? t.marketsSectionsState[e.slug].towerHandicap = e.line : "drake_handicap_match" === e.type ? t.marketsSectionsState[e.slug].drakeHandicap = e.line : "nashor_handicap_match" === e.type ? t.marketsSectionsState[e.slug].nashorHandicap = e.line : "inhibitor_handicap_match" === e.type ? t.marketsSectionsState[e.slug].inhibitorHandicap = e.line : "barrack_handicap_match" === e.type ? t.marketsSectionsState[e.slug].barrackHandicap = e.line : "round_over_under_match" === e.type ? t.marketsSectionsState[e.slug].roundTotal = e.line : "total_corners" === e.type && (t.marketsSectionsState[e.slug].totalCorners = e.line))
                })
            },
            setCardView: e => {
                t(t => {
                    t.cardView = e
                })
            },
            setSportsViewSetting: e => {
                t(t => {
                    t.sportsViewSetting = e
                })
            },
            setTierFilter: e => {
                t(t => {
                    t.tierFilter = e
                })
            },
            setTournamentFilter: e => {
                t(t => {
                    t.tournamentFilter = e
                })
            },
            setSportsHeaders: e => {
                t(t => {
                    t.sportsHeaders = e;
                    let {
                        dragItems: r,
                        hiddenDragItems: s,
                        eventOrder: i
                    } = (0, c.getCachedDragItemsFromStoreCache)({
                        events: t.events,
                        sections: t.sections,
                        sportSlug: t.sportSlug,
                        sportsHeaders: e
                    });
                    t.dragItems = r, t.hiddenDragItems = s, t.eventOrder = i
                })
            },
            setSearchQuery: e => {
                t(t => {
                    t.searchQuery = e
                })
            },
            setOverlayAccordionValue: e => {
                t(t => {
                    t.overlayAccordionValue = e
                })
            },
            setGamesAccordionValue: e => {
                t(t => {
                    t.gamesAccordionValue = e
                })
            },
            mergeLeagueData: e => {
                t(t => {
                    for (let [r, s] of Object.entries(e.events)) t.events[r] || (t.events[r] = s);
                    for (let [r, s] of Object.entries(e.teams)) t.teams[r] || (t.teams[r] = s);
                    for (let [r, s] of Object.entries(e.games)) t.games[r] || (t.games[r] = s);
                    for (let [r, s] of (Object.assign(t.gameIdToSlug, e.gameIdToSlug), Object.assign(t.parentToChildEventIds, e.parentToChildEventIds), t.sections = e.sections, Object.entries(e.marketsSections))) t.marketsSections[r] || (t.marketsSections[r] = s);
                    for (let [r, s] of Object.entries(e.marketsSectionsState)) t.marketsSectionsState[r] || (t.marketsSectionsState[r] = s);
                    e.summary && (t.summary = e.summary);
                    let {
                        dragItems: r,
                        hiddenDragItems: s,
                        eventOrder: i
                    } = (0, c.getCachedDragItemsFromStoreCache)({
                        events: t.events,
                        sections: t.sections,
                        sportSlug: t.sportSlug,
                        sportsHeaders: t.sportsHeaders
                    });
                    t.dragItems = r, t.hiddenDragItems = s, t.eventOrder = i
                })
            },
            mergeFinishedEvents: e => {
                t(t => {
                    Object.entries(e.events).forEach(([e, r]) => {
                        t.events[e] || (t.events[e] = r)
                    }), Object.entries(e.teams).forEach(([e, r]) => {
                        t.teams[e] || (t.teams[e] = r)
                    }), Object.entries(e.games).forEach(([e, r]) => {
                        t.games[e] || (t.games[e] = r)
                    }), Object.entries(e.marketsSections).forEach(([e, r]) => {
                        t.marketsSections[e] || (t.marketsSections[e] = r)
                    }), Object.entries(e.marketsSectionsState).forEach(([e, r]) => {
                        t.marketsSectionsState[e] || (t.marketsSectionsState[e] = r)
                    })
                })
            }
        })), {
            name: "polymarket.store.sports",
            partialize: e => Object.fromEntries(Object.entries(e).filter(([e]) => ["oddsFormat", "cardView", "sportsViewSetting"].includes(e))),
            version: 1,
            merge: h
        })),
        g = i.default.createContext(null);

    function k(e) {
        let t, n, a, o, l, u, c, d = (0, r.c)(17),
            {
                store: p
            } = e,
            h = (0, s.useTranslations)();
        d[0] !== h ? (t = h("sports.live"), d[0] = h, d[1] = t) : t = d[1], d[2] !== h ? (n = h("sports.startingSoon"), d[2] = h, d[3] = n) : n = d[3], d[4] !== h ? (a = h("sports.upcoming"), d[4] = h, d[5] = a) : a = d[5], d[6] !== h ? (o = h("sports.final"), d[6] = h, d[7] = o) : o = d[7], d[8] !== t || d[9] !== n || d[10] !== a || d[11] !== o ? (l = {
            live: t,
            startingSoon: n,
            upcoming: a,
            final: o
        }, d[8] = t, d[9] = n, d[10] = a, d[11] = o, d[12] = l) : l = d[12];
        let m = l;
        return d[13] !== m || d[14] !== p ? (u = () => {
            let e = p.getState().sportsHeaders;
            (e ? .live !== m.live || e ? .startingSoon !== m.startingSoon || e ? .upcoming !== m.upcoming || e ? .final !== m.final) && p.getState().setSportsHeaders(m)
        }, c = [p, m], d[13] = m, d[14] = p, d[15] = u, d[16] = c) : (u = d[15], c = d[16]), i.default.useEffect(u, c), null
    }
    let y = () => i.default.useContext(g),
        S = f({
            sportSlug: a.SportSlug.LIVE,
            secondarySlug: void 0
        });
    e.s(["SportsStoreProvider", 0, e => {
        let n, o, l, u, c, d, p, h, m = (0, r.c)(22),
            {
                children: y,
                initialState: S
            } = e,
            w = (0, s.useTranslations)();
        m[0] !== w ? (n = w("sports.live"), m[0] = w, m[1] = n) : n = m[1], m[2] !== w ? (o = w("sports.startingSoon"), m[2] = w, m[3] = o) : o = m[3], m[4] !== w ? (l = w("sports.upcoming"), m[4] = w, m[5] = l) : l = m[5], m[6] !== w ? (u = w("sports.final"), m[6] = w, m[7] = u) : u = m[7], m[8] !== n || m[9] !== o || m[10] !== l || m[11] !== u ? (c = {
            live: n,
            startingSoon: o,
            upcoming: l,
            final: u
        }, m[8] = n, m[9] = o, m[10] = l, m[11] = u, m[12] = c) : c = m[12];
        let v = c;
        m[13] !== v || m[14] !== S ? (d = () => f({ ...S || {
                sportSlug: a.SportSlug.LIVE,
                secondarySlug: void 0
            },
            sportsHeaders: v
        }), m[13] = v, m[14] = S, m[15] = d) : d = m[15];
        let [_] = i.default.useState(d);
        return m[16] !== _ ? (p = (0, t.jsx)(k, {
            store: _
        }), m[16] = _, m[17] = p) : p = m[17], m[18] !== y || m[19] !== _ || m[20] !== p ? (h = (0, t.jsxs)(g.Provider, {
            value: _,
            children: [p, y]
        }), m[18] = y, m[19] = _, m[20] = p, m[21] = h) : h = m[21], h
    }, "useBoundSportsStore", 0, y, "useSportsStore", 0, (e, t) => {
        let r = y();
        if (!r) throw Error("useSportsStore must be used within a SportsStoreProvider");
        return (0, n.useStoreWithEqualityFn)(r, e, t)
    }, "useSportsStoreOptional", 0, (e, t) => {
        let r = i.default.useContext(g),
            s = (0, n.useStoreWithEqualityFn)(r ? ? S, e, t);
        if (r) return s
    }], 840216)
}, 100825, e => {
    "use strict";
    e.s(["useBTTS", () => A, "useBarrackMost", () => em, "useChildMoneyline", () => I, "useCricketCompletedMatch", () => F, "useCricketTossWinner", () => E, "useDrakeMost", () => ed, "useFirstHalfMoneyline", () => Z, "useFirstHalfSpread", () => B, "useFirstHalfTotal", () => O, "useFirstInningsTotal", () => H, "useGameExists", () => w, "useInhibitorMost", () => eh, "useKillMost", () => eu, "useMoneylineMarket", () => x, "useMoneylineMarkets", () => D, "useNRFI", () => T, "useNashorMost", () => ep, "useNegRiskSportsMarkets", () => _, "useOddsFormat", () => v, "useScores", () => ev, "useSecondInningsTotal", () => N, "useSelectedBarrackHandicap", () => eo, "useSelectedCricketMatchToGoTill", () => P, "useSelectedDrakeHandicap", () => ei, "useSelectedInhibitorHandicap", () => ea, "useSelectedKillHandicap", () => er, "useSelectedMapHandicap", () => ee, "useSelectedNashorHandicap", () => en, "useSelectedParlay", () => J, "useSelectedRoundHandicap", () => et, "useSelectedRoundTotal", () => el, "useSelectedShooterRoundTotal", () => q, "useSelectedTennisFirstSetTotal", () => R, "useSelectedTennisMatchTotal", () => $, "useSelectedTennisSetHandicap", () => z, "useSelectedTennisSetTotal", () => W, "useSelectedTotalCorner", () => K, "useSelectedTowerHandicap", () => es, "useSelectedUFCMethodOfVictory", () => X, "useShooterFirstPistolRoundWinner", () => Q, "useShooterSecondPistolRoundWinner", () => Y, "useSportSlug", () => y, "useSportsAccordionState", () => ew, "useSportsEventSelector", () => f, "useSportsEventsSelector", () => g, "useSportsGameSelector", () => m, "useSportsMarketsLines", () => ey, "useSportsMarketsSections", () => ek, "useSportsStoreSelector", () => h, "useSportsTeamsColorsSelector", () => k, "useSportsViewSetting", () => eb, "useSpread", () => b, "useSpreadsViewEnabled", () => e_, "useTeamTotal", () => U, "useTeamTotalLines", () => V, "useTeamTotalsGrouped", () => j, "useTennisCompletedMatch", () => L, "useTennisFirstSetWinner", () => C, "useTotal", () => M, "useTowerMost", () => ec, "useUFCGoTheDistance", () => G]);
    var t = e.i(999061),
        r = e.i(909420);
    e.i(416340);
    var s = e.i(233522),
        i = e.i(488758),
        n = e.i(289981),
        a = e.i(476979),
        o = e.i(399336),
        l = e.i(826341),
        u = e.i(996076),
        c = e.i(840216);
    let d = /(\d+)\s*-\s*(\d+)/,
        p = e => {
            if (!e) return;
            let t = e.match(d);
            if (t) return [Number(t[1]), Number(t[2])]
        };

    function h(e, r, s) {
        let i, n = (0, t.c)(4);
        n[0] !== e || n[1] !== r || n[2] !== s ? (i = function(e, t, r) {
            switch (e) {
                case "games":
                case "events":
                case "summary":
                case "status":
                case "fetchStatus":
                case "error":
                case "sportSlug":
                case "secondarySlug":
                case "week":
                case "evt":
                case "teams":
                case "oddsFormat":
                case "tierFilter":
                case "sections":
                    if ("function" == typeof t) return r => t(r[e]);
                    return t => t[e];
                case "teamsForGame":
                    if ("string" != typeof t) throw Error("You must provide a key string when selecting teams.");
                    return e => r ? r(e.teams[t]) : e.teams[t];
                case "game":
                    if ("string" != typeof t) throw Error("You must provide a key string when selecting a game.");
                    return e => r ? r(e.games[t]) : e.games[t];
                case "event":
                    if ("string" != typeof t) throw Error("You must provide a key string when selecting an event.");
                    return e => r ? r(e.events[t]) : e.events[t];
                default:
                    throw Error(`Unknown entity: ${e}`)
            }
        }(e, r, s), n[0] = e, n[1] = r, n[2] = s, n[3] = i) : i = n[3];
        let a = i;
        return (0, c.useSportsStore)(a)
    }

    function m(e, r) {
        let i, n, a = (0, t.c)(5);
        a[0] !== r || a[1] !== e ? (i = t => r ? (0, l.createGameSelector)(r)(t.games[e]) : t.games[e], a[0] = r, a[1] = e, a[2] = i) : i = a[2];
        let o = i,
            u = (0, c.useSportsStoreOptional)(o, s.shallow);
        return a[3] !== u ? (n = u ? ? {}, a[3] = u, a[4] = n) : n = a[4], n
    }

    function f(e, r) {
        let s, i = (0, t.c)(3);
        i[0] !== r || i[1] !== e ? (s = t => r ? (0, l.createEventSelector)(r)(t.events[e]) : t.events[e], i[0] = r, i[1] = e, i[2] = s) : s = i[2];
        let n = s;
        return (0, c.useSportsStoreOptional)(n) ? ? {}
    }

    function g() {
        return (0, c.useSportsStoreOptional)(l.eventsSelector, s.shallow)
    }

    function k(e) {
        let r, i = (0, t.c)(2);
        i[0] !== e ? (r = t => (0, l.teamColorsSelector)(t.teams[e]), i[0] = e, i[1] = r) : r = i[1];
        let n = r;
        return (0, c.useSportsStoreOptional)(n, s.shallow)
    }

    function y() {
        return (0, c.useSportsStoreOptional)(S)
    }

    function S(e) {
        return e.sportSlug
    }

    function w(e) {
        let r, s = (0, t.c)(2);
        s[0] !== e ? (r = t => !!t.games[e] && !!t.teams[e], s[0] = e, s[1] = r) : r = s[1];
        let i = r;
        return (0, c.useSportsStore)(i)
    }

    function v() {
        let e, r = (0, t.c)(2),
            s = h("oddsFormat");
        return r[0] !== s ? (e = {
            oddsFormat: s
        }, r[0] = s, r[1] = e) : e = r[1], e
    }

    function _(e, i) {
        let a, o = (0, t.c)(3);
        o[0] !== i || o[1] !== e ? (a = t => {
            let s = t.events[e];
            if (!s) return [];
            let a = s.markets.filter(e => !(e.sportsMarketType && n.IGNORED_SPORTS_MARKET_TYPES.includes(e.sportsMarketType)) && (e.sportsMarketType ? ? "moneyline") === i);
            return (0, n.isNegRiskSportsMarketType)(i) && 3 === a.length ? (0, r.getNegRiskSportsMarkets)(a) : a
        }, o[0] = i, o[1] = e, o[2] = a) : a = o[2];
        let l = a;
        return (0, c.useSportsStoreOptional)(l, s.shallow) ? ? []
    }
    let b = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasSpreads && r.spreads.length && s.spreads) return (0, u.parseLineWithMarket)({
                    line: s.spreads,
                    type: "spreads",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        M = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasTotals && r.totals.length && s.totals) return (0, u.parseLineWithMarket)({
                    line: s.totals,
                    type: "totals",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        T = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasNRFI && r.nrfi.length && s.nrfi) return (0, u.parseLineWithMarket)({
                    line: s.nrfi,
                    type: "nrfi",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        A = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasBTTS && r.btts.length && s.btts) return (0, u.parseLineWithMarket)({
                    line: s.btts,
                    type: "both_teams_to_score",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        I = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasChildMoneyline && r.childMoneyline.length && s.childMoneyline) return (0, u.parseLineWithMarket)({
                    line: s.childMoneyline,
                    type: "child_moneyline",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        x = e => {
            let r, i, n = (0, t.c)(4);
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (r = ["activeMarket"], n[0] = r) : r = n[0];
            let {
                activeMarket: a
            } = (0, o.useEventActiveMarketContext)(r);
            n[1] !== a || n[2] !== e ? (i = t => {
                let r = t.marketsSections[e];
                if (!r || !r.moneyline) return a;
                let s = (0, u.parseMoneylineWithMarket)({
                    moneyline: r.moneyline,
                    state: t
                });
                return s ? "binary" === s.type ? s.market : s.markets.find(e => e.slug === a.slug) ? ? s.markets[0] ? ? a : a
            }, n[1] = a, n[2] = e, n[3] = i) : i = n[3];
            let l = i;
            return (0, c.useSportsStore)(l, s.shallow)
        },
        D = e => {
            let r, i, n = (0, t.c)(4);
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (r = ["activeMarket"], n[0] = r) : r = n[0];
            let {
                activeMarket: a
            } = (0, o.useEventActiveMarketContext)(r);
            n[1] !== a || n[2] !== e ? (i = t => {
                let r = t.marketsSections[e];
                if (!r || !r.moneyline) return {
                    type: "binary",
                    market: a
                };
                let s = (0, u.parseMoneylineWithMarket)({
                    moneyline: r.moneyline,
                    state: t
                });
                if (!s || "binary" === s.type) return {
                    type: "binary",
                    market: s ? .market ? ? a
                };
                let i = s.markets.find(e => e.slug === a.slug);
                return {
                    type: "neg-risk",
                    markets: s.markets,
                    activeNegRiskMarket: i ? ? s.markets[0] ? ? a
                }
            }, n[1] = a, n[2] = e, n[3] = i) : i = n[3];
            let l = i;
            return (0, c.useSportsStore)(l, s.shallow)
        },
        C = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r || !r.firstSetWinner) return;
                let s = r.firstSetWinner,
                    i = t.events[e] ? .markets.find(e => e.slug === s.market);
                if (i) return {
                    type: "binary",
                    market: i,
                    marketSlug: s.market,
                    sportsMarketType: "tennis_first_set_winner"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        E = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r || !r.cricketTossWinner) return;
                let s = r.cricketTossWinner,
                    i = t.events[e] ? .markets.find(e => e.slug === s.market);
                if (i) return {
                    type: "binary",
                    market: i,
                    marketSlug: s.market,
                    sportsMarketType: "cricket_toss_winner"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        P = (e, r) => {
            let i, n = (0, t.c)(3);
            n[0] !== e || n[1] !== r ? (i = t => {
                let s = t.marketsSectionsState[e];
                if (!s ? .cricketMatchToGoTill || !s.cricketMatchToGoTill.length) return;
                let i = s.cricketMatchToGoTill.find(e => e.market === r);
                if (!i) return;
                let n = t.events[e] ? .markets.find(e => e.slug === i.market);
                if (n) return {
                    type: "binary",
                    market: n,
                    marketSlug: i.market,
                    sportsMarketType: "cricket_match_to_go_till"
                }
            }, n[0] = e, n[1] = r, n[2] = i) : i = n[2];
            let a = i;
            return (0, c.useSportsStore)(a, s.shallow)
        },
        F = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r || !r.cricketCompletedMatch) return;
                let s = r.cricketCompletedMatch,
                    i = t.events[e] ? .markets.find(e => e.slug === s.market);
                if (i) return {
                    type: "binary",
                    market: i,
                    marketSlug: s.market,
                    sportsMarketType: "cricket_completed_match"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        L = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r || !r.tennisCompletedMatch) return;
                let s = r.tennisCompletedMatch,
                    i = t.events[e] ? .markets.find(e => e.slug === s.market);
                if (i) return {
                    type: "binary",
                    market: i,
                    marketSlug: s.market,
                    sportsMarketType: "tennis_completed_match"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        B = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasFirstHalfSpreads && r.firstHalfSpreads.length && s.firstHalfSpreads) return (0, u.parseLineWithMarket)({
                    line: s.firstHalfSpreads,
                    type: "first_half_spreads",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        O = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasFirstHalfTotals && r.firstHalfTotals.length && s.firstHalfTotals) return (0, u.parseLineWithMarket)({
                    line: s.firstHalfTotals,
                    type: "first_half_totals",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        H = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasFirstInningsTotals && r.firstInningsTotals.length && s.firstInningsTotals) return (0, u.parseLineWithMarket)({
                    line: s.firstInningsTotals,
                    type: "first_innings_totals",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        N = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasSecondInningsTotals && r.secondInningsTotals.length && s.secondInningsTotals) return (0, u.parseLineWithMarket)({
                    line: s.secondInningsTotals,
                    type: "second_innings_totals",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        R = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasFirstSetTotals && r.firstSetTotals.length && s.firstSetTotals) return (0, u.parseLineWithMarket)({
                    line: s.firstSetTotals,
                    type: "tennis_first_set_totals",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        W = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasSetTotals && r.setTotals.length && s.setTotals) return (0, u.parseLineWithMarket)({
                    line: s.setTotals,
                    type: "tennis_set_totals",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        z = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasSetHandicap && r.setHandicap.length && s.setHandicap) return (0, u.parseLineWithMarket)({
                    line: s.setHandicap,
                    type: "tennis_set_handicap",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        $ = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasMatchTotals && r.matchTotals.length && s.matchTotals) return (0, u.parseLineWithMarket)({
                    line: s.matchTotals,
                    type: "tennis_match_totals",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        q = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasShooterRoundTotals && r.shooterRoundTotals.length && s.shooterRoundTotals) return (0, u.parseLineWithMarket)({
                    line: s.shooterRoundTotals,
                    type: "shooter_rounds_total",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        j = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r || !r.hasTeamTotals || !r.teamTotals.length) return [];
                let s = (0, u.parseLinesWithMarket)({
                        lines: r.teamTotals,
                        type: "team_totals",
                        state: t
                    }),
                    i = {};
                for (let e of s) {
                    let t = e.market.groupItemTitle ? .match(/^(\w+)\s+(?:O\/U|Team Total)/) ? .[1] ? .toLowerCase();
                    t && (i[t] || (i[t] = []), i[t].push(e))
                }
                return Object.entries(i).map(eA)
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        U = (e, r) => {
            let i, n = (0, t.c)(3);
            n[0] !== e || n[1] !== r ? (i = t => {
                let s = t.marketsSections[e],
                    i = t.marketsSectionsState[e],
                    n = i ? .teamTotals ? .[r];
                if (s && s.hasTeamTotals && s.teamTotals.length && n) return (0, u.parseLineWithMarket)({
                    line: n,
                    type: "team_totals",
                    state: t
                })
            }, n[0] = e, n[1] = r, n[2] = i) : i = n[2];
            let a = i;
            return (0, c.useSportsStore)(a, s.shallow)
        },
        V = (e, r) => {
            let i, n = (0, t.c)(3);
            n[0] !== e || n[1] !== r ? (i = t => {
                let s = t.marketsSections[e],
                    i = t.marketsSectionsState[e],
                    n = {
                        line: void 0,
                        lines: void 0,
                        setLine: r => t.setLine({
                            slug: e,
                            type: "team_totals",
                            line: r
                        })
                    };
                if (!s || !s.hasTeamTotals || !s.teamTotals.length || !i) return n;
                let a = s.teamTotals.filter(e => e.teamId === r),
                    o = i.teamTotals ? .[r];
                return a.length && o ? {
                    line: (0, u.parseLineWithMarket)({
                        line: o,
                        type: "team_totals",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: a,
                        type: "team_totals",
                        state: t
                    }),
                    setLine: r => t.setLine({
                        slug: e,
                        type: "team_totals",
                        line: r
                    })
                } : n
            }, n[0] = e, n[1] = r, n[2] = i) : i = n[2];
            let a = i;
            return (0, c.useSportsStore)(a, s.shallow)
        },
        K = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasTotalCorners && r.totalCorners.length && s.totalCorners) return (0, u.parseLineWithMarket)({
                    line: s.totalCorners,
                    type: "total_corners",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        Q = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r || !r.shooterFirstPistolRoundWinner) return;
                let s = t.events[e] ? .markets.find(e => e.slug === r.shooterFirstPistolRoundWinner ? .market);
                if (s) return {
                    type: "binary",
                    market: s,
                    marketSlug: r.shooterFirstPistolRoundWinner ? .market,
                    sportsMarketType: "shooter_first_pistol_round"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        G = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSectionsState[e];
                if (!r ? .ufcGoTheDistance) return;
                let s = r.ufcGoTheDistance,
                    i = t.events[e] ? .markets.find(e => e.slug === s.market);
                if (i) return {
                    type: "binary",
                    market: i,
                    marketSlug: s.market,
                    sportsMarketType: "ufc_go_the_distance"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        Y = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r || !r.shooterSecondPistolRoundWinner) return;
                let s = t.events[e] ? .markets.find(e => e.slug === r.shooterSecondPistolRoundWinner ? .market);
                if (s) return {
                    type: "binary",
                    market: s,
                    marketSlug: r.shooterSecondPistolRoundWinner ? .market,
                    sportsMarketType: "shooter_second_pistol_round"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        X = (e, r) => {
            let i, n = (0, t.c)(3);
            n[0] !== e || n[1] !== r ? (i = t => {
                let s = t.marketsSectionsState[e];
                if (!s ? .ufcMethodOfVictory || !s.ufcMethodOfVictory.length) return;
                let i = s.ufcMethodOfVictory.find(e => e.market === r);
                if (!i) return;
                let n = t.events[e] ? .markets.find(e => e.slug === i.market);
                if (n) return {
                    type: "binary",
                    market: n,
                    marketSlug: i.market,
                    sportsMarketType: "ufc_method_of_victory"
                }
            }, n[0] = e, n[1] = r, n[2] = i) : i = n[2];
            let a = i;
            return (0, c.useSportsStore)(a, s.shallow)
        },
        J = (e, r) => {
            let i, n = (0, t.c)(3);
            n[0] !== e || n[1] !== r ? (i = t => {
                let s = t.marketsSectionsState[e];
                if (!s ? .parlays || !s.parlays.length) return;
                let i = s.parlays.find(e => e.market === r);
                if (!i) return;
                let n = t.events[e] ? .markets.find(e => e.slug === i.market);
                if (n) return {
                    type: "binary",
                    market: n,
                    marketSlug: i.market,
                    sportsMarketType: "parlays"
                }
            }, n[0] = e, n[1] = r, n[2] = i) : i = n[2];
            let a = i;
            return (0, c.useSportsStore)(a, s.shallow)
        },
        Z = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r || !r.hasFirstHalfMoneyline || !r.firstHalfMoneyline) return;
                let s = r.firstHalfMoneyline;
                if ("binary" === s.type) {
                    let r = t.events[e] ? .markets.find(e => e.slug === s.market);
                    if (!r) return;
                    return {
                        type: "binary",
                        market: r,
                        marketSlug: s.market,
                        sportsMarketType: "first_half_moneyline"
                    }
                }
                if ("neg-risk" === s.type) {
                    let {
                        markets: e,
                        marketSlugs: r
                    } = s.markets.reduce((e, r) => {
                        let i = t.events[s.event].markets.find(e => e.slug === r);
                        return i && (e.markets.push(i), e.marketSlugs.push(r)), e
                    }, {
                        markets: [],
                        marketSlugs: []
                    });
                    return {
                        type: "neg-risk",
                        sportsMarketType: "first_half_moneyline",
                        markets: e,
                        marketSlugs: r
                    }
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        ee = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasMapHandicap && s ? .mapHandicap) return (0, u.parseLineWithMarket)({
                    line: s.mapHandicap,
                    type: "map_handicap",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        et = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasRoundHandicap && s ? .roundHandicap) return (0, u.parseLineWithMarket)({
                    line: s.roundHandicap,
                    type: "round_handicap_match",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        er = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasKillHandicap && s ? .killHandicap) return (0, u.parseLineWithMarket)({
                    line: s.killHandicap,
                    type: "kill_handicap_match",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        es = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasTowerHandicap && s ? .towerHandicap) return (0, u.parseLineWithMarket)({
                    line: s.towerHandicap,
                    type: "tower_handicap_match",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        ei = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasDrakeHandicap && s ? .drakeHandicap) return (0, u.parseLineWithMarket)({
                    line: s.drakeHandicap,
                    type: "drake_handicap_match",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        en = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasNashorHandicap && s ? .nashorHandicap) return (0, u.parseLineWithMarket)({
                    line: s.nashorHandicap,
                    type: "nashor_handicap_match",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        ea = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasInhibitorHandicap && s ? .inhibitorHandicap) return (0, u.parseLineWithMarket)({
                    line: s.inhibitorHandicap,
                    type: "inhibitor_handicap_match",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        eo = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasBarrackHandicap && s ? .barrackHandicap) return (0, u.parseLineWithMarket)({
                    line: s.barrackHandicap,
                    type: "barrack_handicap_match",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        el = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e],
                    s = t.marketsSectionsState[e];
                if (r && r.hasRoundTotal && s ? .roundTotal) return (0, u.parseLineWithMarket)({
                    line: s.roundTotal,
                    type: "round_over_under_match",
                    state: t
                })
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        eu = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r ? .killMost) return;
                let s = t.events[e] ? .markets.find(e => e.slug === r.killMost ? .market);
                if (s) return {
                    type: "binary",
                    market: s,
                    marketSlug: r.killMost.market,
                    sportsMarketType: "kill_most_2_way_match"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        ec = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r ? .towerMost) return;
                let s = t.events[e] ? .markets.find(e => e.slug === r.towerMost ? .market);
                if (s) return {
                    type: "binary",
                    market: s,
                    marketSlug: r.towerMost.market,
                    sportsMarketType: "tower_most_2_way_match"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        ed = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r ? .drakeMost) return;
                let s = t.events[e] ? .markets.find(e => e.slug === r.drakeMost ? .market);
                if (s) return {
                    type: "binary",
                    market: s,
                    marketSlug: r.drakeMost.market,
                    sportsMarketType: "drake_most_2_way_match"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        ep = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r ? .nashorMost) return;
                let s = t.events[e] ? .markets.find(e => e.slug === r.nashorMost ? .market);
                if (s) return {
                    type: "binary",
                    market: s,
                    marketSlug: r.nashorMost.market,
                    sportsMarketType: "nashor_most_2_way_match"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        eh = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r ? .inhibitorMost) return;
                let s = t.events[e] ? .markets.find(e => e.slug === r.inhibitorMost ? .market);
                if (s) return {
                    type: "binary",
                    market: s,
                    marketSlug: r.inhibitorMost.market,
                    sportsMarketType: "inhibitor_most_2_way_match"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        em = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.marketsSections[e];
                if (!r ? .barrackMost) return;
                let s = t.events[e] ? .markets.find(e => e.slug === r.barrackMost ? .market);
                if (s) return {
                    type: "binary",
                    market: s,
                    marketSlug: r.barrackMost.market,
                    sportsMarketType: "barrack_most_2_way_match"
                }
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        };

    function ef(e, r, i, n) {
        let a, o = (0, t.c)(5);
        o[0] !== i || o[1] !== r || o[2] !== e || o[3] !== n ? (a = t => {
            let s = t.marketsSections[e];
            if (!s || !s[i] || !s[r] ? .length) return [];
            let a = s[r].map(r => {
                let s = t.events[e] ? .markets.find(e => e.slug === r.market);
                if (s) return {
                    type: "binary",
                    market: s,
                    marketSlug: r.market,
                    sportsMarketType: n
                }
            }).filter(eg);
            return a.length > 0 ? a : []
        }, o[0] = i, o[1] = r, o[2] = e, o[3] = n, o[4] = a) : a = o[4];
        let l = a;
        return (0, c.useSportsStore)(l, s.shallow)
    }

    function eg(e) {
        return void 0 !== e
    }
    let ek = e => {
            let r, i, n, a, o, l, d, p, h, m, f, g, k, y, S, w, v, _, b, M, T, A, I, x, D, P, B, O, H, N, R, W, z, $, q, j, U, V, K, X, J, ee, et, er, es, ei, en, ea, eo, el, eg, ek, ey, eS, ew, ev, e_, eb, eT, eA, eR, eW, ez, e$, eq, ej, eU, eV, eK, eQ, eG, eY, eX, eJ, eZ, e0, e1, e2, e3, e4, e6, e5, e9, e8, e7, te, tt, tr, ts, ti, tn, ta, to, tl, tu, tc, td, tp, th, tm, tf, tg, tk, ty, tS, tw, tv, t_, tb, tM, tT, tA, tI, tx, tD, tC, tE, tP, tF, tL, tB, tO, tH, tN, tR, tW, tz, t$, tq, tj, tU, tV, tK, tQ = (0, t.c)(72),
                tG = ((n = (0, t.c)(2))[0] !== e ? (i = t => {
                    let r = t.marketsSections[e];
                    if (r && r.moneyline) return (0, u.parseMoneylineWithMarket)({
                        moneyline: r.moneyline,
                        state: t
                    })
                }, n[0] = e, n[1] = i) : i = n[1], a = i, (0, c.useSportsStore)(a, s.shallow)),
                tY = ((l = (0, t.c)(2))[0] !== e ? (o = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasSpreads && r.spreads.length ? (0, u.parseLinesWithMarket)({
                        lines: r.spreads,
                        type: "spreads",
                        state: t
                    }) : []
                }, l[0] = e, l[1] = o) : o = l[1], d = o, (0, c.useSportsStore)(d, s.shallow)),
                tX = ((h = (0, t.c)(2))[0] !== e ? (p = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasTotals && r.totals.length ? (0, u.parseLinesWithMarket)({
                        lines: r.totals,
                        type: "totals",
                        state: t
                    }) : []
                }, h[0] = e, h[1] = p) : p = h[1], m = p, (0, c.useSportsStore)(m, s.shallow)),
                tJ = ((g = (0, t.c)(2))[0] !== e ? (f = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasNRFI && r.nrfi.length ? (0, u.parseLinesWithMarket)({
                        lines: r.nrfi,
                        type: "nrfi",
                        state: t
                    }) : []
                }, g[0] = e, g[1] = f) : f = g[1], k = f, (0, c.useSportsStore)(k, s.shallow)),
                tZ = ((S = (0, t.c)(2))[0] !== e ? (y = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasBTTS && r.btts.length ? (0, u.parseLinesWithMarket)({
                        lines: r.btts,
                        type: "both_teams_to_score",
                        state: t
                    }) : []
                }, S[0] = e, S[1] = y) : y = S[1], w = y, (0, c.useSportsStore)(w, s.shallow)),
                t0 = ((_ = (0, t.c)(2))[0] !== e ? (v = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasChildMoneyline && r.childMoneyline.length ? (0, u.parseLinesWithMarket)({
                        lines: r.childMoneyline,
                        type: "child_moneyline",
                        state: t
                    }) : []
                }, _[0] = e, _[1] = v) : v = _[1], b = v, (0, c.useSportsStore)(b, s.shallow)),
                t1 = Z(e),
                t2 = ((T = (0, t.c)(2))[0] !== e ? (M = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasFirstHalfSpreads && r.firstHalfSpreads.length ? (0, u.parseLinesWithMarket)({
                        lines: r.firstHalfSpreads,
                        type: "first_half_spreads",
                        state: t
                    }) : []
                }, T[0] = e, T[1] = M) : M = T[1], A = M, (0, c.useSportsStore)(A, s.shallow)),
                t3 = ((x = (0, t.c)(2))[0] !== e ? (I = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasFirstHalfTotals && r.firstHalfTotals.length ? (0, u.parseLinesWithMarket)({
                        lines: r.firstHalfTotals,
                        type: "first_half_totals",
                        state: t
                    }) : []
                }, x[0] = e, x[1] = I) : I = x[1], D = I, (0, c.useSportsStore)(D, s.shallow)),
                t4 = ((B = (0, t.c)(2))[0] !== e ? (P = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasFirstInningsTotals && r.firstInningsTotals.length ? (0, u.parseLinesWithMarket)({
                        lines: r.firstInningsTotals,
                        type: "first_innings_totals",
                        state: t
                    }) : []
                }, B[0] = e, B[1] = P) : P = B[1], O = P, (0, c.useSportsStore)(O, s.shallow)),
                t6 = ((N = (0, t.c)(2))[0] !== e ? (H = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasSecondInningsTotals && r.secondInningsTotals.length ? (0, u.parseLinesWithMarket)({
                        lines: r.secondInningsTotals,
                        type: "second_innings_totals",
                        state: t
                    }) : []
                }, N[0] = e, N[1] = H) : H = N[1], R = H, (0, c.useSportsStore)(R, s.shallow)),
                t5 = ((z = (0, t.c)(2))[0] !== e ? (W = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasSetTotals && r.setTotals.length ? (0, u.parseLinesWithMarket)({
                        lines: r.setTotals,
                        type: "tennis_set_totals",
                        state: t
                    }) : []
                }, z[0] = e, z[1] = W) : W = z[1], $ = W, (0, c.useSportsStore)($, s.shallow)),
                t9 = ((j = (0, t.c)(2))[0] !== e ? (q = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasMatchTotals && r.matchTotals.length ? (0, u.parseLinesWithMarket)({
                        lines: r.matchTotals,
                        type: "tennis_match_totals",
                        state: t
                    }) : []
                }, j[0] = e, j[1] = q) : q = j[1], U = q, (0, c.useSportsStore)(U, s.shallow)),
                t8 = ((K = (0, t.c)(2))[0] !== e ? (V = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasFirstSetTotals && r.firstSetTotals.length ? (0, u.parseLinesWithMarket)({
                        lines: r.firstSetTotals,
                        type: "tennis_first_set_totals",
                        state: t
                    }) : []
                }, K[0] = e, K[1] = V) : V = K[1], X = V, (0, c.useSportsStore)(X, s.shallow)),
                t7 = C(e),
                re = ((ee = (0, t.c)(2))[0] !== e ? (J = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasSetHandicap && r.setHandicap.length ? (0, u.parseLinesWithMarket)({
                        lines: r.setHandicap,
                        type: "tennis_set_handicap",
                        state: t
                    }) : []
                }, ee[0] = e, ee[1] = J) : J = ee[1], et = J, (0, c.useSportsStore)(et, s.shallow)),
                rt = G(e),
                rr = ((es = (0, t.c)(2))[0] !== e ? (er = t => {
                    let r = t.marketsSectionsState[e];
                    if (!r ? .ufcMethodOfVictory) return;
                    let s = r.ufcMethodOfVictory.map(r => {
                        let s = t.events[e] ? .markets.find(e => e.slug === r.market);
                        if (s) return {
                            type: "binary",
                            market: s,
                            marketSlug: r.market,
                            sportsMarketType: "ufc_method_of_victory"
                        }
                    }).filter(eO);
                    return s.length > 0 ? s : void 0
                }, es[0] = e, es[1] = er) : er = es[1], ei = er, (0, c.useSportsStore)(ei, s.shallow)),
                rs = ((ea = (0, t.c)(2))[0] !== e ? (en = t => {
                    let r = t.marketsSectionsState[e];
                    if (!r ? .parlays) return;
                    let s = r.parlays.map(r => {
                        let s = t.events[e] ? .markets.find(e => e.slug === r.market);
                        if (s) return {
                            type: "binary",
                            market: s,
                            marketSlug: r.market,
                            sportsMarketType: "parlays"
                        }
                    }).filter(eH);
                    return s.length > 0 ? s : void 0
                }, ea[0] = e, ea[1] = en) : en = ea[1], eo = en, (0, c.useSportsStore)(eo, s.shallow)),
                ri = E(e),
                rn = ((eg = (0, t.c)(2))[0] !== e ? (el = t => {
                    let r = t.marketsSections[e];
                    if (!r || !r.cricketTossMatchDouble) return;
                    let s = r.cricketTossMatchDouble,
                        {
                            markets: i,
                            marketSlugs: n
                        } = s.markets.reduce((e, r) => {
                            let i = t.events[s.event].markets.find(e => e.slug === r);
                            return i && (e.markets.push(i), e.marketSlugs.push(r)), e
                        }, {
                            markets: [],
                            marketSlugs: []
                        });
                    return {
                        type: "neg-risk",
                        markets: i,
                        marketSlugs: n,
                        sportsMarketType: "cricket_toss_match_double"
                    }
                }, eg[0] = e, eg[1] = el) : el = eg[1], ek = el, (0, c.useSportsStore)(ek, s.shallow)),
                ra = ((eS = (0, t.c)(2))[0] !== e ? (ey = t => {
                    let r = t.marketsSections[e];
                    if (!r || !r.cricketMostSixes) return;
                    let s = r.cricketMostSixes,
                        {
                            markets: i,
                            marketSlugs: n
                        } = s.markets.reduce((e, r) => {
                            let i = t.events[s.event].markets.find(e => e.slug === r);
                            return i && (e.markets.push(i), e.marketSlugs.push(r)), e
                        }, {
                            markets: [],
                            marketSlugs: []
                        });
                    return {
                        type: "neg-risk",
                        sportsMarketType: "cricket_most_sixes",
                        markets: i,
                        marketSlugs: n
                    }
                }, eS[0] = e, eS[1] = ey) : ey = eS[1], ew = ey, (0, c.useSportsStore)(ew, s.shallow)),
                ro = ((e_ = (0, t.c)(2))[0] !== e ? (ev = t => {
                    let r = t.marketsSections[e];
                    if (!r || !r.cricketTeamTopBatter) return;
                    let s = r.cricketTeamTopBatter,
                        {
                            markets: i,
                            marketSlugs: n
                        } = s.markets.reduce((e, r) => {
                            let i = t.events[s.event].markets.find(e => e.slug === r);
                            return i && (e.markets.push(i), e.marketSlugs.push(r)), e
                        }, {
                            markets: [],
                            marketSlugs: []
                        });
                    return {
                        type: "neg-risk",
                        sportsMarketType: "cricket_team_top_batter",
                        markets: i,
                        marketSlugs: n
                    }
                }, e_[0] = e, e_[1] = ev) : ev = e_[1], eb = ev, (0, c.useSportsStore)(eb, s.shallow)),
                rl = ((eA = (0, t.c)(2))[0] !== e ? (eT = t => {
                    let r = t.marketsSectionsState[e];
                    if (!r ? .cricketMatchToGoTill) return;
                    let s = r.cricketMatchToGoTill.map(r => {
                        let s = t.events[e] ? .markets.find(e => e.slug === r.market);
                        if (s) return {
                            type: "binary",
                            market: s,
                            marketSlug: r.market,
                            sportsMarketType: "cricket_match_to_go_till"
                        }
                    }).filter(eM);
                    return s.length > 0 ? s : void 0
                }, eA[0] = e, eA[1] = eT) : eT = eA[1], eR = eT, (0, c.useSportsStore)(eR, s.shallow)),
                ru = F(e),
                rc = L(e),
                rd = ((ez = (0, t.c)(2))[0] !== e ? (eW = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasShooterRoundTotals && r.shooterRoundTotals.length) return (0, u.parseLinesWithMarket)({
                        lines: r.shooterRoundTotals,
                        type: "shooter_rounds_total",
                        state: t
                    })
                }, ez[0] = e, ez[1] = eW) : eW = ez[1], e$ = eW, (0, c.useSportsStore)(e$, s.shallow)),
                rp = Q(e),
                rh = Y(e),
                rm = ((ej = (0, t.c)(2))[0] !== e ? (eq = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasTeamTotals && r.teamTotals.length ? (0, u.parseLinesWithMarket)({
                        lines: r.teamTotals,
                        type: "team_totals",
                        state: t
                    }) : []
                }, ej[0] = e, ej[1] = eq) : eq = ej[1], eU = eq, (0, c.useSportsStore)(eU, s.shallow)),
                rf = ((eK = (0, t.c)(2))[0] !== e ? (eV = t => {
                    let r = t.marketsSections[e];
                    if (!r || !r.hasAnytimeTouchdowns || !r.anytimeTouchdowns.length) return;
                    let s = r.anytimeTouchdowns.map(r => {
                        let s = t.events[e] ? .markets.find(e => e.slug === r.market);
                        if (s) return {
                            type: "binary",
                            market: s,
                            marketSlug: r.market,
                            sportsMarketType: "anytime_touchdowns"
                        }
                    }).filter(eI);
                    return s.length > 0 ? s : void 0
                }, eK[0] = e, eK[1] = eV) : eV = eK[1], eQ = eV, (0, c.useSportsStore)(eQ, s.shallow)),
                rg = ((eY = (0, t.c)(2))[0] !== e ? (eG = t => {
                    let r = t.marketsSections[e];
                    if (!r || !r.hasFirstTouchdowns || !r.firstTouchdowns.length) return;
                    let s = r.firstTouchdowns.map(r => {
                        let s = t.events[e] ? .markets.find(e => e.slug === r.market);
                        if (s) return {
                            type: "binary",
                            market: s,
                            marketSlug: r.market,
                            sportsMarketType: "first_touchdowns"
                        }
                    }).filter(ex);
                    return s.length > 0 ? s : void 0
                }, eY[0] = e, eY[1] = eG) : eG = eY[1], eX = eG, (0, c.useSportsStore)(eX, s.shallow)),
                rk = ((eZ = (0, t.c)(2))[0] !== e ? (eJ = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasRushingYards && r.rushingYards.length ? (0, u.parseLinesWithMarket)({
                        lines: r.rushingYards,
                        type: "rushing_yards",
                        state: t
                    }) : []
                }, eZ[0] = e, eZ[1] = eJ) : eJ = eZ[1], e0 = eJ, (0, c.useSportsStore)(e0, s.shallow)),
                ry = ((e2 = (0, t.c)(2))[0] !== e ? (e1 = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasReceivingYards && r.receivingYards.length ? (0, u.parseLinesWithMarket)({
                        lines: r.receivingYards,
                        type: "receiving_yards",
                        state: t
                    }) : []
                }, e2[0] = e, e2[1] = e1) : e1 = e2[1], e3 = e1, (0, c.useSportsStore)(e3, s.shallow)),
                rS = ((e6 = (0, t.c)(2))[0] !== e ? (e4 = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasPoints && r.points.length ? (0, u.parseLinesWithMarket)({
                        lines: r.points,
                        type: "points",
                        state: t
                    }) : []
                }, e6[0] = e, e6[1] = e4) : e4 = e6[1], e5 = e4, (0, c.useSportsStore)(e5, s.shallow)),
                rw = ((e8 = (0, t.c)(2))[0] !== e ? (e9 = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasAssists && r.assists.length ? (0, u.parseLinesWithMarket)({
                        lines: r.assists,
                        type: "assists",
                        state: t
                    }) : []
                }, e8[0] = e, e8[1] = e9) : e9 = e8[1], e7 = e9, (0, c.useSportsStore)(e7, s.shallow)),
                rv = ((tt = (0, t.c)(2))[0] !== e ? (te = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasRebounds && r.rebounds.length ? (0, u.parseLinesWithMarket)({
                        lines: r.rebounds,
                        type: "rebounds",
                        state: t
                    }) : []
                }, tt[0] = e, tt[1] = te) : te = tt[1], tr = te, (0, c.useSportsStore)(tr, s.shallow)),
                r_ = ((ti = (0, t.c)(2))[0] !== e ? (ts = t => {
                    let r = t.marketsSections[e];
                    if (!r || !r.hasSoccerAnytimeGoalscorer || !r.soccerAnytimeGoalscorer.length) return;
                    let s = r.soccerAnytimeGoalscorer.map(r => {
                        let s = t.events[e] ? .markets.find(e => e.slug === r.market);
                        if (s) return {
                            type: "binary",
                            market: s,
                            marketSlug: r.market,
                            sportsMarketType: "soccer_anytime_goalscorer"
                        }
                    }).filter(eD).sort(eC);
                    return s.length > 0 ? s : void 0
                }, ti[0] = e, ti[1] = ts) : ts = ti[1], tn = ts, (0, c.useSportsStore)(tn, s.shallow)),
                rb = ((to = (0, t.c)(2))[0] !== e ? (ta = t => {
                    let r = t.marketsSections[e];
                    if (!r || !r.hasSoccerExactScore || !r.soccerExactScore.length) return;
                    let s = r.soccerExactScore.map(r => {
                        let s = t.events[e] ? .markets.find(e => e.slug === r.market);
                        if (s) return {
                            type: "binary",
                            market: s,
                            marketSlug: r.market,
                            sportsMarketType: "soccer_exact_score"
                        }
                    }).filter(eE).sort(eP);
                    return s.length > 0 ? s : void 0
                }, to[0] = e, to[1] = ta) : ta = to[1], tl = ta, (0, c.useSportsStore)(tl, s.shallow)),
                rM = ((tc = (0, t.c)(2))[0] !== e ? (tu = t => {
                    let r = t.marketsSections[e];
                    if (!r || !r.soccerHalftimeResult) return;
                    let s = r.soccerHalftimeResult,
                        {
                            markets: i,
                            marketSlugs: n
                        } = s.markets.reduce((e, r) => {
                            let i = t.events[s.event].markets.find(e => e.slug === r);
                            return i && (e.markets.push(i), e.marketSlugs.push(r)), e
                        }, {
                            markets: [],
                            marketSlugs: []
                        }),
                        a = i.map((e, t) => ({
                            market: e,
                            slug: n[t]
                        })).sort(eF);
                    return {
                        type: "neg-risk",
                        sportsMarketType: "soccer_halftime_result",
                        markets: a.map(eL),
                        marketSlugs: a.map(eB)
                    }
                }, tc[0] = e, tc[1] = tu) : tu = tc[1], td = tu, (0, c.useSportsStore)(td, s.shallow)),
                rT = ((th = (0, t.c)(2))[0] !== e ? (tp = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasTotalCorners && r.totalCorners.length ? (0, u.parseLinesWithMarket)({
                        lines: r.totalCorners,
                        type: "total_corners",
                        state: t
                    }) : []
                }, th[0] = e, th[1] = tp) : tp = th[1], tm = tp, (0, c.useSportsStore)(tm, s.shallow)),
                rA = ((tg = (0, t.c)(2))[0] !== e ? (tf = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasMapHandicap && r.mapHandicap.length) return (0, u.parseLinesWithMarket)({
                        lines: r.mapHandicap,
                        type: "map_handicap",
                        state: t
                    })
                }, tg[0] = e, tg[1] = tf) : tf = tg[1], tk = tf, (0, c.useSportsStore)(tk, s.shallow)),
                rI = ((tS = (0, t.c)(2))[0] !== e ? (ty = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasRoundHandicap && r.roundHandicap.length) return (0, u.parseLinesWithMarket)({
                        lines: r.roundHandicap,
                        type: "round_handicap_match",
                        state: t
                    })
                }, tS[0] = e, tS[1] = ty) : ty = tS[1], tw = ty, (0, c.useSportsStore)(tw, s.shallow)),
                rx = ((t_ = (0, t.c)(2))[0] !== e ? (tv = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasKillHandicap && r.killHandicap.length) return (0, u.parseLinesWithMarket)({
                        lines: r.killHandicap,
                        type: "kill_handicap_match",
                        state: t
                    })
                }, t_[0] = e, t_[1] = tv) : tv = t_[1], tb = tv, (0, c.useSportsStore)(tb, s.shallow)),
                rD = ((tT = (0, t.c)(2))[0] !== e ? (tM = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasTowerHandicap && r.towerHandicap.length) return (0, u.parseLinesWithMarket)({
                        lines: r.towerHandicap,
                        type: "tower_handicap_match",
                        state: t
                    })
                }, tT[0] = e, tT[1] = tM) : tM = tT[1], tA = tM, (0, c.useSportsStore)(tA, s.shallow)),
                rC = ((tx = (0, t.c)(2))[0] !== e ? (tI = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasDrakeHandicap && r.drakeHandicap.length) return (0, u.parseLinesWithMarket)({
                        lines: r.drakeHandicap,
                        type: "drake_handicap_match",
                        state: t
                    })
                }, tx[0] = e, tx[1] = tI) : tI = tx[1], tD = tI, (0, c.useSportsStore)(tD, s.shallow)),
                rE = ((tE = (0, t.c)(2))[0] !== e ? (tC = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasNashorHandicap && r.nashorHandicap.length) return (0, u.parseLinesWithMarket)({
                        lines: r.nashorHandicap,
                        type: "nashor_handicap_match",
                        state: t
                    })
                }, tE[0] = e, tE[1] = tC) : tC = tE[1], tP = tC, (0, c.useSportsStore)(tP, s.shallow)),
                rP = ((tL = (0, t.c)(2))[0] !== e ? (tF = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasInhibitorHandicap && r.inhibitorHandicap.length) return (0, u.parseLinesWithMarket)({
                        lines: r.inhibitorHandicap,
                        type: "inhibitor_handicap_match",
                        state: t
                    })
                }, tL[0] = e, tL[1] = tF) : tF = tL[1], tB = tF, (0, c.useSportsStore)(tB, s.shallow)),
                rF = ((tH = (0, t.c)(2))[0] !== e ? (tO = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasBarrackHandicap && r.barrackHandicap.length) return (0, u.parseLinesWithMarket)({
                        lines: r.barrackHandicap,
                        type: "barrack_handicap_match",
                        state: t
                    })
                }, tH[0] = e, tH[1] = tO) : tO = tH[1], tN = tO, (0, c.useSportsStore)(tN, s.shallow)),
                rL = ((tW = (0, t.c)(2))[0] !== e ? (tR = t => {
                    let r = t.marketsSections[e];
                    if (r && r.hasRoundTotal && r.roundTotal.length) return (0, u.parseLinesWithMarket)({
                        lines: r.roundTotal,
                        type: "round_over_under_match",
                        state: t
                    })
                }, tW[0] = e, tW[1] = tR) : tR = tW[1], tz = tR, (0, c.useSportsStore)(tz, s.shallow)),
                rB = eu(e),
                rO = ec(e),
                rH = ed(e),
                rN = ep(e),
                rR = eh(e),
                rW = em(e),
                rz = ((tq = (0, t.c)(2))[0] !== e ? (t$ = t => {
                    let r = t.marketsSections[e];
                    if (!r || !r.hasFirstBloods || !r.firstBloods) return [];
                    let s = r.firstBloods.map(r => {
                        let s = t.events[e] ? .markets.find(e => e.slug === r.market);
                        if (s) return {
                            type: "binary",
                            market: s,
                            marketSlug: r.market,
                            sportsMarketType: "first_blood_game"
                        }
                    }).filter(eN);
                    return s.length > 0 ? s : []
                }, tq[0] = e, tq[1] = t$) : t$ = tq[1], tj = t$, (0, c.useSportsStore)(tj, s.shallow)),
                r$ = ((tV = (0, t.c)(2))[0] !== e ? (tU = t => {
                    let r = t.marketsSections[e];
                    return r && r.hasKillOverUnders && r.killOverUnders.length ? (0, u.parseLinesWithMarket)({
                        lines: r.killOverUnders,
                        type: "kill_over_under_game",
                        state: t
                    }) : []
                }, tV[0] = e, tV[1] = tU) : tU = tV[1], tK = tU, (0, c.useSportsStore)(tK, s.shallow)),
                rq = ef(e, "dota2GameEndsDaytime", "hasDota2GameEndsDaytime", "dota2_game_ends_daytime"),
                rj = ef(e, "dota2BothTeamsRoshan", "hasDota2BothTeamsRoshan", "dota2_both_teams_roshan"),
                rU = ef(e, "dota2BothTeamsBarracks", "hasDota2BothTeamsBarracks", "dota2_both_teams_barracks"),
                rV = ef(e, "dota2UltraKill", "hasDota2UltraKill", "dota2_ultra_kill"),
                rK = ef(e, "dota2Rampage", "hasDota2Rampage", "dota2_rampage"),
                rQ = ef(e, "cs2OddEvenTotalKills", "hasCs2OddEvenTotalKills", "cs2_odd_even_total_kills"),
                rG = ef(e, "cs2OddEvenTotalRounds", "hasCs2OddEvenTotalRounds", "cs2_odd_even_total_rounds"),
                rY = ef(e, "lolBothTeamsBaron", "hasLolBothTeamsBaron", "lol_both_teams_baron"),
                rX = ef(e, "lolBothTeamsDragon", "hasLolBothTeamsDragon", "lol_both_teams_dragon"),
                rJ = ef(e, "lolBothTeamsInhibitors", "hasLolBothTeamsInhibitors", "lol_both_teams_inhibitors"),
                rZ = ef(e, "lolQuadraKill", "hasLolQuadraKill", "lol_quadra_kill"),
                r0 = ef(e, "lolPentaKill", "hasLolPentaKill", "lol_penta_kill"),
                r1 = ef(e, "lolOddEvenTotalKills", "hasLolOddEvenTotalKills", "lol_odd_even_total_kills");
            return tQ[0] !== rf || tQ[1] !== rw || tQ[2] !== rF || tQ[3] !== rW || tQ[4] !== tZ || tQ[5] !== t0 || tQ[6] !== ru || tQ[7] !== rl || tQ[8] !== ra || tQ[9] !== ro || tQ[10] !== rn || tQ[11] !== ri || tQ[12] !== rQ || tQ[13] !== rG || tQ[14] !== rU || tQ[15] !== rj || tQ[16] !== rq || tQ[17] !== rK || tQ[18] !== rV || tQ[19] !== rC || tQ[20] !== rH || tQ[21] !== rz || tQ[22] !== t1 || tQ[23] !== t2 || tQ[24] !== t3 || tQ[25] !== t4 || tQ[26] !== rg || tQ[27] !== rP || tQ[28] !== rR || tQ[29] !== rx || tQ[30] !== rB || tQ[31] !== r$ || tQ[32] !== rY || tQ[33] !== rX || tQ[34] !== rJ || tQ[35] !== r1 || tQ[36] !== r0 || tQ[37] !== rZ || tQ[38] !== rA || tQ[39] !== tG || tQ[40] !== rE || tQ[41] !== rN || tQ[42] !== tJ || tQ[43] !== rs || tQ[44] !== rS || tQ[45] !== rv || tQ[46] !== ry || tQ[47] !== rI || tQ[48] !== rL || tQ[49] !== rk || tQ[50] !== t6 || tQ[51] !== rp || tQ[52] !== rd || tQ[53] !== rh || tQ[54] !== r_ || tQ[55] !== rb || tQ[56] !== rM || tQ[57] !== tY || tQ[58] !== rm || tQ[59] !== rc || tQ[60] !== t8 || tQ[61] !== t7 || tQ[62] !== t9 || tQ[63] !== re || tQ[64] !== t5 || tQ[65] !== rT || tQ[66] !== tX || tQ[67] !== rD || tQ[68] !== rO || tQ[69] !== rt || tQ[70] !== rr ? (r = {
                moneyline: tG,
                spreads: tY,
                totals: tX,
                nrfi: tJ,
                btts: tZ,
                childMoneyline: t0,
                firstHalfMoneyline: t1,
                firstHalfSpreads: t2,
                firstHalfTotals: t3,
                firstInningsTotals: t4,
                secondInningsTotals: t6,
                tennisFirstSetTotals: t8,
                tennisFirstSetWinner: t7,
                tennisSetTotals: t5,
                tennisMatchTotals: t9,
                tennisSetHandicaps: re,
                shooterRoundTotals: rd,
                shooterFirstPistolRoundWinner: rp,
                shooterSecondPistolRoundWinner: rh,
                ufcGoTheDistance: rt,
                ufcMethodOfVictory: rr,
                parlays: rs,
                cricketTossWinner: ri,
                cricketTossMatchDouble: rn,
                cricketMostSixes: ra,
                cricketTeamTopBatter: ro,
                cricketMatchToGoTill: rl,
                cricketCompletedMatch: ru,
                tennisCompletedMatch: rc,
                teamTotals: rm,
                anytimeTouchdowns: rf,
                firstTouchdowns: rg,
                rushingYards: rk,
                receivingYards: ry,
                points: rS,
                assists: rw,
                rebounds: rv,
                soccerAnytimeGoalscorer: r_,
                soccerExactScore: rb,
                soccerHalftimeResult: rM,
                totalCorners: rT,
                mapHandicaps: rA,
                roundHandicaps: rI,
                killHandicaps: rx,
                towerHandicaps: rD,
                drakeHandicaps: rC,
                nashorHandicaps: rE,
                inhibitorHandicaps: rP,
                barrackHandicaps: rF,
                roundTotals: rL,
                killMost: rB,
                towerMost: rO,
                drakeMost: rH,
                nashorMost: rN,
                inhibitorMost: rR,
                barrackMost: rW,
                firstBloods: rz,
                killOverUnders: r$,
                dota2GameEndsDaytime: rq,
                dota2BothTeamsRoshan: rj,
                dota2BothTeamsBarracks: rU,
                dota2UltraKill: rV,
                dota2Rampage: rK,
                cs2OddEvenTotalKills: rQ,
                cs2OddEvenTotalRounds: rG,
                lolBothTeamsBaron: rY,
                lolBothTeamsDragon: rX,
                lolBothTeamsInhibitors: rJ,
                lolQuadraKill: rZ,
                lolPentaKill: r0,
                lolOddEvenTotalKills: r1
            }, tQ[0] = rf, tQ[1] = rw, tQ[2] = rF, tQ[3] = rW, tQ[4] = tZ, tQ[5] = t0, tQ[6] = ru, tQ[7] = rl, tQ[8] = ra, tQ[9] = ro, tQ[10] = rn, tQ[11] = ri, tQ[12] = rQ, tQ[13] = rG, tQ[14] = rU, tQ[15] = rj, tQ[16] = rq, tQ[17] = rK, tQ[18] = rV, tQ[19] = rC, tQ[20] = rH, tQ[21] = rz, tQ[22] = t1, tQ[23] = t2, tQ[24] = t3, tQ[25] = t4, tQ[26] = rg, tQ[27] = rP, tQ[28] = rR, tQ[29] = rx, tQ[30] = rB, tQ[31] = r$, tQ[32] = rY, tQ[33] = rX, tQ[34] = rJ, tQ[35] = r1, tQ[36] = r0, tQ[37] = rZ, tQ[38] = rA, tQ[39] = tG, tQ[40] = rE, tQ[41] = rN, tQ[42] = tJ, tQ[43] = rs, tQ[44] = rS, tQ[45] = rv, tQ[46] = ry, tQ[47] = rI, tQ[48] = rL, tQ[49] = rk, tQ[50] = t6, tQ[51] = rp, tQ[52] = rd, tQ[53] = rh, tQ[54] = r_, tQ[55] = rb, tQ[56] = rM, tQ[57] = tY, tQ[58] = rm, tQ[59] = rc, tQ[60] = t8, tQ[61] = t7, tQ[62] = t9, tQ[63] = re, tQ[64] = t5, tQ[65] = rT, tQ[66] = tX, tQ[67] = rD, tQ[68] = rO, tQ[69] = rt, tQ[70] = rr, tQ[71] = r) : r = tQ[71], r
        },
        ey = (e, r) => {
            let i, n = (0, t.c)(3);
            n[0] !== e || n[1] !== r ? (i = t => {
                let s = t.marketsSectionsState[e],
                    i = t.marketsSections[e],
                    n = {
                        line: void 0,
                        lines: void 0,
                        setLine: s => t.setLine({
                            slug: e,
                            type: r,
                            line: s
                        })
                    };
                return s && i ? "spreads" === r ? i.hasSpreads && s.spreads ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.spreads,
                        type: "spreads",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.spreads,
                        type: "spreads",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "totals" === r ? i.hasTotals && s.totals ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.totals,
                        type: "totals",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.totals,
                        type: "totals",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "child_moneyline" === r ? i.hasChildMoneyline && s.childMoneyline ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.childMoneyline,
                        type: "child_moneyline",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.childMoneyline,
                        type: "child_moneyline",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "first_half_spreads" === r ? i.hasFirstHalfSpreads && s.firstHalfSpreads ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.firstHalfSpreads,
                        type: "first_half_spreads",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.firstHalfSpreads,
                        type: "first_half_spreads",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "first_half_totals" === r ? i.hasFirstHalfTotals && s.firstHalfTotals ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.firstHalfTotals,
                        type: "first_half_totals",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.firstHalfTotals,
                        type: "first_half_totals",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "first_innings_totals" === r ? i.hasFirstInningsTotals && s.firstInningsTotals ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.firstInningsTotals,
                        type: "first_innings_totals",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.firstInningsTotals,
                        type: "first_innings_totals",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "second_innings_totals" === r ? i.hasSecondInningsTotals && s.secondInningsTotals ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.secondInningsTotals,
                        type: "second_innings_totals",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.secondInningsTotals,
                        type: "second_innings_totals",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "tennis_first_set_totals" === r ? i.hasFirstSetTotals && s.firstSetTotals ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.firstSetTotals,
                        type: "tennis_first_set_totals",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.firstSetTotals,
                        type: "tennis_first_set_totals",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "tennis_set_totals" === r ? i.hasSetTotals && s.setTotals ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.setTotals,
                        type: "tennis_set_totals",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.setTotals,
                        type: "tennis_set_totals",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "tennis_match_totals" === r ? i.hasMatchTotals && s.matchTotals ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.matchTotals,
                        type: "tennis_match_totals",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.matchTotals,
                        type: "tennis_match_totals",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "tennis_set_handicap" === r ? i.hasSetHandicap && s.setHandicap ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.setHandicap,
                        type: "tennis_set_handicap",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.setHandicap,
                        type: "tennis_set_handicap",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "map_handicap" === r ? i.hasMapHandicap && s.mapHandicap ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.mapHandicap,
                        type: "map_handicap",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.mapHandicap,
                        type: "map_handicap",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "round_handicap_match" === r ? i.hasRoundHandicap && s.roundHandicap ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.roundHandicap,
                        type: "round_handicap_match",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.roundHandicap,
                        type: "round_handicap_match",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "kill_handicap_match" === r ? i.hasKillHandicap && s.killHandicap ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.killHandicap,
                        type: "kill_handicap_match",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.killHandicap,
                        type: "kill_handicap_match",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "tower_handicap_match" === r ? i.hasTowerHandicap && s.towerHandicap ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.towerHandicap,
                        type: "tower_handicap_match",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.towerHandicap,
                        type: "tower_handicap_match",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "drake_handicap_match" === r ? i.hasDrakeHandicap && s.drakeHandicap ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.drakeHandicap,
                        type: "drake_handicap_match",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.drakeHandicap,
                        type: "drake_handicap_match",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "nashor_handicap_match" === r ? i.hasNashorHandicap && s.nashorHandicap ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.nashorHandicap,
                        type: "nashor_handicap_match",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.nashorHandicap,
                        type: "nashor_handicap_match",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "inhibitor_handicap_match" === r ? i.hasInhibitorHandicap && s.inhibitorHandicap ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.inhibitorHandicap,
                        type: "inhibitor_handicap_match",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.inhibitorHandicap,
                        type: "inhibitor_handicap_match",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "barrack_handicap_match" === r ? i.hasBarrackHandicap && s.barrackHandicap ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.barrackHandicap,
                        type: "barrack_handicap_match",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.barrackHandicap,
                        type: "barrack_handicap_match",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "round_over_under_match" === r ? i.hasRoundTotal && s.roundTotal ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.roundTotal,
                        type: "round_over_under_match",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.roundTotal,
                        type: "round_over_under_match",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "kill_over_under_game" === r ? i.hasKillOverUnders && s.killOverUnders ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.killOverUnders,
                        type: "kill_over_under_game",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.killOverUnders,
                        type: "kill_over_under_game",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : "total_corners" === r ? i.hasTotalCorners && s.totalCorners ? {
                    line: (0, u.parseLineWithMarket)({
                        line: s.totalCorners,
                        type: "total_corners",
                        state: t
                    }),
                    lines: (0, u.parseLinesWithMarket)({
                        lines: i.totalCorners,
                        type: "total_corners",
                        state: t
                    }),
                    setLine: s => t.setLine({
                        slug: e,
                        type: r,
                        line: s
                    })
                } : n : n : n
            }, n[0] = e, n[1] = r, n[2] = i) : i = n[2];
            let a = i;
            return (0, c.useSportsStore)(a, s.shallow)
        },
        eS = e => [e.overlayAccordionValue, t => e.setOverlayAccordionValue(t)],
        ew = () => (0, c.useSportsStore)(eS, s.shallow),
        ev = e => {
            let r, i = (0, t.c)(2);
            i[0] !== e ? (r = t => {
                let r = t.teams[e];
                return r ? .home && r.away ? [r.home.score, r.away.score] : [0, 0]
            }, i[0] = e, i[1] = r) : r = i[1];
            let n = r;
            return (0, c.useSportsStore)(n, s.shallow)
        },
        e_ = () => {
            let e, r, s = (0, t.c)(5),
                i = g();
            s[0] !== i ? (e = i ? .some(eW), s[0] = i, s[1] = e) : e = s[1];
            let n = e,
                o = y();
            return s[2] !== n || s[3] !== o ? (r = !!o && a.SPREADS_ENABLED_SPORTS_SLUGS.includes(o) && n, s[2] = n, s[3] = o, s[4] = r) : r = s[4], r
        },
        eb = () => {
            let e, t, {
                    event: r
                } = (0, i.useSportsItemContext)(),
                s = e_(),
                n = (0, c.useSportsStore)(ez);
            e: {
                if (!r) {
                    e = "noop";
                    break e
                }
                e = !r.closed && r.markets.some(e$) ? "contains" : "excludes"
            }
            let a = e;
            t: {
                if (s && "excludes" !== a) {
                    t = n;
                    break t
                }
                t = "moneyline"
            }
            return t
        };

    function eM(e) {
        return void 0 !== e
    }

    function eT(e, t) {
        return (e.market.line ? ? 0) - (t.market.line ? ? 0)
    }

    function eA(e) {
        let [t, r] = e;
        return {
            teamId: t,
            teamName: r[0] ? .market.groupItemTitle ? .match(/^(\w+)\s+/) ? .[1] || t,
            markets: r.sort(eT)
        }
    }

    function eI(e) {
        return void 0 !== e
    }

    function ex(e) {
        return void 0 !== e
    }

    function eD(e) {
        return void 0 !== e
    }

    function eC(e, t) {
        return Number(e.market.groupItemThreshold ? ? 0) - Number(t.market.groupItemThreshold ? ? 0)
    }

    function eE(e) {
        return void 0 !== e
    }

    function eP(e, t) {
        let r = p(e.market.groupItemTitle),
            s = p(t.market.groupItemTitle);
        if (r && s) {
            let e = r[0] + r[1],
                t = s[0] + s[1];
            return e !== t ? e - t : r[0] - s[0]
        }
        return r ? -1 : s ? 1 : Number(e.market.groupItemThreshold ? ? 0) - Number(t.market.groupItemThreshold ? ? 0)
    }

    function eF(e, t) {
        return Number(e.market.groupItemThreshold ? ? 0) - Number(t.market.groupItemThreshold ? ? 0)
    }

    function eL(e) {
        return e.market
    }

    function eB(e) {
        return e.slug
    }

    function eO(e) {
        return void 0 !== e
    }

    function eH(e) {
        return void 0 !== e
    }

    function eN(e) {
        return void 0 !== e
    }

    function eR(e) {
        return ("spreads" === e.sportsMarketType || "totals" === e.sportsMarketType || "tennis_set_totals" === e.sportsMarketType || "tennis_match_totals" === e.sportsMarketType) && !e.closed
    }

    function eW(e) {
        return !e.closed && e.markets.some(eR)
    }

    function ez(e) {
        return e.sportsViewSetting
    }

    function e$(e) {
        return ("spreads" === e.sportsMarketType || "totals" === e.sportsMarketType || "tennis_set_totals" === e.sportsMarketType || "tennis_match_totals" === e.sportsMarketType) && !e.closed
    }
}, 6204, e => {
    "use strict";
    e.s(["SportsContextProvider", () => d, "useSportsContext", () => p]);
    var t = e.i(221628),
        r = e.i(999061),
        s = e.i(416340),
        i = e.i(756900),
        n = e.i(100825),
        a = e.i(960334),
        o = e.i(476979),
        l = e.i(593332),
        u = e.i(354712);
    let c = (0, u.createSplitContext)("SportsContext", {
            isLeague: !0,
            isLive: !1,
            isSportsPage: !1,
            sportSlug: l.SportSlug.NFL,
            secondarySlug: void 0,
            sportsV2Enabled: !1,
            virtualized: !1,
            setVirtualized: () => {},
            seriesRecommendations: null,
            eventSlug: null,
            seriesId: null
        }),
        d = e => {
            let u, d, p, h, m, f = (0, r.c)(20),
                {
                    children: g,
                    seriesRecommendations: k,
                    eventSlug: y,
                    seriesId: S
                } = e,
                w = void 0 === k ? null : k,
                v = void 0 === y ? null : y,
                _ = void 0 === S ? null : S,
                b = (0, n.useSportsStoreSelector)("sportSlug"),
                M = (0, n.useSportsStoreSelector)("secondarySlug"),
                [T, A] = s.default.useState(!1);
            f[0] !== M || f[1] !== b ? (u = (0, a.isSportsV2PageSupported)({
                sportSlug: b,
                secondarySlug: M
            }), f[0] = M, f[1] = b, f[2] = u) : u = f[2];
            let I = u;
            f[3] !== b ? (d = (0, o.getIsLeague)(b), f[3] = b, f[4] = d) : d = f[4];
            let x = b === l.SportSlug.LIVE;
            f[5] !== v || f[6] !== _ || f[7] !== w || f[8] !== I || f[9] !== d || f[10] !== x || f[11] !== b || f[12] !== M || f[13] !== T ? (p = {
                isLeague: d,
                isLive: x,
                isSportsPage: !0,
                sportSlug: b,
                secondarySlug: M,
                sportsV2Enabled: I,
                virtualized: T,
                setVirtualized: A,
                seriesRecommendations: w,
                eventSlug: v,
                seriesId: _
            }, f[5] = v, f[6] = _, f[7] = w, f[8] = I, f[9] = d, f[10] = x, f[11] = b, f[12] = M, f[13] = T, f[14] = p) : p = f[14];
            let D = p;
            return f[15] !== g ? (h = (0, t.jsx)(i.Livestream, {
                children: g
            }), f[15] = g, f[16] = h) : h = f[16], f[17] !== h || f[18] !== D ? (m = (0, t.jsx)(c.Provider, {
                values: D,
                children: h
            }), f[17] = h, f[18] = D, f[19] = m) : m = f[19], m
        },
        p = e => (0, u.useSplitContext)(c, e)
}, 960334, e => {
    "use strict";
    e.s(["isSportsV2PageSupported", () => n, "useSportsV2Enabled", () => a]);
    var t = e.i(999061);
    e.i(416340);
    var r = e.i(476979),
        s = e.i(593332),
        i = e.i(6204);
    let n = ({
            sportSlug: e,
            secondarySlug: t
        }) => !!((({
            sportSlug: e
        }) => e && r.IN_GAME_SPORTS_SLUGS.includes(e))({
            sportSlug: e
        }) && t === s.SecondarySlug.GAMES || e === s.SportSlug.LIVE || e && (0, r.isSportCategory)(e) && t === s.SecondarySlug.GAMES),
        a = () => {
            let e, r = (0, t.c)(1);
            r[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["sportsV2Enabled", "isSportsPage"], r[0] = e) : e = r[0];
            let {
                sportsV2Enabled: s,
                isSportsPage: n
            } = (0, i.useSportsContext)(e);
            return n && s
        }
}]);

//# debugId=620d6562-9210-77cf-f55c-dccd6451e3ce