;
! 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] = "7549c676-e8f0-d5bd-db84-d8e3895c8794")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 73903, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(425010);
    e.i(416340);
    let a = /^#(?:[0-9a-f]{3}){1,2}$/i;
    e.s(["useChartTheme", 0, e => {
        let i, n, s = (0, t.c)(5),
            {
                resolvedTheme: o
            } = (0, r.useTheme)(),
            l = "dark" === o;
        if (s[0] !== e || s[1] !== l) {
            var c;
            let t, r;
            c = (e ? ? []).reduce((e, t) => {
                let {
                    id: r,
                    ...a
                } = t;
                return e[r] = { ...a
                }, e
            }, {
                "series-light-blue": {
                    color: "#87BFFF",
                    index: (e ? .length ? ? 0) + 1
                },
                "series-dark-blue": {
                    color: l ? "#2797FF" : "#4378FF",
                    index: (e ? .length ? ? 0) + 2
                },
                "series-yellow": {
                    color: "#FDC503",
                    index: (e ? .length ? ? 0) + 3
                },
                orange: {
                    color: "#FF7F0E",
                    index: (e ? .length ? ? 0) + 4
                },
                blue: {
                    color: l ? "#0093fd" : "#1452f0",
                    index: (e ? .length ? ? 0) + 5
                },
                red: {
                    color: "#FF5952",
                    index: (e ? .length ? ? 0) + 6
                },
                green: {
                    color: "#27AE60",
                    index: (e ? .length ? ? 0) + 7
                }
            }), t = new Map, r = Math.max(-1, ...Object.values(c).map(e => e.index)) + 1, i = new Proxy(c, {
                get(e, i, n) {
                    let s;
                    if (Object.hasOwn(e, i) || "string" != typeof i) return Reflect.get(e, i, n);
                    let o = t.get(i);
                    if (o) return o;
                    if (i.includes(",")) {
                        let [e, t] = i.split(",").map(e => e.trim());
                        a.test(e) && a.test(t) && (s = {
                            color: l ? t : e,
                            index: r++
                        })
                    } else a.test(i) && (s = {
                        color: i,
                        index: r++
                    });
                    return s && t.set(i, s), s ? ? {
                        color: l ? "#0093fd" : "#1452f0",
                        index: r++
                    }
                }
            }), s[0] = e, s[1] = l, s[2] = i
        } else i = s[2];
        let d = i;
        return s[3] !== d ? (n = {
            colors: d
        }, s[3] = d, s[4] = n) : n = s[4], n
    }], 73903)
}, 360493, e => {
    "use strict";
    var t = e.i(195453),
        r = e.i(53950);
    let a = ({
        markets: e,
        lowChanceMarkets: i,
        resolvedMarkets: n,
        colors: s,
        skipManualColor: o = !1
    }) => {
        let l = { ...s
        };
        try {
            if (!o) {
                let r = 0;
                e.forEach(e => {
                    e.seriesColor && s[e.seriesColor] && (l[e.seriesColor] && r++, delete l[e.seriesColor])
                });
                let a = (0, t.uniqBy)([...i, ...n].filter(e => e.seriesColor && s[e.seriesColor]), "seriesColor").length;
                if (a > 0) {
                    let t = Object.keys(l).length;
                    e.length - r - a > t && [...i, ...n].forEach(e => {
                        e.seriesColor && s[e.seriesColor] && delete l[e.seriesColor]
                    })
                }
            }
            let r = { ...l
            };
            return {
                markets: e.slice(0, 4).map(e => {
                    let t;
                    return e.seriesColor && s[e.seriesColor] ? t = e.seriesColor : (t = Object.entries({ ...r
                    }).sort((e, t) => e[1].index < t[1].index ? -1 : 1)[0][0], delete r[t]), { ...e,
                        color: t
                    }
                }),
                unrestrictedColors: l
            }
        } catch (t) {
            if (!o) return a({
                markets: e,
                lowChanceMarkets: i,
                resolvedMarkets: n,
                colors: s,
                skipManualColor: !0
            });
            throw r.logger.error("[GroupChart > getDefaultSeriesColors]", {
                e: t
            }), t
        }
    };
    e.s(["getFirstAvailableColor", 0, e => Object.entries(e).sort((e, t) => e[1].index < t[1].index ? -1 : 1)[0][0], "getSeriesColors", 0, ({
        markets: e,
        lowChanceMarkets: t,
        resolvedMarkets: r,
        event: i,
        colors: n
    }) => "manual" === i.gmpChartMode && i.markets ? .some(e => !!e.showGmpSeries) ? (({
        markets: e,
        event: t,
        colors: r
    }) => {
        let a = { ...r
            },
            i = { ...r
            },
            n = t.markets ? .filter(e => !!e.showGmpSeries) ? ? [],
            s = new Map(e.map(e => [e.slug, e]));
        return {
            markets: n.flatMap((e, t) => {
                let n, o = s.get(e.slug);
                return o ? (e.seriesColor && r[e.seriesColor] ? (n = e.seriesColor, delete a[n]) : n = Object.entries(i).sort((e, t) => e[1].index < t[1].index ? -1 : 1)[0][0], delete i[n], { ...o,
                    sortKey: o.sortKey ? ? t,
                    color: n
                }) : []
            }),
            unrestrictedColors: a
        }
    })({
        markets: e,
        event: i,
        colors: n
    }) : a({
        markets: e,
        lowChanceMarkets: t,
        resolvedMarkets: r,
        colors: n
    })])
}, 215777, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340);
    e.s(["useLiveVolume", 0, () => {
        let e, a, i, n = (0, t.c)(4),
            [s, o] = (0, r.useState)(0);
        n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = e => {
            if (e.size && e.price) {
                let t = e.size * e.price;
                o(e => e + t)
            }
        }, n[0] = e) : e = n[0];
        let l = e;
        n[1] === Symbol.for("react.memo_cache_sentinel") ? (a = () => {
            o(0)
        }, n[1] = a) : a = n[1];
        let c = a;
        return n[2] !== s ? (i = {
            liveVolume: s,
            addTrade: l,
            resetVolume: c
        }, n[2] = s, n[3] = i) : i = n[3], i
    }])
}, 799275, 816332, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(23128),
        i = e.i(169010),
        n = e.i(138567),
        s = e.i(237493),
        o = e.i(219469),
        l = e.i(215959),
        c = e.i(416340),
        d = e.i(721747),
        u = e.i(565575),
        m = e.i(93257),
        p = e.i(660006);
    let h = async e => {
            try {
                if (void 0 === navigator.share) return;
                navigator.canShare(e) && await navigator.share(e)
            } catch (e) {
                if ("AbortError" === e.name) return;
                (0, p.handleError)(e, "shareToMobile")
            }
        },
        f = e => {
            let t, a, i, n, s, o, l = (0, r.c)(17),
                c = (0, u.useCreateShareLink)();
            l[0] !== e.files ? (t = e.files && e.files.length ? [...e.files] : [], l[0] = e.files, l[1] = t) : t = l[1];
            let d = t;
            l[2] !== e.files ? (a = e.files && {
                files: [...e.files]
            }, l[2] = e.files, l[3] = a) : a = l[3], l[4] !== d || l[5] !== e.images ? (i = e.images && {
                files: [...e.images.map(x), ...d]
            }, l[4] = d, l[5] = e.images, l[6] = i) : i = l[6], l[7] !== e || l[8] !== a || l[9] !== i ? (n = { ...e,
                ...a,
                ...i
            }, l[7] = e, l[8] = a, l[9] = i, l[10] = n) : n = l[10];
            let m = n;
            l[11] !== c || l[12] !== e.url || l[13] !== m ? (s = async () => {
                let t = m;
                if (e.url) {
                    let r = await c(e.url);
                    t = { ...m,
                        url: r
                    }
                }
                return h(t)
            }, l[11] = c, l[12] = e.url, l[13] = m, l[14] = s) : s = l[14];
            let p = s;
            return l[15] !== p ? (o = {
                share: p
            }, l[15] = p, l[16] = o) : o = l[16], o
        };

    function x(e) {
        return (e => {
            let t = e.split(","),
                r = t[0].match(/:(.*?);/) ? .[1],
                a = m.Buffer.from(t[1], "base64").toString("ascii"),
                i = a.length,
                n = new Uint8Array(i);
            for (; i--;) n[i] = a.charCodeAt(i);
            return new File([n], "image.jpg", {
                type: r
            })
        })(e)
    }
    e.s(["default", 0, f], 816332);
    var g = e.i(922445),
        v = e.i(604777),
        y = e.i(208956);

    function b() {
        let e, a, i, n, s = (0, r.c)(9),
            o = (0, v.useTranslations)();
        return s[0] !== o ? (e = o("navbar.shareTooltip"), s[0] = o, s[1] = e) : e = s[1], s[2] !== o ? (a = o("navbar.shareTooltipCta"), s[2] = o, s[3] = a) : a = s[3], s[4] !== a ? (i = (0, t.jsx)(y.default, {
            href: "/refer",
            className: "underline text-text-brand hover:text-text-brand-hover transition-colors",
            onClick: k,
            children: a
        }), s[4] = a, s[5] = i) : i = s[5], s[6] !== e || s[7] !== i ? (n = (0, t.jsxs)("span", {
            children: [e, " ", i]
        }), s[6] = e, s[7] = i, s[8] = n) : n = s[8], n
    }

    function k(e) {
        return e.stopPropagation()
    }
    e.s(["ShareTooltipContent", 0, b, "default", 0, ({
        params: e
    }) => {
        let [r, m] = (0, c.useState)(!1), [, p] = (0, d.useCopyToClipboard)(), {
            share: h
        } = f((0, c.useMemo)(() => ({
            title: e ? .title ? ? "",
            url: e ? .url ? ? ""
        }), [e])), x = (0, u.useCreateShareLink)();
        (0, c.useEffect)(() => {
            r && setTimeout(() => m(!1), 2e3)
        }, [r]);
        let v = c.default.useCallback(async () => {
            if (!e ? .url) return;
            let t = await x(e.url ? ? "");
            await p(t) && m(!0)
        }, [p, e ? .url, x]);
        return (0, t.jsx)(i.Tooltip, {
            content: (0, t.jsx)(b, {}),
            showArrow: !1,
            side: "top",
            delayDuration: 50,
            sideOffset: 4,
            triggerAsChild: !0,
            children: (0, t.jsxs)(a.Button, {
                onClick: () => {
                    (0, g.isNarrowViewport)() && h()
                },
                variant: "ghost",
                className: "rounded-full",
                size: "icon",
                children: [c.default.createElement("div", {
                    className: "w-[28px] h-[28px] hidden lg:flex overflow-hidden items-center justify-center",
                    onClick: v,
                    children: (0, t.jsx)(o.AnimatePresence, {
                        initial: !1,
                        mode: "popLayout",
                        children: r ? (0, t.jsx)(l.motion.div, {
                            initial: {
                                opacity: 0,
                                scale: .9
                            },
                            animate: {
                                opacity: 1,
                                scale: 1
                            },
                            exit: {
                                opacity: 0,
                                scale: .9
                            },
                            transition: {
                                duration: .15,
                                ease: "easeInOut"
                            },
                            children: (0, t.jsx)(n.IconCheckOutline18, {})
                        }, "copied") : (0, t.jsx)(l.motion.div, {
                            className: "relative",
                            initial: {
                                opacity: 0,
                                scale: .9
                            },
                            animate: {
                                opacity: 1,
                                scale: 1
                            },
                            exit: {
                                opacity: 0,
                                scale: .9
                            },
                            transition: {
                                duration: .15,
                                ease: "easeInOut"
                            },
                            children: (0, t.jsx)(s.IconLinkOutline18, {})
                        }, "copy")
                    })
                }), (0, t.jsx)("div", {
                    className: "w-[28px] h-[28px] flex items-center justify-center lg:hidden",
                    children: (0, t.jsx)(s.IconLinkOutline18, {})
                })]
            })
        })
    }], 799275)
}, 212017, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(219469),
        i = e.i(215959),
        n = e.i(870555);
    let s = {
        duration: .3,
        ease: [.25, 1, .5, 1]
    };
    e.s(["AnimatedShares", 0, function(e) {
        let o, l, c, d, u, m, p = (0, r.c)(10),
            {
                value: h,
                className: f
            } = e;
        return p[0] !== f ? (o = (0, n.cn)(f, "relative inline-flex overflow-hidden"), p[0] = f, p[1] = o) : o = p[1], p[2] === Symbol.for("react.memo_cache_sentinel") ? (l = {
            y: 10,
            opacity: 0
        }, c = {
            y: 0,
            opacity: 1
        }, d = {
            y: -10,
            opacity: 0
        }, p[2] = l, p[3] = c, p[4] = d) : (l = p[2], c = p[3], d = p[4]), p[5] !== h ? (u = (0, t.jsx)(a.AnimatePresence, {
            mode: "popLayout",
            initial: !1,
            children: (0, t.jsx)(i.motion.span, {
                initial: l,
                animate: c,
                exit: d,
                transition: s,
                children: h
            }, h)
        }), p[5] = h, p[6] = u) : u = p[6], p[7] !== o || p[8] !== u ? (m = (0, t.jsx)("span", {
            className: o,
            children: u
        }), p[7] = o, p[8] = u, p[9] = m) : m = p[9], m
    }, "holderRowLayoutTransition", 0, {
        type: "spring",
        stiffness: 350,
        damping: 30,
        mass: 1
    }])
}, 613135, e => {
    "use strict";
    let t, r, a;
    var i = e.i(416340);

    function n(e) {
        return null !== e && "object" == typeof e && "constructor" in e && e.constructor === Object
    }

    function s(e = {}, t = {}) {
        let r = ["__proto__", "constructor", "prototype"];
        Object.keys(t).filter(e => 0 > r.indexOf(e)).forEach(r => {
            void 0 === e[r] ? e[r] = t[r] : n(t[r]) && n(e[r]) && Object.keys(t[r]).length > 0 && s(e[r], t[r])
        })
    }
    let o = {
        body: {},
        addEventListener() {},
        removeEventListener() {},
        activeElement: {
            blur() {},
            nodeName: ""
        },
        querySelector: () => null,
        querySelectorAll: () => [],
        getElementById: () => null,
        createEvent: () => ({
            initEvent() {}
        }),
        createElement: () => ({
            children: [],
            childNodes: [],
            style: {},
            setAttribute() {},
            getElementsByTagName: () => []
        }),
        createElementNS: () => ({}),
        importNode: () => null,
        location: {
            hash: "",
            host: "",
            hostname: "",
            href: "",
            origin: "",
            pathname: "",
            protocol: "",
            search: ""
        }
    };

    function l() {
        let e = "u" > typeof document ? document : {};
        return s(e, o), e
    }
    let c = {
        document: o,
        navigator: {
            userAgent: ""
        },
        location: {
            hash: "",
            host: "",
            hostname: "",
            href: "",
            origin: "",
            pathname: "",
            protocol: "",
            search: ""
        },
        history: {
            replaceState() {},
            pushState() {},
            go() {},
            back() {}
        },
        CustomEvent: function() {
            return this
        },
        addEventListener() {},
        removeEventListener() {},
        getComputedStyle: () => ({
            getPropertyValue: () => ""
        }),
        Image() {},
        Date() {},
        screen: {},
        setTimeout() {},
        clearTimeout() {},
        matchMedia: () => ({}),
        requestAnimationFrame: e => "u" < typeof setTimeout ? (e(), null) : setTimeout(e, 0),
        cancelAnimationFrame(e) {
            "u" > typeof setTimeout && clearTimeout(e)
        }
    };

    function d() {
        let e = "u" > typeof window ? window : {};
        return s(e, c), e
    }

    function u(e, t = 0) {
        return setTimeout(e, t)
    }

    function m() {
        return Date.now()
    }

    function p(e) {
        return "object" == typeof e && null !== e && e.constructor && "Object" === Object.prototype.toString.call(e).slice(8, -1)
    }

    function h(...e) {
        let t = Object(e[0]);
        for (let r = 1; r < e.length; r += 1) {
            let a = e[r];
            if (null != a && ("u" > typeof window && void 0 !== window.HTMLElement ? !(a instanceof HTMLElement) : !a || 1 !== a.nodeType && 11 !== a.nodeType)) {
                let e = Object.keys(Object(a)).filter(e => "__proto__" !== e && "constructor" !== e && "prototype" !== e);
                for (let r = 0, i = e.length; r < i; r += 1) {
                    let i = e[r],
                        n = Object.getOwnPropertyDescriptor(a, i);
                    void 0 !== n && n.enumerable && (p(t[i]) && p(a[i]) ? a[i].__swiper__ ? t[i] = a[i] : h(t[i], a[i]) : !p(t[i]) && p(a[i]) ? (t[i] = {}, a[i].__swiper__ ? t[i] = a[i] : h(t[i], a[i])) : t[i] = a[i])
                }
            }
        }
        return t
    }

    function f(e, t, r) {
        e.style.setProperty(t, r)
    }

    function x({
        swiper: e,
        targetPosition: t,
        side: r
    }) {
        let a, i = d(),
            n = -e.translate,
            s = null,
            o = e.params.speed;
        e.wrapperEl.style.scrollSnapType = "none", i.cancelAnimationFrame(e.cssModeFrameID);
        let l = t > n ? "next" : "prev",
            c = (e, t) => "next" === l && e >= t || "prev" === l && e <= t,
            u = () => {
                a = new Date().getTime(), null === s && (s = a);
                let l = n + (.5 - Math.cos(Math.max(Math.min((a - s) / o, 1), 0) * Math.PI) / 2) * (t - n);
                if (c(l, t) && (l = t), e.wrapperEl.scrollTo({
                        [r]: l
                    }), c(l, t)) {
                    e.wrapperEl.style.overflow = "hidden", e.wrapperEl.style.scrollSnapType = "", setTimeout(() => {
                        e.wrapperEl.style.overflow = "", e.wrapperEl.scrollTo({
                            [r]: l
                        })
                    }), i.cancelAnimationFrame(e.cssModeFrameID);
                    return
                }
                e.cssModeFrameID = i.requestAnimationFrame(u)
            };
        u()
    }

    function g(e, t = "") {
        let r = d(),
            a = [...e.children];
        return (r.HTMLSlotElement && e instanceof HTMLSlotElement && a.push(...e.assignedElements()), t) ? a.filter(e => e.matches(t)) : a
    }

    function v(e) {
        try {
            console.warn(e);
            return
        } catch (e) {}
    }

    function y(e, t = []) {
        let r = document.createElement(e);
        return r.classList.add(...Array.isArray(t) ? t : function(e = "") {
            return e.trim().split(" ").filter(e => !!e.trim())
        }(t)), r
    }

    function b(e, t) {
        return d().getComputedStyle(e, null).getPropertyValue(t)
    }

    function k(e) {
        let t, r = e;
        if (r) {
            for (t = 0; null !== (r = r.previousSibling);) 1 === r.nodeType && (t += 1);
            return t
        }
    }

    function w(e, t, r) {
        let a = d();
        return r ? e["width" === t ? "offsetWidth" : "offsetHeight"] + parseFloat(a.getComputedStyle(e, null).getPropertyValue("width" === t ? "margin-right" : "margin-top")) + parseFloat(a.getComputedStyle(e, null).getPropertyValue("width" === t ? "margin-left" : "margin-bottom")) : e.offsetWidth
    }

    function S(e, t = "") {
        "u" > typeof trustedTypes ? e.innerHTML = trustedTypes.createPolicy("html", {
            createHTML: e => e
        }).createHTML(t) : e.innerHTML = t
    }

    function j() {
        let e, r;
        return t || (e = d(), t = {
            smoothScroll: (r = l()).documentElement && r.documentElement.style && "scrollBehavior" in r.documentElement.style,
            touch: !!("ontouchstart" in e || e.DocumentTouch && r instanceof e.DocumentTouch)
        }), t
    }

    function C(e = {}) {
        return r || (r = function({
            userAgent: e
        } = {}) {
            let t = j(),
                r = d(),
                a = r.navigator.platform,
                i = e || r.navigator.userAgent,
                n = {
                    ios: !1,
                    android: !1
                },
                s = r.screen.width,
                o = r.screen.height,
                l = i.match(/(Android);?[\s\/]+([\d.]+)?/),
                c = i.match(/(iPad)(?!\1).*OS\s([\d_]+)/),
                u = i.match(/(iPod)(.*OS\s([\d_]+))?/),
                m = !c && i.match(/(iPhone\sOS|iOS)\s([\d_]+)/),
                p = "MacIntel" === a;
            return !c && p && t.touch && ["1024x1366", "1366x1024", "834x1194", "1194x834", "834x1112", "1112x834", "768x1024", "1024x768", "820x1180", "1180x820", "810x1080", "1080x810"].indexOf(`${s}x${o}`) >= 0 && ((c = i.match(/(Version)\/([\d.]+)/)) || (c = [0, 1, "13_0_0"]), p = !1), l && "Win32" !== a && (n.os = "android", n.android = !0), (c || m || u) && (n.os = "ios", n.ios = !0), n
        }(e)), r
    }

    function _() {
        return a || (a = function() {
            let e = d(),
                t = C(),
                r = !1;

            function a() {
                let t = e.navigator.userAgent.toLowerCase();
                return t.indexOf("safari") >= 0 && 0 > t.indexOf("chrome") && 0 > t.indexOf("android")
            }
            if (a()) {
                let t = String(e.navigator.userAgent);
                if (t.includes("Version/")) {
                    let [e, a] = t.split("Version/")[1].split(" ")[0].split(".").map(e => Number(e));
                    r = e < 16 || 16 === e && a < 2
                }
            }
            let i = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),
                n = a(),
                s = n || i && t.ios;
            return {
                isSafari: r || n,
                needPerspectiveFix: r,
                need3dFix: s,
                isWebView: i
            }
        }()), a
    }
    let T = (e, t, r) => {
            t && !e.classList.contains(r) ? e.classList.add(r) : !t && e.classList.contains(r) && e.classList.remove(r)
        },
        M = (e, t, r) => {
            t && !e.classList.contains(r) ? e.classList.add(r) : !t && e.classList.contains(r) && e.classList.remove(r)
        },
        N = (e, t) => {
            if (!e || e.destroyed || !e.params) return;
            let r = t.closest(e.isElement ? "swiper-slide" : `.${e.params.slideClass}`);
            if (r) {
                let t = r.querySelector(`.${e.params.lazyPreloaderClass}`);
                !t && e.isElement && (r.shadowRoot ? t = r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`) : requestAnimationFrame(() => {
                    r.shadowRoot && (t = r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`)) && !t.lazyPreloaderManaged && t.remove()
                })), t && !t.lazyPreloaderManaged && t.remove()
            }
        },
        I = (e, t) => {
            if (!e.slides[t]) return;
            let r = e.slides[t].querySelector('[loading="lazy"]');
            r && r.removeAttribute("loading")
        },
        P = e => {
            if (!e || e.destroyed || !e.params) return;
            let t = e.params.lazyPreloadPrevNext,
                r = e.slides.length;
            if (!r || !t || t < 0) return;
            t = Math.min(t, r);
            let a = "auto" === e.params.slidesPerView ? e.slidesPerViewDynamic() : Math.ceil(e.params.slidesPerView),
                i = e.activeIndex;
            if (e.params.grid && e.params.grid.rows > 1) {
                let r = [i - t];
                r.push(...Array.from({
                    length: t
                }).map((e, t) => i + a + t)), e.slides.forEach((t, a) => {
                    r.includes(t.column) && I(e, a)
                });
                return
            }
            let n = i + a - 1;
            if (e.params.rewind || e.params.loop)
                for (let a = i - t; a <= n + t; a += 1) {
                    let t = (a % r + r) % r;
                    (t < i || t > n) && I(e, t)
                } else
                    for (let a = Math.max(i - t, 0); a <= Math.min(n + t, r - 1); a += 1) a !== i && (a > n || a < i) && I(e, a)
        };

    function E({
        swiper: e,
        runCallbacks: t,
        direction: r,
        step: a
    }) {
        let {
            activeIndex: i,
            previousIndex: n
        } = e, s = r;
        s || (s = i > n ? "next" : i < n ? "prev" : "reset"), e.emit(`transition${a}`), t && "reset" === s ? e.emit(`slideResetTransition${a}`) : t && i !== n && (e.emit(`slideChangeTransition${a}`), "next" === s ? e.emit(`slideNextTransition${a}`) : e.emit(`slidePrevTransition${a}`))
    }

    function A(e, t, r) {
        let a = d(),
            {
                params: i
            } = e,
            n = i.edgeSwipeDetection,
            s = i.edgeSwipeThreshold;
        return !n || !(r <= s) && !(r >= a.innerWidth - s) || "prevent" === n && (t.preventDefault(), !0)
    }

    function O(e) {
        var t, r;
        let a, i, n = l(),
            s = e;
        s.originalEvent && (s = s.originalEvent);
        let o = this.touchEventsData;
        if ("pointerdown" === s.type) {
            if (null !== o.pointerId && o.pointerId !== s.pointerId) return;
            o.pointerId = s.pointerId
        } else "touchstart" === s.type && 1 === s.targetTouches.length && (o.touchId = s.targetTouches[0].identifier);
        if ("touchstart" === s.type) return void A(this, s, s.targetTouches[0].pageX);
        let {
            params: c,
            touches: u,
            enabled: p
        } = this;
        if (!p || !c.simulateTouch && "mouse" === s.pointerType || this.animating && c.preventInteractionOnTransition) return;
        !this.animating && c.cssMode && c.loop && this.loopFix();
        let h = s.target;
        if ("wrapper" === c.touchEventsTarget && (t = h, r = this.wrapperEl, a = d(), !(i = r.contains(t)) && a.HTMLSlotElement && r instanceof HTMLSlotElement && ((i = [...r.assignedElements()].includes(t)) || (i = function(e, t) {
                let r = [t];
                for (; r.length > 0;) {
                    let t = r.shift();
                    if (e === t) return !0;
                    r.push(...t.children, ...t.shadowRoot ? t.shadowRoot.children : [], ...t.assignedElements ? t.assignedElements() : [])
                }
            }(t, r))), !i) || "which" in s && 3 === s.which || "button" in s && s.button > 0 || o.isTouched && o.isMoved) return;
        let f = !!c.noSwipingClass && "" !== c.noSwipingClass,
            x = s.composedPath ? s.composedPath() : s.path;
        f && s.target && s.target.shadowRoot && x && (h = x[0]);
        let g = c.noSwipingSelector ? c.noSwipingSelector : `.${c.noSwipingClass}`,
            v = !!(s.target && s.target.shadowRoot);
        if (c.noSwiping && (v ? function(e, t = this) {
                return function t(r) {
                    if (!r || r === l() || r === d()) return null;
                    r.assignedSlot && (r = r.assignedSlot);
                    let a = r.closest(e);
                    return a || r.getRootNode ? a || t(r.getRootNode().host) : null
                }(t)
            }(g, h) : h.closest(g))) {
            this.allowClick = !0;
            return
        }
        if (c.swipeHandler && !h.closest(c.swipeHandler)) return;
        u.currentX = s.pageX, u.currentY = s.pageY;
        let y = u.currentX,
            b = u.currentY;
        if (!A(this, s, y)) return;
        Object.assign(o, {
            isTouched: !0,
            isMoved: !1,
            allowTouchCallbacks: !0,
            isScrolling: void 0,
            startMoving: void 0
        }), u.startX = y, u.startY = b, o.touchStartTime = m(), this.allowClick = !0, this.updateSize(), this.swipeDirection = void 0, c.threshold > 0 && (o.allowThresholdMove = !1);
        let k = !0;
        h.matches(o.focusableElements) && (k = !1, "SELECT" === h.nodeName && (o.isTouched = !1)), n.activeElement && n.activeElement.matches(o.focusableElements) && n.activeElement !== h && ("mouse" === s.pointerType || "mouse" !== s.pointerType && !h.matches(o.focusableElements)) && n.activeElement.blur();
        let w = k && this.allowTouchMove && c.touchStartPreventDefault;
        (c.touchStartForcePreventDefault || w) && !h.isContentEditable && s.preventDefault(), c.freeMode && c.freeMode.enabled && this.freeMode && this.animating && !c.cssMode && this.freeMode.onTouchStart(), this.emit("touchStart", s)
    }

    function D(e) {
        let t, r, a = l(),
            i = this.touchEventsData,
            {
                params: n,
                touches: s,
                rtlTranslate: o,
                enabled: c
            } = this;
        if (!c || !n.simulateTouch && "mouse" === e.pointerType) return;
        let d = e;
        if (d.originalEvent && (d = d.originalEvent), "pointermove" === d.type && (null !== i.touchId || d.pointerId !== i.pointerId)) return;
        if ("touchmove" === d.type) {
            if (!(t = [...d.changedTouches].find(e => e.identifier === i.touchId)) || t.identifier !== i.touchId) return
        } else t = d;
        if (!i.isTouched) {
            i.startMoving && i.isScrolling && this.emit("touchMoveOpposite", d);
            return
        }
        let u = t.pageX,
            p = t.pageY;
        if (d.preventedByNestedSwiper) {
            s.startX = u, s.startY = p;
            return
        }
        if (!this.allowTouchMove) {
            d.target.matches(i.focusableElements) || (this.allowClick = !1), i.isTouched && (Object.assign(s, {
                startX: u,
                startY: p,
                currentX: u,
                currentY: p
            }), i.touchStartTime = m());
            return
        }
        if (n.touchReleaseOnEdges && !n.loop) {
            if (this.isVertical()) {
                if (p < s.startY && this.translate <= this.maxTranslate() || p > s.startY && this.translate >= this.minTranslate()) {
                    i.isTouched = !1, i.isMoved = !1;
                    return
                }
            } else if (o && (u > s.startX && -this.translate <= this.maxTranslate() || u < s.startX && -this.translate >= this.minTranslate())) return;
            else if (!o && (u < s.startX && this.translate <= this.maxTranslate() || u > s.startX && this.translate >= this.minTranslate())) return
        }
        if (a.activeElement && a.activeElement.matches(i.focusableElements) && a.activeElement !== d.target && "mouse" !== d.pointerType && a.activeElement.blur(), a.activeElement && d.target === a.activeElement && d.target.matches(i.focusableElements)) {
            i.isMoved = !0, this.allowClick = !1;
            return
        }
        i.allowTouchCallbacks && this.emit("touchMove", d), s.previousX = s.currentX, s.previousY = s.currentY, s.currentX = u, s.currentY = p;
        let h = s.currentX - s.startX,
            f = s.currentY - s.startY;
        if (this.params.threshold && Math.sqrt(h ** 2 + f ** 2) < this.params.threshold) return;
        if (void 0 === i.isScrolling) {
            let e;
            this.isHorizontal() && s.currentY === s.startY || this.isVertical() && s.currentX === s.startX ? i.isScrolling = !1 : h * h + f * f >= 25 && (e = 180 * Math.atan2(Math.abs(f), Math.abs(h)) / Math.PI, i.isScrolling = this.isHorizontal() ? e > n.touchAngle : 90 - e > n.touchAngle)
        }
        if (i.isScrolling && this.emit("touchMoveOpposite", d), void 0 === i.startMoving && (s.currentX !== s.startX || s.currentY !== s.startY) && (i.startMoving = !0), i.isScrolling || "touchmove" === d.type && i.preventTouchMoveFromPointerMove) {
            i.isTouched = !1;
            return
        }
        if (!i.startMoving) return;
        this.allowClick = !1, !n.cssMode && d.cancelable && d.preventDefault(), n.touchMoveStopPropagation && !n.nested && d.stopPropagation();
        let x = this.isHorizontal() ? h : f,
            g = this.isHorizontal() ? s.currentX - s.previousX : s.currentY - s.previousY;
        n.oneWayMovement && (x = Math.abs(x) * (o ? 1 : -1), g = Math.abs(g) * (o ? 1 : -1)), s.diff = x, x *= n.touchRatio, o && (x = -x, g = -g);
        let v = this.touchesDirection;
        this.swipeDirection = x > 0 ? "prev" : "next", this.touchesDirection = g > 0 ? "prev" : "next";
        let y = this.params.loop && !n.cssMode,
            b = "next" === this.touchesDirection && this.allowSlideNext || "prev" === this.touchesDirection && this.allowSlidePrev;
        if (!i.isMoved) {
            if (y && b && this.loopFix({
                    direction: this.swipeDirection
                }), i.startTranslate = this.getTranslate(), this.setTransition(0), this.animating) {
                let e = new window.CustomEvent("transitionend", {
                    bubbles: !0,
                    cancelable: !0,
                    detail: {
                        bySwiperTouchMove: !0
                    }
                });
                this.wrapperEl.dispatchEvent(e)
            }
            i.allowMomentumBounce = !1, n.grabCursor && (!0 === this.allowSlideNext || !0 === this.allowSlidePrev) && this.setGrabCursor(!0), this.emit("sliderFirstMove", d)
        }
        if (new Date().getTime(), !1 !== n._loopSwapReset && i.isMoved && i.allowThresholdMove && v !== this.touchesDirection && y && b && Math.abs(x) >= 1) {
            Object.assign(s, {
                startX: u,
                startY: p,
                currentX: u,
                currentY: p,
                startTranslate: i.currentTranslate
            }), i.loopSwapReset = !0, i.startTranslate = i.currentTranslate;
            return
        }
        this.emit("sliderMove", d), i.isMoved = !0, i.currentTranslate = x + i.startTranslate;
        let k = !0,
            w = n.resistanceRatio;
        if (n.touchReleaseOnEdges && (w = 0), x > 0 ? (y && b && !r && i.allowThresholdMove && i.currentTranslate > (n.centeredSlides ? this.minTranslate() - this.slidesSizesGrid[this.activeIndex + 1] - ("auto" !== n.slidesPerView && this.slides.length - n.slidesPerView >= 2 ? this.slidesSizesGrid[this.activeIndex + 1] + this.params.spaceBetween : 0) - this.params.spaceBetween : this.minTranslate()) && this.loopFix({
                direction: "prev",
                setTranslate: !0,
                activeSlideIndex: 0
            }), i.currentTranslate > this.minTranslate() && (k = !1, n.resistance && (i.currentTranslate = this.minTranslate() - 1 + (-this.minTranslate() + i.startTranslate + x) ** w))) : x < 0 && (y && b && !r && i.allowThresholdMove && i.currentTranslate < (n.centeredSlides ? this.maxTranslate() + this.slidesSizesGrid[this.slidesSizesGrid.length - 1] + this.params.spaceBetween + ("auto" !== n.slidesPerView && this.slides.length - n.slidesPerView >= 2 ? this.slidesSizesGrid[this.slidesSizesGrid.length - 1] + this.params.spaceBetween : 0) : this.maxTranslate()) && this.loopFix({
                direction: "next",
                setTranslate: !0,
                activeSlideIndex: this.slides.length - ("auto" === n.slidesPerView ? this.slidesPerViewDynamic() : Math.ceil(parseFloat(n.slidesPerView, 10)))
            }), i.currentTranslate < this.maxTranslate() && (k = !1, n.resistance && (i.currentTranslate = this.maxTranslate() + 1 - (this.maxTranslate() - i.startTranslate - x) ** w))), k && (d.preventedByNestedSwiper = !0), !this.allowSlideNext && "next" === this.swipeDirection && i.currentTranslate < i.startTranslate && (i.currentTranslate = i.startTranslate), !this.allowSlidePrev && "prev" === this.swipeDirection && i.currentTranslate > i.startTranslate && (i.currentTranslate = i.startTranslate), this.allowSlidePrev || this.allowSlideNext || (i.currentTranslate = i.startTranslate), n.threshold > 0)
            if (Math.abs(x) > n.threshold || i.allowThresholdMove) {
                if (!i.allowThresholdMove) {
                    i.allowThresholdMove = !0, s.startX = s.currentX, s.startY = s.currentY, i.currentTranslate = i.startTranslate, s.diff = this.isHorizontal() ? s.currentX - s.startX : s.currentY - s.startY;
                    return
                }
            } else {
                i.currentTranslate = i.startTranslate;
                return
            }
        n.followFinger && !n.cssMode && ((n.freeMode && n.freeMode.enabled && this.freeMode || n.watchSlidesProgress) && (this.updateActiveIndex(), this.updateSlidesClasses()), n.freeMode && n.freeMode.enabled && this.freeMode && this.freeMode.onTouchMove(), this.updateProgress(i.currentTranslate), this.setTranslate(i.currentTranslate))
    }

    function L(e) {
        let t, r, a = this,
            i = a.touchEventsData,
            n = e;
        if (n.originalEvent && (n = n.originalEvent), "touchend" === n.type || "touchcancel" === n.type) {
            if (!(t = [...n.changedTouches].find(e => e.identifier === i.touchId)) || t.identifier !== i.touchId) return
        } else {
            if (null !== i.touchId || n.pointerId !== i.pointerId) return;
            t = n
        }
        if (["pointercancel", "pointerout", "pointerleave", "contextmenu"].includes(n.type) && !(["pointercancel", "contextmenu"].includes(n.type) && (a.browser.isSafari || a.browser.isWebView))) return;
        i.pointerId = null, i.touchId = null;
        let {
            params: s,
            touches: o,
            rtlTranslate: l,
            slidesGrid: c,
            enabled: d
        } = a;
        if (!d || !s.simulateTouch && "mouse" === n.pointerType) return;
        if (i.allowTouchCallbacks && a.emit("touchEnd", n), i.allowTouchCallbacks = !1, !i.isTouched) {
            i.isMoved && s.grabCursor && a.setGrabCursor(!1), i.isMoved = !1, i.startMoving = !1;
            return
        }
        s.grabCursor && i.isMoved && i.isTouched && (!0 === a.allowSlideNext || !0 === a.allowSlidePrev) && a.setGrabCursor(!1);
        let p = m(),
            h = p - i.touchStartTime;
        if (a.allowClick) {
            let e = n.path || n.composedPath && n.composedPath();
            a.updateClickedSlide(e && e[0] || n.target, e), a.emit("tap click", n), h < 300 && p - i.lastClickTime < 300 && a.emit("doubleTap doubleClick", n)
        }
        if (i.lastClickTime = m(), u(() => {
                a.destroyed || (a.allowClick = !0)
            }), !i.isTouched || !i.isMoved || !a.swipeDirection || 0 === o.diff && !i.loopSwapReset || i.currentTranslate === i.startTranslate && !i.loopSwapReset) {
            i.isTouched = !1, i.isMoved = !1, i.startMoving = !1;
            return
        }
        if (i.isTouched = !1, i.isMoved = !1, i.startMoving = !1, r = s.followFinger ? l ? a.translate : -a.translate : -i.currentTranslate, s.cssMode) return;
        if (s.freeMode && s.freeMode.enabled) return void a.freeMode.onTouchEnd({
            currentPos: r
        });
        let f = r >= -a.maxTranslate() && !a.params.loop,
            x = 0,
            g = a.slidesSizesGrid[0];
        for (let e = 0; e < c.length; e += e < s.slidesPerGroupSkip ? 1 : s.slidesPerGroup) {
            let t = e < s.slidesPerGroupSkip - 1 ? 1 : s.slidesPerGroup;
            void 0 !== c[e + t] ? (f || r >= c[e] && r < c[e + t]) && (x = e, g = c[e + t] - c[e]) : (f || r >= c[e]) && (x = e, g = c[c.length - 1] - c[c.length - 2])
        }
        let v = null,
            y = null;
        s.rewind && (a.isBeginning ? y = s.virtual && s.virtual.enabled && a.virtual ? a.virtual.slides.length - 1 : a.slides.length - 1 : a.isEnd && (v = 0));
        let b = (r - c[x]) / g,
            k = x < s.slidesPerGroupSkip - 1 ? 1 : s.slidesPerGroup;
        if (h > s.longSwipesMs) {
            if (!s.longSwipes) return void a.slideTo(a.activeIndex);
            "next" === a.swipeDirection && (b >= s.longSwipesRatio ? a.slideTo(s.rewind && a.isEnd ? v : x + k) : a.slideTo(x)), "prev" === a.swipeDirection && (b > 1 - s.longSwipesRatio ? a.slideTo(x + k) : null !== y && b < 0 && Math.abs(b) > s.longSwipesRatio ? a.slideTo(y) : a.slideTo(x))
        } else {
            if (!s.shortSwipes) return void a.slideTo(a.activeIndex);
            a.navigation && (n.target === a.navigation.nextEl || n.target === a.navigation.prevEl) ? n.target === a.navigation.nextEl ? a.slideTo(x + k) : a.slideTo(x) : ("next" === a.swipeDirection && a.slideTo(null !== v ? v : x + k), "prev" === a.swipeDirection && a.slideTo(null !== y ? y : x))
        }
    }

    function z() {
        let e = this,
            {
                params: t,
                el: r
            } = e;
        if (r && 0 === r.offsetWidth) return;
        t.breakpoints && e.setBreakpoint();
        let {
            allowSlideNext: a,
            allowSlidePrev: i,
            snapGrid: n
        } = e, s = e.virtual && e.params.virtual.enabled;
        e.allowSlideNext = !0, e.allowSlidePrev = !0, e.updateSize(), e.updateSlides(), e.updateSlidesClasses();
        let o = s && t.loop;
        if ("auto" !== t.slidesPerView && !(t.slidesPerView > 1) || !e.isEnd || e.isBeginning || e.params.centeredSlides || o) e.params.loop && !s ? e.slideToLoop(e.realIndex, 0, !1, !0) : e.slideTo(e.activeIndex, 0, !1, !0);
        else {
            let t = s ? e.virtual.slides : e.slides;
            e.slideTo(t.length - 1, 0, !1, !0)
        }
        e.autoplay && e.autoplay.running && e.autoplay.paused && (clearTimeout(e.autoplay.resizeTimeout), e.autoplay.resizeTimeout = setTimeout(() => {
            e.autoplay && e.autoplay.running && e.autoplay.paused && e.autoplay.resume()
        }, 500)), e.allowSlidePrev = i, e.allowSlideNext = a, e.params.watchOverflow && n !== e.snapGrid && e.checkOverflow()
    }

    function R(e) {
        this.enabled && !this.allowClick && (this.params.preventClicks && e.preventDefault(), this.params.preventClicksPropagation && this.animating && (e.stopPropagation(), e.stopImmediatePropagation()))
    }

    function F() {
        let {
            wrapperEl: e,
            rtlTranslate: t,
            enabled: r
        } = this;
        if (!r) return;
        this.previousTranslate = this.translate, this.isHorizontal() ? this.translate = -e.scrollLeft : this.translate = -e.scrollTop, 0 === this.translate && (this.translate = 0), this.updateActiveIndex(), this.updateSlidesClasses();
        let a = this.maxTranslate() - this.minTranslate();
        (0 === a ? 0 : (this.translate - this.minTranslate()) / a) !== this.progress && this.updateProgress(t ? -this.translate : this.translate), this.emit("setTranslate", this.translate, !1)
    }

    function $(e) {
        N(this, e.target), !this.params.cssMode && ("auto" === this.params.slidesPerView || this.params.autoHeight) && this.update()
    }

    function B() {
        !this.documentTouchHandlerProceeded && (this.documentTouchHandlerProceeded = !0, this.params.touchReleaseOnEdges && (this.el.style.touchAction = "auto"))
    }
    let q = (e, t) => {
            let r = l(),
                {
                    params: a,
                    el: i,
                    wrapperEl: n,
                    device: s
                } = e,
                o = !!a.nested,
                c = "on" === t ? "addEventListener" : "removeEventListener";
            i && "string" != typeof i && (r[c]("touchstart", e.onDocumentTouchStart, {
                passive: !1,
                capture: o
            }), i[c]("touchstart", e.onTouchStart, {
                passive: !1
            }), i[c]("pointerdown", e.onTouchStart, {
                passive: !1
            }), r[c]("touchmove", e.onTouchMove, {
                passive: !1,
                capture: o
            }), r[c]("pointermove", e.onTouchMove, {
                passive: !1,
                capture: o
            }), r[c]("touchend", e.onTouchEnd, {
                passive: !0
            }), r[c]("pointerup", e.onTouchEnd, {
                passive: !0
            }), r[c]("pointercancel", e.onTouchEnd, {
                passive: !0
            }), r[c]("touchcancel", e.onTouchEnd, {
                passive: !0
            }), r[c]("pointerout", e.onTouchEnd, {
                passive: !0
            }), r[c]("pointerleave", e.onTouchEnd, {
                passive: !0
            }), r[c]("contextmenu", e.onTouchEnd, {
                passive: !0
            }), (a.preventClicks || a.preventClicksPropagation) && i[c]("click", e.onClick, !0), a.cssMode && n[c]("scroll", e.onScroll), a.updateOnWindowResize ? e[t](s.ios || s.android ? "resize orientationchange observerUpdate" : "resize observerUpdate", z, !0) : e[t]("observerUpdate", z, !0), i[c]("load", e.onLoad, {
                capture: !0
            }))
        },
        V = (e, t) => e.grid && t.grid && t.grid.rows > 1;
    var H = {
        init: !0,
        direction: "horizontal",
        oneWayMovement: !1,
        swiperElementNodeName: "SWIPER-CONTAINER",
        touchEventsTarget: "wrapper",
        initialSlide: 0,
        speed: 300,
        cssMode: !1,
        updateOnWindowResize: !0,
        resizeObserver: !0,
        nested: !1,
        createElements: !1,
        eventsPrefix: "swiper",
        enabled: !0,
        focusableElements: "input, select, option, textarea, button, video, label",
        width: null,
        height: null,
        preventInteractionOnTransition: !1,
        userAgent: null,
        url: null,
        edgeSwipeDetection: !1,
        edgeSwipeThreshold: 20,
        autoHeight: !1,
        setWrapperSize: !1,
        virtualTranslate: !1,
        effect: "slide",
        breakpoints: void 0,
        breakpointsBase: "window",
        spaceBetween: 0,
        slidesPerView: 1,
        slidesPerGroup: 1,
        slidesPerGroupSkip: 0,
        slidesPerGroupAuto: !1,
        centeredSlides: !1,
        centeredSlidesBounds: !1,
        slidesOffsetBefore: 0,
        slidesOffsetAfter: 0,
        normalizeSlideIndex: !0,
        centerInsufficientSlides: !1,
        snapToSlideEdge: !1,
        watchOverflow: !0,
        roundLengths: !1,
        touchRatio: 1,
        touchAngle: 45,
        simulateTouch: !0,
        shortSwipes: !0,
        longSwipes: !0,
        longSwipesRatio: .5,
        longSwipesMs: 300,
        followFinger: !0,
        allowTouchMove: !0,
        threshold: 5,
        touchMoveStopPropagation: !1,
        touchStartPreventDefault: !0,
        touchStartForcePreventDefault: !1,
        touchReleaseOnEdges: !1,
        uniqueNavElements: !0,
        resistance: !0,
        resistanceRatio: .85,
        watchSlidesProgress: !1,
        grabCursor: !1,
        preventClicks: !0,
        preventClicksPropagation: !0,
        slideToClickedSlide: !1,
        loop: !1,
        loopAddBlankSlides: !0,
        loopAdditionalSlides: 0,
        loopPreventsSliding: !0,
        rewind: !1,
        allowSlidePrev: !0,
        allowSlideNext: !0,
        swipeHandler: null,
        noSwiping: !0,
        noSwipingClass: "swiper-no-swiping",
        noSwipingSelector: null,
        passiveListeners: !0,
        maxBackfaceHiddenSlides: 10,
        containerModifierClass: "swiper-",
        slideClass: "swiper-slide",
        slideBlankClass: "swiper-slide-blank",
        slideActiveClass: "swiper-slide-active",
        slideVisibleClass: "swiper-slide-visible",
        slideFullyVisibleClass: "swiper-slide-fully-visible",
        slideNextClass: "swiper-slide-next",
        slidePrevClass: "swiper-slide-prev",
        wrapperClass: "swiper-wrapper",
        lazyPreloaderClass: "swiper-lazy-preloader",
        lazyPreloadPrevNext: 0,
        runCallbacksOnInit: !0,
        _emitClasses: !1
    };
    let U = {
            eventsEmitter: {
                on(e, t, r) {
                    let a = this;
                    if (!a.eventsListeners || a.destroyed || "function" != typeof t) return a;
                    let i = r ? "unshift" : "push";
                    return e.split(" ").forEach(e => {
                        a.eventsListeners[e] || (a.eventsListeners[e] = []), a.eventsListeners[e][i](t)
                    }), a
                },
                once(e, t, r) {
                    let a = this;
                    if (!a.eventsListeners || a.destroyed || "function" != typeof t) return a;

                    function i(...r) {
                        a.off(e, i), i.__emitterProxy && delete i.__emitterProxy, t.apply(a, r)
                    }
                    return i.__emitterProxy = t, a.on(e, i, r)
                },
                onAny(e, t) {
                    return !this.eventsListeners || this.destroyed || "function" != typeof e || 0 > this.eventsAnyListeners.indexOf(e) && this.eventsAnyListeners[t ? "unshift" : "push"](e), this
                },
                offAny(e) {
                    if (!this.eventsListeners || this.destroyed || !this.eventsAnyListeners) return this;
                    let t = this.eventsAnyListeners.indexOf(e);
                    return t >= 0 && this.eventsAnyListeners.splice(t, 1), this
                },
                off(e, t) {
                    let r = this;
                    return r.eventsListeners && !r.destroyed && r.eventsListeners && e.split(" ").forEach(e => {
                        void 0 === t ? r.eventsListeners[e] = [] : r.eventsListeners[e] && r.eventsListeners[e].forEach((a, i) => {
                            (a === t || a.__emitterProxy && a.__emitterProxy === t) && r.eventsListeners[e].splice(i, 1)
                        })
                    }), r
                },
                emit(...e) {
                    let t, r, a, i = this;
                    return i.eventsListeners && !i.destroyed && i.eventsListeners && ("string" == typeof e[0] || Array.isArray(e[0]) ? (t = e[0], r = e.slice(1, e.length), a = i) : (t = e[0].events, r = e[0].data, a = e[0].context || i), r.unshift(a), (Array.isArray(t) ? t : t.split(" ")).forEach(e => {
                        i.eventsAnyListeners && i.eventsAnyListeners.length && i.eventsAnyListeners.forEach(t => {
                            t.apply(a, [e, ...r])
                        }), i.eventsListeners && i.eventsListeners[e] && i.eventsListeners[e].forEach(e => {
                            e.apply(a, r)
                        })
                    })), i
                }
            },
            update: {
                updateSize: function() {
                    let e, t, r = this.el;
                    e = void 0 !== this.params.width && null !== this.params.width ? this.params.width : r.clientWidth, t = void 0 !== this.params.height && null !== this.params.height ? this.params.height : r.clientHeight, 0 === e && this.isHorizontal() || 0 === t && this.isVertical() || (e = e - parseInt(b(r, "padding-left") || 0, 10) - parseInt(b(r, "padding-right") || 0, 10), t = t - parseInt(b(r, "padding-top") || 0, 10) - parseInt(b(r, "padding-bottom") || 0, 10), Number.isNaN(e) && (e = 0), Number.isNaN(t) && (t = 0), Object.assign(this, {
                        width: e,
                        height: t,
                        size: this.isHorizontal() ? e : t
                    }))
                },
                updateSlides: function() {
                    let e, t = this;

                    function r(e, r) {
                        return parseFloat(e.getPropertyValue(t.getDirectionLabel(r)) || 0)
                    }
                    let a = t.params,
                        {
                            wrapperEl: i,
                            slidesEl: n,
                            rtlTranslate: s,
                            wrongRTL: o
                        } = t,
                        l = t.virtual && a.virtual.enabled,
                        c = l ? t.virtual.slides.length : t.slides.length,
                        d = g(n, `.${t.params.slideClass}, swiper-slide`),
                        u = l ? t.virtual.slides.length : d.length,
                        m = [],
                        p = [],
                        h = [],
                        x = a.slidesOffsetBefore;
                    "function" == typeof x && (x = a.slidesOffsetBefore.call(t));
                    let v = a.slidesOffsetAfter;
                    "function" == typeof v && (v = a.slidesOffsetAfter.call(t));
                    let y = t.snapGrid.length,
                        k = t.slidesGrid.length,
                        S = t.size - x - v,
                        j = a.spaceBetween,
                        C = -x,
                        _ = 0,
                        T = 0;
                    if (void 0 === S) return;
                    "string" == typeof j && j.indexOf("%") >= 0 ? j = parseFloat(j.replace("%", "")) / 100 * S : "string" == typeof j && (j = parseFloat(j)), t.virtualSize = -j - x - v, d.forEach(e => {
                        s ? e.style.marginLeft = "" : e.style.marginRight = "", e.style.marginBottom = "", e.style.marginTop = ""
                    }), a.centeredSlides && a.cssMode && (f(i, "--swiper-centered-offset-before", ""), f(i, "--swiper-centered-offset-after", "")), a.cssMode && (f(i, "--swiper-slides-offset-before", `${x}px`), f(i, "--swiper-slides-offset-after", `${v}px`));
                    let M = a.grid && a.grid.rows > 1 && t.grid;
                    M ? t.grid.initSlides(d) : t.grid && t.grid.unsetSlides();
                    let N = "auto" === a.slidesPerView && a.breakpoints && Object.keys(a.breakpoints).filter(e => void 0 !== a.breakpoints[e].slidesPerView).length > 0;
                    for (let i = 0; i < u; i += 1) {
                        e = 0;
                        let n = d[i];
                        if (!n || (M && t.grid.updateSlide(i, n, d), "none" !== b(n, "display"))) {
                            if (l && "auto" === a.slidesPerView) a.virtual.slidesPerViewAutoSlideSize && (e = a.virtual.slidesPerViewAutoSlideSize), e && n && (a.roundLengths && (e = Math.floor(e)), n.style[t.getDirectionLabel("width")] = `${e}px`);
                            else if ("auto" === a.slidesPerView) {
                                N && (n.style[t.getDirectionLabel("width")] = "");
                                let i = getComputedStyle(n),
                                    s = n.style.transform,
                                    o = n.style.webkitTransform;
                                if (s && (n.style.transform = "none"), o && (n.style.webkitTransform = "none"), a.roundLengths) e = t.isHorizontal() ? w(n, "width", !0) : w(n, "height", !0);
                                else {
                                    let t = r(i, "width"),
                                        a = r(i, "padding-left"),
                                        s = r(i, "padding-right"),
                                        o = r(i, "margin-left"),
                                        l = r(i, "margin-right"),
                                        c = i.getPropertyValue("box-sizing");
                                    if (c && "border-box" === c) e = t + o + l;
                                    else {
                                        let {
                                            clientWidth: r,
                                            offsetWidth: i
                                        } = n;
                                        e = t + a + s + o + l + (i - r)
                                    }
                                }
                                s && (n.style.transform = s), o && (n.style.webkitTransform = o), a.roundLengths && (e = Math.floor(e))
                            } else e = (S - (a.slidesPerView - 1) * j) / a.slidesPerView, a.roundLengths && (e = Math.floor(e)), n && (n.style[t.getDirectionLabel("width")] = `${e}px`);
                            n && (n.swiperSlideSize = e), h.push(e), a.centeredSlides ? (C = C + e / 2 + _ / 2 + j, 0 === _ && 0 !== i && (C = C - S / 2 - j), 0 === i && (C = C - S / 2 - j), .001 > Math.abs(C) && (C = 0), a.roundLengths && (C = Math.floor(C)), T % a.slidesPerGroup == 0 && m.push(C), p.push(C)) : (a.roundLengths && (C = Math.floor(C)), (T - Math.min(t.params.slidesPerGroupSkip, T)) % t.params.slidesPerGroup == 0 && m.push(C), p.push(C), C = C + e + j), t.virtualSize += e + j, _ = e, T += 1
                        }
                    }
                    if (t.virtualSize = Math.max(t.virtualSize, S) + v, s && o && ("slide" === a.effect || "coverflow" === a.effect) && (i.style.width = `${t.virtualSize+j}px`), a.setWrapperSize && (i.style[t.getDirectionLabel("width")] = `${t.virtualSize+j}px`), M && t.grid.updateWrapperSize(e, m), !a.centeredSlides) {
                        let e = "auto" !== a.slidesPerView && a.slidesPerView % 1 != 0,
                            r = a.snapToSlideEdge && !a.loop && ("auto" === a.slidesPerView || e),
                            i = m.length;
                        if (r) {
                            let e;
                            if ("auto" === a.slidesPerView) {
                                e = 1;
                                let t = 0;
                                for (let r = h.length - 1; r >= 0; r -= 1)
                                    if ((t += h[r] + (r < h.length - 1 ? j : 0)) <= S) e = h.length - r;
                                    else break
                            } else e = Math.floor(a.slidesPerView);
                            i = Math.max(u - e, 0)
                        }
                        let n = [];
                        for (let e = 0; e < m.length; e += 1) {
                            let s = m[e];
                            a.roundLengths && (s = Math.floor(s)), r ? e <= i && n.push(s) : m[e] <= t.virtualSize - S && n.push(s)
                        }
                        m = n, Math.floor(t.virtualSize - S) - Math.floor(m[m.length - 1]) > 1 && !r && m.push(t.virtualSize - S)
                    }
                    if (l && a.loop) {
                        let e = h[0] + j;
                        if (a.slidesPerGroup > 1) {
                            let r = Math.ceil((t.virtual.slidesBefore + t.virtual.slidesAfter) / a.slidesPerGroup),
                                i = e * a.slidesPerGroup;
                            for (let e = 0; e < r; e += 1) m.push(m[m.length - 1] + i)
                        }
                        for (let r = 0; r < t.virtual.slidesBefore + t.virtual.slidesAfter; r += 1) 1 === a.slidesPerGroup && m.push(m[m.length - 1] + e), p.push(p[p.length - 1] + e), t.virtualSize += e
                    }
                    if (0 === m.length && (m = [0]), 0 !== j) {
                        let e = t.isHorizontal() && s ? "marginLeft" : t.getDirectionLabel("marginRight");
                        d.filter((e, t) => !a.cssMode || !!a.loop || t !== d.length - 1).forEach(t => {
                            t.style[e] = `${j}px`
                        })
                    }
                    if (a.centeredSlides && a.centeredSlidesBounds) {
                        let e = 0;
                        h.forEach(t => {
                            e += t + (j || 0)
                        });
                        let t = (e -= j) > S ? e - S : 0;
                        m = m.map(e => e <= 0 ? -x : e > t ? t + v : e)
                    }
                    if (a.centerInsufficientSlides) {
                        let e = 0;
                        if (h.forEach(t => {
                                e += t + (j || 0)
                            }), (e -= j) < S) {
                            let t = (S - e) / 2;
                            m.forEach((e, r) => {
                                m[r] = e - t
                            }), p.forEach((e, r) => {
                                p[r] = e + t
                            })
                        }
                    }
                    if (Object.assign(t, {
                            slides: d,
                            snapGrid: m,
                            slidesGrid: p,
                            slidesSizesGrid: h
                        }), a.centeredSlides && a.cssMode && !a.centeredSlidesBounds) {
                        f(i, "--swiper-centered-offset-before", `${-m[0]}px`), f(i, "--swiper-centered-offset-after", `${t.size/2-h[h.length-1]/2}px`);
                        let e = -t.snapGrid[0],
                            r = -t.slidesGrid[0];
                        t.snapGrid = t.snapGrid.map(t => t + e), t.slidesGrid = t.slidesGrid.map(e => e + r)
                    }
                    if (u !== c && t.emit("slidesLengthChange"), m.length !== y && (t.params.watchOverflow && t.checkOverflow(), t.emit("snapGridLengthChange")), p.length !== k && t.emit("slidesGridLengthChange"), a.watchSlidesProgress && t.updateSlidesOffset(), t.emit("slidesUpdated"), !l && !a.cssMode && ("slide" === a.effect || "fade" === a.effect)) {
                        let e = `${a.containerModifierClass}backface-hidden`,
                            r = t.el.classList.contains(e);
                        u <= a.maxBackfaceHiddenSlides ? r || t.el.classList.add(e) : r && t.el.classList.remove(e)
                    }
                },
                updateAutoHeight: function(e) {
                    let t, r = this,
                        a = [],
                        i = r.virtual && r.params.virtual.enabled,
                        n = 0;
                    "number" == typeof e ? r.setTransition(e) : !0 === e && r.setTransition(r.params.speed);
                    let s = e => i ? r.slides[r.getSlideIndexByData(e)] : r.slides[e];
                    if ("auto" !== r.params.slidesPerView && r.params.slidesPerView > 1)
                        if (r.params.centeredSlides)(r.visibleSlides || []).forEach(e => {
                            a.push(e)
                        });
                        else
                            for (t = 0; t < Math.ceil(r.params.slidesPerView); t += 1) {
                                let e = r.activeIndex + t;
                                if (e > r.slides.length && !i) break;
                                a.push(s(e))
                            } else a.push(s(r.activeIndex));
                    for (t = 0; t < a.length; t += 1)
                        if (void 0 !== a[t]) {
                            let e = a[t].offsetHeight;
                            n = e > n ? e : n
                        }(n || 0 === n) && (r.wrapperEl.style.height = `${n}px`)
                },
                updateSlidesOffset: function() {
                    let e = this.slides,
                        t = this.isElement ? this.isHorizontal() ? this.wrapperEl.offsetLeft : this.wrapperEl.offsetTop : 0;
                    for (let r = 0; r < e.length; r += 1) e[r].swiperSlideOffset = (this.isHorizontal() ? e[r].offsetLeft : e[r].offsetTop) - t - this.cssOverflowAdjustment()
                },
                updateSlidesProgress: function(e = this && this.translate || 0) {
                    let t = this.params,
                        {
                            slides: r,
                            rtlTranslate: a,
                            snapGrid: i
                        } = this;
                    if (0 === r.length) return;
                    void 0 === r[0].swiperSlideOffset && this.updateSlidesOffset();
                    let n = -e;
                    a && (n = e), this.visibleSlidesIndexes = [], this.visibleSlides = [];
                    let s = t.spaceBetween;
                    "string" == typeof s && s.indexOf("%") >= 0 ? s = parseFloat(s.replace("%", "")) / 100 * this.size : "string" == typeof s && (s = parseFloat(s));
                    for (let e = 0; e < r.length; e += 1) {
                        let o = r[e],
                            l = o.swiperSlideOffset;
                        t.cssMode && t.centeredSlides && (l -= r[0].swiperSlideOffset);
                        let c = (n + (t.centeredSlides ? this.minTranslate() : 0) - l) / (o.swiperSlideSize + s),
                            d = (n - i[0] + (t.centeredSlides ? this.minTranslate() : 0) - l) / (o.swiperSlideSize + s),
                            u = -(n - l),
                            m = u + this.slidesSizesGrid[e],
                            p = u >= 0 && u <= this.size - this.slidesSizesGrid[e],
                            h = u >= 0 && u < this.size - 1 || m > 1 && m <= this.size || u <= 0 && m >= this.size;
                        h && (this.visibleSlides.push(o), this.visibleSlidesIndexes.push(e)), T(o, h, t.slideVisibleClass), T(o, p, t.slideFullyVisibleClass), o.progress = a ? -c : c, o.originalProgress = a ? -d : d
                    }
                },
                updateProgress: function(e) {
                    if (void 0 === e) {
                        let t = this.rtlTranslate ? -1 : 1;
                        e = this && this.translate && this.translate * t || 0
                    }
                    let t = this.params,
                        r = this.maxTranslate() - this.minTranslate(),
                        {
                            progress: a,
                            isBeginning: i,
                            isEnd: n,
                            progressLoop: s
                        } = this,
                        o = i,
                        l = n;
                    if (0 === r) a = 0, i = !0, n = !0;
                    else {
                        a = (e - this.minTranslate()) / r;
                        let t = 1 > Math.abs(e - this.minTranslate()),
                            s = 1 > Math.abs(e - this.maxTranslate());
                        i = t || a <= 0, n = s || a >= 1, t && (a = 0), s && (a = 1)
                    }
                    if (t.loop) {
                        let t = this.getSlideIndexByData(0),
                            r = this.getSlideIndexByData(this.slides.length - 1),
                            a = this.slidesGrid[t],
                            i = this.slidesGrid[r],
                            n = this.slidesGrid[this.slidesGrid.length - 1],
                            o = Math.abs(e);
                        (s = o >= a ? (o - a) / n : (o + n - i) / n) > 1 && (s -= 1)
                    }
                    Object.assign(this, {
                        progress: a,
                        progressLoop: s,
                        isBeginning: i,
                        isEnd: n
                    }), (t.watchSlidesProgress || t.centeredSlides && t.autoHeight) && this.updateSlidesProgress(e), i && !o && this.emit("reachBeginning toEdge"), n && !l && this.emit("reachEnd toEdge"), (o && !i || l && !n) && this.emit("fromEdge"), this.emit("progress", a)
                },
                updateSlidesClasses: function() {
                    let e, t, r, {
                            slides: a,
                            params: i,
                            slidesEl: n,
                            activeIndex: s
                        } = this,
                        o = this.virtual && i.virtual.enabled,
                        l = this.grid && i.grid && i.grid.rows > 1,
                        c = e => g(n, `.${i.slideClass}${e}, swiper-slide${e}`)[0];
                    if (o)
                        if (i.loop) {
                            let t = s - this.virtual.slidesBefore;
                            t < 0 && (t = this.virtual.slides.length + t), t >= this.virtual.slides.length && (t -= this.virtual.slides.length), e = c(`[data-swiper-slide-index="${t}"]`)
                        } else e = c(`[data-swiper-slide-index="${s}"]`);
                    else l ? (e = a.find(e => e.column === s), r = a.find(e => e.column === s + 1), t = a.find(e => e.column === s - 1)) : e = a[s];
                    e && !l && (r = function(e, t) {
                        let r = [];
                        for (; e.nextElementSibling;) {
                            let a = e.nextElementSibling;
                            t ? a.matches(t) && r.push(a) : r.push(a), e = a
                        }
                        return r
                    }(e, `.${i.slideClass}, swiper-slide`)[0], i.loop && !r && (r = a[0]), t = function(e, t) {
                        let r = [];
                        for (; e.previousElementSibling;) {
                            let a = e.previousElementSibling;
                            t ? a.matches(t) && r.push(a) : r.push(a), e = a
                        }
                        return r
                    }(e, `.${i.slideClass}, swiper-slide`)[0], i.loop), a.forEach(a => {
                        M(a, a === e, i.slideActiveClass), M(a, a === r, i.slideNextClass), M(a, a === t, i.slidePrevClass)
                    }), this.emitSlidesClasses()
                },
                updateActiveIndex: function(e) {
                    let t, r, a = this,
                        i = a.rtlTranslate ? a.translate : -a.translate,
                        {
                            snapGrid: n,
                            params: s,
                            activeIndex: o,
                            realIndex: l,
                            snapIndex: c
                        } = a,
                        d = e,
                        u = e => {
                            let t = e - a.virtual.slidesBefore;
                            return t < 0 && (t = a.virtual.slides.length + t), t >= a.virtual.slides.length && (t -= a.virtual.slides.length), t
                        };
                    if (void 0 === d && (d = function(e) {
                            let t, {
                                    slidesGrid: r,
                                    params: a
                                } = e,
                                i = e.rtlTranslate ? e.translate : -e.translate;
                            for (let e = 0; e < r.length; e += 1) void 0 !== r[e + 1] ? i >= r[e] && i < r[e + 1] - (r[e + 1] - r[e]) / 2 ? t = e : i >= r[e] && i < r[e + 1] && (t = e + 1) : i >= r[e] && (t = e);
                            return a.normalizeSlideIndex && (t < 0 || void 0 === t) && (t = 0), t
                        }(a)), n.indexOf(i) >= 0) t = n.indexOf(i);
                    else {
                        let e = Math.min(s.slidesPerGroupSkip, d);
                        t = e + Math.floor((d - e) / s.slidesPerGroup)
                    }
                    if (t >= n.length && (t = n.length - 1), d === o && !a.params.loop) {
                        t !== c && (a.snapIndex = t, a.emit("snapIndexChange"));
                        return
                    }
                    if (d === o && a.params.loop && a.virtual && a.params.virtual.enabled) {
                        a.realIndex = u(d);
                        return
                    }
                    let m = a.grid && s.grid && s.grid.rows > 1;
                    if (a.virtual && s.virtual.enabled) r = s.loop ? u(d) : d;
                    else if (m) {
                        let e = a.slides.find(e => e.column === d),
                            t = parseInt(e.getAttribute("data-swiper-slide-index"), 10);
                        Number.isNaN(t) && (t = Math.max(a.slides.indexOf(e), 0)), r = Math.floor(t / s.grid.rows)
                    } else if (a.slides[d]) {
                        let e = a.slides[d].getAttribute("data-swiper-slide-index");
                        r = e ? parseInt(e, 10) : d
                    } else r = d;
                    Object.assign(a, {
                        previousSnapIndex: c,
                        snapIndex: t,
                        previousRealIndex: l,
                        realIndex: r,
                        previousIndex: o,
                        activeIndex: d
                    }), a.initialized && P(a), a.emit("activeIndexChange"), a.emit("snapIndexChange"), (a.initialized || a.params.runCallbacksOnInit) && (l !== r && a.emit("realIndexChange"), a.emit("slideChange"))
                },
                updateClickedSlide: function(e, t) {
                    let r, a = this.params,
                        i = e.closest(`.${a.slideClass}, swiper-slide`);
                    !i && this.isElement && t && t.length > 1 && t.includes(e) && [...t.slice(t.indexOf(e) + 1, t.length)].forEach(e => {
                        !i && e.matches && e.matches(`.${a.slideClass}, swiper-slide`) && (i = e)
                    });
                    let n = !1;
                    if (i) {
                        for (let e = 0; e < this.slides.length; e += 1)
                            if (this.slides[e] === i) {
                                n = !0, r = e;
                                break
                            }
                    }
                    if (i && n) this.clickedSlide = i, this.virtual && this.params.virtual.enabled ? this.clickedIndex = parseInt(i.getAttribute("data-swiper-slide-index"), 10) : this.clickedIndex = r;
                    else {
                        this.clickedSlide = void 0, this.clickedIndex = void 0;
                        return
                    }
                    a.slideToClickedSlide && void 0 !== this.clickedIndex && this.clickedIndex !== this.activeIndex && this.slideToClickedSlide()
                }
            },
            translate: {
                getTranslate: function(e = this.isHorizontal() ? "x" : "y") {
                    let {
                        params: t,
                        rtlTranslate: r,
                        translate: a,
                        wrapperEl: i
                    } = this;
                    if (t.virtualTranslate) return r ? -a : a;
                    if (t.cssMode) return a;
                    let n = function(e, t = "x") {
                        let r, a, i, n, s, o = d(),
                            l = ((s = d()).getComputedStyle && (n = s.getComputedStyle(e, null)), !n && e.currentStyle && (n = e.currentStyle), n || (n = e.style), n);
                        return o.WebKitCSSMatrix ? ((a = l.transform || l.webkitTransform).split(",").length > 6 && (a = a.split(", ").map(e => e.replace(",", ".")).join(", ")), i = new o.WebKitCSSMatrix("none" === a ? "" : a)) : r = (i = l.MozTransform || l.OTransform || l.MsTransform || l.msTransform || l.transform || l.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,")).toString().split(","), "x" === t && (a = o.WebKitCSSMatrix ? i.m41 : 16 === r.length ? parseFloat(r[12]) : parseFloat(r[4])), "y" === t && (a = o.WebKitCSSMatrix ? i.m42 : 16 === r.length ? parseFloat(r[13]) : parseFloat(r[5])), a || 0
                    }(i, e);
                    return n += this.cssOverflowAdjustment(), r && (n = -n), n || 0
                },
                setTranslate: function(e, t) {
                    let {
                        rtlTranslate: r,
                        params: a,
                        wrapperEl: i,
                        progress: n
                    } = this, s = 0, o = 0;
                    this.isHorizontal() ? s = r ? -e : e : o = e, a.roundLengths && (s = Math.floor(s), o = Math.floor(o)), this.previousTranslate = this.translate, this.translate = this.isHorizontal() ? s : o, a.cssMode ? i[this.isHorizontal() ? "scrollLeft" : "scrollTop"] = this.isHorizontal() ? -s : -o : a.virtualTranslate || (this.isHorizontal() ? s -= this.cssOverflowAdjustment() : o -= this.cssOverflowAdjustment(), i.style.transform = `translate3d(${s}px, ${o}px, 0px)`);
                    let l = this.maxTranslate() - this.minTranslate();
                    (0 === l ? 0 : (e - this.minTranslate()) / l) !== n && this.updateProgress(e), this.emit("setTranslate", this.translate, t)
                },
                minTranslate: function() {
                    return -this.snapGrid[0]
                },
                maxTranslate: function() {
                    return -this.snapGrid[this.snapGrid.length - 1]
                },
                translateTo: function(e = 0, t = this.params.speed, r = !0, a = !0, i) {
                    let n, s = this,
                        {
                            params: o,
                            wrapperEl: l
                        } = s;
                    if (s.animating && o.preventInteractionOnTransition) return !1;
                    let c = s.minTranslate(),
                        d = s.maxTranslate();
                    if (n = a && e > c ? c : a && e < d ? d : e, s.updateProgress(n), o.cssMode) {
                        let e = s.isHorizontal();
                        if (0 === t) l[e ? "scrollLeft" : "scrollTop"] = -n;
                        else {
                            if (!s.support.smoothScroll) return x({
                                swiper: s,
                                targetPosition: -n,
                                side: e ? "left" : "top"
                            }), !0;
                            l.scrollTo({
                                [e ? "left" : "top"]: -n,
                                behavior: "smooth"
                            })
                        }
                        return !0
                    }
                    return 0 === t ? (s.setTransition(0), s.setTranslate(n), r && (s.emit("beforeTransitionStart", t, i), s.emit("transitionEnd"))) : (s.setTransition(t), s.setTranslate(n), r && (s.emit("beforeTransitionStart", t, i), s.emit("transitionStart")), s.animating || (s.animating = !0, s.onTranslateToWrapperTransitionEnd || (s.onTranslateToWrapperTransitionEnd = function(e) {
                        !s || s.destroyed || e.target === this && (s.wrapperEl.removeEventListener("transitionend", s.onTranslateToWrapperTransitionEnd), s.onTranslateToWrapperTransitionEnd = null, delete s.onTranslateToWrapperTransitionEnd, s.animating = !1, r && s.emit("transitionEnd"))
                    }), s.wrapperEl.addEventListener("transitionend", s.onTranslateToWrapperTransitionEnd))), !0
                }
            },
            transition: {
                setTransition: function(e, t) {
                    this.params.cssMode || (this.wrapperEl.style.transitionDuration = `${e}ms`, this.wrapperEl.style.transitionDelay = 0 === e ? "0ms" : ""), this.emit("setTransition", e, t)
                },
                transitionStart: function(e = !0, t) {
                    let {
                        params: r
                    } = this;
                    r.cssMode || (r.autoHeight && this.updateAutoHeight(), E({
                        swiper: this,
                        runCallbacks: e,
                        direction: t,
                        step: "Start"
                    }))
                },
                transitionEnd: function(e = !0, t) {
                    let {
                        params: r
                    } = this;
                    this.animating = !1, r.cssMode || (this.setTransition(0), E({
                        swiper: this,
                        runCallbacks: e,
                        direction: t,
                        step: "End"
                    }))
                }
            },
            slide: {
                slideTo: function(e = 0, t, r = !0, a, i) {
                    let n;
                    "string" == typeof e && (e = parseInt(e, 10));
                    let s = this,
                        o = e;
                    o < 0 && (o = 0);
                    let {
                        params: l,
                        snapGrid: c,
                        slidesGrid: d,
                        previousIndex: u,
                        activeIndex: m,
                        rtlTranslate: p,
                        wrapperEl: h,
                        enabled: f
                    } = s;
                    if (!f && !a && !i || s.destroyed || s.animating && l.preventInteractionOnTransition) return !1;
                    void 0 === t && (t = s.params.speed);
                    let g = Math.min(s.params.slidesPerGroupSkip, o),
                        v = g + Math.floor((o - g) / s.params.slidesPerGroup);
                    v >= c.length && (v = c.length - 1);
                    let y = -c[v];
                    if (l.normalizeSlideIndex)
                        for (let e = 0; e < d.length; e += 1) {
                            let t = -Math.floor(100 * y),
                                r = Math.floor(100 * d[e]),
                                a = Math.floor(100 * d[e + 1]);
                            void 0 !== d[e + 1] ? t >= r && t < a - (a - r) / 2 ? o = e : t >= r && t < a && (o = e + 1) : t >= r && (o = e)
                        }
                    if (s.initialized && o !== m && (!s.allowSlideNext && (p ? y > s.translate && y > s.minTranslate() : y < s.translate && y < s.minTranslate()) || !s.allowSlidePrev && y > s.translate && y > s.maxTranslate() && (m || 0) !== o)) return !1;
                    o !== (u || 0) && r && s.emit("beforeSlideChangeStart"), s.updateProgress(y), n = o > m ? "next" : o < m ? "prev" : "reset";
                    let b = s.virtual && s.params.virtual.enabled;
                    if (!(b && i) && (p && -y === s.translate || !p && y === s.translate)) return s.updateActiveIndex(o), l.autoHeight && s.updateAutoHeight(), s.updateSlidesClasses(), "slide" !== l.effect && s.setTranslate(y), "reset" !== n && (s.transitionStart(r, n), s.transitionEnd(r, n)), !1;
                    if (l.cssMode) {
                        let e = s.isHorizontal(),
                            r = p ? y : -y;
                        if (0 === t) b && (s.wrapperEl.style.scrollSnapType = "none", s._immediateVirtual = !0), b && !s._cssModeVirtualInitialSet && s.params.initialSlide > 0 ? (s._cssModeVirtualInitialSet = !0, requestAnimationFrame(() => {
                            h[e ? "scrollLeft" : "scrollTop"] = r
                        })) : h[e ? "scrollLeft" : "scrollTop"] = r, b && requestAnimationFrame(() => {
                            s.wrapperEl.style.scrollSnapType = "", s._immediateVirtual = !1
                        });
                        else {
                            if (!s.support.smoothScroll) return x({
                                swiper: s,
                                targetPosition: r,
                                side: e ? "left" : "top"
                            }), !0;
                            h.scrollTo({
                                [e ? "left" : "top"]: r,
                                behavior: "smooth"
                            })
                        }
                        return !0
                    }
                    let k = _().isSafari;
                    return b && !i && k && s.isElement && s.virtual.update(!1, !1, o), s.setTransition(t), s.setTranslate(y), s.updateActiveIndex(o), s.updateSlidesClasses(), s.emit("beforeTransitionStart", t, a), s.transitionStart(r, n), 0 === t ? s.transitionEnd(r, n) : s.animating || (s.animating = !0, s.onSlideToWrapperTransitionEnd || (s.onSlideToWrapperTransitionEnd = function(e) {
                        !s || s.destroyed || e.target === this && (s.wrapperEl.removeEventListener("transitionend", s.onSlideToWrapperTransitionEnd), s.onSlideToWrapperTransitionEnd = null, delete s.onSlideToWrapperTransitionEnd, s.transitionEnd(r, n))
                    }), s.wrapperEl.addEventListener("transitionend", s.onSlideToWrapperTransitionEnd)), !0
                },
                slideToLoop: function(e = 0, t, r = !0, a) {
                    "string" == typeof e && (e = parseInt(e, 10));
                    let i = this;
                    if (i.destroyed) return;
                    void 0 === t && (t = i.params.speed);
                    let n = i.grid && i.params.grid && i.params.grid.rows > 1,
                        s = e;
                    if (i.params.loop)
                        if (i.virtual && i.params.virtual.enabled) s += i.virtual.slidesBefore;
                        else {
                            let e;
                            if (n) {
                                let t = s * i.params.grid.rows;
                                e = i.slides.find(e => +e.getAttribute("data-swiper-slide-index") === t).column
                            } else e = i.getSlideIndexByData(s);
                            let t = n ? Math.ceil(i.slides.length / i.params.grid.rows) : i.slides.length,
                                {
                                    centeredSlides: r,
                                    slidesOffsetBefore: o,
                                    slidesOffsetAfter: l
                                } = i.params,
                                c = r || !!o || !!l,
                                d = i.params.slidesPerView;
                            "auto" === d ? d = i.slidesPerViewDynamic() : (d = Math.ceil(parseFloat(i.params.slidesPerView, 10)), c && d % 2 == 0 && (d += 1));
                            let u = t - e < d;
                            if (c && (u = u || e < Math.ceil(d / 2)), a && c && "auto" !== i.params.slidesPerView && !n && (u = !1), u) {
                                let r = c ? e < i.activeIndex ? "prev" : "next" : e - i.activeIndex - 1 < i.params.slidesPerView ? "next" : "prev";
                                i.loopFix({
                                    direction: r,
                                    slideTo: !0,
                                    activeSlideIndex: "next" === r ? e + 1 : e - t + 1,
                                    slideRealIndex: "next" === r ? i.realIndex : void 0
                                })
                            }
                            if (n) {
                                let e = s * i.params.grid.rows;
                                s = i.slides.find(t => +t.getAttribute("data-swiper-slide-index") === e).column
                            } else s = i.getSlideIndexByData(s)
                        }
                    return requestAnimationFrame(() => {
                        i.slideTo(s, t, r, a)
                    }), i
                },
                slideNext: function(e, t = !0, r) {
                    let a = this,
                        {
                            enabled: i,
                            params: n,
                            animating: s
                        } = a;
                    if (!i || a.destroyed) return a;
                    void 0 === e && (e = a.params.speed);
                    let o = n.slidesPerGroup;
                    "auto" === n.slidesPerView && 1 === n.slidesPerGroup && n.slidesPerGroupAuto && (o = Math.max(a.slidesPerViewDynamic("current", !0), 1));
                    let l = a.activeIndex < n.slidesPerGroupSkip ? 1 : o,
                        c = a.virtual && n.virtual.enabled;
                    if (n.loop) {
                        if (s && !c && n.loopPreventsSliding) return !1;
                        if (a.loopFix({
                                direction: "next"
                            }), a._clientLeft = a.wrapperEl.clientLeft, a.activeIndex === a.slides.length - 1 && n.cssMode) return requestAnimationFrame(() => {
                            a.slideTo(a.activeIndex + l, e, t, r)
                        }), !0
                    }
                    return n.rewind && a.isEnd ? a.slideTo(0, e, t, r) : a.slideTo(a.activeIndex + l, e, t, r)
                },
                slidePrev: function(e, t = !0, r) {
                    let a = this,
                        {
                            params: i,
                            snapGrid: n,
                            slidesGrid: s,
                            rtlTranslate: o,
                            enabled: l,
                            animating: c
                        } = a;
                    if (!l || a.destroyed) return a;
                    void 0 === e && (e = a.params.speed);
                    let d = a.virtual && i.virtual.enabled;
                    if (i.loop) {
                        if (c && !d && i.loopPreventsSliding) return !1;
                        a.loopFix({
                            direction: "prev"
                        }), a._clientLeft = a.wrapperEl.clientLeft
                    }

                    function u(e) {
                        return e < 0 ? -Math.floor(Math.abs(e)) : Math.floor(e)
                    }
                    let m = u(o ? a.translate : -a.translate),
                        p = n.map(e => u(e)),
                        h = i.freeMode && i.freeMode.enabled,
                        f = n[p.indexOf(m) - 1];
                    if (void 0 === f && (i.cssMode || h)) {
                        let e;
                        n.forEach((t, r) => {
                            m >= t && (e = r)
                        }), void 0 !== e && (f = h ? n[e] : n[e > 0 ? e - 1 : e])
                    }
                    let x = 0;
                    if (void 0 !== f && ((x = s.indexOf(f)) < 0 && (x = a.activeIndex - 1), "auto" === i.slidesPerView && 1 === i.slidesPerGroup && i.slidesPerGroupAuto && (x = Math.max(x = x - a.slidesPerViewDynamic("previous", !0) + 1, 0))), i.rewind && a.isBeginning) {
                        let i = a.params.virtual && a.params.virtual.enabled && a.virtual ? a.virtual.slides.length - 1 : a.slides.length - 1;
                        return a.slideTo(i, e, t, r)
                    }
                    return i.loop && 0 === a.activeIndex && i.cssMode ? (requestAnimationFrame(() => {
                        a.slideTo(x, e, t, r)
                    }), !0) : a.slideTo(x, e, t, r)
                },
                slideReset: function(e, t = !0, r) {
                    if (!this.destroyed) return void 0 === e && (e = this.params.speed), this.slideTo(this.activeIndex, e, t, r)
                },
                slideToClosest: function(e, t = !0, r, a = .5) {
                    if (this.destroyed) return;
                    void 0 === e && (e = this.params.speed);
                    let i = this.activeIndex,
                        n = Math.min(this.params.slidesPerGroupSkip, i),
                        s = n + Math.floor((i - n) / this.params.slidesPerGroup),
                        o = this.rtlTranslate ? this.translate : -this.translate;
                    if (o >= this.snapGrid[s]) {
                        let e = this.snapGrid[s];
                        o - e > (this.snapGrid[s + 1] - e) * a && (i += this.params.slidesPerGroup)
                    } else {
                        let e = this.snapGrid[s - 1];
                        o - e <= (this.snapGrid[s] - e) * a && (i -= this.params.slidesPerGroup)
                    }
                    return i = Math.min(i = Math.max(i, 0), this.slidesGrid.length - 1), this.slideTo(i, e, t, r)
                },
                slideToClickedSlide: function() {
                    let e, t = this;
                    if (t.destroyed) return;
                    let {
                        params: r,
                        slidesEl: a
                    } = t, i = "auto" === r.slidesPerView ? t.slidesPerViewDynamic() : r.slidesPerView, n = t.getSlideIndexWhenGrid(t.clickedIndex), s = t.isElement ? "swiper-slide" : `.${r.slideClass}`, o = t.grid && t.params.grid && t.params.grid.rows > 1;
                    if (r.loop) {
                        if (t.animating) return;
                        e = parseInt(t.clickedSlide.getAttribute("data-swiper-slide-index"), 10), r.centeredSlides ? t.slideToLoop(e) : n > (o ? (t.slides.length - i) / 2 - (t.params.grid.rows - 1) : t.slides.length - i) ? (t.loopFix(), n = t.getSlideIndex(g(a, `${s}[data-swiper-slide-index="${e}"]`)[0]), u(() => {
                            t.slideTo(n)
                        })) : t.slideTo(n)
                    } else t.slideTo(n)
                }
            },
            loop: {
                loopCreate: function(e, t) {
                    let r, a = this,
                        {
                            params: i,
                            slidesEl: n
                        } = a;
                    if (!i.loop || a.virtual && a.params.virtual.enabled) return;
                    let s = a.grid && i.grid && i.grid.rows > 1;
                    i.loopAddBlankSlides && (i.slidesPerGroup > 1 || s) && ((r = g(n, `.${i.slideBlankClass}`)).forEach(e => {
                        e.remove()
                    }), r.length > 0 && (a.recalcSlides(), a.updateSlides()));
                    let o = i.slidesPerGroup * (s ? i.grid.rows : 1),
                        l = a.slides.length % o != 0,
                        c = s && a.slides.length % i.grid.rows != 0,
                        d = e => {
                            for (let t = 0; t < e; t += 1) {
                                let e = a.isElement ? y("swiper-slide", [i.slideBlankClass]) : y("div", [i.slideClass, i.slideBlankClass]);
                                a.slidesEl.append(e)
                            }
                        };
                    l ? i.loopAddBlankSlides ? (d(o - a.slides.length % o), a.recalcSlides(), a.updateSlides()) : v("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)") : c && (i.loopAddBlankSlides ? (d(i.grid.rows - a.slides.length % i.grid.rows), a.recalcSlides(), a.updateSlides()) : v("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)")), g(n, `.${i.slideClass}, swiper-slide`).forEach((e, t) => {
                        e.setAttribute("data-swiper-slide-index", t)
                    });
                    let u = i.centeredSlides || !!i.slidesOffsetBefore || !!i.slidesOffsetAfter;
                    a.loopFix({
                        slideRealIndex: e,
                        direction: u ? void 0 : "next",
                        initial: t
                    })
                },
                loopFix: function({
                    slideRealIndex: e,
                    slideTo: t = !0,
                    direction: r,
                    setTranslate: a,
                    activeSlideIndex: i,
                    initial: n,
                    byController: s,
                    byMousewheel: o
                } = {}) {
                    let l = this;
                    if (!l.params.loop) return;
                    l.emit("beforeLoopFix");
                    let {
                        slides: c,
                        allowSlidePrev: d,
                        allowSlideNext: u,
                        slidesEl: m,
                        params: p
                    } = l, {
                        centeredSlides: h,
                        slidesOffsetBefore: f,
                        slidesOffsetAfter: x,
                        initialSlide: g
                    } = p, y = h || !!f || !!x;
                    if (l.allowSlidePrev = !0, l.allowSlideNext = !0, l.virtual && p.virtual.enabled) {
                        t && (y || 0 !== l.snapIndex ? y && l.snapIndex < p.slidesPerView ? l.slideTo(l.virtual.slides.length + l.snapIndex, 0, !1, !0) : l.snapIndex === l.snapGrid.length - 1 && l.slideTo(l.virtual.slidesBefore, 0, !1, !0) : l.slideTo(l.virtual.slides.length, 0, !1, !0)), l.allowSlidePrev = d, l.allowSlideNext = u, l.emit("loopFix");
                        return
                    }
                    let b = p.slidesPerView;
                    "auto" === b ? b = l.slidesPerViewDynamic() : (b = Math.ceil(parseFloat(p.slidesPerView, 10)), y && b % 2 == 0 && (b += 1));
                    let k = p.slidesPerGroupAuto ? b : p.slidesPerGroup,
                        w = y ? Math.max(k, Math.ceil(b / 2)) : k;
                    w % k != 0 && (w += k - w % k), l.loopedSlides = w += p.loopAdditionalSlides;
                    let S = l.grid && p.grid && p.grid.rows > 1;
                    c.length < b + w || "cards" === l.params.effect && c.length < b + 2 * w ? v("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters") : S && "row" === p.grid.fill && v("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");
                    let j = [],
                        C = [],
                        _ = S ? Math.ceil(c.length / p.grid.rows) : c.length,
                        T = n && _ - g < b && !y,
                        M = T ? g : l.activeIndex;
                    void 0 === i ? i = l.getSlideIndex(c.find(e => e.classList.contains(p.slideActiveClass))) : M = i;
                    let N = "next" === r || !r,
                        I = "prev" === r || !r,
                        P = 0,
                        E = 0,
                        A = (S ? c[i].column : i) + (y && void 0 === a ? -b / 2 + .5 : 0);
                    if (A < w) {
                        P = Math.max(w - A, k);
                        for (let e = 0; e < w - A; e += 1) {
                            let t = e - Math.floor(e / _) * _;
                            if (S) {
                                let e = _ - t - 1;
                                for (let t = c.length - 1; t >= 0; t -= 1) c[t].column === e && j.push(t)
                            } else j.push(_ - t - 1)
                        }
                    } else if (A + b > _ - w) {
                        E = Math.max(A - (_ - 2 * w), k), T && (E = Math.max(E, b - _ + g + 1));
                        for (let e = 0; e < E; e += 1) {
                            let t = e - Math.floor(e / _) * _;
                            S ? c.forEach((e, r) => {
                                e.column === t && C.push(r)
                            }) : C.push(t)
                        }
                    }
                    if (l.__preventObserver__ = !0, requestAnimationFrame(() => {
                            l.__preventObserver__ = !1
                        }), "cards" === l.params.effect && c.length < b + 2 * w && (C.includes(i) && C.splice(C.indexOf(i), 1), j.includes(i) && j.splice(j.indexOf(i), 1)), I && j.forEach(e => {
                            c[e].swiperLoopMoveDOM = !0, m.prepend(c[e]), c[e].swiperLoopMoveDOM = !1
                        }), N && C.forEach(e => {
                            c[e].swiperLoopMoveDOM = !0, m.append(c[e]), c[e].swiperLoopMoveDOM = !1
                        }), l.recalcSlides(), "auto" === p.slidesPerView ? l.updateSlides() : S && (j.length > 0 && I || C.length > 0 && N) && l.slides.forEach((e, t) => {
                            l.grid.updateSlide(t, e, l.slides)
                        }), p.watchSlidesProgress && l.updateSlidesOffset(), t) {
                        if (j.length > 0 && I) {
                            if (void 0 === e) {
                                let e = l.slidesGrid[M],
                                    t = l.slidesGrid[M + P] - e;
                                o ? l.setTranslate(l.translate - t) : (l.slideTo(M + Math.ceil(P), 0, !1, !0), a && (l.touchEventsData.startTranslate = l.touchEventsData.startTranslate - t, l.touchEventsData.currentTranslate = l.touchEventsData.currentTranslate - t))
                            } else if (a) {
                                let e = S ? j.length / p.grid.rows : j.length;
                                l.slideTo(l.activeIndex + e, 0, !1, !0), l.touchEventsData.currentTranslate = l.translate
                            }
                        } else if (C.length > 0 && N)
                            if (void 0 === e) {
                                let e = l.slidesGrid[M],
                                    t = l.slidesGrid[M - E] - e;
                                o ? l.setTranslate(l.translate - t) : (l.slideTo(M - E, 0, !1, !0), a && (l.touchEventsData.startTranslate = l.touchEventsData.startTranslate - t, l.touchEventsData.currentTranslate = l.touchEventsData.currentTranslate - t))
                            } else {
                                let e = S ? C.length / p.grid.rows : C.length;
                                l.slideTo(l.activeIndex - e, 0, !1, !0)
                            }
                    }
                    if (l.allowSlidePrev = d, l.allowSlideNext = u, l.controller && l.controller.control && !s) {
                        let n = {
                            slideRealIndex: e,
                            direction: r,
                            setTranslate: a,
                            activeSlideIndex: i,
                            byController: !0
                        };
                        Array.isArray(l.controller.control) ? l.controller.control.forEach(e => {
                            !e.destroyed && e.params.loop && e.loopFix({ ...n,
                                slideTo: e.params.slidesPerView === p.slidesPerView && t
                            })
                        }) : l.controller.control instanceof l.constructor && l.controller.control.params.loop && l.controller.control.loopFix({ ...n,
                            slideTo: l.controller.control.params.slidesPerView === p.slidesPerView && t
                        })
                    }
                    l.emit("loopFix")
                },
                loopDestroy: function() {
                    let {
                        params: e,
                        slidesEl: t
                    } = this;
                    if (!e.loop || !t || this.virtual && this.params.virtual.enabled) return;
                    this.recalcSlides();
                    let r = [];
                    this.slides.forEach(e => {
                        r[void 0 === e.swiperSlideIndex ? +e.getAttribute("data-swiper-slide-index") : e.swiperSlideIndex] = e
                    }), this.slides.forEach(e => {
                        e.removeAttribute("data-swiper-slide-index")
                    }), r.forEach(e => {
                        t.append(e)
                    }), this.recalcSlides(), this.slideTo(this.realIndex, 0)
                }
            },
            grabCursor: {
                setGrabCursor: function(e) {
                    let t = this;
                    if (!t.params.simulateTouch || t.params.watchOverflow && t.isLocked || t.params.cssMode) return;
                    let r = "container" === t.params.touchEventsTarget ? t.el : t.wrapperEl;
                    t.isElement && (t.__preventObserver__ = !0), r.style.cursor = "move", r.style.cursor = e ? "grabbing" : "grab", t.isElement && requestAnimationFrame(() => {
                        t.__preventObserver__ = !1
                    })
                },
                unsetGrabCursor: function() {
                    let e = this;
                    e.params.watchOverflow && e.isLocked || e.params.cssMode || (e.isElement && (e.__preventObserver__ = !0), e["container" === e.params.touchEventsTarget ? "el" : "wrapperEl"].style.cursor = "", e.isElement && requestAnimationFrame(() => {
                        e.__preventObserver__ = !1
                    }))
                }
            },
            events: {
                attachEvents: function() {
                    let {
                        params: e
                    } = this;
                    this.onTouchStart = O.bind(this), this.onTouchMove = D.bind(this), this.onTouchEnd = L.bind(this), this.onDocumentTouchStart = B.bind(this), e.cssMode && (this.onScroll = F.bind(this)), this.onClick = R.bind(this), this.onLoad = $.bind(this), q(this, "on")
                },
                detachEvents: function() {
                    q(this, "off")
                }
            },
            breakpoints: {
                setBreakpoint: function() {
                    let e = this,
                        {
                            realIndex: t,
                            initialized: r,
                            params: a,
                            el: i
                        } = e,
                        n = a.breakpoints;
                    if (!n || n && 0 === Object.keys(n).length) return;
                    let s = l(),
                        o = "window" !== a.breakpointsBase && a.breakpointsBase ? "container" : a.breakpointsBase,
                        c = ["window", "container"].includes(a.breakpointsBase) || !a.breakpointsBase ? e.el : s.querySelector(a.breakpointsBase),
                        d = e.getBreakpoint(n, o, c);
                    if (!d || e.currentBreakpoint === d) return;
                    let u = (d in n ? n[d] : void 0) || e.originalParams,
                        m = V(e, a),
                        p = V(e, u),
                        f = e.params.grabCursor,
                        x = u.grabCursor,
                        g = a.enabled;
                    m && !p ? (i.classList.remove(`${a.containerModifierClass}grid`, `${a.containerModifierClass}grid-column`), e.emitContainerClasses()) : !m && p && (i.classList.add(`${a.containerModifierClass}grid`), (u.grid.fill && "column" === u.grid.fill || !u.grid.fill && "column" === a.grid.fill) && i.classList.add(`${a.containerModifierClass}grid-column`), e.emitContainerClasses()), f && !x ? e.unsetGrabCursor() : !f && x && e.setGrabCursor(), ["navigation", "pagination", "scrollbar"].forEach(t => {
                        if (void 0 === u[t]) return;
                        let r = a[t] && a[t].enabled,
                            i = u[t] && u[t].enabled;
                        r && !i && e[t].disable(), !r && i && e[t].enable()
                    });
                    let v = u.direction && u.direction !== a.direction,
                        y = a.loop && (u.slidesPerView !== a.slidesPerView || v),
                        b = a.loop;
                    v && r && e.changeDirection(), h(e.params, u);
                    let k = e.params.enabled,
                        w = e.params.loop;
                    Object.assign(e, {
                        allowTouchMove: e.params.allowTouchMove,
                        allowSlideNext: e.params.allowSlideNext,
                        allowSlidePrev: e.params.allowSlidePrev
                    }), g && !k ? e.disable() : !g && k && e.enable(), e.currentBreakpoint = d, e.emit("_beforeBreakpoint", u), r && (y ? (e.loopDestroy(), e.loopCreate(t), e.updateSlides()) : !b && w ? (e.loopCreate(t), e.updateSlides()) : b && !w && e.loopDestroy()), e.emit("breakpoint", u)
                },
                getBreakpoint: function(e, t = "window", r) {
                    if (!e || "container" === t && !r) return;
                    let a = !1,
                        i = d(),
                        n = "window" === t ? i.innerHeight : r.clientHeight,
                        s = Object.keys(e).map(e => "string" == typeof e && 0 === e.indexOf("@") ? {
                            value: n * parseFloat(e.substr(1)),
                            point: e
                        } : {
                            value: e,
                            point: e
                        });
                    s.sort((e, t) => parseInt(e.value, 10) - parseInt(t.value, 10));
                    for (let e = 0; e < s.length; e += 1) {
                        let {
                            point: n,
                            value: o
                        } = s[e];
                        "window" === t ? i.matchMedia(`(min-width: ${o}px)`).matches && (a = n) : o <= r.clientWidth && (a = n)
                    }
                    return a || "max"
                }
            },
            checkOverflow: {
                checkOverflow: function() {
                    let {
                        isLocked: e,
                        params: t
                    } = this, {
                        slidesOffsetBefore: r
                    } = t;
                    if (r) {
                        let e = this.slides.length - 1,
                            t = this.slidesGrid[e] + this.slidesSizesGrid[e] + 2 * r;
                        this.isLocked = this.size > t
                    } else this.isLocked = 1 === this.snapGrid.length;
                    !0 === t.allowSlideNext && (this.allowSlideNext = !this.isLocked), !0 === t.allowSlidePrev && (this.allowSlidePrev = !this.isLocked), e && e !== this.isLocked && (this.isEnd = !1), e !== this.isLocked && this.emit(this.isLocked ? "lock" : "unlock")
                }
            },
            classes: {
                addClasses: function() {
                    var e, t;
                    let r, {
                            classNames: a,
                            params: i,
                            rtl: n,
                            el: s,
                            device: o
                        } = this,
                        l = (e = ["initialized", i.direction, {
                            "free-mode": this.params.freeMode && i.freeMode.enabled
                        }, {
                            autoheight: i.autoHeight
                        }, {
                            rtl: n
                        }, {
                            grid: i.grid && i.grid.rows > 1
                        }, {
                            "grid-column": i.grid && i.grid.rows > 1 && "column" === i.grid.fill
                        }, {
                            android: o.android
                        }, {
                            ios: o.ios
                        }, {
                            "css-mode": i.cssMode
                        }, {
                            centered: i.cssMode && i.centeredSlides
                        }, {
                            "watch-progress": i.watchSlidesProgress
                        }], t = i.containerModifierClass, r = [], e.forEach(e => {
                            "object" == typeof e ? Object.keys(e).forEach(a => {
                                e[a] && r.push(t + a)
                            }) : "string" == typeof e && r.push(t + e)
                        }), r);
                    a.push(...l), s.classList.add(...a), this.emitContainerClasses()
                },
                removeClasses: function() {
                    let {
                        el: e,
                        classNames: t
                    } = this;
                    e && "string" != typeof e && (e.classList.remove(...t), this.emitContainerClasses())
                }
            }
        },
        W = {};
    class G {
        constructor(...e) {
            let t, r;
            1 === e.length && e[0].constructor && "Object" === Object.prototype.toString.call(e[0]).slice(8, -1) ? r = e[0] : [t, r] = e, r || (r = {}), r = h({}, r), t && !r.el && (r.el = t);
            const a = l();
            if (r.el && "string" == typeof r.el && a.querySelectorAll(r.el).length > 1) {
                const e = [];
                return a.querySelectorAll(r.el).forEach(t => {
                    let a = h({}, r, {
                        el: t
                    });
                    e.push(new G(a))
                }), e
            }
            const i = this;
            i.__swiper__ = !0, i.support = j(), i.device = C({
                userAgent: r.userAgent
            }), i.browser = _(), i.eventsListeners = {}, i.eventsAnyListeners = [], i.modules = [...i.__modules__], r.modules && Array.isArray(r.modules) && r.modules.forEach(e => {
                "function" == typeof e && 0 > i.modules.indexOf(e) && i.modules.push(e)
            });
            const n = {};
            i.modules.forEach(e => {
                var t;
                e({
                    params: r,
                    swiper: i,
                    extendParams: (t = r, function(e = {}) {
                        let r = Object.keys(e)[0],
                            a = e[r];
                        "object" != typeof a || null === a || (!0 === t[r] && (t[r] = {
                            enabled: !0
                        }), "navigation" === r && t[r] && t[r].enabled && !t[r].prevEl && !t[r].nextEl && (t[r].auto = !0), ["pagination", "scrollbar"].indexOf(r) >= 0 && t[r] && t[r].enabled && !t[r].el && (t[r].auto = !0), r in t && "enabled" in a && ("object" != typeof t[r] || "enabled" in t[r] || (t[r].enabled = !0), t[r] || (t[r] = {
                            enabled: !1
                        }))), h(n, e)
                    }),
                    on: i.on.bind(i),
                    once: i.once.bind(i),
                    off: i.off.bind(i),
                    emit: i.emit.bind(i)
                })
            });
            const s = h({}, H, n);
            return i.params = h({}, s, W, r), i.originalParams = h({}, i.params), i.passedParams = h({}, r), i.params && i.params.on && Object.keys(i.params.on).forEach(e => {
                i.on(e, i.params.on[e])
            }), i.params && i.params.onAny && i.onAny(i.params.onAny), Object.assign(i, {
                enabled: i.params.enabled,
                el: t,
                classNames: [],
                slides: [],
                slidesGrid: [],
                snapGrid: [],
                slidesSizesGrid: [],
                isHorizontal: () => "horizontal" === i.params.direction,
                isVertical: () => "vertical" === i.params.direction,
                activeIndex: 0,
                realIndex: 0,
                isBeginning: !0,
                isEnd: !1,
                translate: 0,
                previousTranslate: 0,
                progress: 0,
                velocity: 0,
                animating: !1,
                cssOverflowAdjustment() {
                    return 8388608 * Math.trunc(this.translate / 8388608)
                },
                allowSlideNext: i.params.allowSlideNext,
                allowSlidePrev: i.params.allowSlidePrev,
                touchEventsData: {
                    isTouched: void 0,
                    isMoved: void 0,
                    allowTouchCallbacks: void 0,
                    touchStartTime: void 0,
                    isScrolling: void 0,
                    currentTranslate: void 0,
                    startTranslate: void 0,
                    allowThresholdMove: void 0,
                    focusableElements: i.params.focusableElements,
                    lastClickTime: 0,
                    clickTimeout: void 0,
                    velocities: [],
                    allowMomentumBounce: void 0,
                    startMoving: void 0,
                    pointerId: null,
                    touchId: null
                },
                allowClick: !0,
                allowTouchMove: i.params.allowTouchMove,
                touches: {
                    startX: 0,
                    startY: 0,
                    currentX: 0,
                    currentY: 0,
                    diff: 0
                },
                imagesToLoad: [],
                imagesLoaded: 0
            }), i.emit("_swiper"), i.params.init && i.init(), i
        }
        getDirectionLabel(e) {
            return this.isHorizontal() ? e : ({
                width: "height",
                "margin-top": "margin-left",
                "margin-bottom ": "margin-right",
                "margin-left": "margin-top",
                "margin-right": "margin-bottom",
                "padding-left": "padding-top",
                "padding-right": "padding-bottom",
                marginRight: "marginBottom"
            })[e]
        }
        getSlideIndex(e) {
            let {
                slidesEl: t,
                params: r
            } = this, a = k(g(t, `.${r.slideClass}, swiper-slide`)[0]);
            return k(e) - a
        }
        getSlideIndexByData(e) {
            return this.getSlideIndex(this.slides.find(t => +t.getAttribute("data-swiper-slide-index") === e))
        }
        getSlideIndexWhenGrid(e) {
            return this.grid && this.params.grid && this.params.grid.rows > 1 && ("column" === this.params.grid.fill ? e = Math.floor(e / this.params.grid.rows) : "row" === this.params.grid.fill && (e %= Math.ceil(this.slides.length / this.params.grid.rows))), e
        }
        recalcSlides() {
            let {
                slidesEl: e,
                params: t
            } = this;
            this.slides = g(e, `.${t.slideClass}, swiper-slide`)
        }
        enable() {
            this.enabled || (this.enabled = !0, this.params.grabCursor && this.setGrabCursor(), this.emit("enable"))
        }
        disable() {
            this.enabled && (this.enabled = !1, this.params.grabCursor && this.unsetGrabCursor(), this.emit("disable"))
        }
        setProgress(e, t) {
            e = Math.min(Math.max(e, 0), 1);
            let r = this.minTranslate(),
                a = (this.maxTranslate() - r) * e + r;
            this.translateTo(a, void 0 === t ? 0 : t), this.updateActiveIndex(), this.updateSlidesClasses()
        }
        emitContainerClasses() {
            let e = this;
            if (!e.params._emitClasses || !e.el) return;
            let t = e.el.className.split(" ").filter(t => 0 === t.indexOf("swiper") || 0 === t.indexOf(e.params.containerModifierClass));
            e.emit("_containerClasses", t.join(" "))
        }
        getSlideClasses(e) {
            let t = this;
            return t.destroyed ? "" : e.className.split(" ").filter(e => 0 === e.indexOf("swiper-slide") || 0 === e.indexOf(t.params.slideClass)).join(" ")
        }
        emitSlidesClasses() {
            let e = this;
            if (!e.params._emitClasses || !e.el) return;
            let t = [];
            e.slides.forEach(r => {
                let a = e.getSlideClasses(r);
                t.push({
                    slideEl: r,
                    classNames: a
                }), e.emit("_slideClass", r, a)
            }), e.emit("_slideClasses", t)
        }
        slidesPerViewDynamic(e = "current", t = !1) {
            let {
                params: r,
                slides: a,
                slidesGrid: i,
                slidesSizesGrid: n,
                size: s,
                activeIndex: o
            } = this, l = 1;
            if ("number" == typeof r.slidesPerView) return r.slidesPerView;
            if (r.centeredSlides) {
                let e, t = a[o] ? Math.ceil(a[o].swiperSlideSize) : 0;
                for (let r = o + 1; r < a.length; r += 1) a[r] && !e && (t += Math.ceil(a[r].swiperSlideSize), l += 1, t > s && (e = !0));
                for (let r = o - 1; r >= 0; r -= 1) a[r] && !e && (t += a[r].swiperSlideSize, l += 1, t > s && (e = !0))
            } else if ("current" === e)
                for (let e = o + 1; e < a.length; e += 1)(t ? i[e] + n[e] - i[o] < s : i[e] - i[o] < s) && (l += 1);
            else
                for (let e = o - 1; e >= 0; e -= 1) i[o] - i[e] < s && (l += 1);
            return l
        }
        update() {
            let e, t = this;
            if (!t || t.destroyed) return;
            let {
                snapGrid: r,
                params: a
            } = t;

            function i() {
                let e = Math.min(Math.max(t.rtlTranslate ? -1 * t.translate : t.translate, t.maxTranslate()), t.minTranslate());
                t.setTranslate(e), t.updateActiveIndex(), t.updateSlidesClasses()
            }
            if (a.breakpoints && t.setBreakpoint(), [...t.el.querySelectorAll('[loading="lazy"]')].forEach(e => {
                    e.complete && N(t, e)
                }), t.updateSize(), t.updateSlides(), t.updateProgress(), t.updateSlidesClasses(), a.freeMode && a.freeMode.enabled && !a.cssMode) i(), a.autoHeight && t.updateAutoHeight();
            else {
                if (("auto" === a.slidesPerView || a.slidesPerView > 1) && t.isEnd && !a.centeredSlides) {
                    let r = t.virtual && a.virtual.enabled ? t.virtual.slides : t.slides;
                    e = t.slideTo(r.length - 1, 0, !1, !0)
                } else e = t.slideTo(t.activeIndex, 0, !1, !0);
                e || i()
            }
            a.watchOverflow && r !== t.snapGrid && t.checkOverflow(), t.emit("update")
        }
        changeDirection(e, t = !0) {
            let r = this.params.direction;
            return e || (e = "horizontal" === r ? "vertical" : "horizontal"), e === r || "horizontal" !== e && "vertical" !== e || (this.el.classList.remove(`${this.params.containerModifierClass}${r}`), this.el.classList.add(`${this.params.containerModifierClass}${e}`), this.emitContainerClasses(), this.params.direction = e, this.slides.forEach(t => {
                "vertical" === e ? t.style.width = "" : t.style.height = ""
            }), this.emit("changeDirection"), t && this.update()), this
        }
        changeLanguageDirection(e) {
            (!this.rtl || "rtl" !== e) && (this.rtl || "ltr" !== e) && (this.rtl = "rtl" === e, this.rtlTranslate = "horizontal" === this.params.direction && this.rtl, this.rtl ? (this.el.classList.add(`${this.params.containerModifierClass}rtl`), this.el.dir = "rtl") : (this.el.classList.remove(`${this.params.containerModifierClass}rtl`), this.el.dir = "ltr"), this.update())
        }
        mount(e) {
            let t = this;
            if (t.mounted) return !0;
            let r = e || t.params.el;
            if ("string" == typeof r && (r = document.querySelector(r)), !r) return !1;
            r.swiper = t, r.parentNode && r.parentNode.host && r.parentNode.host.nodeName === t.params.swiperElementNodeName.toUpperCase() && (t.isElement = !0);
            let a = () => `.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`,
                i = r && r.shadowRoot && r.shadowRoot.querySelector ? r.shadowRoot.querySelector(a()) : g(r, a())[0];
            return !i && t.params.createElements && (i = y("div", t.params.wrapperClass), r.append(i), g(r, `.${t.params.slideClass}`).forEach(e => {
                i.append(e)
            })), Object.assign(t, {
                el: r,
                wrapperEl: i,
                slidesEl: t.isElement && !r.parentNode.host.slideSlots ? r.parentNode.host : i,
                hostEl: t.isElement ? r.parentNode.host : r,
                mounted: !0,
                rtl: "rtl" === r.dir.toLowerCase() || "rtl" === b(r, "direction"),
                rtlTranslate: "horizontal" === t.params.direction && ("rtl" === r.dir.toLowerCase() || "rtl" === b(r, "direction")),
                wrongRTL: "-webkit-box" === b(i, "display")
            }), !0
        }
        init(e) {
            let t = this;
            if (t.initialized || !1 === t.mount(e)) return t;
            t.emit("beforeInit"), t.params.breakpoints && t.setBreakpoint(), t.addClasses(), t.updateSize(), t.updateSlides(), t.params.watchOverflow && t.checkOverflow(), t.params.grabCursor && t.enabled && t.setGrabCursor(), t.params.loop && t.virtual && t.params.virtual.enabled ? t.slideTo(t.params.initialSlide + t.virtual.slidesBefore, 0, t.params.runCallbacksOnInit, !1, !0) : t.slideTo(t.params.initialSlide, 0, t.params.runCallbacksOnInit, !1, !0), t.params.loop && t.loopCreate(void 0, !0), t.attachEvents();
            let r = [...t.el.querySelectorAll('[loading="lazy"]')];
            return t.isElement && r.push(...t.hostEl.querySelectorAll('[loading="lazy"]')), r.forEach(e => {
                e.complete ? N(t, e) : e.addEventListener("load", e => {
                    N(t, e.target)
                })
            }), P(t), t.initialized = !0, P(t), t.emit("init"), t.emit("afterInit"), t
        }
        destroy(e = !0, t = !0) {
            let r = this,
                {
                    params: a,
                    el: i,
                    wrapperEl: n,
                    slides: s
                } = r;
            if (void 0 === r.params || r.destroyed) return null;
            (r.emit("beforeDestroy"), r.initialized = !1, r.detachEvents(), a.loop && r.loopDestroy(), t && (r.removeClasses(), i && "string" != typeof i && i.removeAttribute("style"), n && n.removeAttribute("style"), s && s.length && s.forEach(e => {
                e.classList.remove(a.slideVisibleClass, a.slideFullyVisibleClass, a.slideActiveClass, a.slideNextClass, a.slidePrevClass), e.removeAttribute("style"), e.removeAttribute("data-swiper-slide-index")
            })), r.emit("destroy"), Object.keys(r.eventsListeners).forEach(e => {
                r.off(e)
            }), !1 !== e) && (r.el && "string" != typeof r.el && (r.el.swiper = null), Object.keys(r).forEach(e => {
                try {
                    r[e] = null
                } catch (e) {}
                try {
                    delete r[e]
                } catch (e) {}
            }));
            return r.destroyed = !0, null
        }
        static extendDefaults(e) {
            h(W, e)
        }
        static get extendedDefaults() {
            return W
        }
        static get defaults() {
            return H
        }
        static installModule(e) {
            G.prototype.__modules__ || (G.prototype.__modules__ = []);
            let t = G.prototype.__modules__;
            "function" == typeof e && 0 > t.indexOf(e) && t.push(e)
        }
        static use(e) {
            return Array.isArray(e) ? e.forEach(e => G.installModule(e)) : G.installModule(e), G
        }
    }
    Object.keys(U).forEach(e => {
        Object.keys(U[e]).forEach(t => {
            G.prototype[t] = U[e][t]
        })
    }), G.use([function({
        swiper: e,
        on: t,
        emit: r
    }) {
        let a = d(),
            i = null,
            n = null,
            s = () => {
                e && !e.destroyed && e.initialized && (r("beforeResize"), r("resize"))
            },
            o = () => {
                e && !e.destroyed && e.initialized && r("orientationchange")
            };
        t("init", () => {
            e.params.resizeObserver && void 0 !== a.ResizeObserver ? e && !e.destroyed && e.initialized && (i = new ResizeObserver(t => {
                n = a.requestAnimationFrame(() => {
                    let {
                        width: r,
                        height: a
                    } = e, i = r, n = a;
                    t.forEach(({
                        contentBoxSize: t,
                        contentRect: r,
                        target: a
                    }) => {
                        a && a !== e.el || (i = r ? r.width : (t[0] || t).inlineSize, n = r ? r.height : (t[0] || t).blockSize)
                    }), (i !== r || n !== a) && s()
                })
            })).observe(e.el) : (a.addEventListener("resize", s), a.addEventListener("orientationchange", o))
        }), t("destroy", () => {
            n && a.cancelAnimationFrame(n), i && i.unobserve && e.el && (i.unobserve(e.el), i = null), a.removeEventListener("resize", s), a.removeEventListener("orientationchange", o)
        })
    }, function({
        swiper: e,
        extendParams: t,
        on: r,
        emit: a
    }) {
        let i = [],
            n = d(),
            s = (t, r = {}) => {
                let s = new(n.MutationObserver || n.WebkitMutationObserver)(t => {
                    if (e.__preventObserver__) return;
                    if (1 === t.length) return void a("observerUpdate", t[0]);
                    let r = function() {
                        a("observerUpdate", t[0])
                    };
                    n.requestAnimationFrame ? n.requestAnimationFrame(r) : n.setTimeout(r, 0)
                });
                s.observe(t, {
                    attributes: void 0 === r.attributes || r.attributes,
                    childList: e.isElement || (void 0 === r.childList || r).childList,
                    characterData: void 0 === r.characterData || r.characterData
                }), i.push(s)
            };
        t({
            observer: !1,
            observeParents: !1,
            observeSlideChildren: !1
        }), r("init", () => {
            if (e.params.observer) {
                if (e.params.observeParents) {
                    let t = function(e) {
                        let t = [],
                            r = e.parentElement;
                        for (; r;) t.push(r), r = r.parentElement;
                        return t
                    }(e.hostEl);
                    for (let e = 0; e < t.length; e += 1) s(t[e])
                }
                s(e.hostEl, {
                    childList: e.params.observeSlideChildren
                }), s(e.wrapperEl, {
                    attributes: !1
                })
            }
        }), r("destroy", () => {
            i.forEach(e => {
                e.disconnect()
            }), i.splice(0, i.length)
        })
    }]);
    let Z = ["eventsPrefix", "injectStyles", "injectStylesUrls", "modules", "init", "_direction", "oneWayMovement", "swiperElementNodeName", "touchEventsTarget", "initialSlide", "_speed", "cssMode", "updateOnWindowResize", "resizeObserver", "nested", "focusableElements", "_enabled", "_width", "_height", "preventInteractionOnTransition", "userAgent", "url", "_edgeSwipeDetection", "_edgeSwipeThreshold", "_freeMode", "_autoHeight", "setWrapperSize", "virtualTranslate", "_effect", "breakpoints", "breakpointsBase", "_spaceBetween", "_slidesPerView", "maxBackfaceHiddenSlides", "_grid", "_slidesPerGroup", "_slidesPerGroupSkip", "_slidesPerGroupAuto", "_centeredSlides", "_centeredSlidesBounds", "_slidesOffsetBefore", "_slidesOffsetAfter", "normalizeSlideIndex", "_centerInsufficientSlides", "_snapToSlideEdge", "_watchOverflow", "roundLengths", "touchRatio", "touchAngle", "simulateTouch", "_shortSwipes", "_longSwipes", "longSwipesRatio", "longSwipesMs", "_followFinger", "allowTouchMove", "_threshold", "touchMoveStopPropagation", "touchStartPreventDefault", "touchStartForcePreventDefault", "touchReleaseOnEdges", "uniqueNavElements", "_resistance", "_resistanceRatio", "_watchSlidesProgress", "_grabCursor", "preventClicks", "preventClicksPropagation", "_slideToClickedSlide", "_loop", "loopAdditionalSlides", "loopAddBlankSlides", "loopPreventsSliding", "_rewind", "_allowSlidePrev", "_allowSlideNext", "_swipeHandler", "_noSwiping", "noSwipingClass", "noSwipingSelector", "passiveListeners", "containerModifierClass", "slideClass", "slideActiveClass", "slideVisibleClass", "slideFullyVisibleClass", "slideNextClass", "slidePrevClass", "slideBlankClass", "wrapperClass", "lazyPreloaderClass", "lazyPreloadPrevNext", "runCallbacksOnInit", "observer", "observeParents", "observeSlideChildren", "a11y", "_autoplay", "_controller", "coverflowEffect", "cubeEffect", "fadeEffect", "flipEffect", "creativeEffect", "cardsEffect", "hashNavigation", "history", "keyboard", "mousewheel", "_navigation", "_pagination", "parallax", "_scrollbar", "_thumbs", "virtual", "zoom", "control"];

    function K(e) {
        return "object" == typeof e && null !== e && e.constructor && "Object" === Object.prototype.toString.call(e).slice(8, -1) && !e.__swiper__
    }

    function Y(e, t) {
        let r = ["__proto__", "constructor", "prototype"];
        Object.keys(t).filter(e => 0 > r.indexOf(e)).forEach(r => {
            void 0 === e[r] ? e[r] = t[r] : K(t[r]) && K(e[r]) && Object.keys(t[r]).length > 0 ? t[r].__swiper__ ? e[r] = t[r] : Y(e[r], t[r]) : e[r] = t[r]
        })
    }

    function Q(e = {}) {
        return e.navigation && void 0 === e.navigation.nextEl && void 0 === e.navigation.prevEl
    }

    function X(e = {}) {
        return e.pagination && void 0 === e.pagination.el
    }

    function J(e = {}) {
        return e.scrollbar && void 0 === e.scrollbar.el
    }

    function ee(e = "") {
        let t = e.split(" ").map(e => e.trim()).filter(e => !!e),
            r = [];
        return t.forEach(e => {
            0 > r.indexOf(e) && r.push(e)
        }), r.join(" ")
    }

    function et() {
        return (et = Object.assign.bind()).apply(this, arguments)
    }

    function er(e) {
        return e.type && e.type.displayName && e.type.displayName.includes("SwiperSlide")
    }

    function ea(e, t) {
        return "u" < typeof window ? (0, i.useEffect)(e, t) : (0, i.useLayoutEffect)(e, t)
    }
    let ei = (0, i.createContext)(null),
        en = (0, i.createContext)(null),
        es = (0, i.forwardRef)(({
            className: e,
            tag: t = "div",
            wrapperTag: r = "div",
            children: a,
            onSwiper: n,
            ...s
        } = {}, o) => {
            let l, c, d = !1,
                [u, m] = (0, i.useState)("swiper"),
                [p, h] = (0, i.useState)(null),
                [f, x] = (0, i.useState)(!1),
                g = (0, i.useRef)(!1),
                v = (0, i.useRef)(null),
                y = (0, i.useRef)(null),
                b = (0, i.useRef)(null),
                k = (0, i.useRef)(null),
                w = (0, i.useRef)(null),
                j = (0, i.useRef)(null),
                C = (0, i.useRef)(null),
                _ = (0, i.useRef)(null),
                {
                    params: T,
                    passedParams: M,
                    rest: N,
                    events: I
                } = function(e = {}, t = !0) {
                    let r = {
                            on: {}
                        },
                        a = {},
                        i = {};
                    Y(r, H), r._emitClasses = !0, r.init = !1;
                    let n = {},
                        s = Z.map(e => e.replace(/_/, ""));
                    return Object.keys(Object.assign({}, e)).forEach(o => {
                        void 0 !== e[o] && (s.indexOf(o) >= 0 ? K(e[o]) ? (r[o] = {}, i[o] = {}, Y(r[o], e[o]), Y(i[o], e[o])) : (r[o] = e[o], i[o] = e[o]) : 0 === o.search(/on[A-Z]/) && "function" == typeof e[o] ? t ? a[`${o[2].toLowerCase()}${o.substr(3)}`] = e[o] : r.on[`${o[2].toLowerCase()}${o.substr(3)}`] = e[o] : n[o] = e[o])
                    }), ["navigation", "pagination", "scrollbar"].forEach(e => {
                        !0 === r[e] && (r[e] = {}), !1 === r[e] && delete r[e]
                    }), {
                        params: r,
                        passedParams: i,
                        rest: n,
                        events: a
                    }
                }(s),
                {
                    slides: P,
                    slots: E
                } = (l = [], c = {
                    "container-start": [],
                    "container-end": [],
                    "wrapper-start": [],
                    "wrapper-end": []
                }, i.default.Children.toArray(a).forEach(e => {
                    if (er(e)) l.push(e);
                    else if (e.props && e.props.slot && c[e.props.slot]) c[e.props.slot].push(e);
                    else if (e.props && e.props.children) {
                        let t = function e(t) {
                            let r = [];
                            return i.default.Children.toArray(t).forEach(t => {
                                er(t) ? r.push(t) : t.props && t.props.children && e(t.props.children).forEach(e => r.push(e))
                            }), r
                        }(e.props.children);
                        t.length > 0 ? t.forEach(e => l.push(e)) : c["container-end"].push(e)
                    } else c["container-end"].push(e)
                }), {
                    slides: l,
                    slots: c
                }),
                A = () => {
                    x(!f)
                };
            Object.assign(T.on, {
                _containerClasses(e, t) {
                    m(t)
                }
            });
            let O = () => {
                Object.assign(T.on, I), d = !0;
                let e = { ...T
                };
                if (delete e.wrapperClass, y.current = new G(e), y.current.virtual && y.current.params.virtual.enabled) {
                    y.current.virtual.slides = P;
                    let e = {
                        cache: !1,
                        slides: P,
                        renderExternal: h,
                        renderExternalUpdate: !1
                    };
                    Y(y.current.params.virtual, e), Y(y.current.originalParams.virtual, e)
                }
            };
            return v.current || O(), y.current && y.current.on("_beforeBreakpoint", A), (0, i.useEffect)(() => () => {
                y.current && y.current.off("_beforeBreakpoint", A)
            }), (0, i.useEffect)(() => {
                !g.current && y.current && (y.current.emitSlidesClasses(), g.current = !0)
            }), ea(() => {
                if (o && (o.current = v.current), v.current) return y.current.destroyed && O(), ! function({
                    el: e,
                    nextEl: t,
                    prevEl: r,
                    paginationEl: a,
                    scrollbarEl: i,
                    swiper: n
                }, s) {
                    Q(s) && t && r && (n.params.navigation.nextEl = t, n.originalParams.navigation.nextEl = t, n.params.navigation.prevEl = r, n.originalParams.navigation.prevEl = r), X(s) && a && (n.params.pagination.el = a, n.originalParams.pagination.el = a), J(s) && i && (n.params.scrollbar.el = i, n.originalParams.scrollbar.el = i), n.init(e)
                }({
                    el: v.current,
                    nextEl: w.current,
                    prevEl: j.current,
                    paginationEl: C.current,
                    scrollbarEl: _.current,
                    swiper: y.current
                }, T), n && !y.current.destroyed && n(y.current), () => {
                    y.current && !y.current.destroyed && y.current.destroy(!0, !1)
                }
            }, []), ea(() => {
                !d && I && y.current && Object.keys(I).forEach(e => {
                    y.current.on(e, I[e])
                });
                let e = function(e, t, r, a, i) {
                    let n = [];
                    if (!t) return n;
                    let s = e => {
                        0 > n.indexOf(e) && n.push(e)
                    };
                    if (r && a) {
                        let e = a.map(i),
                            t = r.map(i);
                        e.join("") !== t.join("") && s("children"), a.length !== r.length && s("children")
                    }
                    return Z.filter(e => "_" === e[0]).map(e => e.replace(/_/, "")).forEach(r => {
                        if (r in e && r in t)
                            if (K(e[r]) && K(t[r])) {
                                let a = Object.keys(e[r]),
                                    i = Object.keys(t[r]);
                                a.length !== i.length ? s(r) : (a.forEach(a => {
                                    e[r][a] !== t[r][a] && s(r)
                                }), i.forEach(a => {
                                    e[r][a] !== t[r][a] && s(r)
                                }))
                            } else e[r] !== t[r] && s(r)
                    }), n
                }(M, b.current, P, k.current, e => e.key);
                return b.current = M, k.current = P, e.length && y.current && !y.current.destroyed && function({
                    swiper: e,
                    slides: t,
                    passedParams: r,
                    changedParams: a,
                    nextEl: i,
                    prevEl: n,
                    scrollbarEl: s,
                    paginationEl: o
                }) {
                    let l, c, d, u, m, p, h, f, x = a.filter(e => "children" !== e && "direction" !== e && "wrapperClass" !== e),
                        {
                            params: g,
                            pagination: v,
                            navigation: y,
                            scrollbar: b,
                            virtual: k,
                            thumbs: w
                        } = e;
                    a.includes("thumbs") && r.thumbs && r.thumbs.swiper && !r.thumbs.swiper.destroyed && g.thumbs && (!g.thumbs.swiper || g.thumbs.swiper.destroyed) && (l = !0), a.includes("controller") && r.controller && r.controller.control && g.controller && !g.controller.control && (c = !0), a.includes("pagination") && r.pagination && (r.pagination.el || o) && (g.pagination || !1 === g.pagination) && v && !v.el && (d = !0), a.includes("scrollbar") && r.scrollbar && (r.scrollbar.el || s) && (g.scrollbar || !1 === g.scrollbar) && b && !b.el && (u = !0), a.includes("navigation") && r.navigation && (r.navigation.prevEl || n) && (r.navigation.nextEl || i) && (g.navigation || !1 === g.navigation) && y && !y.prevEl && !y.nextEl && (m = !0);
                    let j = t => {
                        e[t] && (e[t].destroy(), "navigation" === t ? (e.isElement && (e[t].prevEl.remove(), e[t].nextEl.remove()), g[t].prevEl = void 0, g[t].nextEl = void 0, e[t].prevEl = void 0, e[t].nextEl = void 0) : (e.isElement && e[t].el.remove(), g[t].el = void 0, e[t].el = void 0))
                    };
                    a.includes("loop") && e.isElement && (g.loop && !r.loop ? p = !0 : !g.loop && r.loop ? h = !0 : f = !0), x.forEach(e => {
                        if (K(g[e]) && K(r[e])) Object.assign(g[e], r[e]), ("navigation" === e || "pagination" === e || "scrollbar" === e) && "enabled" in r[e] && !r[e].enabled && j(e);
                        else {
                            let t = r[e];
                            (!0 === t || !1 === t) && ("navigation" === e || "pagination" === e || "scrollbar" === e) ? !1 === t && j(e): g[e] = r[e]
                        }
                    }), x.includes("controller") && !c && e.controller && e.controller.control && g.controller && g.controller.control && (e.controller.control = g.controller.control), a.includes("children") && t && k && g.virtual.enabled ? (k.slides = t, k.update(!0)) : a.includes("virtual") && k && g.virtual.enabled && (t && (k.slides = t), k.update(!0)), a.includes("children") && t && g.loop && (f = !0), l && w.init() && w.update(!0), c && (e.controller.control = g.controller.control), d && (e.isElement && (!o || "string" == typeof o) && ((o = document.createElement("div")).classList.add("swiper-pagination"), o.part.add("pagination"), e.el.appendChild(o)), o && (g.pagination.el = o), v.init(), v.render(), v.update()), u && (e.isElement && (!s || "string" == typeof s) && ((s = document.createElement("div")).classList.add("swiper-scrollbar"), s.part.add("scrollbar"), e.el.appendChild(s)), s && (g.scrollbar.el = s), b.init(), b.updateSize(), b.setTranslate()), m && (e.isElement && (i && "string" != typeof i || ((i = document.createElement("div")).classList.add("swiper-button-next"), S(i, e.navigation.arrowSvg), i.part.add("button-next"), e.el.appendChild(i)), n && "string" != typeof n || ((n = document.createElement("div")).classList.add("swiper-button-prev"), S(n, e.navigation.arrowSvg), n.part.add("button-prev"), e.el.appendChild(n))), i && (g.navigation.nextEl = i), n && (g.navigation.prevEl = n), y.init(), y.update()), a.includes("allowSlideNext") && (e.allowSlideNext = r.allowSlideNext), a.includes("allowSlidePrev") && (e.allowSlidePrev = r.allowSlidePrev), a.includes("direction") && e.changeDirection(r.direction, !1), (p || f) && e.loopDestroy(), (h || f) && e.loopCreate(), e.update()
                }({
                    swiper: y.current,
                    slides: P,
                    passedParams: M,
                    changedParams: e,
                    nextEl: w.current,
                    prevEl: j.current,
                    scrollbarEl: _.current,
                    paginationEl: C.current
                }), () => {
                    I && y.current && Object.keys(I).forEach(e => {
                        y.current.off(e, I[e])
                    })
                }
            }), ea(() => {
                var e;
                (e = y.current) && !e.destroyed && e.params.virtual && (!e.params.virtual || e.params.virtual.enabled) && (e.updateSlides(), e.updateProgress(), e.updateSlidesClasses(), e.emit("_virtualUpdated"), e.parallax && e.params.parallax && e.params.parallax.enabled && e.parallax.setTranslate())
            }, [p]), i.default.createElement(t, et({
                ref: v,
                className: ee(`${u}${e?` ${e}`:""}`)
            }, N), i.default.createElement(en.Provider, {
                value: y.current
            }, E["container-start"], i.default.createElement(r, {
                className: function(e = "") {
                    return e ? e.includes("swiper-wrapper") ? e : `swiper-wrapper ${e}` : "swiper-wrapper"
                }(T.wrapperClass)
            }, E["wrapper-start"], T.virtual ? function(e, t, r) {
                if (!r) return null;
                let a = e => {
                        let r = e;
                        return e < 0 ? r = t.length + e : r >= t.length && (r -= t.length), r
                    },
                    n = e.isHorizontal() ? {
                        [e.rtlTranslate ? "right" : "left"]: `${r.offset}px`
                    } : {
                        top: `${r.offset}px`
                    },
                    {
                        from: s,
                        to: o
                    } = r,
                    l = e.params.loop ? -t.length : 0,
                    c = e.params.loop ? 2 * t.length : t.length,
                    d = [];
                for (let e = l; e < c; e += 1) e >= s && e <= o && d.push(t[a(e)]);
                return d.map((t, r) => i.default.cloneElement(t, {
                    swiper: e,
                    style: n,
                    key: t.props.virtualIndex || t.key || `slide-${r}`
                }))
            }(y.current, P, p) : P.map((e, t) => i.default.cloneElement(e, {
                swiper: y.current,
                swiperSlideIndex: t
            })), E["wrapper-end"]), Q(T) && i.default.createElement(i.default.Fragment, null, i.default.createElement("div", {
                ref: j,
                className: "swiper-button-prev"
            }), i.default.createElement("div", {
                ref: w,
                className: "swiper-button-next"
            })), J(T) && i.default.createElement("div", {
                ref: _,
                className: "swiper-scrollbar"
            }), X(T) && i.default.createElement("div", {
                ref: C,
                className: "swiper-pagination"
            }), E["container-end"]))
        });
    es.displayName = "Swiper";
    let eo = (0, i.forwardRef)(({
        tag: e = "div",
        children: t,
        className: r = "",
        swiper: a,
        zoom: n,
        lazy: s,
        virtualIndex: o,
        swiperSlideIndex: l,
        ...c
    } = {}, d) => {
        let u = (0, i.useRef)(null),
            [m, p] = (0, i.useState)("swiper-slide"),
            [h, f] = (0, i.useState)(!1);

        function x(e, t, r) {
            t === u.current && p(r)
        }
        ea(() => {
            if (void 0 !== l && (u.current.swiperSlideIndex = l), d && (d.current = u.current), u.current && a) {
                if (a.destroyed) {
                    "swiper-slide" !== m && p("swiper-slide");
                    return
                }
                return a.on("_slideClass", x), () => {
                    a && a.off("_slideClass", x)
                }
            }
        }), ea(() => {
            a && u.current && !a.destroyed && p(a.getSlideClasses(u.current))
        }, [a]);
        let g = {
                isActive: m.indexOf("swiper-slide-active") >= 0,
                isVisible: m.indexOf("swiper-slide-visible") >= 0,
                isFullyVisible: m.indexOf("swiper-slide-fully-visible") >= 0,
                isPrev: m.indexOf("swiper-slide-prev") >= 0,
                isNext: m.indexOf("swiper-slide-next") >= 0
            },
            v = () => "function" == typeof t ? t(g) : t;
        return i.default.createElement(e, et({
            ref: u,
            className: ee(`${m}${r?` ${r}`:""}`),
            "data-swiper-slide-index": o,
            onLoad: () => {
                f(!0)
            }
        }, c), n && i.default.createElement(ei.Provider, {
            value: g
        }, i.default.createElement("div", {
            className: "swiper-zoom-container",
            "data-swiper-zoom": "number" == typeof n ? n : void 0
        }, v(), s && !h && i.default.createElement("div", {
            className: "swiper-lazy-preloader",
            ref: e => {
                e && (e.lazyPreloaderManaged = !0)
            }
        }))), !n && i.default.createElement(ei.Provider, {
            value: g
        }, v(), s && !h && i.default.createElement("div", {
            className: "swiper-lazy-preloader",
            ref: e => {
                e && (e.lazyPreloaderManaged = !0)
            }
        })))
    });
    eo.displayName = "SwiperSlide", e.s(["Swiper", 0, es, "SwiperSlide", 0, eo], 613135)
}, 388343, 940011, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(219469),
        i = e.i(215959),
        n = e.i(86831);
    let s = ["1px 0 0", "-1px 0 0", "0 1px 0", "0 -1px 0", "1px 1px 0", "-1px -1px 0", "1px -1px 0", "-1px 1px 0"];

    function o(e) {
        return e.toFixed(0)
    }
    e.s(["LiveActivityOverlay", 0, function(e) {
        let l, c, d, u, m, p = (0, r.c)(17),
            {
                indicators: h,
                isDark: f,
                className: x,
                formatAmount: g
            } = e,
            v = void 0 === g ? o : g,
            y = void 0 !== f && f ? "#181D21" : "#fff";
        if (p[0] !== x || p[1] !== v || p[2] !== h || p[3] !== y) {
            let e;
            p[7] !== y ? (e = e => `${e} ${y}`, p[7] = y, p[8] = e) : e = p[8];
            let r = s.map(e).join(", ");
            p[9] !== x ? (d = (0, n.cn)("absolute z-10 pointer-events-none", x), p[9] = x, p[10] = d) : d = p[10], l = a.AnimatePresence, c = h.map((e, a) => (0, t.jsx)(i.motion.div, {
                initial: {
                    y: 20,
                    opacity: 0
                },
                animate: {
                    y: 0,
                    opacity: 1
                },
                exit: {
                    y: -20,
                    opacity: 0
                },
                transition: {
                    duration: .2,
                    ease: "easeInOut"
                },
                style: {
                    position: "absolute",
                    bottom: (h.length - a - 1) * 28,
                    left: 0,
                    transition: "bottom 0.2s ease"
                },
                children: (0, t.jsxs)("span", {
                    className: "whitespace-nowrap text-[13px] font-semibold",
                    style: {
                        color: e.color,
                        textShadow: r
                    },
                    children: ["+ $", v(e.amount)]
                })
            }, e.id)), p[0] = x, p[1] = v, p[2] = h, p[3] = y, p[4] = l, p[5] = c, p[6] = d
        } else l = p[4], c = p[5], d = p[6];
        return p[11] !== l || p[12] !== c ? (u = (0, t.jsx)(l, {
            children: c
        }), p[11] = l, p[12] = c, p[13] = u) : u = p[13], p[14] !== d || p[15] !== u ? (m = (0, t.jsx)("div", {
            className: d,
            children: u
        }), p[14] = d, p[15] = u, p[16] = m) : m = p[16], m
    }], 388343);
    var l = e.i(416340);
    e.s(["useLiveActivityQueue", 0, function(e) {
        let t = e ? .maxIndicators ? ? 5,
            r = e ? .baseFlushInterval ? ? 180,
            a = e ? .minFlushInterval ? ? 40,
            i = e ? .fadeTimeout ? ? 5e3,
            n = e ? .maxPending ? ? 30,
            s = e ? .enabled ? ? !0,
            [o, c] = (0, l.useState)([]),
            d = (0, l.useRef)([]),
            u = (0, l.useRef)(new Set),
            m = (0, l.useRef)(new Map),
            p = (0, l.useRef)(null),
            h = (0, l.useRef)(t);
        h.current = t;
        let f = (0, l.useRef)(i);
        f.current = i;
        let x = (0, l.useRef)(r);
        x.current = r;
        let g = (0, l.useRef)(a);
        g.current = a;
        let v = (0, l.useRef)(n);
        v.current = n;
        let y = (0, l.useRef)(s);
        y.current = s;
        let b = (0, l.useCallback)((e, t) => {
                c(t => t.filter(t => t.id !== e)), u.current.delete(t);
                let r = m.current.get(e);
                r && (clearTimeout(r), m.current.delete(e))
            }, []),
            k = (0, l.useRef)(b);
        k.current = b;
        let w = (0, l.useCallback)(() => {
                if (null !== p.current || !y.current) return;
                let e = d.current.length;
                0 === e || (p.current = setTimeout(() => {
                    p.current = null;
                    let e = d.current.shift();
                    if (!e) return;
                    c(t => {
                        let r = h.current,
                            a = [...t, e];
                        for (let e of a.slice(0, -r)) {
                            u.current.delete(e.dedupId);
                            let t = m.current.get(e.id);
                            t && (clearTimeout(t), m.current.delete(e.id))
                        }
                        return a.slice(-r)
                    });
                    let t = setTimeout(() => k.current(e.id, e.dedupId), f.current);
                    m.current.set(e.id, t), d.current.length > 0 && w()
                }, Math.max(g.current, Math.round(x.current / e))))
            }, []),
            S = (0, l.useCallback)(e => {
                if (u.current.has(e.id)) return;
                let t = {
                    id: `${e.id}-${Date.now()}`,
                    dedupId: e.id,
                    amount: e.amount,
                    color: e.color
                };
                d.current.length >= v.current || (u.current.add(e.id), d.current.push(t), w())
            }, [w]),
            j = (0, l.useCallback)(() => {
                for (let e of (c([]), d.current = [], u.current.clear(), null !== p.current && (clearTimeout(p.current), p.current = null), m.current.values())) clearTimeout(e);
                m.current.clear()
            }, []);
        return (0, l.useEffect)(() => {
            s ? w() : null !== p.current && (clearTimeout(p.current), p.current = null)
        }, [s, w]), (0, l.useEffect)(() => () => {
            for (let e of (null !== p.current && clearTimeout(p.current), m.current.values())) clearTimeout(e);
            m.current.clear()
        }, []), {
            indicators: o,
            push: S,
            reset: j
        }
    }], 940011)
}, 85510, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340);

    function a(e, t) {
        let r;
        return (...a) => {
            window.clearTimeout(r), r = window.setTimeout(() => e(...a), t)
        }
    }
    let i = ["x", "y", "top", "bottom", "left", "right", "width", "height"];
    e.s(["useMeasure", 0, function({
        debounce: e,
        scroll: n,
        polyfill: s,
        offsetSize: o
    } = {
        debounce: 0,
        scroll: !1,
        offsetSize: !1
    }) {
        var l;
        let c, d, u, m, p, h, f = s || window.ResizeObserver;
        if (!f) throw Error("This browser does not support ResizeObserver out of the box.");
        let [x, g] = (0, r.useState)({
            left: 0,
            top: 0,
            width: 0,
            height: 0,
            bottom: 0,
            right: 0,
            x: 0,
            y: 0
        }), v = (0, r.useRef)({
            element: null,
            scrollContainers: null,
            resizeObserver: null,
            lastBounds: x,
            orientationHandler: null
        }), y = e ? "number" == typeof e ? e : e.scroll : null, b = e ? "number" == typeof e ? e : e.resize : null, k = (0, r.useRef)(!1);
        (0, r.useEffect)(() => (k.current = !0, () => {
            k.current = !1
        }));
        let [w, S, j] = (0, r.useMemo)(() => {
            let e = () => {
                let e;
                if (!v.current.element) return;
                let {
                    left: t,
                    top: r,
                    width: a,
                    height: n,
                    bottom: s,
                    right: l,
                    x: c,
                    y: d
                } = v.current.element.getBoundingClientRect(), u = {
                    left: t,
                    top: r,
                    width: a,
                    height: n,
                    bottom: s,
                    right: l,
                    x: c,
                    y: d
                };
                v.current.element instanceof HTMLElement && o && (u.height = v.current.element.offsetHeight, u.width = v.current.element.offsetWidth), Object.freeze(u), k.current && (e = v.current.lastBounds, !i.every(t => e[t] === u[t])) && (v.current.lastBounds = u, g(u))
            };
            return [e, b ? a(e, b) : e, y ? a(e, y) : e]
        }, [g, o, y, b]), C = (0, r.useCallback)(() => {
            v.current.scrollContainers && (v.current.scrollContainers.forEach(e => e.removeEventListener("scroll", j, !0)), v.current.scrollContainers = null), v.current.resizeObserver && (v.current.resizeObserver.disconnect(), v.current.resizeObserver = null), v.current.orientationHandler && ("orientation" in screen && "removeEventListener" in screen.orientation ? screen.orientation.removeEventListener("change", v.current.orientationHandler) : "onorientationchange" in window && window.removeEventListener("orientationchange", v.current.orientationHandler))
        }, [j]), _ = (0, r.useCallback)(() => {
            v.current.element && (v.current.resizeObserver = new f(j), v.current.resizeObserver.observe(v.current.element), n && v.current.scrollContainers && v.current.scrollContainers.forEach(e => e.addEventListener("scroll", j, {
                capture: !0,
                passive: !0
            })), v.current.orientationHandler = () => j(), "orientation" in screen && "addEventListener" in screen.orientation ? screen.orientation.addEventListener("change", v.current.orientationHandler) : "onorientationchange" in window && window.addEventListener("orientationchange", v.current.orientationHandler))
        }, [j, n]), T = (0, r.useCallback)(e => {
            e && e !== v.current.element && (C(), v.current.element = e, v.current.scrollContainers = function e(t) {
                let r = [];
                if (!t || t === document.body) return r;
                let {
                    overflow: a,
                    overflowX: i,
                    overflowY: n
                } = window.getComputedStyle(t);
                return [a, i, n].some(e => "auto" === e || "scroll" === e) && r.push(t), [...r, ...e(t.parentElement)]
            }(e), _())
        }, []);
        return l = !!n, (u = (0, t.c)(4))[0] !== l || u[1] !== j ? (c = () => {
            if (l) return window.addEventListener("scroll", j, {
                capture: !0,
                passive: !0
            }), () => void window.removeEventListener("scroll", j, !0)
        }, d = [j, l], u[0] = l, u[1] = j, u[2] = c, u[3] = d) : (c = u[2], d = u[3]), (0, r.useEffect)(c, d), (h = (0, t.c)(3))[0] !== S ? (m = () => (window.addEventListener("resize", S), () => void window.removeEventListener("resize", S)), p = [S], h[0] = S, h[1] = m, h[2] = p) : (m = h[1], p = h[2]), (0, r.useEffect)(m, p), (0, r.useEffect)(() => {
            C(), _()
        }, [n, j, S]), (0, r.useEffect)(() => C, []), [T, x, w]
    }])
}, 754012, 437891, e => {
    "use strict";
    e.i(221628), e.i(999061);
    var t = e.i(416340);
    e.s(["formatPercent", 0, function(e, t = {}) {
        let {
            decimals: r = 0,
            sign: a = !1
        } = t, i = "string" == typeof e ? parseFloat(e) : e;
        if (!Number.isFinite(i)) return "0%";
        let n = 100 * i,
            s = Math.abs(n).toFixed(r);
        return a ? n > 0 ? `+${s}%` : n < 0 ? `-${s}%` : `${s}%` : n < 0 ? `-${s}%` : `${s}%`
    }, "formatToPercentage", 0, function(e, t) {
        let r = Number(e);
        return Number.isNaN(r) ? "0%" : new Intl.NumberFormat("en-US", {
            style: "percent",
            minimumFractionDigits: 0,
            maximumFractionDigits: 0,
            ...t
        }).format(r)
    }], 437891);
    let r = t.default.createContext({}),
        a = t.default.createContext({}),
        i = t.default.createContext({});
    e.s(["ChartContext", 0, r, "ChartHoverContext", 0, a, "ChartPointerContext", 0, i, "useChartContext", 0, () => t.default.useContext(r), "useChartHoverContext", 0, () => t.default.useContext(a)], 754012)
}, 145638, e => {
    "use strict";
    var t = e.i(416340);
    e.s(["isNarrowViewport", 0, function() {
        return window.innerWidth < 768
    }, "useCallbackRef", 0, function(e) {
        let r = t.default.useRef(e);
        return t.default.useEffect(() => {
            r.current = e
        }), t.default.useCallback((...e) => r.current ? .(...e), [])
    }, "useIsMobile", 0, function() {
        let [e, r] = t.default.useState(!1);
        return t.default.useEffect(() => {
            let e = () => r(window.innerWidth < 768);
            return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e)
        }, []), e
    }, "useMounted", 0, function() {
        let [e, r] = t.default.useState(!1);
        return t.default.useEffect(() => {
            r(!0)
        }, []), e
    }, "usePreventScroll", 0, function(e) {
        t.default.useEffect(() => {
            if (!e) return;
            let t = document.body.style.overflow;
            return document.body.style.overflow = "hidden", () => {
                document.body.style.overflow = t
            }
        }, [e])
    }])
}, 483940, e => {
    "use strict";
    var t = e.i(528436),
        r = e.i(491636),
        a = e.i(437891);
    let i = (0, t.bisector)(e => new Date(1e3 * e.time)).left;
    e.s(["bisectDate", 0, i, "formatDailyDate", 0, e => t => (0, r.format)(t, "MMM d", e ? {
        locale: e
    } : void 0), "formatMonthlyDate", 0, e => t => (0, r.format)(t, "MMM", e ? {
        locale: e
    } : void 0), "formatTimelyDate", 0, e => t => (0, r.format)(t, "h:mm a", e ? {
        locale: e
    } : void 0), "formatValue", 0, (e, t = 0) => (0, a.formatPercent)(e, {
        decimals: t
    }), "formatWindow", 0, e => "1h" === e ? "1H" : "6h" === e ? "6H" : "1d" === e ? "1D" : "1w" === e ? "7D" : "1m" === e ? "30D" : "MAX", "getDate", 0, e => new Date(1e3 * e.time), "getTickDecimals", 0, (e, t) => {
        let r = Math.abs(t - e);
        return 0 === r ? 2 : r < .01 ? 4 : r < .1 ? 3 : r < 1 ? 2 : +(r < 10)
    }, "getValue", 0, e => e.value, "unformatWindow", 0, e => "1H" === e ? "1h" : "6H" === e ? "6h" : "1D" === e ? "1d" : "7D" === e ? "1w" : "30D" === e ? "1m" : "all"])
}, 197935, 925437, 333035, 747844, 847829, 299691, 82413, 720959, e => {
    "use strict";
    e.s(["InteractivityContextProvider", () => en, "useInteractivityContext", () => eu, "useInteractivityLabelContext", () => em], 197935);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(754012),
        n = e.i(168565),
        s = e.i(866051),
        o = e.i(833583),
        l = e.i(197662),
        c = e.i(563089),
        d = e.i(581572),
        u = e.i(782271),
        m = e.i(887440),
        p = e.i(145638),
        h = e.i(483940),
        f = e.i(427631),
        x = e.i(863969),
        g = e.i(497058),
        v = e.i(63023),
        y = e.i(651883);
    let b = {
            LABEL_HEIGHT: 30,
            LABEL_GAP: 25,
            BOTTOM_MARGIN: 12,
            TOP_MARGIN: 0,
            SIDE_ODDS_X_OFFSET: 15
        },
        k = b.LABEL_HEIGHT + b.LABEL_GAP,
        w = [.01, .02, .03, .04, .05, .1, .15, .2, .25, .3, .4, .5],
        S = {
            min: 4,
            max: 6
        },
        j = {
            min: 3,
            max: 7
        };

    function C(e, t, r, a) {
        let i = 0,
            n = 0;
        for (let s of t) {
            let t = Math.floor(e / s) + 1;
            if (t >= r && t <= a && (5 === t || 5 !== n && t > n) && (i = s, n = t, 5 === t)) break
        }
        return n > 0 ? {
            step: i,
            count: n
        } : null
    }

    function _(e) {
        let [t, r] = e, a = r - t;
        if (a <= 0) return {
            ticks: [t],
            boundMin: t,
            boundMax: r
        };
        let i = Math.floor(Math.log10(a)),
            n = 10 ** i / 20,
            s = Math.floor(t / n) * n,
            o = Math.ceil(r / n) * n,
            l = o - s,
            c = function(e) {
                let t = Math.floor(Math.log10(e)),
                    r = new Set;
                for (let e = t - 1; e <= t + 1; e++) {
                    let t = 10 ** e;
                    for (let e of w) r.add(e * t)
                }
                return [...r].sort((e, t) => e - t)
            }(l),
            d = C(l, c, S.min, S.max) ? ? C(l, c, j.min, j.max),
            u = d ? .step ? ? a / 5,
            m = u >= 1 ? 0 : Math.max(0, -Math.floor(Math.log10(u)) + 1),
            p = [];
        for (let e = s; e <= o + .001 * u && (p.push(parseFloat(e.toFixed(m))), !(p.length > 20)); e += u);
        return {
            ticks: p,
            boundMin: s,
            boundMax: o
        }
    }

    function T(e) {
        return e.data
    }

    function M() {
        return !0
    }

    function N() {
        return !0
    }

    function I() {
        return !0
    }

    function P(e) {
        return "M0,0Z" !== e.path
    }
    e.s(["CHART_WINDOWS", 0, ["1H", "6H", "1D", "7D", "30D", "ALL"], "MIN_DISTANCE", 0, k, "SIDE_ODDS_CONSTANTS", 0, b, "Y_AXIS_FALLBACK_TICK_RANGE", 0, j, "Y_AXIS_PREFERRED_TICK_RANGE", 0, S, "Y_AXIS_STEP_SIZES", 0, w], 925437);
    let E = a.default.createContext({}),
        A = null,
        O = () => a.default.useContext(E);

    function D(e) {
        return e.data
    }
    e.s(["LineChartContextProvider", 0, e => {
        let a, b, k, w, S, j, C, O, L, z = (0, r.c)(36),
            {
                width: R,
                height: F,
                children: $
            } = e,
            {
                yAxisVisible: B,
                xAxisVisible: q,
                options: V,
                visibleMarkets: H,
                series: U,
                autoscale: W,
                formatChartValue: G,
                toDisplayValue: Z,
                useEstimateHistory: K
            } = (0, i.useChartContext)(),
            Y = V.startColor,
            Q = V.endColor,
            X = H ? .[0] ? .lastTradePrice ? ? void 0;
        if (z[0] !== W || z[1] !== G || z[2] !== U || z[3] !== Z || z[4] !== K || z[5] !== B) {
            e: {
                if (!B) {
                    a = 0;
                    break e
                }
                let e = U.flatMap(D);
                if (0 === e.length) {
                    a = 38;
                    break e
                }
                let t = W ? [(0, s.min)(e, h.getValue) || 0, (0, n.max)(e, h.getValue) || 1] : [0, 1],
                    r = t[1] - t[0] < Number.EPSILON ? [t[0] - Math.max(.05 * Math.abs(t[0]), .05), t[1] + Math.max(.05 * Math.abs(t[1]), .05)] : [t[0], t[1]],
                    {
                        ticks: i
                    } = _(r);a = Math.max(38, function(e) {
                    let t = (A || (A = document.createElement("canvas").getContext("2d")), A);
                    if (!t || 0 === e.length) return 0;
                    t.font = "12px sans-serif";
                    let r = 0;
                    for (let a of e) {
                        let e = t.measureText(a).width;
                        e > r && (r = e)
                    }
                    return Math.ceil(r)
                }(i.map(e => {
                    if (!K || !G || !Z) {
                        let t = r[1] - r[0];
                        return (0, h.formatValue)(e, t < .02 ? 1 : void 0)
                    }
                    let t = Z(r[0]),
                        a = Z(r[1]);
                    return G(e, (0, h.getTickDecimals)(t, a))
                })) + 12)
            }
            z[0] = W,
            z[1] = G,
            z[2] = U,
            z[3] = Z,
            z[4] = K,
            z[5] = B,
            z[6] = a
        }
        else a = z[6];
        let J = a;
        t: {
            let e;
            if (V.margin) {
                b = V.margin;
                break t
            }
            let t = B && "right" === V.yAxisOrientation ? J : 0,
                r = q ? 30 : 10,
                a = B && "left" === V.yAxisOrientation ? J : 0;z[7] !== t || z[8] !== r || z[9] !== a ? (e = {
                top: 10,
                right: t,
                bottom: r,
                left: a
            }, z[7] = t, z[8] = r, z[9] = a, z[10] = e) : e = z[10],
            b = e
        }
        let ee = b;
        z[11] !== F || z[12] !== ee || z[13] !== R ? (k = {
            height: F,
            margin: ee,
            width: R
        }, z[11] = F, z[12] = ee, z[13] = R, z[14] = k) : k = z[14];
        let et = (e => {
            let t, a = (0, r.c)(9),
                {
                    height: o,
                    margin: b,
                    width: k
                } = e,
                {
                    series: w,
                    autoscale: S,
                    options: j,
                    sideOddsOffset: C,
                    dateLocale: E
                } = (0, i.useChartContext)(),
                A = (0, p.useMounted)(),
                O = o - b.top - b.bottom,
                D = k - b.right,
                L = "side" === j.oddsDisplay ? C : 0;
            if (a[0] !== S || a[1] !== E || a[2] !== L || a[3] !== b.left || a[4] !== D || a[5] !== O || a[6] !== A || a[7] !== w) {
                let e = w.flatMap(T),
                    r = (0, m.extent)(e, h.getDate),
                    i = (0, d.scaleTime)({
                        domain: r,
                        range: [b.left, D - 12 - L],
                        round: !0
                    }),
                    o = S ? [(0, s.min)(e, h.getValue) || 0, (0, n.max)(e, h.getValue) || 1] : [0, 1],
                    p = o[1] - o[0] < Number.EPSILON ? [o[0] - Math.max(.05 * Math.abs(o[0]), .05), o[1] + Math.max(.05 * Math.abs(o[1]), .05)] : o,
                    k = (0, c.scaleLinear)({
                        domain: p,
                        range: [O, 0],
                        nice: 5,
                        round: !0
                    }),
                    {
                        ticks: j,
                        boundMin: C,
                        boundMax: z
                    } = _(k.domain());
                k.domain([C, z]);
                let {
                    ticks: R,
                    format: F
                } = ((e, t) => {
                    var r;
                    let a, {
                            interval: i,
                            format: n
                        } = (r = e.domain(), (a = g.timeMinute.count(r[0], r[1])) <= 60 ? {
                            interval: g.timeMinute.every(10),
                            format: (0, h.formatTimelyDate)(t)
                        } : a <= 360 ? {
                            interval: x.timeHour.every(1),
                            format: (0, h.formatTimelyDate)(t)
                        } : a <= 720 ? {
                            interval: x.timeHour.every(2),
                            format: (0, h.formatTimelyDate)(t)
                        } : a <= 1440 ? {
                            interval: x.timeHour.every(4),
                            format: (0, h.formatTimelyDate)(t)
                        } : a <= 4320 ? {
                            interval: x.timeHour.every(12),
                            format: (0, h.formatTimelyDate)(t)
                        } : a <= 10080 ? {
                            interval: f.timeDay.every(1),
                            format: (0, h.formatDailyDate)(t)
                        } : a <= 20160 ? {
                            interval: f.timeDay.every(3),
                            format: (0, h.formatDailyDate)(t)
                        } : a <= 43800 ? {
                            interval: y.timeWeek.every(1),
                            format: (0, h.formatDailyDate)(t)
                        } : a <= 87600 ? {
                            interval: y.timeWeek.every(2),
                            format: (0, h.formatDailyDate)(t)
                        } : {
                            interval: v.timeMonth.every(1),
                            format: (0, h.formatMonthlyDate)(t)
                        }),
                        s = e.ticks(i);
                    return {
                        ticks: s.length > 3 ? (e => {
                            let t = e;
                            if (e.length > 3) {
                                let r = g.timeMinute.count(e[0], e[1]),
                                    a = g.timeMinute.count(e[1], e[2]),
                                    i = g.timeMinute.count(e[e.length - 2], e[e.length - 1]);
                                r !== a && a === i ? t = e.slice(1) : r === a && a !== i && (t = e.slice(0, e.length - 1))
                            }
                            return t
                        })(s) : s,
                        format: n
                    }
                })(i, E);
                t = {
                    xAxisScale: i,
                    yAxisScale: k,
                    series: A ? w.map(e => {
                        let t;
                        return e.backfilledData.length && (t = i((0, h.getDate)(e.backfilledData[e.backfilledData.length - 1]))), { ...e,
                            key: e.id,
                            pathId: `${e.id}-path`,
                            path: (0, u.line)({
                                x: e => i((0, h.getDate)(e)) ? ? 0,
                                y: e => k((0, h.getValue)(e)) ? ? 0,
                                curve: l.curveMonotoneX,
                                defined: M
                            })(e.data),
                            ...e.backfilledData.length && {
                                fullPath: (0, u.line)({
                                    x: e => i((0, h.getDate)(e)) ? ? 0,
                                    y: e => k((0, h.getValue)(e)) ? ? 0,
                                    curve: l.curveMonotoneX,
                                    defined: N
                                })([...e.backfilledData, ...e.data]),
                                shortPath: (0, u.line)({
                                    x: e => i((0, h.getDate)(e)) ? ? 0,
                                    y: e => k((0, h.getValue)(e)) ? ? 0,
                                    curve: l.curveMonotoneX,
                                    defined: I
                                })([...e.backfilledData, ...e.data.length ? [e.data[0]] : []]),
                                pathStartX: t
                            }
                        }
                    }).filter(P) : [],
                    yAxisTicks: j,
                    xAxisTicks: R,
                    xTickMarkFormatter: F
                }, a[0] = S, a[1] = E, a[2] = L, a[3] = b.left, a[4] = D, a[5] = O, a[6] = A, a[7] = w, a[8] = t
            } else t = a[8];
            return t
        })(k);
        z[15] !== et ? ({
            xAxisScale: S,
            yAxisScale: j,
            ...w
        } = et, z[15] = et, z[16] = w, z[17] = S, z[18] = j) : (w = z[16], S = z[17], j = z[18]), z[19] !== Q || z[20] !== X || z[21] !== Y ? (C = {
            startColor: Y,
            endColor: Q,
            lastTradePrice: X
        }, z[19] = Q, z[20] = X, z[21] = Y, z[22] = C) : C = z[22];
        let {
            color: er,
            gradient: ea,
            getVariableColor: ei
        } = (0, o.useGradientColors)(C);
        z[23] !== ei || z[24] !== F || z[25] !== er || z[26] !== ea || z[27] !== ee || z[28] !== w || z[29] !== R || z[30] !== S || z[31] !== j ? (O = {
            width: R,
            height: F,
            margin: ee,
            xAxisScale: S,
            yAxisScale: j,
            lastPriceColor: er,
            getVariableColor: ei,
            linearGradientElement: ea,
            ...w
        }, z[23] = ei, z[24] = F, z[25] = er, z[26] = ea, z[27] = ee, z[28] = w, z[29] = R, z[30] = S, z[31] = j, z[32] = O) : O = z[32];
        let en = O;
        return z[33] !== $ || z[34] !== en ? (L = (0, t.jsx)(E.Provider, {
            value: en,
            children: $
        }), z[33] = $, z[34] = en, z[35] = L) : L = z[35], L
    }, "useLineChartContext", 0, O], 333035);
    let L = a.default.createContext({}),
        z = e => {
            let i, n, s, o, l = (0, r.c)(9),
                {
                    animatePaths: c,
                    animateMarkers: d,
                    children: u
                } = e,
                m = void 0 === c || c,
                p = void 0 === d || d,
                [h, f] = a.default.useState(0);
            l[0] === Symbol.for("react.memo_cache_sentinel") ? (i = () => {
                let e = setTimeout(() => f(.3), 1e3);
                return () => clearTimeout(e)
            }, n = [], l[0] = i, l[1] = n) : (i = l[0], n = l[1]), a.default.useEffect(i, n), l[2] !== p || l[3] !== m || l[4] !== h ? (s = {
                animatePaths: m,
                animateMarkers: p,
                tickAnimationDuration: h
            }, l[2] = p, l[3] = m, l[4] = h, l[5] = s) : s = l[5];
            let x = s;
            return l[6] !== u || l[7] !== x ? (o = (0, t.jsx)(L.Provider, {
                value: x,
                children: u
            }), l[6] = u, l[7] = x, l[8] = o) : o = l[8], o
        };
    e.s(["AnimationContextProvider", 0, z, "useAnimationContext", 0, () => a.default.useContext(L)], 747844);
    let R = a.default.createContext({}),
        F = e => {
            let n, s, o, l, c, d, u, m, p = (0, r.c)(17),
                {
                    children: h
                } = e,
                {
                    window: f,
                    series: x
                } = (0, i.useChartContext)(),
                [g, v] = a.default.useState(!1),
                [y, b] = a.default.useState(!1),
                [k, w] = a.default.useState(0),
                [S, j] = a.default.useState(null);
            p[0] === Symbol.for("react.memo_cache_sentinel") ? (n = [], p[0] = n) : n = p[0];
            let [C, _] = a.default.useState(n);
            p[1] === Symbol.for("react.memo_cache_sentinel") ? (s = (e, t, r) => {
                w(e), j(t ? [...t] : null), _([...r]), v(!0), b(!1)
            }, p[1] = s) : s = p[1];
            let T = s;
            p[2] === Symbol.for("react.memo_cache_sentinel") ? (o = () => {
                b(!0)
            }, p[2] = o) : o = p[2];
            let M = o;
            p[3] === Symbol.for("react.memo_cache_sentinel") ? (l = () => {
                v(!1), b(!1), w(0), j(null), _([])
            }, p[3] = l) : l = p[3];
            let N = l;
            p[4] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
                v(!1), b(!1), w(0), j(null), _([])
            }, p[4] = c) : c = p[4], p[5] !== f || p[6] !== x ? (d = [f, x], p[5] = f, p[6] = x, p[7] = d) : d = p[7], a.default.useEffect(c, d), p[8] !== S || p[9] !== k || p[10] !== C || p[11] !== g || p[12] !== y ? (u = {
                isDragging: g,
                isLocked: y,
                dragAnchorLeft: k,
                dragAnchorData: S,
                dragAnchorTops: C,
                startDrag: T,
                lockDrag: M,
                endDrag: N,
                clearDrag: N
            }, p[8] = S, p[9] = k, p[10] = C, p[11] = g, p[12] = y, p[13] = u) : u = p[13];
            let I = u;
            return p[14] !== h || p[15] !== I ? (m = (0, t.jsx)(R.Provider, {
                value: I,
                children: h
            }), p[14] = h, p[15] = I, p[16] = m) : m = p[16], m
        };
    e.s(["DragRangeContextProvider", 0, F, "useDragRangeContext", 0, () => a.default.useContext(R)], 847829), e.s(["TooltipPositionContextProvider", () => J, "useTooltipCursorMotionContext", () => er, "useTooltipLabelDataContext", () => et, "useTooltipPositionContext", () => ee], 720959);
    var $ = e.i(178918),
        B = e.i(949553),
        q = ["tooltipOpen"];

    function V() {
        return (V = Object.assign.bind()).apply(this, arguments)
    }
    var H = e.i(328113),
        U = e.i(339393);
    let W = (0, a.createContext)({
            annotations: void 0,
            annotationMode: void 0,
            xAxisTopOffset: void 0,
            forcedTooltipPoint: void 0,
            forceShowDateTooltip: !1,
            preventTooltip: !1,
            updateHoverPosition: e => {},
            annotationsEnabled: !1,
            annotationsVisible: !1
        }),
        G = () => (0, a.useContext)(W);
    e.s(["AnnotationsContext", 0, W, "useAnnotationsContext", 0, G], 299691);
    let Z = ({
        options: e,
        series: t,
        xAxisScale: r,
        yAxisScale: a,
        margin: i
    }) => {
        try {
            if ("persist" === e.tooltipOptions.mode) {
                let e = r.range(),
                    n = t.map(e => {
                        if (e.data.length) {
                            let t = e.data[e.data.length - 1];
                            return {
                                id: e.id,
                                label: e.label,
                                color: e.color,
                                point: t,
                                precision: e.precision
                            }
                        }
                    }).filter(Boolean);
                return {
                    tooltip: {
                        tooltipOpen: !0,
                        tooltipData: n,
                        tooltipLeft: e[e.length - 1] + i.right + 5
                    },
                    tops: n.map(e => a(e.point.value))
                }
            }
            return
        } catch (e) {
            console.error("[GroupChart > getRestingTooltipData] Error", e);
            return
        }
    };

    function K(e, t) {
        return e === t || !!e && !!t && e.length === t.length && e.every((e, r) => {
            let a = t[r];
            return !!a && e.id === a.id && e.label === a.label && e.color === a.color && e.precision === a.precision && e.point.time === a.point.time && e.point.value === a.point.value
        })
    }
    e.s(["enrichTooltipLabels", 0, ({
        tooltipData: e,
        rangeOfDomain: t,
        minValueDifferential: r,
        canClampMin: a = !0,
        canClampMax: i = !0
    }) => e.sort((e, t) => e.point.value > t.point.value ? 1 : -1).reduce((n, s, o) => {
        if (0 === t) return n.push({ ...s,
            adjustedValue: s.point.value + o * r
        }), n;
        let l = (o > 0 ? n[o - 1].adjustedValue : -1 / 0) + r,
            c = s.point.value;
        return a && c < l && (c = l + .002), i && o === e.length - 1 && (c = Math.min(c, e[0].point.value + t)), n.push({ ...s,
            adjustedValue: c
        }), n
    }, []), "hasSameTooltipData", 0, K], 82413);
    let Y = a.default.createContext({}),
        Q = a.default.createContext({}),
        X = a.default.createContext({});

    function J(e) {
        var n;
        let s, o, l, c, d, u, m, f, x, g, v, y, b, k, w, S = (0, r.c)(33),
            {
                children: j
            } = e,
            {
                series: C
            } = (0, i.useChartContext)(),
            {
                setHoverData: _
            } = (0, i.useChartHoverContext)(),
            {
                xAxisScale: T,
                yAxisScale: M
            } = O(),
            {
                setState: N
            } = eu(),
            {
                updateHoverPosition: I
            } = G();
        S[0] !== C || S[1] !== T || S[2] !== M ? (s = {
            xAxisScale: T,
            yAxisScale: M,
            series: C
        }, S[0] = C, S[1] = T, S[2] = M, S[3] = s) : s = S[3];
        let {
            position: P,
            state: E
        } = (e => {
            var t, n, s, o, l;
            let c, d, u, m, f, x, g, v, y, b, k = (0, r.c)(60),
                {
                    xAxisScale: w,
                    yAxisScale: S,
                    series: j
                } = e,
                {
                    options: C
                } = (0, i.useChartContext)(),
                {
                    height: _,
                    margin: T
                } = O(),
                {
                    annotationMode: M,
                    forcedTooltipPoint: N,
                    forceShowDateTooltip: I,
                    preventTooltip: P
                } = G(),
                [E, A] = a.default.useState(!1),
                D = (0, H.useLatest)(j),
                L = (0, H.useLatest)(E);
            k[0] === Symbol.for("react.memo_cache_sentinel") ? (c = [], k[0] = c) : c = k[0];
            let [z, R] = a.default.useState(c), F = a.default.useRef(!1), $ = a.default.useRef(null);
            k[1] !== T || k[2] !== C || k[3] !== j || k[4] !== w || k[5] !== S ? (d = () => {
                let e = Z({
                    options: C,
                    series: j,
                    yAxisScale: S,
                    xAxisScale: w,
                    margin: T
                });
                if (e) return {
                    tooltipOpen: !1,
                    tooltipLeft: e.tooltip.tooltipLeft,
                    tooltipData: e.tooltip.tooltipData
                }
            }, k[1] = T, k[2] = C, k[3] = j, k[4] = w, k[5] = S, k[6] = d) : d = k[6];
            let [W] = a.default.useState(d), {
                showTooltip: K,
                hideTooltip: Y,
                tooltipData: Q,
                tooltipLeft: X,
                tooltipTop: J,
                tooltipOpen: ee,
                updateTooltip: et
            } = (n = (t = (0, a.useState)(V({
                tooltipOpen: !1
            }, W)))[0], s = t[1], o = (0, a.useCallback)(function(e) {
                return s("function" == typeof e ? function(t) {
                    t.tooltipOpen;
                    var r = function(e, t) {
                        if (null == e) return {};
                        var r, a, i = {},
                            n = Object.keys(e);
                        for (a = 0; a < n.length; a++) r = n[a], t.indexOf(r) >= 0 || (i[r] = e[r]);
                        return i
                    }(t, q);
                    return V({}, e(r), {
                        tooltipOpen: !0
                    })
                } : {
                    tooltipOpen: !0,
                    tooltipLeft: e.tooltipLeft,
                    tooltipTop: e.tooltipTop,
                    tooltipData: e.tooltipData
                })
            }, [s]), l = (0, a.useCallback)(function() {
                return s({
                    tooltipOpen: !1,
                    tooltipLeft: void 0,
                    tooltipTop: void 0,
                    tooltipData: void 0
                })
            }, [s]), {
                tooltipOpen: n.tooltipOpen,
                tooltipLeft: n.tooltipLeft,
                tooltipTop: n.tooltipTop,
                tooltipData: n.tooltipData,
                updateTooltip: s,
                showTooltip: o,
                hideTooltip: l
            }), er = void 0 === X ? 0 : X, ea = void 0 === J ? 0 : J;
            k[7] !== N || k[8] !== Y || k[9] !== D || k[10] !== T || k[11] !== C || k[12] !== et || k[13] !== w || k[14] !== S ? (u = () => {
                if (!F.current && !N) {
                    if ("persist" === C.tooltipOptions.mode) {
                        let e = Z({
                            options: C,
                            series: D.current ? ? [],
                            yAxisScale: S,
                            xAxisScale: w,
                            margin: T
                        });
                        if (e) {
                            F.current = !0, $.current = setTimeout(() => {
                                F.current = !1
                            }, 100), et(e.tooltip), R([...e.tops]), A(!1);
                            return
                        }
                    }
                    Y()
                }
            }, k[7] = N, k[8] = Y, k[9] = D, k[10] = T, k[11] = C, k[12] = et, k[13] = w, k[14] = S, k[15] = u) : u = k[15];
            let ei = u;
            k[16] !== M || k[17] !== N || k[18] !== _ || k[19] !== D || k[20] !== L || k[21] !== C.tooltipOptions.mode || k[22] !== ei || k[23] !== K || k[24] !== w || k[25] !== S ? (m = e => {
                if (F.current) return;
                let t = N ? {
                    x: N,
                    y: 0
                } : (0, B.localPoint)(e);
                if (!t && "persist" === C.tooltipOptions.mode) return void ei();
                let {
                    x: r,
                    y: a
                } = t || {
                    x: 0,
                    y: 0
                };
                if ("bottom-bar" === M && a > _ - 20 && !N) return void ei();
                let i = w.invert(r),
                    n = [],
                    s = (D.current ? ? []).map(e => {
                        let t = (0, h.bisectDate)(e.data, i, 1),
                            r = e.data[t - 1],
                            a = e.data[t],
                            s = r;
                        return a && (0, h.getDate)(a) && (s = i.valueOf() - (0, h.getDate)(r).valueOf() > (0, h.getDate)(a).valueOf() - i.valueOf() ? a : r), n.push(s), {
                            point: s,
                            color: e.color,
                            id: e.id,
                            label: e.label,
                            precision: e.precision
                        }
                    });
                R(n.map(e => S(e ? .value ? (0, h.getValue)(e) : S.domain()[1]))), K({
                    tooltipData: s,
                    tooltipLeft: r,
                    tooltipTop: S(1)
                }), !L.current && (!(0, p.isNarrowViewport)() || (0, p.isNarrowViewport)() && !N) && A(!0)
            }, k[16] = M, k[17] = N, k[18] = _, k[19] = D, k[20] = L, k[21] = C.tooltipOptions.mode, k[22] = ei, k[23] = K, k[24] = w, k[25] = S, k[26] = m) : m = k[26];
            let en = m;
            k[27] === Symbol.for("react.memo_cache_sentinel") ? (f = {
                wait: 1e3,
                enabled: !0
            }, k[27] = f) : f = k[27];
            let es = (0, U.useDeferredMounted)(f);
            k[28] !== es || k[29] !== C.tooltipOptions.mode || k[30] !== ei ? (x = () => {
                es && "persist" === C.tooltipOptions.mode && ei()
            }, g = [es, C.tooltipOptions.mode, ei], k[28] = es, k[29] = C.tooltipOptions.mode, k[30] = ei, k[31] = x, k[32] = g) : (x = k[31], g = k[32]), a.default.useEffect(x, g);
            e: {
                let e;
                if (N) {
                    let e, t, r;
                    if (k[33] !== N || k[34] !== j || k[35] !== w || k[36] !== S) {
                        let r = w.invert(N),
                            a = [];
                        e = (j ? ? []).map(e => {
                            let t = (0, h.bisectDate)(e.data, r, 1),
                                i = e.data[t - 1],
                                n = e.data[t],
                                s = i;
                            return n && (0, h.getDate)(n) && (s = r.valueOf() - (0, h.getDate)(i).valueOf() > (0, h.getDate)(n).valueOf() - r.valueOf() ? n : i), a.push(s), {
                                point: s,
                                color: e.color,
                                id: e.id,
                                label: e.label,
                                precision: e.precision
                            }
                        }), t = a.map(e => S(e ? .value ? (0, h.getValue)(e) : S.domain()[1])), k[33] = N, k[34] = j, k[35] = w, k[36] = S, k[37] = e, k[38] = t
                    } else e = k[37], t = k[38];
                    let a = t,
                        i = P ? void 0 : e,
                        n = a.length ? a[0] : ea;
                    k[39] !== N || k[40] !== i || k[41] !== n || k[42] !== a ? (r = {
                        tooltipData: i,
                        tooltipLeft: N,
                        tooltipTop: n,
                        tooltipTops: a
                    }, k[39] = N, k[40] = i, k[41] = n, k[42] = a, k[43] = r) : r = k[43], v = r;
                    break e
                }
                k[44] !== Q || k[45] !== er || k[46] !== ea || k[47] !== z ? (e = {
                    tooltipData: Q,
                    tooltipLeft: er,
                    tooltipTop: ea,
                    tooltipTops: z
                }, k[44] = Q, k[45] = er, k[46] = ea, k[47] = z, k[48] = e) : e = k[48],
                v = e
            }
            let eo = v,
                el = E || !!I,
                ec = !P && (ee || !!N);
            k[49] !== en || k[50] !== Y || k[51] !== ei || k[52] !== K || k[53] !== el || k[54] !== ec || k[55] !== et ? (y = {
                handleTooltip: en,
                showTooltip: K,
                showDateTooltip: el,
                hideTooltip: Y,
                tooltipOpen: ec,
                updateTooltip: et,
                resetTooltip: ei
            }, k[49] = en, k[50] = Y, k[51] = ei, k[52] = K, k[53] = el, k[54] = ec, k[55] = et, k[56] = y) : y = k[56];
            let ed = y;
            return k[57] !== eo || k[58] !== ed ? (b = {
                position: eo,
                state: ed
            }, k[57] = eo, k[58] = ed, k[59] = b) : b = k[59], b
        })(s), A = (0, $.useMotionValue)(P.tooltipLeft ? ? 0), D = (n = P.tooltipData, K((w = a.default.useRef(n)).current, n) || (w.current = n), w.current);
        S[4] !== N || S[5] !== E ? (o = () => N(E), l = [N, E], S[4] = N, S[5] = E, S[6] = o, S[7] = l) : (o = S[6], l = S[7]), a.default.useEffect(o, l), S[8] !== P.tooltipLeft || S[9] !== A ? (c = () => {
            A.set(P.tooltipLeft ? ? 0)
        }, d = [P.tooltipLeft, A], S[8] = P.tooltipLeft, S[9] = A, S[10] = c, S[11] = d) : (c = S[10], d = S[11]), a.default.useEffect(c, d), S[12] !== _ || S[13] !== D ? (u = () => {
            _(D ? ? null)
        }, m = [D, _], S[12] = _, S[13] = D, S[14] = u, S[15] = m) : (u = S[14], m = S[15]), a.default.useEffect(u, m), S[16] !== P.tooltipLeft || S[17] !== I ? (f = () => {
            void 0 !== P.tooltipLeft && I(P.tooltipLeft)
        }, x = [P.tooltipLeft, I], S[16] = P.tooltipLeft, S[17] = I, S[18] = f, S[19] = x) : (f = S[18], x = S[19]), a.default.useEffect(f, x), S[20] !== D ? (g = {
            tooltipData: D
        }, S[20] = D, S[21] = g) : g = S[21];
        let L = g;
        S[22] !== A ? (v = {
            tooltipLeftMotion: A
        }, S[22] = A, S[23] = v) : v = S[23];
        let z = v;
        return S[24] !== j || S[25] !== P ? (y = (0, t.jsx)(Y.Provider, {
            value: P,
            children: j
        }), S[24] = j, S[25] = P, S[26] = y) : y = S[26], S[27] !== L || S[28] !== y ? (b = (0, t.jsx)(Q.Provider, {
            value: L,
            children: y
        }), S[27] = L, S[28] = y, S[29] = b) : b = S[29], S[30] !== z || S[31] !== b ? (k = (0, t.jsx)(X.Provider, {
            value: z,
            children: b
        }), S[30] = z, S[31] = b, S[32] = k) : k = S[32], k
    }
    let ee = () => a.default.useContext(Y),
        et = () => a.default.useContext(Q),
        er = () => a.default.useContext(X),
        ea = a.default.createContext({}),
        ei = a.default.createContext({});

    function en(e) {
        let n, s, o, l, c, d, u, m, p = (0, r.c)(19),
            {
                children: h
            } = e,
            {
                options: f
            } = (0, i.useChartContext)(),
            {
                margin: x
            } = O();
        p[0] !== x || p[1] !== f.tooltipOptions.mode ? (n = () => {
            var e, t;
            return e = f.tooltipOptions.mode, t = x.right, "persist" === e ? t - 20 : 120
        }, p[0] = x, p[1] = f.tooltipOptions.mode, p[2] = n) : n = p[2];
        let [g] = a.default.useState(n), v = a.default.useRef(g), [y, b] = a.default.useState(g);
        p[3] === Symbol.for("react.memo_cache_sentinel") ? (s = {
            handleTooltip: ed,
            showTooltip: ec,
            hideTooltip: el,
            tooltipOpen: !1,
            updateTooltip: eo,
            showDateTooltip: !1,
            resetTooltip: es
        }, p[3] = s) : s = p[3];
        let [k, w] = a.default.useState(s);
        p[4] !== f.tooltipOptions.mode ? (o = e => {
            "persist" !== f.tooltipOptions.mode && e > v.current && (v.current = e, b(e))
        }, p[4] = f.tooltipOptions.mode, p[5] = o) : o = p[5];
        let S = o;
        p[6] !== k ? (l = { ...k,
            setState: w
        }, p[6] = k, p[7] = l) : l = p[7];
        let j = l;
        p[8] !== y || p[9] !== S ? (c = {
            updateLargestLabelWidth: S,
            largestLabelWidth: y
        }, p[8] = y, p[9] = S, p[10] = c) : c = p[10];
        let C = c;
        return p[11] !== h ? (d = (0, t.jsx)(z, {
            children: (0, t.jsx)(J, {
                children: (0, t.jsx)(F, {
                    children: h
                })
            })
        }), p[11] = h, p[12] = d) : d = p[12], p[13] !== C || p[14] !== d ? (u = (0, t.jsx)(ei.Provider, {
            value: C,
            children: d
        }), p[13] = C, p[14] = d, p[15] = u) : u = p[15], p[16] !== u || p[17] !== j ? (m = (0, t.jsx)(ea.Provider, {
            value: j,
            children: u
        }), p[16] = u, p[17] = j, p[18] = m) : m = p[18], m
    }

    function es() {}

    function eo() {}

    function el() {}

    function ec() {}

    function ed() {}
    let eu = () => a.default.useContext(ea),
        em = () => a.default.useContext(ei)
}, 195859, e => {
    "use strict";
    var t = e.i(60970),
        r = e.i(519099),
        a = e.i(944830),
        i = e.i(556800),
        n = e.i(796755),
        s = e.i(6251),
        o = e.i(540143),
        l = e.i(406878),
        c = l.default && l.default.isRegExp,
        d = c ? (0, o.default)(c) : function(e) {
            return (0, s.default)(e) && "[object RegExp]" == (0, n.default)(e)
        },
        u = (0, e.i(820440).default)("length"),
        m = "\\ud800-\\udfff",
        p = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",
        h = "\\ud83c[\\udffb-\\udfff]",
        f = "[^" + m + "]",
        x = "(?:\\ud83c[\\udde6-\\uddff]){2}",
        g = "[\\ud800-\\udbff][\\udc00-\\udfff]",
        v = "(?:" + p + "|" + h + ")?",
        y = "[\\ufe0e\\ufe0f]?",
        b = "(?:\\u200d(?:" + [f, x, g].join("|") + ")" + y + v + ")*",
        k = RegExp(h + "(?=" + h + ")|" + ("(?:" + [f + p + "?", p, x, g, "[" + m + "]"].join("|")) + ")" + (y + v + b), "g");
    let w = function(e) {
        for (var t = k.lastIndex = 0; k.test(e);) ++t;
        return t
    };
    var S = e.i(438232),
        j = e.i(982032),
        C = e.i(322467),
        _ = /\w*$/;
    e.s(["truncate", 0, function(e, n) {
        var s = 30,
            o = "...";
        if ((0, i.default)(n)) {
            var l = "separator" in n ? n.separator : l;
            s = "length" in n ? (0, j.default)(n.length) : s, o = "omission" in n ? (0, t.default)(n.omission) : o
        }
        var c = (e = (0, C.default)(e)).length;
        if ((0, a.default)(e)) {
            var m = (0, S.default)(e);
            c = m.length
        }
        if (s >= c) return e;
        var p = s - (f = o, (0, a.default)(f) ? w(f) : u(f));
        if (p < 1) return o;
        var h = m ? (0, r.default)(m, 0, p).join("") : e.slice(0, p);
        if (void 0 === l) return h + o;
        if (m && (p += h.length - p), d(l)) {
            if (e.slice(p).search(l)) {
                var f, x, g = h;
                for (l.global || (l = RegExp(l.source, (0, C.default)(_.exec(l)) + "g")), l.lastIndex = 0; x = l.exec(g);) var v = x.index;
                h = h.slice(0, void 0 === v ? p : v)
            }
        } else if (e.indexOf((0, t.default)(l), p) != p) {
            var y = h.lastIndexOf(l);
            y > -1 && (h = h.slice(0, y))
        }
        return h + o
    }], 195859)
}, 309865, 994402, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(195859);
    e.i(416340);
    var a = e.i(145638);
    let i = null;

    function n(e) {
        return e.label
    }
    e.s(["useCalculateLongestSeriesWidth", 0, function(e, s) {
        let o, l = (0, t.c)(6),
            c = void 0 === s ? "14px sans-serif" : s,
            d = (0, a.useIsMobile)(),
            u = e ? .map(n).join(",") || "",
            m = 0;
        if (u && 1)
            if (l[0] !== c || l[1] !== e) {
                let t = (i || (i = document.createElement("canvas").getContext("2d")), i);
                t && (t.font = c, m = Math.max(...e.map(e => t.measureText((0, r.truncate)(e.label, {
                    length: 24,
                    separator: " "
                })).width))), l[0] = c, l[1] = e, l[2] = m
            } else m = l[2];
        let p = Math.max(m + (d ? 15 : 20), d ? 50 : 90),
            h = p + 30;
        return l[3] !== h || l[4] !== p ? (o = {
            sideOddsOffset: p,
            sideOddsLabelOffset: h
        }, l[3] = h, l[4] = p, l[5] = o) : o = l[5], o
    }], 309865), e.i(196593), e.s(["UNIT_LABELS", 0, {
        inches: "inches",
        minutes: "minutes",
        cases: "cases",
        days: "days",
        oscars: "Oscars",
        seats: "seats"
    }, "slugToFormat", 0, {
        "how-many-inches-of-snow-in-nyc-this-weekend-jan-24-26": "inches",
        "how-long-will-it-take-alex-honnold-to-free-solo-taipei-101": "minutes",
        "measles-cases-in-us-in-2026": "cases",
        "how-long-will-the-next-government-shutdown-last": "days",
        "how-many-oscars-will-sinners-win": "oscars",
        "what-price-will-bitcoin-hit-before-2027": "usd",
        "spacex-ipo-closing-market-cap": "usd",
        "spacex-ipo-closing-market-cap-above": "usd",
        "how-long-will-the-dhs-shutdown-last": "days",
        "how-many-inches-of-snow-in-nyc-this-weekend-february-21-23": "inches",
        "how-many-inches-of-snow-in-nyc-this-weekend-february-21-23-273": "inches",
        "republican-house-seats-after-the-2026-midterm-elections": "seats",
        "republican-senate-seats-after-the-2026-midterm-elections-927": "seats",
        "scream-7-opening-weekend-box-office": "usd"
    }], 994402)
}, 715877, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340),
        a = e.i(488549),
        i = e.i(249792),
        n = e.i(606572),
        s = e.i(650485),
        o = e.i(459225),
        l = e.i(360493),
        c = e.i(73903);
    e.s(["useChartMarkets", 0, ({
        markets: e,
        lowChanceMarkets: t,
        resolvedMarkets: d,
        event: u,
        colorsProp: m,
        forceShowAllMarkets: p,
        mode: h,
        outcomeMode: f,
        selectedAssetIndex: x,
        showBothOutcomes: g
    }) => {
        let {
            colors: v
        } = (0, c.useChartTheme)(), y = r.default.useMemo(() => m ? ? v, [m, v]), b = (0, i.useToast)(), {
            markets: k,
            lowChanceMarkets: w,
            unrestrictedColors: S
        } = r.default.useMemo(() => {
            if ("single" === h && "single" === f) return {
                lowChanceMarkets: [],
                ...(0, l.getSeriesColors)({
                    markets: e,
                    lowChanceMarkets: [],
                    resolvedMarkets: d,
                    event: u,
                    colors: y
                })
            };
            let {
                chartMarkets: r,
                nonChartMarkets: a
            } = ((e, t, r) => {
                let a, {
                    sortBy: i = "price"
                } = r ? ? {};
                return ("price" === i ? (a = { ...t,
                    sortBy: i
                }, [...e].map(e => (0, o.parseMarketWithSortKey)(e)).sort((e, t) => (0, s.aggregatedSort)(e, t, a))) : e).reduce((e, t) => {
                    if (t.showGmpSeries) {
                        if (e.chartMarkets.length >= 4) {
                            let t = e.chartMarkets.toReversed().findIndex(e => !e.showGmpSeries);
                            if (-1 !== t) {
                                let r = e.chartMarkets.length - 1 - t,
                                    [a] = e.chartMarkets.splice(r, 1);
                                e.nonChartMarkets.push(a)
                            }
                        }
                        e.chartMarkets.length < 4 ? e.chartMarkets.push(t) : e.nonChartMarkets.push(t)
                    } else e.chartMarkets.length < 4 ? e.chartMarkets.push(t) : e.nonChartMarkets.push(t);
                    return e
                }, {
                    chartMarkets: [],
                    nonChartMarkets: []
                })
            })([...e], u), i = [...a, ...t];
            return {
                lowChanceMarkets: i,
                ...(0, l.getSeriesColors)({
                    markets: r,
                    lowChanceMarkets: i,
                    resolvedMarkets: d,
                    event: u,
                    colors: y
                })
            }
        }, [e, t, d, u, y, h, f]), j = r.default.useMemo(() => [...k, ...w, ...d], [k, w, d]), [C, _] = r.default.useState(() => "single" === h && "single" === f && void 0 !== x && 2 === j.length ? g ? k : [k[x]] : p ? k : k.slice(0, 4)), T = r.default.useRef(k.map(e => e.slug).join(",")), {
            hiddenMarkets: M,
            visibleMarketMap: N,
            hiddenMarketMap: I
        } = r.default.useMemo(() => {
            let e = j.filter(e => !C.some(t => t.slug === e.slug));
            return {
                hiddenMarkets: e,
                visibleMarketMap: C.reduce((e, t, r) => (e[(0, a.getAssetId)(t)] = { ...t,
                    index: r
                }, e), {}),
                hiddenMarketMap: e.reduce((e, t) => (e[(0, a.getAssetId)(t)] = t, e), {})
            }
        }, [C, j]), P = r.default.useMemo(() => {
            let e = { ...S
            };
            return C.forEach(t => {
                delete e[t.color]
            }), e
        }, [C, S]), E = r.default.useCallback((e, t) => {
            "hide" === t && 1 === C.length ? b.info(new n.ToastBuilder().title("At least one option required").description("You cannot remove all options from the chart. Please keep at least one option selected.")) : _(r => {
                if ("show" === t) {
                    let t = e.seriesColor;
                    return t || (t = (0, l.getFirstAvailableColor)(P)), [...r, { ...e,
                        color: e.seriesColor ? ? (0, l.getFirstAvailableColor)(P)
                    }]
                }
                return r.filter(t => t.slug !== e.slug)
            })
        }, [_, P, C]);
        return r.default.useEffect(() => {
            if ("single" === h && "single" === f && void 0 !== x && 2 === j.length) g ? _(() => j) : _(() => [j[x]]);
            else if ("group" === h || void 0 === h) {
                let e = k.map(e => e.slug).join(",");
                e !== T.current && (T.current = e, _(() => p ? k : k.slice(0, 4)))
            }
        }, [h, f, x, g, j, k, p]), r.default.useMemo(() => ({
            visibleMarkets: C,
            hiddenMarkets: M,
            visibleMarketMap: N,
            hiddenMarketMap: I,
            toggleMarket: E,
            colors: y
        }), [C, M, N, I, E, y])
    }, "useConvertBinaryMarketToChartMarkets", 0, e => {
        let r, a = (0, t.c)(25);
        e: {
            let t, i, n, s, o, l;
            if (!e.clobTokenIds) {
                let t;
                a[0] !== e ? (t = [e], a[0] = e, a[1] = t) : t = a[1], r = t;
                break e
            }
            let c = e.outcomes ? .[0],
                d = `${e.slug}-${e.outcomes?.[0]}`;a[2] !== e || a[3] !== c || a[4] !== d ? (t = { ...e,
                sortKey: 1,
                index: 0,
                groupItemTitle: c,
                showGmpSeries: !0,
                seriesColor: "blue",
                slug: d
            }, a[2] = e, a[3] = c, a[4] = d, a[5] = t) : t = a[5];
            let u = `${e.slug}-${e.outcomes?.[1]}`,
                m = e.outcomes ? .[1];a[6] !== e.outcomes ? (i = Array.isArray(e.outcomes) ? e.outcomes.toReversed() : [], a[6] = e.outcomes, a[7] = i) : i = a[7],
            a[8] !== e.outcomePrices ? (n = Array.isArray(e.outcomePrices) ? e.outcomePrices.toReversed() : [], a[8] = e.outcomePrices, a[9] = n) : n = a[9],
            a[10] !== e.clobTokenIds ? (s = Array.isArray(e.clobTokenIds) && {
                clobTokenIds: [e.clobTokenIds[1], e.clobTokenIds[0]]
            }, a[10] = e.clobTokenIds, a[11] = s) : s = a[11];
            let p = e.bestAsk ? 1 - e.bestAsk : null,
                h = e.bestBid ? 1 - e.bestBid : null,
                f = e.lastTradePrice ? 1 - e.lastTradePrice : null;a[12] !== e || a[13] !== h || a[14] !== f || a[15] !== u || a[16] !== m || a[17] !== i || a[18] !== n || a[19] !== s || a[20] !== p ? (o = { ...e,
                sortKey: 2,
                index: 1,
                slug: u,
                groupItemTitle: m,
                outcomes: i,
                outcomePrices: n,
                ...s,
                showGmpSeries: !0,
                bestAsk: p,
                bestBid: h,
                lastTradePrice: f,
                seriesColor: "red"
            }, a[12] = e, a[13] = h, a[14] = f, a[15] = u, a[16] = m, a[17] = i, a[18] = n, a[19] = s, a[20] = p, a[21] = o) : o = a[21],
            a[22] !== o || a[23] !== t ? (l = [t, o], a[22] = o, a[23] = t, a[24] = l) : l = a[24],
            r = l
        }
        return r
    }])
}, 87846, e => {
    "use strict";
    var t = e.i(518321),
        r = e.i(416340);
    e.s(["default", 0, (e, a, i = e => JSON.stringify(e), n = e => JSON.parse(e)) => {
        let [{
            _format: s,
            _parse: o
        }] = (0, r.useState)({
            _format: i,
            _parse: n
        }), [l, c] = (0, t.useCookieState)(a.key, { ...e && {
                defaultValue: s(e)
            },
            ...a.path && {
                path: "/"
            },
            expires: a.expires ? ? 365
        }), d = (0, r.useCallback)(e => {
            c(s(e))
        }, [c, s]);
        return [(0, r.useMemo)(() => l ? o(l) : e, [l, o, e]), d]
    }])
}, 334509, 212858, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(294781),
        a = e.i(416340),
        i = e.i(87846);

    function n(e) {
        return e
    }

    function s(e) {
        return e
    }
    e.s(["useContextChartOptions", 0, e => {
        let o, l, c, d, u, m, p, h, f, x, g, v, y, b, k = (0, t.c)(42);
        k[0] !== e ? (o = void 0 === e ? {} : e, k[0] = e, k[1] = o) : o = k[1];
        let {
            forcedWindow: w,
            initialWindow: S
        } = o, [j, C] = a.default.useState(!1), [_, T] = a.default.useState(!1), [M, N] = a.default.useState(0), [I, P] = a.default.useState(!0), E = (0, r.useRouter)();
        E ? .asPath;
        let A = E ? .asPath ? ? window.location.pathname;
        k[2] !== A ? (c = (l = A.split("?")[0].split("#")[0]).split("/").filter(Boolean), k[2] = A, k[3] = l, k[4] = c) : (l = k[3], c = k[4]);
        let O = c,
            D = O.length ? O[O.length - 1] : l,
            L = `group_chart_window_${D}`;
        k[5] !== L || k[6] !== S ? (d = {
            key: L,
            path: "/",
            defaultValue: S
        }, k[5] = L, k[6] = S, k[7] = d) : d = k[7];
        let [z, R] = (0, i.default)("all", d);
        k[8] === Symbol.for("react.memo_cache_sentinel") ? (u = {
            key: "crypto_chart_type",
            path: "/"
        }, k[8] = u) : u = k[8];
        let [F, $] = (0, i.default)("asset-price", u, n, s);
        k[9] === Symbol.for("react.memo_cache_sentinel") ? (m = {
            key: "group_chart_autoscale",
            path: "/"
        }, k[9] = m) : m = k[9];
        let [B, q] = (0, i.default)(!0, m);
        k[10] === Symbol.for("react.memo_cache_sentinel") ? (p = {
            key: "group_chart_x_axis",
            path: "/"
        }, k[10] = p) : p = k[10];
        let [V, H] = (0, i.default)(!0, p);
        k[11] === Symbol.for("react.memo_cache_sentinel") ? (h = {
            key: "group_chart_y_axis",
            path: "/"
        }, k[11] = h) : h = k[11];
        let [U, W] = (0, i.default)(!0, h);
        k[12] === Symbol.for("react.memo_cache_sentinel") ? (f = {
            key: "group_chart_h_grid",
            path: "/"
        }, k[12] = f) : f = k[12];
        let [G, Z] = (0, i.default)(!0, f);
        k[13] === Symbol.for("react.memo_cache_sentinel") ? (x = {
            key: "group_chart_v_grid",
            path: "/"
        }, k[13] = x) : x = k[13];
        let [K, Y] = (0, i.default)(!1, x);
        k[14] === Symbol.for("react.memo_cache_sentinel") ? (g = {
            key: "group_chart_show_both_outcomes",
            path: "/"
        }, k[14] = g) : g = k[14];
        let [Q, X] = (0, i.default)(!1, g), [J, ee] = a.default.useState(!0);
        k[15] !== S || k[16] !== R ? (v = () => {
            S && R(S)
        }, k[15] = S, k[16] = R, k[17] = v) : v = k[17], k[18] !== S ? (y = [S], k[18] = S, k[19] = y) : y = k[19], a.default.useEffect(v, y);
        let et = w ? ? z;
        return k[20] !== I || k[21] !== B || k[22] !== F || k[23] !== J || k[24] !== G || k[25] !== _ || k[26] !== M || k[27] !== q || k[28] !== $ || k[29] !== Z || k[30] !== X || k[31] !== Y || k[32] !== R || k[33] !== H || k[34] !== W || k[35] !== j || k[36] !== Q || k[37] !== et || k[38] !== K || k[39] !== V || k[40] !== U ? (b = {
            window: et,
            setWindow: R,
            chartType: F,
            setChartType: $,
            autoscale: B,
            setAutoscale: q,
            settingsOpen: j,
            setSettingsOpen: C,
            optionsOpen: _,
            setOptionsOpen: T,
            xAxisVisible: V,
            setXAxisVisible: H,
            yAxisVisible: U,
            setYAxisVisible: W,
            horizontalGridVisible: G,
            setHorizontalGridVisible: Z,
            verticalGridVisible: K,
            setVerticalGridVisible: Y,
            animate: I,
            setAnimate: P,
            selectedAssetIndex: M,
            setSelectedAssetIndex: N,
            showBothOutcomes: Q,
            setShowBothOutcomes: X,
            estimateViewEnabled: J,
            setEstimateViewEnabled: ee
        }, k[20] = I, k[21] = B, k[22] = F, k[23] = J, k[24] = G, k[25] = _, k[26] = M, k[27] = q, k[28] = $, k[29] = Z, k[30] = X, k[31] = Y, k[32] = R, k[33] = H, k[34] = W, k[35] = j, k[36] = Q, k[37] = et, k[38] = K, k[39] = V, k[40] = U, k[41] = b) : b = k[41], b
    }], 334509);
    let o = e => e;
    e.s(["backfillChartData", 0, e => {
        if (0 === e.length) return {
            data: [],
            backfilled: {}
        };
        let t = new Set;
        e.forEach(([, e]) => {
            e.forEach(e => {
                t.add(o(e.time))
            })
        });
        let r = Array.from(t).sort((e, t) => e - t),
            a = e.reduce((e, [t]) => (e[t] = !1, e), {});
        return {
            data: e.map(([e, t]) => {
                let i, n = new Map;
                t.forEach(e => {
                    n.set(o(e.time), e.value)
                });
                let s = [],
                    l = [],
                    c = t.length ? t[0].value : .001;
                for (let t of r) n.has(t) ? (c = n.get(t), s.push({
                    time: o(t),
                    value: c
                }), void 0 === i && (i = t)) : (void 0 === i || t < i) && (a[e] || (a[e] = !0), l.push({
                    time: o(t),
                    value: c
                }), s.push({
                    time: o(t),
                    value: c
                }));
                return [e, s, l]
            }),
            backfilled: a
        }
    }], 212858)
}, 12884, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(754012),
        n = e.i(309865),
        s = e.i(994402),
        o = e.i(390960),
        l = e.i(864006),
        c = e.i(196593),
        d = e.i(715877),
        u = e.i(334509),
        m = e.i(212858),
        p = e.i(483940),
        h = e.i(425010);
    let f = {
            "republican-presidential-nominee-2028": "2025-07-20T00:00:00.000Z",
            "presidential-election-winner-2028": "2025-07-20T00:00:00.000Z",
            "democratic-presidential-nominee-2028": "2025-07-20T00:00:00.000Z",
            "which-party-wins-2028-us-presidential-election": "2025-07-20T00:00:00.000Z",
            "which-party-will-win-the-house-in-2026": "2025-07-20T00:00:00.000Z",
            "which-party-will-win-the-senate-in-2026": "2025-07-20T00:00:00.000Z",
            "balance-of-power-2026-midterms": "2025-07-20T00:00:00.000Z"
        },
        x = e => {
            let {
                colorScheme: t,
                isDark: r = !1,
                shadeArea: a = !1,
                shouldDim: i = !1,
                hoverable: n = !1
            } = e;
            switch (t) {
                case "blue":
                    return (e => {
                        let {
                            isDark: t,
                            shadeArea: r,
                            hoverable: a
                        } = e;
                        return {
                            chart: {},
                            series: { ...r && {
                                    topColor: t ? "rgba(45, 155, 219, 0.2)" : "rgba(22, 82, 240, 0.15)",
                                    bottomColor: "rgba(0, 0, 0, 0)"
                                },
                                ...!r && {
                                    topColor: "rgba(0, 0, 0, 0)",
                                    bottomColor: "rgba(0, 0, 0, 0)"
                                },
                                lineColor: "var(--brand-500)",
                                priceLineColor: "var(--brand-500)",
                                crosshairMarkerBorderColor: "var(--brand-500)",
                                crosshairMarkerBackgroundColor: "var(--brand-500)",
                                baseLineColor: "var(--neutral-50)",
                                ...a && {
                                    enhancedLineColor: "var(--brand-500)",
                                    enhancedTopColor: "rgba(0, 0, 0, 0)",
                                    enhancedBottomColor: "rgba(0, 0, 0, 0)",
                                    fadedLineColor: "var(--neutral-50)",
                                    fadedTopColor: "rgba(0, 0, 0, 0)",
                                    fadedBottomColor: "rgba(0, 0, 0, 0)"
                                }
                            }
                        }
                    })({
                        isDark: r,
                        shadeArea: a,
                        shouldDim: i,
                        hoverable: n
                    });
                case "red":
                    return (e => {
                        let {
                            shadeArea: t,
                            shouldDim: r,
                            hoverable: a
                        } = e;
                        return {
                            chart: {},
                            series: { ...t && {
                                    topColor: "rgba(230, 72, 0, 0.15)",
                                    bottomColor: "rgba(0, 0, 0, 0)"
                                },
                                ...!t && {
                                    topColor: "rgba(0, 0, 0, 0)",
                                    bottomColor: "rgba(0, 0, 0, 0)"
                                },
                                ...r && {
                                    lineColor: "var(--red-400)",
                                    priceLineColor: "var(--red-400)",
                                    crosshairMarkerBorderColor: "var(--red-400)",
                                    crosshairMarkerBackgroundColor: "var(--red-400)",
                                    baseLineColor: "var(--neutral-50)"
                                },
                                ...!r && {
                                    lineColor: "var(--red-600)",
                                    priceLineColor: "var(--red-600)",
                                    crosshairMarkerBorderColor: "var(--red-600)",
                                    crosshairMarkerBackgroundColor: "var(--red-600)",
                                    baseLineColor: "var(--neutral-50)"
                                },
                                ...a && {
                                    enhancedLineColor: "var(--red-600)",
                                    enhancedTopColor: "rgba(0, 0, 0, 0)",
                                    enhancedBottomColor: "rgba(0, 0, 0, 0)",
                                    fadedLineColor: "var(--neutral-50)",
                                    fadedTopColor: "rgba(0, 0, 0, 0)",
                                    fadedBottomColor: "rgba(0, 0, 0, 0)"
                                }
                            }
                        }
                    })({
                        isDark: r,
                        shadeArea: a,
                        shouldDim: i,
                        hoverable: n
                    });
                case "gray":
                    return (e => {
                        let {
                            hoverable: t
                        } = e;
                        return {
                            chart: {},
                            series: {
                                topColor: "rgba(0, 0, 0, 0)",
                                bottomColor: "rgba(0, 0, 0, 0)",
                                lineColor: "var(--neutral-200)",
                                priceLineColor: "var(--neutral-200)",
                                crosshairMarkerBorderColor: "var(--neutral-200)",
                                crosshairMarkerBackgroundColor: "var(--neutral-200)",
                                baseLineColor: "var(--neutral-50)",
                                ...t && {
                                    enhancedLineColor: "var(--neutral-200)",
                                    enhancedTopColor: "rgba(0, 0, 0, 0)",
                                    enhancedBottomColor: "rgba(0, 0, 0, 0)",
                                    fadedLineColor: "var(--neutral-50)",
                                    fadedTopColor: "rgba(0, 0, 0, 0)",
                                    fadedBottomColor: "rgba(0, 0, 0, 0)"
                                }
                            }
                        }
                    })({
                        isDark: r,
                        shadeArea: a,
                        shouldDim: i,
                        hoverable: n
                    });
                default:
                    return {
                        chart: {},
                        series: {}
                    }
            }
        },
        g = (e, t) => t && f[t] ? f[t] : e.acceptingOrders && e.acceptingOrdersTimestamp ? e.acceptingOrdersTimestamp : e.startDate ? ? e.createdAt ? ? void 0,
        v = e => {
            try {
                let t = e.closedTime ? ? void 0;
                if (t) {
                    let [e, r] = t.split(" "), [a] = r.split("+");
                    return `${e}T${a}.000Z`
                }
                return
            } catch {
                return
            }
        };
    var y = e.i(614933),
        b = e.i(318594),
        k = e.i(213333),
        w = e.i(134709),
        S = e.i(510954),
        j = e.i(57096),
        C = e.i(655740),
        _ = e.i(631222),
        T = e.i(254697),
        M = e.i(70549),
        N = e.i(101844),
        I = e.i(817758),
        P = e.i(183592);
    let E = e => {
            switch (e) {
                case "1H":
                    return "1h";
                case "6H":
                    return "6h";
                case "1D":
                    return "1d";
                case "7D":
                    return "1w";
                case "30D":
                    return "1m";
                default:
                    return "all"
            }
        },
        A = {
            ONE_HOUR: {
                threshold: 60,
                fidelity: "1"
            },
            SIX_HOURS: {
                threshold: 360,
                fidelity: "1"
            },
            ONE_DAY: {
                threshold: 1440,
                fidelity: "5"
            },
            HALF_WEEK: {
                threshold: 5040,
                fidelity: "15"
            },
            ONE_WEEK: {
                threshold: 10080,
                fidelity: "30"
            },
            HALF_MONTH: {
                threshold: 21600,
                fidelity: "60"
            },
            ONE_MONTH: {
                threshold: 43200,
                fidelity: "180"
            },
            MAX: {
                threshold: Number.MAX_SAFE_INTEGER,
                fidelity: "720"
            }
        },
        O = e => {
            switch (e) {
                case "1h":
                    return 3600;
                case "6h":
                    return 21600;
                case "1d":
                    return 86400;
                case "1w":
                    return 604800;
                case "1m":
                    return 2592e3;
                default:
                    return 0
            }
        },
        D = async e => {
            let t, r, [a, i, n, s, o, l, c, d, u, m] = e.queryKey;
            "" !== l && (t = parseInt((new Date(l).getTime() / 1e3).toFixed(), 10)), "" !== c && (r = parseInt((new Date(c).getTime() / 1e3).toFixed(), 10)), t && r && r - t > 1209600 && (t = void 0, r = void 0);
            let p = t,
                h = r,
                f = "range" === (d ? ? "");
            if ("all" !== s) {
                let e = Math.floor(Date.now() / 1e3),
                    r = O(s);
                if (r > 0)
                    if (f && h) {
                        let e = h - r;
                        p = Math.max("number" == typeof t ? t : e, e)
                    } else t && (t > e || e - r > t) && (p = void 0)
            }
            p && h && h - p > 1209600 && (f && h ? p = h - 1209600 : (p = void 0, h = void 0));
            let x = u ? _.GAMMA_API_URL : _.CLOB_API_URL,
                g = o;
            if (u) {
                g = "5";
                let e = Math.floor(Date.now() / 1e3);
                p || (p = e - (O(s) || 1209600), h = e);
                let t = h ? ? e;
                t - p > 1209600 && (p = t - 1209600)
            }
            return C.axios.get(((e, t, r = _.CLOB_API_URL, a = !1) => {
                let i = a ? `event_id=${t.market}` : `market=${t.market}`;
                return t.startTs ? t.endTs ? `${r}${e}?startTs=${t.startTs}&${i}&fidelity=${t.fidelity}&endTs=${t.endTs}` : `${r}${e}?startTs=${t.startTs}&${i}&fidelity=${t.fidelity}` : `${r}${e}?interval=${t.interval}&${i}&fidelity=${t.fidelity}`
            })(u ? "/market-estimate-history" : a, {
                market: u ? m : n,
                interval: s,
                fidelity: g,
                startTs: p,
                endTs: p ? h ? ? (u ? Math.floor(Date.now() / 1e3) : void 0) : void 0
            }, x, u)).then(({
                data: e
            }) => e.history.map(e => ({
                time: e.t,
                value: e.p
            })).filter(e => !!e))
        },
        L = ({
            assetId: e,
            window: t,
            startDate: r = "",
            endDate: a = "",
            forcedFidelity: i,
            mode: n,
            hasEstimate: s,
            marketId: o
        }) => {
            let [l, c, d] = (({
                window: e,
                startDate: t,
                endDate: r,
                forcedFidelity: a,
                mode: i
            }) => {
                try {
                    var n, s;
                    let o, l, c = E(e),
                        d = new Date,
                        u = new Date(t);
                    if (r && (d = new Date(r), "range" === i && "all" !== c)) {
                        let e = (0, P.sub)(d, (e => {
                            switch (e) {
                                case "1h":
                                    return {
                                        hours: 1
                                    };
                                case "6h":
                                    return {
                                        hours: 6
                                    };
                                case "1d":
                                    return {
                                        days: 1
                                    };
                                case "1w":
                                    return {
                                        weeks: 1
                                    };
                                default:
                                    return {
                                        months: 1
                                    }
                            }
                        })(c));
                        o = (u = (0, I.max)([u, e])).toString()
                    }
                    let m = t ? (n = d, s = u, l = (0, N.differenceInMilliseconds)(n, s) / M.millisecondsInMinute, (0, T.getRoundingMethod)(void 0)(l)) : void 0;
                    if (!m || a) {
                        let e = a ? ? 10;
                        return [c, Number.isNaN(e) ? "10" : e.toString(), o]
                    }
                    if (r && "range" !== i) return [c, A.MAX.fidelity, o];
                    if ("1h" === c || m < A.ONE_HOUR.threshold) return ["1h", A.ONE_HOUR.fidelity, o];
                    if ("6h" === c || m < A.SIX_HOURS.threshold) return ["6h", A.SIX_HOURS.fidelity, o];
                    if ("1d" === c || m < A.ONE_DAY.threshold) return ["1d", A.ONE_DAY.fidelity, o];
                    if ("1w" === c || m < A.ONE_WEEK.threshold) return ["1w", m < A.HALF_WEEK.threshold ? A.HALF_WEEK.fidelity : A.ONE_WEEK.fidelity, o];
                    if ("1m" === c || m < A.ONE_MONTH.threshold) return ["1m", m < A.HALF_MONTH.threshold ? A.HALF_MONTH.fidelity : A.ONE_MONTH.fidelity, o];
                    return [E(e), A.MAX.fidelity, o]
                } catch {
                    return [E(e), "10", void 0]
                }
            })({
                window: t,
                startDate: r,
                endDate: a,
                forcedFidelity: i,
                mode: n
            });
            return S.queryKeys[j.QueryKey.ClobChart].interval(e, l, c, "range" === n ? d ? ? r : r, a, n, s, o)
        };
    var z = e.i(210308),
        R = e.i(156591);
    let F = (e, t, i) => {
        let n, s, o, l, c, d, u, f, S, j, C, _ = (0, r.c)(49);
        _[0] !== i ? (n = i ? ? {}, _[0] = i, _[1] = n) : n = _[1];
        let {
            autoscale: T,
            window: M,
            backfillData: N,
            mode: I,
            outcomeMode: P,
            eventSlug: E,
            eventId: A,
            useEstimateHistory: O,
            enabled: F,
            gameStartTime: V
        } = n, H = void 0 === T || T, U = void 0 === M ? "1h" : M, W = void 0 === F || F;
        _[2] !== e ? (s = Object.values(e), _[2] = e, _[3] = s) : s = _[3];
        let G = s,
            Z = G.some($);
        _[4] !== G || _[5] !== Z ? (o = {
            markets: G,
            closed: Z
        }, _[4] = G, _[5] = Z, _[6] = o) : o = _[6];
        let {
            markets: K,
            closed: Y
        } = o, {
            assets: Q
        } = ((e, t, r, i = !1, n) => {
            let {
                resolvedTheme: s
            } = (0, h.useTheme)(), o = "dark" === s;
            return a.default.useMemo(() => ({
                assets: e.flatMap((e, a) => "single" === t ? (e => {
                    let {
                        market: t,
                        isDark: r,
                        eventSlug: a,
                        eventId: i
                    } = e;
                    return (Array.isArray(t.outcomes) ? t.outcomes : []).map((e, n) => ({
                        assetId: t.clobTokenIds ? .[n] ? ? "",
                        marketId: i ? ? t.id ? .toString() ? ? "",
                        title: e,
                        outcomeIndex: n,
                        assetIndex: n,
                        colorScheme: 0 === n ? "blue" : "red",
                        startDate: g(t, a),
                        endDate: v(t),
                        seriesOptions: { ...x({
                                colorScheme: 0 === n ? "blue" : "red",
                                isDark: r,
                                shadeArea: !1,
                                shouldDim: !1
                            }).series
                        }
                    }))
                })({
                    market: e,
                    isDark: o,
                    eventSlug: r,
                    eventId: n
                }) : (e => {
                    let {
                        market: t,
                        idx: r,
                        isDark: a,
                        hoverable: i,
                        eventSlug: n,
                        eventId: s
                    } = e, o = x({
                        colorScheme: "blue",
                        isDark: a,
                        shadeArea: !1,
                        shouldDim: !1,
                        hoverable: i
                    }).series;
                    return [{
                        assetId: t.clobTokenIds ? .[0] ? ? "",
                        marketId: s ? ? t.id ? .toString() ? ? "",
                        title: t.groupItemTitle ? ? t.question ? ? "",
                        outcomeIndex: 0,
                        assetIndex: r,
                        colorScheme: "blue",
                        startDate: g(t, n),
                        endDate: v(t),
                        seriesOptions: { ...o
                        }
                    }]
                })({
                    market: e,
                    idx: a,
                    isDark: o,
                    hoverable: i,
                    eventSlug: r,
                    eventId: n
                }))
            }), [e, t, o, r, n])
        })(K, "group", E, !1, A);
        if (_[7] !== Q || _[8] !== V || _[9] !== O || _[10] !== U) {
            e: {
                let e = O ? Q.slice(0, 1) : Q;
                if ("game" === U && V) {
                    let t, r;
                    if (_[12] !== V ? (r = Number.isFinite(t = new Date(V).getTime()), _[12] = V, _[13] = t, _[14] = r) : (t = _[13], r = _[14]), r) {
                        let r = new Date(Math.min(t, Date.now() - 18e5)).toISOString();
                        l = e.map(e => ({ ...e,
                            startDate: r
                        }));
                        break e
                    }
                }
                l = e
            }
            _[7] = Q,
            _[8] = V,
            _[9] = O,
            _[10] = U,
            _[11] = l
        }
        else l = _[11];
        let X = l;
        _[15] !== U ? (c = (0, p.formatWindow)(U), _[15] = U, _[16] = c) : c = _[16], _[17] !== Y ? (d = Y && {
            mode: "range"
        }, _[17] = Y, _[18] = d) : d = _[18], _[19] !== c || _[20] !== d ? (u = {
            window: c,
            ...d
        }, _[19] = c, _[20] = d, _[21] = u) : u = _[21], _[22] !== W || _[23] !== u || _[24] !== O ? (f = {
            intervalOptions: u,
            useEstimateHistory: O,
            enabled: W
        }, _[22] = W, _[23] = u, _[24] = O, _[25] = f) : f = _[25];
        let {
            chartData: J,
            areQueriesPending: ee,
            areQueriesFetching: et
        } = ((e, t) => {
            let {
                intervalOptions: r,
                enabled: i = !0,
                useEstimateHistory: n
            } = t, s = (0, b.useQueryClient)(), o = (0, w.default)(), l = a.default.useMemo(() => e.map(e => s.getQueryData(L({
                assetId: e.assetId,
                window: r.window,
                startDate: e.startDate,
                endDate: e.endDate,
                forcedFidelity: r.fidelity,
                mode: r.mode,
                hasEstimate: n,
                marketId: e.marketId
            }).queryKey)), [s, r, e, n]), c = a.default.useMemo(() => e.map(e => L({
                assetId: e.assetId,
                window: r.window,
                startDate: e.startDate,
                endDate: e.endDate,
                forcedFidelity: r.fidelity,
                mode: r.mode,
                hasEstimate: n,
                marketId: e.marketId
            }).queryKey), [e, r, n]), d = (0, y.useQueries)({
                queries: c.map((t, r) => ({
                    queryKey: t,
                    queryFn: D,
                    enabled: i && Array.isArray(e) && o,
                    refetchOnWindowFocus: !0,
                    refetchOnReconnect: !1,
                    gcTime: 3e5,
                    staleTime: 3e4,
                    refetchInterval: 3e4,
                    initialData: l.length > r ? l[r] : void 0
                }))
            }), u = (0, k.usePrevious)(r.window), m = (0, k.usePrevious)(c), p = a.default.useRef({
                chartData: {},
                areQueriesPending: !1,
                areQueriesFetching: !1
            }), h = d.some(e => e.isFetching), f = p.current.areQueriesPending;
            return h && !f && m && (u !== r.window || m ? .length !== c.length) || (p.current = {
                chartData: e.reduce((e, t, r) => (e[t.assetId] = d[r].data || [], e), {}),
                areQueriesPending: f,
                areQueriesFetching: h
            }), p.current
        })(X, f);
        _[26] !== H || _[27] !== N || _[28] !== J || _[29] !== t || _[30] !== e || _[31] !== I || _[32] !== P || _[33] !== O ? (S = () => {
            let r = Object.entries(J ? ? {}).map(B),
                a = {};
            if (!r.length) return {
                series: [],
                ranges: {},
                backfilledSeries: {}
            };
            if (N) {
                let {
                    data: e,
                    backfilled: t
                } = (0, m.backfillChartData)(r);
                r = e, a = t
            }
            if (r.length > 1) {
                let e = -1 / 0;
                for (let [, t] of r)
                    if (t.length > 0) {
                        let r = t[t.length - 1].time;
                        r > e && (e = r)
                    }
                Number.isFinite(e) && (r = r.map(t => {
                    let [r, a, i] = t;
                    return a.length > 0 && a[a.length - 1].time < e ? [r, [...a, {
                        time: e,
                        value: a[a.length - 1].value
                    }], i] : [r, a, i]
                }))
            }
            if (O) {
                let [e, t, i] = r.reduce(q), n = 1, s = 0;
                return {
                    series: [{
                        id: "estimate",
                        label: "",
                        color: "var(--brand-500)",
                        data: t.map(e => (H && (e.value < n && (n = e.value), e.value > s && (s = e.value)), e)),
                        precision: 2,
                        backfilledData: i.map(e => (H && (e.value < n && (n = e.value), e.value > s && (s = e.value)), e))
                    }],
                    ranges: {
                        [e]: {
                            assetId: e,
                            min: n,
                            max: s
                        }
                    },
                    backfilledSeries: a
                }
            }
            return r.filter(t => {
                let [r] = t;
                return !!e[r]
            }).sort((t, r) => (e[t[0]] ? .index ? ? Number.MAX_SAFE_INTEGER) - (e[r[0]] ? .index ? ? Number.MAX_SAFE_INTEGER)).reduce((r, a) => {
                let [i, n, s] = a, o = e[i];
                if (!o) return r;
                let l = 1,
                    c = 0;
                H || (l = 0, c = 1);
                let d = n.map(e => (H && (e.value < l && (l = e.value), e.value > c && (c = e.value)), e)),
                    u = s.map(e => (H && (e.value < l && (l = e.value), e.value > c && (c = e.value)), e));
                return r.series.push({
                    id: `${i}${"single"===I&&"single"===P?"-single":""}`,
                    label: o.groupItemTitle ? ? i,
                    color: t[o.color] ? .color,
                    data: d,
                    precision: (0, R.getPrecisionFromTickSize)(o.orderPriceMinTickSize),
                    backfilledData: u
                }), r.ranges[i] = {
                    assetId: i,
                    min: l,
                    max: c
                }, r
            }, {
                series: [],
                ranges: {},
                backfilledSeries: a
            })
        }, _[26] = H, _[27] = N, _[28] = J, _[29] = t, _[30] = e, _[31] = I, _[32] = P, _[33] = O, _[34] = S) : S = _[34], _[35] !== Q || _[36] !== H || _[37] !== N || _[38] !== J || _[39] !== t || _[40] !== e || _[41] !== O ? (j = [J, Q, H, e, N, t, O], _[35] = Q, _[36] = H, _[37] = N, _[38] = J, _[39] = t, _[40] = e, _[41] = O, _[42] = j) : j = _[42];
        let {
            series: er,
            ranges: ea,
            backfilledSeries: ei
        } = (0, z.useDeepCompareMemo)(S, j);
        return _[43] !== et || _[44] !== ee || _[45] !== ei || _[46] !== ea || _[47] !== er ? (C = {
            series: er,
            ranges: ea,
            backfilledSeries: ei,
            loading: ee,
            fetching: et
        }, _[43] = et, _[44] = ee, _[45] = ei, _[46] = ea, _[47] = er, _[48] = C) : C = _[48], C
    };

    function $(e) {
        return e.closed
    }

    function B(e) {
        let [t, r] = e;
        return [t, r, []]
    }

    function q(e, t) {
        return t[1].length > e[1].length ? t : e
    }
    var V = e.i(73903);
    let H = a.default.createContext({}),
        U = a.default.createContext({}),
        W = a.default.createContext({}),
        G = e => "number" == typeof e && Number.isFinite(e) ? Math.min(20, Math.max(0, Math.floor(e))) : 0;
    e.s(["ChartContextProvider", 0, function(e) {
        let m, p, h, f, x, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, R = (0, r.c)(154),
            {
                markets: $,
                lowChanceMarkets: B,
                resolvedMarkets: q,
                event: Z,
                options: K,
                customColors: Y,
                children: Q
            } = e,
            X = (0, l.useLocale)();
        R[0] !== X ? (m = (0, o.getDateFnsLocale)(X), R[0] = X, R[1] = m) : m = R[1];
        let J = m,
            {
                colors: ee
            } = (0, V.useChartTheme)(Y),
            et = K.xAxisOffset ? ? 0;
        R[2] !== K || R[3] !== et ? (p = { ...K,
            xAxisOffset: et
        }, R[2] = K, R[3] = et, R[4] = p) : p = R[4];
        let er = p,
            [ea, ei] = a.default.useState(null),
            [en, es] = a.default.useState(!1);
        R[5] !== K.forcedWindow || R[6] !== K.initialWindow ? (h = {
            forcedWindow: K.forcedWindow,
            initialWindow: K.initialWindow
        }, R[5] = K.forcedWindow, R[6] = K.initialWindow, R[7] = h) : h = R[7];
        let {
            window: eo,
            setWindow: el,
            autoscale: ec,
            setAutoscale: ed,
            settingsOpen: eu,
            setSettingsOpen: em,
            optionsOpen: ep,
            setOptionsOpen: eh,
            xAxisVisible: ef,
            setXAxisVisible: ex,
            yAxisVisible: eg,
            setYAxisVisible: ev,
            horizontalGridVisible: ey,
            setHorizontalGridVisible: eb,
            verticalGridVisible: ek,
            setVerticalGridVisible: ew,
            selectedAssetIndex: eS,
            setSelectedAssetIndex: ej,
            showBothOutcomes: eC,
            setShowBothOutcomes: e_,
            estimateViewEnabled: eT,
            setEstimateViewEnabled: eM
        } = (0, u.useContextChartOptions)(h);
        R[8] !== ee || R[9] !== Z || R[10] !== B || R[11] !== $ || R[12] !== er.forceShowAllMarkets || R[13] !== er.mode || R[14] !== er.outcomeMode || R[15] !== q || R[16] !== eS || R[17] !== eC ? (f = {
            markets: $,
            lowChanceMarkets: B,
            resolvedMarkets: q,
            event: Z,
            colors: ee,
            forceShowAllMarkets: er.forceShowAllMarkets,
            mode: er.mode,
            outcomeMode: er.outcomeMode,
            selectedAssetIndex: eS,
            showBothOutcomes: eC
        }, R[8] = ee, R[9] = Z, R[10] = B, R[11] = $, R[12] = er.forceShowAllMarkets, R[13] = er.mode, R[14] = er.outcomeMode, R[15] = q, R[16] = eS, R[17] = eC, R[18] = f) : f = R[18];
        let eN = f,
            {
                visibleMarkets: eI,
                hiddenMarkets: eP,
                visibleMarketMap: eE,
                hiddenMarketMap: eA,
                toggleMarket: eO
            } = (0, d.useChartMarkets)(eN),
            eD = "single" !== K.mode && !!Z.estimateValue && !!Z.estimatedValue && !Z.cantEstimate,
            eL = eD && eT;
        R[19] !== Z.id ? (x = Z.id ? .toString(), R[19] = Z.id, R[20] = x) : x = R[20], R[21] !== ec || R[22] !== Z.slug || R[23] !== K.backfillData || R[24] !== K.gameStartTime || R[25] !== K.mode || R[26] !== K.outcomeMode || R[27] !== x || R[28] !== eL || R[29] !== eo ? (g = {
            autoscale: ec,
            window: eo,
            backfillData: K.backfillData,
            mode: K.mode,
            outcomeMode: K.outcomeMode,
            eventSlug: Z.slug,
            eventId: x,
            useEstimateHistory: eL,
            gameStartTime: K.gameStartTime
        }, R[21] = ec, R[22] = Z.slug, R[23] = K.backfillData, R[24] = K.gameStartTime, R[25] = K.mode, R[26] = K.outcomeMode, R[27] = x, R[28] = eL, R[29] = eo, R[30] = g) : g = R[30];
        let {
            series: ez,
            ranges: eR,
            backfilledSeries: eF,
            loading: e$,
            fetching: eB
        } = F(eE, ee, g);
        R[31] !== ec || R[32] !== eD || R[33] !== Z.slug || R[34] !== K.backfillData || R[35] !== K.gameStartTime || R[36] !== K.mode || R[37] !== K.outcomeMode || R[38] !== eo ? (v = {
            autoscale: ec,
            window: eo,
            backfillData: K.backfillData,
            mode: K.mode,
            outcomeMode: K.outcomeMode,
            eventSlug: Z.slug,
            enabled: eD,
            gameStartTime: K.gameStartTime
        }, R[31] = ec, R[32] = eD, R[33] = Z.slug, R[34] = K.backfillData, R[35] = K.gameStartTime, R[36] = K.mode, R[37] = K.outcomeMode, R[38] = eo, R[39] = v) : v = R[39];
        let {
            series: eq
        } = F(eE, ee, v), eV = eL ? eq : ez, eH = Number(Z.estimatedValue);
        R[40] !== eH ? (y = Number.isFinite(eH) ? eH : void 0, R[40] = eH, R[41] = y) : y = R[41];
        let eU = y;
        if (R[42] !== ez) {
            e: {
                for (let e of ez) {
                    let t = e.data[e.data.length - 1];
                    if (t && Number.isFinite(t.value)) {
                        b = t.value;
                        break e
                    }
                }
                b = void 0
            }
            R[42] = ez,
            R[43] = b
        }
        else b = R[43];
        let eW = b;
        t: {
            if (!eL || void 0 === eU || void 0 === eW || 0 === eW) {
                k = void 0;
                break t
            }
            k = eU / eW
        }
        let eG = k;
        R[44] !== eG || R[45] !== eL ? (w = e => eL && void 0 !== eG ? e * eG : e, R[44] = eG, R[45] = eL, R[46] = w) : w = R[46];
        let eZ = w;
        R[47] !== Z.slug || R[48] !== eZ || R[49] !== eL ? (S = (e, t) => {
            let r = G(void 0 === t ? 0 : t);
            return eL ? ((e, t, r = 0, a = !0) => {
                let i = G(r),
                    n = s.slugToFormat[t];
                if ("usd" === n) return Math.abs(e) >= 1e3 ? `$${(0,c.suffixNumber)(e,!0)}` : (0, c.formatCurrency)(e, {
                    decimals: i
                });
                let o = n ? s.UNIT_LABELS[n] : void 0,
                    l = (0, c.formatNum)(e, {
                        decimals: i,
                        trailingZeros: !1
                    });
                return a && o ? `${l} ${o}` : l
            })(eZ(e), Z.slug, r, !1) : (0, c.formatPercent)(e, {
                decimals: r
            })
        }, R[47] = Z.slug, R[48] = eZ, R[49] = eL, R[50] = S) : S = R[50];
        let eK = S;
        R[51] !== ez ? (j = ez ? ? [], R[51] = ez, R[52] = j) : j = R[52];
        let {
            sideOddsOffset: eY,
            sideOddsLabelOffset: eQ
        } = (0, n.useCalculateLongestSeriesWidth)(j);
        R[53] !== ez ? (C = ez ? ? [], R[53] = ez, R[54] = C) : C = R[54];
        let eX = K.xAxisEnabled && ef,
            eJ = K.yAxisEnabled && eg;
        R[55] !== ec || R[56] !== eF || R[57] !== eD || R[58] !== ee || R[59] !== J || R[60] !== eT || R[61] !== Z || R[62] !== eB || R[63] !== eK || R[64] !== eA || R[65] !== eP || R[66] !== ey || R[67] !== e$ || R[68] !== er || R[69] !== ep || R[70] !== eV || R[71] !== eR || R[72] !== eS || R[73] !== ed || R[74] !== eM || R[75] !== eb || R[76] !== eh || R[77] !== ej || R[78] !== em || R[79] !== e_ || R[80] !== ew || R[81] !== el || R[82] !== ex || R[83] !== ev || R[84] !== eu || R[85] !== eC || R[86] !== eQ || R[87] !== eY || R[88] !== C || R[89] !== eX || R[90] !== eJ || R[91] !== eZ || R[92] !== eO || R[93] !== eL || R[94] !== ek || R[95] !== eE || R[96] !== eI || R[97] !== eo ? (_ = {
            event: Z,
            series: C,
            ranges: eR,
            backfilledSeries: eF,
            autoscale: ec,
            setAutoscale: ed,
            loading: e$,
            fetching: eB,
            window: eo,
            setWindow: el,
            colors: ee,
            toggleMarket: eO,
            settingsOpen: eu,
            setSettingsOpen: em,
            optionsOpen: ep,
            setOptionsOpen: eh,
            visibleMarkets: eI,
            hiddenMarkets: eP,
            xAxisVisible: eX,
            setXAxisVisible: ex,
            yAxisVisible: eJ,
            setYAxisVisible: ev,
            horizontalGridVisible: ey,
            setHorizontalGridVisible: eb,
            verticalGridVisible: ek,
            setVerticalGridVisible: ew,
            visibleMarketMap: eE,
            hiddenMarketMap: eA,
            sideOddsOffset: eY,
            sideOddsLabelOffset: eQ,
            options: er,
            selectedAssetIndex: eS,
            setSelectedAssetIndex: ej,
            showBothOutcomes: eC,
            setShowBothOutcomes: e_,
            useEstimateHistory: eL,
            canShowEstimate: eD,
            estimateViewEnabled: eT,
            setEstimateViewEnabled: eM,
            formatChartValue: eK,
            toDisplayValue: eZ,
            probabilitySeries: eV,
            dateLocale: J
        }, R[55] = ec, R[56] = eF, R[57] = eD, R[58] = ee, R[59] = J, R[60] = eT, R[61] = Z, R[62] = eB, R[63] = eK, R[64] = eA, R[65] = eP, R[66] = ey, R[67] = e$, R[68] = er, R[69] = ep, R[70] = eV, R[71] = eR, R[72] = eS, R[73] = ed, R[74] = eM, R[75] = eb, R[76] = eh, R[77] = ej, R[78] = em, R[79] = e_, R[80] = ew, R[81] = el, R[82] = ex, R[83] = ev, R[84] = eu, R[85] = eC, R[86] = eQ, R[87] = eY, R[88] = C, R[89] = eX, R[90] = eJ, R[91] = eZ, R[92] = eO, R[93] = eL, R[94] = ek, R[95] = eE, R[96] = eI, R[97] = eo, R[98] = _) : _ = R[98];
        let e0 = _;
        R[99] !== eD || R[100] !== eT || R[101] !== Z || R[102] !== er || R[103] !== eS || R[104] !== eM || R[105] !== ej || R[106] !== em || R[107] !== el || R[108] !== eu || R[109] !== eC || R[110] !== eL || R[111] !== eo ? (T = {
            event: Z,
            window: eo,
            setWindow: el,
            options: er,
            settingsOpen: eu,
            setSettingsOpen: em,
            selectedAssetIndex: eS,
            setSelectedAssetIndex: ej,
            showBothOutcomes: eC,
            canShowEstimate: eD,
            estimateViewEnabled: eT,
            setEstimateViewEnabled: eM,
            useEstimateHistory: eL
        }, R[99] = eD, R[100] = eT, R[101] = Z, R[102] = er, R[103] = eS, R[104] = eM, R[105] = ej, R[106] = em, R[107] = el, R[108] = eu, R[109] = eC, R[110] = eL, R[111] = eo, R[112] = T) : T = R[112];
        let e1 = T;
        R[113] !== ea ? (M = {
            hoverData: ea,
            setHoverData: ei
        }, R[113] = ea, R[114] = M) : M = R[114];
        let e2 = M;
        R[115] !== en ? (N = {
            pointerWithin: en,
            setPointerWithin: es
        }, R[115] = en, R[116] = N) : N = R[116];
        let e3 = N,
            e4 = er.xAxisEnabled && ef,
            e5 = er.yAxisEnabled && eg;
        R[117] !== ec || R[118] !== ey || R[119] !== er || R[120] !== ed || R[121] !== eb || R[122] !== eh || R[123] !== em || R[124] !== e_ || R[125] !== ew || R[126] !== ex || R[127] !== ev || R[128] !== eu || R[129] !== eC || R[130] !== e4 || R[131] !== e5 || R[132] !== ek ? (I = {
            autoscale: ec,
            setAutoscale: ed,
            settingsOpen: eu,
            setSettingsOpen: em,
            options: er,
            setOptionsOpen: eh,
            xAxisVisible: e4,
            setXAxisVisible: ex,
            yAxisVisible: e5,
            setYAxisVisible: ev,
            horizontalGridVisible: ey,
            setHorizontalGridVisible: eb,
            verticalGridVisible: ek,
            setVerticalGridVisible: ew,
            showBothOutcomes: eC,
            setShowBothOutcomes: e_
        }, R[117] = ec, R[118] = ey, R[119] = er, R[120] = ed, R[121] = eb, R[122] = eh, R[123] = em, R[124] = e_, R[125] = ew, R[126] = ex, R[127] = ev, R[128] = eu, R[129] = eC, R[130] = e4, R[131] = e5, R[132] = ek, R[133] = I) : I = R[133];
        let e6 = I;
        R[134] !== e$ ? (P = {
            loading: e$,
            setPointerWithin: es
        }, R[134] = e$, R[135] = P) : P = R[135];
        let e9 = P;
        return R[136] !== Q || R[137] !== e0 ? (E = (0, t.jsx)(i.ChartContext.Provider, {
            value: e0,
            children: Q
        }), R[136] = Q, R[137] = e0, R[138] = E) : E = R[138], R[139] !== e9 || R[140] !== E ? (A = (0, t.jsx)(W.Provider, {
            value: e9,
            children: E
        }), R[139] = e9, R[140] = E, R[141] = A) : A = R[141], R[142] !== e6 || R[143] !== A ? (O = (0, t.jsx)(U.Provider, {
            value: e6,
            children: A
        }), R[142] = e6, R[143] = A, R[144] = O) : O = R[144], R[145] !== e1 || R[146] !== O ? (D = (0, t.jsx)(H.Provider, {
            value: e1,
            children: O
        }), R[145] = e1, R[146] = O, R[147] = D) : D = R[147], R[148] !== e3 || R[149] !== D ? (L = (0, t.jsx)(i.ChartPointerContext.Provider, {
            value: e3,
            children: D
        }), R[148] = e3, R[149] = D, R[150] = L) : L = R[150], R[151] !== e2 || R[152] !== L ? (z = (0, t.jsx)(i.ChartHoverContext.Provider, {
            value: e2,
            children: L
        }), R[151] = e2, R[152] = L, R[153] = z) : z = R[153], z
    }, "useChartCanvasContext", 0, () => a.default.useContext(W), "useChartContext", 0, () => a.default.useContext(i.ChartContext), "useChartHoverContext", 0, () => a.default.useContext(i.ChartHoverContext), "useChartNavContext", 0, () => a.default.useContext(H), "useChartSettingsContext", 0, () => a.default.useContext(U)], 12884)
}, 695937, 24781, 100524, 873588, 32183, 146136, 705985, 852967, 302254, e => {
    "use strict";
    var t = e.i(274466),
        r = e.i(416340),
        a = e.i(188734);
    e.s(["useUpdate", 0, function() {
        var e = (0, t.__read)((0, r.useState)({}), 2)[1];
        return (0, a.default)(function() {
            return e({})
        })
    }], 695937);
    var i = e.i(221628),
        n = e.i(999061),
        s = e.i(219469),
        o = e.i(145638),
        l = e.i(299691),
        c = e.i(754012),
        d = e.i(333035),
        u = e.i(215959),
        m = e.i(267905),
        p = e.i(188474);
    let h = e => {
        let t, r, a, s, o, l, c, d, m, h = (0, n.c)(15);
        h[0] !== e ? ({
            ref: s,
            top: l,
            left: c,
            transform: d,
            className: r,
            children: t,
            innerRef: a,
            ...o
        } = e, h[0] = e, h[1] = t, h[2] = r, h[3] = a, h[4] = s, h[5] = o, h[6] = l, h[7] = c, h[8] = d) : (t = h[1], r = h[2], a = h[3], s = h[4], o = h[5], l = h[6], c = h[7], d = h[8]);
        let f = void 0 === l ? 0 : l,
            x = void 0 === c ? 0 : c,
            g = (0, p.useComposedRefs)(s, a),
            v = `translate(${x}, ${f})${d?` ${d}`:""}`;
        return h[9] !== t || h[10] !== r || h[11] !== g || h[12] !== o || h[13] !== v ? (m = (0, i.jsx)(u.motion.g, {
            ref: g,
            className: r,
            transform: v,
            ...o,
            children: t
        }), h[9] = t, h[10] = r, h[11] = g, h[12] = o, h[13] = v, h[14] = m) : m = h[14], m
    };
    h.displayName = "Group";
    let f = e => {
        let t, a, s, o, l, c, d, h, f, x, g, v, y, b, k = (0, n.c)(35);
        k[0] !== e ? ({
            ref: o,
            from: c,
            to: d,
            fill: h,
            className: a,
            innerRef: s,
            animated: f,
            animate: t,
            ...l
        } = e, k[0] = e, k[1] = t, k[2] = a, k[3] = s, k[4] = o, k[5] = l, k[6] = c, k[7] = d, k[8] = h, k[9] = f) : (t = k[1], a = k[2], s = k[3], o = k[4], l = k[5], c = k[6], d = k[7], h = k[8], f = k[9]), k[10] !== c ? (x = void 0 === c ? {
            x: 0,
            y: 0
        } : c, k[10] = c, k[11] = x) : x = k[11];
        let w = x;
        k[12] !== d ? (g = void 0 === d ? {
            x: 1,
            y: 1
        } : d, k[12] = d, k[13] = g) : g = k[13];
        let S = g,
            j = void 0 === h ? "transparent" : h,
            C = void 0 !== f && f,
            _ = (0, p.useComposedRefs)(o, s),
            T = w.x === S.x || w.y === S.y,
            M = (0, m.useAnimationControls)();
        k[14] !== C || k[15] !== M || k[16] !== w.x || k[17] !== w.y || k[18] !== S.x || k[19] !== S.y ? (v = () => {
            C && M.start({
                x1: w.x,
                y1: w.y,
                x2: S.x,
                y2: S.y,
                transition: {
                    type: "tween",
                    duration: 0,
                    ease: "easeOut"
                }
            })
        }, k[14] = C, k[15] = M, k[16] = w.x, k[17] = w.y, k[18] = S.x, k[19] = S.y, k[20] = v) : v = k[20], k[21] !== w || k[22] !== S ? (y = [w, S], k[21] = w, k[22] = S, k[23] = y) : y = k[23], r.default.useEffect(v, y);
        let N = T ? "crispEdges" : "auto",
            I = C ? M : t;
        return k[24] !== a || k[25] !== _ || k[26] !== j || k[27] !== w.x || k[28] !== w.y || k[29] !== l || k[30] !== I || k[31] !== N || k[32] !== S.x || k[33] !== S.y ? (b = (0, i.jsx)(u.motion.line, {
            ref: _,
            className: a,
            x1: w.x,
            y1: w.y,
            x2: S.x,
            y2: S.y,
            fill: j,
            shapeRendering: N,
            animate: I,
            ...l
        }), k[24] = a, k[25] = _, k[26] = j, k[27] = w.x, k[28] = w.y, k[29] = l, k[30] = I, k[31] = N, k[32] = S.x, k[33] = S.y, k[34] = b) : b = k[34], b
    };
    f.displayName = "Line", e.s(["Group", 0, h, "Line", 0, f], 24781);
    var x = e.i(86831);
    let g = "left",
        v = "bottom";
    var y = e.i(57773);

    function b(e) {
        if (("function" == typeof e || "object" == typeof e && e) && "valueOf" in e) {
            var t = e.valueOf();
            if ("number" == typeof t) return t
        }
        return e
    }

    function k(e, t) {
        return "ticks" in e ? e.ticks(t) : e.domain().filter(function(e, r, a) {
            return null == t || a.length <= t || r % Math.round((a.length - 1) / t) == 0
        })
    }
    e.s(["coerceNumber", 0, b], 100524), e.s(["getTicks", 0, k], 873588);
    var w = e.i(583282);
    let S = ({
            x: e,
            y: t
        }, r) => new w.Point(r ? {
            x: e,
            y: t
        } : {
            x: t,
            y: e
        }),
        j = 0;

    function C(e) {
        return null == e ? void 0 : e.toString()
    }
    var _ = e.i(328113),
        T = e.i(475753),
        M = e.i(178918);
    let N = e => 1 === e ? 1 : 1 - 2 ** (-10 * e);
    e.s(["easeOutExpo", 0, N], 32183);
    var I = e.i(962262),
        I = I;
    let P = "__react_svg_text_measurement_id",
        E = (0, I.default)((e, t) => {
            try {
                let r = document.getElementById(P);
                if (!r) {
                    let e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
                    e.setAttribute("aria-hidden", "true"), e.style.width = "0", e.style.height = "0", e.style.position = "absolute", e.style.top = "-100%", e.style.left = "-100%", (r = document.createElementNS("http://www.w3.org/2000/svg", "text")).setAttribute("id", P), e.appendChild(r), document.body.appendChild(e)
                }
                return Object.assign(r.style, t), r.textContent = e, r.getComputedTextLength()
            } catch {
                return null
            }
        }, (e, t) => `${e}_${JSON.stringify(t)}`),
        A = e => "number" == typeof e && Number.isFinite(e) || "string" == typeof e,
        O = {
            overflow: "visible"
        };

    function D(e) {
        let t, a, s, o, l, c, d, m, p, h, f, x, g, v, y, b, k, w, S, j = (0, n.c)(41);
        if (j[0] !== e ? ({
                ref: a,
                ...t
            } = e, j[0] = e, j[1] = t, j[2] = a) : (t = j[1], a = j[2]), j[3] !== t) {
            let {
                dx: e,
                dy: r,
                textAnchor: a,
                innerTextRef: i,
                verticalAnchor: n,
                angle: u,
                lineHeight: g,
                scaleToFit: v,
                capHeight: y,
                width: b,
                animated: k,
                animate: w,
                animationDuration: S,
                ...C
            } = t;
            o = e, l = r, c = a, s = i, d = n, m = g, p = v, h = y, f = S, x = C, j[3] = t, j[4] = s, j[5] = o, j[6] = l, j[7] = c, j[8] = d, j[9] = m, j[10] = p, j[11] = h, j[12] = f, j[13] = x
        } else s = j[4], o = j[5], l = j[6], c = j[7], d = j[8], m = j[9], p = j[10], h = j[11], f = j[12], x = j[13];
        let C = void 0 === o ? 0 : o,
            I = void 0 === l ? 0 : l,
            P = void 0 === c ? "start" : c,
            D = void 0 === f ? .3 : f,
            {
                x: z,
                y: R,
                fontSize: F
            } = x,
            $ = void 0 === z ? 0 : z,
            B = void 0 === R ? 0 : R,
            q = (0, _.useLatest)(D),
            {
                wordsByLines: V
            } = (e => {
                let t, r, a, i, s, o, l, c, d, u, m = (0, n.c)(32);
                if (m[0] !== e) {
                    let {
                        verticalAnchor: n,
                        scaleToFit: o,
                        angle: l,
                        width: c,
                        lineHeight: d,
                        capHeight: u,
                        children: p,
                        style: h,
                        ...f
                    } = e;
                    s = c, t = p, a = h, r = void 0 !== o && o;
                    let {
                        x: x,
                        y: g
                    } = f;
                    i = !A(void 0 === x ? 0 : x) || !A(void 0 === g ? 0 : g), m[0] = e, m[1] = t, m[2] = r, m[3] = a, m[4] = i, m[5] = s
                } else t = m[1], r = m[2], a = m[3], i = m[4], s = m[5];
                let p = i;
                if (m[6] !== t || m[7] !== a) {
                    let e, r = null == t ? [] : t.toString().split(/(?:(?!\u00A0+)\s+)/);
                    m[9] !== a ? (e = e => ({
                        word: e,
                        wordWidth: E(e, a) || 0
                    }), m[9] = a, m[10] = e) : e = m[10], o = r.map(e), m[6] = t, m[7] = a, m[8] = o
                } else o = m[8];
                m[11] !== a ? (l = E(" ", a) || 0, m[11] = a, m[12] = l) : l = m[12], m[13] !== o || m[14] !== l ? (c = {
                    wordsWithWidth: o,
                    spaceWidth: l
                }, m[13] = o, m[14] = l, m[15] = c) : c = m[15];
                let {
                    wordsWithWidth: h,
                    spaceWidth: f
                } = c;
                e: {
                    let e, a;
                    if (p) {
                        let e;
                        m[16] === Symbol.for("react.memo_cache_sentinel") ? (e = [], m[16] = e) : e = m[16], d = e;
                        break e
                    }
                    if (s || r) {
                        let e;
                        if (m[17] !== r || m[18] !== f || m[19] !== s || m[20] !== h) {
                            let t;
                            m[22] !== r || m[23] !== f || m[24] !== s ? (t = (e, t) => {
                                let {
                                    word: a,
                                    wordWidth: i
                                } = t, n = e[e.length - 1];
                                return n && (null == s || r || (n.width || 0) + i + f < s) ? (n.words.push(a), n.width = n.width || 0, n.width = n.width + (i + f)) : e.push({
                                    words: [a],
                                    width: i
                                }), e
                            }, m[22] = r, m[23] = f, m[24] = s, m[25] = t) : t = m[25], e = h.reduce(t, []), m[17] = r, m[18] = f, m[19] = s, m[20] = h, m[21] = e
                        } else e = m[21];
                        d = e;
                        break e
                    }
                    m[26] !== t ? (e = null == t ? [] : t.toString().split(/(?:(?!\u00A0+)\s+)/), m[26] = t, m[27] = e) : e = m[27],
                    m[28] !== e ? (a = [{
                        words: e
                    }], m[28] = e, m[29] = a) : a = m[29],
                    d = a
                }
                let x = d;
                return m[30] !== x ? (u = {
                    wordsByLines: x
                }, m[30] = x, m[31] = u) : u = m[31], u
            })(t),
            H = (0, M.useMotionValue)($),
            U = (0, M.useMotionValue)(B);
        if (j[14] !== q.current || j[15] !== H || j[16] !== $ ? (g = () => {
                (0, T.animate)(H, $ ? ? 0, {
                    type: "tween",
                    duration: q.current ? ? 0,
                    ease: N
                })
            }, j[14] = q.current, j[15] = H, j[16] = $, j[17] = g) : g = j[17], j[18] !== $ ? (v = [$], j[18] = $, j[19] = v) : v = j[19], (0, r.useEffect)(g, v), j[20] !== q.current || j[21] !== U || j[22] !== B ? (y = () => {
                (0, T.animate)(U, B ? ? 0, {
                    type: "tween",
                    duration: q.current ? ? 0,
                    ease: N
                })
            }, j[20] = q.current, j[21] = U, j[22] = B, j[23] = y) : y = j[23], j[24] !== B ? (b = [B], j[24] = B, j[25] = b) : b = j[25], (0, r.useEffect)(y, b), j[26] !== x) {
            let {
                x: e,
                y: t,
                ...r
            } = x;
            k = r, j[26] = x, j[27] = k
        } else k = j[27];
        return j[28] !== s || j[29] !== H || j[30] !== U || j[31] !== P || j[32] !== k || j[33] !== V ? (w = V.length > 0 ? (0, i.jsx)(u.motion.text, {
            layout: "position",
            ref: s,
            ...k,
            textAnchor: P,
            style: {
                x: H,
                y: U
            },
            children: V.map(L)
        }) : null, j[28] = s, j[29] = H, j[30] = U, j[31] = P, j[32] = k, j[33] = V, j[34] = w) : w = j[34], j[35] !== C || j[36] !== I || j[37] !== F || j[38] !== a || j[39] !== w ? (S = (0, i.jsx)("svg", {
            ref: a,
            x: C,
            y: I,
            fontSize: F,
            style: O,
            children: w
        }), j[35] = C, j[36] = I, j[37] = F, j[38] = a, j[39] = w, j[40] = S) : S = j[40], S
    }

    function L(e, t) {
        return (0, i.jsx)("tspan", {
            children: e.words.join(" ")
        }, t)
    }
    var z = e.i(747844);
    let R = e => {
        let t, r, a, s, o, l, c, d, u, m, p, g, v, y, b, k, w, S, j, C, _, T, M = (0, n.c)(44);
        if (M[0] !== e) {
            let {
                ref: i,
                innerRef: n,
                value: h,
                index: f,
                formattedValue: x,
                from: S,
                to: j,
                hide: C,
                hideTicks: _,
                horizontal: T,
                orientation: N,
                tickClassName: I,
                tickComponent: P,
                tickLabelProps: E,
                tickStroke: A,
                tickTransform: O,
                strokeWidth: D,
                tickLineProps: L,
                tickAnimationDuration: z,
                ...R
            } = e;
            d = i, l = f, r = x, a = S, w = j, p = C, s = _, o = T, c = N, y = I, t = E, g = A, k = O, m = D, b = L, v = z, u = R, M[0] = e, M[1] = t, M[2] = r, M[3] = a, M[4] = s, M[5] = o, M[6] = l, M[7] = c, M[8] = d, M[9] = u, M[10] = m, M[11] = p, M[12] = g, M[13] = v, M[14] = y, M[15] = b, M[16] = k, M[17] = w
        } else t = M[1], r = M[2], a = M[3], s = M[4], o = M[5], l = M[6], c = M[7], d = M[8], u = M[9], m = M[10], p = M[11], g = M[12], v = M[13], y = M[14], b = M[15], k = M[16], w = M[17];
        let N = void 0 !== p && p,
            I = void 0 === g ? "#222" : g;
        M[18] !== t || M[19] !== l ? (S = t[l] ? ? {}, M[18] = t, M[19] = l, M[20] = S) : S = M[20];
        let P = S,
            E = Math.max(10, "number" == typeof P.fontSize && P.fontSize || 0),
            A = w.y + (o && "top" !== c ? E : 0);
        return M[21] !== y ? (j = (0, x.cn)("visx-axis-tick", y), M[21] = y, M[22] = j) : j = M[22], M[23] !== a || M[24] !== s || M[25] !== m || M[26] !== b || M[27] !== I || M[28] !== w ? (C = !s && (0, i.jsx)(f, {
            from: a,
            to: w,
            stroke: I,
            strokeWidth: m,
            strokeLinecap: "square",
            ...b
        }), M[23] = a, M[24] = s, M[25] = m, M[26] = b, M[27] = I, M[28] = w, M[29] = C) : C = M[29], M[30] !== r || M[31] !== N || M[32] !== v || M[33] !== P || M[34] !== A || M[35] !== w.x ? (_ = !N && (0, i.jsx)(D, {
            x: w.x,
            y: A,
            animationDuration: v,
            ...P,
            children: r
        }), M[30] = r, M[31] = N, M[32] = v, M[33] = P, M[34] = A, M[35] = w.x, M[36] = _) : _ = M[36], M[37] !== d || M[38] !== u || M[39] !== j || M[40] !== C || M[41] !== _ || M[42] !== k ? (T = (0, i.jsxs)(h, {
            ref: d,
            className: j,
            transform: k,
            ...u,
            children: [C, _]
        }), M[37] = d, M[38] = u, M[39] = j, M[40] = C, M[41] = _, M[42] = k, M[43] = T) : T = M[43], T
    };
    R.displayName = "Tick";
    let F = e => {
            let t, r, a = (0, n.c)(27),
                {
                    hideTicks: o,
                    horizontal: l,
                    orientation: c,
                    tickClassName: d,
                    tickComponent: u,
                    tickLabelProps: m,
                    tickStroke: p,
                    tickTransform: f,
                    ticks: x,
                    strokeWidth: g,
                    tickLineProps: v
                } = e,
                y = void 0 === p ? "#222" : p,
                {
                    tickAnimationDuration: b
                } = (0, z.useAnimationContext)();
            if (a[0] !== m || a[1] !== o || a[2] !== l || a[3] !== c || a[4] !== g || a[5] !== b || a[6] !== d || a[7] !== u || a[8] !== v || a[9] !== y || a[10] !== f || a[11] !== x) {
                let e;
                a[13] !== m || a[14] !== o || a[15] !== l || a[16] !== c || a[17] !== g || a[18] !== b || a[19] !== d || a[20] !== u || a[21] !== v || a[22] !== y || a[23] !== f ? (e = e => {
                    let {
                        value: t,
                        index: r,
                        from: a,
                        to: n,
                        formattedValue: s,
                        hide: p
                    } = e;
                    return (0, i.jsx)(R, {
                        value: t,
                        index: r,
                        formattedValue: s ? ? "",
                        from: a,
                        to: n,
                        hideTicks: o,
                        hide: p,
                        horizontal: l,
                        orientation: c,
                        tickClassName: d,
                        tickComponent: u,
                        tickLabelProps: m,
                        tickStroke: y,
                        tickTransform: f,
                        strokeWidth: g,
                        tickLineProps: v,
                        tickAnimationDuration: b,
                        initial: {
                            opacity: 0
                        },
                        animate: {
                            opacity: 1,
                            transition: {
                                type: "tween",
                                duration: .1,
                                ease: "easeOut",
                                delay: .05
                            }
                        },
                        exit: {
                            opacity: 0,
                            transition: {
                                type: "tween",
                                duration: .1,
                                ease: "easeOut"
                            }
                        }
                    }, `visx-tick-${t}-${r}`)
                }, a[13] = m, a[14] = o, a[15] = l, a[16] = c, a[17] = g, a[18] = b, a[19] = d, a[20] = u, a[21] = v, a[22] = y, a[23] = f, a[24] = e) : e = a[24], t = x.map(e), a[0] = m, a[1] = o, a[2] = l, a[3] = c, a[4] = g, a[5] = b, a[6] = d, a[7] = u, a[8] = v, a[9] = y, a[10] = f, a[11] = x, a[12] = t
            } else t = a[12];
            return a[25] !== t ? (r = (0, i.jsx)(h, {
                children: (0, i.jsx)(s.AnimatePresence, {
                    initial: !1,
                    mode: "popLayout",
                    children: t
                })
            }), a[25] = t, a[26] = r) : r = a[26], r
        },
        $ = {
            width: "auto"
        },
        B = {
            textAnchor: "middle",
            fontFamily: "Arial",
            fontSize: 10,
            fill: "#222"
        },
        q = e => {
            let t, r, a, s, o, l, c, d, u, m = (0, n.c)(47),
                {
                    axisFromPoint: p,
                    axisLineClassName: h,
                    axisToPoint: y,
                    hideAxisLine: b,
                    hideTicks: k,
                    horizontal: w,
                    label: S,
                    labelClassName: j,
                    labelOffset: C,
                    labelProps: _,
                    orientation: T,
                    scale: M,
                    stroke: N,
                    strokeDasharray: I,
                    strokeWidth: P,
                    tickClassName: E,
                    tickComponent: A,
                    tickLineProps: O,
                    tickLabelProps: L,
                    tickLength: z,
                    tickStroke: R,
                    tickTransform: q,
                    ticks: H
                } = e,
                U = void 0 === S ? "" : S,
                W = void 0 === C ? 14 : C,
                G = void 0 === T ? v : T,
                Z = void 0 === N ? "#222" : N,
                K = void 0 === P ? 1 : P,
                Y = void 0 === z ? 8 : z,
                Q = void 0 === R ? "#222" : R;
            m[0] !== _ ? (t = { ...B,
                ..._
            }, m[0] = _, m[1] = t) : t = m[1];
            let X = t,
                J = "object" == typeof L ? L : null;
            m[2] !== J || m[3] !== L || m[4] !== H ? (s = { ...B,
                ...J
            }, a = Math.max(10, ...(r = H.map(e => {
                let {
                    value: t,
                    index: r
                } = e;
                return "function" == typeof L ? L(t, r, H) : s
            })).map(V)), m[2] = J, m[3] = L, m[4] = H, m[5] = r, m[6] = a, m[7] = s) : (r = m[5], a = m[6], s = m[7]);
            let ee = a;
            m[8] !== X || m[9] !== ee || m[10] !== r || m[11] !== s ? (o = {
                combinedLabelProps: X,
                tickLabelPropsDefault: s,
                allTickLabelProps: r,
                maxTickLabelFontSize: ee
            }, m[8] = X, m[9] = ee, m[10] = r, m[11] = s, m[12] = o) : o = m[12];
            let {
                combinedLabelProps: et,
                allTickLabelProps: er,
                maxTickLabelFontSize: ea
            } = o;
            return m[13] !== er || m[14] !== k || m[15] !== w || m[16] !== G || m[17] !== M || m[18] !== K || m[19] !== E || m[20] !== A || m[21] !== O || m[22] !== Q || m[23] !== q || m[24] !== H ? (l = (0, i.jsx)(F, {
                hideTicks: k,
                horizontal: w,
                orientation: G,
                scale: M,
                tickClassName: E,
                tickComponent: A,
                tickStroke: Q,
                tickTransform: q,
                ticks: H,
                strokeWidth: K,
                tickLineProps: O,
                tickLabelProps: er
            }), m[13] = er, m[14] = k, m[15] = w, m[16] = G, m[17] = M, m[18] = K, m[19] = E, m[20] = A, m[21] = O, m[22] = Q, m[23] = q, m[24] = H, m[25] = l) : l = m[25], m[26] !== p || m[27] !== h || m[28] !== y || m[29] !== b || m[30] !== Z || m[31] !== I || m[32] !== K ? (c = !b && (0, i.jsx)(f, {
                className: (0, x.cn)("visx-axis-line", h),
                from: p,
                to: y,
                stroke: Z,
                strokeWidth: K,
                strokeDasharray: I,
                layout: "size",
                style: $,
                animated: !0
            }), m[26] = p, m[27] = h, m[28] = y, m[29] = b, m[30] = Z, m[31] = I, m[32] = K, m[33] = c) : c = m[33], m[34] !== et || m[35] !== U || m[36] !== j || m[37] !== W || m[38] !== ea || m[39] !== G || m[40] !== M || m[41] !== Y ? (d = U && (0, i.jsx)(D, {
                className: (0, x.cn)("visx-axis-label", j),
                ...(({
                    labelOffset: e,
                    labelProps: t,
                    orientation: r,
                    range: a,
                    tickLabelFontSize: i,
                    tickLength: n
                }) => {
                    let s, o, l, c = r === g || "top" === r ? -1 : 1;
                    if ("top" === r || r === v) {
                        let l = r === v && "number" == typeof t.fontSize ? t.fontSize : 0;
                        s = (Number(a[0]) + Number(a[a.length - 1])) / 2, o = c * (n + e + i + l)
                    } else s = c * ((Number(a[0]) + Number(a[a.length - 1])) / 2), o = -(n + e), l = `rotate(${90*c})`;
                    return {
                        x: s,
                        y: o,
                        transform: l
                    }
                })({
                    labelOffset: W,
                    labelProps: et,
                    orientation: G,
                    range: M.range(),
                    tickLabelFontSize: ea,
                    tickLength: Y
                }),
                ...et,
                children: U
            }), m[34] = et, m[35] = U, m[36] = j, m[37] = W, m[38] = ea, m[39] = G, m[40] = M, m[41] = Y, m[42] = d) : d = m[42], m[43] !== l || m[44] !== c || m[45] !== d ? (u = (0, i.jsxs)(i.Fragment, {
                children: [l, c, d]
            }), m[43] = l, m[44] = c, m[45] = d, m[46] = u) : u = m[46], u
        };

    function V(e) {
        return "number" == typeof e.fontSize ? e.fontSize : 0
    }
    let H = e => {
        let t, r, a, s, o, l, c, u, m, p, h, f, w, _, T, M, N, I, P, E, A, O, D, L, z, R, F = (0, n.c)(75);
        F[0] !== e ? ({
            axisClassName: t,
            hideAxisLine: o,
            hideTicks: l,
            hideZero: c,
            innerRef: r,
            left: u,
            numTicks: m,
            orientation: p,
            rangePadding: h,
            scale: s,
            tickFormat: _,
            tickLength: f,
            tickValues: T,
            top: w,
            ...a
        } = e, F[0] = e, F[1] = t, F[2] = r, F[3] = a, F[4] = s, F[5] = o, F[6] = l, F[7] = c, F[8] = u, F[9] = m, F[10] = p, F[11] = h, F[12] = f, F[13] = w, F[14] = _, F[15] = T) : (t = F[1], r = F[2], a = F[3], s = F[4], o = F[5], l = F[6], c = F[7], u = F[8], m = F[9], p = F[10], h = F[11], f = F[12], w = F[13], _ = F[14], T = F[15]);
        let $ = void 0 !== o && o,
            B = void 0 !== l && l,
            V = void 0 !== c && c,
            H = void 0 === u ? 0 : u,
            W = void 0 === m ? 10 : m,
            G = void 0 === p ? v : p,
            Z = void 0 === h ? 0 : h,
            K = void 0 === f ? 8 : f,
            Y = void 0 === w ? 0 : w,
            {
                width: Q,
                margin: X
            } = (0, d.useLineChartContext)();
        if (F[16] !== s || F[17] !== _) {
            var J;
            M = _ ? ? ("tickFormat" in (J = s) ? J.tickFormat() : C), F[16] = s, F[17] = _, F[18] = M
        } else M = F[18];
        let ee = M,
            et = G === g,
            er = "top" === G,
            ea = er || G === v;
        F[19] !== s ? (N = s.range(), F[19] = s, F[20] = N) : N = F[20];
        let ei = N;
        F[21] !== Z ? (I = ((e = j) => "number" == typeof e ? {
            start: e,
            end: e
        } : {
            start: j,
            end: j,
            ...e
        })(Z), F[21] = Z, F[22] = I) : I = F[22];
        let en = I,
            es = Number(ei[0]) + .5 - en.start;
        F[23] !== ea || F[24] !== es ? (P = S({
            x: es,
            y: 0
        }, ea), F[23] = ea, F[24] = es, F[25] = P) : P = F[25];
        let eo = Number(ei[ei.length - 1]) + .5 + en.end;
        F[26] !== ea || F[27] !== eo ? (E = S({
            x: eo,
            y: 0
        }, ea), F[26] = ea, F[27] = eo, F[28] = E) : E = F[28], F[29] !== s ? (A = ((e, t = "center") => {
            if ("start" !== t && "bandwidth" in e) {
                let r = e.bandwidth();
                return "center" === t && (r /= 2), e.round() && (r = Math.round(r)), t => {
                    let a = e(t);
                    return "number" == typeof a ? a + r : a
                }
            }
            return e
        })(s), F[29] = s, F[30] = A) : A = F[30];
        let el = et || er ? -1 : 1;
        F[31] !== P || F[32] !== E || F[33] !== A || F[34] !== el ? (O = {
            axisFromPoint: P,
            axisToPoint: E,
            tickPosition: A,
            tickSign: el
        }, F[31] = P, F[32] = E, F[33] = A, F[34] = el, F[35] = O) : O = F[35];
        let {
            axisFromPoint: ec,
            axisToPoint: ed,
            tickPosition: eu,
            tickSign: em
        } = O;
        if (F[36] !== ee || F[37] !== V || F[38] !== ea || F[39] !== X || F[40] !== W || F[41] !== s || F[42] !== K || F[43] !== eu || F[44] !== em || F[45] !== T || F[46] !== Q) {
            let e;
            F[48] !== V ? (e = e => !V || 0 !== e && "0" !== e, F[48] = V, F[49] = e) : e = F[49];
            let t = (T ? ? k(s, W)).filter(e).map(U);
            D = t.map(e => {
                let {
                    value: r,
                    index: a
                } = e, i = b(eu(r)), n = ee(r, a, t), s = ((n ? ? "").includes(":") ? 6.75 : 6.25) * (n ? ? "").length, o = S({
                    x: i,
                    y: K * em
                }, ea);
                return {
                    value: r,
                    index: a,
                    from: S({
                        x: i,
                        y: 0
                    }, ea),
                    to: o,
                    formattedValue: ee(r, a, t),
                    hide: ea && (o.x <= s / 2 || o.x >= Q - X.right - s / 2)
                }
            }), F[36] = ee, F[37] = V, F[38] = ea, F[39] = X, F[40] = W, F[41] = s, F[42] = K, F[43] = eu, F[44] = em, F[45] = T, F[46] = Q, F[47] = D
        } else D = F[47];
        let ep = D;
        return F[50] !== t ? (L = (0, x.cn)("visx-axis", t), F[50] = t, F[51] = L) : L = F[51], F[52] !== ec || F[53] !== ed || F[54] !== ee || F[55] !== $ || F[56] !== B || F[57] !== V || F[58] !== ea || F[59] !== W || F[60] !== G || F[61] !== Z || F[62] !== a || F[63] !== s || F[64] !== K || F[65] !== eu || F[66] !== em || F[67] !== ep ? (z = (0, i.jsx)(q, { ...a,
            axisFromPoint: ec,
            axisToPoint: ed,
            hideAxisLine: $,
            hideTicks: B,
            hideZero: V,
            horizontal: ea,
            numTicks: W,
            orientation: G,
            rangePadding: Z,
            scale: s,
            tickLength: K,
            tickPosition: eu,
            tickSign: em,
            ticks: ep,
            tickFormat: ee
        }), F[52] = ec, F[53] = ed, F[54] = ee, F[55] = $, F[56] = B, F[57] = V, F[58] = ea, F[59] = W, F[60] = G, F[61] = Z, F[62] = a, F[63] = s, F[64] = K, F[65] = eu, F[66] = em, F[67] = ep, F[68] = z) : z = F[68], F[69] !== r || F[70] !== H || F[71] !== L || F[72] !== z || F[73] !== Y ? (R = (0, i.jsx)(y.Group, {
            className: L,
            innerRef: r,
            top: Y,
            left: H,
            children: z
        }), F[69] = r, F[70] = H, F[71] = L, F[72] = z, F[73] = Y, F[74] = R) : R = F[74], R
    };

    function U(e, t) {
        return {
            value: e,
            index: t
        }
    }
    let W = {
            dy: "0.25em",
            fill: "#222",
            fontFamily: "Arial",
            fontSize: 10,
            textAnchor: "middle"
        },
        G = e => {
            let t, r, a, s, o, l, c, d, u = (0, n.c)(16);
            u[0] !== e ? ({
                axisClassName: t,
                labelOffset: a,
                tickLength: s,
                tickLabelProps: o,
                ...r
            } = e, u[0] = e, u[1] = t, u[2] = r, u[3] = a, u[4] = s, u[5] = o) : (t = u[1], r = u[2], a = u[3], s = u[4], o = u[5]);
            let m = void 0 === a ? 8 : a,
                p = void 0 === s ? 0 : s;
            u[6] !== o ? (l = "function" == typeof o ? o : { ...W,
                ...o
            }, u[6] = o, u[7] = l) : l = u[7];
            let h = l;
            return u[8] !== t ? (c = (0, x.cn)("visx-axis-bottom", t), u[8] = t, u[9] = c) : c = u[9], u[10] !== m || u[11] !== r || u[12] !== c || u[13] !== h || u[14] !== p ? (d = (0, i.jsx)(H, {
                axisClassName: c,
                labelOffset: m,
                orientation: v,
                tickLabelProps: h,
                tickLength: p,
                ...r
            }), u[10] = m, u[11] = r, u[12] = c, u[13] = h, u[14] = p, u[15] = d) : d = u[15], d
        },
        Z = e => {
            let t, r, a, s, o, u, m, p, h, f = (0, n.c)(19);
            if (f[0] !== e) {
                let {
                    ticks: i,
                    scale: n,
                    height: l,
                    width: c,
                    margin: d,
                    tickLabelProps: m,
                    window: p,
                    oddsDisplay: h,
                    ...x
                } = e;
                u = i, s = n, t = l, r = d, o = m, a = x, f[0] = e, f[1] = t, f[2] = r, f[3] = a, f[4] = s, f[5] = o, f[6] = u
            } else t = f[1], r = f[2], a = f[3], s = f[4], o = f[5], u = f[6];
            let {
                xTickMarkFormatter: x
            } = (0, d.useLineChartContext)(), {
                options: g
            } = (0, c.useChartContext)(), {
                xAxisOffset: v
            } = g, {
                annotationMode: y,
                annotations: b,
                xAxisTopOffset: k
            } = (0, l.useAnnotationsContext)();
            f[7] !== o ? (m = {
                fill: "var(--neutral-200)",
                fontSize: 12,
                fontWeight: 400,
                opacity: 1,
                textAnchor: "middle",
                ...o
            }, f[7] = o, f[8] = m) : m = f[8];
            let w = m;
            e: {
                let e;
                if ("bottom-bar" === y && b ? .length) {
                    let e, t = k ? ? 12;
                    f[9] !== t ? (e = {
                        topOffset: t
                    }, f[9] = t, f[10] = e) : e = f[10], p = e;
                    break e
                }
                f[11] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    topOffset: 0
                }, f[11] = e) : e = f[11],
                p = e
            }
            let {
                topOffset: S
            } = p, j = t - r.bottom - r.top + S + v;
            return f[12] !== a || f[13] !== s || f[14] !== j || f[15] !== x || f[16] !== w || f[17] !== u ? (h = (0, i.jsx)(G, {
                top: j,
                left: 0,
                scale: s,
                tickFormat: x,
                stroke: "transparent",
                tickStroke: "transparent",
                tickLabelProps: w,
                tickValues: u,
                hideAxisLine: !0,
                ...a
            }), f[12] = a, f[13] = s, f[14] = j, f[15] = x, f[16] = w, f[17] = u, f[18] = h) : h = f[18], h
        };
    var K = e.i(483940);
    let Y = {
            dx: "0.25em",
            dy: "0.25em",
            fill: "#222",
            fontFamily: "Arial",
            fontSize: 10,
            textAnchor: "start"
        },
        Q = e => {
            let t, r, a, s, o, l, c, d, u = (0, n.c)(16);
            u[0] !== e ? ({
                axisClassName: t,
                labelOffset: a,
                tickLength: s,
                tickLabelProps: o,
                ...r
            } = e, u[0] = e, u[1] = t, u[2] = r, u[3] = a, u[4] = s, u[5] = o) : (t = u[1], r = u[2], a = u[3], s = u[4], o = u[5]);
            let m = void 0 === a ? 36 : a,
                p = void 0 === s ? 8 : s;
            u[6] !== o ? (l = "function" == typeof o ? o : { ...Y,
                ...o
            }, u[6] = o, u[7] = l) : l = u[7];
            let h = l;
            return u[8] !== t ? (c = (0, x.cn)("visx-axis-left", t), u[8] = t, u[9] = c) : c = u[9], u[10] !== m || u[11] !== r || u[12] !== c || u[13] !== h || u[14] !== p ? (d = (0, i.jsx)(H, {
                axisClassName: c,
                labelOffset: m,
                orientation: g,
                tickLabelProps: h,
                tickLength: p,
                ...r
            }), u[10] = m, u[11] = r, u[12] = c, u[13] = h, u[14] = p, u[15] = d) : d = u[15], d
        },
        X = {
            dx: "0.25em",
            dy: "0.25em",
            fill: "#222",
            fontFamily: "Arial",
            fontSize: 10,
            textAnchor: "start"
        },
        J = e => {
            let t, r, a, s, o, l, c, d, u = (0, n.c)(16);
            u[0] !== e ? ({
                axisClassName: t,
                labelOffset: a,
                tickLength: s,
                tickLabelProps: o,
                ...r
            } = e, u[0] = e, u[1] = t, u[2] = r, u[3] = a, u[4] = s, u[5] = o) : (t = u[1], r = u[2], a = u[3], s = u[4], o = u[5]);
            let m = void 0 === a ? 36 : a,
                p = void 0 === s ? 8 : s;
            u[6] !== o ? (l = "function" == typeof o ? o : { ...X,
                ...o
            }, u[6] = o, u[7] = l) : l = u[7];
            let h = l;
            return u[8] !== t ? (c = (0, x.cn)("visx-axis-right", t), u[8] = t, u[9] = c) : c = u[9], u[10] !== m || u[11] !== r || u[12] !== c || u[13] !== h || u[14] !== p ? (d = (0, i.jsx)(H, {
                axisClassName: c,
                labelOffset: m,
                orientation: "right",
                tickLabelProps: h,
                tickLength: p,
                ...r
            }), u[10] = m, u[11] = r, u[12] = c, u[13] = h, u[14] = p, u[15] = d) : d = u[15], d
        },
        ee = e => {
            let t, r, a, s, o, l, d, u, m, p, h = (0, n.c)(25);
            h[0] !== e ? ({
                ticks: l,
                scale: a,
                width: d,
                margin: t,
                tickLabelProps: o,
                orientation: s,
                ...r
            } = e, h[0] = e, h[1] = t, h[2] = r, h[3] = a, h[4] = s, h[5] = o, h[6] = l, h[7] = d) : (t = h[1], r = h[2], a = h[3], s = h[4], o = h[5], l = h[6], d = h[7]);
            let f = void 0 === s ? "right" : s,
                {
                    formatChartValue: x,
                    toDisplayValue: g,
                    useEstimateHistory: v
                } = (0, c.useChartContext)();
            h[8] !== x || h[9] !== a || h[10] !== g || h[11] !== v ? (u = e => {
                if (!v) {
                    let t = a.domain();
                    return (0, K.formatValue)(e.valueOf(), t[1] - t[0] < .02 ? 1 : void 0)
                }
                let t = a.domain(),
                    r = g ? .(t[0]) ? ? t[0],
                    i = g ? .(t[1]) ? ? t[1],
                    n = (0, K.getTickDecimals)(r, i);
                return x ? .(e.valueOf(), n) ? ? (0, K.formatValue)(e.valueOf())
            }, h[8] = x, h[9] = a, h[10] = g, h[11] = v, h[12] = u) : u = h[12];
            let y = u,
                b = "right" === f ? "start" : "end";
            h[13] !== b || h[14] !== o ? (m = {
                fill: "var(--color-text-secondary)",
                fontSize: 12,
                fontWeight: 400,
                opacity: 1,
                textAnchor: b,
                ...o
            }, h[13] = b, h[14] = o, h[15] = m) : m = h[15];
            let k = m;
            return h[16] !== t || h[17] !== f || h[18] !== r || h[19] !== a || h[20] !== y || h[21] !== k || h[22] !== l || h[23] !== d ? (p = "right" === f ? (0, i.jsx)(J, {
                scale: a,
                left: d - t.right - 4,
                tickFormat: y,
                stroke: "transparent",
                tickStroke: "transparent",
                tickLabelProps: k,
                numTicks: 5,
                tickValues: l,
                ...r
            }) : (0, i.jsx)(Q, {
                scale: a,
                left: 15,
                tickFormat: y,
                stroke: "transparent",
                tickStroke: "transparent",
                tickLabelProps: k,
                numTicks: 5,
                tickValues: l,
                ...r
            }), h[16] = t, h[17] = f, h[18] = r, h[19] = a, h[20] = y, h[21] = k, h[22] = l, h[23] = d, h[24] = p) : p = h[24], p
        };
    e.s(["Axes", 0, () => {
        let e, t, a, u, m, p, f, x, g = (0, n.c)(30),
            {
                window: v,
                xAxisVisible: y,
                yAxisVisible: b,
                options: k
            } = (0, c.useChartContext)(),
            {
                annotationMode: w,
                annotations: S
            } = (0, l.useAnnotationsContext)(),
            {
                xAxisScale: j,
                yAxisScale: C,
                yAxisTicks: _,
                xAxisTicks: T,
                width: M,
                height: N,
                margin: I
            } = (0, d.useLineChartContext)(),
            P = (0, o.useIsMobile)(),
            [E, A] = r.default.useState(.3);
        g[0] === Symbol.for("react.memo_cache_sentinel") ? (e = () => {
            let e = setTimeout(() => A(.1), 1e3);
            return () => clearTimeout(e)
        }, t = [], g[0] = e, g[1] = t) : (e = g[0], t = g[1]), r.default.useEffect(e, t);
        let O = "bottom-bar" === w && !!S ? .length;
        e: {
            if (P && T.length > 2) {
                let e, t = T[T.length - 1];
                g[2] !== t || g[3] !== T[0] ? (e = [T[0], t], g[2] = t, g[3] = T[0], g[4] = e) : e = g[4], a = e;
                break e
            }
            a = T
        }
        let D = a;
        return g[5] !== E || g[6] !== D || g[7] !== N || g[8] !== O || g[9] !== I || g[10] !== k || g[11] !== M || g[12] !== v || g[13] !== j || g[14] !== y ? (u = y && (0, i.jsx)(h, {
            initial: {
                opacity: 0,
                height: "auto",
                width: "auto"
            },
            animate: {
                opacity: 1,
                height: "auto",
                width: "auto",
                transition: {
                    opacity: {
                        type: "tween",
                        ease: "easeOut",
                        duration: .2,
                        delay: E
                    }
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    opacity: {
                        type: "tween",
                        ease: "easeOut",
                        duration: .075
                    }
                }
            },
            style: {
                width: "auto",
                height: "auto"
            },
            children: (0, i.jsx)(Z, {
                width: M,
                height: N,
                margin: I,
                window: v,
                ticks: D,
                scale: j,
                hideAxisLine: O,
                oddsDisplay: k.oddsDisplay
            })
        }), g[5] = E, g[6] = D, g[7] = N, g[8] = O, g[9] = I, g[10] = k, g[11] = M, g[12] = v, g[13] = j, g[14] = y, g[15] = u) : u = g[15], g[16] !== u ? (m = (0, i.jsx)(s.AnimatePresence, {
            children: u
        }), g[16] = u, g[17] = m) : m = g[17], g[18] !== I || g[19] !== k || g[20] !== M || g[21] !== C || g[22] !== _ || g[23] !== b ? (p = b && (0, i.jsx)(h, {
            initial: {
                opacity: 0,
                height: "auto",
                width: "auto"
            },
            animate: {
                opacity: 1,
                height: "auto",
                width: "auto",
                transition: {
                    opacity: {
                        type: "tween",
                        ease: "easeOut",
                        duration: .2,
                        delay: .3
                    }
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    opacity: {
                        type: "tween",
                        ease: "easeOut",
                        duration: .075
                    }
                }
            },
            style: {
                width: "auto",
                height: "auto"
            },
            children: (0, i.jsx)(ee, {
                width: M,
                margin: I,
                ticks: _,
                scale: C,
                orientation: k.yAxisOrientation
            })
        }), g[18] = I, g[19] = k, g[20] = M, g[21] = C, g[22] = _, g[23] = b, g[24] = p) : p = g[24], g[25] !== p ? (f = (0, i.jsx)(s.AnimatePresence, {
            children: p
        }), g[25] = p, g[26] = f) : f = g[26], g[27] !== m || g[28] !== f ? (x = (0, i.jsxs)(h, {
            children: [m, f]
        }), g[27] = m, g[28] = f, g[29] = x) : x = g[29], x
    }], 146136);
    var et = e.i(491636),
        er = e.i(85510),
        ea = e.i(847829),
        ei = e.i(197935),
        en = e.i(720959);

    function es() {
        let e, t = (0, n.c)(3),
            {
                options: r,
                sideOddsOffset: a
            } = (0, c.useChartContext)(),
            {
                width: i,
                margin: s
            } = (0, d.useLineChartContext)(),
            o = "side" === r.oddsDisplay ? a : 0,
            l = i - s.right - 12 - o;
        return t[0] !== l || t[1] !== o ? (e = {
            chartEndX: l,
            endOffset: o
        }, t[0] = l, t[1] = o, t[2] = e) : e = t[2], e
    }
    e.s(["useChartBoundary", 0, es], 705985);
    let eo = (e, t) => (0, et.format)(e, "MMM d, yyyy", t ? {
            locale: t
        } : void 0),
        el = e => {
            let t, r, a, o, l, m, p, h, f, x, g = (0, n.c)(29);
            g[0] !== e ? ({
                ref: r,
                date: t,
                ...a
            } = e, g[0] = e, g[1] = t, g[2] = r, g[3] = a) : (t = g[1], r = g[2], a = g[3]);
            let {
                options: v,
                dateLocale: y
            } = (0, c.useChartContext)(), {
                width: b,
                margin: k
            } = (0, d.useLineChartContext)(), {
                resetTooltip: w
            } = (0, ei.useInteractivityContext)(), {
                largestLabelWidth: S
            } = (0, ei.useInteractivityLabelContext)(), {
                tooltipLeft: j
            } = (0, en.useTooltipPositionContext)(), {
                isDragging: C,
                isLocked: _,
                dragAnchorData: T,
                dragAnchorLeft: M,
                clearDrag: N
            } = (0, ea.useDragRangeContext)();
            g[4] !== N || g[5] !== w ? (o = () => {
                N(), w()
            }, g[4] = N, g[5] = w, g[6] = o) : o = g[6];
            let I = o,
                [P, E] = (0, er.useMeasure)(),
                {
                    chartEndX: A
                } = es();
            e: {
                if (v.tooltipOptions ? .mode === "persist") {
                    l = b - 5;
                    break e
                }
                l = b - k.right - k.left - 20
            }
            let O = l,
                D = j <= A,
                L = j > b - k.right - k.left - 16 - S;
            t: {
                let e;
                if (!C || !T ? .[0] ? .point ? .time) {
                    m = null;
                    break t
                }
                let t = 1e3 * T[0].point.time;g[7] !== t ? (e = new Date(t), g[7] = t, g[8] = e) : e = g[8],
                m = e
            }
            let z = m;
            r: {
                let e;
                if (C && z) {
                    let e, r, a = z < t ? z : t,
                        i = z < t ? t : z;
                    g[9] !== y || g[10] !== a ? (e = eo(a, y), g[9] = y, g[10] = a, g[11] = e) : e = g[11], g[12] !== y || g[13] !== i ? (r = eo(i, y), g[12] = y, g[13] = i, g[14] = r) : r = g[14], p = `${e} - ${r}`;
                    break r
                }
                if (g[15] !== t || g[16] !== y) {
                    let r;
                    r = t, e = (0, et.format)(r, "MMM d, h:mm a", y ? {
                        locale: y
                    } : void 0), g[15] = t, g[16] = y, g[17] = e
                } else e = g[17];p = e
            }
            let R = p;
            a: {
                if (C && z) {
                    h = Math.max(0, Math.min((M + j) / 2 - E.width / 2, O));
                    break a
                }
                if (L) {
                    h = Math.min(j - 12 - E.width, O - E.width + 4);
                    break a
                }
                h = Math.min(j + 8, O)
            }
            let F = h;
            return g[18] !== R || g[19] !== I || g[20] !== _ || g[21] !== F || g[22] !== P || g[23] !== r || g[24] !== a || g[25] !== D ? (f = D && (0, i.jsx)(u.motion.div, {
                ref: r,
                initial: {
                    opacity: 0
                },
                animate: {
                    opacity: 1,
                    left: F
                },
                transition: {
                    opacity: {
                        type: "tween",
                        duration: .125,
                        ease: "easeOut",
                        delay: .02
                    },
                    left: {
                        type: "spring",
                        stiffness: 500,
                        damping: 40,
                        mass: .8
                    }
                },
                exit: {
                    opacity: 0,
                    transition: {
                        duration: .15,
                        ease: "easeOut"
                    }
                },
                className: "absolute -top-6 bg-transparent border-none text-text-secondary text-xs font-medium",
                style: {
                    pointerEvents: _ ? "auto" : "none"
                },
                ...a,
                children: (0, i.jsxs)("span", {
                    ref: P,
                    className: "flex items-center whitespace-nowrap gap-1.5",
                    children: [(0, i.jsx)("span", {
                        className: "text-xs text-text-secondary truncate",
                        children: R
                    }), _ && (0, i.jsx)("button", {
                        type: "button",
                        onClick: I,
                        className: "flex items-center justify-center shrink-0 cursor-pointer",
                        style: {
                            width: "20px",
                            height: "20px",
                            padding: 0,
                            border: "none",
                            background: "none",
                            color: "var(--color-primary, #1d1f24)"
                        },
                        children: (0, i.jsx)("svg", {
                            width: "14",
                            height: "14",
                            viewBox: "0 0 12 12",
                            fill: "none",
                            xmlns: "http://www.w3.org/2000/svg",
                            children: (0, i.jsx)("path", {
                                d: "M3 3L9 9M9 3L3 9",
                                stroke: "currentColor",
                                strokeWidth: "1.5",
                                strokeLinecap: "round"
                            })
                        })
                    })]
                })
            }), g[18] = R, g[19] = I, g[20] = _, g[21] = F, g[22] = P, g[23] = r, g[24] = a, g[25] = D, g[26] = f) : f = g[26], g[27] !== f ? (x = (0, i.jsx)(s.AnimatePresence, {
                children: f
            }), g[27] = f, g[28] = x) : x = g[28], x
        };
    el.displayName = "DateTooltip", e.s(["useDateTooltip", 0, () => {
        let e, t = (0, n.c)(4),
            {
                showDateTooltip: r
            } = (0, ei.useInteractivityContext)(),
            {
                tooltipData: a
            } = (0, en.useTooltipLabelDataContext)(),
            s = r && a && a.length > 0 && a[0].point;
        e: {
            let r, n;
            if (!s) {
                e = null;
                break e
            }
            t[0] !== a[0].point ? (r = (0, K.getDate)(a[0].point), t[0] = a[0].point, t[1] = r) : r = t[1],
            t[2] !== r ? (n = (0, i.jsx)(el, {
                date: r
            }), t[2] = r, t[3] = n) : n = t[3],
            e = n
        }
        return e
    }], 852967);
    var ec = e.i(925437);
    let {
        LABEL_HEIGHT: ed,
        BOTTOM_MARGIN: eu,
        TOP_MARGIN: em
    } = ec.SIDE_ODDS_CONSTANTS;

    function ep(e, t) {
        let r = [...e].sort((e, t) => e.y - t.y).map(e => {
                let r = e.y - ed / 2;
                return r = Math.max(r = Math.min(r, t - ed - eu), em), {
                    data: e.data,
                    targetY: e.y,
                    adjustedY: r
                }
            }),
            a = !0,
            i = 0;
        for (; a && i < 10;) {
            a = !1, i++;
            for (let e = 1; e < r.length; e++) {
                let t = r[e],
                    i = r[e - 1],
                    n = i.adjustedY + ec.MIN_DISTANCE - t.adjustedY;
                if (n > 0) {
                    a = !0;
                    let e = n / 2,
                        r = Math.max(em, i.adjustedY - e),
                        s = i.adjustedY - r;
                    i.adjustedY = r, t.adjustedY += n - s
                }
            }
            for (let e = 0; e < r.length; e++) {
                let a = r[e];
                if (a.adjustedY < em) {
                    a.adjustedY = em;
                    for (let t = e + 1; t < r.length; t++) r[t].adjustedY = Math.max(r[t].adjustedY, r[t - 1].adjustedY + ec.MIN_DISTANCE)
                }
                let i = t - ed - eu;
                if (a.adjustedY > i) {
                    a.adjustedY = i;
                    for (let t = e - 1; t >= 0; t--) r[t].adjustedY = Math.min(r[t].adjustedY, r[t + 1].adjustedY - ec.MIN_DISTANCE)
                }
            }
        }
        for (let e = 1; e < r.length; e++) {
            let t = r[e],
                a = r[e - 1].adjustedY + ec.MIN_DISTANCE;
            t.adjustedY < a && (t.adjustedY = a)
        }
        return r
    }

    function eh(e) {
        return null !== e && e.data.point ? .value !== void 0
    }
    let {
        SIDE_ODDS_X_OFFSET: ef
    } = ec.SIDE_ODDS_CONSTANTS;
    var ex = e.i(640793),
        eg = e.i(195859);
    let ev = r.default.memo(({
        data: e,
        adjustedY: t,
        xPosition: a
    }) => {
        let {
            formatChartValue: n
        } = (0, c.useChartContext)(), {
            getVariableColor: s,
            lastPriceColor: o
        } = (0, d.useLineChartContext)(), l = {
            color: r.default.useMemo(() => o ? s(e.point.value) : e.color, [o, e.color, s, e.point.value]),
            WebkitTextStroke: "3px var(--chart-bg, var(--color-background))",
            paintOrder: "stroke fill"
        };
        return (0, i.jsx)(u.motion.div, {
            className: "absolute left-0 top-0 pointer-events-none z-10",
            initial: {
                opacity: 0,
                x: a,
                y: t
            },
            animate: {
                opacity: 1,
                x: a,
                y: t,
                transition: {
                    x: {
                        type: "tween",
                        duration: .2,
                        ease: "easeOut"
                    },
                    y: {
                        type: "tween",
                        duration: .2,
                        ease: "easeOut"
                    },
                    opacity: {
                        duration: .15
                    }
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    duration: .1
                }
            },
            children: (0, i.jsxs)("div", {
                className: "flex flex-col items-start gap-[3.3px]",
                children: [(0, i.jsx)("span", {
                    className: "text-[13px] font-medium leading-[14px] whitespace-nowrap",
                    style: l,
                    children: (0, eg.truncate)(e.label, {
                        length: 35,
                        separator: " "
                    })
                }), (0, i.jsx)("span", {
                    className: "text-[26px] font-semibold leading-none whitespace-nowrap",
                    style: l,
                    children: n ? .(e.point.value, +(3 === e.precision))
                })]
            })
        })
    });
    e.s(["SideOdds", 0, () => {
        let e, t, a, o, l = (0, n.c)(13),
            {
                options: u
            } = (0, c.useChartContext)(),
            {
                height: m,
                margin: p
            } = (0, d.useLineChartContext)(),
            h = function() {
                let e, t, a, i, s, o, l = (0, n.c)(12),
                    {
                        tooltipData: c,
                        tooltipTops: d,
                        tooltipLeft: u
                    } = (0, en.useTooltipPositionContext)();
                l[0] !== c || l[1] !== u || l[2] !== d ? (e = {
                    tooltipData: c,
                    tooltipTops: d,
                    tooltipLeft: u
                }, l[0] = c, l[1] = u, l[2] = d, l[3] = e) : e = l[3];
                let [m, p] = r.default.useState(e);
                l[4] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, ex.throttle)((e, t, r) => {
                    p({
                        tooltipData: e,
                        tooltipTops: t,
                        tooltipLeft: r
                    })
                }, 16), l[4] = t) : t = l[4];
                let h = t;
                return l[5] !== c || l[6] !== u || l[7] !== d ? (a = () => {
                    h(c, d, u)
                }, i = [c, d, u, h], l[5] = c, l[6] = u, l[7] = d, l[8] = a, l[9] = i) : (a = l[8], i = l[9]), r.default.useEffect(a, i), l[10] === Symbol.for("react.memo_cache_sentinel") ? (s = () => () => {
                    h.cancel()
                }, o = [h], l[10] = s, l[11] = o) : (s = l[10], o = l[11]), r.default.useEffect(s, o), m
            }(),
            f = function(e, t) {
                let r, {
                    chartEndX: a
                } = es();
                e: {
                    if (e && void 0 !== t) {
                        r = Math.min(t, a) + ef;
                        break e
                    }
                    r = a + ef
                }
                return r
            }(!!(h.tooltipData ? .length && h.tooltipTops ? .length), h.tooltipLeft),
            x = function(e, t) {
                let r, a = (0, n.c)(17),
                    {
                        options: i,
                        series: s
                    } = (0, c.useChartContext)(),
                    {
                        height: o,
                        margin: l,
                        yAxisScale: u
                    } = (0, d.useLineChartContext)();
                if (a[0] !== o || a[1] !== l || a[2] !== i.mode || a[3] !== i.outcomeMode || a[4] !== s || a[5] !== e || a[6] !== t || a[7] !== u) {
                    e: {
                        let n;
                        if (e ? .length && t ? .length) {
                            let n, s;
                            a[9] !== t ? (n = (e, r) => ({
                                data: e,
                                y: t[r]
                            }), a[9] = t, a[10] = n) : n = a[10], a[11] !== o ? (s = e => {
                                let t = e.y;
                                return t >= 0 && t <= o && e.data.point ? .value !== void 0
                            }, a[11] = o, a[12] = s) : s = a[12];
                            let c = e.map(n).filter(s);
                            if ("single" === i.mode && "single" === i.outcomeMode) {
                                let e = c[0];
                                if (e) {
                                    r = ep([e], o - l.top - l.bottom);
                                    break e
                                }
                            } else if (c.length > 0) {
                                r = ep(c, o - l.top - l.bottom);
                                break e
                            }
                        }
                        if (s.length > 0) {
                            let e;
                            a[13] !== u ? (e = e => {
                                if (e.data.length > 0) {
                                    let t = e.data[e.data.length - 1];
                                    return {
                                        data: {
                                            id: e.id,
                                            label: e.label,
                                            color: e.color,
                                            point: t,
                                            precision: e.precision
                                        },
                                        y: u(t.value)
                                    }
                                }
                                return null
                            }, a[13] = u, a[14] = e) : e = a[14];
                            let t = s.map(e).filter(eh);
                            if ("single" === i.mode && "single" === i.outcomeMode) {
                                let e, i = t[0];
                                if (i) {
                                    r = ep([i], o - l.top - l.bottom);
                                    break e
                                }
                                a[15] === Symbol.for("react.memo_cache_sentinel") ? (e = [], a[15] = e) : e = a[15], r = e;
                                break e
                            }
                            r = ep(t, o - l.top - l.bottom);
                            break e
                        }
                        a[16] === Symbol.for("react.memo_cache_sentinel") ? (n = [], a[16] = n) : n = a[16],
                        r = n
                    }
                    a[0] = o,
                    a[1] = l,
                    a[2] = i.mode,
                    a[3] = i.outcomeMode,
                    a[4] = s,
                    a[5] = e,
                    a[6] = t,
                    a[7] = u,
                    a[8] = r
                }
                else r = a[8];
                return r
            }(h.tooltipData, h.tooltipTops);
        if ("side" !== u.oddsDisplay) return null;
        let g = m - p.top - p.bottom;
        if (l[0] !== p.top || l[1] !== g ? (e = {
                top: p.top,
                height: g
            }, l[0] = p.top, l[1] = g, l[2] = e) : e = l[2], l[3] !== x || l[4] !== f) {
            let e;
            l[6] !== f ? (e = e => (0, i.jsx)(ev, {
                data: e.data,
                adjustedY: e.adjustedY,
                xPosition: f
            }, e.data.id), l[6] = f, l[7] = e) : e = l[7], t = x.map(e), l[3] = x, l[4] = f, l[5] = t
        } else t = l[5];
        return l[8] !== t ? (a = (0, i.jsx)(s.AnimatePresence, {
            mode: "popLayout",
            children: t
        }), l[8] = t, l[9] = a) : a = l[9], l[10] !== e || l[11] !== a ? (o = (0, i.jsx)("div", {
            className: "absolute left-0 w-full pointer-events-none overflow-visible",
            style: e,
            children: a
        }), l[10] = e, l[11] = a, l[12] = o) : o = l[12], o
    }], 302254)
}, 148369, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061);
    e.i(416340), e.s(["TriangleDown", 0, e => {
        let a, i, n = (0, r.c)(3),
            {
                size: s
            } = e,
            o = void 0 === s ? 12 : s;
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("path", {
            d: "M6.51952 9.5C6.28858 9.9 5.71123 9.9 5.48029 9.5L1.84298 3.2C1.61204 2.8 1.90072 2.3 2.3626 2.3L9.63721 2.3C10.0991 2.3 10.3878 2.8 10.1568 3.2L6.51952 9.5Z",
            fill: "currentColor"
        }), n[0] = a) : a = n[0], n[1] !== o ? (i = (0, t.jsx)("svg", {
            width: o,
            height: o,
            viewBox: "0 0 12 12",
            fill: "none",
            xmlns: "http://www.w3.org/2000/svg",
            children: a
        }), n[1] = o, n[2] = i) : i = n[2], i
    }, "TriangleUp", 0, e => {
        let a, i, n = (0, r.c)(3),
            {
                size: s
            } = e,
            o = void 0 === s ? 12 : s;
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("path", {
            d: "M6.51952 2.5C6.28858 2.1 5.71123 2.1 5.48029 2.5L1.84298 8.8C1.61204 9.2 1.90072 9.7 2.3626 9.7L9.63721 9.7C10.0991 9.7 10.3878 9.2 10.1568 8.8L6.51952 2.5Z",
            fill: "currentColor"
        }), n[0] = a) : a = n[0], n[1] !== o ? (i = (0, t.jsx)("svg", {
            width: o,
            height: o,
            viewBox: "0 0 12 12",
            fill: "none",
            xmlns: "http://www.w3.org/2000/svg",
            children: a
        }), n[1] = o, n[2] = i) : i = n[2], i
    }])
}, 51297, (e, t, r) => {
    "use strict";
    r.__esModule = !0, r.default = function(e) {
        var t = e.from,
            r = void 0 === t ? {
                x: 0,
                y: 0
            } : t,
            s = e.to,
            l = void 0 === s ? {
                x: 1,
                y: 1
            } : s,
            c = e.fill,
            d = e.className,
            u = e.innerRef,
            m = function(e, t) {
                if (null == e) return {};
                var r, a, i = {},
                    n = Object.keys(e);
                for (a = 0; a < n.length; a++) r = n[a], t.indexOf(r) >= 0 || (i[r] = e[r]);
                return i
            }(e, n),
            p = r.x === l.x || r.y === l.y;
        return a.default.createElement("line", o({
            ref: u,
            className: (0, i.default)("visx-line", d),
            x1: r.x,
            y1: r.y,
            x2: l.x,
            y2: l.y,
            fill: void 0 === c ? "transparent" : c,
            shapeRendering: p ? "crispEdges" : "auto"
        }, m))
    };
    var a = s(e.r(416340)),
        i = s(e.r(944967)),
        n = ["from", "to", "fill", "className", "innerRef"];

    function s(e) {
        return e && e.__esModule ? e : {
            default: e
        }
    }

    function o() {
        return (o = Object.assign.bind()).apply(this, arguments)
    }
}, 709539, 79478, 54127, 160162, 547525, 929446, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(754012),
        i = e.i(852967),
        n = e.i(302254),
        s = e.i(401527),
        o = e.i(416340),
        l = e.i(688589),
        c = e.i(197935),
        d = e.i(720959),
        u = e.i(333035),
        m = e.i(705985),
        p = e.i(82413),
        h = e.i(213333),
        f = e.i(475753),
        x = e.i(215959),
        g = e.i(112283),
        v = e.i(178918),
        y = e.i(308579),
        b = e.i(847829),
        k = e.i(85510),
        w = e.i(86831),
        S = e.i(148369);
    let j = ({
            left: e,
            bounds: t,
            flipLabel: r,
            maxLeft: a
        }) => r ? Math.min(e - 8 - t.width, a - t.width) : Math.min(e + 8, a),
        C = ({
            ref: e,
            data: r,
            domain: i,
            range: n,
            className: l,
            componentHeight: d,
            adjustedValue: m,
            flipLabel: p,
            maxLeft: C,
            motionLeft: _,
            ...T
        }) => {
            let {
                options: M,
                formatChartValue: N,
                useEstimateHistory: I
            } = (0, a.useChartContext)(), {
                margin: P,
                getVariableColor: E,
                lastPriceColor: A
            } = (0, u.useLineChartContext)(), {
                showDateTooltip: O
            } = (0, c.useInteractivityContext)(), {
                updateLargestLabelWidth: D,
                largestLabelWidth: L
            } = (0, c.useInteractivityLabelContext)(), {
                isDragging: z,
                dragAnchorData: R
            } = (0, b.useDragRangeContext)(), [F, $] = (0, k.useMeasure)(), B = "persist" === M.tooltipOptions.mode ? C + P.right : C, q = (0, v.useMotionValue)(j({
                left: _.get(),
                bounds: $,
                flipLabel: p,
                maxLeft: B
            })), V = (0, v.useMotionValue)(m), H = (0, y.useTransform)(V, i, n), U = g.useMotionTemplate `translateY(${H.get()-10}px)`;
            o.default.useEffect(() => {
                V.set(m)
            }, [m, V, O]);
            let W = (0, h.usePrevious)(p),
                G = o.default.useRef(p);
            (0, s.useMotionValueEvent)(_, "change", e => {
                let t = j({
                    left: e,
                    bounds: $,
                    flipLabel: p,
                    maxLeft: B
                });
                void 0 !== W && W !== p && G.current !== p ? (G.current = p, (0, f.animate)(q, t, {
                    type: "spring",
                    duration: .05,
                    bounce: 0
                })) : q.set(t)
            }), o.default.useEffect(() => {
                D($.width)
            }, [$.width]);
            let Z = o.default.useMemo(() => I ? "var(--brand-500)" : A ? E(r.point.value) : r.color, [I, A, r.color, E, r.point.value]),
                K = o.default.useMemo(() => {
                    if (!z || !R) return null;
                    let e = R.find(e => e.id === r.id);
                    if (!e) return null;
                    let t = r.point.value - e.point.value,
                        a = Math.round(100 * Math.abs(t));
                    return 0 === a ? null : {
                        diff: t,
                        pct: a
                    }
                }, [z, R, r.id, r.point.value]);
            return (0, t.jsx)(x.motion.div, {
                ref: e,
                className: (0, w.cn)("flex absolute overflow-visible pointer-events-none z-2", l),
                style: {
                    transform: U,
                    left: q
                },
                initial: {
                    opacity: 0
                },
                animate: {
                    opacity: 1,
                    transition: {
                        type: "tween",
                        duration: .125,
                        ease: "easeOut",
                        delay: .02
                    }
                },
                exit: {
                    opacity: 0,
                    transition: {
                        duration: 0
                    }
                },
                ...T,
                children: (0, t.jsxs)("div", {
                    ref: F,
                    className: "flex items-center h-5 box-border rounded",
                    style: {
                        backgroundColor: "var(--chart-bg, var(--color-background, white))",
                        border: "1px solid var(--color-border, #e5e5e5)",
                        gap: "4px",
                        paddingRight: "6px",
                        ..."persist" === M.tooltipOptions.mode && !!L && {
                            width: `${L}px`,
                            justifyContent: "center"
                        }
                    },
                    children: [(0, t.jsx)("div", {
                        className: "rounded-sm shrink-0",
                        style: {
                            width: "4px",
                            height: "12px",
                            backgroundColor: Z,
                            marginLeft: "4px"
                        }
                    }), r.label && (0, t.jsx)("p", {
                        className: "text-xs font-semibold capitalize leading-5 truncate p-0",
                        style: {
                            color: "var(--color-primary, #1d1f24)"
                        },
                        children: r.label
                    }), (0, t.jsx)("p", {
                        className: "text-xs font-semibold capitalize leading-5 truncate p-0",
                        style: {
                            color: "var(--color-primary, #1d1f24)"
                        },
                        children: N ? .(r.point.value, +(3 === r.precision))
                    }), K && (0, t.jsxs)("span", {
                        className: "flex items-center shrink-0",
                        style: {
                            color: K.diff >= 0 ? "#22C55E" : "#EF4444",
                            gap: "2px"
                        },
                        children: [K.diff >= 0 ? (0, t.jsx)(S.TriangleUp, {}) : (0, t.jsx)(S.TriangleDown, {}), (0, t.jsxs)("span", {
                            className: "text-xs font-semibold leading-5",
                            children: [K.pct, "%"]
                        })]
                    })]
                })
            })
        };
    C.displayName = "LabelTooltipItem";
    let _ = o.default.memo(C),
        T = (e, t) => e.length === t.length && e.every((e, r) => e === t[r]),
        M = e => {
            let i, n, s, o, l, c, d, u, m, h, f, x, g, v, y, b = (0, r.c)(45);
            if (b[0] !== e) {
                let {
                    ref: t,
                    domain: r,
                    range: a,
                    componentWidth: p,
                    componentHeight: f,
                    margin: x,
                    tooltipData: g,
                    left: v,
                    flipLabel: y,
                    maxLeft: k,
                    motionLeft: w,
                    lastPriceColor: S,
                    ...j
                } = e;
                u = t, n = r, d = a, i = f, h = g, s = y, l = k, c = w, o = S, m = j, b[0] = e, b[1] = i, b[2] = n, b[3] = s, b[4] = o, b[5] = l, b[6] = c, b[7] = d, b[8] = u, b[9] = m, b[10] = h
            } else i = b[1], n = b[2], s = b[3], o = b[4], l = b[5], c = b[6], d = b[7], u = b[8], m = b[9], h = b[10];
            let {
                useEstimateHistory: k
            } = (0, a.useChartContext)();
            b[11] !== n ? (f = n[1] - n[0] == 0 ? [n[0] - .001, n[1] + .001] : n, b[11] = n, b[12] = f) : f = b[12];
            let w = f,
                S = w[1] - w[0],
                j = .1 * S;
            b[13] !== w || b[14] !== j || b[15] !== S ? (x = {
                domain: w,
                rangeOfDomain: S,
                minValueDifferential: j
            }, b[13] = w, b[14] = j, b[15] = S, b[16] = x) : x = b[16];
            let {
                domain: C,
                rangeOfDomain: T,
                minValueDifferential: M
            } = x;
            e: {
                let e;
                if (k) {
                    let e, t = h[0];
                    if (!t) {
                        let e;
                        b[17] === Symbol.for("react.memo_cache_sentinel") ? (e = [], b[17] = e) : e = b[17], g = e;
                        break e
                    }
                    b[18] !== t ? (e = [{ ...t,
                        label: "",
                        adjustedValue: t.point.value
                    }], b[18] = t, b[19] = e) : e = b[19], g = e;
                    break e
                }
                b[20] !== M || b[21] !== T || b[22] !== h ? (e = (0, p.enrichTooltipLabels)({
                    tooltipData: h,
                    rangeOfDomain: T,
                    minValueDifferential: M
                }), b[20] = M, b[21] = T, b[22] = h, b[23] = e) : e = b[23],
                g = e
            }
            let N = g;
            if (b[24] !== i || b[25] !== C || b[26] !== s || b[27] !== o || b[28] !== l || b[29] !== c || b[30] !== d || b[31] !== N) {
                let e;
                b[33] !== i || b[34] !== C || b[35] !== s || b[36] !== o || b[37] !== l || b[38] !== c || b[39] !== d ? (e = e => (0, t.jsx)(_, {
                    id: `label-tooltip-${e.label}`,
                    data: { ...e,
                        color: o ? ? e.color
                    },
                    domain: C,
                    range: d,
                    componentHeight: i,
                    adjustedValue: e.adjustedValue,
                    flipLabel: s,
                    maxLeft: l,
                    motionLeft: c
                }, `label-tooltip-item-${e.id}`), b[33] = i, b[34] = C, b[35] = s, b[36] = o, b[37] = l, b[38] = c, b[39] = d, b[40] = e) : e = b[40], v = N.map(e), b[24] = i, b[25] = C, b[26] = s, b[27] = o, b[28] = l, b[29] = c, b[30] = d, b[31] = N, b[32] = v
            } else v = b[32];
            return b[41] !== u || b[42] !== m || b[43] !== v ? (y = (0, t.jsx)("div", {
                ref: u,
                className: "flex",
                ...m,
                children: v
            }), b[41] = u, b[42] = m, b[43] = v, b[44] = y) : y = b[44], y
        };
    M.displayName = "LabelTooltip";
    let N = o.default.memo(M, (e, t) => e.flipLabel === t.flipLabel && e.maxLeft === t.maxLeft && e.lastPriceColor === t.lastPriceColor && e.motionLeft === t.motionLeft && T(e.domain, t.domain) && T(e.range, t.range) && (0, p.hasSameTooltipData)(e.tooltipData, t.tooltipData));

    function I() {
        let e, i, n, s, o = (0, r.c)(15),
            {
                options: l
            } = (0, a.useChartContext)(),
            {
                tooltipOptions: p
            } = l,
            {
                yAxisScale: h,
                width: f,
                height: x,
                margin: g,
                lastPriceColor: v
            } = (0, u.useLineChartContext)(),
            {
                largestLabelWidth: y
            } = (0, c.useInteractivityLabelContext)(),
            {
                chartEndX: b
            } = (0, m.useChartBoundary)();
        o[0] !== h ? (e = h.domain(), o[0] = h, o[1] = e) : e = o[1];
        let k = e;
        o[2] !== h ? (i = h.range(), o[2] = h, o[3] = i) : i = o[3];
        let w = i;
        e: {
            if ("persist" === p.mode) {
                n = f - 5;
                break e
            }
            n = f - g.right - g.left - 20
        }
        let S = n,
            {
                tooltipLeftMotion: j
            } = (0, d.useTooltipCursorMotionContext)();
        return o[4] !== b || o[5] !== k || o[6] !== x || o[7] !== y || o[8] !== v || o[9] !== g || o[10] !== S || o[11] !== w || o[12] !== j || o[13] !== f ? (s = (0, t.jsx)(P, {
            width: f,
            height: x,
            margin: g,
            domain: k,
            range: w,
            chartEndX: b,
            largestLabelWidth: y,
            maxLeft: S,
            motionLeft: j,
            lastPriceColor: v
        }), o[4] = b, o[5] = k, o[6] = x, o[7] = y, o[8] = v, o[9] = g, o[10] = S, o[11] = w, o[12] = j, o[13] = f, o[14] = s) : s = o[14], s
    }

    function P(e) {
        let a, i, n, l, c, u, m = (0, r.c)(26),
            {
                width: p,
                height: h,
                margin: f,
                domain: x,
                range: g,
                chartEndX: v,
                largestLabelWidth: y,
                maxLeft: b,
                motionLeft: k,
                lastPriceColor: w
            } = e,
            {
                tooltipData: S
            } = (0, d.useTooltipLabelDataContext)(),
            j = p - f.right - f.left - 16 - y;
        m[0] !== k || m[1] !== j ? (a = () => k.get() > j, m[0] = k, m[1] = j, m[2] = a) : a = m[2];
        let [C, _] = o.default.useState(a);
        m[3] !== v || m[4] !== k ? (i = () => k.get() <= v, m[3] = v, m[4] = k, m[5] = i) : i = m[5];
        let [T, M] = o.default.useState(i);
        return m[6] !== v || m[7] !== k || m[8] !== j ? (n = () => {
            let e = k.get();
            _(e > j), M(e <= v)
        }, l = [v, k, j], m[6] = v, m[7] = k, m[8] = j, m[9] = n, m[10] = l) : (n = m[9], l = m[10]), o.default.useEffect(n, l), m[11] !== v || m[12] !== j ? (c = e => {
            let t = e > j,
                r = e <= v;
            _(e => e === t ? e : t), M(e => e === r ? e : r)
        }, m[11] = v, m[12] = j, m[13] = c) : c = m[13], (0, s.useMotionValueEvent)(k, "change", c), m[14] !== x || m[15] !== C || m[16] !== h || m[17] !== w || m[18] !== f || m[19] !== b || m[20] !== k || m[21] !== g || m[22] !== T || m[23] !== S || m[24] !== p ? (u = !!S && !!S ? .length && !!S[0].point && T && (0, t.jsx)("div", {
            className: "z-5",
            children: (0, t.jsx)(N, {
                componentWidth: p,
                componentHeight: h,
                margin: f,
                tooltipData: S,
                domain: x,
                range: g,
                left: k.get(),
                flipLabel: C,
                motionLeft: k,
                maxLeft: b,
                lastPriceColor: w
            }, "label-tooltip")
        }), m[14] = x, m[15] = C, m[16] = h, m[17] = w, m[18] = f, m[19] = b, m[20] = k, m[21] = g, m[22] = T, m[23] = S, m[24] = p, m[25] = u) : u = m[25], u
    }

    function E() {
        let e, a = (0, r.c)(1);
        return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(l.ErrorBoundary, {
            onError: A,
            fallback: (0, t.jsx)(t.Fragment, {}),
            children: (0, t.jsx)(I, {})
        }), a[0] = e) : e = a[0], e
    }

    function A(e, t) {
        return console.error("Error rendering tooltip", {
            error: e,
            errorInfo: t
        })
    }
    I.displayName = "TooltipContent", P.displayName = "TooltipPositionedContent", E.displayName = "Tooltip";
    let O = o.default.memo(E);
    e.s(["ChartOverlays", 0, () => {
        let e, s, o = (0, r.c)(5),
            {
                options: l
            } = (0, a.useChartContext)(),
            c = (0, i.useDateTooltip)();
        return o[0] !== l.oddsDisplay ? (e = "tooltip" === l.oddsDisplay ? (0, t.jsx)(O, {}) : (0, t.jsx)(n.SideOdds, {}), o[0] = l.oddsDisplay, o[1] = e) : e = o[1], o[2] !== c || o[3] !== e ? (s = (0, t.jsxs)(t.Fragment, {
            children: [c, e]
        }), o[2] = c, o[3] = e, o[4] = s) : s = o[4], s
    }], 709539);
    var D = e.i(219469),
        L = e.i(24781);
    let z = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: {
                    type: "tween",
                    duration: .125,
                    ease: "easeOut",
                    delay: .02
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    duration: 0
                }
            }
        },
        R = e => {
            let a, i, n, s, o, l, p, h, f = (0, r.c)(27);
            f[0] !== e ? ({
                ref: a,
                style: n,
                ...i
            } = e, f[0] = e, f[1] = a, f[2] = i, f[3] = n) : (a = f[1], i = f[2], n = f[3]);
            let {
                height: x,
                margin: g
            } = (0, u.useLineChartContext)(), {
                tooltipLeft: v,
                tooltipData: y
            } = (0, d.useTooltipPositionContext)(), {
                showDateTooltip: k
            } = (0, c.useInteractivityContext)(), {
                chartEndX: w
            } = (0, m.useChartBoundary)(), {
                isDragging: S,
                dragAnchorLeft: j
            } = (0, b.useDragRangeContext)(), C = Math.min(v, w), _ = Math.min(j, w), T = v <= w, M = g.top - 28;
            f[4] !== M ? (s = {
                y: M
            }, f[4] = M, f[5] = s) : s = f[5];
            let N = s,
                I = x - g.bottom - 4;
            f[6] !== I ? (o = {
                y: I
            }, f[6] = I, f[7] = o) : o = f[7];
            let P = o;
            return f[8] !== N || f[9] !== P || f[10] !== a || f[11] !== i || f[12] !== T || f[13] !== k || f[14] !== n || f[15] !== y || f[16] !== v || f[17] !== C ? (l = k && !!y && !!v && T && (0, t.jsx)(L.Line, {
                ref: a,
                from: {
                    x: C,
                    ...N
                },
                to: {
                    x: C,
                    ...P
                },
                ...z,
                style: { ...n,
                    pointerEvents: "none"
                },
                stroke: "var(--neutral-50)",
                strokeWidth: 1.5,
                ...i
            }), f[8] = N, f[9] = P, f[10] = a, f[11] = i, f[12] = T, f[13] = k, f[14] = n, f[15] = y, f[16] = v, f[17] = C, f[18] = l) : l = f[18], f[19] !== _ || f[20] !== S || f[21] !== N || f[22] !== P ? (p = S && (0, t.jsx)(L.Line, {
                from: {
                    x: _,
                    ...N
                },
                to: {
                    x: _,
                    ...P
                },
                ...z,
                style: {
                    pointerEvents: "none"
                },
                stroke: "var(--neutral-50)",
                strokeWidth: 1.5
            }), f[19] = _, f[20] = S, f[21] = N, f[22] = P, f[23] = p) : p = f[23], f[24] !== l || f[25] !== p ? (h = (0, t.jsxs)(D.AnimatePresence, {
                children: [l, p]
            }), f[24] = l, f[25] = p, f[26] = h) : h = f[26], h
        };

    function F(e) {
        let a, i, n, s, o, l, p, h, f, g, v = (0, r.c)(24);
        v[0] !== e ? ({
            ref: n,
            id: a,
            idx: i,
            serie: o,
            ...s
        } = e, v[0] = e, v[1] = a, v[2] = i, v[3] = n, v[4] = s, v[5] = o) : (a = v[1], i = v[2], n = v[3], s = v[4], o = v[5]);
        let {
            lastPriceColor: y,
            getVariableColor: b
        } = (0, u.useLineChartContext)(), {
            showDateTooltip: k
        } = (0, c.useInteractivityContext)(), {
            tooltipTops: w,
            tooltipLeft: S,
            tooltipData: j
        } = (0, d.useTooltipPositionContext)(), {
            chartEndX: C
        } = (0, m.useChartBoundary)(), _ = k && S && w && w.length > i ? w[i] : 0;
        v[6] !== a || v[7] !== j ? (l = j ? .find(e => e.id === a), v[6] = a, v[7] = j, v[8] = l) : l = v[8];
        let T = l;
        e: {
            if (!S) {
                p = 0;
                break e
            }
            p = Math.min(S, C)
        }
        let M = p,
            N = j ? .[0] ? .point ? .value;
        t: {
            if (y) {
                let e;
                v[9] !== b || v[10] !== N ? (e = b(N), v[9] = b, v[10] = N, v[11] = e) : e = v[11], h = e;
                break t
            }
            h = o.color
        }
        let I = h;
        return v[12] !== I || v[13] !== a || v[14] !== n || v[15] !== s || v[16] !== k || v[17] !== T || v[18] !== S || v[19] !== _ || v[20] !== M ? (f = k && !!S && !!T && (0, t.jsx)(x.motion.circle, {
            ref: n,
            id: `${a}-tooltip-circle`,
            cx: M,
            cy: _ + 1,
            r: 4,
            fill: I,
            fillOpacity: 1,
            stroke: I,
            strokeOpacity: .1,
            strokeWidth: 2,
            pointerEvents: "none",
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: {
                    type: "tween",
                    duration: .125,
                    ease: "easeOut",
                    delay: .05
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    duration: 0
                }
            },
            ...s
        }), v[12] = I, v[13] = a, v[14] = n, v[15] = s, v[16] = k, v[17] = T, v[18] = S, v[19] = _, v[20] = M, v[21] = f) : f = v[21], v[22] !== f ? (g = (0, t.jsx)(D.AnimatePresence, {
            children: f
        }), v[22] = f, v[23] = g) : g = v[23], g
    }

    function $(e, r) {
        return (0, t.jsx)(F, {
            id: e.id,
            idx: r,
            serie: e
        }, `${e.id}-data-marker-tooltip`)
    }
    R.displayName = "CrosshairTooltip", e.s(["CrosshairTooltip", 0, R], 79478), e.s(["DataMarkerTooltip", 0, () => {
        let e, a, i = (0, r.c)(4),
            {
                series: n
            } = (0, u.useLineChartContext)();
        return i[0] !== n ? (e = n.map($), i[0] = n, i[1] = e) : e = i[1], i[2] !== e ? (a = (0, t.jsx)(t.Fragment, {
            children: e
        }), i[2] = e, i[3] = a) : a = i[3], a
    }], 54127);
    var B = e.i(203537),
        q = e.i(944967),
        V = e.i(51297),
        H = e.i(57773),
        U = e.i(583282),
        W = e.i(873588),
        G = e.i(100524);

    function Z(e) {
        return "bandwidth" in e ? e.bandwidth() : 0
    }
    var K = ["top", "left", "scale", "height", "stroke", "strokeWidth", "strokeDasharray", "className", "numTicks", "lineStyle", "offset", "tickValues", "children"];

    function Y() {
        return (Y = Object.assign.bind()).apply(this, arguments)
    }

    function Q(e) {
        var t = e.top,
            r = e.left,
            a = e.scale,
            i = e.height,
            n = e.stroke,
            s = void 0 === n ? "#eaf0f6" : n,
            l = e.strokeWidth,
            c = void 0 === l ? 1 : l,
            d = e.strokeDasharray,
            u = e.className,
            m = e.numTicks,
            p = e.lineStyle,
            h = e.offset,
            f = e.tickValues,
            x = e.children,
            g = function(e, t) {
                if (null == e) return {};
                var r, a, i = {},
                    n = Object.keys(e);
                for (a = 0; a < n.length; a++) r = n[a], t.indexOf(r) >= 0 || (i[r] = e[r]);
                return i
            }(e, K),
            v = null != f ? f : (0, W.getTicks)(a, void 0 === m ? 10 : m),
            y = (null != h ? h : 0) + Z(a) / 2,
            b = v.map(function(e, t) {
                var r, n = (null != (r = (0, G.coerceNumber)(a(e))) ? r : 0) + y;
                return {
                    index: t,
                    from: new U.Point({
                        x: n,
                        y: 0
                    }),
                    to: new U.Point({
                        x: n,
                        y: i
                    })
                }
            });
        return o.default.createElement(H.Group, {
            className: (0, q.default)("visx-columns", u),
            top: void 0 === t ? 0 : t,
            left: void 0 === r ? 0 : r
        }, x ? x({
            lines: b
        }) : b.map(function(e) {
            var t = e.from,
                r = e.to,
                a = e.index;
            return o.default.createElement(V.default, Y({
                key: "column-line-" + a,
                from: t,
                to: r,
                stroke: s,
                strokeWidth: c,
                strokeDasharray: d,
                style: p
            }, g))
        }))
    }

    function X(e) {
        let a, i, n, s, o, l = (0, r.c)(10);
        return l[0] !== e ? ({
            ref: i,
            enabled: a,
            ...n
        } = e, l[0] = e, l[1] = a, l[2] = i, l[3] = n) : (a = l[1], i = l[2], n = l[3]), l[4] !== a || l[5] !== i || l[6] !== n ? (s = a && (0, t.jsx)(Q, {
            ref: i,
            strokeDasharray: "1,3",
            stroke: "var(--neutral-100)",
            pointerEvents: "none",
            numTicks: 10,
            numOctaves: 10,
            ...n
        }), l[4] = a, l[5] = i, l[6] = n, l[7] = s) : s = l[7], l[8] !== s ? (o = (0, t.jsx)(D.AnimatePresence, {
            children: s
        }), l[8] = s, l[9] = o) : o = l[9], o
    }
    Q.propTypes = {
        tickValues: B.default.array,
        height: B.default.number.isRequired
    };
    var J = ["top", "left", "scale", "width", "stroke", "strokeWidth", "strokeDasharray", "className", "children", "numTicks", "lineStyle", "offset", "tickValues"];

    function ee() {
        return (ee = Object.assign.bind()).apply(this, arguments)
    }

    function et(e) {
        var t = e.top,
            r = e.left,
            a = e.scale,
            i = e.width,
            n = e.stroke,
            s = void 0 === n ? "#eaf0f6" : n,
            l = e.strokeWidth,
            c = void 0 === l ? 1 : l,
            d = e.strokeDasharray,
            u = e.className,
            m = e.children,
            p = e.numTicks,
            h = e.lineStyle,
            f = e.offset,
            x = e.tickValues,
            g = function(e, t) {
                if (null == e) return {};
                var r, a, i = {},
                    n = Object.keys(e);
                for (a = 0; a < n.length; a++) r = n[a], t.indexOf(r) >= 0 || (i[r] = e[r]);
                return i
            }(e, J),
            v = null != x ? x : (0, W.getTicks)(a, void 0 === p ? 10 : p),
            y = (null != f ? f : 0) + Z(a) / 2,
            b = v.map(function(e, t) {
                var r, n = (null != (r = (0, G.coerceNumber)(a(e))) ? r : 0) + y;
                return {
                    index: t,
                    from: new U.Point({
                        x: 0,
                        y: n
                    }),
                    to: new U.Point({
                        x: i,
                        y: n
                    })
                }
            });
        return o.default.createElement(H.Group, {
            className: (0, q.default)("visx-rows", u),
            top: void 0 === t ? 0 : t,
            left: void 0 === r ? 0 : r
        }, m ? m({
            lines: b
        }) : b.map(function(e) {
            var t = e.from,
                r = e.to,
                a = e.index;
            return o.default.createElement(V.default, ee({
                key: "row-line-" + a,
                from: t,
                to: r,
                stroke: s,
                strokeWidth: c,
                strokeDasharray: d,
                style: h
            }, g))
        }))
    }

    function er(e) {
        let a, i, n, s, o, l, c, d, u = (0, r.c)(16);
        return u[0] !== e ? ({
            ref: n,
            enabled: a,
            margin: i,
            width: l,
            scale: o,
            ...s
        } = e, u[0] = e, u[1] = a, u[2] = i, u[3] = n, u[4] = s, u[5] = o, u[6] = l) : (a = u[1], i = u[2], n = u[3], s = u[4], o = u[5], l = u[6]), u[7] !== a || u[8] !== i || u[9] !== n || u[10] !== s || u[11] !== o || u[12] !== l ? (c = a && (0, t.jsx)(x.motion.g, {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1
            },
            exit: {
                opacity: 0
            },
            transition: {
                duration: .3,
                ease: "easeOut"
            },
            children: (0, t.jsx)(et, {
                ref: n,
                left: i.left,
                width: l - i.left - i.right,
                top: 0,
                scale: o,
                strokeDasharray: "1,3",
                stroke: "var(--neutral-300)",
                strokeOpacity: .5,
                pointerEvents: "none",
                ...s
            })
        }), u[7] = a, u[8] = i, u[9] = n, u[10] = s, u[11] = o, u[12] = l, u[13] = c) : c = u[13], u[14] !== c ? (d = (0, t.jsx)(D.AnimatePresence, {
            children: c
        }), u[14] = c, u[15] = d) : d = u[15], d
    }
    et.propTypes = {
        tickValues: B.default.array,
        width: B.default.number.isRequired
    }, e.s(["GroupChartGrid", 0, function() {
        let e, i, n, s = (0, r.c)(14),
            {
                verticalGridVisible: o,
                horizontalGridVisible: l
            } = (0, a.useChartContext)(),
            {
                xAxisScale: c,
                yAxisScale: d,
                yAxisTicks: m,
                width: p,
                height: h,
                margin: f
            } = (0, u.useLineChartContext)();
        return s[0] !== h || s[1] !== l || s[2] !== f || s[3] !== p || s[4] !== d || s[5] !== m ? (e = (0, t.jsx)(er, {
            height: h,
            width: p,
            margin: f,
            scale: d,
            enabled: l,
            tickValues: m
        }), s[0] = h, s[1] = l, s[2] = f, s[3] = p, s[4] = d, s[5] = m, s[6] = e) : e = s[6], s[7] !== h || s[8] !== o || s[9] !== c ? (i = (0, t.jsx)(X, {
            height: h,
            scale: c,
            enabled: o
        }), s[7] = h, s[8] = o, s[9] = c, s[10] = i) : i = s[10], s[11] !== e || s[12] !== i ? (n = (0, t.jsxs)(t.Fragment, {
            children: [e, i]
        }), s[11] = e, s[12] = i, s[13] = n) : n = s[13], n
    }], 160162);
    var ea = e.i(747844),
        ei = e.i(833583),
        en = e.i(483940),
        es = e.i(339393),
        eo = e.i(695937);

    function el(e, t) {
        var r = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
            var a = Object.getOwnPropertySymbols(e);
            t && (a = a.filter(function(t) {
                return Object.getOwnPropertyDescriptor(e, t).enumerable
            })), r.push.apply(r, a)
        }
        return r
    }

    function ec(e) {
        return (ec = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
            return typeof e
        } : function(e) {
            return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
        })(e)
    }

    function ed() {
        return (ed = Object.assign || function(e) {
            for (var t = 1; t < arguments.length; t++) {
                var r = arguments[t];
                for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a])
            }
            return e
        }).apply(this, arguments)
    }

    function eu(e, t) {
        (null == t || t > e.length) && (t = e.length);
        for (var r = 0, a = Array(t); r < t; r++) a[r] = e[r];
        return a
    }

    function em(e, t) {
        var r = "u" > typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
        if (!r) {
            if (Array.isArray(e) || (r = function(e) {
                    if (e) {
                        if ("string" == typeof e) return eu(e, void 0);
                        var t = Object.prototype.toString.call(e).slice(8, -1);
                        if ("Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t) return Array.from(e);
                        if ("Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return eu(e, void 0)
                    }
                }(e)) || t && e && "number" == typeof e.length) {
                r && (e = r);
                var a = 0,
                    i = function() {};
                return {
                    s: i,
                    n: function() {
                        return a >= e.length ? {
                            done: !0
                        } : {
                            done: !1,
                            value: e[a++]
                        }
                    },
                    e: function(e) {
                        throw e
                    },
                    f: i
                }
            }
            throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
        }
        var n, s = !0,
            o = !1;
        return {
            s: function() {
                r = r.call(e)
            },
            n: function() {
                var e = r.next();
                return s = e.done, e
            },
            e: function(e) {
                o = !0, n = e
            },
            f: function() {
                try {
                    s || null == r.return || r.return()
                } finally {
                    if (o) throw n
                }
            }
        }
    }

    function ep(e) {
        var t = {};
        return 4 === e.length && (t.x2 = e[2][0], t.y2 = e[2][1]), e.length >= 3 && (t.x1 = e[1][0], t.y1 = e[1][1]), t.x = e[e.length - 1][0], t.y = e[e.length - 1][1], 4 === e.length ? t.type = "C" : 3 === e.length ? t.type = "Q" : t.type = "L", t
    }
    var eh = /[MLCSTQAHVZmlcstqahv]|-?[\d.e+-]+/g,
        ef = {
            M: ["x", "y"],
            L: ["x", "y"],
            H: ["x"],
            V: ["y"],
            C: ["x1", "y1", "x2", "y2", "x", "y"],
            S: ["x2", "y2", "x", "y"],
            Q: ["x1", "y1", "x", "y"],
            T: ["x", "y"],
            A: ["rx", "ry", "xAxisRotation", "largeArcFlag", "sweepFlag", "x", "y"],
            Z: []
        };

    function ex(e, t) {
        for (var r = Array(e), a = 0; a < e; a++) r[a] = t;
        return r
    }

    function eg(e, t, r) {
        var a = e.length - 1,
            i = t.length - 1,
            n = a / i,
            s = ex(i).reduce(function(t, a, i) {
                var s = Math.floor(n * i);
                return r && s < e.length - 1 && r(e[s], e[s + 1]) && t[s] && (n * i % 1 < .5 ? s > 0 ? s -= 1 : s < e.length - 1 && (s += 1) : s < e.length - 1 ? s += 1 : s > 0 && (s -= 1)), t[s] = (t[s] || 0) + 1, t
            }, []).reduce(function(t, r, a) {
                if (a === e.length - 1) {
                    var i = ex(r, ed({}, e[e.length - 1]));
                    return "M" === i[0].type && i.forEach(function(e) {
                        e.type = "L"
                    }), t.concat(i)
                }
                return t.concat(function(e, t, r) {
                    var a, i = [];
                    if ("L" === t.type || "Q" === t.type || "C" === t.type) i = i.concat((a = [
                        [e.x, e.y]
                    ], null != t.x1 && a.push([t.x1, t.y1]), null != t.x2 && a.push([t.x2, t.y2]), a.push([t.x, t.y]), (function(e, t) {
                        for (var r = [], a = e, i = 1 / (t = t || 2), n = 0; n < t - 1; n++) {
                            var s = function(e, t) {
                                var r = [],
                                    a = [];
                                return e.length && function e(t, i) {
                                    if (1 === t.length) r.push(t[0]), a.push(t[0]);
                                    else {
                                        for (var n = Array(t.length - 1), s = 0; s < n.length; s++) 0 === s && r.push(t[0]), s === n.length - 1 && a.push(t[s + 1]), n[s] = [(1 - i) * t[s][0] + i * t[s + 1][0], (1 - i) * t[s][1] + i * t[s + 1][1]];
                                        e(n, i)
                                    }
                                }(e, t), {
                                    left: r,
                                    right: a.reverse()
                                }
                            }(a, i / (1 - i * n));
                            r.push(s.left), a = s.right
                        }
                        return r.push(a), r
                    })(a, r).map(ep)));
                    else {
                        var n = ed({}, e);
                        "M" === n.type && (n.type = "L"), (i = i.concat(ex(r - 1).map(function() {
                            return n
                        }))).push(t)
                    }
                    return i
                }(e[a], e[a + 1], r))
            }, []);
        return s.unshift(e[0]), s
    }

    function ev(e) {
        for (var t, r, a = (e || "").match(eh) || [], i = [], n = 0; n < a.length; ++n)
            if (t = ef[a[n]]) {
                r = {
                    type: a[n]
                };
                for (var s = 0; s < t.length; ++s) r[t[s]] = +a[n + s + 1];
                n += t.length, i.push(r)
            }
        return i
    }

    function ey(e, t, r) {
        var a = ev(e),
            i = ev(t),
            n = "object" === ec(r) ? r : {
                excludeSegment: r,
                snapEndsToInput: !0
            },
            s = n.excludeSegment,
            o = n.snapEndsToInput;
        if (!a.length && !i.length) return function() {
            return ""
        };
        var l = function(e, t, r) {
            var a = null == e ? [] : e.slice(),
                i = null == t ? [] : t.slice(),
                n = "object" === ec(r) ? r : {
                    excludeSegment: r,
                    snapEndsToInput: !0
                },
                s = n.excludeSegment,
                o = n.snapEndsToInput;
            if (!a.length && !i.length) return function() {
                return []
            };
            var l = (0 === a.length || "Z" === a[a.length - 1].type) && (0 === i.length || "Z" === i[i.length - 1].type);
            a.length > 0 && "Z" === a[a.length - 1].type && a.pop(), i.length > 0 && "Z" === i[i.length - 1].type && i.pop(), a.length ? i.length || i.push(a[0]) : a.push(i[0]), 0 !== Math.abs(i.length - a.length) && (i.length > a.length ? a = eg(a, i, s) : i.length < a.length && (i = eg(i, a, s)));
            var c = (a = a.map(function(e, t) {
                return function(e, t) {
                    var r = {
                            x1: "x",
                            y1: "y",
                            x2: "x",
                            y2: "y"
                        },
                        a = ["xAxisRotation", "largeArcFlag", "sweepFlag"];
                    if (e.type !== t.type && "M" !== t.type.toUpperCase()) {
                        var i = {};
                        Object.keys(t).forEach(function(n) {
                            var s = t[n],
                                o = e[n];
                            void 0 === o && (a.includes(n) ? o = s : (void 0 === o && r[n] && (o = e[r[n]]), void 0 === o && (o = 0))), i[n] = o
                        }), i.type = t.type, e = i
                    }
                    return e
                }(e, i[t])
            })).map(function(e) {
                return function(e) {
                    for (var t = 1; t < arguments.length; t++) {
                        var r = null != arguments[t] ? arguments[t] : {};
                        t % 2 ? el(Object(r), !0).forEach(function(t) {
                            var a, i, n;
                            a = e, i = t, n = r[t], i in a ? Object.defineProperty(a, i, {
                                value: n,
                                enumerable: !0,
                                configurable: !0,
                                writable: !0
                            }) : a[i] = n
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : el(Object(r)).forEach(function(t) {
                            Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t))
                        })
                    }
                    return e
                }({}, e)
            });
            return l && (c.push({
                    type: "Z"
                }), a.push({
                    type: "Z"
                })),
                function(e) {
                    if (1 === e && o) return null == t ? [] : t;
                    if (0 === e) return a;
                    for (var r = 0; r < c.length; ++r) {
                        var n, s = a[r],
                            l = i[r],
                            d = c[r],
                            u = em(ef[d.type]);
                        try {
                            for (u.s(); !(n = u.n()).done;) {
                                var m = n.value;
                                d[m] = (1 - e) * s[m] + e * l[m], ("largeArcFlag" === m || "sweepFlag" === m) && (d[m] = Math.round(d[m]))
                            }
                        } catch (e) {
                            u.e(e)
                        } finally {
                            u.f()
                        }
                    }
                    return c
                }
        }(a, i, {
            excludeSegment: s,
            snapEndsToInput: o
        });
        return function(e) {
            if (1 === e && o) return null == t ? "" : t;
            var r, a = l(e),
                i = "",
                n = em(a);
            try {
                for (n.s(); !(r = n.n()).done;) {
                    var s = r.value;
                    i += function(e) {
                        return "".concat(e.type).concat(ef[e.type].map(function(t) {
                            return e[t]
                        }).join(","))
                    }(s)
                }
            } catch (e) {
                n.e(e)
            } finally {
                n.f()
            }
            return i
        }
    }
    Object.keys(ef).forEach(function(e) {
        ef[e.toLowerCase()] = ef[e]
    });
    var eb = e.i(32183),
        ek = e.i(267905),
        ew = e.i(145638);

    function eS(e) {
        let a, i, n, s, l, c, d, u, m = (0, r.c)(16);
        m[0] !== e ? ({
            ref: i,
            ...a
        } = e, m[0] = e, m[1] = a, m[2] = i) : (a = m[1], i = m[2]);
        let p = (0, ew.useMounted)(),
            h = (0, ek.useAnimationControls)();
        m[3] !== h ? (n = async () => {
            try {
                await h.start({
                    pathOffset: 1,
                    pathLength: .1,
                    transition: {
                        duration: .9,
                        type: "tween",
                        ease: "easeInOut",
                        delay: 1
                    }
                }), await h.start({
                    pathOffset: 1,
                    pathLength: 0,
                    transition: {
                        duration: .1,
                        type: "tween",
                        ease: "easeInOut"
                    }
                }), h.set({
                    strokeOpacity: 0,
                    pathLength: 0,
                    pathOffset: 0
                })
            } catch {}
        }, m[3] = h, m[4] = n) : n = m[4];
        let f = n,
            g = (0, ew.useCallbackRef)(f);
        return m[5] !== g || m[6] !== p ? (s = () => {
            p && g()
        }, m[5] = g, m[6] = p, m[7] = s) : s = m[7], m[8] !== p ? (l = [p], m[8] = p, m[9] = l) : l = m[9], o.default.useEffect(s, l), m[10] === Symbol.for("react.memo_cache_sentinel") ? (c = {
            pathOffset: 0,
            pathLength: 0,
            strokeOpacity: 1
        }, d = {
            strokeOpacity: 0,
            pathLength: 0,
            pathOffset: 0
        }, m[10] = c, m[11] = d) : (c = m[10], d = m[11]), m[12] !== h || m[13] !== a || m[14] !== i ? (u = (0, t.jsx)(x.motion.path, {
            ref: i,
            animate: h,
            initial: c,
            exit: d,
            ...a
        }), m[12] = h, m[13] = a, m[14] = i, m[15] = u) : u = m[15], u
    }
    let ej = (e = -13, t = -13) => `inset(-13px ${e}px -13px ${t}px)`,
        eC = e => {
            let a, i, n, s, l, p, g, k, S, j, C, _, T, M, N, I, P, E, A, O, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er, ea, ei = (0, r.c)(110);
            ei[0] !== e ? ({
                ref: k,
                id: n,
                d: a,
                fullPath: i,
                shortPath: j,
                pathStartX: g,
                stroke: C,
                enabled: _,
                strokeWidth: T,
                onAnimationComplete: p,
                shimmer: M,
                hoverable: N,
                markerEnd: l,
                linearGradientElement: s,
                ...S
            } = e, ei[0] = e, ei[1] = a, ei[2] = i, ei[3] = n, ei[4] = s, ei[5] = l, ei[6] = p, ei[7] = g, ei[8] = k, ei[9] = S, ei[10] = j, ei[11] = C, ei[12] = _, ei[13] = T, ei[14] = M, ei[15] = N) : (a = ei[1], i = ei[2], n = ei[3], s = ei[4], l = ei[5], p = ei[6], g = ei[7], k = ei[8], S = ei[9], j = ei[10], C = ei[11], _ = ei[12], T = ei[13], M = ei[14], N = ei[15]);
            let en = void 0 === _ || _,
                el = void 0 === T ? 1.75 : T,
                ec = void 0 === M || M,
                ed = void 0 === N || N,
                [eu, em] = o.default.useState(!1),
                {
                    width: ep,
                    margin: eh
                } = (0, u.useLineChartContext)(),
                {
                    tooltipLeft: ef
                } = (0, d.useTooltipPositionContext)(),
                {
                    tooltipOpen: ex
                } = (0, c.useInteractivityContext)(),
                {
                    endOffset: eg
                } = (0, m.useChartBoundary)(),
                {
                    isDragging: ev,
                    dragAnchorLeft: ek
                } = (0, b.useDragRangeContext)(),
                ew = a ? ? "";
            ei[16] !== ew ? (I = {
                main: ew
            }, ei[16] = ew, ei[17] = I) : I = ei[17];
            let {
                main: eC
            } = ((e, t = !1) => {
                let r = {
                        main: o.default.useDeferredValue(e.main),
                        backfilledMasked: o.default.useDeferredValue(e.backfilledMasked ? ? ""),
                        backfilledDashed: o.default.useDeferredValue(e.backfilledDashed ? ? "")
                    },
                    a = {
                        main: (0, h.usePrevious)(r.main),
                        backfilledMasked: (0, h.usePrevious)(r.backfilledMasked ? ? r.main),
                        backfilledDashed: (0, h.usePrevious)(r.backfilledDashed ? ? r.main)
                    },
                    i = (0, v.useMotionValue)(1),
                    n = (0, eo.useUpdate)(),
                    s = o.default.useRef({
                        main: [r.main, r.main],
                        backfilledMasked: [r.backfilledMasked, r.backfilledMasked],
                        backfilledDashed: [r.backfilledDashed, r.backfilledDashed]
                    });
                return o.default.useEffect(() => {
                    let e = a.main && a.main !== r.main,
                        o = a.backfilledMasked !== r.backfilledMasked || a.backfilledDashed !== r.backfilledDashed;
                    t && (e || o) && (s.current = {
                        main: [a.main ? ? r.main, r.main],
                        backfilledMasked: [!a.backfilledMasked && r.backfilledMasked ? a.main ? ? r.main : a.backfilledMasked ? ? r.backfilledMasked, r.backfilledMasked],
                        backfilledDashed: [!a.backfilledDashed && r.backfilledDashed ? a.main ? ? r.main : a.backfilledDashed ? ? r.backfilledDashed, r.backfilledDashed]
                    }, i.set(0), n(), (0, f.animate)(i, 1, {
                        duration: .42,
                        ease: eb.easeOutExpo
                    }))
                }, [r.main, r.backfilledMasked, r.backfilledDashed]), o.default.useEffect(() => {
                    t || (s.current = {
                        main: [r.main, r.main],
                        backfilledMasked: [r.backfilledMasked, r.backfilledMasked],
                        backfilledDashed: [r.backfilledDashed, r.backfilledDashed]
                    })
                }, [r.main, r.backfilledMasked, r.backfilledDashed]), {
                    main: (0, y.useTransform)(i, s.current.main.map((e, t) => t), s.current.main, {
                        mixer: ey
                    }),
                    backfilledMasked: (0, y.useTransform)(i, s.current.backfilledMasked.map((e, t) => t), s.current.backfilledMasked, {
                        mixer: ey
                    }),
                    backfilledDashed: (0, y.useTransform)(i, s.current.backfilledDashed.map((e, t) => t), s.current.backfilledDashed, {
                        mixer: ey
                    })
                }
            })(I, eu);
            ei[18] === Symbol.for("react.memo_cache_sentinel") ? (P = {
                wait: 800
            }, ei[18] = P) : P = ei[18];
            let e_ = (0, es.useDeferredMounted)(P),
                eT = !!ex && !!ef,
                eM = ef ? ef + eg : ef,
                eN = ek + eg;
            e: {
                let e, t = a ? ? "";
                if (ei[19] !== t) {
                    let r;
                    ei[21] === Symbol.for("react.memo_cache_sentinel") ? (r = /-?[\d.]+/g, ei[21] = r) : r = ei[21], e = t.match(r), ei[19] = t, ei[20] = e
                } else e = ei[20];
                let r = e;
                if (!r || r.length < 2) {
                    E = ep - eh.right;
                    break e
                }
                E = parseFloat(r[r.length - 2])
            }
            let eI = E;
            t: {
                let e;
                if (!ed || !eT || !eM) {
                    let e;
                    ei[22] === Symbol.for("react.memo_cache_sentinel") ? (e = ej(), ei[22] = e) : e = ei[22], A = e;
                    break t
                }
                if (ev) {
                    let e, t = Math.min(eM, eN),
                        r = eI - Math.max(eM, eN),
                        a = t - (g ? ? 0);
                    ei[23] !== a || ei[24] !== r ? (e = ej(r, a), ei[23] = a, ei[24] = r, ei[25] = e) : e = ei[25], A = e;
                    break t
                }
                let t = ep - eh.right - eM - 10;ei[26] !== t ? (e = ej(t), ei[26] = t, ei[27] = e) : e = ei[27],
                A = e
            }
            let eP = A,
                eE = g ? ? 0;
            ei[28] !== eh || ei[29] !== eE || ei[30] !== ep ? (O = (({
                offset: e = -13,
                xStart: t,
                width: r,
                margin: a
            }) => {
                let i = r - a.right - t + e;
                return `inset(-13px ${i}px -13px -13px)`
            })({
                width: ep,
                margin: eh,
                xStart: eE
            }), ei[28] = eh, ei[29] = eE, ei[30] = ep, ei[31] = O) : O = ei[31];
            let eA = O,
                eO = a ? ? "";
            ei[32] !== eO ? (z = (e => {
                if (!e) return {
                    strokeDasharray: "none",
                    initialStrokeDashoffset: 0
                };
                try {
                    let t = document.createElementNS("http://www.w3.org/2000/svg", "svg"),
                        r = document.createElementNS("http://www.w3.org/2000/svg", "path");
                    r.setAttribute("d", e), t.appendChild(r), document.body.appendChild(t);
                    let a = r.getTotalLength();
                    return document.body.removeChild(t), {
                        strokeDasharray: "2 2",
                        initialStrokeDashoffset: a
                    }
                } catch {
                    return {
                        strokeDasharray: "2 2",
                        initialStrokeDashoffset: 0
                    }
                }
            })(eO), ei[32] = eO, ei[33] = z) : z = ei[33];
            let {
                strokeDasharray: eD,
                initialStrokeDashoffset: eL
            } = z, ez = !!i && !!j;
            ei[34] === Symbol.for("react.memo_cache_sentinel") ? (R = {
                pathLength: 0
            }, ei[34] = R) : R = ei[34], ei[35] === Symbol.for("react.memo_cache_sentinel") ? (F = {
                pathLength: 1,
                transition: {
                    duration: .7,
                    type: "tween",
                    ease: "easeOut",
                    delay: .1
                }
            }, ei[35] = F) : F = ei[35], ei[36] === Symbol.for("react.memo_cache_sentinel") ? ($ = {
                strokeOpacity: 0,
                transition: {
                    type: "tween",
                    duration: .05,
                    ease: "easeOut"
                }
            }, ei[36] = $) : $ = ei[36], ei[37] !== eC ? (B = (0, t.jsx)(x.motion.path, {
                d: eC,
                strokeWidth: 2,
                strokeOpacity: 1,
                fill: "transparent",
                initial: R,
                animate: F,
                exit: $,
                className: "pointer-events-none stroke-neutral-50"
            }), ei[37] = eC, ei[38] = B) : B = ei[38];
            let eR = `${n}-main-path`;
            return ei[39] === Symbol.for("react.memo_cache_sentinel") ? (q = {
                pathLength: 0
            }, ei[39] = q) : q = ei[39], ei[40] !== eT ? (V = eT && {
                type: "tween",
                duration: 0
            }, ei[40] = eT, ei[41] = V) : V = ei[41], ei[42] !== eT ? (H = !eT && {
                type: "spring",
                stiffness: 1300,
                damping: 65
            }, ei[42] = eT, ei[43] = H) : H = ei[43], ei[44] !== V || ei[45] !== H ? (U = {
                duration: .7,
                type: "tween",
                ease: "easeOut",
                delay: .1,
                clipPath: { ...V,
                    ...H
                }
            }, ei[44] = V, ei[45] = H, ei[46] = U) : U = ei[46], ei[47] !== eP || ei[48] !== U ? (W = {
                pathLength: 1,
                clipPath: eP,
                transition: U
            }, ei[47] = eP, ei[48] = U, ei[49] = W) : W = ei[49], ei[50] === Symbol.for("react.memo_cache_sentinel") ? (G = {
                strokeOpacity: 0,
                transition: {
                    type: "tween",
                    duration: .05,
                    ease: "easeOut"
                }
            }, ei[50] = G) : G = ei[50], ei[51] !== en || ei[52] !== p ? (Z = e => {
                en && em(!0), p ? .(e)
            }, ei[51] = en, ei[52] = p, ei[53] = Z) : Z = ei[53], ei[54] !== n || ei[55] !== eC || ei[56] !== l || ei[57] !== k || ei[58] !== S || ei[59] !== C || ei[60] !== el || ei[61] !== eR || ei[62] !== W || ei[63] !== Z ? (K = (0, t.jsx)(x.motion.path, {
                ref: k,
                id: n,
                markerEnd: l,
                d: eC,
                strokeWidth: el,
                stroke: C,
                shapeRendering: "geometricPrecision",
                initial: q,
                animate: W,
                exit: G,
                onAnimationComplete: Z,
                ...S
            }, eR), ei[54] = n, ei[55] = eC, ei[56] = l, ei[57] = k, ei[58] = S, ei[59] = C, ei[60] = el, ei[61] = eR, ei[62] = W, ei[63] = Z, ei[64] = K) : K = ei[64], ei[65] !== n || ei[66] !== eC || ei[67] !== ec || ei[68] !== C ? (Y = ec && (0, t.jsx)(D.AnimatePresence, {
                children: (0, t.jsx)(eS, {
                    id: `${n}-shimmer`,
                    d: eC,
                    stroke: C,
                    strokeWidth: 2.75,
                    fill: "transparent",
                    className: "pointer-events-none"
                }, `${n}-shimmer`)
            }), ei[65] = n, ei[66] = eC, ei[67] = ec, ei[68] = C, ei[69] = Y) : Y = ei[69], ei[70] !== eT || ei[71] !== eA || ei[72] !== e_ || ei[73] !== ez || ei[74] !== n || ei[75] !== eC || ei[76] !== el ? (Q = !1, ei[70] = eT, ei[71] = eA, ei[72] = e_, ei[73] = ez, ei[74] = n, ei[75] = eC, ei[76] = el, ei[77] = Q) : Q = ei[77], ei[78] !== Q ? (X = (0, t.jsx)(D.AnimatePresence, {
                children: Q
            }), ei[78] = Q, ei[79] = X) : X = ei[79], ei[80] !== eT || ei[81] !== eA || ei[82] !== e_ || ei[83] !== ez || ei[84] !== n || ei[85] !== eC || ei[86] !== el ? (J = ez && (0, t.jsx)(x.motion.path, {
                d: eC,
                strokeWidth: el,
                shapeRendering: "geometricPrecision",
                initial: {
                    pathLength: +!!e_,
                    strokeOpacity: +!e_
                },
                animate: {
                    pathLength: 1,
                    clipPath: eA,
                    strokeOpacity: 1,
                    transition: {
                        clipPath: { ...eT && {
                                type: "tween",
                                duration: 0
                            },
                            ...!eT && {
                                type: "spring",
                                stiffness: 1300,
                                damping: 65
                            }
                        },
                        opacity: {
                            duration: .175,
                            delay: .025,
                            ease: "easeIn"
                        }
                    }
                },
                exit: {
                    display: "none",
                    strokeOpacity: 0,
                    opacity: 0,
                    transition: {
                        type: "tween",
                        duration: 0,
                        ease: "easeOut"
                    }
                },
                fill: "transparent",
                className: "stroke-background pointer-events-none"
            }, `${n}-backfilled-path-mask`), ei[80] = eT, ei[81] = eA, ei[82] = e_, ei[83] = ez, ei[84] = n, ei[85] = eC, ei[86] = el, ei[87] = J) : J = ei[87], ei[88] !== J ? (ee = (0, t.jsx)(D.AnimatePresence, {
                children: J
            }), ei[88] = J, ei[89] = ee) : ee = ei[89], ei[90] !== eT || ei[91] !== eA || ei[92] !== ez || ei[93] !== n || ei[94] !== eL || ei[95] !== eC || ei[96] !== C || ei[97] !== eD || ei[98] !== el ? (et = ez && (0, t.jsx)(x.motion.path, {
                d: eC,
                strokeWidth: el,
                shapeRendering: "geometricPrecision",
                initial: {
                    strokeOpacity: 0,
                    strokeDasharray: eD,
                    strokeDashoffset: eL
                },
                animate: {
                    clipPath: eA,
                    strokeOpacity: 1,
                    strokeDasharray: eD,
                    strokeDashoffset: 0,
                    transition: {
                        clipPath: { ...eT && {
                                type: "tween",
                                duration: 0
                            },
                            ...!eT && {
                                type: "spring",
                                stiffness: 1300,
                                damping: 65
                            }
                        },
                        opacity: {
                            duration: .175,
                            delay: .025,
                            ease: "easeIn"
                        }
                    }
                },
                exit: {
                    display: "none",
                    strokeOpacity: 0,
                    opacity: 0,
                    transition: {
                        type: "tween",
                        duration: 0,
                        ease: "easeOut"
                    }
                },
                fill: "transparent",
                className: (0, w.cn)("pointer-events-none", !1),
                stroke: `color-mix(in srgb, ${C} 40%, transparent)`
            }, `${n}-backfilled-path-dashed`), ei[90] = eT, ei[91] = eA, ei[92] = ez, ei[93] = n, ei[94] = eL, ei[95] = eC, ei[96] = C, ei[97] = eD, ei[98] = el, ei[99] = et) : et = ei[99], ei[100] !== et ? (er = (0, t.jsx)(D.AnimatePresence, {
                children: et
            }), ei[100] = et, ei[101] = er) : er = ei[101], ei[102] !== s || ei[103] !== B || ei[104] !== K || ei[105] !== Y || ei[106] !== X || ei[107] !== ee || ei[108] !== er ? (ea = (0, t.jsxs)(L.Group, {
                children: [s, B, K, Y, X, ee, er]
            }), ei[102] = s, ei[103] = B, ei[104] = K, ei[105] = Y, ei[106] = X, ei[107] = ee, ei[108] = er, ei[109] = ea) : ea = ei[109], ea
        };
    eC.displayName = "AnimatedPath";
    let e_ = o.default.memo(eC),
        eT = e => {
            let a, i, n, s, o, l, c, d = (0, r.c)(26),
                {
                    cx: u,
                    cy: m,
                    fill: p,
                    r: h,
                    animationEnabled: f,
                    pulseEnabled: g,
                    visible: v,
                    className: y
                } = e,
                b = void 0 === h ? 3 : h,
                k = void 0 === f || f,
                S = void 0 === g || g,
                j = void 0 === v || v;
            return (d[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                wait: 850
            }, d[0] = a) : a = d[0], (0, es.useDeferredMounted)(a)) ? (d[1] !== y ? (i = (0, w.cn)("pointer-events-none", y), d[1] = y, d[2] = i) : i = d[2], d[3] !== k || d[4] !== u || d[5] !== m || d[6] !== p || d[7] !== b || d[8] !== j ? (n = j && (0, t.jsx)(x.motion.circle, {
                cx: u,
                cy: m,
                r: b,
                fill: p,
                initial: {
                    scale: 0,
                    opacity: 0
                },
                animate: {
                    scale: 1,
                    opacity: k ? 1 : .5,
                    transition: {
                        type: "tween",
                        duration: .1,
                        ease: "easeOut"
                    }
                },
                exit: {
                    scale: 0,
                    opacity: 0,
                    transition: {
                        type: "tween",
                        duration: .05,
                        ease: "easeOut"
                    }
                }
            }, "main-dot"), d[3] = k, d[4] = u, d[5] = m, d[6] = p, d[7] = b, d[8] = j, d[9] = n) : n = d[9], d[10] !== n ? (s = (0, t.jsx)(D.AnimatePresence, {
                children: n
            }), d[10] = n, d[11] = s) : s = d[11], d[12] !== k || d[13] !== u || d[14] !== m || d[15] !== p || d[16] !== S || d[17] !== b || d[18] !== j ? (o = j && S && k && (0, t.jsx)(x.motion.circle, {
                cx: u,
                cy: m,
                r: b,
                fill: p,
                initial: {
                    opacity: .6,
                    scale: 1
                },
                animate: {
                    opacity: 0,
                    scale: 4,
                    transition: {
                        type: "tween",
                        duration: 2.25,
                        ease: "easeOut",
                        delay: .7,
                        repeatType: "loop",
                        repeat: 1 / 0,
                        repeatDelay: 1
                    }
                }
            }, "pulse-dot"), d[12] = k, d[13] = u, d[14] = m, d[15] = p, d[16] = S, d[17] = b, d[18] = j, d[19] = o) : o = d[19], d[20] !== o ? (l = (0, t.jsx)(D.AnimatePresence, {
                children: o
            }), d[20] = o, d[21] = l) : l = d[21], d[22] !== l || d[23] !== i || d[24] !== s ? (c = (0, t.jsxs)("g", {
                className: i,
                children: [s, l]
            }), d[22] = l, d[23] = i, d[24] = s, d[25] = c) : c = d[25], c) : null
        };

    function eM(e) {
        return !!e.data.length
    }
    eT.displayName = "EndPointDot", e.s(["LineChartRenderer", 0, function() {
        let e, a, i, n, s = (0, r.c)(25),
            {
                series: l,
                linearGradientElement: d,
                lastPriceColor: m,
                xAxisScale: p,
                yAxisScale: h
            } = (0, u.useLineChartContext)(),
            {
                tooltipOpen: f
            } = (0, c.useInteractivityContext)(),
            {
                animatePaths: x,
                animateMarkers: g
            } = (0, ea.useAnimationContext)();
        s[0] !== l ? (e = l.filter(eM), s[0] = l, s[1] = e) : e = s[1];
        let v = e,
            y = o.default.useDeferredValue(v);
        if (s[2] !== x || s[3] !== y || s[4] !== d) {
            let e;
            s[6] !== x || s[7] !== d ? (e = e => (0, t.jsx)(e_, {
                id: e.pathId,
                d: e.path ? ? "",
                fullPath: e.fullPath ? ? void 0,
                shortPath: e.shortPath ? ? void 0,
                pathStartX: e.pathStartX,
                stroke: d ? ei.GRADIENT_URL : e.color,
                strokeWidth: 1.75,
                strokeOpacity: 1,
                fill: "transparent",
                enabled: x,
                className: "pointer-events-none",
                shimmer: !0,
                hoverable: !0,
                linearGradientElement: d
            }, `${e.key}-path`), s[6] = x, s[7] = d, s[8] = e) : e = s[8], a = y.map(e), s[2] = x, s[3] = y, s[4] = d, s[5] = a
        } else a = s[5];
        if (s[9] !== g || s[10] !== y || s[11] !== m || s[12] !== f || s[13] !== p || s[14] !== h) {
            let e;
            s[16] !== g || s[17] !== m || s[18] !== f || s[19] !== p || s[20] !== h ? (e = e => {
                let r = e.data[e.data.length - 1];
                if (!r) return null;
                let a = p((0, en.getDate)(r)),
                    i = h((0, en.getValue)(r));
                return (0, t.jsx)(eT, {
                    cx: a,
                    cy: i,
                    fill: m ? ? e.color,
                    animationEnabled: g,
                    pulseEnabled: !f,
                    visible: !f,
                    r: 4
                }, `${e.key}-end-dot`)
            }, s[16] = g, s[17] = m, s[18] = f, s[19] = p, s[20] = h, s[21] = e) : e = s[21], i = y.map(e), s[9] = g, s[10] = y, s[11] = m, s[12] = f, s[13] = p, s[14] = h, s[15] = i
        } else i = s[15];
        return s[22] !== a || s[23] !== i ? (n = (0, t.jsx)("g", {
            id: "line-chart",
            children: (0, t.jsxs)(D.AnimatePresence, {
                mode: "popLayout",
                children: [a, i]
            })
        }), s[22] = a, s[23] = i, s[24] = n) : n = s[24], n
    }], 547525);
    var eN = e.i(262614),
        eI = e.i(487010),
        eP = e.i(204977);
    let eE = function(e, t, r) {
        var a = void 0 === r ? {} : r,
            i = a.delay,
            n = void 0 === i ? 300 : i,
            s = a.moveThreshold,
            l = a.onClick,
            c = a.onLongPressEnd,
            d = (0, eN.default)(e),
            u = (0, eN.default)(l),
            m = (0, eN.default)(c),
            p = (0, o.useRef)(void 0),
            h = (0, o.useRef)(!1),
            f = (0, o.useRef)({
                x: 0,
                y: 0
            }),
            x = (0, o.useRef)(!1),
            g = (0, o.useRef)(!1),
            v = !!((null == s ? void 0 : s.x) && s.x > 0 || (null == s ? void 0 : s.y) && s.y > 0);
        (0, eP.default)(function() {
            var e = (0, eI.getTargetElement)(t);
            if (null == e ? void 0 : e.addEventListener) {
                var r = function(e) {
                        var t = k(e),
                            r = t.clientX,
                            a = t.clientY,
                            i = Math.abs(r - f.current.x),
                            n = Math.abs(a - f.current.y);
                        return !!((null == s ? void 0 : s.x) && i > s.x || (null == s ? void 0 : s.y) && n > s.y)
                    },
                    a = function(e) {
                        p.current = setTimeout(function() {
                            d.current(e), h.current = !0
                        }, n)
                    },
                    i = function(e) {
                        if (!g.current) {
                            if (g.current = !0, v) {
                                var t = k(e),
                                    r = t.clientX,
                                    i = t.clientY;
                                f.current.x = r, f.current.y = i
                            }
                            a(e)
                        }
                    },
                    o = function(e) {
                        var t;
                        null != (t = null == e ? void 0 : e.sourceCapabilities) && t.firesTouchEvents || (x.current = !0, v && (f.current.x = e.clientX, f.current.y = e.clientY), a(e))
                    },
                    l = function(e) {
                        p.current && r(e) && (clearTimeout(p.current), p.current = void 0)
                    },
                    c = function(e) {
                        var t;
                        g.current && (g.current = !1, p.current && (clearTimeout(p.current), p.current = void 0), h.current ? null == (t = m.current) || t.call(m, e) : u.current && u.current(e), h.current = !1)
                    },
                    y = function(e) {
                        var t, r;
                        (null == (t = null == e ? void 0 : e.sourceCapabilities) ? void 0 : t.firesTouchEvents) || x.current && (x.current = !1, p.current && (clearTimeout(p.current), p.current = void 0), h.current ? null == (r = m.current) || r.call(m, e) : u.current && u.current(e), h.current = !1)
                    },
                    b = function(e) {
                        var t;
                        x.current && (x.current = !1, p.current && (clearTimeout(p.current), p.current = void 0), h.current && (null == (t = m.current) || t.call(m, e), h.current = !1))
                    };
                return e.addEventListener("mousedown", o), e.addEventListener("mouseup", y), e.addEventListener("mouseleave", b), e.addEventListener("touchstart", i), e.addEventListener("touchend", c), v && (e.addEventListener("mousemove", l), e.addEventListener("touchmove", l)),
                    function() {
                        p.current && (clearTimeout(p.current), h.current = !1), e.removeEventListener("mousedown", o), e.removeEventListener("mouseup", y), e.removeEventListener("mouseleave", b), e.removeEventListener("touchstart", i), e.removeEventListener("touchend", c), v && (e.removeEventListener("mousemove", l), e.removeEventListener("touchmove", l))
                    }
            }

            function k(e) {
                return "TouchEvent" in window && e instanceof TouchEvent ? {
                    clientX: e.touches[0].clientX,
                    clientY: e.touches[0].clientY
                } : e instanceof MouseEvent ? {
                    clientX: e.clientX,
                    clientY: e.clientY
                } : {
                    clientX: 0,
                    clientY: 0
                }
            }
        }, [], t)
    };
    var eA = e.i(640793);
    e.s(["TooltipObserver", 0, function({
        view: e
    }) {
        let {
            width: r,
            height: i,
            margin: n
        } = (0, u.useLineChartContext)(), {
            resetTooltip: s,
            handleTooltip: l
        } = (0, c.useInteractivityContext)(), {
            tooltipData: m,
            tooltipLeft: p,
            tooltipTops: h
        } = (0, d.useTooltipPositionContext)(), {
            options: f
        } = (0, a.useChartContext)(), {
            isDragging: x,
            isLocked: g,
            startDrag: v,
            lockDrag: y,
            clearDrag: k
        } = (0, b.useDragRangeContext)(), w = o.default.useRef(null), S = o.default.useRef(!1), [j, C] = o.default.useState(!1), _ = o.default.useRef(!1), T = o.default.useRef(0), M = o.default.useRef(!1), N = o.default.useRef(!1), I = o.default.useRef(null), P = o.default.useRef(y);
        P.current = y;
        let E = o.default.useRef(null),
            A = o.default.useMemo(() => (0, eA.throttle)(l, 16), [l]);
        o.default.useEffect(() => () => {
            A.cancel(), E.current ? .()
        }, [A]);
        let O = o.default.useCallback(() => {
                if (M.current) return;
                if (N.current) {
                    N.current = !1;
                    return
                }
                if (g) {
                    k(), s();
                    return
                }
                let e = m ? .[0] ? .point ? .time;
                e && navigator.clipboard.writeText(e.toString()).then(() => {}).catch(() => {})
            }, [m, g, k, s]),
            D = o.default.useCallback(e => {
                if ((0, ew.isNarrowViewport)() || g) return;
                _.current = !0, T.current = e.clientX, M.current = !1, I.current = {
                    left: p,
                    data: m ? [...m] : null,
                    tops: h ? [...h] : []
                }, E.current ? .();
                let t = () => {
                    window.removeEventListener("mouseup", t), E.current = null, _.current && (_.current = !1, I.current = null, M.current && (P.current(), N.current = !0, M.current = !1))
                };
                window.addEventListener("mouseup", t), E.current = () => {
                    window.removeEventListener("mouseup", t), E.current = null
                }
            }, [p, m, h, g]),
            L = o.default.useCallback(e => {
                !(0, ew.isNarrowViewport)() && !g && (A(e), _.current && !M.current && Math.abs(e.clientX - T.current) > 3 && I.current && (M.current = !0, v(I.current.left, I.current.data, I.current.tops)))
            }, [A, v, g]),
            z = o.default.useCallback(() => {
                E.current ? .(), _.current && (_.current = !1, I.current = null, M.current && (y(), N.current = !0, M.current = !1))
            }, [y]),
            R = o.default.useCallback(() => {
                (0, ew.isNarrowViewport)() || (A.cancel(), (!_.current || !M.current) && (_.current && (_.current = !1, I.current = null, E.current ? .()), g || x || s()))
            }, [A, s, x, g]);
        return eE(() => {
            (0, ew.isNarrowViewport)() && (C(!0), S.current = !e || "smp" === e)
        }, w, {
            delay: 200,
            moveThreshold: {
                y: 20
            },
            onLongPressEnd: () => C(!1)
        }), (0, ew.usePreventScroll)(j), (0, t.jsx)("rect", {
            ref: w,
            x: n.left,
            y: 0,
            width: "persist" === f.tooltipOptions.mode ? r - n.left - n.right : r,
            height: i,
            rx: 0,
            fill: "transparent",
            onTouchStart: j ? l : void 0,
            onTouchMove: j ? l : void 0,
            onTouchEnd: () => {
                (0, ew.isNarrowViewport)() && (A.cancel(), s())
            },
            onMouseDown: D,
            onMouseMove: L,
            onMouseUp: z,
            onMouseLeave: R,
            onClick: O,
            onDrag: e => {
                S.current && e.stopPropagation()
            },
            onPointerDown: e => {
                S.current && e.stopPropagation()
            },
            onPointerMove: e => {
                S.current && e.stopPropagation()
            }
        })
    }], 929446)
}, 540240, 981772, 658807, 457134, 31603, 515385, 501437, 796587, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconChevronUpOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...a
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...a
    }, t.default.createElement("polyline", {
        points: "2.75 11.5 9 5.25 15.25 11.5",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))], 540240);
    var a = e.i(221628),
        i = e.i(999061),
        n = e.i(23128),
        s = e.i(169010),
        o = e.i(208956),
        l = e.i(751197),
        c = e.i(604777),
        d = e.i(631222);
    let u = `${d.POLYMARKET_DOCS_LINK}/market-makers/maker-rebates`;

    function m() {
        let e, t, r, n, s, l = (0, i.c)(11),
            d = (0, c.useTranslations)();
        return l[0] !== d ? (e = d("rewards.makerRebate.description"), l[0] = d, l[1] = e) : e = l[1], l[2] !== e ? (t = (0, a.jsx)("p", {
            className: "font-medium text-xs spacing-1.5",
            children: e
        }), l[2] = e, l[3] = t) : t = l[3], l[4] !== d ? (r = d("rewards.makerRebate.learnMore"), l[4] = d, l[5] = r) : r = l[5], l[6] !== r ? (n = (0, a.jsx)(o.default, {
            href: u,
            target: "_blank",
            rel: "noopener noreferrer",
            className: "text-text-brand inline-block",
            children: r
        }), l[6] = r, l[7] = n) : n = l[7], l[8] !== t || l[9] !== n ? (s = (0, a.jsxs)("div", {
            className: "w-[250px] rounded-lg p-4 flex flex-col gap-y-1",
            children: [t, n]
        }), l[8] = t, l[9] = n, l[10] = s) : s = l[10], s
    }
    e.s(["MakerRebateTooltip", 0, function(e) {
        let t, r, o = (0, i.c)(5),
            {
                asIcon: d,
                compact: u
            } = e,
            p = void 0 !== d && d,
            h = void 0 !== u && u,
            f = (0, c.useTranslations)();
        return o[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, a.jsx)(m, {}), o[0] = t) : t = o[0], o[1] !== p || o[2] !== h || o[3] !== f ? (r = (0, a.jsx)(s.Tooltip, {
            mobileSupport: !0,
            className: "p-0 !z-[225]",
            showArrow: !1,
            delayDuration: 200,
            content: t,
            children: p ? (0, a.jsx)("div", {
                className: "text-amber-500 w-7 h-7 flex items-center justify-center cursor-pointer",
                children: (0, a.jsx)(l.IconBadgeDollarOutline18, {
                    size: 16
                })
            }) : (0, a.jsxs)(n.Button, {
                variant: "ghost-accent",
                className: h ? "text-xs px-1.5 h-6 gap-0.5" : "text-sm px-2 h-7 gap-1",
                size: "sm",
                children: [(0, a.jsx)(l.IconBadgeDollarOutline18, {
                    size: h ? 12 : 14,
                    className: "text-amber-500"
                }), (0, a.jsx)("span", {
                    className: "text-amber-500",
                    children: f("rewards.makerRebate.label")
                })]
            })
        }), o[1] = p, o[2] = h, o[3] = f, o[4] = r) : r = o[4], r
    }], 981772);
    var p = e.i(723823),
        h = e.i(635868),
        f = e.i(399336),
        x = e.i(356092);
    let g = e => {
        switch (e) {
            case "0.01":
            default:
                return "1¢";
            case "0.001":
                return "0.1¢"
        }
    };
    e.s(["getTickSizeLabelFromValue", 0, g], 658807);
    let v = [{
        value: "0.01",
        label: g("0.01")
    }, {
        value: "0.001",
        label: g("0.001")
    }];
    e.s(["usePresentationalTickSize", 0, () => {
        let e, r, a, n, s, o, l, c, d, u = (0, i.c)(34);
        u[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], u[0] = e) : e = u[0];
        let {
            activeMarket: m
        } = (0, f.useEventActiveMarketContext)(e);
        u[1] === Symbol.for("react.memo_cache_sentinel") ? (r = ["bookWorkerApiRef"], u[1] = r) : r = u[1];
        let {
            bookWorkerApiRef: g
        } = (0, h.useBookContext)(r), {
            hideDecimalPrices: y
        } = (0, x.useLocalStorageHideDecimalPrices)(), {
            tickSize: b,
            customTickSizeEnabled: k,
            tickSizeOptions: w
        } = (() => {
            let e, t, r = (0, i.c)(4);
            r[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], r[0] = e) : e = r[0];
            let {
                activeMarket: a
            } = (0, f.useEventActiveMarketContext)(e), n = (0, p.useTickSize)(a);
            return r[1] !== a.orderPriceMinTickSize || r[2] !== n ? (t = (({
                marketTickSize: e,
                userTickSize: t
            }) => {
                let r = .001 === e;
                return {
                    customTickSizeEnabled: r,
                    tickSize: `${t??e}`,
                    tickSizeOptions: r ? v : []
                }
            })({
                marketTickSize: a.orderPriceMinTickSize,
                userTickSize: n
            }), r[1] = a.orderPriceMinTickSize, r[2] = n, r[3] = t) : t = r[3], t
        })(), [S, j] = t.default.useState(b);
        u[2] !== m ? .clobTokenIds ? .[0] ? (a = m ? .clobTokenIds ? .[0] ? .toLowerCase ? .() || "", u[2] = m ? .clobTokenIds ? .[0], u[3] = a) : a = u[3];
        let C = a,
            _ = m ? .orderPriceMinTickSize,
            T = m ? .outcomes;
        u[4] !== C || u[5] !== g || u[6] !== _ || u[7] !== T ? (n = e => {
            let t = parseFloat(e);
            C && .001 === _ && (g ? .current ? .setUserTickSize({
                assetId: C,
                tickSize: t,
                outcomes: T
            }), j(e))
        }, u[4] = C, u[5] = g, u[6] = _, u[7] = T, u[8] = n) : n = u[8];
        let M = n;
        u[9] !== k || u[10] !== b || u[11] !== S ? (s = () => {
            k && b !== S && j(b)
        }, u[9] = k, u[10] = b, u[11] = S, u[12] = s) : s = u[12], u[13] !== k || u[14] !== b ? (o = [k, b], u[13] = k, u[14] = b, u[15] = o) : o = u[15], t.default.useEffect(s, o);
        let N = t.default.useRef(y);
        return u[16] !== C || u[17] !== g || u[18] !== k || u[19] !== y || u[20] !== _ || u[21] !== T ? (l = () => {
            let e = N.current;
            if ((N.current = y, k) && C) {
                if (y) g ? .current ? .setUserTickSize({
                    assetId: C,
                    tickSize: .01,
                    outcomes: T
                }), j("0.01");
                else if (e) {
                    if (null == _) return;
                    g ? .current ? .setUserTickSize({
                        assetId: C,
                        tickSize: _,
                        outcomes: T
                    }), j(`${_}`)
                }
            }
        }, u[16] = C, u[17] = g, u[18] = k, u[19] = y, u[20] = _, u[21] = T, u[22] = l) : l = u[22], u[23] !== C || u[24] !== k || u[25] !== y || u[26] !== _ || u[27] !== T ? (c = [y, k, C, _, T], u[23] = C, u[24] = k, u[25] = y, u[26] = _, u[27] = T, u[28] = c) : c = u[28], t.default.useEffect(l, c), u[29] !== k || u[30] !== M || u[31] !== S || u[32] !== w ? (d = {
            customTickSizeEnabled: k,
            tickSize: S,
            onTickSizeChange: M,
            tickSizeOptions: w
        }, u[29] = k, u[30] = M, u[31] = S, u[32] = w, u[33] = d) : d = u[33], d
    }], 457134);
    var y = e.i(827525),
        b = e.i(215959),
        k = e.i(608652),
        w = e.i(600317),
        S = e.i(142953),
        j = e.i(174617),
        C = e.i(199786),
        _ = "Toggle",
        T = t.forwardRef((e, t) => {
            let {
                pressed: r,
                defaultPressed: i,
                onPressedChange: n,
                ...s
            } = e, [o, l] = (0, C.useControllableState)({
                prop: r,
                onChange: n,
                defaultProp: i ? ? !1,
                caller: _
            });
            return (0, a.jsx)(w.Primitive.button, {
                type: "button",
                "aria-pressed": o,
                "data-state": o ? "on" : "off",
                "data-disabled": e.disabled ? "" : void 0,
                ...s,
                ref: t,
                onClick: (0, j.composeEventHandlers)(e.onClick, () => {
                    e.disabled || l(!o)
                })
            })
        });
    T.displayName = _, e.s(["Root", 0, T, "Toggle", 0, T], 31603);
    var M = e.i(974539),
        N = "ToggleGroup",
        [I, P] = (0, k.createContextScope)(N, [S.createRovingFocusGroupScope]),
        E = (0, S.createRovingFocusGroupScope)(),
        A = t.default.forwardRef((e, t) => {
            let {
                type: r,
                ...i
            } = e;
            if ("single" === r) return (0, a.jsx)(L, { ...i,
                ref: t
            });
            if ("multiple" === r) return (0, a.jsx)(z, { ...i,
                ref: t
            });
            throw Error(`Missing prop \`type\` expected on \`${N}\``)
        });
    A.displayName = N;
    var [O, D] = I(N), L = t.default.forwardRef((e, r) => {
        let {
            value: i,
            defaultValue: n,
            onValueChange: s = () => {},
            ...o
        } = e, [l, c] = (0, C.useControllableState)({
            prop: i,
            defaultProp: n ? ? "",
            onChange: s,
            caller: N
        });
        return (0, a.jsx)(O, {
            scope: e.__scopeToggleGroup,
            type: "single",
            value: t.default.useMemo(() => l ? [l] : [], [l]),
            onItemActivate: c,
            onItemDeactivate: t.default.useCallback(() => c(""), [c]),
            children: (0, a.jsx)($, { ...o,
                ref: r
            })
        })
    }), z = t.default.forwardRef((e, r) => {
        let {
            value: i,
            defaultValue: n,
            onValueChange: s = () => {},
            ...o
        } = e, [l, c] = (0, C.useControllableState)({
            prop: i,
            defaultProp: n ? ? [],
            onChange: s,
            caller: N
        }), d = t.default.useCallback(e => c((t = []) => [...t, e]), [c]), u = t.default.useCallback(e => c((t = []) => t.filter(t => t !== e)), [c]);
        return (0, a.jsx)(O, {
            scope: e.__scopeToggleGroup,
            type: "multiple",
            value: l,
            onItemActivate: d,
            onItemDeactivate: u,
            children: (0, a.jsx)($, { ...o,
                ref: r
            })
        })
    });
    A.displayName = N;
    var [R, F] = I(N), $ = t.default.forwardRef((e, t) => {
        let {
            __scopeToggleGroup: r,
            disabled: i = !1,
            rovingFocus: n = !0,
            orientation: s,
            dir: o,
            loop: l = !0,
            ...c
        } = e, d = E(r), u = (0, M.useDirection)(o), m = {
            role: "group",
            dir: u,
            ...c
        };
        return (0, a.jsx)(R, {
            scope: r,
            rovingFocus: n,
            disabled: i,
            children: n ? (0, a.jsx)(S.Root, {
                asChild: !0,
                ...d,
                orientation: s,
                dir: u,
                loop: l,
                children: (0, a.jsx)(w.Primitive.div, { ...m,
                    ref: t
                })
            }) : (0, a.jsx)(w.Primitive.div, { ...m,
                ref: t
            })
        })
    }), B = "ToggleGroupItem", q = t.default.forwardRef((e, r) => {
        let i = D(B, e.__scopeToggleGroup),
            n = F(B, e.__scopeToggleGroup),
            s = E(e.__scopeToggleGroup),
            o = i.value.includes(e.value),
            l = n.disabled || e.disabled,
            c = { ...e,
                pressed: o,
                disabled: l
            },
            d = t.default.useRef(null);
        return n.rovingFocus ? (0, a.jsx)(S.Item, {
            asChild: !0,
            ...s,
            focusable: !l,
            active: o,
            ref: d,
            children: (0, a.jsx)(V, { ...c,
                ref: r
            })
        }) : (0, a.jsx)(V, { ...c,
            ref: r
        })
    });
    q.displayName = B;
    var V = t.default.forwardRef((e, t) => {
        let {
            __scopeToggleGroup: r,
            value: i,
            ...n
        } = e, s = D(B, r), o = {
            role: "radio",
            "aria-checked": e.pressed,
            "aria-pressed": void 0
        }, l = "single" === s.type ? o : void 0;
        return (0, a.jsx)(T, { ...l,
            ...n,
            ref: t,
            onPressedChange: e => {
                e ? s.onItemActivate(i) : s.onItemDeactivate(i)
            }
        })
    });
    e.s(["Item", 0, q, "Root", 0, A, "ToggleGroup", 0, A, "ToggleGroupItem", 0, q, "createToggleGroupScope", 0, P], 759935);
    var H = e.i(759935);
    e.s(["ToggleGroup", 0, H], 515385);
    var H = H,
        U = e.i(507909),
        W = e.i(918997),
        G = e.i(870555);

    function Z(e) {
        let t, r, n, s, o = (0, i.c)(8);
        return o[0] !== e ? ({
            className: t,
            ...r
        } = e, o[0] = e, o[1] = t, o[2] = r) : (t = o[1], r = o[2]), o[3] !== t ? (n = (0, G.cn)("cursor-pointer h-5 flex justify-center items-center self-center", "box-border rounded-[5px] border border-solid border-neutral-50 relative bg-background text-neutral-500 outline-none", "text-sm font-medium leading-[15px]", "ml-2 p-0", "max-sm:ml-1.5", "data-[pressed=true]:bg-brand-500 data-[pressed=true]:text-white", "hover:bg-neutral-50", t), o[3] = t, o[4] = n) : n = o[4], o[5] !== r || o[6] !== n ? (s = (0, a.jsx)(b.motion.button, {
            className: n,
            ...r
        }), o[5] = r, o[6] = n, o[7] = s) : s = o[7], s
    }
    e.s(["TickSizeButton", 0, Z], 501437);
    let K = {
            ease: U.transition.ease,
            duration: .1
        },
        Y = {
            initial: {
                scale: 1,
                backgroundColor: "var(--neutral-50)"
            },
            tap: {
                scale: .95,
                backgroundColor: "var(--neutral-100)"
            }
        };

    function Q(e) {
        return (0, a.jsx)(H.Item, {
            value: e.value,
            asChild: !0,
            children: (0, a.jsx)(b.motion.button, {
                variants: Y,
                initial: "initial",
                animate: "initial",
                whileTap: "tap",
                transition: K,
                className: (0, G.cn)("w-full bg-neutral-50 text-text-primary! text-base font-medium leading-[15px] h-10", "flex items-center justify-center border-none rounded-lg shadow-none outline-none select-none", "data-[state=on]:font-semibold"),
                children: e.label
            })
        }, e.value)
    }

    function X(e) {
        return e.stopPropagation()
    }
    e.s(["TickSizeDrawer", 0, function(e) {
        let t, r, n, s, o, l, d, u, m, p, h, f, x, g, v, b, k, w, S, j, C, _, T = (0, i.c)(49);
        T[0] !== e ? ({
            ref: l,
            tickSize: d,
            onTickSizeChange: n,
            tickSizeOptions: u,
            open: s,
            onOpenChange: r,
            className: t,
            ...o
        } = e, T[0] = e, T[1] = t, T[2] = r, T[3] = n, T[4] = s, T[5] = o, T[6] = l, T[7] = d, T[8] = u) : (t = T[1], r = T[2], n = T[3], s = T[4], o = T[5], l = T[6], d = T[7], u = T[8]), T[9] !== r || T[10] !== s ? (m = {
            prop: s,
            defaultProp: !1,
            onChange: r
        }, T[9] = r, T[10] = s, T[11] = m) : m = T[11];
        let [M, N] = (0, W.useControllableState)(m), I = void 0 !== M && M, P = (0, c.useTranslations)();
        T[12] !== d || T[13] !== u ? (p = u.find(e => e.value === d) ? .label ? ? "0.01", T[12] = d, T[13] = u, T[14] = p) : p = T[14];
        let E = p;
        T[15] !== N || T[16] !== n ? (h = e => {
            n(e), N(!1)
        }, T[15] = N, T[16] = n, T[17] = h) : h = T[17];
        let A = h;
        return T[18] !== t || T[19] !== E ? (f = (0, a.jsx)(Z, {
            className: t,
            children: E
        }), T[18] = t, T[19] = E, T[20] = f) : f = T[20], T[21] !== o || T[22] !== l || T[23] !== f ? (x = (0, a.jsx)(y.Drawer.Trigger, {
            ref: l,
            asChild: !0,
            ...o,
            children: f
        }), T[21] = o, T[22] = l, T[23] = f, T[24] = x) : x = T[24], T[25] !== N ? (g = (0, a.jsx)(y.Drawer.Overlay, {
            onClick: e => {
                e.stopPropagation(), N(!1)
            },
            className: "fixed inset-0 bg-black/40 z-[calc(var(--z-drawer)+34)]"
        }), T[25] = N, T[26] = g) : g = T[26], T[27] === Symbol.for("react.memo_cache_sentinel") ? (v = (0, a.jsx)(y.Drawer.Handle, {}), T[27] = v) : v = T[27], T[28] !== P ? (b = P("trading.decimals"), T[28] = P, T[29] = b) : b = T[29], T[30] !== b ? (k = (0, a.jsx)("h2", {
            className: "font-semibold text-xl leading-[30px] w-full my-6 mb-4 px-0",
            children: b
        }), T[30] = b, T[31] = k) : k = T[31], T[32] !== u ? (w = u.map(Q), T[32] = u, T[33] = w) : w = T[33], T[34] !== A || T[35] !== w || T[36] !== d ? (S = (0, a.jsx)(H.Root, {
            type: "single",
            value: d,
            onValueChange: A,
            className: "flex flex-col gap-1 w-full",
            children: w
        }), T[34] = A, T[35] = w, T[36] = d, T[37] = S) : S = T[37], T[38] !== k || T[39] !== S ? (j = (0, a.jsxs)(y.Drawer.Content, {
            onClick: X,
            className: "z-[calc(var(--z-drawer)+35)] fixed bottom-0 left-0 right-0 flex flex-col rounded-t-lg bg-background p-4",
            children: [v, k, S]
        }), T[38] = k, T[39] = S, T[40] = j) : j = T[40], T[41] !== j || T[42] !== g ? (C = (0, a.jsxs)(y.Drawer.Portal, {
            children: [g, j]
        }), T[41] = j, T[42] = g, T[43] = C) : C = T[43], T[44] !== N || T[45] !== I || T[46] !== C || T[47] !== x ? (_ = (0, a.jsxs)(y.Drawer.Root, {
            shouldScaleBackground: !1,
            open: I,
            onOpenChange: N,
            repositionInputs: !1,
            children: [x, C]
        }), T[44] = N, T[45] = I, T[46] = C, T[47] = x, T[48] = _) : _ = T[48], _
    }], 796587)
}, 122054, 458406, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(457134),
        n = e.i(796587),
        s = e.i(158789),
        o = e.i(219469),
        l = e.i(215959),
        c = e.i(507909),
        d = e.i(918997),
        u = e.i(85510),
        m = e.i(870555),
        p = e.i(501437);
    let h = {
        initial: {
            opacity: 0
        },
        animate: {
            opacity: 1,
            transition: c.opacityTransition
        },
        exit: {
            opacity: 0,
            transition: c.opacityTransition
        }
    };

    function f(e) {
        let a, i, n, f, g, v, y, b, k, w, S = (0, r.c)(31),
            {
                tickSize: j,
                onTickSizeChange: C,
                tickSizeOptions: _,
                open: T,
                onOpenChange: M,
                className: N
            } = e,
            [I, P] = (0, u.useMeasure)();
        S[0] !== M || S[1] !== T ? (a = {
            prop: T,
            defaultProp: !1,
            onChange: M
        }, S[0] = M, S[1] = T, S[2] = a) : a = S[2];
        let [E, A] = (0, d.useControllableState)(a), O = void 0 !== E && E;
        S[3] !== j || S[4] !== _ ? (i = _.find(e => e.value === j) ? .label ? ? "0.01", S[3] = j, S[4] = _, S[5] = i) : i = S[5];
        let D = i,
            L = P.width ? ? "auto";
        return S[6] !== L ? (n = {
            width: L
        }, S[6] = L, S[7] = n) : n = S[7], S[8] !== N ? (f = (0, m.cn)("w-auto", N), S[8] = N, S[9] = f) : f = S[9], S[10] !== D || S[11] !== j ? (g = (0, t.jsx)(o.AnimatePresence, {
            initial: !1,
            mode: "popLayout",
            children: (0, t.jsx)(l.motion.div, {
                variants: h,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                className: "px-2",
                children: D
            }, j)
        }), S[10] = D, S[11] = j, S[12] = g) : g = S[12], S[13] !== I || S[14] !== g ? (v = (0, t.jsx)("div", {
            ref: I,
            className: "w-fit",
            children: g
        }), S[13] = I, S[14] = g, S[15] = v) : v = S[15], S[16] !== n || S[17] !== f || S[18] !== v ? (y = (0, t.jsx)(s.DropdownMenuTrigger, {
            asChild: !0,
            children: (0, t.jsx)(p.TickSizeButton, {
                transition: c.transition,
                animate: n,
                className: f,
                children: v
            })
        }), S[16] = n, S[17] = f, S[18] = v, S[19] = y) : y = S[19], S[20] !== _ ? (b = _.map(x), S[20] = _, S[21] = b) : b = S[21], S[22] !== C || S[23] !== b || S[24] !== j ? (k = (0, t.jsx)(s.DropdownMenuContent, {
            align: "end",
            side: "bottom",
            sideOffset: 4,
            className: "z-999",
            children: (0, t.jsx)(s.DropdownMenuRadioGroup, {
                value: j,
                onValueChange: C,
                children: b
            })
        }), S[22] = C, S[23] = b, S[24] = j, S[25] = k) : k = S[25], S[26] !== A || S[27] !== O || S[28] !== k || S[29] !== y ? (w = (0, t.jsxs)(s.DropdownMenu, {
            modal: !0,
            open: O,
            onOpenChange: A,
            children: [y, k]
        }), S[26] = A, S[27] = O, S[28] = k, S[29] = y, S[30] = w) : w = S[30], w
    }

    function x(e) {
        return (0, t.jsx)(s.DropdownMenuRadioItem, {
            value: e.value,
            className: "w-auto",
            hideIndicator: !0,
            children: e.label
        }, e.value)
    }
    var g = e.i(839593);
    let v = ({ ...e
    }) => a.default.createElement(g.Icon, {
        size: "24px",
        ...e
    }, a.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M22 13L3 13L3 11L22 11L22 13Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), a.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M11.4143 5.00003L4.41431 12L11.4143 19L10.0001 20.4142L1.58588 12L10.0001 3.58582L11.4143 5.00003Z",
        fill: "currentColor"
    }));
    e.s(["IconArrowLeftFill24", 0, v], 458406);
    var y = e.i(31603),
        y = y,
        b = e.i(922445),
        k = e.i(658807);
    let w = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: c.opacityTransition
            },
            exit: {
                opacity: 0,
                transition: c.opacityTransition
            }
        },
        S = {
            initial: {
                opacity: 0,
                width: 0,
                transition: { ...c.transition,
                    opacity: { ...c.opacityTransition
                    }
                }
            },
            animate: {
                opacity: 1,
                width: "auto",
                transition: { ...c.transition,
                    opacity: { ...c.opacityTransition
                    }
                }
            },
            exit: {
                opacity: 0,
                width: 0,
                transition: { ...c.transition,
                    opacity: { ...c.opacityTransition
                    }
                }
            }
        },
        j = () => {
            let e, a = (0, r.c)(1);
            return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(v, {
                className: "size-4 mx-1 rotate-180 fill-text-secondary"
            }), a[0] = e) : e = a[0], e
        };

    function C(e) {
        let i, n, s, h, f, x, g, v, C, _, T, M, N, I, P, E, A, O, D = (0, r.c)(48),
            {
                ref: L,
                tickSize: z,
                onTickSizeChange: R,
                className: F
            } = e,
            $ = a.default.useRef(null),
            [B, q] = a.default.useState(!1),
            [V, H] = a.default.useState(!1),
            [U, W] = (0, u.useMeasure)(),
            G = "0.001" === z ? "0.01" : "0.001";
        D[0] !== G ? (i = (0, k.getTickSizeLabelFromValue)(G), D[0] = G, D[1] = i) : i = D[1], D[2] !== z ? (n = (0, k.getTickSizeLabelFromValue)(z), D[2] = z, D[3] = n) : n = D[3], D[4] !== i || D[5] !== n ? (s = {
            otherTickSizeLabel: i,
            tickSizeLabel: n
        }, D[4] = i, D[5] = n, D[6] = s) : s = D[6];
        let {
            tickSizeLabel: Z,
            otherTickSizeLabel: K
        } = s, Y = "0.001" === z;
        D[7] !== Y ? (h = () => Y, D[7] = Y, D[8] = h) : h = D[8];
        let [Q] = a.default.useState(h);
        D[9] !== R ? (f = e => {
            $.current && ($.current.disabled = !0, setTimeout(() => {
                $.current && ($.current.disabled = !1)
            }, 500)), R(e ? "0.001" : "0.01"), q(!0), H(!1)
        }, D[9] = R, D[10] = f) : f = D[10];
        let X = f;
        D[11] !== Q || D[12] !== X || D[13] !== Y ? (x = {
            prop: Y,
            defaultProp: Q,
            onChange: X
        }, D[11] = Q, D[12] = X, D[13] = Y, D[14] = x) : x = D[14];
        let [J, ee] = (0, d.useControllableState)(x), et = void 0 !== J && J;
        return D[15] !== B ? (g = () => {
            B || (0, b.isNarrowViewport)() || H(!0)
        }, D[15] = B, D[16] = g) : g = D[16], D[17] === Symbol.for("react.memo_cache_sentinel") ? (v = () => {
            H(!1), q(!1)
        }, D[17] = v) : v = D[17], D[18] !== F ? (C = (0, m.cn)(F, "w-auto! overflow-hidden!"), D[18] = F, D[19] = C) : C = D[19], D[20] !== W.width ? (_ = {
            width: W.width
        }, D[20] = W.width, D[21] = _) : _ = D[21], D[22] !== z || D[23] !== Z ? (T = (0, t.jsx)(o.AnimatePresence, {
            initial: !1,
            mode: "popLayout",
            children: (0, t.jsx)(l.motion.span, {
                transition: c.transition,
                variants: w,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                className: "text-xs whitespace-nowrap",
                children: Z
            }, z)
        }), D[22] = z, D[23] = Z, D[24] = T) : T = D[24], D[25] !== U || D[26] !== T ? (M = (0, t.jsx)("div", {
            ref: U,
            className: "flex items-center",
            children: T
        }), D[25] = U, D[26] = T, D[27] = M) : M = D[27], D[28] !== _ || D[29] !== M ? (N = (0, t.jsx)(l.motion.div, {
            animate: _,
            transition: c.transition,
            children: M
        }), D[28] = _, D[29] = M, D[30] = N) : N = D[30], D[31] !== V || D[32] !== K ? (I = V && (0, t.jsxs)(l.motion.div, {
            variants: S,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            transition: c.transition,
            className: "flex items-center",
            children: [(0, t.jsx)(j, {}), (0, t.jsx)("span", {
                className: "text-xs whitespace-nowrap",
                children: K
            })]
        }, "toggle-hoverable-content"), D[31] = V, D[32] = K, D[33] = I) : I = D[33], D[34] !== I ? (P = (0, t.jsx)(o.AnimatePresence, {
            initial: !1,
            mode: "wait",
            children: I
        }), D[34] = I, D[35] = P) : P = D[35], D[36] !== N || D[37] !== P ? (E = (0, t.jsxs)("span", {
            className: "flex items-center w-auto px-1.5",
            children: [N, P]
        }), D[36] = N, D[37] = P, D[38] = E) : E = D[38], D[39] !== C || D[40] !== E || D[41] !== g ? (A = (0, t.jsx)(p.TickSizeButton, {
            ref: $,
            onHoverStart: g,
            onHoverEnd: v,
            className: C,
            children: E
        }), D[39] = C, D[40] = E, D[41] = g, D[42] = A) : A = D[42], D[43] !== ee || D[44] !== et || D[45] !== L || D[46] !== A ? (O = (0, t.jsx)(y.Root, {
            ref: L,
            pressed: et,
            onPressedChange: ee,
            asChild: !0,
            children: A
        }), D[43] = ee, D[44] = et, D[45] = L, D[46] = A, D[47] = O) : O = D[47], O
    }
    e.s(["TickSizeWidget", 0, e => {
        let a, s, o, l, c = (0, r.c)(9);
        c[0] !== e ? ({
            mode: s,
            ...a
        } = e, c[0] = e, c[1] = a, c[2] = s) : (a = c[1], s = c[2]);
        let d = void 0 === s ? "toggle" : s,
            {
                customTickSizeEnabled: u,
                tickSize: m,
                tickSizeOptions: p,
                onTickSizeChange: h
            } = (0, i.usePresentationalTickSize)();
        e: {
            if ("dropdown" === d) {
                o = f;
                break e
            }
            if ("drawer" === d) {
                o = n.TickSizeDrawer;
                break e
            }
            o = C
        }
        let x = o;
        return u ? (c[3] !== x || c[4] !== h || c[5] !== a || c[6] !== m || c[7] !== p ? (l = (0, t.jsx)(x, {
            tickSize: m,
            tickSizeOptions: p,
            onTickSizeChange: h,
            ...a
        }), c[3] = x, c[4] = h, c[5] = a, c[6] = m, c[7] = p, c[8] = l) : l = c[8], l) : null
    }], 122054)
}, 613870, 362724, e => {
    "use strict";
    var t = e.i(601550),
        r = e.i(964974),
        a = e.i(318594),
        i = e.i(719902),
        n = e.i(416340),
        s = e.i(660006),
        o = e.i(87846);
    e.s(["default", 0, (e, l = {}, c = {
        hydrateInitialData: !1
    }) => {
        let {
            queryKey: d = [(0, i.uniqueId)("useCachedState__")],
            queryOptions: u
        } = l, [m] = (0, n.useState)(d), p = (0, a.useQueryClient)(), [h, f] = (0, o.default)(c ? .cookieConfig ? .enabled ? e : void 0, {
            key: c ? .cookieConfig ? .enabled ? c ? .cookieConfig ? .key : "",
            path: "/"
        }), {
            data: x
        } = (0, r.useQuery)({
            queryKey: m,
            queryFn: () => {
                let t = p.getQueryData(m);
                return void 0 !== t ? t : e
            },
            refetchOnWindowFocus: !0,
            refetchOnReconnect: !0,
            gcTime: 864e5,
            ...u,
            ...c ? .hydrateInitialData && {
                initialData: c ? .cookieConfig ? .enabled && h ? h : p.getQueryData(m)
            }
        }), {
            mutate: g
        } = (0, t.useMutation)({
            mutationKey: m,
            mutationFn: async e => {
                c ? .cookieConfig ? .enabled && f(e.value), p.setQueryData(m, e.value)
            },
            onError: e => {
                (0, s.handleError)(e, `[useCachedState] mutate ${m}`)
            }
        });
        return [x ? ? e, (0, n.useCallback)(e => {
            g({
                value: e
            })
        }, [g])]
    }], 613870);
    var l = e.i(999061),
        c = e.i(723823),
        d = e.i(399336),
        u = e.i(880809),
        m = e.i(196593),
        p = e.i(156591);
    e.s(["default", 0, () => {
        let e, t, r, a, i = (0, l.c)(11);
        i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket", "activeMarketTickSize"], i[0] = e) : e = i[0];
        let {
            activeMarket: n,
            activeMarketTickSize: s
        } = (0, d.useEventActiveMarketContext)(e);
        i[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["selectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "side"], i[1] = t) : t = i[1];
        let {
            selectedOutcomeIdx: o,
            setPrice: h,
            setPriceUpdateLocation: f,
            side: x
        } = (0, u.useTradeContext)(t), g = (0, c.useMarketBestPrices)(n), v = s ? ? .01;
        i[2] !== v ? (r = (0, p.getPrecisionFromTickSize)(v), i[2] = v, i[3] = r) : r = i[3];
        let y = r;
        return i[4] !== g || i[5] !== y || i[6] !== o || i[7] !== h || i[8] !== f || i[9] !== x ? (a = (e, t, r) => {
            let a = t ? ? o ? ? 0,
                i = e ? ? x ? ? "",
                n = g ? .[0 === a ? "~zero" : "~one"] ? .[i.toLowerCase()];
            n && (h((0, m.showPaddedCentsOnly)(n, y)), (void 0 === r || r) && f("click"))
        }, i[4] = g, i[5] = y, i[6] = o, i[7] = h, i[8] = f, i[9] = x, i[10] = a) : a = i[10], a
    }], 362724)
}, 794823, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340);
    let i = (0, a.createContext)(void 0);

    function n() {}

    function s() {}

    function o() {}
    e.s(["EventTradeProvider", 0, e => {
        let n, s, o, l, c, d, u = (0, r.c)(7),
            {
                children: m
            } = e;
        u[0] === Symbol.for("react.memo_cache_sentinel") ? (n = new Map, u[0] = n) : n = u[0];
        let p = (0, a.useRef)(n);
        u[1] === Symbol.for("react.memo_cache_sentinel") ? (s = (e, t) => {
            p.current.set(e, t)
        }, u[1] = s) : s = u[1];
        let h = s;
        u[2] === Symbol.for("react.memo_cache_sentinel") ? (o = e => {
            p.current.delete(e)
        }, u[2] = o) : o = u[2];
        let f = o;
        u[3] === Symbol.for("react.memo_cache_sentinel") ? (l = e => {
            p.current.forEach(t => {
                t(e)
            })
        }, u[3] = l) : l = u[3];
        let x = l;
        u[4] === Symbol.for("react.memo_cache_sentinel") ? (c = {
            registerTradeHandler: h,
            unregisterTradeHandler: f,
            handleTrade: x
        }, u[4] = c) : c = u[4];
        let g = c;
        return u[5] !== m ? (d = (0, t.jsx)(i.Provider, {
            value: g,
            children: m
        }), u[5] = m, u[6] = d) : d = u[6], d
    }, "useEventTrade", 0, () => {
        let e = (0, r.c)(1),
            t = (0, a.useContext)(i);
        if (!t) {
            let t;
            return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                registerTradeHandler: n,
                unregisterTradeHandler: s,
                handleTrade: o
            }, e[0] = t) : t = e[0], t
        }
        return t
    }])
}, 327673, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(329905),
        i = e.i(992805),
        n = e.i(169010),
        s = e.i(540240),
        o = e.i(69121),
        l = e.i(219469),
        c = e.i(215959),
        d = e.i(416340),
        u = e.i(981772),
        m = e.i(853037),
        p = e.i(19303),
        h = e.i(122054),
        f = e.i(613870),
        x = e.i(134709),
        g = e.i(510954),
        v = e.i(57096),
        y = e.i(944891),
        b = e.i(922445),
        k = e.i(870555),
        w = e.i(604777),
        S = e.i(631222),
        j = e.i(399336),
        C = e.i(891685),
        _ = e.i(880809),
        T = e.i(362724),
        M = e.i(455145),
        N = e.i(469870),
        I = e.i(794823),
        P = e.i(196593);
    let E = e => {
        let a, i, n, s, o, l, c, u, m = (0, r.c)(17),
            {
                initialVolume: p,
                conditionId: h
            } = e,
            f = (0, w.useTranslations)(),
            [x, g] = d.default.useState(p);
        m[0] !== p ? (a = () => {
            g(p)
        }, i = [p], m[0] = p, m[1] = a, m[2] = i) : (a = m[1], i = m[2]), d.default.useEffect(a, i);
        let {
            registerTradeHandler: v,
            unregisterTradeHandler: y
        } = (0, I.useEventTrade)();
        m[3] !== h ? (n = e => {
            if (!e ? .conditionId || e.conditionId.toLowerCase() !== h.toLowerCase()) return;
            let t = e.price * e.size;
            t > 0 && g(e => e + t)
        }, m[3] = h, m[4] = n) : n = m[4];
        let b = n;
        m[5] !== h || m[6] !== b || m[7] !== v || m[8] !== y ? (s = () => {
            let e = `book-widget-volume-${h}`;
            return v(e, b), () => {
                y(e)
            }
        }, o = [b, v, y, h], m[5] = h, m[6] = b, m[7] = v, m[8] = y, m[9] = s, m[10] = o) : (s = m[9], o = m[10]), d.default.useEffect(s, o), m[11] !== x ? (l = (0, P.formatVolume)(x), m[11] = x, m[12] = l) : l = m[12], m[13] !== f ? (c = f("events.headerMeta.volume"), m[13] = f, m[14] = c) : c = m[14];
        let k = `${l} ${c}`;
        return m[15] !== k ? (u = (0, t.jsx)("p", {
            className: "text-text-secondary text-sm font-normal whitespace-nowrap",
            children: k
        }), m[15] = k, m[16] = u) : u = m[16], u
    };
    var A = e.i(328951);
    let O = {
            queryKey: g.queryKeys[v.QueryKey.UI].bookOpenState().queryKey,
            queryOptions: {
                refetchOnWindowFocus: !1,
                refetchOnReconnect: !1,
                gcTime: 1 / 0,
                staleTime: 1 / 0,
                meta: {
                    persist: !0
                }
            }
        },
        D = {
            hydrateInitialData: !0,
            cookieConfig: {
                key: "polymarket.bookOpenState",
                enabled: !0
            }
        };

    function L(e) {
        return e.stopPropagation()
    }

    function z(e) {
        return e.stopPropagation()
    }
    let R = d.default.memo(function() {
            let e, a, i, s, l, c, d, u, m, p = (0, r.c)(19),
                h = (0, w.useTranslations)();
            return p[0] !== h ? (e = h("trading.orderBook.title"), p[0] = h, p[1] = e) : e = p[1], p[2] !== e ? (a = (0, t.jsx)("h3", {
                children: e
            }), p[2] = e, p[3] = a) : a = p[3], p[4] !== h ? (i = h("trading.orderBook.tooltip"), p[4] = h, p[5] = i) : i = p[5], p[6] !== h ? (s = h("rewards.learnMore"), p[6] = h, p[7] = s) : s = p[7], p[8] !== s ? (l = (0, t.jsx)("a", {
                href: `${S.POLYMARKET_DOCS_LINK}/concepts/prices-orderbook`,
                target: "_blank",
                rel: "noreferrer noopener",
                className: "text-text-brand hover:brightness-105",
                onClick: z,
                children: s
            }), p[8] = s, p[9] = l) : l = p[9], p[10] !== i || p[11] !== l ? (c = (0, t.jsxs)("p", {
                children: [i, " ", l]
            }), p[10] = i, p[11] = l, p[12] = c) : c = p[12], p[13] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)("div", {
                onClick: L,
                className: "flex items-center",
                children: (0, t.jsx)(o.IconCircleInfoFill12, {
                    className: "text-text-secondary shrink-0 size-3"
                })
            }), p[13] = d) : d = p[13], p[14] !== c ? (u = (0, t.jsx)(n.Tooltip, {
                className: "text-body-sm py-3 px-4 max-w-64 text-left",
                showArrow: !1,
                sideOffset: 8,
                side: "top",
                content: c,
                children: d
            }), p[14] = c, p[15] = u) : u = p[15], p[16] !== a || p[17] !== u ? (m = (0, t.jsxs)("div", {
                className: "absolute transition flex items-center gap-x-2 whitespace-nowrap duration-400 ease-[cubic-bezier(0.77,0,0.175,1)] left-0 text-text text-heading-lg font-semibold top-1/2 -translate-y-1/2",
                children: [a, u]
            }), p[16] = a, p[17] = u, p[18] = m) : m = p[18], m
        }),
        F = d.default.memo(function(e) {
            let a, i, n, o, l, c = (0, r.c)(11),
                {
                    withVolume: d,
                    hydratedActive: u
                } = e;
            c[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], c[0] = a) : a = c[0];
            let {
                event: m
            } = (0, C.useEventContext)(a);
            c[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], c[1] = i) : i = c[1];
            let {
                activeMarket: p
            } = (0, j.useEventActiveMarketContext)(i);
            c[2] !== p || c[3] !== m || c[4] !== d ? (n = !!d && m && p && (0, t.jsx)(E, {
                initialVolume: m.volume,
                conditionId: p.conditionId
            }), c[2] = p, c[3] = m, c[4] = d, c[5] = n) : n = c[5];
            let h = `transition-transform duration-200 ${u?"":"rotate-180"}`;
            return c[6] !== h ? (o = (0, t.jsx)("div", {
                className: "text-text h-7 w-7 px-1.5 !mr-1 pr-0 pointer-events-none rounded-lg !outline-none group overflow-hidden gap-x-2 flex items-center justify-start",
                children: (0, t.jsx)(s.IconChevronUpOutline18, {
                    className: h
                })
            }), c[6] = h, c[7] = o) : o = c[7], c[8] !== n || c[9] !== o ? (l = (0, t.jsxs)("div", {
                className: "flex items-center justify-end gap-x-2",
                children: [n, o]
            }), c[8] = n, c[9] = o, c[10] = l) : l = c[10], l
        }),
        $ = d.default.memo(function(e) {
            let a, n, s, o, l, c, d, f, x, g, v, k, S, I, P, E, O, D, L, z, R, F, $, B, q, V, H, U, W, G = (0, r.c)(30),
                {
                    withSideToggle: Z,
                    withRecenterButton: K,
                    variant: Y
                } = e,
                Q = (0, w.useTranslations)();
            G[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["eventSettings"], G[0] = a) : a = G[0];
            let {
                eventSettings: X
            } = (0, C.useEventContext)(a);
            G[1] === Symbol.for("react.memo_cache_sentinel") ? (n = ["activeMarket"], G[1] = n) : n = G[1];
            let {
                activeMarket: J
            } = (0, j.useEventActiveMarketContext)(n);
            G[2] === Symbol.for("react.memo_cache_sentinel") ? (s = ["selectedOutcome", "setSelectedOutcomeIdx"], G[2] = s) : s = G[2];
            let {
                selectedOutcome: ee,
                setSelectedOutcomeIdx: et
            } = (0, _.useTradeContext)(s), er = (0, T.default)(), ea = (B = (0, r.c)(19), q = void 0 === K || K, V = void 0 !== Z && Z, H = (0, w.useTranslations)(), U = (0, M.useOnPriceLevelClick)(J), W = (0, N.useOnSpreadClick)(), B[0] !== ee || B[1] !== H ? (O = ee ? H("trading.orderBook.tradeOutcome", {
                outcome: ee
            }) : void 0, B[0] = ee, B[1] = H, B[2] = O) : O = B[2], B[3] !== q ? (D = q && {
                recenter: {
                    enabled: !0,
                    buttonVariant: "ghost-accent"
                }
            }, B[3] = q, B[4] = D) : D = B[4], B[5] !== V ? (L = V && {
                sideToggle: {
                    enabled: !0
                }
            }, B[5] = V, B[6] = L) : L = B[6], B[7] !== O || B[8] !== D || B[9] !== L ? (z = {
                label: O,
                ...D,
                ...L,
                className: "dark:bg-surface-1"
            }, B[7] = O, B[8] = D, B[9] = L, B[10] = z) : z = B[10], B[11] !== W ? (R = {
                recenter: !0,
                onClick: W,
                className: "dark:bg-surface-1 dark:hover:bg-button-ghost-accent-bg-hover"
            }, B[11] = W, B[12] = R) : R = B[12], B[13] !== U ? (F = {
                onClick: U
            }, B[13] = U, B[14] = F) : F = B[14], B[15] !== z || B[16] !== R || B[17] !== F ? ($ = {
                headerOptions: z,
                spreadOptions: R,
                rowOptions: F
            }, B[15] = z, B[16] = R, B[17] = F, B[18] = $) : $ = B[18], $);
            J ? .feesEnabled;
            e: {
                let {
                    priceMarketSettings: e
                } = X;
                if (e.priceMarketsUiEnabled && ("fifteen" === e.variant || "fiveminute" === e.variant)) {
                    o = !0;
                    break e
                }
                o = !!J ? .feesEnabled
            }
            let ei = o;
            return G[3] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, t.jsx)("div", {
                className: "w-full h-px shrink-0 bg-border"
            }), G[3] = l) : l = G[3], G[4] !== J.outcomes || G[5] !== er || G[6] !== ee || G[7] !== et || G[8] !== Q ? (c = J.outcomes && ee && (0, t.jsx)(i.TextTabs, {
                size: "xs",
                items: J.outcomes.map(e => ({
                    value: e,
                    label: Q("trading.orderBook.tradeOutcome", {
                        outcome: e
                    })
                })),
                value: ee,
                onValueChange: e => {
                    let t = J.outcomes.indexOf(e); - 1 !== t && (et(t), er(void 0, t, !(0, b.isNarrowViewport)()))
                }
            }), G[4] = J.outcomes, G[5] = er, G[6] = ee, G[7] = et, G[8] = Q, G[9] = c) : c = G[9], G[10] !== c ? (d = (0, t.jsx)("div", {
                children: c
            }), G[10] = c, G[11] = d) : d = G[11], G[12] !== ei ? (f = ei && (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)(y.Media, {
                    lessThan: "lg",
                    children: (0, t.jsx)(u.MakerRebateTooltip, {
                        asIcon: !0
                    })
                }), (0, t.jsx)(y.Media, {
                    greaterThanOrEqual: "lg",
                    children: (0, t.jsx)(u.MakerRebateTooltip, {
                        asIcon: !1
                    })
                })]
            }), G[12] = ei, G[13] = f) : f = G[13], G[14] === Symbol.for("react.memo_cache_sentinel") ? (x = (0, t.jsx)(y.Media, {
                lessThan: "lg",
                children: (0, t.jsx)(m.default, {
                    asIcon: !0
                })
            }), G[14] = x) : x = G[14], G[15] === Symbol.for("react.memo_cache_sentinel") ? (g = (0, t.jsx)(y.Media, {
                greaterThanOrEqual: "lg",
                children: (0, t.jsx)(m.default, {
                    asIcon: !1
                })
            }), v = (0, t.jsx)(p.ClobRefreshButtonWithTooltip, {
                variant: "ghost-accent"
            }), k = (0, t.jsx)(h.TickSizeWidget, {
                mode: "toggle"
            }), G[15] = g, G[16] = v, G[17] = k) : (g = G[15], v = G[16], k = G[17]), G[18] !== f ? (S = (0, t.jsxs)("div", {
                className: "flex items-center gap-x-0.5",
                children: [f, x, g, v, k]
            }), G[18] = f, G[19] = S) : S = G[19], G[20] !== S || G[21] !== d ? (I = (0, t.jsxs)("div", {
                className: "px-4 py-[14px] flex justify-between items-center bg-surface-1",
                children: [d, S]
            }), G[20] = S, G[21] = d, G[22] = I) : I = G[22], G[23] !== J || G[24] !== ea || G[25] !== Y ? (P = (0, t.jsx)(A.OrderBook, {
                market: J,
                options: ea,
                variant: Y,
                maxHeight: 360
            }), G[23] = J, G[24] = ea, G[25] = Y, G[26] = P) : P = G[26], G[27] !== I || G[28] !== P ? (E = (0, t.jsxs)(t.Fragment, {
                children: [l, I, P]
            }), G[27] = I, G[28] = P, G[29] = E) : E = G[29], E
        }),
        B = d.default.memo(function(e) {
            let i, n, s, o, d, u, m, p, h, g, v = (0, r.c)(30),
                {
                    className: y,
                    withSideToggle: b,
                    withRecenterButton: w,
                    withVolume: S,
                    variant: j
                } = e,
                [C, _] = (0, f.default)(!1, O, D),
                T = !!(0, x.default)() && C;
            v[0] !== C || v[1] !== _ ? (i = () => {
                _(!C)
            }, v[0] = C, v[1] = _, v[2] = i) : i = v[2];
            let M = i;
            v[3] !== y ? (n = (0, k.cn)("flex w-full max-w-full flex-col mt-8 max-lg:max-w-[unset]", y), v[3] = y, v[4] = n) : n = v[4];
            let N = `${T?"Collapse":"Expand"} Order Book section`;
            v[5] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("div", {
                className: "flex flex-col justify-start items-start w-full",
                children: (0, t.jsx)("div", {
                    className: "flex flex-row gap-x-2 items-center w-full",
                    children: (0, t.jsx)("div", {
                        className: "relative h-10 w-full overflow-hidden",
                        children: (0, t.jsx)(R, {})
                    })
                })
            }), v[5] = s) : s = v[5], v[6] !== T || v[7] !== S ? (o = (0, t.jsxs)("div", {
                className: "flex justify-between items-center",
                children: [s, (0, t.jsx)(F, {
                    withVolume: S,
                    hydratedActive: T
                })]
            }), v[6] = T, v[7] = S, v[8] = o) : o = v[8], v[9] !== M || v[10] !== T || v[11] !== N || v[12] !== o ? (d = (0, t.jsx)("button", {
                type: "button",
                className: "cursor-pointer group w-full focus:ring-0 focus:outline-none relative bg-surface-1 hover:bg-neutral-50/50 dark:hover:bg-neutral-100/50 p-4 text-left",
                onClick: M,
                "aria-label": N,
                "aria-expanded": T,
                children: o
            }), v[9] = M, v[10] = T, v[11] = N, v[12] = o, v[13] = d) : d = v[13];
            let I = T ? "auto" : 0;
            return v[14] !== T || v[15] !== j || v[16] !== w || v[17] !== b ? (u = T && (0, t.jsx)(c.motion.div, {
                initial: {
                    opacity: 0
                },
                animate: {
                    opacity: 1
                },
                exit: {
                    opacity: 0
                },
                transition: {
                    duration: .25
                },
                children: (0, t.jsx)($, {
                    withSideToggle: b,
                    withRecenterButton: w,
                    variant: j
                })
            }, "book-widget-content"), v[14] = T, v[15] = j, v[16] = w, v[17] = b, v[18] = u) : u = v[18], v[19] !== u ? (m = (0, t.jsx)(l.AnimatePresence, {
                mode: "wait",
                children: u
            }), v[19] = u, v[20] = m) : m = v[20], v[21] !== I || v[22] !== m ? (p = (0, t.jsx)(a.AnimateHeight, {
                duration: 250,
                easing: "cubic-bezier(0.77,0,0.175,1)",
                animateOpacity: !0,
                height: I,
                children: m
            }), v[21] = I, v[22] = m, v[23] = p) : p = v[23], v[24] !== p || v[25] !== d ? (h = (0, t.jsxs)("div", {
                className: "w-full rounded-xl border overflow-hidden transition-all duration-250 ease-in-out bg-surface-1",
                children: [d, p]
            }), v[24] = p, v[25] = d, v[26] = h) : h = v[26], v[27] !== h || v[28] !== n ? (g = (0, t.jsx)("div", {
                className: n,
                children: h
            }), v[27] = h, v[28] = n, v[29] = g) : g = v[29], g
        });
    e.s(["OrderBookAccordion", 0, B], 327673)
}, 858021, 580442, 1637, 632096, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(814703),
        i = e.i(208956),
        n = e.i(798631),
        s = e.i(810912),
        o = e.i(416340),
        l = e.i(476979),
        c = e.i(987222),
        d = e.i(604777),
        u = e.i(784521),
        m = e.i(891685),
        p = e.i(6204);

    function h(e, t = 0) {
        let r = parseFloat(e || "0");
        return Number.isNaN(r) ? t : r
    }

    function f(e) {
        let t = e.markets.filter(e => (e.sportsMarketType ? ? "moneyline") === "moneyline");
        if (1 === t.length && t[0].teams ? .length === 2) {
            let e = t[0],
                r = e.teams;
            if (!r) return null;
            let [a, i] = r, n = Math.round(100 * h(e.outcomePrices ? .[0], .5)), s = Math.round(100 * h(e.outcomePrices ? .[1], .5));
            return "home" === a.hostStatus ? {
                homePrice: n,
                awayPrice: s
            } : "home" === i.hostStatus ? {
                homePrice: s,
                awayPrice: n
            } : {
                homePrice: n,
                awayPrice: s
            }
        }
        if (t.length >= 2) {
            let e = 50,
                r = 50;
            for (let a of t) "home" === a.negRiskSportsMarketType && (e = Math.round(100 * h(a.outcomePrices ? .[0], .5))), "away" === a.negRiskSportsMarketType && (r = Math.round(100 * h(a.outcomePrices ? .[0], .5)));
            return {
                homePrice: e,
                awayPrice: r
            }
        }
        return null
    }

    function x(e) {
        if (e.negRisk || 1 !== e.markets.length) return !1;
        let t = e.markets[0];
        return !!t && 2 === t.outcomes.length && "Yes" === t.outcomes[0] && "No" === t.outcomes[1]
    }

    function g(e) {
        return e.replace(/\.0$/, "")
    }

    function v(e) {
        let t = e.gameStartTime || e.startTime || e.eventDate || "";
        if (!t) return "";
        let r = new Date(t);
        return Number.isNaN(r.getTime()) ? "" : r.toLocaleDateString("en-US", {
            month: "long",
            day: "numeric",
            year: "numeric",
            timeZone: "America/New_York"
        })
    }

    function y(e) {
        let t = e.gameStartTime || e.startTime || "";
        if (!t) return "";
        let r = new Date(t);
        return Number.isNaN(r.getTime()) ? "" : r.toLocaleTimeString("en-US", {
            hour: "numeric",
            minute: "2-digit",
            timeZone: "America/New_York"
        })
    }

    function b(e) {
        return e >= 1e9 ? `$${g((e/1e9).toFixed(1))} billion` : e >= 999500 ? `$${g((e/1e6).toFixed(1))} million` : e >= 1e3 ? `$${g((e/1e3).toFixed(1))}K` : `$${Math.round(e)}`
    }

    function k(e) {
        if (!e) return null;
        try {
            let t = new Date(e);
            if (Number.isNaN(t.getTime())) return null;
            return t.toLocaleDateString("en-US", {
                month: "short",
                day: "numeric",
                year: "numeric"
            })
        } catch {
            return null
        }
    }

    function w(e) {
        let t = e.series ? .[0] ? .commentCount;
        if (Number.isFinite(t) && t > 0) return t;
        let r = e.commentCount;
        return Number.isFinite(r) && r > 0 ? r : 0
    }
    var S = e.i(898792),
        j = e.i(593332);
    let C = new Set([j.SportSlug.CS2, j.SportSlug.VALORANT]);
    var _ = e.i(227766),
        T = e.i(255760),
        M = e.i(847979),
        N = e.i(162923);

    function I(e) {
        if (!e) return null;
        try {
            let t = new Date(e);
            if (Number.isNaN(t.getTime())) return null;
            let r = t.toLocaleString("en-US", {
                hour: "numeric",
                minute: "2-digit",
                hour12: !0,
                timeZone: "America/New_York"
            }).replace(/\s/, "");
            return `${r} ET`
        } catch {
            return null
        }
    }

    function P(e) {
        if (!e) return null;
        try {
            let t = new Date(e);
            if (Number.isNaN(t.getTime())) return null;
            return t.toLocaleDateString("en-US", {
                month: "long",
                day: "numeric",
                timeZone: "America/New_York"
            })
        } catch {
            return null
        }
    }
    let E = {
        qqq: "QQQ",
        spy: "SPY",
        ewy: "EWY",
        vxx: "VXX",
        eurusd: "EUR/USD",
        gbpusd: "GBP/USD",
        usdcad: "USD/CAD",
        usdjpy: "USD/JPY",
        usdkrw: "USD/KRW",
        xauusd: "Gold",
        xagusd: "Silver",
        oil: "Oil",
        copper: "Copper",
        naturalgas: "Natural Gas"
    };

    function A(e) {
        return {
            "@type": "Question",
            name: e.question,
            acceptedAnswer: {
                "@type": "Answer",
                text: e.schemaAnswer
            }
        }
    }

    function O(e) {
        return 0 === e.length ? "" : 1 === e.length ? e[0] : 2 === e.length ? `${e[0]} and ${e[1]}` : `${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`
    }

    function D(e) {
        return {
            "@type": "Question",
            name: e.question,
            acceptedAnswer: {
                "@type": "Answer",
                text: e.answer
            }
        }
    }
    e.s(["EventFAQSection", 0, function() {
        let e, g, O, D, L, z, R, F, $, B, q, V, H, U, W, G = (0, r.c)(43),
            [Z, K] = o.default.useState(!1);
        G[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], G[0] = e) : e = G[0];
        let {
            authenticated: Y
        } = (0, u.useAccountContext)(e);
        G[1] === Symbol.for("react.memo_cache_sentinel") ? (g = ["event"], G[1] = g) : g = G[1];
        let {
            event: Q
        } = (0, m.useEventContext)(g);
        G[2] === Symbol.for("react.memo_cache_sentinel") ? (O = ["sportSlug"], G[2] = O) : O = G[2];
        let {
            sportSlug: X
        } = (0, p.useSportsContext)(O), J = (0, d.useTranslations)();
        G[3] !== X ? (D = X && (0, l.isEsportsSlug)(X), G[3] = X, G[4] = D) : D = G[4];
        let ee = D;
        if (G[5] !== Q || G[6] !== ee || G[7] !== J) {
            e: {
                var et, er, ea;
                let e;
                if ((0, c.isUpDownSlug)(Q.slug)) {
                    let e;
                    if (G[9] !== Q || G[10] !== J) {
                        let r, a, n, s, o, l, d, u, m, p, h, f, x, g, v, y, k, S, j, C, A, O, D, L, z, R;
                        e = function(e, r) {
                            let a = [],
                                n = `upDownFaq.windowLabels.${e.windowVariant}`,
                                s = `upDownFaq.windowDurations.${e.windowVariant}`,
                                o = {
                                    title: e.title,
                                    windowLabel: r(n),
                                    cryptoName: e.cryptoName,
                                    cryptoTicker: e.cryptoTicker,
                                    leadingOutcome: e.leadingOutcome,
                                    leadingProbabilityDisplay: e.leadingProbabilityDisplay,
                                    leadingProbabilityCents: e.leadingProbabilityCents,
                                    payoutMathDisplay: e.payoutMathDisplay,
                                    totalVolumeRounded: e.totalVolumeRounded,
                                    windowDuration: r(s),
                                    priceToBeat: e.priceToBeat ? ? "",
                                    startTime: e.startTime ? ? "",
                                    endTime: e.endTime ? ? "",
                                    resolutionDate: e.resolutionDate ? ? r("upDownFaq.fragments.theResolutionDate"),
                                    referenceDate: e.referenceDate ? ? r("upDownFaq.fragments.theReferenceDate"),
                                    timeRemaining: null != e.timeRemainingMinutes ? function(e, t) {
                                        if (e < 2) return t("upDownFaq.timeRemaining.aboutOneMinute");
                                        if (e < 60) return t("upDownFaq.timeRemaining.aboutMinutes", {
                                            count: e
                                        });
                                        let r = Math.round(e / 60);
                                        return 1 === r ? t("upDownFaq.timeRemaining.aboutOneHour") : r < 24 ? t("upDownFaq.timeRemaining.aboutHours", {
                                            count: r
                                        }) : t("upDownFaq.timeRemaining.aboutOneDay")
                                    }(e.timeRemainingMinutes, r) : ""
                                }; {
                                let e = r("upDownFaq.whatIsMarket.a", o);
                                a.push({
                                    question: r("upDownFaq.whatIsMarket.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            }
                            if (e.totalVolume >= 1e4) {
                                let e = r("upDownFaq.activity.highVolumeA", o);
                                a.push({
                                    question: r("upDownFaq.activity.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            } else {
                                let e = r("upDownFaq.activity.lowVolumeA", o);
                                a.push({
                                    question: r("upDownFaq.activity.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            }
                            if ("chainlink" === e.resolutionSource) {
                                let t = e.priceToBeat ? r("upDownFaq.fragments.ofPriceToBeat", o) : "",
                                    i = e.endTime ? r("upDownFaq.fragments.byEndTime", o) : "",
                                    n = r("upDownFaq.howToTrade.chainlinkA", { ...o,
                                        priceToBeatPart: t,
                                        endTimePart: i
                                    });
                                a.push({
                                    question: r("upDownFaq.howToTrade.q", o),
                                    answer: n,
                                    schemaAnswer: n
                                })
                            } else if ("hourly" === e.windowVariant) {
                                let t = e.startTime ? r("upDownFaq.fragments.beginningAtStartTime", o) : "",
                                    i = r("upDownFaq.howToTrade.hourlyA", { ...o,
                                        startTimePart: t
                                    });
                                a.push({
                                    question: r("upDownFaq.howToTrade.q", o),
                                    answer: i,
                                    schemaAnswer: i
                                })
                            } else {
                                let e = r("upDownFaq.howToTrade.dailyA", o);
                                a.push({
                                    question: r("upDownFaq.howToTrade.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            }
                            if (e.isResolved) {
                                let t = e.resolvedOutcome ? ? e.leadingOutcome,
                                    i = r("upDownFaq.currentOdds.resolvedA", { ...o,
                                        outcome: t
                                    });
                                a.push({
                                    question: r("upDownFaq.currentOdds.q", o),
                                    answer: i,
                                    schemaAnswer: i
                                })
                            } else {
                                let t = e.leadingOutcome.toLowerCase(),
                                    i = r(`upDownFaq.windowUrgency.${e.windowVariant}`),
                                    n = r("upDownFaq.currentOdds.liveA", { ...o,
                                        upDown: t,
                                        urgency: i
                                    });
                                a.push({
                                    question: r("upDownFaq.currentOdds.q", o),
                                    answer: n,
                                    schemaAnswer: n
                                })
                            }
                            if ("chainlink" === e.resolutionSource) {
                                let e = r("upDownFaq.resolution.chainlinkA", o);
                                a.push({
                                    question: r("upDownFaq.resolution.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            } else if ("hourly" === e.windowVariant) {
                                let t = e.startTime ? r("upDownFaq.fragments.beginningAtStartTime", o) : "",
                                    i = r("upDownFaq.resolution.hourlyA", { ...o,
                                        startTimePart: t
                                    });
                                a.push({
                                    question: r("upDownFaq.resolution.q", o),
                                    answer: i,
                                    schemaAnswer: i
                                })
                            } else {
                                let e = r("upDownFaq.resolution.dailyA", o);
                                a.push({
                                    question: r("upDownFaq.resolution.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            }
                            if ("fiveminute" === e.windowVariant || "fifteen" === e.windowVariant || "fourhour" === e.windowVariant) {
                                let t = e.priceToBeat ? r("upDownFaq.fragments.priceToBeatParens", o) : "",
                                    i = r("upDownFaq.followWithout.shortWindowA", { ...o,
                                        priceToBeatPart: t
                                    });
                                a.push({
                                    question: r("upDownFaq.followWithout.q", o),
                                    answer: i,
                                    schemaAnswer: i
                                })
                            } else if ("hourly" === e.windowVariant) {
                                let e = r("upDownFaq.followWithout.hourlyA", o);
                                a.push({
                                    question: r("upDownFaq.followWithout.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            } else {
                                let e = r("upDownFaq.followWithout.dailyA", o);
                                a.push({
                                    question: r("upDownFaq.followWithout.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            } {
                                let n = (0, t.jsx)(i.default, {
                                    href: "/accuracy",
                                    className: "underline hover:text-text-secondary",
                                    children: r("upDownFaq.reliability.linkText")
                                });
                                if (e.totalVolume >= 1e4) {
                                    let e = r("upDownFaq.reliability.highVolumeSchemaA", o);
                                    a.push({
                                        question: r("upDownFaq.reliability.q", o),
                                        answer: (0, t.jsxs)(t.Fragment, {
                                            children: [r("upDownFaq.reliability.highVolumeBeforeLink", o), n, r("upDownFaq.reliability.highVolumeAfterLink")]
                                        }),
                                        schemaAnswer: e
                                    })
                                } else {
                                    let e = r("upDownFaq.reliability.lowVolumeSchemaA", o);
                                    a.push({
                                        question: r("upDownFaq.reliability.q", o),
                                        answer: (0, t.jsxs)(t.Fragment, {
                                            children: [r("upDownFaq.reliability.lowVolumeBeforeLink", o), n, r("upDownFaq.reliability.lowVolumeAfterLink")]
                                        }),
                                        schemaAnswer: e
                                    })
                                }
                            } {
                                let e = r("upDownFaq.getStarted.a", o);
                                a.push({
                                    question: r("upDownFaq.getStarted.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            }
                            if (!e.hasNoTrades) {
                                let t = e.leadingOutcome.toLowerCase(),
                                    i = r(`upDownFaq.priceVolatility.${e.windowVariant}`, o),
                                    n = r("upDownFaq.priceMeaning.a", { ...o,
                                        upDown: t,
                                        volatilityNote: i
                                    });
                                a.push({
                                    question: r("upDownFaq.priceMeaning.q", o),
                                    answer: n,
                                    schemaAnswer: n
                                })
                            }
                            if (e.isLive) {
                                let t = null != e.timeRemainingMinutes ? r("upDownFaq.fragments.approximatelyFromNow", o) : "",
                                    i = e.endTime ? r("upDownFaq.fragments.atEndTime", o) : "",
                                    n = "chainlink" === e.resolutionSource ? e.priceToBeat ? r("upDownFaq.resolutionSummary.chainlinkWithPtb", o) : r("upDownFaq.resolutionSummary.chainlink", o) : "pyth" === e.resolutionSource ? r("upDownFaq.resolutionSummary.pyth", o) : "hourly" === e.windowVariant ? r("upDownFaq.resolutionSummary.hourly", o) : r("upDownFaq.resolutionSummary.daily", o),
                                    s = r("upDownFaq.marketClose.liveA", { ...o,
                                        timePart: t,
                                        endTimePart: i,
                                        resolutionSummary: n
                                    });
                                a.push({
                                    question: r("upDownFaq.marketClose.q", o),
                                    answer: s,
                                    schemaAnswer: s
                                })
                            } else if (e.isResolved) {
                                let t = e.resolvedOutcome ? ? e.leadingOutcome,
                                    i = e.endTime ? r("upDownFaq.fragments.atEndTime", o) : "",
                                    n = r("upDownFaq.marketClose.resolvedA", { ...o,
                                        outcome: t,
                                        endTimePart: i
                                    });
                                a.push({
                                    question: r("upDownFaq.marketClose.q", o),
                                    answer: n,
                                    schemaAnswer: n
                                })
                            } else if (e.isPending) {
                                let t = e.endTime ? r("upDownFaq.fragments.atEndTime", o) : "",
                                    i = r("upDownFaq.marketClose.pendingA", { ...o,
                                        endTimePart: t
                                    });
                                a.push({
                                    question: r("upDownFaq.marketClose.q", o),
                                    answer: i,
                                    schemaAnswer: i
                                })
                            }
                            if (e.commentCount > 1) {
                                let t = e.commentCount.toLocaleString("en-US"),
                                    i = r("upDownFaq.tradersSaying.activeA", { ...o,
                                        countDisplay: t
                                    });
                                a.push({
                                    question: r("upDownFaq.tradersSaying.q", o),
                                    answer: i,
                                    schemaAnswer: i
                                })
                            } else {
                                let e = r("upDownFaq.tradersSaying.newMarketA", o);
                                a.push({
                                    question: r("upDownFaq.tradersSaying.q", o),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            } {
                                let e = r("upDownFaq.whatIsPolymarket.a", o);
                                a.push({
                                    question: r("upDownFaq.whatIsPolymarket.q"),
                                    answer: e,
                                    schemaAnswer: e
                                })
                            }
                            return a
                        }((s = function(e) {
                            if ((0, c.matchesFiveMinuteUpDown)(e)) return "fiveminute";
                            if ((0, c.matchesFifteenMinuteUpDown)(e)) return "fifteen";
                            if ((0, c.matchesFourHourUpDown)(e)) return "fourhour";
                            let t = e.toLowerCase();
                            return N.HOURLY_UP_OR_DOWN_PREFIXES.some(e => t.startsWith(e)) && /-[0-9]+(am|pm)-et$/.test(t) ? "hourly" : "daily"
                        }(n = Q.slug), o = (0, M.isEquityMarketSlug)(n) ? "pyth" : "fiveminute" === s || "fifteen" === s || "fourhour" === s ? "chainlink" : "binance", l = (0, _.getCryptoFromEvent)(Q), d = n.split("-up-or-down")[0] || n.split("-")[0], m = (u = l ? (0, T.getAssetNames)(l) : (0, T.getAssetNames)(d)).name ? E[et = u.name] ? ? et.charAt(0).toUpperCase() + et.slice(1) : Q.title ? .split("(")[0] ? .trim() || "Asset", p = u.abbreviation ? ? d.toUpperCase(), h = "xrp" === (er = l || d) || "dogecoin" === er || "hype" === er || "bnb" === er || /^(eurusd|gbpusd|usdcad)$/.test(er) ? 4 : 2, f = Q.markets[0], x = parseFloat(f ? .outcomePrices ? .[0] || "0.5"), g = parseFloat(f ? .outcomePrices ? .[1] || "0.5"), v = f ? .outcomes ? .[0] ? ? "Up", y = f ? .outcomes ? .[1] ? ? "Down", x >= g ? (r = v, a = Math.round(100 * x)) : (r = y, a = Math.round(100 * g)), k = null, Q.closed && f && (k = x >= g ? v : y), j = (S = f ? .endDate ? ? Q.endDate) ? new Date(S).getTime() : null, C = Date.now(), A = Q.closed, O = "daily" === s ? P(S) ? `Noon ET ${P(S)}` : null : I(S), D = "daily" === s ? P(f ? .eventStartTime) ? `Noon ET ${P(f?.eventStartTime)}` : null : I(f ? .eventStartTime), L = null, z = null, "daily" === s && (L = P(S), z = P(f ? .eventStartTime ? ? Q.startDate)), ea = Q.eventMetadata ? .priceToBeat, R = null != ea && Number.isFinite(ea) ? `$${ea.toLocaleString("en-US",{minimumFractionDigits:h,maximumFractionDigits:h})}` : null, {
                            title: Q.title,
                            cryptoName: m,
                            cryptoTicker: p,
                            windowVariant: s,
                            resolutionSource: o,
                            priceToBeat: R,
                            leadingOutcome: r,
                            leadingProbability: a,
                            leadingProbabilityDisplay: `${a}%`,
                            leadingProbabilityCents: `${a}\xa2`,
                            payoutMathDisplay: `${100-a}\xa2`,
                            totalVolume: Q.volume,
                            totalVolumeRounded: b(Q.volume),
                            commentCount: w(Q),
                            isResolved: A,
                            isLive: !A && null !== j && C < j,
                            isPending: !A && null !== j && C >= j,
                            resolvedOutcome: k,
                            endTime: O,
                            startTime: D,
                            timeRemainingMinutes: function(e) {
                                if (!e) return null;
                                try {
                                    let t = new Date(e);
                                    if (Number.isNaN(t.getTime())) return null;
                                    let r = t.getTime() - Date.now();
                                    if (r <= 0) return null;
                                    return Math.round(r / 6e4)
                                } catch {
                                    return null
                                }
                            }(S),
                            resolutionDate: L,
                            referenceDate: z,
                            hasNoTrades: 0 === Q.volume
                        }), J), G[9] = Q, G[10] = J, G[11] = e
                    } else e = G[11];
                    L = e;
                    break e
                }
                if (ee) {
                    let e = function(e) {
                        let t, r = (0, S.extractTeamsFromEvent)(e);
                        if (!r) return null;
                        let a = f(e);
                        if (!a) return null;
                        let i = (0, S.getLeagueFromEvent)(e),
                            n = (0, l.getSportDisplayHeader)(i),
                            s = (t = (0, j.canonicalSportSlug)(i), C.has(t) ? {
                                unit: "map",
                                unitPlural: "maps",
                                unitCap: "Map",
                                unitPluralCap: "Maps"
                            } : {
                                unit: "game",
                                unitPlural: "games",
                                unitCap: "Game",
                                unitPluralCap: "Games"
                            }),
                            o = (0, S.getTeamDisplayName)(r.away, i),
                            c = (0, S.getTeamDisplayName)(r.home, i),
                            d = r.away.name,
                            u = r.home.name,
                            m = (r.away.abbreviation || o).toUpperCase(),
                            p = (r.home.abbreviation || c).toUpperCase(),
                            {
                                awayPrice: h,
                                homePrice: x
                            } = a,
                            g = e.eventMetadata ? .league || n;
                        return {
                            teamA: o,
                            teamB: c,
                            teamAFullName: d,
                            teamBFullName: u,
                            teamAAbbreviation: m,
                            teamBAbbreviation: p,
                            teamAPrice: h,
                            teamBPrice: x,
                            gameTitle: n,
                            tournamentName: g,
                            boCount: function(e) {
                                if (e.period) {
                                    let t = e.period.split("/");
                                    if (2 === t.length && t[1]) return t[1]
                                }
                                let t = e.markets.map(e => e.sportsMarketType ? ? "").filter(e => /^(game|map)-\d+/.test(e));
                                if (t.length > 0) {
                                    let e = Math.max(...t.map(e => {
                                        let t = e.match(/^(?:game|map)-(\d+)/);
                                        return t ? parseInt(t[1], 10) : 0
                                    }));
                                    if (e > 0) return String(e)
                                }
                                return null
                            }(e),
                            ...s,
                            gameDate: v(e),
                            gameTime: y(e),
                            totalVolume: b(e.volume),
                            commentCount: w(e),
                            title: `${o} vs. ${c}`
                        }
                    }(Q);
                    if (e) {
                        let r, a, n, s, o, l, c, d, u, m, p, h, f, x, g, v;
                        r = [], a = e.title, n = e.commentCount.toLocaleString("en-US"), s = {
                            title: a,
                            teamA: e.teamA,
                            teamB: e.teamB,
                            teamAFullName: e.teamAFullName,
                            teamBFullName: e.teamBFullName,
                            teamAAbbreviation: e.teamAAbbreviation,
                            teamBAbbreviation: e.teamBAbbreviation,
                            teamAPrice: e.teamAPrice,
                            teamBPrice: e.teamBPrice,
                            teamAPayout: 100 - e.teamAPrice,
                            gameTitle: e.gameTitle,
                            tournamentName: e.tournamentName,
                            unit: e.unit,
                            unitPlural: e.unitPlural,
                            unitCap: e.unitCap,
                            unitPluralCap: e.unitPluralCap,
                            gameDate: e.gameDate,
                            gameTime: e.gameTime,
                            totalVolume: e.totalVolume,
                            commentCountDisplay: n
                        }, e.boCount && (s.boCount = e.boCount), o = J(e.boCount ? "esportsEventFaq.whatIsMarket.a" : "esportsEventFaq.whatIsMarket.aNoBoCount", s), r.push({
                            question: J("esportsEventFaq.whatIsMarket.q", s),
                            answer: o,
                            schemaAnswer: o
                        }), l = J("esportsEventFaq.activity.a", s), r.push({
                            question: J("esportsEventFaq.activity.q", s),
                            answer: l,
                            schemaAnswer: l
                        }), c = J("esportsEventFaq.howToTrade.a", s), r.push({
                            question: J("esportsEventFaq.howToTrade.q", s),
                            answer: c,
                            schemaAnswer: c
                        }), d = J("esportsEventFaq.currentOdds.a", s), r.push({
                            question: J("esportsEventFaq.currentOdds.q", s),
                            answer: d,
                            schemaAnswer: d
                        }), u = J("esportsEventFaq.followWithout.a", s), r.push({
                            question: J("esportsEventFaq.followWithout.q", s),
                            answer: u,
                            schemaAnswer: u
                        }), m = (0, t.jsx)(i.default, {
                            href: "/accuracy",
                            className: "underline hover:text-text-secondary",
                            children: J("esportsEventFaq.reliability.linkText")
                        }), p = J("esportsEventFaq.reliability.schemaA", s), r.push({
                            question: J("esportsEventFaq.reliability.q", s),
                            answer: (0, t.jsxs)(t.Fragment, {
                                children: [J("esportsEventFaq.reliability.beforeLink", s), m, J("esportsEventFaq.reliability.afterLink")]
                            }),
                            schemaAnswer: p
                        }), h = J("esportsEventFaq.getStarted.a", s), r.push({
                            question: J("esportsEventFaq.getStarted.q", s),
                            answer: h,
                            schemaAnswer: h
                        }), f = J("esportsEventFaq.priceMeaning.a", s), r.push({
                            question: J("esportsEventFaq.priceMeaning.q", s),
                            answer: f,
                            schemaAnswer: f
                        }), x = J(e.boCount ? "esportsEventFaq.marketClose.a" : "esportsEventFaq.marketClose.aNoBoCount", s), r.push({
                            question: J("esportsEventFaq.marketClose.q", s),
                            answer: x,
                            schemaAnswer: x
                        }), g = e.commentCount > 0 ? J("esportsEventFaq.tradersSaying.activeA", s) : J("esportsEventFaq.tradersSaying.newA", s), r.push({
                            question: J("esportsEventFaq.tradersSaying.q", s),
                            answer: g,
                            schemaAnswer: g
                        }), v = J("esportsEventFaq.whatIsPolymarket.a"), r.push({
                            question: J("esportsEventFaq.whatIsPolymarket.q"),
                            answer: v,
                            schemaAnswer: v
                        }), L = r;
                        break e
                    }
                }
                if (Q.seriesSlug && (0, l.isSportSupported)(Q.seriesSlug)) {
                    let e = function(e) {
                        let t = (0, S.extractTeamsFromEvent)(e);
                        if (!t) return null;
                        let r = f(e);
                        if (!r) return null;
                        let a = (0, S.getLeagueFromEvent)(e),
                            i = (0, l.getSportDisplayHeader)(a),
                            n = (0, S.getTeamDisplayName)(t.away, a),
                            s = (0, S.getTeamDisplayName)(t.home, a),
                            o = t.away.name,
                            c = t.home.name,
                            d = (t.away.abbreviation || n).toUpperCase(),
                            u = (t.home.abbreviation || s).toUpperCase(),
                            {
                                homePrice: m,
                                awayPrice: p
                            } = r,
                            h = m > p ? "home" : p > m ? "away" : "home",
                            x = "home" === h ? s : n,
                            g = "home" === h ? m : p,
                            k = "home" === h ? n : s;
                        return {
                            awayTeam: n,
                            homeTeam: s,
                            awayTeamFullName: o,
                            homeTeamFullName: c,
                            awayTeamAbbreviation: d,
                            homeTeamAbbreviation: u,
                            leagueName: i,
                            gameDate: v(e),
                            gameTime: y(e),
                            favoredTeam: x,
                            favoredTeamFullName: "home" === h ? c : o,
                            favoredTeamAbbreviation: "home" === h ? u : d,
                            favoredTeamPrice: g,
                            underdogTeam: k,
                            underdogTeamFullName: "home" === h ? o : c,
                            underdogTeamPrice: "home" === h ? p : m,
                            awayTeamPrice: p,
                            homeTeamPrice: m,
                            profitPerShare: 100 - g,
                            totalVolume: b(e.volume),
                            commentCount: w(e),
                            accuracyScore: "94%",
                            matchupTitle: `${n} vs. ${s}`
                        }
                    }(Q);
                    if (e) {
                        let r, a, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y;
                        r = [], a = e.matchupTitle, n = e.commentCount.toLocaleString("en-US"), o = J("sportsFaq.whatIsMarket.a", s = {
                            title: a,
                            leagueName: e.leagueName,
                            awayTeam: e.awayTeam,
                            homeTeam: e.homeTeam,
                            awayTeamFullName: e.awayTeamFullName,
                            homeTeamFullName: e.homeTeamFullName,
                            awayTeamAbbreviation: e.awayTeamAbbreviation,
                            homeTeamAbbreviation: e.homeTeamAbbreviation,
                            gameDate: e.gameDate,
                            gameTime: e.gameTime,
                            favoredTeam: e.favoredTeam,
                            favoredTeamFullName: e.favoredTeamFullName,
                            favoredTeamAbbreviation: e.favoredTeamAbbreviation,
                            favoredTeamPrice: e.favoredTeamPrice,
                            underdogTeam: e.underdogTeam,
                            underdogTeamFullName: e.underdogTeamFullName,
                            underdogTeamPrice: e.underdogTeamPrice,
                            awayTeamPrice: e.awayTeamPrice,
                            homeTeamPrice: e.homeTeamPrice,
                            profitPerShare: e.profitPerShare,
                            totalVolume: e.totalVolume,
                            commentCountDisplay: n,
                            accuracyScore: e.accuracyScore
                        }), r.push({
                            question: J("sportsFaq.whatIsMarket.q", s),
                            answer: o,
                            schemaAnswer: o
                        }), l = J("sportsFaq.activity.a", s), r.push({
                            question: J("sportsFaq.activity.q", s),
                            answer: l,
                            schemaAnswer: l
                        }), c = J("sportsFaq.howToTrade.a", s), r.push({
                            question: J("sportsFaq.howToTrade.q", s),
                            answer: c,
                            schemaAnswer: c
                        }), d = J("sportsFaq.currentOdds.a", s), r.push({
                            question: J("sportsFaq.currentOdds.q", s),
                            answer: d,
                            schemaAnswer: d
                        }), u = J("sportsFaq.resolution.a", s), r.push({
                            question: J("sportsFaq.resolution.q", s),
                            answer: u,
                            schemaAnswer: u
                        }), m = J("sportsFaq.followWithout.a", s), r.push({
                            question: J("sportsFaq.followWithout.q", s),
                            answer: m,
                            schemaAnswer: m
                        }), p = (0, t.jsx)(i.default, {
                            href: "/accuracy",
                            className: "underline hover:text-text-secondary",
                            children: J("sportsFaq.reliability.linkText")
                        }), h = J("sportsFaq.reliability.schemaA", s), r.push({
                            question: J("sportsFaq.reliability.q", s),
                            answer: (0, t.jsxs)(t.Fragment, {
                                children: [J("sportsFaq.reliability.beforeLink", s), p, J("sportsFaq.reliability.afterLink")]
                            }),
                            schemaAnswer: h
                        }), f = J("sportsFaq.getStarted.a", s), r.push({
                            question: J("sportsFaq.getStarted.q", s),
                            answer: f,
                            schemaAnswer: f
                        }), x = J("sportsFaq.priceMeaning.a", s), r.push({
                            question: J("sportsFaq.priceMeaning.q", s),
                            answer: x,
                            schemaAnswer: x
                        }), g = J("sportsFaq.marketClose.a", s), r.push({
                            question: J("sportsFaq.marketClose.q", s),
                            answer: g,
                            schemaAnswer: g
                        }), v = e.commentCount > 0 ? J("sportsFaq.tradersSaying.activeA", s) : J("sportsFaq.tradersSaying.newA", s), r.push({
                            question: J("sportsFaq.tradersSaying.q", s),
                            answer: v,
                            schemaAnswer: v
                        }), y = J("sportsFaq.whatIsPolymarket.a", s), r.push({
                            question: J("sportsFaq.whatIsPolymarket.q"),
                            answer: y,
                            schemaAnswer: y
                        }), L = r;
                        break e
                    }
                }
                G[12] !== Q || G[13] !== J ? (e = function(e, r) {
                    var a;
                    let n = [],
                        s = e.daysUntilResolution && e.daysUntilResolution > 0 ? (a = e.daysUntilResolution, a <= 1 ? r("eventFaq.timeUntil.aboutOneDay") : a < 30 ? r("eventFaq.timeUntil.aboutDays", {
                            count: a
                        }) : a < 60 ? r("eventFaq.timeUntil.aboutOneMonth") : a < 365 ? r("eventFaq.timeUntil.aboutMonths", {
                            count: Math.round(a / 30)
                        }) : a < 730 ? r("eventFaq.timeUntil.overOneYear") : r("eventFaq.timeUntil.overYears", {
                            count: Math.round(a / 365)
                        })) : "",
                        o = {
                            title: e.title,
                            leadingOutcome: e.leadingOutcome,
                            leadingProbabilityDisplay: e.leadingProbabilityDisplay,
                            leadingProbabilityCents: e.leadingProbabilityCents,
                            leadingProbability: e.leadingProbability,
                            outcomeCountDisplay: e.outcomeCountDisplay,
                            secondOutcome: e.secondOutcome ? ? "",
                            secondProbabilityDisplay: e.secondProbabilityDisplay ? ? "",
                            payoutMathDisplay: e.payoutMathDisplay,
                            totalVolumeRounded: e.totalVolumeRounded,
                            createdAt: e.createdAt ? ? "",
                            endDate: e.endDate ? ? "",
                            timeUntilResolution: s,
                            accuracyScore: e.accuracyScore
                        };
                    if (e.isBinary) {
                        let e = r("eventFaq.whatIsMarket.binaryA", o);
                        n.push({
                            question: r("eventFaq.whatIsMarket.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    } else {
                        let t = r(e.secondOutcome && e.secondProbabilityDisplay ? "eventFaq.whatIsMarket.multiWithSecondA" : "eventFaq.whatIsMarket.multiWithoutSecondA", o);
                        n.push({
                            question: r("eventFaq.whatIsMarket.q", o),
                            answer: t,
                            schemaAnswer: t
                        })
                    }
                    if (e.totalVolume >= 1e4) {
                        let t = e.createdAt ? r("eventFaq.activity.highVolumeDatePart", o) : "",
                            a = r("eventFaq.activity.highVolumeA", { ...o,
                                datePart: t
                            });
                        n.push({
                            question: r("eventFaq.activity.q", o),
                            answer: a,
                            schemaAnswer: a
                        })
                    } else {
                        let t = e.createdAt ? r("eventFaq.activity.newMarketDatePart", o) : "",
                            a = r("eventFaq.activity.newMarketA", { ...o,
                                datePart: t
                            });
                        n.push({
                            question: r("eventFaq.activity.q", o),
                            answer: a,
                            schemaAnswer: a
                        })
                    }
                    if (e.isBinary) {
                        let e = r("eventFaq.howToTrade.binaryA", o);
                        n.push({
                            question: r("eventFaq.howToTrade.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    } else {
                        let e = r("eventFaq.howToTrade.multiA", o);
                        n.push({
                            question: r("eventFaq.howToTrade.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    }
                    if (e.hasNoTrades) {
                        let e = r("eventFaq.currentOdds.noTradesA");
                        n.push({
                            question: r("eventFaq.currentOdds.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    } else if (e.isBinary) {
                        let e = r("eventFaq.currentOdds.binaryA", o);
                        n.push({
                            question: r("eventFaq.currentOdds.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    } else if (e.leadingProbability < 10) {
                        let t = r(e.secondOutcome && e.secondProbabilityDisplay ? "eventFaq.currentOdds.wideOpenWithSecondA" : "eventFaq.currentOdds.wideOpenWithoutSecondA", o);
                        n.push({
                            question: r("eventFaq.currentOdds.q", o),
                            answer: t,
                            schemaAnswer: t
                        })
                    } else {
                        let t = r(e.secondOutcome && e.secondProbabilityDisplay ? "eventFaq.currentOdds.standardWithSecondA" : "eventFaq.currentOdds.standardWithoutSecondA", o);
                        n.push({
                            question: r("eventFaq.currentOdds.q", o),
                            answer: t,
                            schemaAnswer: t
                        })
                    } {
                        let e = r("eventFaq.resolution.a", o);
                        n.push({
                            question: r("eventFaq.resolution.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    } {
                        let e = r("eventFaq.followWithout.a", o);
                        n.push({
                            question: r("eventFaq.followWithout.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    }
                    let l = (0, t.jsx)(i.default, {
                        href: "/accuracy",
                        className: "underline hover:text-text-secondary",
                        children: r("eventFaq.reliability.linkText")
                    });
                    if (e.totalVolume >= 1e4) {
                        let e = r("eventFaq.reliability.highVolumeSchemaA", o);
                        n.push({
                            question: r("eventFaq.reliability.q", o),
                            answer: (0, t.jsxs)(t.Fragment, {
                                children: [r("eventFaq.reliability.highVolumeBeforeLink", o), l, r("eventFaq.reliability.highVolumeAfterLink")]
                            }),
                            schemaAnswer: e
                        })
                    } else {
                        let e = r("eventFaq.reliability.lowVolumeSchemaA", o);
                        n.push({
                            question: r("eventFaq.reliability.q", o),
                            answer: (0, t.jsxs)(t.Fragment, {
                                children: [r("eventFaq.reliability.lowVolumeBeforeLink", o), l, r("eventFaq.reliability.lowVolumeAfterLink")]
                            }),
                            schemaAnswer: e
                        })
                    } {
                        let e = r("eventFaq.getStarted.a", o);
                        n.push({
                            question: r("eventFaq.getStarted.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    }
                    if (!e.hasNoTrades)
                        if (e.isBinary) {
                            let e = r("eventFaq.priceMeaning.binaryA", o);
                            n.push({
                                question: r("eventFaq.priceMeaning.binaryQ", o),
                                answer: e,
                                schemaAnswer: e
                            })
                        } else {
                            let e = r("eventFaq.priceMeaning.multiA", o);
                            n.push({
                                question: r("eventFaq.priceMeaning.multiQ", o),
                                answer: e,
                                schemaAnswer: e
                            })
                        }
                    if (e.isResolved) {
                        let e = r("eventFaq.marketClose.resolvedA", o);
                        n.push({
                            question: r("eventFaq.marketClose.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    } else if (e.isEndDatePassed) {
                        let e = r("eventFaq.marketClose.endDatePassedA", o);
                        n.push({
                            question: r("eventFaq.marketClose.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    } else if (e.hasEndDate)
                        if (e.isLongTerm) {
                            let e = r("eventFaq.marketClose.longTermA", o);
                            n.push({
                                question: r("eventFaq.marketClose.q", o),
                                answer: e,
                                schemaAnswer: e
                            })
                        } else {
                            let e = r("eventFaq.marketClose.standardA", o);
                            n.push({
                                question: r("eventFaq.marketClose.q", o),
                                answer: e,
                                schemaAnswer: e
                            })
                        }
                    else {
                        let e = r("eventFaq.marketClose.noEndDateA");
                        n.push({
                            question: r("eventFaq.marketClose.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    }
                    if (e.commentCount > 1) {
                        let t = e.commentCount.toLocaleString("en-US"),
                            a = r(e.commentCount >= 10 ? "eventFaq.tradersSaying.activeCommunity" : "eventFaq.tradersSaying.growingDiscussion", {
                                countDisplay: t
                            }),
                            i = r("eventFaq.tradersSaying.activeA", { ...o,
                                communityPhrasing: a
                            });
                        n.push({
                            question: r("eventFaq.tradersSaying.q", o),
                            answer: i,
                            schemaAnswer: i
                        })
                    } else {
                        let e = r("eventFaq.tradersSaying.newMarketA", o);
                        n.push({
                            question: r("eventFaq.tradersSaying.q", o),
                            answer: e,
                            schemaAnswer: e
                        })
                    } {
                        let e = r("eventFaq.whatIsPolymarket.a", o);
                        n.push({
                            question: r("eventFaq.whatIsPolymarket.q"),
                            answer: e,
                            schemaAnswer: e
                        })
                    }
                    return n
                }(function(e) {
                    let t = x(e),
                        r = x(e) ? 2 : e.negRisk || e.markets.length > 1 ? e.markets.length : e.markets[0] ? .outcomes ? .length ? ? 2,
                        a = "",
                        i = 0,
                        n = null,
                        s = null;
                    if (t) {
                        let t = e.markets[0];
                        i = Math.round(100 * h(t ? .outcomePrices ? .[0], .5)), a = "Yes", n = "No", s = 100 - i
                    } else {
                        let t = e.markets.map(e => ({
                            name: e.groupItemTitle || e.question || "Unknown",
                            prob: Math.round(100 * h(e.outcomePrices ? .[0]))
                        })).sort((e, t) => t.prob - e.prob);
                        t[0] && (a = t[0].name, i = t[0].prob), t[1] && (n = t[1].name, s = t[1].prob)
                    }
                    let o = e.endDate ? function(e) {
                        try {
                            let t = new Date(e);
                            if (Number.isNaN(t.getTime())) return null;
                            return Math.ceil((t.getTime() - Date.now()) / 864e5)
                        } catch {
                            return null
                        }
                    }(e.endDate) : null;
                    return {
                        title: e.title,
                        isBinary: t,
                        outcomeCount: r,
                        outcomeCountDisplay: r >= 40 ? `${r}+` : String(r),
                        leadingOutcome: a,
                        leadingProbability: i,
                        leadingProbabilityDisplay: `${i}%`,
                        leadingProbabilityCents: `${i}\xa2`,
                        secondOutcome: n,
                        secondProbabilityDisplay: null !== s ? `${s}%` : null,
                        payoutMathDisplay: `${100-i}\xa2`,
                        totalVolume: e.volume,
                        totalVolumeRounded: b(e.volume),
                        createdAt: k(e.creationDate ? ? e.start_date),
                        endDate: k(e.endDate),
                        daysUntilResolution: o,
                        timeUntilResolution: o && o > 0 ? o <= 1 ? "about 1 day" : o < 30 ? `about ${o} days` : o < 60 ? "about 1 month" : o < 365 ? `about ${Math.round(o/30)} months` : o < 730 ? "over 1 year" : `over ${Math.round(o/365)} years` : null,
                        isResolved: e.closed,
                        isEndDatePassed: null !== o && o <= 0,
                        isLongTerm: null !== o && o > 365,
                        hasEndDate: !!e.endDate && null !== k(e.endDate),
                        commentCount: w(e),
                        hasNoTrades: 0 === e.volume,
                        accuracyScore: "94%"
                    }
                }(Q), J), G[12] = Q, G[13] = J, G[14] = e) : e = G[14],
                L = e
            }
            G[5] = Q,
            G[6] = ee,
            G[7] = J,
            G[8] = L
        }
        else L = G[8];
        let ei = L;
        G[15] !== ei ? (z = ei.map(A), G[15] = ei, G[16] = z) : z = G[16], G[17] !== z ? (R = {
            "@context": "https://schema.org",
            "@type": "FAQPage",
            mainEntity: z
        }, G[17] = z, G[18] = R) : R = G[18];
        let en = R;
        if (Y || 0 === ei.length) return null;
        let es = ei.length > 5;
        if (G[19] !== en ? (F = JSON.stringify(en), G[19] = en, G[20] = F) : F = G[20], G[21] !== F ? ($ = (0, t.jsx)(a.default, {
                children: (0, t.jsx)("script", {
                    type: "application/ld+json",
                    dangerouslySetInnerHTML: {
                        __html: F
                    }
                })
            }), G[21] = F, G[22] = $) : $ = G[22], G[23] !== J ? (B = J("eventFaq.title"), G[23] = J, G[24] = B) : B = G[24], G[25] !== B ? (q = (0, t.jsx)("h2", {
                className: "text-[16px] font-semibold text-text-primary mb-2",
                children: B
            }), G[25] = B, G[26] = q) : q = G[26], G[27] !== ei || G[28] !== Z) {
            let e;
            G[30] !== Z ? (e = (e, r) => (0, t.jsxs)(s.Accordion.Item, {
                value: `faq-${r}`,
                className: "border-b border-border last:border-b-0",
                style: r >= 5 && !Z ? {
                    display: "none"
                } : void 0,
                children: [(0, t.jsx)(s.Accordion.Header, {
                    children: (0, t.jsxs)(s.Accordion.Trigger, {
                        className: "w-full flex items-center justify-between py-5 lg:py-6 text-[14px] text-text-primary hover:text-text-secondary transition-colors group cursor-pointer text-start",
                        children: [e.question, (0, t.jsx)(n.IconChevronDownOutline12, {
                            className: "shrink-0 ml-4 transform transition-transform duration-200 group-data-[state=open]:rotate-180"
                        })]
                    })
                }), (0, t.jsx)(s.Accordion.Content, {
                    forceMount: !0,
                    className: "overflow-hidden data-[state=open]:animate-accordionSlideDown data-[state=closed]:animate-accordionSlideUp data-[state=closed]:h-0 data-[state=closed]:opacity-0",
                    children: (0, t.jsx)("div", {
                        className: "pb-5 lg:pb-6 text-[14px] text-text-primary leading-relaxed",
                        children: e.answer
                    })
                })]
            }, r), G[30] = Z, G[31] = e) : e = G[31], V = ei.map(e), G[27] = ei, G[28] = Z, G[29] = V
        } else V = G[29];
        return G[32] !== V ? (H = (0, t.jsx)(s.Accordion.Root, {
            type: "single",
            collapsible: !0,
            className: "w-full",
            children: V
        }), G[32] = V, G[33] = H) : H = G[33], G[34] !== es || G[35] !== Z || G[36] !== J ? (U = es && (0, t.jsxs)("button", {
            type: "button",
            onClick: () => K(!Z),
            className: "flex items-center gap-2 mt-4 text-[14px] text-text-secondary hover:text-text-primary transition-colors cursor-pointer",
            children: [(0, t.jsx)("span", {
                children: J(Z ? "footer.viewLess" : "footer.viewMore")
            }), (0, t.jsx)(n.IconChevronDownOutline12, {
                className: `transform transition-transform duration-200 ${Z?"rotate-180":""}`
            })]
        }), G[34] = es, G[35] = Z, G[36] = J, G[37] = U) : U = G[37], G[38] !== q || G[39] !== H || G[40] !== U || G[41] !== $ ? (W = (0, t.jsxs)("section", {
            className: "w-full pt-8",
            children: [$, q, H, U]
        }), G[38] = q, G[39] = H, G[40] = U, G[41] = $, G[42] = W) : W = G[42], W
    }], 858021), e.s(["SportsCategoryFAQSection", 0, function() {
        let e, i, c, h, f, x, g, v, y, k, w, S, j, C, _ = (0, r.c)(38),
            [T, M] = o.default.useState(!1);
        _[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], _[0] = e) : e = _[0];
        let {
            authenticated: N
        } = (0, u.useAccountContext)(e);
        _[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["events"], _[1] = i) : i = _[1];
        let {
            events: I
        } = (0, m.useEventContext)(i);
        _[2] === Symbol.for("react.memo_cache_sentinel") ? (c = ["sportSlug"], _[2] = c) : c = _[2];
        let {
            sportSlug: P
        } = (0, p.useSportsContext)(c), E = (0, d.useTranslations)();
        e: {
            let e, t;
            if (!P) {
                let e;
                _[3] === Symbol.for("react.memo_cache_sentinel") ? (e = [], _[3] = e) : e = _[3], h = e;
                break e
            }
            _[4] !== I ? (e = Array.isArray(I) ? I : [], _[4] = I, _[5] = e) : e = _[5];
            let r = e;_[6] !== r || _[7] !== P || _[8] !== E ? (t = (0, l.getIsLeague)(P) ? function(e, t, r) {
                let a = (0, l.getSportDisplayHeader)(t),
                    i = [],
                    n = e.filter(e => e.active && !e.closed && !e.archived),
                    s = n.length;
                if (0 === s) return i.push({
                    question: r("sportsCategoryFaq.league.q1.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q1.a", {
                        leagueName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.league.q5.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q5.a", {
                        leagueName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.league.q6.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q6.a", {
                        leagueName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.league.q7.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q7.a", {
                        leagueName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.noMarkets.q", {
                        name: a
                    }),
                    answer: r("sportsCategoryFaq.noMarkets.a", {
                        name: a
                    })
                }), i;
                let o = [...n].sort((e, t) => (t.volume ? ? 0) - (e.volume ? ? 0)),
                    c = n.reduce((e, t) => e + (t.volume ? ? 0), 0),
                    d = o.slice(0, 3).map(e => e.title),
                    u = n.filter(e => e.startDate && new Date(e.startDate).getTime() > Date.now()).sort((e, t) => new Date(e.startDate).getTime() - new Date(t.startDate).getTime())[0],
                    m = u ? function(e) {
                        if (!e) return null;
                        let t = new Date(e);
                        return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString("en-US", {
                            year: "numeric",
                            month: "long",
                            day: "numeric"
                        })
                    }(u.startDate) : null;
                return i.push({
                    question: r("sportsCategoryFaq.league.q1.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q1.a", {
                        leagueName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.league.q2.q", {
                        leagueName: a
                    }),
                    answer: c > 0 ? r("sportsCategoryFaq.league.q2.withVolume", {
                        leagueName: a,
                        activeCount: s,
                        totalVolume: b(c)
                    }) : r("sportsCategoryFaq.league.q2.noVolume", {
                        leagueName: a,
                        activeCount: s
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.league.q3.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q3.a", {
                        leagueName: a,
                        topMarkets: O(d)
                    })
                }), u && m && i.push({
                    question: r("sportsCategoryFaq.league.q4.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q4.a", {
                        leagueName: a,
                        nextEvent: u.title,
                        nextDate: m
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.league.q5.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q5.a", {
                        leagueName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.league.q6.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q6.a", {
                        leagueName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.league.q7.q", {
                        leagueName: a
                    }),
                    answer: r("sportsCategoryFaq.league.q7.a", {
                        leagueName: a
                    })
                }), i
            }(r, P, E) : function(e, t, r) {
                let a = (0, l.getSportDisplayHeader)(t),
                    i = [],
                    n = e.filter(e => e.active && !e.closed && !e.archived),
                    s = n.length;
                if (0 === s) return i.push({
                    question: r("sportsCategoryFaq.sport.q1.q", {
                        sportName: a
                    }),
                    answer: r("sportsCategoryFaq.sport.q1.noMatchups", {
                        sportName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.sport.q2.q", {
                        sportName: a
                    }),
                    answer: r("sportsCategoryFaq.sport.q2.noSample", {
                        sportName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.sport.q6.q", {
                        sportName: a
                    }),
                    answer: r("sportsCategoryFaq.sport.q6.a", {
                        sportName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.sport.q7.q", {
                        sportName: a
                    }),
                    answer: r("sportsCategoryFaq.sport.q7.a", {
                        sportName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.noMarkets.q", {
                        name: a
                    }),
                    answer: r("sportsCategoryFaq.noMarkets.a", {
                        name: a
                    })
                }), i;
                let o = [...n].sort((e, t) => (t.volume ? ? 0) - (e.volume ? ? 0)),
                    c = o.filter(e => /\bvs\.?\b/i.test(e.title)).slice(0, 2).map(e => e.title),
                    d = o.slice(0, 3).map(e => e.title),
                    u = (() => {
                        let e = o[0],
                            t = e ? .markets ? .[0] ? .outcomePrices ? .[0];
                        if (!t) return null;
                        let r = Math.round(100 * parseFloat(t));
                        return Number.isFinite(r) && r > 0 && r < 100 ? r : null
                    })();
                i.push({
                    question: r("sportsCategoryFaq.sport.q1.q", {
                        sportName: a
                    }),
                    answer: c.length > 0 ? r("sportsCategoryFaq.sport.q1.withMatchups", {
                        sportName: a,
                        topMarkets: O(c)
                    }) : r("sportsCategoryFaq.sport.q1.noMatchups", {
                        sportName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.sport.q2.q", {
                        sportName: a
                    }),
                    answer: null !== u ? r("sportsCategoryFaq.sport.q2.withSample", {
                        sportName: a,
                        samplePrice: u
                    }) : r("sportsCategoryFaq.sport.q2.noSample", {
                        sportName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.sport.q3.q", {
                        sportName: a
                    }),
                    answer: r("sportsCategoryFaq.sport.q3.a", {
                        sportName: a,
                        topMarkets: O(d)
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.sport.q4.q", {
                        sportName: a
                    }),
                    answer: r("sportsCategoryFaq.sport.q4.a", {
                        sportName: a
                    })
                });
                let m = (0, l.isSportCategory)(t) ? (0, l.getLeaguesForCategory)(t).filter(e => n.some(t => t.seriesSlug === e.sportSlug)).slice(0, 3).map(e => e.displayHeader) : [];
                return i.push({
                    question: r("sportsCategoryFaq.sport.q5.q", {
                        sportName: a
                    }),
                    answer: m.length >= 2 ? r("sportsCategoryFaq.sport.q5.withLeagues", {
                        sportName: a,
                        activeCount: s,
                        topLeagues: O(m)
                    }) : r("sportsCategoryFaq.sport.q5.noLeagues", {
                        sportName: a,
                        activeCount: s
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.sport.q6.q", {
                        sportName: a
                    }),
                    answer: r("sportsCategoryFaq.sport.q6.a", {
                        sportName: a
                    })
                }), i.push({
                    question: r("sportsCategoryFaq.sport.q7.q", {
                        sportName: a
                    }),
                    answer: r("sportsCategoryFaq.sport.q7.a", {
                        sportName: a
                    })
                }), i
            }(r, P, E), _[6] = r, _[7] = P, _[8] = E, _[9] = t) : t = _[9],
            h = t
        }
        let A = h;
        _[10] !== A ? (f = A.map(D), _[10] = A, _[11] = f) : f = _[11], _[12] !== f ? (x = {
            "@context": "https://schema.org",
            "@type": "FAQPage",
            mainEntity: f
        }, _[12] = f, _[13] = x) : x = _[13];
        let L = x;
        if (N || A.length < 3) return null;
        let z = A.length > 5;
        if (_[14] !== L ? (g = JSON.stringify(L), _[14] = L, _[15] = g) : g = _[15], _[16] !== g ? (v = (0, t.jsx)(a.default, {
                children: (0, t.jsx)("script", {
                    type: "application/ld+json",
                    dangerouslySetInnerHTML: {
                        __html: g
                    }
                })
            }), _[16] = g, _[17] = v) : v = _[17], _[18] !== E ? (y = E("sportsCategoryFaq.title"), _[18] = E, _[19] = y) : y = _[19], _[20] !== y ? (k = (0, t.jsx)("h2", {
                className: "text-[16px] font-semibold text-text-primary mb-2",
                children: y
            }), _[20] = y, _[21] = k) : k = _[21], _[22] !== A || _[23] !== T) {
            let e;
            _[25] !== T ? (e = (e, r) => (0, t.jsxs)(s.Accordion.Item, {
                value: `faq-${r}`,
                className: "border-b border-border last:border-b-0",
                style: r >= 5 && !T ? {
                    display: "none"
                } : void 0,
                children: [(0, t.jsx)(s.Accordion.Header, {
                    children: (0, t.jsxs)(s.Accordion.Trigger, {
                        className: "w-full flex items-center justify-between py-5 lg:py-6 text-[14px] text-text-primary hover:text-text-secondary transition-colors group cursor-pointer text-start",
                        children: [e.question, (0, t.jsx)(n.IconChevronDownOutline12, {
                            className: "shrink-0 ml-4 transform transition-transform duration-200 group-data-[state=open]:rotate-180"
                        })]
                    })
                }), (0, t.jsx)(s.Accordion.Content, {
                    forceMount: !0,
                    className: "overflow-hidden data-[state=open]:animate-accordionSlideDown data-[state=closed]:animate-accordionSlideUp data-[state=closed]:h-0 data-[state=closed]:opacity-0",
                    children: (0, t.jsx)("div", {
                        className: "pb-5 lg:pb-6 text-[14px] text-text-primary leading-relaxed",
                        children: e.answer
                    })
                })]
            }, r), _[25] = T, _[26] = e) : e = _[26], w = A.map(e), _[22] = A, _[23] = T, _[24] = w
        } else w = _[24];
        return _[27] !== w ? (S = (0, t.jsx)(s.Accordion.Root, {
            type: "single",
            collapsible: !0,
            className: "w-full",
            children: w
        }), _[27] = w, _[28] = S) : S = _[28], _[29] !== z || _[30] !== T || _[31] !== E ? (j = z && (0, t.jsxs)("button", {
            type: "button",
            onClick: () => M(!T),
            className: "flex items-center gap-2 mt-4 text-[14px] text-text-secondary hover:text-text-primary transition-colors cursor-pointer",
            children: [(0, t.jsx)("span", {
                children: E(T ? "footer.viewLess" : "footer.viewMore")
            }), (0, t.jsx)(n.IconChevronDownOutline12, {
                className: `transform transition-transform duration-200 ${T?"rotate-180":""}`
            })]
        }), _[29] = z, _[30] = T, _[31] = E, _[32] = j) : j = _[32], _[33] !== S || _[34] !== j || _[35] !== v || _[36] !== k ? (C = (0, t.jsxs)("section", {
            className: "w-full pt-8",
            children: [v, k, S, j]
        }), _[33] = S, _[34] = j, _[35] = v, _[36] = k, _[37] = C) : C = _[37], C
    }], 580442);
    let L = (0, o.createContext)(void 0);

    function z() {}

    function R() {}
    e.s(["EventCommentHandlersProvider", 0, e => {
        let a, i, n, s, l, c = (0, r.c)(8),
            {
                children: d
            } = e;
        c[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {}, c[0] = a) : a = c[0];
        let [u, m] = (0, o.useState)(a);
        c[1] === Symbol.for("react.memo_cache_sentinel") ? (i = e => {
            m(e)
        }, c[1] = i) : i = c[1];
        let p = i;
        c[2] === Symbol.for("react.memo_cache_sentinel") ? (n = () => {
            m({})
        }, c[2] = n) : n = c[2];
        let h = n;
        c[3] !== u ? (s = {
            registerCommentHandlers: p,
            unregisterCommentHandlers: h,
            commentHandlers: u
        }, c[3] = u, c[4] = s) : s = c[4];
        let f = s;
        return c[5] !== d || c[6] !== f ? (l = (0, t.jsx)(L.Provider, {
            value: f,
            children: d
        }), c[5] = d, c[6] = f, c[7] = l) : l = c[7], l
    }, "useEventCommentHandlers", 0, () => {
        let e = (0, r.c)(1),
            t = (0, o.useContext)(L);
        if (!t) {
            let t;
            return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                registerCommentHandlers: z,
                unregisterCommentHandlers: R,
                commentHandlers: {}
            }, e[0] = t) : t = e[0], t
        }
        return t
    }], 1637);
    var F = e.i(23128),
        $ = e.i(16674),
        B = e.i(312390);
    let q = (0, o.memo)(function(e) {
        let a, i, n, s, l, c = (0, r.c)(21),
            {
                hasComments: u,
                isEmpty: m,
                hasNextPage: p,
                isFetchingNextPage: h,
                onFetchNextPage: f,
                authenticated: x,
                hasMoreToShow: g,
                onShowMore: v
            } = e,
            y = (0, d.useTranslations)();
        c[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
            threshold: 0
        }, c[0] = a) : a = c[0];
        let {
            ref: b,
            inView: k
        } = (0, $.useInView)(a), w = (0, o.useRef)(0);
        return (c[1] !== x || c[2] !== u || c[3] !== p || c[4] !== k || c[5] !== m || c[6] !== h || c[7] !== f ? (i = () => {
            if (!x) return;
            if (m && p && !h) return void f();
            let e = Date.now(),
                t = e - w.current;
            k && p && u && !h && t > 1e3 && (w.current = e, f())
        }, n = [x, u, p, m, h, k, f], c[1] = x, c[2] = u, c[3] = p, c[4] = k, c[5] = m, c[6] = h, c[7] = f, c[8] = i, c[9] = n) : (i = c[8], n = c[9]), (0, o.useEffect)(i, n), u) ? (c[10] !== x || c[11] !== g || c[12] !== p || c[13] !== m || c[14] !== h || c[15] !== v || c[16] !== b || c[17] !== y ? (s = !m || p || h ? x ? (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)("div", {
                ref: b,
                className: "h-1"
            }), h && (0, t.jsx)(B.BeatLoader, {
                color: "gray",
                loading: !0,
                size: 8
            })]
        }) : g ? (0, t.jsx)(F.Button, {
            onClick: v,
            variant: "outline",
            size: "lg",
            className: "rounded-full w-fit px-4",
            children: "Show more comments"
        }) : null : (0, t.jsx)("p", {
            className: "text-text-secondary text-sm",
            children: y("comments.noComments")
        }), c[10] = x, c[11] = g, c[12] = p, c[13] = m, c[14] = h, c[15] = v, c[16] = b, c[17] = y, c[18] = s) : s = c[18], c[19] !== s ? (l = (0, t.jsx)("div", {
            className: "flex justify-center w-full py-4",
            children: s
        }), c[19] = s, c[20] = l) : l = c[20], l) : null
    });
    e.s(["CommentsFooter", 0, q], 632096)
}, 779590, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(567692),
        n = e.i(148858),
        s = e.i(213333),
        o = e.i(840216),
        l = e.i(870555),
        c = e.i(399336),
        d = e.i(891685),
        u = e.i(932235),
        m = e.i(635868),
        p = e.i(488549),
        h = e.i(732799),
        f = e.i(586034);

    function x(e) {
        let a, i = (0, r.c)(2),
            {
                connectionStatus: n
            } = e,
            s = "orange";
        return "connected" === n ? s = "green" : "disconnected" === n ? s = "red" : "uninstantiated" === n && (s = "gray"), i[0] !== s ? (a = (0, t.jsx)("div", {
            className: "rounded-full size-[0.7rem] lg:size-3",
            style: {
                backgroundColor: s
            }
        }), i[0] = s, i[1] = a) : a = i[1], a
    }

    function g(e) {
        let a, i = (0, r.c)(2),
            {
                connectionStatus: n
            } = e,
            s = "Open" === n ? "green" : "Connecting" === n ? "orange" : "red";
        return i[0] !== s ? (a = (0, t.jsx)("div", {
            className: "rounded-full size-[0.7rem] lg:size-3",
            style: {
                backgroundColor: s
            }
        }), i[0] = s, i[1] = a) : a = i[1], a
    }

    function v() {
        let e, o, u, f, g, v, w, _, T, M, N, I, P, E, A, O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y = (0, r.c)(87);
        Y[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket", "activeMarketTickSize"], Y[0] = e) : e = Y[0];
        let {
            activeMarket: Q,
            activeMarketTickSize: X
        } = (0, c.useEventActiveMarketContext)(e);
        Y[1] !== Q ? (o = (0, p.getAssetId)(Q), Y[1] = Q, Y[2] = o) : o = Y[2], Y[3] !== X || Y[4] !== o ? (u = {
            assetId: o,
            orderPriceMinTickSize: X
        }, Y[3] = X, Y[4] = o, Y[5] = u) : u = Y[5];
        let {
            assetId: J,
            orderPriceMinTickSize: ee
        } = u;
        Y[6] === Symbol.for("react.memo_cache_sentinel") ? (f = ["bookWorkerApiRef"], Y[6] = f) : f = Y[6];
        let {
            bookWorkerApiRef: et
        } = (0, m.useBookContext)(f), {
            connectionState: er,
            markets: ea,
            resetConnection: ei
        } = (0, h.useMarketWsContext)(), {
            copy: en
        } = (() => {
            let [e, t] = a.useState(void 0), r = a.useCallback(async e => {
                if (!navigator ? .clipboard) return !1;
                try {
                    return await navigator.clipboard.writeText(e), t(e), !0
                } catch {
                    return t(void 0), !1
                }
            }, []);
            return a.useMemo(() => ({
                copiedText: e,
                copy: r
            }), [e, r])
        })(), es = er.status, eo = ((e, t) => {
            let a, i = (0, r.c)(7); {
                let r, n;
                if (i[1] !== e.subscribedAssetIds || i[2] !== t) {
                    let a = t.reduce(S, {});
                    r = [...e.subscribedAssetIds].reduce((e, t) => {
                        let r = a[t];
                        if (r) {
                            let a = r.market.eventSlug ? ? r.market.slug,
                                i = r.market.clobTokenIds,
                                n = r.market.slug;
                            if (e[a]) {
                                let s;
                                i && Array.isArray(i) && i.length > 1 && (s = i.find(e => e !== t)), e[a][n] ? (e[a][n].subscribed.push({
                                    assetId: t,
                                    outcomeIndex: r.outcomeIndex,
                                    tickSize: r.tickSize
                                }), s && e[a][n].subscribed.push({
                                    assetId: s,
                                    outcomeIndex: r.outcomeIndex,
                                    tickSize: r.tickSize
                                })) : e[a][n] = {
                                    subscribed: [{
                                        assetId: t,
                                        outcomeIndex: r.outcomeIndex,
                                        tickSize: r.tickSize
                                    }],
                                    filtered: s ? [{
                                        assetId: s,
                                        outcomeIndex: (r.outcomeIndex + 1) % 2,
                                        tickSize: r.tickSize
                                    }] : []
                                }
                            } else e[a] = {
                                [n]: {
                                    subscribed: [{
                                        assetId: t,
                                        outcomeIndex: r.outcomeIndex,
                                        tickSize: r.tickSize
                                    }],
                                    filtered: []
                                }
                            }
                        }
                        return e
                    }, {}), i[1] = e.subscribedAssetIds, i[2] = t, i[3] = r
                } else r = i[3];
                let s = r;
                i[4] !== s || i[5] !== e.subscribedAssetIds.size ? (n = {
                    status: "enabled",
                    data: {
                        assetsByMarket: s,
                        totalSubscribed: e.subscribedAssetIds.size,
                        totalFiltered: e.subscribedAssetIds.size
                    }
                }, i[4] = s, i[5] = e.subscribedAssetIds.size, i[6] = n) : n = i[6], a = n
            }
            return a
        })(er, ea), {
            status: el,
            totalQueued: ec,
            totalFetching: ed,
            totalFetched: eu,
            totalPolling: em
        } = (() => {
            let e, t, a, n = (0, r.c)(9);
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event", "events"], n[0] = e) : e = n[0];
            let {
                event: s,
                events: o
            } = (0, d.useEventContext)(e), l = (0, i.useBooksStore)(j);
            n[1] !== s || n[2] !== o ? (t = [...o ? ? [], s].reduce(C, {}), n[1] = s, n[2] = o, n[3] = t) : t = n[3];
            let c = t;
            if (n[4] !== l || n[5] !== c) {
                let e;
                n[7] !== c ? (e = (e, t) => {
                    let [r, a] = t;
                    if (c[r]) {
                        let t = c[r].slug,
                            i = c[r].eventSlug ? ? t;
                        e.status[i] || (e.status[i] = []);
                        let n = "queued" === a.book,
                            s = "fetching" === a.book,
                            o = "success" === a.book;
                        e.status[i].push({
                            marketSlug: t,
                            queued: n,
                            fetching: s,
                            fetched: o,
                            polling: a.polling
                        }), n && (e.totalQueued = e.totalQueued + 1), s && (e.totalFetching = e.totalFetching + 1), o && (e.totalFetched = e.totalFetched + 1), a.polling && (e.totalPolling = e.totalPolling + 1)
                    }
                    return e
                }, n[7] = c, n[8] = e) : e = n[8], a = Object.entries(l).reduce(e, {
                    status: {},
                    totalQueued: 0,
                    totalFetching: 0,
                    totalFetched: 0,
                    totalPolling: 0
                }), n[4] = l, n[5] = c, n[6] = a
            } else a = n[6];
            return a
        })(), [ep, eh] = a.default.useState(!1), [ef, ex] = a.default.useState("connections");
        Y[7] !== el ? (g = Object.entries(el).map(k).filter(b), Y[7] = el, Y[8] = g) : g = Y[8];
        let eg = g,
            ev = (0, s.usePrevious)(em),
            [ey, eb] = a.default.useState(!1);
        Y[9] !== ev || Y[10] !== em ? (v = () => {
            let e;
            return em !== ev && (eb(!0), e && clearTimeout(e), e = setTimeout(() => {
                eb(!1)
            })), () => {
                e && clearTimeout(e)
            }
        }, Y[9] = ev, Y[10] = em, Y[11] = v) : v = Y[11], Y[12] !== em ? (w = [em], Y[12] = em, Y[13] = w) : w = Y[13], a.default.useEffect(v, w), Y[14] === Symbol.for("react.memo_cache_sentinel") ? (_ = new Set, Y[14] = _) : _ = Y[14];
        let [ek, ew] = a.default.useState(_);
        Y[15] !== et ? (T = async e => {
            et ? .current && ew(new Set(await et.current.toggleLogAsset(e, !0)))
        }, Y[15] = et, Y[16] = T) : T = Y[16];
        let eS = T;
        Y[17] !== et ? (M = async e => {
            et ? .current && ew(new Set(await et.current.toggleLogAsset(e, !1)))
        }, Y[17] = et, Y[18] = M) : M = Y[18];
        let ej = M;
        Y[19] === Symbol.for("react.memo_cache_sentinel") ? (N = {}, Y[19] = N) : N = Y[19];
        let [eC, e_] = a.default.useState(N);
        Y[20] !== et || Y[21] !== ee ? (I = async e => {
            if (et ? .current) {
                let t = .001 === ee ? .01 : .001;
                await et.current.setMarketTickSize({
                    assetId: e,
                    tickSize: t
                })
            }
        }, Y[20] = et, Y[21] = ee, Y[22] = I) : I = Y[22];
        let eT = I;
        Y[23] === Symbol.for("react.memo_cache_sentinel") ? (P = (0, t.jsx)("span", {
            className: "mr-1",
            children: "Market Worker: "
        }), Y[23] = P) : P = Y[23], Y[24] !== es ? (E = (0, t.jsx)(x, {
            connectionStatus: es
        }), Y[24] = es, Y[25] = E) : E = Y[25], Y[26] !== eo.status || Y[27] !== ep ? (A = "enabled" === eo.status && (0, t.jsx)("button", {
            type: "button",
            style: {
                height: "18px",
                fontSize: "11px",
                marginLeft: "4px"
            },
            onClick: () => eh(!ep),
            children: ep ? "less" : "more"
        }), Y[26] = eo.status, Y[27] = ep, Y[28] = A) : A = Y[28], Y[29] === Symbol.for("react.memo_cache_sentinel") ? (O = {
            height: "18px",
            fontSize: "11px",
            marginLeft: "4px"
        }, Y[29] = O) : O = Y[29], Y[30] !== et ? (D = (0, t.jsx)("button", {
            type: "button",
            style: O,
            onClick: () => {
                et ? .current ? .ping()
            },
            children: "ping"
        }), Y[30] = et, Y[31] = D) : D = Y[31], Y[32] === Symbol.for("react.memo_cache_sentinel") ? (L = {
            height: "18px",
            fontSize: "11px",
            marginLeft: "4px"
        }, Y[32] = L) : L = Y[32], Y[33] !== ei ? (z = (0, t.jsx)("button", {
            type: "button",
            style: L,
            onClick: () => {
                ei()
            },
            children: "reset"
        }), Y[33] = ei, Y[34] = z) : z = Y[34], Y[35] !== E || Y[36] !== A || Y[37] !== D || Y[38] !== z ? (R = (0, t.jsxs)("div", {
            className: "mr-2 flex items-center justify-center",
            children: [P, E, A, D, z]
        }), Y[35] = E, Y[36] = A, Y[37] = D, Y[38] = z, Y[39] = R) : R = Y[39];
        let eM = `Connections (${eo?.data?.totalSubscribed??0})`;
        Y[40] !== eM ? (F = (0, t.jsx)("p", {
            className: "text-[10px] font-medium text-text-secondary",
            children: eM
        }), Y[40] = eM, Y[41] = F) : F = Y[41];
        let eN = ec > 0 && "text-red-500 transition-colors duration-50 delay-0";
        Y[42] !== eN ? ($ = (0, l.cn)("text-text-secondary transition-colors duration-50 delay-1000", eN), Y[42] = eN, Y[43] = $) : $ = Y[43], Y[44] !== $ || Y[45] !== ec ? (B = (0, t.jsxs)("p", {
            className: "text-[10px] font-medium text-text-secondary",
            children: ["Queued (", (0, t.jsx)("span", {
                className: $,
                children: ec
            }), ")"]
        }), Y[44] = $, Y[45] = ec, Y[46] = B) : B = Y[46];
        let eI = ed > 0 && "text-red-500 transition-colors duration-50 delay-0";
        Y[47] !== eI ? (q = (0, l.cn)("text-text-secondary transition-colors duration-50 delay-1000", eI), Y[47] = eI, Y[48] = q) : q = Y[48], Y[49] !== q || Y[50] !== ed ? (V = (0, t.jsxs)("p", {
            className: "text-[10px] font-medium text-text-secondary",
            children: ["Fetching (", (0, t.jsx)("span", {
                className: q,
                children: ed
            }), ")"]
        }), Y[49] = q, Y[50] = ed, Y[51] = V) : V = Y[51];
        let eP = ey && "text-red-500 transition-colors duration-50 delay-0";
        return Y[52] !== eP ? (H = (0, l.cn)("text-text-secondary transition-colors duration-50 delay-1000", eP), Y[52] = eP, Y[53] = H) : H = Y[53], Y[54] !== H || Y[55] !== em ? (U = (0, t.jsxs)("p", {
            className: "text-[10px] font-medium text-text-secondary",
            children: ["Polling (", (0, t.jsx)("span", {
                className: H,
                children: em
            }), ")"]
        }), Y[54] = H, Y[55] = em, Y[56] = U) : U = Y[56], Y[57] !== F || Y[58] !== B || Y[59] !== V || Y[60] !== U ? (W = (0, t.jsxs)("div", {
            className: "flex w-full gap-2 items-center justify-center",
            children: [F, B, V, U]
        }), Y[57] = F, Y[58] = B, Y[59] = V, Y[60] = U, Y[61] = W) : W = Y[61], Y[62] !== R || Y[63] !== W ? (G = (0, t.jsxs)("div", {
            className: "flex flex-col gap-1 w-full",
            children: [R, W]
        }), Y[62] = R, Y[63] = W, Y[64] = G) : G = Y[64], Y[65] !== ef || Y[66] !== J || Y[67] !== eo.data || Y[68] !== eo.status || Y[69] !== ep || Y[70] !== en || Y[71] !== el || Y[72] !== ek || Y[73] !== ee || Y[74] !== eg || Y[75] !== eC || Y[76] !== eS || Y[77] !== ej || Y[78] !== eT || Y[79] !== eu || Y[80] !== ed || Y[81] !== em || Y[82] !== ec ? (Z = ep && (0, t.jsxs)(n.Tabs, {
            value: ef,
            onValueChange: ex,
            className: "w-full max-w-full",
            children: [(0, t.jsxs)(n.TabsList, {
                className: "w-full max-w-full",
                variant: "underline",
                children: [(0, t.jsx)(n.TabsTrigger, {
                    value: "connections",
                    className: "w-auto min-w-auto flex-1 text-xs p-2",
                    children: "Connections"
                }), (0, t.jsxs)(n.TabsTrigger, {
                    value: "fetching",
                    className: "w-auto min-w-auto flex-1 text-xs p-2",
                    children: ["Fetching (", ed, ")"]
                }), (0, t.jsxs)(n.TabsTrigger, {
                    value: "polling",
                    className: "w-auto min-w-auto flex-1 text-xs p-2",
                    children: ["Polling (", em, ")"]
                })]
            }), (0, t.jsx)(n.TabsContent, {
                value: "connections",
                className: "w-full max-w-full min-h-[220px] h-[220px] max-h-[220px] overflow-y-auto bg-surface-2 rounded-md p-4",
                children: (0, t.jsx)("div", {
                    className: "flex flex-col gap-2 w-full min-h-full h-max",
                    children: "enabled" === eo.status && (0, t.jsxs)("div", {
                        className: "flex flex-col gap-2 w-full",
                        children: [(0, t.jsxs)("div", {
                            children: [(0, t.jsxs)("p", {
                                className: "text-xs",
                                children: ["Total Subscribed: ", eo.data.totalSubscribed]
                            }), (0, t.jsxs)("p", {
                                className: "text-xs",
                                children: ["Total Filtered: ", eo.data.totalFiltered]
                            })]
                        }), (0, t.jsx)("div", {
                            className: "flex flex-col gap-2 w-full",
                            children: Object.entries(eo.data.assetsByMarket).map(e => {
                                let [r, a] = e;
                                return (0, t.jsxs)("div", {
                                    className: "flex flex-col gap-1 w-full",
                                    children: [(0, t.jsx)("p", {
                                        className: "text-sm font-medium cursor-pointer",
                                        onClick: () => en(r),
                                        children: `(${Object.values(a).reduce(y,0)}) Event: ${r}`
                                    }), (0, t.jsx)("div", {
                                        className: "flex flex-col gap-1 pl-2",
                                        children: Object.entries(a).map(e => {
                                            let [r, a] = e, {
                                                subscribed: i,
                                                filtered: n
                                            } = a;
                                            return (0, t.jsxs)("div", {
                                                children: [(0, t.jsx)("p", {
                                                    className: "text-xs font-medium cursor-pointer",
                                                    onClick: () => en(r),
                                                    children: r
                                                }), (0, t.jsx)("p", {
                                                    className: "text-xs font-medium pl-2",
                                                    children: "Subscribed:"
                                                }), i.map(e => (0, t.jsxs)("div", {
                                                    className: "w-full pl-4 flex flex-nowrap",
                                                    children: [(0, t.jsx)("span", {
                                                        className: "text-xs font-normal cursor-pointer flex flex-nowrap",
                                                        onClick: () => en(e.assetId),
                                                        children: `${e.assetId.slice(0,4)}...${e.assetId.slice(-4)} (idx: ${e.outcomeIndex})`
                                                    }), (0, t.jsx)("span", {
                                                        className: "text-xs font-normal cursor-pointer ml-4 flex flex-nowrap",
                                                        onClick: () => {
                                                            ek.has(e.assetId) ? ej(e.assetId) : eS(e.assetId)
                                                        },
                                                        children: ek.has(e.assetId) ? "unlog" : "log"
                                                    }), e.assetId === J && (.01 === ee || eC[e.assetId]) && (0, t.jsx)("span", {
                                                        className: "flex items-center gap-2 flex-nowrap",
                                                        children: (0, t.jsx)("span", {
                                                            className: "text-xs font-normal cursor-pointer ml-4",
                                                            onClick: () => {
                                                                eC[e.assetId] ? e_(t => (t[e.assetId] && delete t[e.assetId], t)) : e_(t => ({ ...t,
                                                                    [e.assetId]: !0
                                                                })), eT(e.assetId)
                                                            },
                                                            children: eC[e.assetId] ? "reset tick" : "simulate tick change"
                                                        })
                                                    })]
                                                }, e.assetId)), (0, t.jsx)("p", {
                                                    className: "text-xs font-medium pl-2",
                                                    children: "Filtered:"
                                                }), n.map(e => (0, t.jsx)("span", {
                                                    className: "text-xs font-normal pl-4 cursor-pointer",
                                                    onClick: () => en(e.assetId),
                                                    children: `${e.assetId.slice(0,4)}...${e.assetId.slice(-4)} (idx: ${e.outcomeIndex})`
                                                }, e.assetId))]
                                            }, r)
                                        })
                                    })]
                                }, r)
                            })
                        })]
                    })
                })
            }), (0, t.jsx)(n.TabsContent, {
                value: "fetching",
                className: "w-full max-w-full min-h-[220px] h-[220px] max-h-[220px] overflow-y-auto bg-surface-2 rounded-md p-4",
                children: (0, t.jsx)("div", {
                    className: "flex flex-col gap-2 w-full min-h-full h-max",
                    children: eu + ec + ed === 0 ? (0, t.jsx)("div", {
                        className: "flex flex-col gap-1",
                        children: (0, t.jsx)("p", {
                            className: "text-sm font-medium text-text-secondary",
                            children: "No fetching or queued markets"
                        })
                    }) : (0, t.jsx)("div", {
                        className: "flex flex-col gap-1",
                        children: Object.entries(el).map(e => {
                            let [r, a] = e;
                            return (0, t.jsxs)("div", {
                                className: "flex flex-col gap-1",
                                children: [(0, t.jsx)("p", {
                                    className: "text-sm font-medium",
                                    children: `(${a.length}) Event: ${r}`
                                }), (0, t.jsx)("div", {
                                    className: "flex flex-col gap-1 pl-2",
                                    children: a.map(e => (0, t.jsxs)("div", {
                                        className: "flex w-full max-w-full gap-2 items-center",
                                        children: [(0, t.jsx)("div", {
                                            className: (0, l.cn)("w-2.5 h-2.5 rounded-full bg-red-500", e.queued && "bg-border", e.fetching && "bg-yellow-500", e.fetched && "bg-green-500")
                                        }), (0, t.jsx)("p", {
                                            className: "text-xs font-medium flex-1 truncate cursor-pointer",
                                            onClick: () => en(e.marketSlug),
                                            children: e.marketSlug
                                        })]
                                    }, e.marketSlug))
                                })]
                            }, r)
                        })
                    })
                })
            }), (0, t.jsx)(n.TabsContent, {
                value: "polling",
                className: "w-full max-w-full min-h-[220px] h-[220px] max-h-[220px] overflow-y-auto bg-surface-2 rounded-md p-4",
                children: (0, t.jsx)("div", {
                    className: "flex w-full min-h-full h-max",
                    children: 0 === eg.length ? (0, t.jsx)("div", {
                        className: "flex flex-col gap-1",
                        children: (0, t.jsx)("p", {
                            className: "text-sm font-medium text-text-secondary",
                            children: "No polling markets"
                        })
                    }) : (0, t.jsx)("div", {
                        className: "flex flex-col gap-1",
                        children: eg.map(e => {
                            let [r, a] = e;
                            return (0, t.jsxs)("div", {
                                className: "flex flex-col gap-1",
                                children: [(0, t.jsx)("p", {
                                    className: "text-sm font-medium",
                                    children: `(${a.length}) Event: ${r}`
                                }), (0, t.jsx)("div", {
                                    className: "flex flex-col gap-1 pl-2",
                                    children: a.map(e => (0, t.jsx)("div", {
                                        children: (0, t.jsx)("p", {
                                            className: "text-xs font-medium cursor-pointer",
                                            onClick: () => en(e.marketSlug),
                                            children: e.marketSlug
                                        })
                                    }, e.marketSlug))
                                })]
                            }, r)
                        })
                    })
                })
            })]
        }), Y[65] = ef, Y[66] = J, Y[67] = eo.data, Y[68] = eo.status, Y[69] = ep, Y[70] = en, Y[71] = el, Y[72] = ek, Y[73] = ee, Y[74] = eg, Y[75] = eC, Y[76] = eS, Y[77] = ej, Y[78] = eT, Y[79] = eu, Y[80] = ed, Y[81] = em, Y[82] = ec, Y[83] = Z) : Z = Y[83], Y[84] !== G || Y[85] !== Z ? (K = (0, t.jsxs)("div", {
            className: "flex flex-col gap-2 w-full",
            children: [G, Z]
        }), Y[84] = G, Y[85] = Z, Y[86] = K) : K = Y[86], K
    }

    function y(e, t) {
        return e + t.subscribed.length
    }

    function b(e) {
        let [, t] = e;
        return t.length > 0
    }

    function k(e) {
        let [t, r] = e;
        return [t, r.filter(w)]
    }

    function w(e) {
        return e.polling
    }

    function S(e, t) {
        return Array.isArray(t.clobTokenIds) && t.clobTokenIds.length > 0 && t.clobTokenIds.forEach((r, a) => {
            e[r] = {
                outcomeIndex: a,
                market: t,
                tickSize: t.orderPriceMinTickSize
            }
        }), e
    }

    function j(e) {
        return e.fetchStatus
    }

    function C(e, t) {
        return t.markets.forEach(r => {
            e[(0, p.getAssetId)(r)] = {
                slug: r.slug,
                eventSlug: t.slug
            }
        }), e
    }
    e.s(["StatusIconComponent", 0, g, "default", 0, function() {
        let e, i, n, s, l, c, d, m, p, h, y, b, k, w, S = (0, r.c)(26),
            {
                userConnectionStatus: j
            } = (0, f.useUserWsContext)(),
            {
                connectionStatus: C,
                ping: _
            } = (0, u.useSportsWebsocketContext)(),
            T = void 0 === C ? "uninstantiated" : C,
            M = (0, o.useBoundSportsStore)();
        S[0] !== M ? (e = () => {
            if (M) return M.getState().cardView
        }, S[0] = M, S[1] = e) : e = S[1];
        let [N, I] = a.default.useState(e);
        return S[2] !== M ? (i = () => {
            M && M.subscribe(e => {
                I(e.cardView)
            })
        }, n = [M], S[2] = M, S[3] = i, S[4] = n) : (i = S[3], n = S[4]), a.default.useEffect(i, n), S[5] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("div", {
            className: "mr-2 flex items-center justify-center",
            children: (0, t.jsx)("span", {
                className: "mr-1 font-semibold",
                children: "Websocket Channels"
            })
        }), S[5] = s) : s = S[5], S[6] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, t.jsx)("span", {
            className: "mr-1",
            children: "User Channel: "
        }), S[6] = l) : l = S[6], S[7] !== j ? (c = (0, t.jsxs)("div", {
            className: "mr-2 flex items-center justify-center",
            children: [l, (0, t.jsx)(g, {
                connectionStatus: j
            })]
        }), S[7] = j, S[8] = c) : c = S[8], S[9] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)(v, {}), S[9] = d) : d = S[9], S[10] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, t.jsx)("span", {
            className: "mr-1",
            children: "Sports Channel: "
        }), S[10] = m) : m = S[10], S[11] !== T ? (p = (0, t.jsx)(x, {
            connectionStatus: T
        }), S[11] = T, S[12] = p) : p = S[12], S[13] === Symbol.for("react.memo_cache_sentinel") ? (h = {
            height: "18px",
            fontSize: "11px",
            marginLeft: "4px"
        }, S[13] = h) : h = S[13], S[14] !== _ ? (y = (0, t.jsx)("button", {
            type: "button",
            style: h,
            onClick: () => _ ? .(),
            children: "ping"
        }), S[14] = _, S[15] = y) : y = S[15], S[16] !== y || S[17] !== p ? (b = (0, t.jsxs)("div", {
            className: "mr-2 flex items-center justify-center",
            children: [m, p, y]
        }), S[16] = y, S[17] = p, S[18] = b) : b = S[18], S[19] !== N || S[20] !== M ? (k = !!N && (0, t.jsxs)("div", {
            className: "mr-2 flex items-center justify-center",
            children: [(0, t.jsx)("span", {
                className: "mr-1",
                children: "Sports Card View: "
            }), (0, t.jsx)("button", {
                type: "button",
                style: {
                    height: "18px",
                    fontSize: "11px",
                    marginLeft: "4px"
                },
                onClick: () => {
                    M && ("aggregate" === N ? M.setState({
                        cardView: "default"
                    }) : M.setState({
                        cardView: "aggregate"
                    }))
                },
                children: N
            })]
        }), S[19] = N, S[20] = M, S[21] = k) : k = S[21], S[22] !== b || S[23] !== k || S[24] !== c ? (w = (0, t.jsxs)("div", {
            className: "mt-4 flex w-full flex-col",
            children: [s, c, d, b, k]
        }), S[22] = b, S[23] = k, S[24] = c, S[25] = w) : w = S[25], w
    }], 779590)
}, 566160, 265725, 960867, e => {
    "use strict";
    let t;
    var r = e.i(221628),
        a = e.i(999061),
        i = e.i(416340),
        n = e.i(827681),
        s = e.i(863828),
        o = e.i(858021),
        l = e.i(580442),
        c = e.i(593332),
        d = e.i(668122),
        u = e.i(79075),
        m = e.i(784521),
        p = e.i(305457),
        h = e.i(1637),
        f = e.i(891685),
        x = e.i(6204),
        g = e.i(632096),
        v = e.i(284553),
        y = e.i(336896),
        b = e.i(779590),
        k = e.i(328113),
        w = e.i(397456),
        S = e.i(606231),
        j = e.i(655740),
        C = e.i(631222);
    let _ = (0, i.createContext)({
            connectionStatus: "Uninstantiated"
        }),
        T = () => (0, i.useContext)(_);
    e.s(["EventWebsocketProvider", 0, ({
        eventSlug: e,
        entityId: t,
        entityType: a,
        eventHandlers: n,
        isDisabled: s,
        subscriptions: o,
        children: l
    }) => {
        let c = (0, k.useLatest)(n),
            d = (0, i.useRef)([]),
            u = (0, i.useRef)(w.ReadyState.UNINSTANTIATED),
            m = (0, i.useRef)(null),
            [p] = (0, i.useState)(() => Math.random().toString(36).substr(2, 9)),
            h = (0, i.useMemo)(() => {
                let r = [];
                return e && r.push({
                    topic: "activity",
                    type: "trades",
                    filters: JSON.stringify({
                        event_slug: e
                    })
                }), t && a && r.push({
                    topic: "comments",
                    type: "*",
                    filters: `{"parentEntityID":${t},"parentEntityType":"${a}"}`
                }), o && r.push(...o), {
                    subscriptions: r
                }
            }, [e, t, a, p, o]),
            f = !s && e ? C.LIVE_DATA_WEBSOCKET_URL : null,
            x = (0, i.useRef)({}),
            g = (0, i.useRef)({}),
            v = (0, i.useRef)({}),
            y = (0, i.useCallback)(() => {
                let e, t, r, a = new Date,
                    i = a.getUTCHours(),
                    n = a.getUTCMinutes(),
                    s = ((t = new Date(Date.UTC(e = a.getUTCFullYear(), 2, 1, 7, 0, 0))).setUTCDate(1 + (7 - t.getUTCDay() + 7) % 7 + 7), (r = new Date(Date.UTC(e, 10, 1, 6, 0, 0))).setUTCDate(1 + (7 - r.getUTCDay()) % 7), a >= t && a < r) ? -4 : -5,
                    o = (i + s + 24) % 24 + n / 60,
                    l = a.getUTCDay(),
                    c = l;
                return i + s < 0 ? c = (l - 1 + 7) % 7 : i + s >= 24 && (c = (l + 1) % 7), 0 === c || 6 === c || o >= 16 || o < 9.5
            }, []),
            b = (0, i.useCallback)(async e => {
                try {
                    let {
                        data: t
                    } = await j.axios.get("/api/equity/ticker-snapshot", {
                        params: {
                            symbol: e
                        },
                        timeout: 1e4
                    });
                    if (t ? .currentPrice) return t.currentPrice;
                    return null
                } catch {
                    return null
                }
            }, []),
            T = (0, i.useCallback)(e => {
                let t = [],
                    r = Date.now() - 18e4;
                for (let a = 0; a < 180; a++) t.push({
                    timestamp: r + 1e3 * a,
                    value: e
                });
                return t
            }, []),
            M = (0, i.useCallback)(e => {
                let t = x.current[e];
                if (!t || !c.current ? .update) return;
                let r = {
                    symbol: e,
                    timestamp: t.timestamp + 1e3,
                    value: t.value
                };
                x.current[e] = {
                    timestamp: r.timestamp,
                    value: r.value
                }, c.current.update(r)
            }, []),
            N = (0, i.useCallback)(e => {
                M(e), v.current[e] = setInterval(() => {
                    M(e)
                }, 1e3)
            }, [M]),
            I = (0, i.useCallback)(e => {
                N(e)
            }, [N]),
            P = (0, i.useCallback)(e => {
                g.current[e] && (clearTimeout(g.current[e]), delete g.current[e]), v.current[e] && (clearInterval(v.current[e]), delete v.current[e])
            }, []),
            E = (0, i.useCallback)(() => {
                new Set([...Object.keys(g.current), ...Object.keys(v.current)]).forEach(e => P(e))
            }, [P]);
        (0, i.useEffect)(() => () => {
            E()
        }, [E]);
        let {
            readyState: A,
            sendMessage: O
        } = (0, S.useWebSocket)({
            url: f,
            onClose: () => {
                E(), d.current = []
            },
            onMessage: e => {
                if (e.data) try {
                    let t = JSON.parse(e.data);
                    if ("update" === t.type && t.payload) {
                        let e = o ? .some(e => "equity_prices" === e.topic) && t.payload.symbol,
                            r = t.payload.timestamp || t.payload.time;
                        if (e && t.payload.symbol && "number" == typeof r && "number" == typeof t.payload.value) {
                            let e = t.payload.symbol;
                            x.current[e] = {
                                timestamp: r < 1e10 ? 1e3 * r : r,
                                value: t.payload.value
                            }, P(e), g.current[e] = setTimeout(() => {
                                I(e)
                            }, 1500)
                        }
                    }
                    if (c.current && t.type in c.current) {
                        let e = c.current[t.type];
                        t.payload && e && e(t.payload)
                    }
                } catch {}
            },
            maxReconnectAttempts: 5,
            reconnectInterval: 1e4,
            shouldReconnect: () => !s && !!e
        }), D = {
            [w.ReadyState.CONNECTING]: "Connecting",
            [w.ReadyState.OPEN]: "Open",
            [w.ReadyState.CLOSING]: "Closing",
            [w.ReadyState.CLOSED]: "Closed",
            [w.ReadyState.UNINSTANTIATED]: "Uninstantiated"
        }[A];
        (0, i.useEffect)(() => {
            u.current = A, m.current = O
        }, [A, O]), (0, i.useEffect)(() => {
            if (A !== w.ReadyState.OPEN) return;
            let e = d.current;
            if (e.length > 0) try {
                O(JSON.stringify({
                    action: "unsubscribe",
                    subscriptions: e
                })), e.forEach(e => {
                    if ("equity_prices" === e.topic && e.filters) try {
                        let t = JSON.parse(e.filters).symbol;
                        t && (P(t), delete x.current[t])
                    } catch {}
                })
            } catch {}
            if (h.subscriptions.length > 0) try {
                O(JSON.stringify({
                    action: "subscribe",
                    subscriptions: h.subscriptions
                })), y() && c.current ? .subscribe && h.subscriptions.forEach(async e => {
                    if ("equity_prices" === e.topic && e.filters) try {
                        let t = JSON.parse(e.filters).symbol;
                        if (t) {
                            let e = await b(t),
                                r = {
                                    symbol: t,
                                    data: T(e || 100)
                                };
                            c.current ? .subscribe && c.current.subscribe(r);
                            let a = r.data[r.data.length - 1];
                            x.current[t] = {
                                timestamp: a.timestamp,
                                value: a.value
                            }, g.current[t] = setTimeout(() => {
                                I(t)
                            }, 1500)
                        }
                    } catch {}
                })
            } catch {}
            d.current = h.subscriptions
        }, [h, A, O, y, T, I, b, P]), (0, i.useEffect)(() => () => {
            if (u.current === w.ReadyState.OPEN && d.current.length > 0 && m.current) try {
                m.current(JSON.stringify({
                    action: "unsubscribe",
                    subscriptions: d.current
                }))
            } catch {}
            x.current = {}
        }, []), (0, i.useEffect)(() => {
            let e;
            return "Open" === D && (e = setInterval(() => {
                m.current && m.current("PING")
            }, 3e4)), () => {
                e && clearInterval(e)
            }
        }, [D]);
        let L = (0, i.useMemo)(() => ({
            connectionStatus: D
        }), [D]);
        return (0, r.jsx)(_.Provider, {
            value: L,
            children: l
        })
    }, "useEventWebsocket", 0, T], 265725);
    var M = e.i(122538),
        N = e.i(635973),
        I = e.i(474157),
        P = e.i(510954),
        E = e.i(57096),
        A = e.i(499390);
    let O = e => ({
        entityType: e.queryKey[2],
        entityId: e.queryKey[3],
        sortBy: e.queryKey[4],
        holdersOnly: e.queryKey[5],
        commentId: e.queryKey[6]
    });
    var D = e.i(601550),
        L = e.i(318594);
    let z = e => {
            let t, r, i, n, s, o, l, c = (0, a.c)(20),
                {
                    commentsEventQueryKey: d
                } = e,
                u = (0, L.useQueryClient)(),
                m = d.queryKey[2],
                p = d.queryKey[3];
            if (c[0] !== p || c[1] !== m || c[2] !== u) {
                let e;
                e = {
                    queryKey: P.queryKeys[E.QueryKey.Comments].event._def,
                    predicate: e => {
                        let t = e.queryKey;
                        return t[2] === m && t[3] === p && !t[6]
                    }
                }, t = {
                    cancelAllVariants: () => u.cancelQueries(e),
                    invalidateAllVariants: () => u.invalidateQueries(e),
                    snapshotAllVariants: () => u.getQueriesData(e),
                    restoreVariants: e => {
                        e.forEach(([e, t]) => {
                            u.setQueryData(e, t)
                        })
                    },
                    setEachVariant: t => {
                        u.getQueriesData(e).forEach(([e, r]) => {
                            if (!r) return;
                            let a = t(r, {
                                holdersOnly: !!e[5]
                            });
                            a && a !== r && u.setQueryData(e, a)
                        })
                    }
                }, c[0] = p, c[1] = m, c[2] = u, c[3] = t
            } else t = c[3];
            let h = t;
            c[4] !== h ? (r = () => h.cancelAllVariants(), c[4] = h, c[5] = r) : r = c[5];
            let f = r;
            c[6] !== h ? (i = () => h.invalidateAllVariants(), c[6] = h, c[7] = i) : i = c[7];
            let x = i;
            c[8] !== h ? (n = () => h.snapshotAllVariants(), c[8] = h, c[9] = n) : n = c[9];
            let g = n;
            c[10] !== h ? (s = e => h.restoreVariants(e), c[10] = h, c[11] = s) : s = c[11];
            let v = s;
            c[12] !== h ? (o = e => h.setEachVariant(e), c[12] = h, c[13] = o) : o = c[13];
            let y = o;
            return c[14] !== f || c[15] !== x || c[16] !== v || c[17] !== y || c[18] !== g ? (l = {
                cancelAllVariants: f,
                invalidateAllVariants: x,
                snapshotAllVariants: g,
                restoreVariants: v,
                setEachVariant: y
            }, c[14] = f, c[15] = x, c[16] = v, c[17] = y, c[18] = g, c[19] = l) : l = c[19], l
        },
        R = e => {
            let t, r, i, n, s = (0, a.c)(9),
                {
                    commentsEventQueryKey: o
                } = e;
            s[0] !== o ? (t = {
                commentsEventQueryKey: o
            }, s[0] = o, s[1] = t) : t = s[1];
            let {
                invalidateAllVariants: l
            } = z(t);
            s[2] !== l ? (r = () => {
                l()
            }, s[2] = l, s[3] = r) : r = s[3], s[4] !== o.queryKey || s[5] !== r ? (i = {
                mutationKey: o.queryKey,
                mutationFn: I.createCommentFetcher,
                onSettled: r
            }, s[4] = o.queryKey, s[5] = r, s[6] = i) : i = s[6];
            let c = (0, D.useMutation)(i);
            return s[7] !== c ? (n = {
                mutation: c
            }, s[7] = c, s[8] = n) : n = s[8], n
        };
    var F = e.i(23128),
        $ = e.i(211721),
        B = e.i(149534);
    let q = ({
        strokeWidth: e = 1.5,
        ...t
    }) => i.default.createElement(B.Icon, {
        size: "18px",
        ...t
    }, i.default.createElement("path", {
        d: "m12.4012,2.75c-.399-.6885-1.1861-1.1016-2.0212-.9771l-6.924,1.0291c-1.092.1619-1.846,1.179-1.684,2.272l.978,6.5808",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), i.default.createElement("path", {
        d: "m13.75,5.25h-6.5c-1.105,0-2,.895-2,2v6.5c0,1.105.895,2,2,2h6.5c1.105,0,2-.895,2-2v-6.5c0-1.105-.895-2-2-2Z",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), i.default.createElement("path", {
        d: "m12.75,11c.552,0,1-.4477,1-1s-.448-1-1-1-1,.4477-1,1,.448,1,1,1Z",
        fill: "currentColor",
        strokeWidth: "0",
        "data-color": "color-2"
    }), i.default.createElement("path", {
        d: "m8.25,11c.552,0,1-.4477,1-1s-.448-1-1-1-1,.4477-1,1,.448,1,1,1Z",
        fill: "currentColor",
        strokeWidth: "0",
        "data-color": "color-2"
    }), i.default.createElement("path", {
        d: "m9.3695,11.8237c.7156.1717,1.4592.1786,2.2344-.0001.3429-.079.6631.1762.6431.5275-.0524.919-.8151,1.6489-1.7471,1.6489-.9221,0-1.6783-.7142-1.7452-1.6193-.0252-.341.2823-.6367.6148-.5569Z",
        fill: "currentColor",
        strokeWidth: "0",
        "data-color": "color-2"
    }));
    var V = e.i(661907),
        H = e.i(604777),
        U = e.i(632567),
        W = e.i(222163),
        G = Object.defineProperty,
        Z = {},
        K = {
            ActiveEmoji: () => tl,
            Empty: () => to,
            List: () => ta,
            Loading: () => tn,
            Root: () => eK,
            Search: () => eY,
            SkinTone: () => tc,
            SkinToneSelector: () => ti,
            Viewport: () => eX
        };
    for (var Y in K) G(Z, Y, {
        get: K[Y],
        enumerable: !0
    });
    var Q = "'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif",
        X = ["none", "light", "medium-light", "medium", "medium-dark", "dark"];

    function J(e) {
        return e.charAt(0).toUpperCase() + e.slice(1)
    }
    var ee = null;

    function et(e) {
        try {
            ee ? ? = document.createElement("canvas").getContext("2d", {
                willReadFrequently: !0
            })
        } catch {}
        if (!ee || (queueMicrotask(() => {
                ee && (ee = null)
            }), ee.canvas.width = 2, ee.canvas.height = 2, ee.font = `2px ${Q}`, ee.textBaseline = "middle", ee.measureText(e).width >= 4)) return !1;
        ee.fillStyle = "#00f", ee.fillText(e, 0, 0);
        let t = ee.getImageData(0, 0, 2, 2).data;
        ee.clearRect(0, 0, 2, 2), ee.fillStyle = "#f00", ee.fillText(e, 0, 0);
        let r = ee.getImageData(0, 0, 2, 2).data;
        for (let e = 0; e < 16; e += 4)
            if (t[e] !== r[e] || t[e + 1] !== r[e + 1] || t[e + 2] !== r[e + 2]) return !1;
        return !0
    }

    function er(e, t, r) {
        try {
            let a = e.getItem(t);
            if (!a) throw Error(`No value found for "${t}".`);
            let i = JSON.parse(a);
            return r(i)
        } catch {
            return null
        }
    }

    function ea(e, t, r) {
        e.setItem(t, JSON.stringify(r))
    }

    function ei(e) {
        return t => void 0 === t ? void 0 : e(t)
    }

    function en(e) {
        return t => null === t ? null : e(t)
    }

    function es(e) {
        if ("string" != typeof e) throw Error();
        return e
    }

    function eo(e) {
        if ("number" != typeof e) throw Error();
        return e
    }

    function el(e) {
        if ("boolean" != typeof e) throw Error();
        return e
    }

    function ec(e) {
        return t => {
            if ("object" != typeof t || null === t) throw Error();
            let r = {};
            for (let a in e) {
                let i = t[a];
                void 0 === i && e[a](void 0), r[a] = e[a](i)
            }
            return r
        }
    }

    function ed(e) {
        return t => {
            if (!Array.isArray(t)) throw Error();
            return t.length > 0 && e(t[0]), t
        }
    }
    var eu = (e, t) => `${e}/${t}/data.json`,
        em = (e, t) => `${e}/${t}/messages.json`,
        ep = ["bn", "da", "de", "en-gb", "en", "es-mx", "es", "et", "fi", "fr", "hi", "hu", "it", "ja", "ko", "lt", "ms", "nb", "nl", "pl", "pt", "ru", "sv", "th", "uk", "vi", "zh-hant", "zh"],
        eh = e => `frimousse/data/${e}`,
        ef = "frimousse/metadata";
    async function ex(e, t) {
        try {
            return (await fetch(e, {
                method: "HEAD",
                signal: t
            })).headers.get("etag")
        } catch {
            return null
        }
    }
    async function eg(e, t, r) {
        let [{
            emojis: a,
            emojisEtag: i
        }, {
            messages: n,
            messagesEtag: s
        }] = await Promise.all([fetch(eu(e, t), {
            signal: r
        }).then(async e => ({
            emojis: await e.json(),
            emojisEtag: e.headers.get("etag")
        })), fetch(em(e, t), {
            signal: r
        }).then(async e => ({
            messages: await e.json(),
            messagesEtag: e.headers.get("etag")
        }))]);
        return {
            emojis: a,
            messages: n,
            emojisEtag: i,
            messagesEtag: s
        }
    }
    async function ev(e, t, r) {
        let [a, i] = await Promise.all([ex(eu(e, t), r), ex(em(e, t), r)]);
        return {
            emojisEtag: a,
            messagesEtag: i
        }
    }
    async function ey(e, t, r) {
        let {
            emojis: a,
            emojisEtag: i,
            messages: n,
            messagesEtag: s
        } = await eg(e, t, r), o = n.subgroups.find(e => "country-flag" === e.key || "subdivision-flag" === e.key), l = n.groups.filter(e => "component" !== e.key), c = a.filter(e => "group" in e), d = l.map(e => ({
            index: e.order,
            label: J(e.message)
        })), u = n.skinTones.reduce((e, t) => (e[t.key] = J(t.message), e), {}), m = {
            locale: t,
            emojis: c.map(e => ({
                emoji: e.emoji,
                category: e.group,
                version: e.version,
                label: J(e.label),
                tags: e.tags ? ? [],
                countryFlag: o && e.subgroup === o.order || void 0,
                skins: e.skins ? e.skins.filter(e => "number" == typeof e.tone).reduce((e, t) => (e[X[t.tone]] = t.emoji, e), {}) : void 0
            })),
            categories: d,
            skinTones: u
        };
        return ea(localStorage, eh(t), {
            data: m,
            metadata: {
                emojisEtag: i,
                messagesEtag: s
            }
        }), m
    }
    var eb = ec({
            emojiVersion: eo,
            countryFlags: el
        }),
        ek = ec({
            data: ec({
                locale: es,
                emojis: ed(ec({
                    emoji: es,
                    category: eo,
                    label: es,
                    version: eo,
                    tags: ed(es),
                    countryFlag: ei(el),
                    skins: ei(ec({
                        light: es,
                        "medium-light": es,
                        medium: es,
                        "medium-dark": es,
                        dark: es
                    }))
                })),
                categories: ed(ec({
                    index: eo,
                    label: es
                })),
                skinTones: ec({
                    light: es,
                    "medium-light": es,
                    medium: es,
                    "medium-dark": es,
                    dark: es
                })
            }),
            metadata: ec({
                emojisEtag: en(es),
                messagesEtag: en(es)
            })
        });
    async function ew({
        locale: e,
        emojiVersion: t,
        emojibaseUrl: r,
        signal: a
    }) {
        let i = "string" == typeof r ? r : `https://cdn.jsdelivr.net/npm/emojibase-data@${"number"==typeof t?Math.floor(t):"latest"}`,
            n = er(sessionStorage, ef, eb),
            s = er(localStorage, eh(e), ek),
            o;
        if (s)
            if (n) o = s.data;
            else try {
                let {
                    emojisEtag: t,
                    messagesEtag: r
                } = await ev(i, e, a);
                o = t && r && t === s.metadata.emojisEtag && r === s.metadata.messagesEtag ? s.data : await ey(i, e, a)
            } catch {
                o = s.data
            } else o = await ey(i, e, a);
        return ea(sessionStorage, ef, n ? ? = function(e, t) {
            let r = new Map;
            for (let t of e) r.has(t.version) || r.set(t.version, t.emoji);
            let a = [...r.keys()].sort((e, t) => t - e),
                i = a[0] ? ? 0,
                n = et("🇪🇺");
            if ("number" == typeof t) return {
                emojiVersion: t,
                countryFlags: n
            };
            for (let e of a)
                if (et(r.get(e))) return {
                    emojiVersion: e,
                    countryFlags: n
                };
            return {
                emojiVersion: i,
                countryFlags: n
            }
        }(o.emojis, t)), {
            locale: e,
            emojis: o.emojis.filter(e => {
                let t = e.version <= n.emojiVersion;
                return e.countryFlag ? t && n.countryFlags : t
            }),
            categories: o.categories,
            skinTones: o.skinTones
        }
    }

    function eS(e) {
        return ep.includes(e) ? e : (console.warn(`Locale "${e}" is not supported, using "en" instead.`), "en")
    }

    function ej(e) {
        return X.includes(e) ? e : (console.warn(`Skin tone "${e}" is not valid, using "none" instead.`), "none")
    }

    function eC(e, t, r = Object.is) {
        let [a, n] = (0, i.useState)(() => t(e.get()));
        return (0, i.useEffect)(() => e.subscribe(() => {
            let a = t(e.get());
            n(e => r(e, a) ? e : a)
        }), [e, t, r]), (0, i.useDebugValue)(a), a
    }

    function e_(e, t, r) {
        return eC(e, (0, i.useCallback)(e => e[t], [t]), r)
    }
    var {
        useStore: eT,
        Provider: eM
    } = (t = (0, i.createContext)(null), {
        useStore: () => {
            let e = (0, i.useContext)(t);
            if (!e) throw Error("EmojiPicker.Root is missing.");
            return e
        },
        Provider: ({
            store: e,
            children: a
        }) => (0, r.jsx)(t.Provider, {
            value: e,
            children: a
        })
    });

    function eN(e) {
        return e.search
    }

    function eI(e) {
        return "none" === e.interaction ? void 0 : e.data ? .rows[e.activeRowIndex] ? .emojis[e.activeColumnIndex]
    }

    function eP(e) {
        return void 0 === e.data || "number" == typeof e.data ? .count && 0 === e.data.count
    }

    function eE(e) {
        return null === e.data || null === e.viewportHeight || null === e.rowHeight || null === e.categoryHeaderHeight
    }

    function eA(e) {
        return e.data ? .rows.length
    }

    function eO(e) {
        return e.data ? .categories.length
    }

    function eD(e) {
        return e.data ? .categoriesStartRowIndices
    }

    function eL(e) {
        return e.data ? .skinTones
    }

    function ez(e, t) {
        return e ? .emoji === t ? .emoji
    }

    function eR(e, t) {
        return e ? .categoryIndex === t ? .categoryIndex && e ? .emojis.length === t ? .emojis.length && !!e ? .emojis.every((e, r) => ez(e, t ? .emojis[r]))
    }
    var eF = /\p{Emoji_Modifier_Base}/u,
        e$ = /\uFE0F$/,
        eB = /\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,
        eq = {
            light: "🏻",
            "medium-light": "🏼",
            medium: "🏽",
            "medium-dark": "🏾",
            dark: "🏿"
        };

    function eV() {
        let e = eC(eT(), eI, ez);
        return (0, i.useDeferredValue)(e)
    }

    function eH(e = "✋") {
        let t = eT(),
            r = e_(t, "skinTone"),
            a = (0, i.useMemo)(() => X.map(t => ({
                skinTone: t,
                emoji: function(e, t) {
                    if (!e.split("‍").some(e => eF.test(e))) return e;
                    let r = e.split("‍").map(e => e.replace(eB, "")).join("‍");
                    return "none" === t ? r : r.split("‍").map((e, r, a) => {
                        let i = a.length > 1;
                        return !eF.test(e) || i && "🤝" === e ? e : e.replace(e$, "") + eq[t]
                    }).join("‍")
                }(e, t)
            })), [e]);
        return [r, (0, i.useCallback)(e => {
            t.set({
                skinTone: e
            })
        }, []), a]
    }

    function eU(e, t) {
        if (Object.is(e, t)) return !0;
        if ("object" != typeof e || "object" != typeof t || null === e || null === t || Array.isArray(e) !== Array.isArray(t)) return !1;
        let r = Object.keys(e),
            a = Object.keys(t);
        return r.length === a.length && r.every(r => r in t && e[r] === t[r])
    }

    function eW() {}
    var eG = "u" > typeof window ? i.useLayoutEffect : i.useEffect;

    function eZ({
        emojiVersion: e,
        emojibaseUrl: t
    }) {
        let [r, a] = (0, i.useState)(void 0), n = eT(), s = e_(n, "locale"), o = e_(n, "columns"), l = e_(n, "skinTone"), c = e_(n, "search");
        return (0, i.useEffect)(() => {
            let r = new AbortController,
                i = r.signal;
            return ew({
                locale: s,
                emojiVersion: e,
                emojibaseUrl: t,
                signal: i
            }).then(e => {
                a(e)
            }).catch(e => {
                i.aborted || console.error(e)
            }), () => {
                r.abort()
            }
        }, [e, t, s]), (0, i.useEffect)(() => {
            if (r) return function(e, t) {
                let r = null;
                if ("function" == typeof window.requestIdleCallback) r = window.requestIdleCallback(e, t);
                else {
                    let a = Date.now();
                    r = window.setTimeout(() => {
                        e({
                            didTimeout: !1,
                            timeRemaining: () => Math.max(0, (t ? .timeout ? ? 50) - (Date.now() - a))
                        })
                    }, 10)
                }
                return () => {
                    "function" == typeof window.cancelIdleCallback ? window.cancelIdleCallback(r) : window.clearTimeout(r)
                }
            }(() => {
                n.get().onDataChange(function(e, t, r, a) {
                    let i = function(e, t) {
                            if (!t) return e;
                            let r = t.toLowerCase().trim(),
                                a = new WeakMap;
                            return e.filter(e => {
                                let t = 0;
                                for (let a of (e.label.toLowerCase().includes(r) && (t += 10), e.tags)) a.toLowerCase().includes(r) && (t += 1);
                                return t > 0 && (a.set(e, t), !0)
                            }).sort((e, t) => (a.get(t) ? ? 0) - (a.get(e) ? ? 0))
                        }(e.emojis, a),
                        n = [],
                        s = [],
                        o = [],
                        l = {},
                        c = 0,
                        d = 0;
                    for (let e of i) l[e.category] || (l[e.category] = []), l[e.category].push({
                        emoji: r && "none" !== r && e.skins ? e.skins[r] : e.emoji,
                        label: e.label
                    });
                    for (let r of e.categories) {
                        let e = l[r.index];
                        if (!e || 0 === e.length) continue;
                        let a = (function(e, t) {
                            let r = [];
                            if (t <= 0) return r;
                            for (let a = 0, i = e.length; a < i; a += t) r.push(e.slice(a, a + t));
                            return r
                        })(Array.from(e), t).map(e => ({
                            categoryIndex: c,
                            emojis: e
                        }));
                        n.push(...a), s.push({
                            label: r.label,
                            rowsCount: a.length,
                            startRowIndex: d
                        }), o.push(d), c++, d += a.length
                    }
                    return {
                        count: i.length,
                        categories: s,
                        categoriesStartRowIndices: o,
                        rows: n,
                        skinTones: e.skinTones
                    }
                }(r, o, l, c))
            }, {
                timeout: 100
            })
        }, [r, o, l, c]), null
    }
    var eK = (0, i.forwardRef)(({
            locale: e = "en",
            columns: t = 9,
            skinTone: a = "none",
            onEmojiSelect: n = eW,
            emojiVersion: s,
            emojibaseUrl: o,
            onFocusCapture: l,
            onBlurCapture: c,
            children: d,
            style: u,
            sticky: m = !0,
            ...p
        }, h) => {
            let f, x = (f = (0, i.useRef)(n), eG(() => {
                    f.current = n
                }), (0, i.useCallback)((...e) => f.current(...e), [])),
                g = function(e) {
                    let [t] = (0, i.useState)(e);
                    return t
                }(() => {
                    var r, i, n;
                    let s, o, l, c, d, u, p, h;
                    return r = eS(e), i = ej(a), s = 0, n = (e, a) => ({
                        locale: r,
                        columns: t,
                        sticky: m,
                        skinTone: i,
                        onEmojiSelect: x,
                        data: null,
                        search: "",
                        interaction: "none",
                        activeColumnIndex: 0,
                        activeRowIndex: 0,
                        rowHeight: null,
                        categoryHeaderHeight: null,
                        viewportWidth: null,
                        viewportHeight: null,
                        viewportCurrentCategoryIndex: null,
                        viewportStartCategoryIndex: 0,
                        viewportStartRowIndex: 0,
                        viewportEndRowIndex: 0,
                        rootRef: null,
                        searchRef: null,
                        viewportRef: null,
                        listRef: null,
                        updateViewportState: t => {
                            let r = a(),
                                i = t ? .data ? ? r.data,
                                n = t ? .categoryHeaderHeight ? ? r.categoryHeaderHeight,
                                o = t ? .rowHeight ? ? r.rowHeight,
                                l = t ? .viewportHeight ? ? r.viewportHeight;
                            if (!i || 0 === i.rows.length || !n || !o || !l) return e({ ...t,
                                viewportStartCategoryIndex: 0,
                                viewportStartRowIndex: 0,
                                viewportEndRowIndex: 0
                            });
                            let c = 0,
                                d = 0;
                            for (let e of i.categories)
                                if (d++ * n + e.startRowIndex * o < s) c += n;
                                else break;
                            let u = i.categories.length * n + i.rows.length * o,
                                m = Math.floor(2 * o / 2),
                                p = Math.ceil(2 * o / 2),
                                h = Math.min(s - c - m, u - l),
                                f = Math.max(0, Math.floor(h / o)),
                                x = Math.min(i.rows.length - 1, Math.ceil((h + l + p) / o)),
                                g = i.rows[f] ? .categoryIndex;
                            return e(void 0 === g && t ? t : { ...t,
                                viewportStartCategoryIndex: g,
                                viewportStartRowIndex: f,
                                viewportEndRowIndex: x
                            })
                        },
                        onDataChange: e => {
                            a().updateViewportState({
                                data: e,
                                activeColumnIndex: 0,
                                activeRowIndex: 0
                            })
                        },
                        onSearchChange: t => {
                            e({
                                search: t,
                                interaction: t ? "keyboard" : "none"
                            })
                        },
                        onActiveEmojiChange: (t, r, i) => {
                            if (e({
                                    interaction: t,
                                    activeColumnIndex: r,
                                    activeRowIndex: i
                                }), "keyboard" !== t) return;
                            let {
                                listRef: n,
                                viewportRef: o,
                                sticky: l,
                                rowHeight: c,
                                viewportHeight: d,
                                categoryHeaderHeight: u
                            } = a(), m = n ? .current, p = o ? .current;
                            if (!m || !p || !c || !u || !d) return;
                            0 === i && p.scrollTo({
                                top: 0,
                                behavior: "instant"
                            });
                            let h = m.querySelector(`[aria-rowindex="${i}"]`);
                            if (!(h instanceof HTMLElement)) return;
                            let f = h.offsetTop,
                                x = getComputedStyle(h),
                                g = Number.parseFloat(x.scrollMarginTop),
                                v = Number.parseFloat(x.scrollMarginBottom),
                                y = s + g;
                            l && f < s + d / 2 && (y += u);
                            let b = y + d - v;
                            (f < y || f + c > b) && p.scrollTo({
                                top: Math.max(f < y + u ? f - Math.max(l ? u : 0, g) : f - d + c + v, 0),
                                behavior: "instant"
                            })
                        },
                        onActiveEmojiReset: () => {
                            e({
                                interaction: "none",
                                activeColumnIndex: 0,
                                activeRowIndex: 0
                            })
                        },
                        onRowHeightChange: e => {
                            a().updateViewportState({
                                rowHeight: e
                            })
                        },
                        onCategoryHeaderHeightChange: e => {
                            a().updateViewportState({
                                categoryHeaderHeight: e
                            })
                        },
                        onViewportSizeChange: (e, t) => {
                            a().updateViewportState({
                                viewportWidth: e,
                                viewportHeight: t
                            })
                        },
                        onViewportScroll: e => {
                            s = e, a().updateViewportState()
                        }
                    }), o = {}, l = null, c = null, d = new Set, u = () => {
                        if (l)
                            for (let e of (o = l, l = null, d)) e(o);
                        c = null
                    }, p = () => l ? ? o, o = n(h = e => {
                        Object.assign(l ? ? = o, "function" == typeof e ? e(p()) : e), c || (c = requestAnimationFrame(u))
                    }, p), {
                        get: p,
                        set: h,
                        subscribe: e => (d.add(e), () => d.delete(e))
                    }
                }),
                [v, y] = (0, i.useState)(!1),
                b = (0, i.useRef)(null),
                k = (0, i.useCallback)(e => {
                    e && (b.current = e, g.set({
                        rootRef: b
                    }))
                }, []);
            eG(() => {
                g.set({
                    locale: eS(e)
                })
            }, [e]), eG(() => {
                g.set({
                    columns: t
                })
            }, [t]), eG(() => {
                g.set({
                    sticky: m
                })
            }, [m]), eG(() => {
                g.set({
                    skinTone: ej(a)
                })
            }, [a]);
            let w = (0, i.useCallback)(e => {
                    l ? .(e);
                    let {
                        searchRef: t,
                        viewportRef: r
                    } = g.get(), a = e.target === t ? .current || e.target.hasAttribute("frimousse-search"), i = e.target === r ? .current || e.target.hasAttribute("frimousse-viewport");
                    e.isDefaultPrevented() || (y(a || i), e.isDefaultPrevented() || (y(a || i), i ? g.get().onActiveEmojiChange("keyboard", 0, 0) : a && "" === g.get().search && g.set({
                        interaction: "none"
                    })))
                }, [l]),
                S = (0, i.useCallback)(e => {
                    c ? .(e), e.isDefaultPrevented() || e.currentTarget.contains(e.relatedTarget) || y(!1)
                }, [c]);
            return eG(() => {
                v || g.get().onActiveEmojiReset()
            }, [v]), (0, i.useImperativeHandle)(h, () => b.current), (0, i.useEffect)(() => {
                if (v) return document.addEventListener("keydown", e), () => {
                    document.removeEventListener("keydown", e)
                };

                function e(e) {
                    if (e.defaultPrevented || !e.key.startsWith("Arrow") && "Enter" !== e.key) return;
                    let {
                        data: t,
                        onEmojiSelect: r,
                        onActiveEmojiChange: a,
                        interaction: i,
                        activeColumnIndex: n,
                        activeRowIndex: s
                    } = g.get();
                    if ("Enter" === e.key) {
                        let t = eI(g.get());
                        t && (e.preventDefault(), r(t))
                    }
                    if (e.key.startsWith("Arrow")) {
                        let r = n,
                            o = s;
                        if (e.preventDefault(), "none" !== i) {
                            if (t ? .rows && t.rows.length > 0) switch (e.key) {
                                case "ArrowLeft":
                                    if (0 === r) {
                                        let e = o - 1,
                                            a = t.rows[e];
                                        a && (o = e, r = a.emojis.length - 1)
                                    } else r -= 1;
                                    break;
                                case "ArrowRight":
                                    if (r === t.rows[o].emojis.length - 1) {
                                        let e = o + 1;
                                        t.rows[e] && (o = e, r = 0)
                                    } else r += 1;
                                    break;
                                case "ArrowUp":
                                    {
                                        let e = t.rows[o - 1];e && (o -= 1, e.emojis[r] || (r = e.emojis.length - 1));
                                        break
                                    }
                                case "ArrowDown":
                                    {
                                        let e = t.rows[o + 1];e && (o += 1, e.emojis[r] || (r = e.emojis.length - 1))
                                    }
                            }
                            a("keyboard", r, o)
                        } else a("keyboard", 0, 0)
                    }
                }
            }, [v]), eG(() => {
                let e = null,
                    t = null,
                    r = null,
                    a = null,
                    i = g.subscribe(i => {
                        b.current && (e !== i.viewportWidth && (e = i.viewportWidth, b.current.style.setProperty("--frimousse-viewport-width", `${i.viewportWidth}px`)), t !== i.viewportHeight && (t = i.viewportHeight, b.current.style.setProperty("--frimousse-viewport-height", `${i.viewportHeight}px`)), r !== i.rowHeight && (r = i.rowHeight, b.current.style.setProperty("--frimousse-row-height", `${i.rowHeight}px`)), a !== i.categoryHeaderHeight && (a = i.categoryHeaderHeight, b.current.style.setProperty("--frimousse-category-header-height", `${i.categoryHeaderHeight}px`)))
                    }),
                    {
                        viewportWidth: n,
                        viewportHeight: s,
                        rowHeight: o,
                        categoryHeaderHeight: l
                    } = g.get();
                return n && b.current.style.setProperty("--frimousse-viewport-width", `${n}px`), s && b.current.style.setProperty("--frimousse-viewport-height", `${s}px`), o && b.current.style.setProperty("--frimousse-row-height", `${o}px`), l && b.current.style.setProperty("--frimousse-category-header-height", `${l}px`), i
            }, []), (0, r.jsx)("div", {
                "data-focused": v ? "" : void 0,
                "frimousse-root": "",
                onBlurCapture: S,
                onFocusCapture: w,
                ...p,
                ref: k,
                style: {
                    "--frimousse-emoji-font": Q,
                    ...u
                },
                children: (0, r.jsxs)(eM, {
                    store: g,
                    children: [(0, r.jsx)(eZ, {
                        emojiVersion: s,
                        emojibaseUrl: o
                    }), d]
                })
            })
        }),
        eY = (0, i.forwardRef)(({
            value: e,
            defaultValue: t,
            onChange: a,
            ...n
        }, s) => {
            let o = eT(),
                l = (0, i.useRef)(null),
                c = (0, i.useCallback)(e => {
                    e && (l.current = e, o.set({
                        searchRef: l
                    }))
                }, []),
                d = "string" == typeof e,
                u = (0, i.useRef)(d);
            (0, i.useEffect)(() => {
                u.current = d
            }, [d]), eG(() => {
                o.set({
                    search: "string" == typeof e ? e : "string" == typeof t ? t : ""
                })
            }, []), eG(() => {
                "string" == typeof e && o.get().onSearchChange(e)
            }, [e]);
            let m = (0, i.useCallback)(e => {
                a ? .(e), e.isDefaultPrevented() || o.get().onSearchChange(e.target.value)
            }, [a]);
            return (0, i.useImperativeHandle)(s, () => l.current), (0, r.jsx)("input", {
                autoCapitalize: "off",
                autoComplete: "off",
                autoCorrect: "off",
                enterKeyHint: "done",
                "frimousse-search": "",
                placeholder: "Search…",
                spellCheck: !1,
                type: "search",
                ...n,
                defaultValue: t,
                onChange: m,
                ref: c,
                value: e
            })
        }),
        eQ = (0, i.memo)(() => {
            let e = eV();
            return e ? (0, r.jsx)("div", {
                "aria-live": "polite",
                style: {
                    border: 0,
                    clip: "rect(0, 0, 0, 0)",
                    height: 1,
                    margin: -1,
                    overflow: "hidden",
                    padding: 0,
                    position: "absolute",
                    whiteSpace: "nowrap",
                    width: 1,
                    wordWrap: "normal"
                },
                children: e.label
            }) : null
        }),
        eX = (0, i.forwardRef)(({
            children: e,
            onScroll: t,
            onKeyDown: a,
            style: n,
            ...s
        }, o) => {
            let l = eT(),
                c = (0, i.useRef)(null),
                d = (0, i.useCallback)(e => {
                    e && (c.current = e, l.set({
                        viewportRef: c
                    }))
                }, []),
                u = eC(l, eA),
                m = eC(l, eO),
                p = (0, i.useCallback)(e => {
                    t ? .(e), l.get().onViewportScroll(e.currentTarget.scrollTop)
                }, [t]);
            return eG(() => {
                if (!c.current) return;
                let e = new ResizeObserver(([e]) => {
                    let t = e ? .borderBoxSize[0] ? .inlineSize ? ? 0,
                        r = e ? .borderBoxSize[0] ? .blockSize ? ? 0,
                        {
                            onViewportSizeChange: a,
                            viewportHeight: i,
                            viewportWidth: n
                        } = l.get();
                    (i !== r || n !== t) && a(t, r)
                });
                return e.observe(c.current), l.get().onViewportSizeChange(c.current.offsetWidth, c.current.clientHeight), () => {
                    e.disconnect()
                }
            }, []), (0, i.useImperativeHandle)(o, () => c.current), (0, r.jsxs)("div", {
                "frimousse-viewport": "",
                ...s,
                onScroll: p,
                ref: d,
                style: {
                    position: "relative",
                    boxSizing: "border-box",
                    contain: "layout paint",
                    containIntrinsicSize: "number" == typeof u && "number" == typeof m ? `var(--frimousse-viewport-width, auto) calc(${u} * var(--frimousse-row-height) + ${m} * var(--frimousse-category-header-height))` : void 0,
                    overflowY: "auto",
                    overscrollBehavior: "contain",
                    scrollbarGutter: "stable",
                    willChange: "scroll-position",
                    ...n
                },
                children: [(0, r.jsx)(eQ, {}), e]
            })
        });

    function eJ(e, t, r) {
        return {
            emoji: { ...e,
                isActive: r
            },
            role: "gridcell",
            "aria-colindex": t,
            "aria-selected": r || void 0,
            "aria-label": e.label,
            "data-active": r ? "" : void 0,
            "frimousse-emoji": "",
            style: {
                fontFamily: "var(--frimousse-emoji-font)"
            },
            tabIndex: -1
        }
    }

    function e0(e, t = !1) {
        return {
            role: t ? void 0 : "row",
            "aria-rowindex": t ? void 0 : e,
            "frimousse-row": "",
            style: {
                contain: t ? void 0 : "content",
                height: t ? void 0 : "var(--frimousse-row-height)",
                display: "flex"
            }
        }
    }

    function e1(e, t) {
        return {
            "frimousse-category": "",
            style: {
                contain: "content",
                top: t ? `calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))` : void 0,
                height: t ? `calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))` : void 0,
                width: "100%",
                pointerEvents: "none",
                position: "absolute"
            }
        }
    }

    function e2(e, t = !1, r = !0) {
        return {
            category: e,
            "frimousse-category-header": "",
            style: {
                contain: t ? void 0 : "layout paint",
                height: t ? void 0 : "var(--frimousse-category-header-height)",
                pointerEvents: "auto",
                position: r ? "sticky" : void 0,
                top: 0
            }
        }
    }

    function e3(e, t, r, a) {
        return {
            "frimousse-list-sizer": "",
            style: {
                position: "relative",
                boxSizing: "border-box",
                height: `calc(${e} * var(--frimousse-row-height) + ${t} * var(--frimousse-category-header-height))`,
                paddingTop: `calc(${r} * var(--frimousse-row-height) + ${a} * var(--frimousse-category-header-height))`
            }
        }
    }

    function e4(e, t, r) {
        return {
            "aria-colcount": e,
            "aria-rowcount": t,
            "frimousse-list": "",
            style: {
                "--frimousse-list-columns": e,
                ...r
            },
            role: "grid"
        }
    }

    function e5(e) {
        e.preventDefault()
    }
    var e6 = (0, i.memo)(({
            Emoji: e,
            emoji: t,
            columnIndex: a,
            rowIndex: n
        }) => {
            let s = eT(),
                o = eC(s, e => eI(e) ? .emoji === t.emoji),
                l = (0, i.useCallback)(() => {
                    s.get().onEmojiSelect(t)
                }, [t]),
                c = (0, i.useCallback)(() => {
                    s.get().onActiveEmojiChange("pointer", a, n)
                }, [a, n]),
                d = (0, i.useCallback)(() => {
                    s.get().onActiveEmojiReset()
                }, []);
            return (0, r.jsx)(e, { ...eJ(t, a, o),
                onClick: l,
                onPointerDown: e5,
                onPointerEnter: c,
                onPointerLeave: d
            })
        }),
        e9 = (0, i.memo)(({
            Row: e,
            Emoji: t,
            rowIndex: a
        }) => {
            let i = eC(eT(), e => e.data ? .rows[a], eR);
            return i ? (0, r.jsx)(e, { ...e0(a),
                children: i.emojis.map((e, i) => (0, r.jsx)(e6, {
                    Emoji: t,
                    columnIndex: i,
                    emoji: e,
                    rowIndex: a
                }, e.label))
            }) : null
        }),
        e8 = (0, i.memo)(({
            CategoryHeader: e,
            categoryIndex: t
        }) => {
            let a = eT(),
                i = eC(a, e => e.data ? .categories[t], eU),
                n = e_(a, "sticky");
            return i ? (0, r.jsx)("div", { ...e1(t, i),
                children: (0, r.jsx)(e, { ...e2({
                        label: i.label
                    }, !1, n)
                })
            }) : null
        }),
        e7 = (0, i.memo)(({
            CategoryHeader: e,
            Row: t,
            Emoji: a
        }) => {
            let n = (0, i.useRef)(null),
                s = eT(),
                o = e_(s, "columns"),
                l = (0, i.useMemo)(() => Array(o).fill({
                    emoji: "🙂",
                    label: ""
                }), [o]),
                c = (0, i.useMemo)(() => ({
                    label: "Category"
                }), []),
                d = (0, i.useRef)(null),
                u = (0, i.useRef)(null);
            return eG(() => {
                let e = n.current ? .parentElement ? .parentElement;
                if (!e || !d.current || !u.current) return;
                let t = new ResizeObserver(e => {
                    for (let t of e) {
                        let e = t.contentRect.height,
                            {
                                onRowHeightChange: r,
                                onCategoryHeaderHeightChange: a,
                                rowHeight: i,
                                categoryHeaderHeight: n
                            } = s.get();
                        t.target === d.current && i !== e && r(e), t.target === u.current && n !== e && a(e)
                    }
                });
                t.observe(e), t.observe(d.current), t.observe(u.current);
                let {
                    onRowHeightChange: r,
                    onCategoryHeaderHeightChange: a
                } = s.get();
                return r(d.current.clientHeight), a(u.current.clientHeight), () => {
                    t.disconnect()
                }
            }, []), (0, r.jsxs)("div", {
                "aria-hidden": !0,
                ref: n,
                style: {
                    height: 0,
                    visibility: "hidden"
                },
                children: [(0, r.jsx)("div", {
                    "frimousse-row-sizer": "",
                    ref: d,
                    children: (0, r.jsx)(t, { ...e0(-1, !0),
                        children: l.map((e, t) => (0, r.jsx)(a, { ...eJ(e, t, !1)
                        }, t))
                    })
                }), (0, r.jsx)("div", { ...e1(-1),
                    children: (0, r.jsx)("div", {
                        "frimousse-category-header-sizer": "",
                        ref: u,
                        children: (0, r.jsx)(e, { ...e2(c, !0)
                        })
                    })
                })]
            })
        });

    function te({
        category: e,
        ...t
    }) {
        return (0, r.jsx)("div", { ...t,
            children: e.label
        })
    }

    function tt({
        emoji: e,
        ...t
    }) {
        return (0, r.jsx)("button", {
            type: "button",
            ...t,
            children: e.emoji
        })
    }

    function tr({ ...e
    }) {
        return (0, r.jsx)("div", { ...e
        })
    }
    var ta = (0, i.forwardRef)(({
            style: e,
            components: t,
            ...a
        }, n) => {
            let s = eT(),
                o = (0, i.useRef)(null),
                l = (0, i.useCallback)(e => {
                    e && (o.current = e, s.set({
                        listRef: o
                    }))
                }, []),
                c = t ? .CategoryHeader ? ? te,
                d = t ? .Emoji ? ? tt,
                u = t ? .Row ? ? tr,
                m = e_(s, "columns"),
                p = e_(s, "viewportStartRowIndex"),
                h = e_(s, "viewportEndRowIndex"),
                f = eC(s, eA),
                x = eC(s, eD, eU),
                g = (0, i.useMemo)(() => x ? .filter(e => e < p).length ? ? 0, [x, p]),
                v = x ? .length ? ? 0;
            return (0, i.useImperativeHandle)(n, () => o.current), f && x && 0 !== v ? (0, r.jsx)("div", { ...e4(m, f, e),
                ...a,
                ref: l,
                children: (0, r.jsxs)("div", { ...e3(f, v, p, g),
                    children: [(0, r.jsx)(e7, {
                        CategoryHeader: c,
                        Emoji: d,
                        Row: u
                    }), Array.from({
                        length: h - p + 1
                    }, (e, t) => {
                        let a = p + t,
                            n = x.indexOf(a);
                        return (0, r.jsxs)(i.Fragment, {
                            children: [n >= 0 && (0, r.jsx)("div", {
                                style: {
                                    height: "var(--frimousse-category-header-height)"
                                }
                            }), (0, r.jsx)(e9, {
                                Emoji: d,
                                Row: u,
                                rowIndex: a
                            })]
                        }, a)
                    }), Array.from({
                        length: v
                    }, (e, t) => (0, r.jsx)(e8, {
                        CategoryHeader: c,
                        categoryIndex: t
                    }, t))]
                })
            }) : (0, r.jsx)("div", { ...e4(m, 0, e),
                ...a,
                children: (0, r.jsx)("div", { ...e3(0, 0, 0, 0),
                    children: (0, r.jsx)(e7, {
                        CategoryHeader: c,
                        Emoji: d,
                        Row: u
                    })
                })
            })
        }),
        ti = (0, i.forwardRef)(({
            emoji: e,
            onClick: t,
            "aria-label": a = "Change skin tone",
            ...n
        }, s) => {
            let o = eC(eT(), eL, eU),
                [l, c, d] = eH(e),
                u = (0, i.useMemo)(() => Math.max(0, d.findIndex(e => e.skinTone === l)), [l, d]),
                m = d[u],
                p = d[(u + 1) % d.length].skinTone,
                h = "none" === l ? void 0 : o ? .[l],
                f = "none" === p ? void 0 : o ? .[p],
                x = (0, i.useCallback)(e => {
                    t ? .(e), e.isDefaultPrevented() || c(p)
                }, [t, c, p]);
            return (0, r.jsx)("button", {
                type: "button",
                ...n,
                "aria-label": a + (f ? ` (${f})` : ""),
                "aria-live": "polite",
                "aria-valuetext": h,
                "frimousse-skin-tone-selector": "",
                onClick: x,
                ref: s,
                children: m.emoji
            })
        });

    function tn({
        children: e,
        ...t
    }) {
        return eC(eT(), eE) ? (0, r.jsx)("span", {
            "frimousse-loading": "",
            ...t,
            children: e
        }) : null
    }

    function ts({
        children: e
    }) {
        return e({
            search: eC(eT(), eN)
        })
    }

    function to({
        children: e,
        ...t
    }) {
        return eC(eT(), eP) ? (0, r.jsx)("span", {
            "frimousse-empty": "",
            ...t,
            children: "function" == typeof e ? (0, r.jsx)(ts, {
                children: e
            }) : e
        }) : null
    }

    function tl({
        children: e
    }) {
        return e({
            emoji: eV()
        })
    }

    function tc({
        children: e,
        emoji: t
    }) {
        let [r, a, i] = eH(t);
        return e({
            skinTone: r,
            setSkinTone: a,
            skinToneVariations: i
        })
    }
    eK.displayName = "EmojiPicker.Root", eY.displayName = "EmojiPicker.Search", eX.displayName = "EmojiPicker.Viewport", ta.displayName = "EmojiPicker.List", tn.displayName = "EmojiPicker.Loading", to.displayName = "EmojiPicker.Empty", ti.displayName = "EmojiPicker.SkinToneSelector", tl.displayName = "EmojiPicker.ActiveEmoji", tc.displayName = "EmojiPicker.SkinTone";
    let td = ({
        strokeWidth: e = 1.5,
        ...t
    }) => i.default.createElement(B.Icon, {
        size: "18px",
        ...t
    }, i.default.createElement("circle", {
        cx: "9",
        cy: "9",
        r: "7.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), i.default.createElement("path", {
        d: "M12.749,11c-.717,1.338-2.128,2.25-3.749,2.25s-3.033-.912-3.749-2.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), i.default.createElement("circle", {
        cx: "7",
        cy: "8",
        r: "1",
        fill: "currentColor",
        "data-color": "color-2",
        "data-stroke": "none"
    }), i.default.createElement("circle", {
        cx: "11",
        cy: "8",
        r: "1",
        fill: "currentColor",
        "data-color": "color-2",
        "data-stroke": "none"
    }));

    function tu(e) {
        let t, i, n, s, o, l, c, d, u, m, p, h, f = (0, a.c)(27),
            {
                open: x,
                onOpenChange: g,
                onEmojiSelect: v
            } = e,
            y = (0, H.useTranslations)();
        return f[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, r.jsx)(W.PopoverTrigger, {
            asChild: !0,
            children: (0, r.jsx)("button", {
                type: "button",
                className: "hidden md:flex items-center justify-center size-8 rounded-md text-text-secondary cursor-pointer hover:bg-neutral-50 active:scale-90 transition-transform",
                children: (0, r.jsx)(td, {})
            })
        }), f[0] = t) : t = f[0], f[1] !== v ? (i = e => {
            v(e.emoji)
        }, f[1] = v, f[2] = i) : i = f[2], f[3] !== y ? (n = y("comments.emojiPicker.search"), f[3] = y, f[4] = n) : n = f[4], f[5] !== n ? (s = (0, r.jsx)(Z.Search, {
            className: "z-10 mx-2 mt-2 appearance-none rounded-md bg-input-filled-bg px-2.5 py-2 text-body-sm text-text-primary placeholder:text-text-secondary focus:outline-none",
            placeholder: n
        }), f[5] = n, f[6] = s) : s = f[6], f[7] !== y ? (o = y("comments.emojiPicker.loading"), f[7] = y, f[8] = o) : o = f[8], f[9] !== o ? (l = (0, r.jsx)(Z.Loading, {
            className: "absolute inset-0 flex items-center justify-center text-text-secondary text-body-sm",
            children: o
        }), f[9] = o, f[10] = l) : l = f[10], f[11] !== y ? (c = y("comments.emojiPicker.noResults"), f[11] = y, f[12] = c) : c = f[12], f[13] !== c ? (d = (0, r.jsx)(Z.Empty, {
            className: "absolute inset-0 flex items-center justify-center text-text-secondary text-body-sm",
            children: c
        }), f[13] = c, f[14] = d) : d = f[14], f[15] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, r.jsx)(Z.List, {
            className: "select-none pb-1.5",
            components: {
                CategoryHeader: th,
                Row: tp,
                Emoji: tm
            }
        }), f[15] = u) : u = f[15], f[16] !== l || f[17] !== d ? (m = (0, r.jsxs)(Z.Viewport, {
            className: "relative flex-1 outline-hidden",
            children: [l, d, u]
        }), f[16] = l, f[17] = d, f[18] = m) : m = f[18], f[19] !== m || f[20] !== i || f[21] !== s ? (p = (0, r.jsx)(W.PopoverContent, {
            side: "top",
            align: "end",
            sideOffset: 0,
            className: "w-auto p-0 border-none shadow-lg rounded-xl",
            children: (0, r.jsxs)(Z.Root, {
                className: "isolate flex h-[400px] w-[320px] flex-col bg-background border rounded-xl",
                onEmojiSelect: i,
                children: [s, m]
            })
        }), f[19] = m, f[20] = i, f[21] = s, f[22] = p) : p = f[22], f[23] !== g || f[24] !== x || f[25] !== p ? (h = (0, r.jsxs)(W.Popover, {
            open: x,
            onOpenChange: g,
            children: [t, p]
        }), f[23] = g, f[24] = x, f[25] = p, f[26] = h) : h = f[26], h
    }

    function tm(e) {
        let {
            emoji: t,
            ...a
        } = e;
        return (0, r.jsx)("button", {
            type: "button",
            className: "flex size-8 items-center justify-center rounded-md text-lg data-active:bg-neutral-100 dark:data-active:bg-neutral-800",
            ...a,
            children: t.emoji
        })
    }

    function tp(e) {
        let {
            children: t,
            ...a
        } = e;
        return (0, r.jsx)("div", {
            className: "scroll-my-1.5 px-1.5",
            ...a,
            children: t
        })
    }

    function th(e) {
        let {
            category: t,
            ...a
        } = e;
        return (0, r.jsx)("div", {
            className: "bg-background px-3 pt-3 pb-1.5 font-medium text-text-secondary text-body-xs",
            ...a,
            children: t.label
        })
    }
    var tf = e.i(827525),
        tx = e.i(697972),
        tg = e.i(435894),
        tv = e.i(525962),
        ty = e.i(664318),
        tb = e.i(197994);
    let tk = ({ ...e
    }) => i.default.createElement(tb.Icon, {
        size: "18px",
        ...e
    }, i.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M11.1083 11.1083C11.4012 10.8154 11.876 10.8154 12.1689 11.1083L16.2803 15.2197C16.5732 15.5126 16.5732 15.9874 16.2803 16.2803C15.9874 16.5732 15.5126 16.5732 15.2197 16.2803L11.1083 12.1689C10.8154 11.876 10.8154 11.4012 11.1083 11.1083Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), i.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M1.5 7.75C1.5 4.29829 4.29829 1.5 7.75 1.5C11.2017 1.5 14 4.29829 14 7.75C14 11.2017 11.2017 14 7.75 14C4.29829 14 1.5 11.2017 1.5 7.75ZM7.75 3C5.12671 3 3 5.12671 3 7.75C3 10.3733 5.12671 12.5 7.75 12.5C10.3733 12.5 12.5 10.3733 12.5 7.75C12.5 5.12671 10.3733 3 7.75 3Z",
        fill: "currentColor"
    }));
    var tw = e.i(415142);

    function tS(e) {
        let t, i, n, s, o, l = (0, a.c)(13),
            {
                category: c,
                onClick: d
            } = e,
            u = c.gif ? .images ? .fixed_width ? .webp || c.gif ? .images ? .fixed_width ? .url;
        return l[0] !== c.name || l[1] !== d ? (t = () => d(c.name), l[0] = c.name, l[1] = d, l[2] = t) : t = l[2], l[3] !== c.name || l[4] !== u ? (i = u ? (0, r.jsx)("img", {
            src: u,
            alt: c.name,
            className: "absolute inset-0 w-full h-full object-cover",
            loading: "lazy"
        }) : (0, r.jsx)("div", {
            className: "absolute inset-0 bg-neutral-100 dark:bg-neutral-800"
        }), l[3] = c.name, l[4] = u, l[5] = i) : i = l[5], l[6] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, r.jsx)("div", {
            className: "absolute inset-0 bg-black/30 group-hover:bg-black/45 transition-colors"
        }), l[6] = n) : n = l[6], l[7] !== c.name ? (s = (0, r.jsx)("span", {
            className: "absolute inset-0 flex items-center justify-center text-white font-semibold text-sm capitalize",
            children: c.name
        }), l[7] = c.name, l[8] = s) : s = l[8], l[9] !== t || l[10] !== i || l[11] !== s ? (o = (0, r.jsxs)("button", {
            type: "button",
            className: "relative w-full aspect-[2/1.2] rounded-lg overflow-hidden cursor-pointer group",
            onClick: t,
            children: [i, n, s]
        }), l[9] = t, l[10] = i, l[11] = s, l[12] = o) : o = l[12], o
    }

    function tj(e) {
        let t, i, n, s = (0, a.c)(10),
            {
                gif: o,
                onSelect: l
            } = e,
            c = o.images ? .fixed_width ? .webp || o.images ? .fixed_width ? .url,
            d = o.images ? .original ? .webp || o.images ? .original ? .url;
        return s[0] !== o.id || s[1] !== l || s[2] !== d ? (t = () => l({
            id: o.id,
            url: d
        }), s[0] = o.id, s[1] = l, s[2] = d, s[3] = t) : t = s[3], s[4] !== c || s[5] !== o.title ? (i = (0, r.jsx)("img", {
            src: c,
            alt: o.title,
            className: "w-full h-auto block",
            loading: "lazy"
        }), s[4] = c, s[5] = o.title, s[6] = i) : i = s[6], s[7] !== t || s[8] !== i ? (n = (0, r.jsx)("button", {
            type: "button",
            className: "w-full rounded-lg overflow-hidden cursor-pointer hover:opacity-80 active:scale-95 transition-all",
            onClick: t,
            children: i
        }), s[7] = t, s[8] = i, s[9] = n) : n = s[9], n
    }

    function tC(e) {
        let t, i, n = (0, a.c)(8),
            {
                categories: s,
                isLoading: o,
                onCategoryClick: l
            } = e;
        if (o) {
            let e;
            return n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, r.jsx)("div", {
                className: "grid grid-cols-2 gap-2",
                children: Array.from({
                    length: 8
                }).map(t_)
            }), n[0] = e) : e = n[0], e
        }
        if (n[1] !== s || n[2] !== l) {
            let e;
            n[4] !== l ? (e = e => (0, r.jsx)(tS, {
                category: e,
                onClick: l
            }, e.name_encoded), n[4] = l, n[5] = e) : e = n[5], t = s.map(e), n[1] = s, n[2] = l, n[3] = t
        } else t = n[3];
        return n[6] !== t ? (i = (0, r.jsx)("div", {
            className: "grid grid-cols-2 gap-2",
            children: t
        }), n[6] = t, n[7] = i) : i = n[7], i
    }

    function t_(e, t) {
        return (0, r.jsx)(ty.Skeleton, {
            className: "w-full aspect-[2/1.2] rounded-lg"
        }, t)
    }

    function tT(e) {
        let t, i, n = (0, a.c)(10),
            {
                results: s,
                isLoading: o,
                onSelect: l,
                noResultsText: c
            } = e;
        if (o && 0 === s.length) {
            let e;
            return n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, r.jsx)("div", {
                className: "grid grid-cols-2 gap-2",
                children: Array.from({
                    length: 6
                }).map(tM)
            }), n[0] = e) : e = n[0], e
        }
        if (!o && 0 === s.length) {
            let e;
            return n[1] !== c ? (e = (0, r.jsx)("div", {
                className: "flex items-center justify-center py-12 text-text-secondary text-sm",
                children: c
            }), n[1] = c, n[2] = e) : e = n[2], e
        }
        if (n[3] !== l || n[4] !== s) {
            let e;
            n[6] !== l ? (e = e => (0, r.jsx)(tj, {
                gif: e,
                onSelect: l
            }, e.id), n[6] = l, n[7] = e) : e = n[7], t = s.map(e), n[3] = l, n[4] = s, n[5] = t
        } else t = n[5];
        return n[8] !== t ? (i = (0, r.jsx)("div", {
            className: "grid grid-cols-2 gap-2",
            children: t
        }), n[8] = t, n[9] = i) : i = n[9], i
    }

    function tM(e, t) {
        return (0, r.jsx)(ty.Skeleton, {
            className: "w-full aspect-square rounded-lg"
        }, t)
    }

    function tN(e) {
        let t, i, n, s, o, l, c = (0, a.c)(20),
            {
                query: d,
                setQuery: u,
                hasQuery: m,
                categories: p,
                categoriesLoading: h,
                results: f,
                searchLoading: x,
                onCategoryClick: g,
                onSelect: v,
                searchPlaceholder: y,
                noResultsText: b
            } = e;
        return c[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, r.jsx)(tk, {
            className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary pointer-events-none"
        }), c[0] = t) : t = c[0], c[1] !== u ? (i = e => u(e.target.value), c[1] = u, c[2] = i) : i = c[2], c[3] !== d || c[4] !== y || c[5] !== i ? (n = (0, r.jsx)("div", {
            className: "px-4 pt-1 shrink-0",
            children: (0, r.jsxs)("div", {
                className: "relative",
                children: [t, (0, r.jsx)(tg.Input, {
                    variant: "filled",
                    className: "pl-10 rounded-xl focus-visible:ring-0",
                    placeholder: y,
                    value: d,
                    onChange: i
                })]
            })
        }), c[3] = d, c[4] = y, c[5] = i, c[6] = n) : n = c[6], c[7] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, r.jsx)("div", {
            className: "h-2.5 shrink-0"
        }), c[7] = s) : s = c[7], c[8] !== p || c[9] !== h || c[10] !== m || c[11] !== b || c[12] !== g || c[13] !== v || c[14] !== f || c[15] !== x ? (o = (0, r.jsx)("div", {
            className: "px-4 pb-4 flex-1 min-h-0 overflow-y-auto",
            children: m ? (0, r.jsx)(tT, {
                results: f,
                isLoading: x,
                onSelect: v,
                noResultsText: b
            }) : (0, r.jsx)(tC, {
                categories: p,
                isLoading: h,
                onCategoryClick: g
            })
        }), c[8] = p, c[9] = h, c[10] = m, c[11] = b, c[12] = g, c[13] = v, c[14] = f, c[15] = x, c[16] = o) : o = c[16], c[17] !== n || c[18] !== o ? (l = (0, r.jsxs)(r.Fragment, {
            children: [n, s, o]
        }), c[17] = n, c[18] = o, c[19] = l) : l = c[19], l
    }

    function tI(e) {
        let t, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k = (0, a.c)(55),
            {
                open: w,
                onOpenChange: S,
                onSelectGif: j,
                prefetch: C
            } = e,
            _ = (0, H.useTranslations)(),
            T = (0, tx.useMediaQuery)("(min-width: 768px)"),
            [M, N] = (0, i.useState)(""),
            {
                categories: I,
                isLoading: P
            } = function(e) {
                let [t, r] = (0, i.useState)([]), [a, n] = (0, i.useState)(!1), s = (0, i.useRef)(!1);
                return (0, i.useEffect)(() => {
                    if (!e || s.current) return;
                    let t = !1;
                    return n(!0), async function() {
                        try {
                            let e = await fetch("/api/giphy?action=categories&limit=16"),
                                a = await e.json();
                            !t && a.data && (r(a.data), s.current = !0)
                        } catch {} finally {
                            t || n(!1)
                        }
                    }(), () => {
                        t = !0
                    }
                }, [e]), {
                    categories: t,
                    isLoading: a
                }
            }(w || !!C),
            {
                results: E,
                isLoading: A
            } = function(e) {
                let [t, r] = (0, i.useState)([]), [a, n] = (0, i.useState)(!1), s = (0, i.useRef)(null), o = (0, i.useRef)(0), l = (0, i.useCallback)(async (e, t) => {
                    if (!e.trim()) {
                        r([]), n(!1);
                        return
                    }
                    n(!0);
                    try {
                        let a = await fetch(`/api/giphy?action=search&q=${encodeURIComponent(e)}&limit=20`),
                            i = await a.json();
                        t === o.current && i.data && r(i.data)
                    } catch {} finally {
                        t === o.current && n(!1)
                    }
                }, []);
                return (0, i.useEffect)(() => {
                    s.current && clearTimeout(s.current);
                    let t = ++o.current;
                    if (!e.trim()) {
                        r([]), n(!1);
                        return
                    }
                    return n(!0), s.current = setTimeout(() => {
                        l(e, t)
                    }, 300), () => {
                        s.current && clearTimeout(s.current)
                    }
                }, [e, l]), {
                    results: t,
                    isLoading: a
                }
            }(M);
        k[0] !== M ? (t = M.trim(), k[0] = M, k[1] = t) : t = k[1];
        let O = t.length > 0;
        k[2] === Symbol.for("react.memo_cache_sentinel") ? (n = e => {
            N(e)
        }, k[2] = n) : n = k[2];
        let D = n;
        k[3] !== S || k[4] !== j ? (s = e => {
            j(e), S(!1), N("")
        }, k[3] = S, k[4] = j, k[5] = s) : s = k[5];
        let L = s;
        k[6] !== S ? (o = e => {
            e || N(""), S(e)
        }, k[6] = S, k[7] = o) : o = k[7];
        let z = o;
        k[8] !== _ ? (l = _("comments.giphyPicker.title"), k[8] = _, k[9] = l) : l = k[9];
        let R = l;
        k[10] !== _ ? (c = _("comments.giphyPicker.search"), k[10] = _, k[11] = c) : c = k[11], k[12] !== _ ? (d = _("comments.giphyPicker.noResults"), k[12] = _, k[13] = d) : d = k[13], k[14] !== I || k[15] !== P || k[16] !== L || k[17] !== O || k[18] !== M || k[19] !== E || k[20] !== A || k[21] !== c || k[22] !== d ? (u = {
            query: M,
            setQuery: N,
            hasQuery: O,
            categories: I,
            categoriesLoading: P,
            results: E,
            searchLoading: A,
            onCategoryClick: D,
            onSelect: L,
            searchPlaceholder: c,
            noResultsText: d
        }, k[14] = I, k[15] = P, k[16] = L, k[17] = O, k[18] = M, k[19] = E, k[20] = A, k[21] = c, k[22] = d, k[23] = u) : u = k[23];
        let F = u;
        if (T) {
            let e, t, a, i;
            return k[24] !== R ? (e = (0, r.jsx)(tv.ModalHeader, {
                className: "px-4 pt-3 pb-0",
                children: (0, r.jsx)(tv.ModalTitle, {
                    className: "text-lg",
                    children: R
                })
            }), k[24] = R, k[25] = e) : e = k[25], k[26] !== F ? (t = (0, r.jsx)(tN, { ...F
            }), k[26] = F, k[27] = t) : t = k[27], k[28] !== t || k[29] !== e ? (a = (0, r.jsxs)(tv.ModalContent, {
                className: "max-w-lg p-0! overflow-hidden max-h-[80vh] flex flex-col gap-0!",
                children: [e, t]
            }), k[28] = t, k[29] = e, k[30] = a) : a = k[30], k[31] !== z || k[32] !== w || k[33] !== a ? (i = (0, r.jsx)(tv.Modal, {
                open: w,
                onOpenChange: z,
                children: a
            }), k[31] = z, k[32] = w, k[33] = a, k[34] = i) : i = k[34], i
        }
        return k[35] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, r.jsx)(tf.Drawer.Overlay, {
            className: "fixed inset-0 z-250 bg-black/40"
        }), k[35] = m) : m = k[35], k[36] === Symbol.for("react.memo_cache_sentinel") ? (p = (0, r.jsx)(tf.Drawer.Handle, {
            className: "mt-1.5"
        }), k[36] = p) : p = k[36], k[37] !== R ? (h = (0, r.jsx)(tf.Drawer.Title, {
            children: R
        }), k[37] = R, k[38] = h) : h = k[38], k[39] !== _ ? (f = _("comments.giphyPicker.description"), k[39] = _, k[40] = f) : f = k[40], k[41] !== f ? (x = (0, r.jsx)(tf.Drawer.Description, {
            children: f
        }), k[41] = f, k[42] = x) : x = k[42], k[43] !== h || k[44] !== x ? (g = (0, r.jsxs)(tw.VisuallyHidden.Root, {
            children: [h, x]
        }), k[43] = h, k[44] = x, k[45] = g) : g = k[45], k[46] !== F ? (v = (0, r.jsx)(tN, { ...F
        }), k[46] = F, k[47] = v) : v = k[47], k[48] !== g || k[49] !== v ? (y = (0, r.jsxs)(tf.Drawer.Portal, {
            children: [m, (0, r.jsxs)(tf.Drawer.Content, {
                className: "fixed inset-x-0 bottom-0 top-3.5 z-251 flex flex-col rounded-t-2xl bg-(--color-background) pt-5",
                children: [p, g, v]
            })]
        }), k[48] = g, k[49] = v, k[50] = y) : y = k[50], k[51] !== z || k[52] !== w || k[53] !== y ? (b = (0, r.jsx)(tf.Drawer.Root, {
            open: w,
            onOpenChange: z,
            shouldScaleBackground: !1,
            children: y
        }), k[51] = z, k[52] = w, k[53] = y, k[54] = b) : b = k[54], b
    }
    let tP = async (e, t, r, a) => {
            try {
                return await e({
                    commentBody: t || void 0,
                    parentCommentId: a ? .parentCommentID ? ? a ? .id,
                    replyAddress: a ? .userAddress,
                    media: r
                }), !0
            } catch {
                return !1
            }
        },
        tE = ({
            replyComment: e,
            setReplyComment: t,
            onSubmit: a
        }) => {
            let o = (0, p.useAmplitudeAnalytics)(),
                [l, c] = (0, i.useState)(""),
                [h, f] = (0, i.useState)(!1),
                [x, g] = (0, i.useState)(!1),
                [v, y] = (0, i.useState)(!1),
                [b, k] = (0, i.useState)(!1),
                [w, S] = (0, i.useState)(null),
                j = (0, i.useRef)(null),
                {
                    setListenersEnabled: C
                } = (0, U.useHotkeyContext)(),
                {
                    authenticated: _
                } = (0, m.useAccountContext)(["authenticated"]),
                {
                    setOpen: T,
                    setConnectorRoute: M
                } = (0, s.useSiwx)(),
                N = (0, H.useTranslations)(),
                I = (0, i.useCallback)(() => {
                    let e = Date.now();
                    (0, u.markSignupPromptOpened)("comments", {
                        now: e,
                        route: "login"
                    }), o.trackEvent(d.Events.SignupPromptOpened, (0, u.getSignupPromptOpenedEventProperties)({
                        source: "comments",
                        route: "login"
                    })), M(n.ConnectorRoute.LOGIN), T(!0)
                }, [o, M, T]),
                P = (0, i.useCallback)(() => {
                    if (!_) {
                        j.current ? .blur(), I();
                        return
                    }
                    C(!1)
                }, [_, I, C]),
                E = (0, i.useCallback)(async () => {
                    if (!_) return void I();
                    let r = l.trim(),
                        i = !!w;
                    if (!r && !i) return;
                    let n = w ? {
                        provider: "giphy",
                        providerMediaId: w.id
                    } : void 0;
                    (f(!0), await tP(a, r, n, e)) ? (f(!1), c(""), S(null), t && t(null)) : f(!1)
                }, [_, l, w, a, I, e, t]),
                A = (0, i.useMemo)(() => !!e && "function" == typeof t, [e, t]);
            (0, i.useEffect)(() => {
                A && (L(!1), j.current ? .focus())
            }, [A]);
            let O = (0, i.useMemo)(() => h || "" === l && !w, [l, h, w]),
                [D, L] = (0, i.useState)(!1),
                z = (0, i.useCallback)(() => {
                    D ? t ? .(null) : L(!0)
                }, [D, t]);
            return (0, r.jsxs)(r.Fragment, {
                children: [(0, r.jsxs)("form", {
                    className: "flex flex-col w-full relative border rounded-xl",
                    onSubmit: e => {
                        e.preventDefault(), E()
                    },
                    onKeyDown: e => {
                        "Enter" !== e.key || e.shiftKey || (e.preventDefault(), E()), "Backspace" === e.key && "function" == typeof t && "" === l && (e.preventDefault(), z())
                    },
                    children: [(0, r.jsxs)("div", {
                        className: "flex items-end relative",
                        children: [(0, r.jsx)(V.default, {
                            ref: j,
                            value: l,
                            onChange: e => {
                                c(e.target.value)
                            },
                            minRows: 1,
                            maxRows: 4,
                            className: "leading-5 scroll-p-3.5 px-3.5 py-3.5 pr-28 placeholder:text-text-secondary md:placeholder:text-sm md:text-[14px]! rounded-xl w-full min-h-[48px] h-12 max-h-52 transition resize-none focus:outline-none! border-none shadow-none bg-transparent",
                            placeholder: N("comments.addComment"),
                            onFocus: P,
                            onBlur: () => C(!0)
                        }), (0, r.jsxs)("div", {
                            className: "absolute bottom-2 right-2 flex items-center gap-1",
                            children: [(0, r.jsx)(tu, {
                                open: b,
                                onOpenChange: e => {
                                    k(e), e || j.current ? .focus()
                                },
                                onEmojiSelect: e => {
                                    c(t => t + e)
                                }
                            }), (0, r.jsx)("button", {
                                type: "button",
                                className: "flex items-center justify-center size-8 rounded-md text-text-secondary cursor-pointer hover:bg-neutral-50 active:scale-90 transition-transform",
                                onClick: () => g(!0),
                                onMouseEnter: () => y(!0),
                                children: (0, r.jsx)(q, {})
                            }), (0, r.jsx)(F.Button, {
                                variant: "default",
                                size: "sm",
                                className: "px-3.5 text-sm font-semibold rounded-md",
                                type: "submit",
                                disabled: O,
                                children: N("comments.post")
                            })]
                        })]
                    }), w && (0, r.jsx)("div", {
                        className: "px-3.5 pb-3 pt-1",
                        children: (0, r.jsxs)("div", {
                            className: "relative inline-block",
                            children: [(0, r.jsx)("img", {
                                src: w.url,
                                alt: "Selected GIF",
                                className: "max-h-32 rounded-lg"
                            }), (0, r.jsx)("button", {
                                type: "button",
                                className: "absolute -top-1.5 -right-1.5 flex items-center justify-center size-5 rounded-full bg-background border text-text-secondary cursor-pointer hover:text-text-tertiary transition-colors",
                                onClick: () => S(null),
                                children: (0, r.jsx)($.IconXmarkOutline12, {
                                    size: 10
                                })
                            })]
                        })
                    })]
                }), (0, r.jsx)(tI, {
                    open: x,
                    onOpenChange: g,
                    onSelectGif: S,
                    prefetch: v
                })]
            })
        };
    var tA = e.i(417493),
        tO = e.i(158789),
        tD = e.i(136273),
        tL = e.i(798631),
        tz = e.i(421569),
        tR = e.i(180715);
    let tF = ({
        strokeWidth: e = 1.5,
        ...t
    }) => i.default.createElement(tR.Icon, {
        size: "12px",
        ...t
    }, i.default.createElement("path", {
        d: "m6,.75l4.25,1.75v4.969c0,2.201-3.185,3.449-4.041,3.745-.138.048-.281.048-.419,0-.855-.296-4.041-1.544-4.041-3.745V2.5L6,.75s0,0,0,0Z",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));
    var t$ = e.i(134709);
    let tB = () => {
            let e, t = (0, a.c)(1);
            return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, r.jsx)("hr", {
                className: "w-full h-px border-0 bg-neutral-50"
            }), t[0] = e) : e = t[0], e
        },
        tq = e => {
            let t, i, n, s, o, l = (0, a.c)(7),
                {
                    handleClick: c
                } = e;
            return l[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, r.jsx)(tz.IconChevronLeftOutline12, {
                className: "mr-1.5 text-text"
            }), i = (0, r.jsx)("p", {
                className: "font-semibold text-sm whitespace-nowrap overflow-hidden",
                children: "Show full discussion"
            }), l[0] = t, l[1] = i) : (t = l[0], i = l[1]), l[2] !== c ? (n = (0, r.jsxs)("div", {
                className: "rounded-full bg-neutral-50 flex items-center py-2.5 pl-3 pr-4 mr-4 cursor-pointer hover:bg-neutral-100",
                onClick: c,
                children: [t, i]
            }), l[2] = c, l[3] = n) : n = l[3], l[4] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, r.jsx)(tB, {}), l[4] = s) : s = l[4], l[5] !== n ? (o = (0, r.jsxs)("div", {
                className: "flex w-full my-5 items-center",
                children: [n, s]
            }), l[5] = n, l[6] = o) : o = l[6], o
        };

    function tV() {
        let e, t, i, n = (0, a.c)(5),
            s = (0, H.useTranslations)();
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, r.jsx)(tF, {
            size: 14,
            className: "shrink-0"
        }), n[0] = e) : e = n[0], n[1] !== s ? (t = s("comments.bewareExternalLinks"), n[1] = s, n[2] = t) : t = n[2], n[3] !== t ? (i = (0, r.jsxs)("div", {
            className: "w-full lg:w-fit px-3 h-9 rounded-full bg-neutral-50 flex items-center justify-center gap-x-3 lg:gap-x-2 text-text-secondary",
            children: [e, (0, r.jsx)("p", {
                className: "text-[13px] font-semibold text-pretty",
                children: t
            })]
        }), n[3] = t, n[4] = i) : i = n[4], i
    }
    let tH = e => {
            let t, n, s, o, l, c, d, u, m, p, h, f, x = (0, a.c)(29),
                {
                    sortBy: g,
                    setSortBy: v
                } = e,
                y = (0, H.useTranslations)(),
                [b, k] = (0, i.useState)(!1);
            return x[0] !== g || x[1] !== y ? (t = y(g === I.CommentsSortBy.Newest ? "comments.newest" : "comments.mostLiked"), x[0] = g, x[1] = y, x[2] = t) : t = x[2], x[3] !== t ? (n = (0, r.jsx)("span", {
                children: t
            }), x[3] = t, x[4] = n) : n = x[4], x[5] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, r.jsx)(tL.IconChevronDownOutline12, {
                className: "transition-transform duration-200 group-data-[state=open]:rotate-180"
            }), x[5] = s) : s = x[5], x[6] !== n ? (o = (0, r.jsx)(tO.DropdownMenuTrigger, {
                asChild: !0,
                children: (0, r.jsxs)("button", {
                    type: "button",
                    className: "group flex items-center gap-2 cursor-pointer bg-transparent border-none p-0 text-sm font-medium focus-visible:outline-none focus-visible:ring-0",
                    "aria-label": "sort-comments-by",
                    children: [n, s]
                })
            }), x[6] = n, x[7] = o) : o = x[7], x[8] !== v ? (l = () => v(I.CommentsSortBy.Newest), x[8] = v, x[9] = l) : l = x[9], x[10] !== y ? (c = y("comments.newest"), x[10] = y, x[11] = c) : c = x[11], x[12] !== l || x[13] !== c ? (d = (0, r.jsx)(tO.DropdownMenuItem, {
                onClick: l,
                children: c
            }), x[12] = l, x[13] = c, x[14] = d) : d = x[14], x[15] !== v ? (u = () => v(I.CommentsSortBy.Likes), x[15] = v, x[16] = u) : u = x[16], x[17] !== y ? (m = y("comments.mostLiked"), x[17] = y, x[18] = m) : m = x[18], x[19] !== u || x[20] !== m ? (p = (0, r.jsx)(tO.DropdownMenuItem, {
                onClick: u,
                children: m
            }), x[19] = u, x[20] = m, x[21] = p) : p = x[21], x[22] !== p || x[23] !== d ? (h = (0, r.jsxs)(tO.DropdownMenuContent, {
                className: "min-w-fit",
                align: "start",
                children: [d, p]
            }), x[22] = p, x[23] = d, x[24] = h) : h = x[24], x[25] !== b || x[26] !== h || x[27] !== o ? (f = (0, r.jsxs)(tO.DropdownMenu, {
                open: b,
                onOpenChange: k,
                children: [o, h]
            }), x[25] = b, x[26] = h, x[27] = o, x[28] = f) : f = x[28], f
        },
        tU = e => {
            let t, i, n, s, o, l = (0, a.c)(12),
                {
                    shouldShowHoldersOnly: c,
                    setShouldShowHoldersOnly: d
                } = e,
                u = (0, H.useTranslations)();
            return (0, t$.default)() ? (l[0] !== d ? (t = e => d(!!e), l[0] = d, l[1] = t) : t = l[1], l[2] !== c || l[3] !== t ? (i = (0, r.jsx)(tA.Checkbox, {
                className: "h-5 w-5",
                id: "shouldShowHoldersOnly",
                checked: c,
                onCheckedChange: t
            }), l[2] = c, l[3] = t, l[4] = i) : i = l[4], l[5] !== u ? (n = u("comments.holders"), l[5] = u, l[6] = n) : n = l[6], l[7] !== n ? (s = (0, r.jsx)("p", {
                children: n
            }), l[7] = n, l[8] = s) : s = l[8], l[9] !== i || l[10] !== s ? (o = (0, r.jsxs)(tD.Label, {
                htmlFor: "shouldShowHoldersOnly",
                className: "flex items-center gap-2 cursor-pointer",
                children: [i, s]
            }), l[9] = i, l[10] = s, l[11] = o) : o = l[11], o) : null
        },
        tW = (0, i.memo)(function(e) {
            let t, i, n, s, o, l, c, d, u, p = (0, a.c)(27),
                {
                    setHoldersOnly: h,
                    setSortBy: f,
                    isEventActive: x,
                    commentsEventQueryKey: g
                } = e,
                k = (0, y.useRouter)(),
                {
                    connectionStatus: w
                } = T();
            p[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], p[0] = t) : t = p[0];
            let {
                proxyAddress: S
            } = (0, m.useAccountContext)(t);
            p[1] !== g ? (i = {
                commentsEventQueryKey: g
            }, p[1] = g, p[2] = i) : i = p[2];
            let {
                mutation: j
            } = R(i), {
                mutateAsync: _
            } = j;
            p[3] !== g ? (n = O(g), p[3] = g, p[4] = n) : n = p[4];
            let {
                entityId: M,
                entityType: N,
                holdersOnly: I,
                sortBy: P,
                commentId: E
            } = n;
            p[5] !== _ || p[6] !== M || p[7] !== N ? (s = async e => {
                (e.commentBody || e.media) && await _({ ...e,
                    parentEntityId: Number(M),
                    parentEntityType: N
                })
            }, p[5] = _, p[6] = M, p[7] = N, p[8] = s) : s = p[8];
            let A = s;
            p[9] !== k ? (o = () => {
                if (k.isReady) {
                    let {
                        commentId: e,
                        tid: t,
                        ...r
                    } = k.query;
                    k.push({
                        pathname: k.pathname,
                        query: r
                    }, void 0)
                }
            }, p[9] = k, p[10] = o) : o = p[10];
            let D = o;
            return p[11] !== A ? (l = (0, r.jsx)("div", {
                className: "flex items-center pb-4",
                children: (0, r.jsx)(tE, {
                    onSubmit: A
                })
            }), p[11] = A, p[12] = l) : l = p[12], p[13] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, r.jsx)("div", {
                className: "lg:hidden mb-4",
                children: (0, r.jsx)(tV, {})
            }), p[13] = c) : c = p[13], p[14] !== E || p[15] !== w || p[16] !== D || p[17] !== I || p[18] !== x || p[19] !== S || p[20] !== h || p[21] !== f || p[22] !== P ? (d = E ? (0, r.jsx)("div", {
                children: (0, r.jsx)(tq, {
                    handleClick: D
                })
            }) : (0, r.jsxs)("div", {
                className: "flex items-center justify-between",
                children: [(0, r.jsxs)("div", {
                    className: "flex gap-4",
                    children: [(0, r.jsx)(tH, {
                        sortBy: P,
                        setSortBy: f
                    }), x ? (0, r.jsx)(tU, {
                        shouldShowHoldersOnly: I,
                        setShouldShowHoldersOnly: h
                    }) : null]
                }), (0, r.jsxs)("div", {
                    className: "flex gap-2",
                    children: [(0, r.jsx)("div", {
                        className: "hidden lg:block",
                        children: (0, r.jsx)(tV, {})
                    }), C.internalTestProxyAddresses[S ? S.toLowerCase() : ""] || "true" === v.default.env.NEXT_PUBLIC_ENABLE_WS_CONNECTION_DETAIL ? (0, r.jsxs)("div", {
                        className: "ml-1 flex items-center gap-1 justify-center",
                        children: [(0, r.jsx)("span", {
                            className: "text-sm font-normal text-text",
                            children: "Comments Websocket: "
                        }), (0, r.jsx)(b.StatusIconComponent, {
                            connectionStatus: w
                        })]
                    }) : null]
                })]
            }), p[14] = E, p[15] = w, p[16] = D, p[17] = I, p[18] = x, p[19] = S, p[20] = h, p[21] = f, p[22] = P, p[23] = d) : d = p[23], p[24] !== l || p[25] !== d ? (u = (0, r.jsxs)(r.Fragment, {
                children: [l, c, d]
            }), p[24] = l, p[25] = d, p[26] = u) : u = p[26], u
        });
    var tG = e.i(169010),
        tZ = e.i(956998),
        tK = e.i(208956),
        tY = e.i(44326),
        tQ = e.i(619264),
        tX = e.i(702502);

    function tJ(e) {
        let t, i, n = (0, a.c)(5),
            {
                media: s
            } = e;
        if (n[0] !== s) t = s.url ? s.url : "giphy" === s.provider && s.providerMediaId ? `https://media.giphy.com/media/${s.providerMediaId}/giphy.gif` : "", n[0] = s, n[1] = t;
        else t = n[1];
        let o = t;
        if (!o) return null;
        let l = s.altText || "GIF";
        return n[2] !== o || n[3] !== l ? (i = (0, r.jsx)("img", {
            src: o,
            alt: l,
            className: "max-w-full max-h-64 rounded-lg mt-1",
            loading: "lazy"
        }), n[2] = o, n[3] = l, n[4] = i) : i = n[4], i
    }
    let t0 = e => {
            let t, i, n, s, o = (0, a.c)(10),
                {
                    profileUserIsReplyingTo: l
                } = e;
            o[0] !== l.name || o[1] !== l.proxyWallet ? (t = (0, tX.createProfileUrl)({
                proxyWallet: l.proxyWallet,
                name: l.name
            }), o[0] = l.name, o[1] = l.proxyWallet, o[2] = t) : t = o[2], o[3] !== l ? (i = (0, tQ.formatUserName)(l, 12), o[3] = l, o[4] = i) : i = o[4];
            let c = `@${i}`;
            return o[5] !== c ? (n = (0, r.jsx)("span", {
                className: "text-brand-500 text-sm font-semibold mr-1 hover:underline hover:decoration-2 hover:decoration-solid",
                children: c
            }), o[5] = c, o[6] = n) : n = o[6], o[7] !== t || o[8] !== n ? (s = (0, r.jsx)(tK.default, {
                href: t,
                children: n
            }), o[7] = t, o[8] = n, o[9] = s) : s = o[9], s
        },
        t1 = e => {
            let t, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k, w = (0, a.c)(42),
                {
                    body: S,
                    profileUserIsReplyingTo: j,
                    media: C
                } = e,
                _ = (0, H.useTranslations)(),
                [T, M] = (0, i.useState)(!1);
            w[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                x: 0,
                y: 0
            }, w[0] = t) : t = w[0];
            let [N, I] = (0, i.useState)(t), [P, E] = (0, i.useState)(!1), [O, D] = (0, i.useState)(!1), L = (0, i.useRef)(null), z = (0, i.useRef)(null), R = (0, i.useRef)(null), F = (0, i.useRef)(S);
            w[1] !== S || w[2] !== P ? (n = () => {
                if (F.current !== S && (F.current = S, E(!1)), !S) return void D(!1);
                if (P) return;
                let e = z.current;
                e && D(e.scrollHeight > e.clientHeight)
            }, s = [S, P], w[1] = S, w[2] = P, w[3] = n, w[4] = s) : (n = w[3], s = w[4]), (0, i.useLayoutEffect)(n, s), w[5] === Symbol.for("react.memo_cache_sentinel") ? (o = () => {
                let e = () => {
                        let e = window.getSelection();
                        if (!e || !L.current) return;
                        let t = e.toString().trim().length > 0,
                            r = e.anchorNode && L.current.contains(e.anchorNode);
                        t && r ? ((() => {
                            let e = window.getSelection();
                            if (!e || !L.current || !e.toString().trim() || !e.anchorNode || !L.current.contains(e.anchorNode)) return M(!1);
                            try {
                                let t = e.getRangeAt(0).getBoundingClientRect();
                                I({
                                    x: t.left + t.width / 2,
                                    y: t.top
                                })
                            } catch {
                                M(!1)
                            }
                        })(), M(!0)) : M(!1)
                    },
                    t = e => {
                        if (R.current ? .contains(e.target)) return;
                        let t = window.getSelection();
                        t ? .toString().trim() || M(!1)
                    };
                return document.addEventListener("selectionchange", e), document.addEventListener("mouseup", e), document.addEventListener("touchend", e), document.addEventListener("click", t), () => {
                    document.removeEventListener("selectionchange", e), document.removeEventListener("mouseup", e), document.removeEventListener("touchend", e), document.removeEventListener("click", t)
                }
            }, l = [], w[5] = o, w[6] = l) : (o = w[5], l = w[6]), (0, i.useEffect)(o, l), w[7] !== T ? (c = () => {
                if (!T) return;
                let e = () => {
                    let e = window.getSelection();
                    if (!e || !L.current || !e.toString().trim() || !e.anchorNode || !L.current.contains(e.anchorNode)) return void M(!1);
                    try {
                        let t = e.getRangeAt(0).getBoundingClientRect();
                        I({
                            x: t.left + t.width / 2,
                            y: t.top
                        })
                    } catch {
                        M(!1)
                    }
                };
                return window.addEventListener("scroll", e, !0), () => window.removeEventListener("scroll", e, !0)
            }, d = [T], w[7] = T, w[8] = c, w[9] = d) : (c = w[8], d = w[9]), (0, i.useEffect)(c, d);
            let $ = C && C.length > 0;
            if (!S && !$) {
                let e;
                return w[10] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, r.jsx)(ty.Skeleton, {
                    className: "w-[70%] h-[18px] my-2"
                }), w[10] = e) : e = w[10], e
            }
            w[11] !== j ? (u = j ? (0, r.jsx)(t0, {
                profileUserIsReplyingTo: j
            }) : null, w[11] = j, w[12] = u) : u = w[12], w[13] !== S || w[14] !== P || w[15] !== O || w[16] !== _ ? (m = S && (0, r.jsxs)(tZ.default, {
                options: {
                    validate: {
                        url: t2
                    },
                    target: "_blank",
                    rel: A.getExternalLinkRel,
                    className: {
                        url: "text-brand-500 font-medium hover:underline hover:decoration-2 hover:decoration-solid"
                    }
                },
                children: [(0, r.jsx)("div", {
                    ref: z,
                    className: `wrap-break-word whitespace-pre-wrap ${!P?"line-clamp-4":""}`,
                    children: S
                }), O && (0, r.jsx)("div", {
                    className: "mt-1",
                    children: P ? (0, r.jsx)("button", {
                        type: "button",
                        className: "font-medium text-text-secondary cursor-pointer hover:text-text-tertiary bg-transparent border-none p-0 font-inherit",
                        onClick: () => E(!1),
                        children: _("comments.showLess")
                    }) : (0, r.jsx)("button", {
                        type: "button",
                        className: "font-medium text-text-secondary cursor-pointer hover:text-text-tertiary bg-transparent border-none p-0 font-inherit",
                        onClick: () => E(!0),
                        children: _("comments.readMore")
                    })
                })]
            }), w[13] = S, w[14] = P, w[15] = O, w[16] = _, w[17] = m) : m = w[17], w[18] !== $ || w[19] !== C ? (p = $ && C.map(t3), w[18] = $, w[19] = C, w[20] = p) : p = w[20], w[21] !== p || w[22] !== u || w[23] !== m ? (h = (0, r.jsx)("div", {
                className: "comment-body flex flex-col",
                children: (0, r.jsxs)("div", {
                    ref: L,
                    className: "mt-1 mb-2 text-body-base font-normal max-w-full",
                    children: [u, m, p]
                })
            }), w[21] = p, w[22] = u, w[23] = m, w[24] = h) : h = w[24];
            let B = N.y - 4;
            return w[25] !== B || w[26] !== N.x ? (f = {
                position: "fixed",
                left: N.x,
                top: B,
                transform: "translate(-50%, -100%)",
                zIndex: 50
            }, w[25] = B, w[26] = N.x, w[27] = f) : f = w[27], w[28] === Symbol.for("react.memo_cache_sentinel") ? (x = (0, r.jsx)(tF, {
                size: 14,
                className: "shrink-0"
            }), w[28] = x) : x = w[28], w[29] !== _ ? (g = _("comments.bewareExternalLinks"), w[29] = _, w[30] = g) : g = w[30], w[31] !== g ? (v = (0, r.jsxs)("div", {
                ref: R,
                className: "flex items-center gap-x-2 text-text-secondary",
                children: [x, (0, r.jsx)("p", {
                    className: "text-body-base font-semibold whitespace-nowrap",
                    children: g
                })]
            }), w[31] = g, w[32] = v) : v = w[32], w[33] !== f || w[34] !== v ? (y = (0, r.jsx)(tG.TooltipContent, {
                side: "top",
                sideOffset: 12,
                className: "w-fit px-3 py-2 rounded-full bg-neutral-50 flex items-center justify-center gap-x-2 select-none shadow-md",
                style: f,
                children: v
            }), w[33] = f, w[34] = v, w[35] = y) : y = w[35], w[36] !== T || w[37] !== y ? (b = (0, r.jsx)(tG.TooltipProvider, {
                delayDuration: 0,
                children: (0, r.jsx)(tY.Tooltip.Root, {
                    open: T,
                    children: y
                })
            }), w[36] = T, w[37] = y, w[38] = b) : b = w[38], w[39] !== h || w[40] !== b ? (k = (0, r.jsxs)(r.Fragment, {
                children: [h, b]
            }), w[39] = h, w[40] = b, w[41] = k) : k = w[41], k
        };

    function t2(e) {
        return A.validDomainRegex.test(e)
    }

    function t3(e) {
        return (0, r.jsx)(tJ, {
            media: e
        }, e.id)
    }
    let t4 = ({
            strokeWidth: e = 1.5,
            ...t
        }) => i.default.createElement(tR.Icon, {
            size: "12px",
            ...t
        }, i.default.createElement("path", {
            d: "m6,.75C3.101.75.75,3.1.75,6c0,1.082.329,2.088.89,2.923-.187.776-.474,1.551-.89,2.327,1.161,0,2.138-.191,2.953-.55.696.341,1.469.55,2.297.55,2.899,0,5.25-2.351,5.25-5.25S8.899.75,6,.75Z",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e
        })),
        t5 = e => {
            let t, i, n = (0, a.c)(3);
            return n[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, r.jsx)("path", {
                d: "M16.8375 3.99249C16.378 3.52975 15.8316 3.1624 15.2297 2.91156C14.6277 2.66071 13.9821 2.53132 13.33 2.53082C12.0965 2.53102 10.9081 2.99438 10 3.82916C9.09203 2.99424 7.90353 2.53086 6.67002 2.53082C6.01714 2.5315 5.37084 2.66129 4.76831 2.91271C4.16577 3.16414 3.61891 3.53223 3.15919 3.99582C1.19836 5.96499 1.19919 9.04499 3.16086 11.0058L10 17.845L16.8392 11.0058C18.8009 9.04499 18.8017 5.96499 16.8375 3.99249Z",
                fill: "#F55A00"
            }), n[0] = t) : t = n[0], n[1] !== e ? (i = (0, r.jsx)("svg", {
                xmlns: "http://www.w3.org/2000/svg",
                width: "18",
                height: "18",
                viewBox: "0 0 20 20",
                fill: "none",
                ...e,
                children: t
            }), n[1] = e, n[2] = i) : i = n[2], i
        },
        t6 = e => {
            let t, i, n = (0, a.c)(3);
            return n[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, r.jsx)("path", {
                d: "M10 3.82916C9.09203 2.99424 7.90353 2.53086 6.67002 2.53082C6.01714 2.5315 5.37084 2.66129 4.76831 2.91271C4.16577 3.16414 3.61891 3.53223 3.15919 3.99582C1.19836 5.96499 1.19919 9.04499 3.16086 11.0058L9.27086 17.1158C9.41253 17.365 9.68586 17.5258 10 17.5258C10.129 17.5246 10.2559 17.4931 10.3706 17.4339C10.4852 17.3747 10.5843 17.2894 10.66 17.185L16.8392 11.0058C18.8009 9.04416 18.8009 5.96499 16.8375 3.99249C16.378 3.52975 15.8316 3.1624 15.2297 2.91156C14.6277 2.66071 13.9821 2.53132 13.33 2.53082C12.0965 2.53102 10.9081 2.99438 10 3.82916ZM15.6592 5.17082C16.9617 6.47999 16.9625 8.52499 15.6609 9.82749L10 15.4883L4.33919 9.82749C3.03752 8.52499 3.03836 6.47999 4.33752 5.17416C4.97086 4.54416 5.79919 4.19749 6.67002 4.19749C7.54086 4.19749 8.36586 4.54416 8.99419 5.17249L9.41086 5.58916C9.48818 5.66661 9.58002 5.72806 9.68111 5.76998C9.78221 5.81191 9.89058 5.83349 10 5.83349C10.1095 5.83349 10.2178 5.81191 10.3189 5.76998C10.42 5.72806 10.5119 5.66661 10.5892 5.58916L11.0059 5.17249C12.2659 3.91499 14.4009 3.91832 15.6592 5.17082Z",
                fill: "currentColor"
            }), n[0] = t) : t = n[0], n[1] !== e ? (i = (0, r.jsx)("svg", {
                xmlns: "http://www.w3.org/2000/svg",
                width: "18",
                height: "18",
                viewBox: "0 0 20 20",
                fill: "none",
                ...e,
                children: t
            }), n[1] = e, n[2] = i) : i = n[2], i
        },
        t9 = e => {
            let t, i = (0, a.c)(2);
            return i[0] !== e ? (t = (0, r.jsx)(t5, {
                className: "animate-like",
                ...e
            }), i[0] = e, i[1] = t) : t = i[1], t
        },
        t8 = e => {
            let t, i = (0, a.c)(2);
            return i[0] !== e ? (t = (0, r.jsx)(t6, {
                className: "[&_path]:fill-(--color-text-secondary) animate-unlike",
                ...e
            }), i[0] = e, i[1] = t) : t = i[1], t
        },
        t7 = e => {
            let t, i, o, l, c, h, f = (0, a.c)(24),
                {
                    commentId: x,
                    reactions: g,
                    isAuthenticated: v,
                    isCurrentUserComment: y,
                    commentProxyWallet: b,
                    userProxyWallet: k,
                    currentUserCommentReactions: w,
                    commentsEventQueryKey: S
                } = e,
                j = (0, p.useAmplitudeAnalytics)(),
                {
                    setOpen: C,
                    setConnectorRoute: _
                } = (0, s.useSiwx)();
            f[0] !== S ? (t = {
                commentsEventQueryKey: S
            }, f[0] = S, f[1] = t) : t = f[1];
            let {
                mutation: T
            } = (e => {
                let t, r, i, n, s, o, l, c = (0, a.c)(20),
                    {
                        commentsEventQueryKey: d
                    } = e;
                c[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress", "baseAddress"], c[0] = t) : t = c[0];
                let {
                    proxyAddress: u,
                    baseAddress: p
                } = (0, m.useAccountContext)(t);
                c[1] !== d ? (r = {
                    commentsEventQueryKey: d
                }, c[1] = d, c[2] = r) : r = c[2];
                let {
                    cancelAllVariants: h,
                    invalidateAllVariants: f,
                    setEachVariant: x,
                    snapshotAllVariants: g,
                    restoreVariants: v
                } = z(r);
                c[3] !== p || c[4] !== h || c[5] !== u || c[6] !== x || c[7] !== g ? (i = async e => {
                    if (!e.commentID || !u || !p) return;
                    await h();
                    let t = g();
                    if (void 0 !== e.reactionID) x(t => ({
                        pageParams: t.pageParams,
                        pages: (0, A.handleOptimisticDeleteReaction)(t, e)
                    }));
                    else {
                        let t = {
                            id: Math.ceil(1e5 * Math.random()).toString(),
                            isOptimistic: !0,
                            commentID: e.commentID,
                            createdAt: new Date().toISOString(),
                            icon: "",
                            reactionType: "HEART",
                            userAddress: p,
                            profile: {
                                proxyWallet: u
                            }
                        };
                        x(r => ({
                            pageParams: r.pageParams,
                            pages: (0, A.handleOptimisticPostReaction)(r, e, t)
                        }))
                    }
                    return {
                        previousVariants: t
                    }
                }, c[3] = p, c[4] = h, c[5] = u, c[6] = x, c[7] = g, c[8] = i) : i = c[8];
                let y = i;
                c[9] !== v ? (n = (e, t, r) => {
                    r ? .previousVariants && v(r.previousVariants)
                }, c[9] = v, c[10] = n) : n = c[10], c[11] !== f ? (s = () => {
                    f()
                }, c[11] = f, c[12] = s) : s = c[12], c[13] !== d.queryKey || c[14] !== y || c[15] !== n || c[16] !== s ? (o = {
                    mutationKey: d.queryKey,
                    mutationFn: I.mutateReactionsFetcher,
                    onMutate: y,
                    onError: n,
                    onSettled: s
                }, c[13] = d.queryKey, c[14] = y, c[15] = n, c[16] = s, c[17] = o) : o = c[17];
                let b = (0, D.useMutation)(o);
                return c[18] !== b ? (l = {
                    mutation: b
                }, c[18] = b, c[19] = l) : l = c[19], l
            })(t), {
                mutateAsync: M
            } = T;
            f[2] !== w ? (i = w ? .find(rr), f[2] = w, f[3] = i) : i = f[3];
            let N = i,
                P = y || !!N ? .isOptimistic;
            f[4] !== j || f[5] !== x || f[6] !== b || f[7] !== N || f[8] !== v || f[9] !== P || f[10] !== M || f[11] !== _ || f[12] !== C || f[13] !== k ? (o = () => {
                if (!v) {
                    let e = Date.now();
                    (0, u.markSignupPromptOpened)("comments", {
                        now: e,
                        route: "login"
                    }), j.trackEvent(d.Events.SignupPromptOpened, (0, u.getSignupPromptOpenedEventProperties)({
                        source: "comments",
                        route: "login"
                    })), _(n.ConnectorRoute.LOGIN), C(!0)
                }!P && b && k && M(N ? .reactionID ? {
                    commentID: Number(x),
                    reactionID: N.reactionID,
                    reactionType: void 0,
                    commentProxyWallet: b,
                    userProxyWallet: k
                } : {
                    commentID: Number(x),
                    reactionID: void 0,
                    reactionType: "HEART",
                    commentProxyWallet: b,
                    userProxyWallet: k
                })
            }, f[4] = j, f[5] = x, f[6] = b, f[7] = N, f[8] = v, f[9] = P, f[10] = M, f[11] = _, f[12] = C, f[13] = k, f[14] = o) : o = f[14];
            let E = o;
            f[15] !== N ? .reactionID ? (l = N ? .reactionID ? (0, r.jsx)(t9, {}) : (0, r.jsx)(t8, {}), f[15] = N ? .reactionID, f[16] = l) : l = f[16];
            let O = g ? .length ? ? 0;
            return f[17] !== O ? (c = (0, r.jsx)("span", {
                className: "text-xs text-text-secondary",
                children: O
            }), f[17] = O, f[18] = c) : c = f[18], f[19] !== E || f[20] !== P || f[21] !== l || f[22] !== c ? (h = (0, r.jsxs)(F.Button, {
                variant: "ghost",
                size: "icon",
                className: "h-6 w-fit py-1 pl-1 !pr-1.5 gap-1",
                disabled: P,
                onClick: E,
                children: [l, c]
            }), f[19] = E, f[20] = P, f[21] = l, f[22] = c, f[23] = h) : h = f[23], h
        };

    function re(e) {
        let t, i, n, s, o, l = (0, a.c)(13),
            {
                isCommentOptimistic: c,
                onToggleReplyComment: d,
                isAuthenticated: u
            } = e,
            m = (0, H.useTranslations)();
        if (!u) return null;
        let p = `h-6 w-fit py-1 pl-1.5 !px-1.5 gap-1 text-text-secondary ${c?"opacity-50 cursor-not-allowed":"opacity-100"}`;
        return l[0] !== c || l[1] !== d ? (t = () => {
            c || d()
        }, l[0] = c, l[1] = d, l[2] = t) : t = l[2], l[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, r.jsx)(t4, {}), l[3] = i) : i = l[3], l[4] !== m ? (n = m("comments.reply"), l[4] = m, l[5] = n) : n = l[5], l[6] !== n ? (s = (0, r.jsx)("span", {
            className: "text-xs",
            children: n
        }), l[6] = n, l[7] = s) : s = l[7], l[8] !== c || l[9] !== p || l[10] !== t || l[11] !== s ? (o = (0, r.jsxs)(F.Button, {
            variant: "ghost",
            size: "icon",
            className: p,
            disabled: c,
            onClick: t,
            children: [i, s]
        }), l[8] = c, l[9] = p, l[10] = t, l[11] = s, l[12] = o) : o = l[12], o
    }
    let rt = e => {
        let t, n, s, o, l, c, d, u = (0, a.c)(23),
            {
                comment: p,
                isCurrentUserComment: h,
                currentUserCommentReactions: f,
                commentsEventQueryKey: x,
                proxyAddress: g
            } = e;
        u[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["authenticated"], u[0] = t) : t = u[0];
        let {
            authenticated: v
        } = (0, m.useAccountContext)(t), [y, b] = (0, i.useState)(null);
        u[1] !== p ? (n = () => {
            p && b(e => e ? null : p)
        }, u[1] = p, u[2] = n) : n = u[2];
        let k = n;
        u[3] !== x ? (s = {
            commentsEventQueryKey: x
        }, u[3] = x, u[4] = s) : s = u[4];
        let {
            mutation: w
        } = R(s), {
            mutateAsync: S
        } = w;
        u[5] !== x || u[6] !== S ? (o = async e => {
            if (!e.commentBody && !e.media) return;
            let {
                entityId: t,
                entityType: r
            } = O(x);
            await S({ ...e,
                parentEntityId: Number(t),
                parentEntityType: r
            })
        }, u[5] = x, u[6] = S, u[7] = o) : o = u[7];
        let j = o;
        return u[8] !== v || u[9] !== p || u[10] !== x || u[11] !== f || u[12] !== k || u[13] !== h || u[14] !== g ? (l = p ? (0, r.jsxs)("div", {
            className: "-ml-1.5 flex items-center gap-1.5",
            children: [(0, r.jsx)(t7, {
                isAuthenticated: v,
                commentId: p.id,
                isCurrentUserComment: h,
                commentProxyWallet: p.profile ? .proxyWallet,
                userProxyWallet: g,
                reactions: p.reactions,
                currentUserCommentReactions: f,
                commentsEventQueryKey: x
            }), (0, r.jsx)(re, {
                isAuthenticated: v,
                isCommentOptimistic: p ? .isOptimistic ? ? !1,
                onToggleReplyComment: k
            })]
        }) : (0, r.jsx)(ty.Skeleton, {
            className: "w-[30%] h-[18px]"
        }), u[8] = v, u[9] = p, u[10] = x, u[11] = f, u[12] = k, u[13] = h, u[14] = g, u[15] = l) : l = u[15], u[16] !== v || u[17] !== j || u[18] !== y ? (c = v && y && !y.isOptimistic ? (0, r.jsx)("div", {
            className: "flex w-full mt-3",
            children: (0, r.jsx)(tE, {
                replyComment: y,
                setReplyComment: b,
                onSubmit: j
            })
        }) : null, u[16] = v, u[17] = j, u[18] = y, u[19] = c) : c = u[19], u[20] !== l || u[21] !== c ? (d = (0, r.jsxs)(r.Fragment, {
            children: [l, c]
        }), u[20] = l, u[21] = c, u[22] = d) : d = u[22], d
    };

    function rr(e) {
        return "HEART" === e.reactionType
    }
    var ra = e.i(569297),
        ri = e.i(127202),
        rn = e.i(941056),
        rs = e.i(534532),
        ro = e.i(249792),
        rl = e.i(606572),
        rc = e.i(200139);
    let rd = e => {
        let t, r, i, n, s, o, l = (0, a.c)(18),
            {
                commentsEventQueryKey: c
            } = e;
        l[0] !== c ? (t = {
            commentsEventQueryKey: c
        }, l[0] = c, l[1] = t) : t = l[1];
        let {
            cancelAllVariants: d,
            invalidateAllVariants: u,
            setEachVariant: m,
            snapshotAllVariants: p,
            restoreVariants: h
        } = z(t);
        l[2] !== d || l[3] !== m || l[4] !== p ? (r = async e => {
            await d();
            let t = p();
            return m(t => ({
                pageParams: t.pageParams,
                pages: (0, A.handleOptimisticCommentDelete)(t, e)
            })), {
                previousVariants: t
            }
        }, l[2] = d, l[3] = m, l[4] = p, l[5] = r) : r = l[5];
        let f = r;
        l[6] !== h ? (i = (e, t, r) => {
            r ? .previousVariants && h(r.previousVariants)
        }, l[6] = h, l[7] = i) : i = l[7], l[8] !== u ? (n = () => {
            u()
        }, l[8] = u, l[9] = n) : n = l[9], l[10] !== c.queryKey || l[11] !== f || l[12] !== i || l[13] !== n ? (s = {
            mutationKey: c.queryKey,
            mutationFn: I.deleteCommentFetcher,
            onMutate: f,
            onError: i,
            onSettled: n
        }, l[10] = c.queryKey, l[11] = f, l[12] = i, l[13] = n, l[14] = s) : s = l[14];
        let x = (0, D.useMutation)(s);
        return l[15] !== f || l[16] !== x ? (o = {
            mutation: x,
            deleteComment: f
        }, l[15] = f, l[16] = x, l[17] = o) : o = l[17], o
    };
    var ru = e.i(964974);
    let rm = async e => {
            try {
                return await (0, I.mutateReportsFetcher)({
                    commentID: e
                }), {
                    success: !0
                }
            } catch (e) {
                if ((0, j.isAxiosError)(e) && e.response ? .data ? .type === "validation error") return {
                    success: !1,
                    isValidationError: !0
                };
                return {
                    success: !1
                }
            }
        },
        rp = async e => {
            try {
                return await e()
            } catch {
                return null
            }
        },
        rh = async e => {
            try {
                if (e) return await navigator.clipboard.writeText(e), !0;
                return !1
            } catch {
                return !1
            }
        },
        rf = (e, t) => {
            let r = (0, H.useTranslations)(),
                [a, n] = (0, i.useState)(!1),
                [s, o] = (0, i.useState)(null),
                [l, c] = (0, i.useState)(!1),
                d = (0, ro.useToast)(),
                u = (0, y.useRouter)(),
                {
                    event: m
                } = (0, f.useEventContext)(["event"]),
                {
                    codes: p
                } = (0, rc.useReferralCodes)(t),
                h = (0, i.useMemo)(() => (0, rc.getPrimaryReferralCode)(p), [p]),
                x = (0, i.useCallback)(() => {
                    let {
                        eventSlug: t,
                        marketSlug: r
                    } = u.query;
                    return {
                        commentId: e,
                        eventSlug: t || m.slug,
                        marketSlug: r || m.markets[0] ? .slug,
                        eventTitle: m.title,
                        referralCode: h
                    }
                }, [e, m, u.query, h]),
                g = (0, i.useCallback)(async () => {
                    if (!e) return null;
                    let t = await fetch("/api/comment/share", {
                        method: "POST",
                        headers: {
                            "Content-Type": "application/json"
                        },
                        body: JSON.stringify(x())
                    });
                    if (!t.ok) throw Error("Failed to create share link");
                    return (await t.json()).shortLink
                }, [e, x]),
                v = (0, i.useCallback)(async () => {
                    if (!e || s || l) return;
                    c(!0);
                    let t = await rp(g);
                    t && o(t), c(!1)
                }, [e, s, l, g]);
            return {
                handleCopyLink: (0, i.useCallback)(async () => {
                    if (!e || a) return;
                    n(!0);
                    let t = s || await rp(g);
                    await rh(t) ? d.success(new rl.ToastBuilder().title(r("comments.linkCopied")).description(r("comments.linkCopiedDescription"))) : t || d.error(new rl.ToastBuilder().title(r("comments.failedToCopyLink")).description(r("comments.pleaseTryAgain"))), n(!1)
                }, [e, a, s, g, d]),
                isCopying: a,
                prefetchLink: v
            }
        },
        rx = e => {
            let t, i, n, s, o, l, c, d, u, p, h, f, x, g, v, y = (0, a.c)(44),
                {
                    commentId: b,
                    onSetCommentIdToDelete: k,
                    commentsEventQueryKey: w,
                    isCurrentUserComment: S
                } = e,
                j = (0, H.useTranslations)(),
                C = (0, ro.useToast)(),
                {
                    handleCopyLink: _,
                    isCopying: T,
                    prefetchLink: M
                } = rf(b, !0);
            y[0] !== w ? (t = {
                commentsEventQueryKey: w
            }, y[0] = w, y[1] = t) : t = y[1];
            let {
                mutation: N
            } = rd(t), {
                mutateAsync: P
            } = N, E = (() => {
                let e, t, r, i = (0, a.c)(6);
                i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated", "proxyAddress"], i[0] = e) : e = i[0];
                let {
                    authenticated: n,
                    proxyAddress: s
                } = (0, m.useAccountContext)(e);
                i[1] !== s ? (t = ["/isUserMod", s], i[1] = s, i[2] = t) : t = i[2];
                let o = n && !!s;
                i[3] !== t || i[4] !== o ? (r = {
                    queryKey: t,
                    queryFn: I.getIsMod,
                    enabled: o,
                    refetchOnMount: !1,
                    refetchOnReconnect: !1,
                    refetchOnWindowFocus: !1
                }, i[3] = t, i[4] = o, i[5] = r) : r = i[5];
                let {
                    data: l
                } = (0, ru.useQuery)(r);
                return l ? ? !1
            })();
            y[2] !== b || y[3] !== j || y[4] !== C ? (i = async () => {
                let e = await rm(b);
                e.success ? C.success(new rl.ToastBuilder().title(j("comments.reported.title")).description(j("comments.reported.description"))) : e.isValidationError && C.success(new rl.ToastBuilder().title(j("comments.reported.title")).description(j("comments.reported.alreadyReported")))
            }, y[2] = b, y[3] = j, y[4] = C, y[5] = i) : i = y[5];
            let A = i;
            y[6] !== b || y[7] !== k ? (n = () => {
                k(b)
            }, y[6] = b, y[7] = k, y[8] = n) : n = y[8];
            let O = n;
            y[9] !== b || y[10] !== P ? (s = () => {
                P({
                    id: b
                })
            }, y[9] = b, y[10] = P, y[11] = s) : s = y[11];
            let D = s;
            y[12] !== M ? (o = e => {
                e && M()
            }, y[12] = M, y[13] = o) : o = y[13], y[14] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, r.jsx)(tO.DropdownMenuTrigger, {
                className: "bg-transparent hover:bg-neutral-50 active:bg-neutral-50 flex items-center justify-center cursor-pointer size-6 min-w-6 rounded-sm outline-none transition-none",
                children: (0, r.jsx)(ra.IconDotsOutline18, {
                    className: "size-4"
                })
            }), y[14] = l) : l = y[14], y[15] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, r.jsx)(rs.IconUpload4Outline18, {}), y[15] = c) : c = y[15], y[16] !== j ? (d = j("comments.share"), y[16] = j, y[17] = d) : d = y[17], y[18] !== _ || y[19] !== T || y[20] !== d ? (u = (0, r.jsxs)(tO.DropdownMenuItem, {
                onClick: _,
                disabled: T,
                children: [c, d]
            }), y[18] = _, y[19] = T, y[20] = d, y[21] = u) : u = y[21];
            let L = S ? .5 : 1;
            return y[22] !== L ? (p = (0, r.jsx)(ri.IconFlagOutline18, {
                style: {
                    opacity: L
                }
            }), y[22] = L, y[23] = p) : p = y[23], y[24] !== j ? (h = j("comments.report"), y[24] = j, y[25] = h) : h = y[25], y[26] !== A || y[27] !== S || y[28] !== p || y[29] !== h ? (f = (0, r.jsxs)(tO.DropdownMenuItem, {
                disabled: S,
                onClick: A,
                children: [p, h]
            }), y[26] = A, y[27] = S, y[28] = p, y[29] = h, y[30] = f) : f = y[30], y[31] !== D || y[32] !== O || y[33] !== S || y[34] !== E || y[35] !== j ? (x = S || E ? (0, r.jsxs)(tO.DropdownMenuItem, {
                className: "text-text",
                onClick: E ? D : O,
                children: [(0, r.jsx)(rn.IconTrashOutline18, {}), j("comments.delete")]
            }) : null, y[31] = D, y[32] = O, y[33] = S, y[34] = E, y[35] = j, y[36] = x) : x = y[36], y[37] !== u || y[38] !== f || y[39] !== x ? (g = (0, r.jsxs)(tO.DropdownMenuContent, {
                className: "w-fit",
                align: "end",
                children: [u, f, x]
            }), y[37] = u, y[38] = f, y[39] = x, y[40] = g) : g = y[40], y[41] !== g || y[42] !== o ? (v = (0, r.jsxs)(tO.DropdownMenu, {
                modal: !0,
                onOpenChange: o,
                children: [l, g]
            }), y[41] = g, y[42] = o, y[43] = v) : v = y[43], v
        },
        rg = e => {
            let t, i, o, l, c, m, h, f, x, g, v, y = (0, a.c)(26),
                {
                    commentId: b
                } = e,
                k = (0, H.useTranslations)(),
                w = (0, p.useAmplitudeAnalytics)(),
                {
                    setOpen: S,
                    setConnectorRoute: j
                } = (0, s.useSiwx)(),
                {
                    handleCopyLink: C,
                    isCopying: _,
                    prefetchLink: T
                } = rf(b, !1);
            y[0] !== w || y[1] !== j || y[2] !== S ? (t = () => {
                let e = Date.now();
                (0, u.markSignupPromptOpened)("comments", {
                    now: e,
                    route: "login"
                }), w.trackEvent(d.Events.SignupPromptOpened, (0, u.getSignupPromptOpenedEventProperties)({
                    source: "comments",
                    route: "login"
                })), j(n.ConnectorRoute.LOGIN), S(!0)
            }, y[0] = w, y[1] = j, y[2] = S, y[3] = t) : t = y[3];
            let M = t;
            return y[4] !== T ? (i = e => {
                e && T()
            }, y[4] = T, y[5] = i) : i = y[5], y[6] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, r.jsx)(tO.DropdownMenuTrigger, {
                className: "bg-transparent hover:bg-neutral-50 active:bg-neutral-50 flex items-center justify-center cursor-pointer size-7 min-w-7 rounded-sm outline-none transition-none",
                children: (0, r.jsx)(ra.IconDotsOutline18, {})
            }), y[6] = o) : o = y[6], y[7] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, r.jsx)(rs.IconUpload4Outline18, {}), y[7] = l) : l = y[7], y[8] !== k ? (c = k("comments.share"), y[8] = k, y[9] = c) : c = y[9], y[10] !== C || y[11] !== _ || y[12] !== c ? (m = (0, r.jsxs)(tO.DropdownMenuItem, {
                onClick: C,
                disabled: _,
                children: [l, c]
            }), y[10] = C, y[11] = _, y[12] = c, y[13] = m) : m = y[13], y[14] === Symbol.for("react.memo_cache_sentinel") ? (h = (0, r.jsx)(ri.IconFlagOutline18, {}), y[14] = h) : h = y[14], y[15] !== k ? (f = k("comments.report"), y[15] = k, y[16] = f) : f = y[16], y[17] !== M || y[18] !== f ? (x = (0, r.jsxs)(tO.DropdownMenuItem, {
                onClick: M,
                children: [h, f]
            }), y[17] = M, y[18] = f, y[19] = x) : x = y[19], y[20] !== m || y[21] !== x ? (g = (0, r.jsxs)(tO.DropdownMenuContent, {
                className: "w-fit",
                align: "end",
                children: [m, x]
            }), y[20] = m, y[21] = x, y[22] = g) : g = y[22], y[23] !== g || y[24] !== i ? (v = (0, r.jsxs)(tO.DropdownMenu, {
                modal: !0,
                onOpenChange: i,
                children: [o, g]
            }), y[23] = g, y[24] = i, y[25] = v) : v = y[25], v
        },
        rv = e => {
            let t, i, n = (0, a.c)(7),
                {
                    commentId: s,
                    onSetCommentIdToDelete: o,
                    isCurrentUserComment: l,
                    commentsEventQueryKey: c
                } = e;
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["authenticated"], n[0] = t) : t = n[0];
            let {
                authenticated: d
            } = (0, m.useAccountContext)(t);
            return n[1] !== d || n[2] !== s || n[3] !== c || n[4] !== l || n[5] !== o ? (i = (0, r.jsx)("div", {
                className: "absolute top-0 right-0 flex",
                children: d && s ? (0, r.jsx)(rx, {
                    commentId: s,
                    onSetCommentIdToDelete: o,
                    isCurrentUserComment: l,
                    commentsEventQueryKey: c
                }) : (0, r.jsx)(rg, {
                    commentId: s
                })
            }), n[1] = d, n[2] = s, n[3] = c, n[4] = l, n[5] = o, n[6] = i) : i = n[6], i
        };
    var ry = e.i(781577),
        rb = e.i(131878),
        rk = e.i(390960),
        rw = e.i(864006),
        rS = e.i(177412),
        rj = e.i(86831),
        rC = e.i(196593);
    let r_ = e => {
            let t, n, s, o, l, c, d, u, m, p, h, f, x = (0, a.c)(30),
                {
                    positions: g
                } = e,
                [v, y] = (0, i.useState)(!1);
            if (!Array.isArray(g)) return null;
            let [b] = g;
            if (x[0] !== v || x[1] !== b || x[2] !== g) {
                let e, a, i = {
                        green: "text-green-600 dark:text-green-400",
                        blue: "text-brand-500",
                        red: "text-red-500"
                    },
                    p = {
                        green: "bg-green-600/10 hover:bg-green-600/20 dark:bg-green-400/15 hover:dark:bg-green-400/25",
                        blue: "bg-brand-500/10 hover:bg-brand-500/20",
                        red: "bg-red-500/10 hover:bg-red-500/20"
                    };
                n = tO.DropdownMenu, d = v, u = y;
                let h = (0, rj.cn)("group disabled:!opacity-100 active:!scale-100 px-1.5 h-5.5 gap-1.5 transition-none", p[b.Color]),
                    f = (0, rj.cn)(i[b.Color], "truncate text-xs"),
                    k = Number(b.PositionSize) / 1e6;
                if (x[12] !== k ? (e = (0, rC.suffixNumber)(k, !0), x[12] = k, x[13] = e) : e = x[13], x[14] !== b) {
                    let e;
                    e = b.Outcome ? .toLowerCase() === "yes" || b.Outcome ? .toLowerCase() === "no", a = b.GroupItemTitle && e ? b.GroupItemTitle : b.Outcome, x[14] = b, x[15] = a
                } else a = x[15];
                m = (0, r.jsx)(tO.DropdownMenuTrigger, {
                    asChild: !0,
                    disabled: 1 === g.length,
                    children: (0, r.jsxs)(F.Button, {
                        "aria-label": "sort-markets-by",
                        className: h,
                        children: [(0, r.jsx)("p", {
                            className: f,
                            children: `${e} ${a}`
                        }), g.length > 1 ? (0, r.jsx)(tL.IconChevronDownOutline12, {
                            className: (0, rj.cn)(i[b.Color], "transition-transform duration-200 group-data-[state=open]:rotate-180"),
                            strokeWidth: 1.5,
                            size: 10
                        }) : null]
                    })
                }), t = tO.DropdownMenuContent, l = 4, c = "start", s = "w-full flex flex-col py-1 max-w-72", o = g.map(e => (0, r.jsxs)("div", {
                    className: "flex items-center justify-between px-3 py-2 gap-8",
                    children: [(0, r.jsx)("p", {
                        className: "text-[13px] tracking-[-0.09px] text-text-primary font-medium truncate",
                        children: e.GroupItemTitle
                    }), (0, r.jsx)("span", {
                        className: (0, rj.cn)("text-body-sm text-text-secondary font-medium whitespace-nowrap px-1 pr-[5px] py-px rounded-sm pointer-events-none", p[e.Color], i[e.Color]),
                        children: `${(0,rC.suffixNumber)(Number(e.PositionSize)/1e6,!0)} ${e.Outcome}`
                    })]
                }, e.TokenId)), x[0] = v, x[1] = b, x[2] = g, x[3] = t, x[4] = n, x[5] = s, x[6] = o, x[7] = l, x[8] = c, x[9] = d, x[10] = u, x[11] = m
            } else t = x[3], n = x[4], s = x[5], o = x[6], l = x[7], c = x[8], d = x[9], u = x[10], m = x[11];
            return x[16] !== s || x[17] !== o ? (p = (0, r.jsx)("div", {
                className: s,
                children: o
            }), x[16] = s, x[17] = o, x[18] = p) : p = x[18], x[19] !== t || x[20] !== l || x[21] !== c || x[22] !== p ? (h = (0, r.jsx)(t, {
                sideOffset: l,
                align: c,
                children: p
            }), x[19] = t, x[20] = l, x[21] = c, x[22] = p, x[23] = h) : h = x[23], x[24] !== n || x[25] !== d || x[26] !== u || x[27] !== m || x[28] !== h ? (f = (0, r.jsxs)(n, {
                open: d,
                onOpenChange: u,
                children: [m, h]
            }), x[24] = n, x[25] = d, x[26] = u, x[27] = m, x[28] = h, x[29] = f) : f = x[29], f
        },
        rT = e => {
            let t, i, n, s = (0, a.c)(29),
                {
                    profile: o,
                    commentCreatedAt: l
                } = e,
                c = (0, rw.useLocale)(),
                u = (0, rw.useMessages)().time,
                h = (0, p.useAmplitudeAnalytics)();
            s[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["authenticated"], s[0] = t) : t = s[0];
            let {
                authenticated: f
            } = (0, m.useAccountContext)(t);
            s[1] !== h || s[2] !== f || s[3] !== o ? (i = () => {
                f && o && h.trackEvent(d.Events.CommentUserClick, {
                    clicked_user_address: o.proxyWallet,
                    clicked_user_name: o.name,
                    clicked_user_pseudonym: o.pseudonym
                })
            }, s[1] = h, s[2] = f, s[3] = o, s[4] = i) : i = s[4];
            let x = i;
            if (!o) {
                let e;
                return s[5] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, r.jsx)(ty.Skeleton, {
                    className: "w-[40%] h-[18px]"
                }), s[5] = e) : e = s[5], e
            }
            if (s[6] !== l || s[7] !== x || s[8] !== c || s[9] !== o || s[10] !== u) {
                let e, t, a, i, d, m, p = l ? ((e, t) => {
                        try {
                            return (0, ry.formatDistanceStrict)(new Date(e), new Date, {
                                locale: t
                            })
                        } catch {
                            return null
                        }
                    })(l, (0, rk.getDateFnsLocale)(c)) : null,
                    h = o.proxyWallet ? ? "";
                s[12] !== o ? (e = (0, tQ.formatUserName)(o, 16), s[12] = o, s[13] = e) : e = s[13], s[14] !== o ? (t = (0, tQ.formatUserName)(o, 16), s[14] = o, s[15] = t) : t = s[15], s[16] !== x || s[17] !== e || s[18] !== t ? (a = (0, r.jsx)("span", {
                    className: "text-body-base font-semibold text-text-primary hover:underline whitespace-nowrap overflow-hidden text-ellipsis",
                    title: e,
                    onClick: x,
                    children: t
                }), s[16] = x, s[17] = e, s[18] = t, s[19] = a) : a = s[19], s[20] !== o || s[21] !== h || s[22] !== a ? (i = (0, r.jsx)(rS.ProfileHoverCard, {
                    user: o,
                    address: h,
                    children: a
                }), s[20] = o, s[21] = h, s[22] = a, s[23] = i) : i = s[23], s[24] !== o.cleanedPositions ? (d = (0, r.jsx)(r_, {
                    positions: o.cleanedPositions
                }), s[24] = o.cleanedPositions, s[25] = d) : d = s[25], s[26] !== i || s[27] !== d ? (m = (0, r.jsxs)("div", {
                    className: "flex gap-2 items-baseline",
                    children: [i, d]
                }), s[26] = i, s[27] = d, s[28] = m) : m = s[28], n = (0, r.jsxs)("div", {
                    className: "flex items-baseline whitespace-nowrap overflow-hidden text-ellipsis pr-8 gap-1",
                    children: [m, p ? (0, r.jsx)("time", {
                        dateTime: l,
                        className: "ml-1.5 text-body-sm font-medium text-text-secondary whitespace-nowrap overflow-hidden text-ellipsis",
                        children: (0, rb.abbreviateTime)(p, u)
                    }) : null]
                }), s[6] = l, s[7] = x, s[8] = c, s[9] = o, s[10] = u, s[11] = n
            } else n = s[11];
            return n
        },
        rM = e => {
            let t, i, n, s, o, l, c = (0, a.c)(22),
                {
                    replies: d,
                    commentsEventQueryKey: u,
                    onSetCommentIdToDelete: m,
                    proxyAddress: p,
                    shouldAnimate: h,
                    isShowingReplies: f,
                    setIsShowingReplies: x
                } = e,
                g = (0, H.useTranslations)();
            if (!d) return null;
            c[0] !== f || c[1] !== x ? (t = () => x(!f), c[0] = f, c[1] = x, c[2] = t) : t = c[2], c[3] !== d.length || c[4] !== g ? (i = g("comments.replies").replace("{count}", String(d.length)), c[3] = d.length, c[4] = g, c[5] = i) : i = c[5];
            let v = `transition-transform duration-200 ${f?"rotate-180":""}`;
            return c[6] !== v ? (n = (0, r.jsx)(tL.IconChevronDownOutline12, {
                className: v
            }), c[6] = v, c[7] = n) : n = c[7], c[8] !== t || c[9] !== i || c[10] !== n ? (s = (0, r.jsxs)(F.Button, {
                variant: "ghost",
                size: "sm",
                className: "text-text-secondary h-6 text-xs w-fit py-0.5 px-2 mt-1 -ml-2 gap-1.5",
                onClick: t,
                children: [i, n]
            }), c[8] = t, c[9] = i, c[10] = n, c[11] = s) : s = c[11], c[12] !== u || c[13] !== f || c[14] !== m || c[15] !== p || c[16] !== d || c[17] !== h ? (o = f ? d.map(e => (0, r.jsx)("article", {
                id: `comment-${e.id}`,
                className: "comment reply flex mt-6",
                children: (0, r.jsx)(rP, {
                    comment: e,
                    onSetCommentIdToDelete: m,
                    commentsEventQueryKey: u,
                    shouldAnimate: h,
                    proxyAddress: p,
                    isReply: !0
                })
            }, e.id)) : null, c[12] = u, c[13] = f, c[14] = m, c[15] = p, c[16] = d, c[17] = h, c[18] = o) : o = c[18], c[19] !== s || c[20] !== o ? (l = (0, r.jsxs)(r.Fragment, {
                children: [s, o]
            }), c[19] = s, c[20] = o, c[21] = l) : l = c[21], l
        };
    var rN = e.i(363966);
    let rI = e => {
            let t, i, n, s, o, l = (0, a.c)(20),
                {
                    profile: c,
                    size: d
                } = e,
                u = void 0 === d ? 40 : d;
            if (!c) {
                let e;
                return l[0] !== u ? (e = (0, r.jsx)(ty.Skeleton, {
                    className: "rounded-full",
                    style: {
                        width: u,
                        height: u
                    }
                }), l[0] = u, l[1] = e) : e = l[1], e
            }
            let m = c.proxyWallet ? ? "";
            l[2] !== u ? (t = {
                minWidth: u
            }, l[2] = u, l[3] = t) : t = l[3];
            let p = c ? .name ? ? c.proxyWallet ? ? void 0,
                h = c.proxyWallet ? ? "";
            return l[4] !== c.name || l[5] !== c.proxyWallet ? (i = c ? .name ? ? (c.proxyWallet ? c.proxyWallet.slice(0, 6) : ""), l[4] = c.name, l[5] = c.proxyWallet, l[6] = i) : i = l[6], l[7] !== c.profileImage || l[8] !== u || l[9] !== h || l[10] !== i ? (n = (0, r.jsx)(rN.default, {
                address: h,
                alt: i,
                height: u,
                quality: 100,
                profileImage: c.profileImage,
                width: u
            }), l[7] = c.profileImage, l[8] = u, l[9] = h, l[10] = i, l[11] = n) : n = l[11], l[12] !== t || l[13] !== p || l[14] !== n ? (s = (0, r.jsx)("div", {
                className: "h-fit shrink-0",
                style: t,
                title: p,
                children: n
            }), l[12] = t, l[13] = p, l[14] = n, l[15] = s) : s = l[15], l[16] !== c || l[17] !== m || l[18] !== s ? (o = (0, r.jsx)(rS.ProfileHoverCard, {
                user: c,
                address: m,
                children: s
            }), l[16] = c, l[17] = m, l[18] = s, l[19] = o) : o = l[19], o
        },
        rP = (0, i.memo)(function(e) {
            let t, n, s, o, l, c, d, u, m, p, h, f, x, g = (0, a.c)(54),
                {
                    comment: v,
                    onSetCommentIdToDelete: y,
                    commentsEventQueryKey: b,
                    shouldAnimate: k,
                    proxyAddress: w,
                    isReply: S
                } = e;
            g[0] !== v || g[1] !== w ? (t = (({
                comment: e,
                proxyAddress: t
            }) => !!e ? .profile ? .proxyWallet && !!t && e.profile.proxyWallet.toLowerCase() === t.toLowerCase())({
                comment: v,
                proxyAddress: w
            }), g[0] = v, g[1] = w, g[2] = t) : t = g[2], g[3] !== v || g[4] !== w ? (n = (({
                comment: e,
                proxyAddress: t
            }) => e ? .reactions && t ? e.reactions.reduce((e, r) => (r ? .profile ? .proxyWallet && r ? .profile ? .proxyWallet.toLowerCase() === t.toLowerCase() && e.push({
                isOptimistic: r.isOptimistic,
                reactionType: r.reactionType,
                reactionID: r.id
            }), e), []) : [])({
                comment: v,
                proxyAddress: w
            }), g[3] = v, g[4] = w, g[5] = n) : n = g[5], g[6] !== t || g[7] !== n ? (s = {
                isCurrentUserComment: t,
                currentUserCommentReactions: n
            }, g[6] = t, g[7] = n, g[8] = s) : s = g[8];
            let {
                isCurrentUserComment: j,
                currentUserCommentReactions: C
            } = s, _ = Array.isArray(v ? .children) && v.children.length > 0;
            g[9] !== v ? .children ? .length || g[10] !== b || g[11] !== _ ? (o = () => {
                if (!_) return !1;
                let {
                    commentId: e
                } = O(b);
                return !!e || (v ? .children ? .length ? ? 0) <= 2
            }, g[9] = v ? .children ? .length, g[10] = b, g[11] = _, g[12] = o) : o = g[12];
            let [T, M] = (0, i.useState)(o), N = `flex w-full ${k?"animate-fadeIn":""}`, I = v ? .profile, P = S ? 32 : 40;
            g[13] !== I || g[14] !== P ? (l = (0, r.jsx)(rI, {
                profile: I,
                size: P
            }), g[13] = I, g[14] = P, g[15] = l) : l = g[15];
            let E = `flex flex-col ml-3.5 whitespace-normal ${S?"w-[calc(100%-50px)]":"w-[calc(100%-58px)]"}`,
                A = v ? .profile,
                D = v ? .createdAt;
            g[16] !== A || g[17] !== D ? (c = (0, r.jsx)(rT, {
                profile: A,
                commentCreatedAt: D
            }), g[16] = A, g[17] = D, g[18] = c) : c = g[18];
            let L = v ? .id;
            g[19] !== b || g[20] !== j || g[21] !== y || g[22] !== L ? (d = (0, r.jsx)(rv, {
                commentId: L,
                onSetCommentIdToDelete: y,
                isCurrentUserComment: j,
                commentsEventQueryKey: b
            }), g[19] = b, g[20] = j, g[21] = y, g[22] = L, g[23] = d) : d = g[23], g[24] !== c || g[25] !== d ? (u = (0, r.jsxs)("div", {
                className: "flex items-center w-full justify-between relative gap-3",
                children: [c, d]
            }), g[24] = c, g[25] = d, g[26] = u) : u = g[26];
            let z = v ? .profileUserIsReplyingTo,
                R = v ? .body,
                F = v ? .media;
            g[27] !== z || g[28] !== R || g[29] !== F ? (m = (0, r.jsx)(t1, {
                profileUserIsReplyingTo: z,
                body: R,
                media: F
            }), g[27] = z, g[28] = R, g[29] = F, g[30] = m) : m = g[30], g[31] !== v || g[32] !== b || g[33] !== C || g[34] !== j || g[35] !== w ? (p = (0, r.jsx)(rt, {
                comment: v,
                isCurrentUserComment: j,
                currentUserCommentReactions: C,
                commentsEventQueryKey: b,
                proxyAddress: w
            }), g[31] = v, g[32] = b, g[33] = C, g[34] = j, g[35] = w, g[36] = p) : p = g[36];
            let $ = v ? .children;
            return g[37] !== b || g[38] !== T || g[39] !== y || g[40] !== w || g[41] !== k || g[42] !== $ ? (h = (0, r.jsx)(rM, {
                replies: $,
                commentsEventQueryKey: b,
                onSetCommentIdToDelete: y,
                shouldAnimate: k,
                proxyAddress: w,
                isShowingReplies: T,
                setIsShowingReplies: M
            }), g[37] = b, g[38] = T, g[39] = y, g[40] = w, g[41] = k, g[42] = $, g[43] = h) : h = g[43], g[44] !== u || g[45] !== m || g[46] !== p || g[47] !== h || g[48] !== E ? (f = (0, r.jsxs)("div", {
                className: E,
                children: [u, m, p, h]
            }), g[44] = u, g[45] = m, g[46] = p, g[47] = h, g[48] = E, g[49] = f) : f = g[49], g[50] !== f || g[51] !== N || g[52] !== l ? (x = (0, r.jsxs)("div", {
                className: N,
                children: [l, f]
            }), g[50] = f, g[51] = N, g[52] = l, g[53] = x) : x = g[53], x
        }),
        rE = (0, i.memo)(function(e) {
            let t, i = (0, a.c)(2),
                {
                    commentsEventQueryKey: n
                } = e;
            return i[0] !== n ? (t = (0, r.jsx)(r.Fragment, {
                children: Array.from({
                    length: 5
                }, (e, t) => (0, r.jsx)("div", {
                    className: "flex mt-6 h-[75px]",
                    children: (0, r.jsx)(rP, {
                        comment: void 0,
                        proxyAddress: void 0,
                        shouldAnimate: !1,
                        commentsEventQueryKey: n,
                        onSetCommentIdToDelete: rA
                    })
                }, `skeleton-comment-${t}`))
            }), i[0] = n, i[1] = t) : t = i[1], t
        });

    function rA() {}
    let rO = (0, i.memo)(function(e) {
            let t, i, n, s = (0, a.c)(12),
                {
                    comments: o,
                    onSetCommentIdToDelete: l,
                    commentsEventQueryKey: c
                } = e;
            s[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], s[0] = t) : t = s[0];
            let {
                proxyAddress: d
            } = (0, m.useAccountContext)(t);
            if (s[1] !== o || s[2] !== c || s[3] !== l || s[4] !== d) {
                let e;
                s[6] !== c || s[7] !== l || s[8] !== d ? (e = e => (0, r.jsx)("article", {
                    id: `comment-${e.id}`,
                    className: "comment flex pt-6",
                    children: (0, r.jsx)(rP, {
                        comment: e,
                        shouldAnimate: !1,
                        onSetCommentIdToDelete: l,
                        commentsEventQueryKey: c,
                        proxyAddress: d
                    })
                }, e.id), s[6] = c, s[7] = l, s[8] = d, s[9] = e) : e = s[9], i = o.map(e), s[1] = o, s[2] = c, s[3] = l, s[4] = d, s[5] = i
            } else i = s[5];
            return s[10] !== i ? (n = (0, r.jsx)("div", {
                children: i
            }), s[10] = i, s[11] = n) : n = s[11], n
        }),
        rD = (0, i.memo)(function(e) {
            let t, i, n, s, o, l, c, d, u, m, p, h, f, x, g = (0, a.c)(36),
                {
                    commentId: v,
                    onClose: y,
                    commentsEventQueryKey: b
                } = e,
                k = (0, H.useTranslations)();
            g[0] !== b ? (t = {
                commentsEventQueryKey: b
            }, g[0] = b, g[1] = t) : t = g[1];
            let {
                mutation: w
            } = rd(t), {
                mutateAsync: S
            } = w;
            g[2] !== v || g[3] !== S || g[4] !== y ? (i = async () => {
                v && (S({
                    id: v
                }), y())
            }, g[2] = v, g[3] = S, g[4] = y, g[5] = i) : i = g[5];
            let j = i;
            if (!v) return null;
            let C = !!v;
            return g[6] !== y ? (n = e => !e && y(), g[6] = y, g[7] = n) : n = g[7], g[8] !== k ? (s = k("comments.deleteDialog.title"), g[8] = k, g[9] = s) : s = g[9], g[10] !== s ? (o = (0, r.jsx)(tv.ModalTitle, {
                children: s
            }), g[10] = s, g[11] = o) : o = g[11], g[12] !== k ? (l = k("comments.deleteDialog.description"), g[12] = k, g[13] = l) : l = g[13], g[14] !== l ? (c = (0, r.jsx)(tv.ModalDescription, {
                children: l
            }), g[14] = l, g[15] = c) : c = g[15], g[16] !== k ? (d = k("comments.deleteDialog.cancel"), g[16] = k, g[17] = d) : d = g[17], g[18] !== d ? (u = (0, r.jsx)(tv.ModalClose, {
                asChild: !0,
                children: (0, r.jsx)(F.Button, {
                    variant: "outline",
                    children: d
                })
            }), g[18] = d, g[19] = u) : u = g[19], g[20] !== k ? (m = k("comments.deleteDialog.confirm"), g[20] = k, g[21] = m) : m = g[21], g[22] !== j || g[23] !== m ? (p = (0, r.jsx)(F.Button, {
                variant: "destructive",
                onClick: j,
                children: m
            }), g[22] = j, g[23] = m, g[24] = p) : p = g[24], g[25] !== u || g[26] !== p ? (h = (0, r.jsxs)(tv.ModalFooter, {
                children: [u, p]
            }), g[25] = u, g[26] = p, g[27] = h) : h = g[27], g[28] !== h || g[29] !== o || g[30] !== c ? (f = (0, r.jsxs)(tv.ModalContent, {
                children: [o, c, h]
            }), g[28] = h, g[29] = o, g[30] = c, g[31] = f) : f = g[31], g[32] !== f || g[33] !== C || g[34] !== n ? (x = (0, r.jsx)(tv.Modal, {
                open: C,
                onOpenChange: n,
                size: "sm",
                children: f
            }), g[32] = f, g[33] = C, g[34] = n, g[35] = x) : x = g[35], x
        });
    var rL = e.i(66199);
    let rz = e => Array.isArray(e.series) && e.series.length > 0 ? {
        entityType: "Series",
        entityId: e.series[0].id
    } : {
        entityType: "Event",
        entityId: e.id
    };
    e.s(["getCommentEntity", 0, rz], 960867);
    let rR = e => {
            let t, c, f, x, v, b, k, w, S, j, C, _, T, O, D, R, F, $, B, q, V, H, U, W = (0, a.c)(79),
                {
                    isEventActive: G,
                    entityType: Z,
                    entityId: K,
                    eventCommentCount: Y,
                    markets: Q,
                    shouldForcePositionColorBlue: X,
                    showCategoryFAQ: J
                } = e,
                [ee, et] = (0, i.useState)(null),
                er = (0, p.useAmplitudeAnalytics)();
            W[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["authenticated"], W[0] = t) : t = W[0];
            let {
                authenticated: ea
            } = (0, m.useAccountContext)(t), [ei, en] = (0, i.useState)(10);
            W[1] !== Y || W[2] !== G ? (c = {
                isEventActive: G,
                commentCount: Y
            }, W[1] = Y, W[2] = G, W[3] = c) : c = W[3];
            let {
                holdersOnly: es,
                setHoldersOnly: eo,
                sortBy: el,
                setSortBy: ec,
                commentId: ed
            } = (e => {
                let t, r, n, s, o = (0, a.c)(12),
                    {
                        isEventActive: l,
                        commentCount: c
                    } = e,
                    d = (0, y.useRouter)();
                o[0] !== c || o[1] !== l ? (t = Number.isFinite(c) && c > 1e3 && l, o[0] = c, o[1] = l, o[2] = t) : t = o[2], o[3] !== t ? (r = {
                    defaultValue: t
                }, o[3] = t, o[4] = r) : r = o[4];
                let [u, m] = (0, rL.useLocalStorageState)("pm_show_holders", r), [p, h] = (0, i.useState)(I.CommentsSortBy.Newest);
                if (o[5] !== d.query) {
                    let e;
                    n = (e = d.query).commentId && "string" == typeof e.commentId ? e.commentId : void 0, o[5] = d.query, o[6] = n
                } else n = o[6];
                let f = n;
                return o[7] !== f || o[8] !== u || o[9] !== m || o[10] !== p ? (s = {
                    holdersOnly: u,
                    setHoldersOnly: m,
                    sortBy: p,
                    setSortBy: h,
                    commentId: f
                }, o[7] = f, o[8] = u, o[9] = m, o[10] = p, o[11] = s) : s = o[11], s
            })(c);
            W[4] === Symbol.for("react.memo_cache_sentinel") ? (f = () => {
                en(10)
            }, W[4] = f) : f = W[4], W[5] !== es || W[6] !== el ? (x = [el, es], W[5] = es, W[6] = el, W[7] = x) : x = W[7], (0, i.useEffect)(f, x), W[8] !== ed || W[9] !== K || W[10] !== Z || W[11] !== es || W[12] !== G || W[13] !== Q || W[14] !== X || W[15] !== el ? (v = {
                entityType: Z,
                entityId: K,
                sortBy: el,
                holdersOnly: es,
                isEventActive: G,
                commentId: ed,
                markets: Q,
                shouldForcePositionColorBlue: X
            }, W[8] = ed, W[9] = K, W[10] = Z, W[11] = es, W[12] = G, W[13] = Q, W[14] = X, W[15] = el, W[16] = v) : v = W[16];
            let {
                query: eu,
                queryKey: em
            } = (e => {
                let t, r, i, n, s, o, l = (0, a.c)(27),
                    {
                        entityType: c,
                        entityId: d,
                        sortBy: u,
                        holdersOnly: m,
                        isEventActive: p,
                        commentId: h,
                        markets: f,
                        shouldForcePositionColorBlue: x
                    } = e,
                    g = void 0 !== x && x;
                l[0] !== f ? (t = f.reduce((e, t) => (!t.closed && Array.isArray(t.clobTokenIds) && Array.isArray(t.outcomes) && t.clobTokenIds.forEach((r, a, i) => {
                    let n = 0 === a ? i[1] : i[0];
                    if (!e[r]) {
                        let i = t.outcomes[a];
                        e[r] = {
                            oppositeAssetId: n,
                            outcomeIndex: a,
                            outcome: i,
                            groupItemTitle: t.groupItemTitle
                        }
                    }
                }), e), {}), l[0] = f, l[1] = t) : t = l[1];
                let v = t;
                l[2] !== c || l[3] !== m || l[4] !== v || l[5] !== g || l[6] !== u ? (r = e => {
                    if (!e.pages) return;
                    let t = new Set;
                    return (({
                        comments: e,
                        sortBy: t
                    }) => {
                        if (!Array.isArray(e)) return [];
                        let r = e.reduce((e, t) => (t.parentCommentID && (e[t.parentCommentID] || (e[t.parentCommentID] = []), e[t.parentCommentID].push({ ...t
                            })), e), {}),
                            a = e.reduce((e, t) => {
                                let r = t.profile ? .baseAddress;
                                return t.profile && r && "string" == typeof r && !e[r] && (e[r.toLowerCase()] = t.profile), e
                            }, {});
                        return e.filter(e => !e.parentCommentID && e.profile).sort((e, r) => (0, A.sortComments)(e, r, t)).map(e => ({ ...e,
                            children: (0, A.cleanAndSortReplies)(r[e.id], a)
                        }))
                    })({
                        comments: e.pages.flatMap(e => e.reduce((e, r) => {
                            if (!r.profile || t.has(r.id)) return e;
                            t.add(r.id);
                            let a = (0, A.addPositionsToUser)(r, v, g);
                            return "Series" === c && m ? (a.profile ? .cleanedPositions ? .length ? ? 0) > 0 && e.push(a) : e.push(a), e
                        }, [])),
                        sortBy: u
                    })
                }, l[2] = c, l[3] = m, l[4] = v, l[5] = g, l[6] = u, l[7] = r) : r = l[7];
                let y = r;
                l[8] !== h || l[9] !== d || l[10] !== c || l[11] !== m || l[12] !== p || l[13] !== u ? (i = P.queryKeys[E.QueryKey.Comments].event(c, d, u, m && p, h), l[8] = h, l[9] = d, l[10] = c, l[11] = m, l[12] = p, l[13] = u, l[14] = i) : i = l[14];
                let b = i,
                    k = b.queryKey,
                    w = !!d;
                (l[15] !== h || l[16] !== m || l[17] !== p ? (n = (e, t) => {
                    if (!h && (Array.isArray(e) && e.length > 0 || m && p && t.length < 20)) return t.length
                }, l[15] = h, l[16] = m, l[17] = p, l[18] = n) : n = l[18], l[19] !== b.queryKey || l[20] !== y || l[21] !== w || l[22] !== n) ? (s = {
                    queryKey: k,
                    queryFn: I.getEventCommentsFetcher,
                    enabled: w,
                    initialPageParam: 0,
                    getNextPageParam: n,
                    refetchOnMount: !1,
                    placeholderData: M.keepPreviousData,
                    select: y,
                    staleTime: 1 / 0,
                    refetchOnReconnect: !1,
                    refetchOnWindowFocus: !1,
                    refetchInterval: !1
                }, l[19] = b.queryKey, l[20] = y, l[21] = w, l[22] = n, l[23] = s) : s = l[23];
                let S = s,
                    j = (0, N.useInfiniteQuery)(S);
                return l[24] !== j || l[25] !== b ? (o = {
                    query: j,
                    queryKey: b
                }, l[24] = j, l[25] = b, l[26] = o) : o = l[26], o
            })(v), {
                data: ep,
                fetchNextPage: eh,
                hasNextPage: ef,
                isFetchingNextPage: ex
            } = eu;
            e: {
                let e;
                if (!ep) {
                    b = void 0;
                    break e
                }
                if (ea) {
                    b = ep;
                    break e
                }
                W[17] !== ep || W[18] !== ei ? (e = ep.slice(0, ei), W[17] = ep, W[18] = ei, W[19] = e) : e = W[19],
                b = e
            }
            let eg = b;
            t: {
                if (!ep || ea) {
                    k = !1;
                    break t
                }
                k = ep.length > ei || (ef ? ? !1)
            }
            let ev = k,
                {
                    setConnectorRoute: ey,
                    setOpen: eb
                } = (0, s.useSiwx)();
            W[20] !== er || W[21] !== ey || W[22] !== eb ? (w = () => {
                let e = Date.now();
                (0, u.markSignupPromptOpened)("comments", {
                    now: e,
                    route: "signup"
                }), er.trackEvent(d.Events.SignupPromptOpened, (0, u.getSignupPromptOpenedEventProperties)({
                    source: "comments",
                    route: "signup"
                })), ey(n.ConnectorRoute.SIGNUP), eb(!0)
            }, W[20] = er, W[21] = ey, W[22] = eb, W[23] = w) : w = W[23];
            let ek = w;
            W[24] === Symbol.for("react.memo_cache_sentinel") ? (S = () => {
                et(null)
            }, W[24] = S) : S = W[24];
            let ew = S;
            W[25] !== em ? (j = {
                commentsEventQueryKey: em
            }, W[25] = em, W[26] = j) : j = W[26];
            let {
                addCommentWebsocket: eS
            } = (e => {
                let t, r, i, n = (0, a.c)(7),
                    {
                        commentsEventQueryKey: s
                    } = e;
                n[0] !== s ? (t = {
                    commentsEventQueryKey: s
                }, n[0] = s, n[1] = t) : t = n[1];
                let {
                    cancelAllVariants: o,
                    setEachVariant: l
                } = z(t);
                n[2] !== o || n[3] !== l ? (r = async e => {
                    await o();
                    let t = { ...e,
                        parentEntityType: e.parentEntityType
                    };
                    l((r, a) => (0, A.handleDoesCommentAlreadyExist)(r, e) || a.holdersOnly && !Array.isArray(e.profile.positions) ? r : {
                        pageParams: r.pageParams,
                        pages: (0, A.handleOptimisticCommentCreate)(r, t)
                    })
                }, n[2] = o, n[3] = l, n[4] = r) : r = n[4];
                let c = r;
                return n[5] !== c ? (i = {
                    addCommentWebsocket: c
                }, n[5] = c, n[6] = i) : i = n[6], i
            })(j);
            W[27] !== em ? (C = {
                commentsEventQueryKey: em
            }, W[27] = em, W[28] = C) : C = W[28];
            let {
                deleteComment: ej
            } = rd(C);
            W[29] !== em ? (_ = {
                commentsEventQueryKey: em
            }, W[29] = em, W[30] = _) : _ = W[30];
            let {
                addReactionWebsocket: eC
            } = (e => {
                let t, r, i, n = (0, a.c)(9),
                    {
                        commentsEventQueryKey: s
                    } = e,
                    o = (0, L.useQueryClient)();
                n[0] !== s ? (t = {
                    commentsEventQueryKey: s
                }, n[0] = s, n[1] = t) : t = n[1];
                let {
                    cancelAllVariants: l,
                    setEachVariant: c
                } = z(t);
                n[2] !== l || n[3] !== s || n[4] !== o || n[5] !== c ? (r = async e => {
                    if (o.isMutating({
                            mutationKey: s.queryKey
                        }) > 0) return;
                    await l();
                    let t = { ...e
                    };
                    c(r => ({
                        pageParams: r.pageParams,
                        pages: (0, A.handleOptimisticPostReaction)(r, e, t)
                    }))
                }, n[2] = l, n[3] = s, n[4] = o, n[5] = c, n[6] = r) : r = n[6];
                let d = r;
                return n[7] !== d ? (i = {
                    addReactionWebsocket: d
                }, n[7] = d, n[8] = i) : i = n[8], i
            })(_);
            W[31] !== em ? (T = {
                commentsEventQueryKey: em
            }, W[31] = em, W[32] = T) : T = W[32];
            let {
                deleteReactionWebsocket: e_
            } = (e => {
                let t, r, i, n = (0, a.c)(9),
                    {
                        commentsEventQueryKey: s
                    } = e,
                    o = (0, L.useQueryClient)();
                n[0] !== s ? (t = {
                    commentsEventQueryKey: s
                }, n[0] = s, n[1] = t) : t = n[1];
                let {
                    cancelAllVariants: l,
                    setEachVariant: c
                } = z(t);
                n[2] !== l || n[3] !== s || n[4] !== o || n[5] !== c ? (r = async e => {
                    !e.commentID || o.isMutating({
                        mutationKey: s.queryKey
                    }) > 0 || (await l(), c(t => ({
                        pageParams: t.pageParams,
                        pages: (0, A.handleOptimisticDeleteReactionWS)(t, e)
                    })))
                }, n[2] = l, n[3] = s, n[4] = o, n[5] = c, n[6] = r) : r = n[6];
                let d = r;
                return n[7] !== d ? (i = {
                    deleteReactionWebsocket: d
                }, n[7] = d, n[8] = i) : i = n[8], i
            })(T), {
                registerCommentHandlers: eT,
                unregisterCommentHandlers: eM
            } = (0, h.useEventCommentHandlers)();
            W[33] !== eS || W[34] !== eC || W[35] !== ej || W[36] !== e_ ? (O = {
                comment_created: eS,
                comment_removed: ej,
                reaction_created: eC,
                reaction_removed: e_
            }, W[33] = eS, W[34] = eC, W[35] = ej, W[36] = e_, W[37] = O) : O = W[37];
            let eN = O;
            W[38] !== eN || W[39] !== eT || W[40] !== eM ? (D = () => (eT(eN), () => eM()), W[38] = eN, W[39] = eT, W[40] = eM, W[41] = D) : D = W[41], W[42] !== eS || W[43] !== eC || W[44] !== ej || W[45] !== e_ || W[46] !== eT || W[47] !== eM ? (R = [eS, ej, eC, e_, eT, eM], W[42] = eS, W[43] = eC, W[44] = ej, W[45] = e_, W[46] = eT, W[47] = eM, W[48] = R) : R = W[48], (0, i.useEffect)(D, R), W[49] !== G || W[50] !== em || W[51] !== eo || W[52] !== ec ? (F = (0, r.jsx)(tW, {
                setSortBy: ec,
                setHoldersOnly: eo,
                isEventActive: G,
                commentsEventQueryKey: em
            }), W[49] = G, W[50] = em, W[51] = eo, W[52] = ec, W[53] = F) : F = W[53], W[54] !== ee || W[55] !== em ? ($ = (0, r.jsx)(rD, {
                commentId: ee,
                commentsEventQueryKey: em,
                onClose: ew
            }), W[54] = ee, W[55] = em, W[56] = $) : $ = W[56], W[57] !== eg || W[58] !== em ? (B = eg ? (0, r.jsx)(rO, {
                comments: eg,
                commentsEventQueryKey: em,
                onSetCommentIdToDelete: et
            }) : (0, r.jsx)(rE, {
                commentsEventQueryKey: em
            }), W[57] = eg, W[58] = em, W[59] = B) : B = W[59];
            let eI = !!eg,
                eP = eg ? .length === 0,
                eE = ef ? ? !1,
                eA = ex ? ? !1;
            return W[60] !== ea || W[61] !== eh || W[62] !== ek || W[63] !== ev || W[64] !== eI || W[65] !== eP || W[66] !== eE || W[67] !== eA ? (q = (0, r.jsx)(g.CommentsFooter, {
                hasComments: eI,
                isEmpty: eP,
                hasNextPage: eE,
                isFetchingNextPage: eA,
                onFetchNextPage: eh,
                authenticated: ea,
                hasMoreToShow: ev,
                onShowMore: ek
            }), W[60] = ea, W[61] = eh, W[62] = ek, W[63] = ev, W[64] = eI, W[65] = eP, W[66] = eE, W[67] = eA, W[68] = q) : q = W[68], W[69] !== F || W[70] !== $ || W[71] !== B || W[72] !== q ? (V = (0, r.jsxs)("section", {
                "data-nosnippet": !0,
                children: [F, $, B, q]
            }), W[69] = F, W[70] = $, W[71] = B, W[72] = q, W[73] = V) : V = W[73], W[74] !== J ? (H = J ? (0, r.jsx)(l.SportsCategoryFAQSection, {}) : (0, r.jsx)(o.EventFAQSection, {}), W[74] = J, W[75] = H) : H = W[75], W[76] !== V || W[77] !== H ? (U = (0, r.jsxs)("div", {
                id: "commentsInner",
                className: "flex w-full flex-col pb-6",
                children: [V, H]
            }), W[76] = V, W[77] = H, W[78] = U) : U = W[78], U
        },
        rF = (0, i.memo)(function() {
            let e, t, i, n = (0, a.c)(9);
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], n[0] = e) : e = n[0];
            let {
                event: s
            } = (0, f.useEventContext)(e), o = s.active && !s.closed, l = s.commentCount ? ? 0;
            n[1] !== s ? (t = rz(s), n[1] = s, n[2] = t) : t = n[2];
            let {
                entityType: c,
                entityId: d
            } = t;
            return n[3] !== d || n[4] !== c || n[5] !== s.markets || n[6] !== l || n[7] !== o ? (i = (0, r.jsx)(rR, {
                isEventActive: o,
                entityType: c,
                entityId: d,
                eventCommentCount: l,
                markets: s.markets
            }), n[3] = d, n[4] = c, n[5] = s.markets, n[6] = l, n[7] = o, n[8] = i) : i = n[8], i
        }),
        r$ = (0, i.memo)(function() {
            let e, t, i, n, s, o, l, d = (0, a.c)(20);
            d[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["events", "event"], d[0] = e) : e = d[0];
            let {
                events: u,
                event: m
            } = (0, f.useEventContext)(e);
            d[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["isSportsPage", "sportSlug", "eventSlug"], d[1] = t) : t = d[1];
            let {
                isSportsPage: p,
                sportSlug: h,
                eventSlug: g
            } = (0, x.useSportsContext)(t);
            d[2] !== m ? (i = rz(m), d[2] = m, d[3] = i) : i = d[3];
            let {
                entityType: v,
                entityId: y
            } = i, b = m.commentCount ? ? 0;
            d[4] !== u ? (n = u ? ? [], d[4] = u, d[5] = n) : n = d[5], d[6] !== n ? (s = n.some(rB), d[6] = n, d[7] = s) : s = d[7];
            let k = s;
            d[8] !== v || d[9] !== m.markets || d[10] !== u ? (o = "Series" === v && Array.isArray(u) ? u.flatMap(rq) : m.markets, d[8] = v, d[9] = m.markets, d[10] = u, d[11] = o) : o = d[11];
            let w = o,
                S = p && h !== c.SportSlug.EPL,
                j = p && !g;
            return d[12] !== y || d[13] !== v || d[14] !== b || d[15] !== k || d[16] !== w || d[17] !== S || d[18] !== j ? (l = (0, r.jsx)(rR, {
                isEventActive: k,
                entityType: v,
                entityId: y,
                eventCommentCount: b,
                markets: w,
                shouldForcePositionColorBlue: S,
                showCategoryFAQ: j
            }), d[12] = y, d[13] = v, d[14] = b, d[15] = k, d[16] = w, d[17] = S, d[18] = j, d[19] = l) : l = d[19], l
        });

    function rB(e) {
        return e.active && !e.closed
    }

    function rq(e) {
        return e.markets
    }
    e.s(["Comments", 0, rF, "SportsComments", 0, r$], 566160)
}, 66674, 91070, 467772, 813899, 193789, e => {
    "use strict";
    e.i(221628);
    var t = e.i(999061);
    e.s(["default", 0, function(e) {
        (0, t.c)(1);
        let {
            event: r
        } = e;
        return null
    }], 66674);
    var r = e.i(416340),
        a = e.i(100825);
    e.s(["useFilteredTabs", 0, (e, r) => {
        let i, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y = (0, t.c)(85),
            {
                moneyline: b,
                spreads: k,
                totals: w,
                firstHalfMoneyline: S,
                firstHalfSpreads: j,
                firstHalfTotals: C,
                anytimeTouchdowns: _,
                firstTouchdowns: T,
                rushingYards: M,
                receivingYards: N,
                points: I,
                assists: P,
                rebounds: E,
                soccerAnytimeGoalscorer: A,
                soccerExactScore: O,
                soccerHalftimeResult: D,
                totalCorners: L,
                firstBloods: z,
                killOverUnders: R,
                dota2GameEndsDaytime: F,
                dota2BothTeamsRoshan: $,
                dota2BothTeamsBarracks: B,
                dota2UltraKill: q,
                dota2Rampage: V,
                cs2OddEvenTotalKills: H,
                cs2OddEvenTotalRounds: U,
                lolBothTeamsBaron: W,
                lolBothTeamsDragon: G,
                lolBothTeamsInhibitors: Z,
                lolQuadraKill: K,
                lolPentaKill: Y,
                lolOddEvenTotalKills: Q
            } = (0, a.useSportsMarketsSections)(r),
            X = (0, a.useTeamTotalsGrouped)(r);
        y[0] !== F ? (i = F ? ? [], y[0] = F, y[1] = i) : i = y[1], y[2] !== $ ? (n = $ ? ? [], y[2] = $, y[3] = n) : n = y[3], y[4] !== B ? (s = B ? ? [], y[4] = B, y[5] = s) : s = y[5], y[6] !== q ? (o = q ? ? [], y[6] = q, y[7] = o) : o = y[7], y[8] !== V ? (l = V ? ? [], y[8] = V, y[9] = l) : l = y[9], y[10] !== H ? (c = H ? ? [], y[10] = H, y[11] = c) : c = y[11], y[12] !== U ? (d = U ? ? [], y[12] = U, y[13] = d) : d = y[13], y[14] !== W ? (u = W ? ? [], y[14] = W, y[15] = u) : u = y[15], y[16] !== G ? (m = G ? ? [], y[16] = G, y[17] = m) : m = y[17], y[18] !== Z ? (p = Z ? ? [], y[18] = Z, y[19] = p) : p = y[19], y[20] !== K ? (h = K ? ? [], y[20] = K, y[21] = h) : h = y[21], y[22] !== Y ? (f = Y ? ? [], y[22] = Y, y[23] = f) : f = y[23], y[24] !== Q ? (x = Q ? ? [], y[24] = Q, y[25] = x) : x = y[25], y[26] !== i || y[27] !== n || y[28] !== h || y[29] !== f || y[30] !== x || y[31] !== s || y[32] !== o || y[33] !== l || y[34] !== c || y[35] !== d || y[36] !== u || y[37] !== m || y[38] !== p ? (g = [...i, ...n, ...s, ...o, ...l, ...c, ...d, ...u, ...m, ...p, ...h, ...f, ...x], y[26] = i, y[27] = n, y[28] = h, y[29] = f, y[30] = x, y[31] = s, y[32] = o, y[33] = l, y[34] = c, y[35] = d, y[36] = u, y[37] = m, y[38] = p, y[39] = g) : g = y[39];
        let J = g;
        e: {
            let t;
            if (!e) {
                v = null;
                break e
            }
            if (y[40] !== J || y[41] !== _ ? .length || y[42] !== P ? .length || y[43] !== z || y[44] !== S || y[45] !== j ? .length || y[46] !== C ? .length || y[47] !== T ? .length || y[48] !== R || y[49] !== b || y[50] !== I ? .length || y[51] !== E ? .length || y[52] !== N ? .length || y[53] !== M ? .length || y[54] !== A ? .length || y[55] !== O || y[56] !== D || y[57] !== k ? .length || y[58] !== e || y[59] !== X || y[60] !== L ? .length || y[61] !== w ? .length) {
                let r;
                y[63] !== J || y[64] !== _ ? .length || y[65] !== P ? .length || y[66] !== z || y[67] !== S || y[68] !== j ? .length || y[69] !== C ? .length || y[70] !== T ? .length || y[71] !== R || y[72] !== b || y[73] !== I ? .length || y[74] !== E ? .length || y[75] !== N ? .length || y[76] !== M ? .length || y[77] !== A ? .length || y[78] !== O || y[79] !== D || y[80] !== k ? .length || y[81] !== X || y[82] !== L ? .length || y[83] !== w ? .length ? (r = e => {
                    switch (e.value) {
                        case "series-lines":
                        case "game-lines":
                            return !!b || !!k ? .length || !!w ? .length;
                        case "first-half":
                            return !!S || !!j ? .length || !!C ? .length;
                        case "team-totals":
                            return X.length > 0;
                        case "touchdowns":
                            return !!_ ? .length || !!T ? .length;
                        case "rushing":
                            return !!M ? .length;
                        case "receiving":
                            return !!N ? .length;
                        case "points":
                            return !!I ? .length;
                        case "assists":
                            return !!P ? .length;
                        case "rebounds":
                            return !!E ? .length;
                        case "goalscorers":
                            return !!A ? .length;
                        case "exact-score":
                            return !!O;
                        case "halftime":
                            return !!D;
                        case "corners":
                            return !!L ? .length;
                        default:
                            {
                                let t = e.value.match(/^game(\d+)$/);
                                if (t) {
                                    let e = parseInt(t[1], 10),
                                        r = `-game${e}-`,
                                        a = !!z ? .some(e => e.marketSlug.includes(r)),
                                        i = !!R ? .some(e => e.marketSlug.includes(r)),
                                        n = J.some(e => e.marketSlug.includes(r));
                                    return a || i || n
                                }
                                return !1
                            }
                    }
                }, y[63] = J, y[64] = _ ? .length, y[65] = P ? .length, y[66] = z, y[67] = S, y[68] = j ? .length, y[69] = C ? .length, y[70] = T ? .length, y[71] = R, y[72] = b, y[73] = I ? .length, y[74] = E ? .length, y[75] = N ? .length, y[76] = M ? .length, y[77] = A ? .length, y[78] = O, y[79] = D, y[80] = k ? .length, y[81] = X, y[82] = L ? .length, y[83] = w ? .length, y[84] = r) : r = y[84], t = e.filter(r), y[40] = J, y[41] = _ ? .length, y[42] = P ? .length, y[43] = z, y[44] = S, y[45] = j ? .length, y[46] = C ? .length, y[47] = T ? .length, y[48] = R, y[49] = b, y[50] = I ? .length, y[51] = E ? .length, y[52] = N ? .length, y[53] = M ? .length, y[54] = A ? .length, y[55] = O, y[56] = D, y[57] = k ? .length, y[58] = e, y[59] = X, y[60] = L ? .length, y[61] = w ? .length, y[62] = t
            } else t = y[62];v = t
        }
        return v
    }], 91070);
    var i = e.i(567692),
        n = e.i(840216),
        s = e.i(458164),
        o = e.i(399336),
        l = e.i(880809),
        c = e.i(866192),
        d = e.i(488224),
        u = e.i(289981),
        m = e.i(476979),
        p = e.i(593332);
    let h = [{
            value: "game-lines",
            labelKey: "sports.gameLines"
        }, {
            value: "first-half",
            labelKey: "sports.firstHalf"
        }, {
            value: "team-totals",
            labelKey: "sports.teamTotals"
        }, {
            value: "touchdowns",
            labelKey: "sports.touchdowns"
        }, {
            value: "rushing",
            labelKey: "sports.rushing"
        }, {
            value: "receiving",
            labelKey: "sports.receiving"
        }],
        f = [{
            value: "game-lines",
            labelKey: "sports.gameLines"
        }, {
            value: "first-half",
            labelKey: "sports.firstHalf"
        }, {
            value: "points",
            labelKey: "sports.points"
        }, {
            value: "assists",
            labelKey: "sports.assists"
        }, {
            value: "rebounds",
            labelKey: "sports.rebounds"
        }],
        x = [{
            value: "series-lines",
            labelKey: "sports.seriesLines"
        }, {
            value: "game1",
            labelKey: "sports.game1"
        }, {
            value: "game2",
            labelKey: "sports.game2"
        }, {
            value: "game3",
            labelKey: "sports.game3"
        }, {
            value: "game4",
            labelKey: "sports.game4"
        }, {
            value: "game5",
            labelKey: "sports.game5"
        }],
        g = [{
            value: "series-lines",
            labelKey: "sports.seriesLines"
        }, {
            value: "game1",
            labelKey: "sports.map1"
        }, {
            value: "game2",
            labelKey: "sports.map2"
        }, {
            value: "game3",
            labelKey: "sports.map3"
        }, {
            value: "game4",
            labelKey: "sports.map4"
        }, {
            value: "game5",
            labelKey: "sports.map5"
        }],
        v = [{
            value: "game-lines",
            labelKey: "sports.gameLines"
        }, {
            value: "goalscorers",
            labelKey: "sports.goalscorers"
        }, {
            value: "exact-score",
            labelKey: "sports.exactScore"
        }, {
            value: "halftime",
            labelKey: "sports.halftimeResult"
        }, {
            value: "corners",
            labelKey: "sports.corners"
        }],
        y = "game-lines",
        b = ["lol-", "cs2-", "val-", "dota-"],
        k = {
            first_half_moneyline: "first-half",
            first_half_spreads: "first-half",
            first_half_totals: "first-half",
            team_totals: "team-totals",
            anytime_touchdowns: "touchdowns",
            first_touchdowns: "touchdowns",
            rushing_yards: "rushing",
            receiving_yards: "receiving",
            points: "points",
            assists: "assists",
            rebounds: "rebounds",
            soccer_anytime_goalscorer: "goalscorers",
            soccer_exact_score: "exact-score",
            soccer_halftime_result: "halftime",
            total_corners: "corners"
        };

    function w(e) {
        return e && k[e] || y
    }
    e.s(["DEFAULT_TAB", 0, y, "getLeagueFromSlug", 0, function(e) {
        return e ? e.startsWith("nfl-") ? "nfl" : e.startsWith("nba-") ? "nba" : e.startsWith("cs2-") ? "cs2" : b.some(t => e.startsWith(t)) ? "esports" : m.sportMap[(0, p.canonicalSportSlug)(e)] ? .sportId === m.SportId.Soccer ? "soccer" : null : null
    }, "getTabFromSportsMarketType", 0, w, "getTabsForLeague", 0, function(e) {
        return "nfl" === e ? h : "nba" === e ? f : "cs2" === e ? g : "esports" === e ? x : "soccer" === e ? v : null
    }], 467772);
    var S = e.i(740594),
        j = e.i(488549),
        C = e.i(429411),
        _ = e.i(134709),
        T = e.i(196593),
        M = e.i(156591);
    let N = ({
        market: e,
        side: t,
        selectedOutcomeIdx: r,
        store: a
    }) => {
        if (a) {
            let i = a.getState().byAsset[(0, j.getAssetId)(e)] ? .views ? .[String(e.orderPriceMinTickSize)] ? .bestPrices;
            if (i) {
                let a = i ? .[0 === r ? "~zero" : "~one"] ? .[t ? .toLowerCase()];
                return a ? (0, T.showPaddedCentsOnly)(a, (0, M.getPrecisionFromTickSize)(e.orderPriceMinTickSize ? ? .01)) : a
            }
        }
    };
    e.s(["getPriceToSet", 0, N, "useSetSportsPriceOnLoad", 0, () => {
        let e, a, n, c, d, u, m, p, h = (0, t.c)(35),
            f = r.default.useRef(null);
        h[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], h[0] = e) : e = h[0];
        let {
            activeMarket: x
        } = (0, o.useEventActiveMarketContext)(e), g = (0, i.useBoundBookStore)(), v = (0, _.default)(), y = r.default.useRef(!1);
        h[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["setPrice", "setPriceUpdateLocation", "side", "selectedOutcomeIdx", "orderType", "priceUpdateLocation"], h[1] = a) : a = h[1];
        let {
            setPrice: b,
            setPriceUpdateLocation: k,
            side: w,
            selectedOutcomeIdx: j,
            orderType: I,
            priceUpdateLocation: P
        } = (0, l.useTradeContext)(a);
        h[2] !== g || h[3] !== b || h[4] !== k ? (n = e => {
            let {
                market: t,
                side: r,
                selectedOutcomeIdx: a
            } = e, i = N({
                market: t,
                side: r,
                selectedOutcomeIdx: a,
                store: g
            });
            i && (b(i), k("update-only"))
        }, h[2] = g, h[3] = b, h[4] = k, h[5] = n) : n = h[5];
        let E = n;
        h[6] !== b || h[7] !== k ? (c = e => {
            b(e), k("update-only")
        }, h[6] = b, h[7] = k, h[8] = c) : c = h[8];
        let A = c,
            O = (0, C.useCallbackRef)(E),
            D = (0, C.useCallbackRef)(A);
        h[9] !== x || h[10] !== O || h[11] !== I || h[12] !== P || h[13] !== j || h[14] !== w ? (d = () => {
            let e = f.current,
                t = f.current ? .timestamp ? ? 0,
                r = f.current ? .orderType ? ? "",
                a = f.current ? .side ? ? "",
                i = f.current ? .selectedOutcomeIdx ? ? 0,
                n = Date.now() - t > 1e3,
                o = r !== I,
                l = a !== w,
                c = i !== j,
                d = e ? .slug !== x.slug;
            "click" !== P && "update-only" !== P && "type" !== P && y.current && I === s.OrderType.Limit && (n || o || c || d ? (f.current = {
                slug: x.slug,
                side: w,
                selectedOutcomeIdx: j,
                orderType: I,
                timestamp: Date.now()
            }, O({
                market: x,
                side: w,
                selectedOutcomeIdx: j
            })) : l && f.current && (f.current.side = w))
        }, h[9] = x, h[10] = O, h[11] = I, h[12] = P, h[13] = j, h[14] = w, h[15] = d) : d = h[15], h[16] !== x.slug || h[17] !== O || h[18] !== I || h[19] !== P || h[20] !== j || h[21] !== w ? (u = [x.slug, O, I, j, w, P], h[16] = x.slug, h[17] = O, h[18] = I, h[19] = P, h[20] = j, h[21] = w, h[22] = u) : u = h[22], r.default.useEffect(d, u), h[23] !== x.bestAsk || h[24] !== x.bestBid || h[25] !== x.orderPriceMinTickSize || h[26] !== v || h[27] !== I || h[28] !== P || h[29] !== w || h[30] !== D ? (m = () => {
            if (v) {
                if (I === s.OrderType.Limit && "click" !== P) {
                    let e = w === S.Side.BUY ? x.bestAsk : x.bestBid;
                    null !== e && D((0, T.showPaddedCentsOnly)(e.toString(), (0, M.getPrecisionFromTickSize)(x.orderPriceMinTickSize ? ? .01)))
                }
                y.current = !0
            }
        }, h[23] = x.bestAsk, h[24] = x.bestBid, h[25] = x.orderPriceMinTickSize, h[26] = v, h[27] = I, h[28] = P, h[29] = w, h[30] = D, h[31] = m) : m = h[31], h[32] !== v || h[33] !== D ? (p = [v, D], h[32] = v, h[33] = D, h[34] = p) : p = h[34], r.default.useEffect(m, p)
    }], 813899), e.s(["useSetActiveSportsMarket", 0, () => {
        let {
            activeMarket: e,
            setActiveMarket: t
        } = (0, o.useEventActiveMarketContext)(["activeMarket", "setActiveMarket"]), {
            side: a,
            selectedOutcomeIdx: m,
            setSelectedOutcomeIdx: p,
            setPrice: h,
            setPriceUpdateLocation: f,
            orderType: x
        } = (0, l.useTradeContext)(["side", "selectedOutcomeIdx", "setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "orderType"]), g = (0, n.useBoundSportsStore)(), v = (0, d.useBoundSportsItemStore)(), y = (0, i.useBoundBookStore)(), b = r.default.useCallback(({
            market: e
        }) => {
            if (g) {
                let {
                    events: t
                } = g.getState(), r = Object.values(t).find(t => t.markets.some(t => t.slug === e.slug));
                if (r) return (e => {
                    let {
                        moneyline: t,
                        spreads: r,
                        totals: a
                    } = e.markets.reduce((e, t) => ((0, u.isSpreadMarket)(t.sportsMarketType) ? e.spreads.push(t) : (0, u.isTotalMarket)(t.sportsMarketType) ? e.totals.push(t) : e.moneyline.push(t), e), {
                        moneyline: [],
                        spreads: [],
                        totals: []
                    });
                    return {
                        event: e,
                        markets: {
                            moneyline: t,
                            spreads: r,
                            totals: a
                        }
                    }
                })(r)
            }
        }, [g, v]);
        return r.default.useCallback((r, i) => {
            let {
                eventSlug: n,
                variant: o,
                openGamesAccordion: l = !1,
                openOverlayAccordion: d = !1,
                closeGamesAccordionIfOpen: u = !0,
                closeOverlayAccordionIfOpen: k = !0,
                forceCloseOverlayAccordion: w = !1,
                skipSetActiveMarket: S = !1
            } = i ? ? {}, j = b({
                market: r
            });
            if (j) {
                let {
                    event: a
                } = j;
                if (!S && e.slug !== r.slug) {
                    let i = r.negRisk ? (0, c.findWinningSportsMarketOfType)(a.markets, r.sportsMarketType) : void 0,
                        n = ("spreads" === e.sportsMarketType || e.sportsMarketType ? .includes("handicap")) && e.invertOutcomesVisually,
                        s = ("spreads" === r.sportsMarketType || r.sportsMarketType ? .includes("handicap")) && r.invertOutcomesVisually;
                    t(i ? ? r), (n || s) && n !== s && p((m + 1) % 2)
                }
                if (!g) return;
                v && v.getState().handleOverlayChange({
                    event: a,
                    market: r,
                    store: g,
                    findInitialSpreadsAndTotals: !0
                });
                let {
                    overlayAccordionValue: i
                } = g.getState(), s = "" !== i && i === o;
                void 0 !== o && (w || "" !== i && i !== o && !d || s && k && i === o ? g.getState().setOverlayAccordionValue("") : !s && d && g.getState().setOverlayAccordionValue(o));
                let {
                    gamesAccordionValue: h
                } = g.getState(), f = "" !== h && h === n;
                void 0 !== n && ("" !== h && h !== n && !l || f && u && h === n ? g.getState().setGamesAccordionValue("") : !f && l && g.getState().setGamesAccordionValue(n))
            }
            if (x === s.OrderType.Limit) {
                let e = N({
                    market: r,
                    side: a,
                    selectedOutcomeIdx: m,
                    store: y
                });
                e && (h(e), f("update-only"))
            }
        }, [t, g, v, e.slug, m, p, h, f, e.sportsMarketType, e.invertOutcomesVisually, y, a, x])
    }, "useSportsSlugInit", 0, function() {
        let e = (0, n.useBoundSportsStore)(),
            {
                initialSlugParam: t
            } = (0, o.useEventActiveMarketContext)(["initialSlugParam"]),
            a = r.default.useMemo(() => {
                if (!t || !e) return null;
                for (let [r, a] of Object.entries(e.getState().events)) {
                    let e = a.markets.find(e => e.slug === t);
                    if (e) return {
                        market: e,
                        eventSlug: r
                    }
                }
                return null
            }, [e, t]);
        return r.default.useEffect(() => {
            if (!a || !e) return;
            let t = a.market.sportsMarketType;
            t && !(0, u.isMoneylineMarket)(t) && (e.getState().setLine({
                slug: a.eventSlug,
                type: t,
                line: {
                    value: a.market.slug,
                    line: a.market.line || 0,
                    label: `${a.market.line||0}`,
                    market: a.market.slug,
                    event: a.eventSlug
                }
            }), e.getState().setOverlayAccordionValue(t))
        }, [a, e]), a ? w(a.market.sportsMarketType) : null
    }], 193789)
}, 661879, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(964974),
        a = e.i(318594),
        i = e.i(510954),
        n = e.i(57096);
    let s = [];
    e.s(["useAnnotations", 0, function(e) {
        let o, l, c, d = (0, t.c)(9),
            u = (0, a.useQueryClient)();
        d[0] !== e ? (o = i.queryKeys[n.QueryKey.Annotations].event(e ? ? ""), d[0] = e, d[1] = o) : o = d[1];
        let m = o.queryKey;
        d[2] !== m || d[3] !== u ? (l = async () => u.getQueryData(m) ? ? [], d[2] = m, d[3] = u, d[4] = l) : l = d[4];
        let p = !!e;
        d[5] !== m || d[6] !== l || d[7] !== p ? (c = {
            queryKey: m,
            queryFn: l,
            staleTime: 1 / 0,
            gcTime: 1 / 0,
            enabled: p
        }, d[5] = m, d[6] = l, d[7] = p, d[8] = c) : c = d[8];
        let {
            data: h
        } = (0, r.useQuery)(c);
        return h ? ? s
    }])
}, 177600, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(936712),
        i = e.i(678714),
        n = e.i(937048),
        s = e.i(416340),
        o = e.i(458255),
        l = e.i(870555);
    let c = {
            $green2: "var(--green-500)",
            $red2: "var(--red-400)",
            $gray3: "var(--neutral-500)"
        },
        d = new Intl.NumberFormat("en-US", {
            notation: "compact",
            compactDisplay: "short",
            maximumSignificantDigits: 4
        }),
        u = e => {
            let u, m, p, h, f, x, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er = (0, r.c)(114);
            if (er[0] !== e) {
                let {
                    ref: t,
                    priceChange: r,
                    hideOnZeroValue: a,
                    decimalCount: i,
                    roundUp: n,
                    size: s,
                    fontSize: o,
                    textClassName: l,
                    numberClassName: c,
                    className: d,
                    style: M,
                    delay: N,
                    hidePercentage: I,
                    children: P,
                    noDebounce: E,
                    coerceToDollars: A,
                    suffix: O,
                    ...D
                } = e;
                f = t, p = r, v = a, y = i, b = n, k = s, w = o, T = l, m = c, u = d, x = M, S = N, j = I, C = E, _ = A, g = O, h = D, er[0] = e, er[1] = u, er[2] = m, er[3] = p, er[4] = h, er[5] = f, er[6] = x, er[7] = g, er[8] = v, er[9] = y, er[10] = b, er[11] = k, er[12] = w, er[13] = S, er[14] = j, er[15] = C, er[16] = _, er[17] = T
            } else u = er[1], m = er[2], p = er[3], h = er[4], f = er[5], x = er[6], g = er[7], v = er[8], y = er[9], b = er[10], k = er[11], w = er[12], S = er[13], j = er[14], C = er[15], _ = er[16], T = er[17];
            let ea = void 0 === v || v,
                ei = void 0 === y ? 1 : y,
                en = void 0 !== b && b,
                es = void 0 === k ? 12 : k,
                eo = void 0 === w ? 12 : w,
                el = void 0 === S ? 0 : S,
                ec = void 0 !== j && j,
                ed = void 0 !== C && C,
                eu = void 0 !== _ && _;
            er[18] !== el ? (M = {
                wait: el,
                trailing: !0
            }, er[18] = el, er[19] = M) : M = er[19];
            let em = (0, n.useDebounce)(p, M),
                ep = ed ? p : em,
                eh = eu || !!g;
            N = void 0 !== ei ? ei : eh ? 0 : +(.1 > (ep || 0));
            let ef = 100 * (ep || 0);
            eh && (ef = ep ? ? 0);
            let ex = "";
            if (eu && Math.abs(ef) >= 1e3) {
                let e;
                if (er[20] !== ef) {
                    var eg;
                    let t, r, a;
                    eg = ef, t = d.formatToParts(Math.abs(eg)), r = t.find(e => "compact" === e.type) ? .value ? ? "", a = parseFloat(t.filter(e => "integer" === e.type || "decimal" === e.type || "fraction" === e.type).map(e => e.value).join("") || "0"), e = {
                        scaled: eg < 0 ? -a : a,
                        unit: r
                    }, er[20] = ef, er[21] = e
                } else e = er[21];
                let {
                    scaled: t,
                    unit: r
                } = e;
                ef = t, ex = r, 0 === N && (N = 1)
            }
            er[22] !== ef || er[23] !== N || er[24] !== en || er[25] !== eh ? (I = en && !eh ? Math.ceil(ef) : parseFloat(ef.toFixed(N)), er[22] = ef, er[23] = N, er[24] = en, er[25] = eh, er[26] = I) : I = er[26];
            let ev = I;
            er[27] !== N || er[28] !== ev ? (P = ev.toFixed(N), er[27] = N, er[28] = ev, er[29] = P) : P = er[29];
            let ey = parseFloat(P);
            er[30] !== ep ? (E = () => ep && 0 !== ep ? ep < 0 ? "down" : "up" : "neutral", er[30] = ep, er[31] = E) : E = er[31];
            let eb = E();
            er[32] !== ev ? (A = Math.abs(ev), er[32] = ev, er[33] = A) : A = er[33], er[34] !== ey ? (O = Math.abs(ey), er[34] = ey, er[35] = O) : O = er[35];
            let ek = "down" === eb ? "$red2" : "up" === eb ? "$green2" : "$gray3";
            er[36] !== ex || er[37] !== N || er[38] !== eb || er[39] !== A || er[40] !== O || er[41] !== ek ? (D = {
                value: A,
                displayValue: O,
                decimals: N,
                direction: eb,
                color: ek,
                unit: ex
            }, er[36] = ex, er[37] = N, er[38] = eb, er[39] = A, er[40] = O, er[41] = ek, er[42] = D) : D = er[42];
            let {
                color: ew,
                value: eS,
                decimals: ej,
                displayValue: eC,
                direction: e_,
                unit: eT
            } = D, eM = ea && 0 === eC || "neutral" === e_, [eN, eI] = s.default.useState(!1);
            if (er[43] !== p ? (L = () => {
                    void 0 !== p && eI(!0)
                }, z = [p], er[43] = p, er[44] = L, er[45] = z) : (L = er[44], z = er[45]), s.default.useEffect(L, z), !eN && void 0 === p) return null;
            let eP = eM && "hidden";
            er[46] !== u || er[47] !== eP ? (R = (0, l.cn)("flex items-center", eP, u), er[46] = u, er[47] = eP, er[48] = R) : R = er[48];
            let eE = c[ew],
                eA = `transform 150ms ease ${el}s, color 120ms ease-in-out ${el}s`;
            er[49] !== eE || er[50] !== eA ? (F = {
                color: eE,
                transition: eA
            }, er[49] = eE, er[50] = eA, er[51] = F) : F = er[51], er[52] !== ew || er[53] !== e_ || er[54] !== es ? ($ = "up" === e_ ? (0, t.jsx)(i.IconCaretUpFill12, {
                size: es,
                color: c[ew]
            }) : "down" === e_ ? (0, t.jsx)(a.IconCaretDownFill12, {
                size: es,
                color: c[ew]
            }) : null, er[52] = ew, er[53] = e_, er[54] = es, er[55] = $) : $ = er[55], er[56] !== F || er[57] !== $ ? (B = (0, t.jsx)("div", {
                className: "z-1 mr-0.5 ml-1",
                style: F,
                children: $
            }), er[56] = F, er[57] = $, er[58] = B) : B = er[58], er[59] === Symbol.for("react.memo_cache_sentinel") ? (q = {
                width: "auto"
            }, er[59] = q) : q = er[59];
            let eO = el + .05;
            er[60] !== eO ? (V = {
                type: "tween",
                ease: "easeOut",
                duration: .1,
                delay: eO
            }, er[60] = eO, er[61] = V) : V = er[61], er[62] !== el || er[63] !== V ? (H = {
                opacity: 1,
                width: "auto",
                transition: {
                    type: "spring",
                    duration: .3,
                    bounce: .1,
                    delay: el,
                    opacity: V
                }
            }, er[62] = el, er[63] = V, er[64] = H) : H = er[64], er[65] === Symbol.for("react.memo_cache_sentinel") ? (U = {
                opacity: 0,
                width: "auto",
                transition: {
                    type: "spring",
                    duration: .3,
                    bounce: .1,
                    opacity: {
                        type: "tween",
                        ease: "easeOut",
                        duration: .05
                    }
                }
            }, er[65] = U) : U = er[65];
            let eD = c[ew],
                eL = `color 120ms ease-in-out ${el}s`;
            return er[66] !== eD || er[67] !== eL ? (W = {
                color: eD,
                transition: eL
            }, er[66] = eD, er[67] = eL, er[68] = W) : W = er[68], er[69] !== m ? (G = (0, l.cn)("z-2", m), er[69] = m, er[70] = G) : G = er[70], er[71] !== eu || er[72] !== T ? (Z = eu && (0, t.jsx)(o.AnimatedNumber.Prefix, {
                className: T,
                children: "$"
            }), er[71] = eu, er[72] = T, er[73] = Z) : Z = er[73], er[74] !== ej || er[75] !== ep || er[76] !== T ? (K = ((ep ? ? 0) < .1 || ej > 0) && (0, t.jsx)(o.AnimatedNumber.Decimal, {
                className: T
            }), er[74] = ej, er[75] = ep, er[76] = T, er[77] = K) : K = er[77], er[78] !== K || er[79] !== T ? (Y = (0, t.jsx)(o.AnimatedNumber.Digits, {
                stiffness: 1300,
                damping: 50,
                className: T,
                children: K
            }), er[78] = K, er[79] = T, er[80] = Y) : Y = er[80], er[81] !== eu || er[82] !== T || er[83] !== eT ? (Q = eu && eT && (0, t.jsx)(o.AnimatedNumber.Suffix, {
                className: T,
                children: eT
            }), er[81] = eu, er[82] = T, er[83] = eT, er[84] = Q) : Q = er[84], er[85] !== eu || er[86] !== ec || er[87] !== g || er[88] !== T ? (X = !eu && !g && (0, t.jsx)(o.AnimatedNumber.Suffix, {
                className: T,
                children: !ec && "%"
            }), er[85] = eu, er[86] = ec, er[87] = g, er[88] = T, er[89] = X) : X = er[89], er[90] !== g || er[91] !== T ? (J = g && (0, t.jsx)(o.AnimatedNumber.Suffix, {
                className: T,
                children: g
            }), er[90] = g, er[91] = T, er[92] = J) : J = er[92], er[93] !== ej || er[94] !== e_ || er[95] !== eo || er[96] !== ed || er[97] !== H || er[98] !== W || er[99] !== G || er[100] !== Z || er[101] !== Y || er[102] !== Q || er[103] !== X || er[104] !== J || er[105] !== eS ? (ee = (0, t.jsxs)(o.AnimatedNumber.Root, {
                noDebounce: ed,
                initial: q,
                animate: H,
                exit: U,
                value: eS,
                decimalCount: ej,
                fontSize: eo,
                padding: 0,
                style: W,
                className: G,
                children: [Z, Y, Q, X, J]
            }, e_), er[93] = ej, er[94] = e_, er[95] = eo, er[96] = ed, er[97] = H, er[98] = W, er[99] = G, er[100] = Z, er[101] = Y, er[102] = Q, er[103] = X, er[104] = J, er[105] = eS, er[106] = ee) : ee = er[106], er[107] !== h || er[108] !== f || er[109] !== x || er[110] !== R || er[111] !== B || er[112] !== ee ? (et = (0, t.jsxs)("div", {
                ref: f,
                className: R,
                style: x,
                ...h,
                children: [B, ee]
            }), er[107] = h, er[108] = f, er[109] = x, er[110] = R, er[111] = B, er[112] = ee, er[113] = et) : et = er[113], et
        };
    u.displayName = "PriceChange", e.s(["PriceChange", 0, u])
}, 421504, e => {
    "use strict";
    e.s(["filterTrackedPositionsCallback", 0, (e, t) => {
        if (!e || !t) return [];
        if (Array.isArray(t)) {
            let r = t.reduce((e, t) => (e[t.conditionId] || (e[t.conditionId] = !0), e), {});
            return e ? .filter(e => r[e.market.id.toLowerCase()]) ? ? []
        }
        return !Array.isArray(t) && t ? .conditionId ? e.filter(e => e.market.id.toLowerCase() === t.conditionId.toLowerCase()) ? ? [] : []
    }])
}, 74156, 355429, e => {
    "use strict";
    var t, r = ((t = {}).initialized = "initialized", t.posed = "posed", t.proposed = "proposed", t.resolved = "resolved", t.challenged = "challenged", t.reproposed = "reproposed", t.disputed = "disputed", t);
    async function a(e) {
        let t = await fetch(`/api/market/resolution/${e}`);
        if (!t.ok) throw Error(`Failed to fetch resolution data: ${t.statusText}`);
        return (await t.json()).data ? ? null
    }
    e.s(["ResolutionStatus", () => r], 355429);
    let i = async e => {
        let t = e.negRisk ? e.negRiskRequestID : e.questionID;
        return t ? a(t) : null
    };
    e.s(["getResolutionData", 0, i], 74156)
}, 227865, 699291, e => {
    "use strict";
    var t, r = e.i(221628),
        a = e.i(999061),
        i = e.i(122538),
        n = e.i(964974),
        s = e.i(144333),
        o = e.i(416340),
        l = e.i(458164),
        c = e.i(394341),
        d = e.i(30704),
        u = e.i(430849),
        m = e.i(502475),
        p = e.i(784521),
        h = e.i(399336),
        f = e.i(880809),
        x = e.i(354712),
        g = e.i(74156),
        v = ((t = {}).Book = "Order Book", t.Chart = "Graph", t.Positions = "Positions", t.OpenOrders = "Open Orders", t.History = "History", t.Resolution = "Resolution", t);
    e.s(["EVENT_DETAIL_TABS", () => v], 699291);
    let y = (0, x.createSplitContext)("EventDetailTabContext", {
        event: void 0,
        filledOrders: [],
        market: void 0,
        openOrders: [],
        resolutionData: void 0,
        selected: "",
        selectedIndex: 0,
        setSelectedIndex: () => {},
        tabs: []
    });

    function b(e) {
        return e >= .01
    }
    e.s(["EventDetailTabContextProvider", 0, e => {
        let t, x, k, w, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, R, F = (0, a.c)(71),
            {
                market: $,
                event: B,
                children: q
            } = e;
        F[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["activeMarket"], F[0] = t) : t = F[0];
        let {
            activeMarket: V
        } = (0, h.useEventActiveMarketContext)(t);
        F[1] !== V || F[2] !== B || F[3] !== $ ? (x = $ || B.markets.find(e => V.id === e.id) || B.markets[0], F[1] = V, F[2] = B, F[3] = $, F[4] = x) : x = F[4];
        let H = x;
        F[5] === Symbol.for("react.memo_cache_sentinel") ? (k = ["authenticated", "proxyAddress"], F[5] = k) : k = F[5];
        let {
            authenticated: U,
            proxyAddress: W
        } = (0, p.useAccountContext)(k), {
            filledOrders: G
        } = (0, c.useFilledOrders)(), Z = H ? .clobTokenIds, K = H ? .conditionId, Y = H ? .orderPriceMinTickSize;
        F[6] !== Z || F[7] !== K || F[8] !== Y ? (w = {
            clobTokenIds: Z,
            conditionId: K,
            orderPriceMinTickSize: Y
        }, F[6] = Z, F[7] = K, F[8] = Y, F[9] = w) : w = F[9];
        let {
            userOpenOrders: Q
        } = (0, d.default)(w), X = !!Q.length, J = !!G.length;
        F[10] === Symbol.for("react.memo_cache_sentinel") ? (S = ["orderType"], F[10] = S) : S = F[10];
        let {
            orderType: ee
        } = (0, f.useTradeContext)(S), et = (0, u.default)(H.conditionId);
        F[11] !== H.conditionId ? (j = (0, m.getTrackedMarketPositionsSelector)(H.conditionId), F[11] = H.conditionId, F[12] = j) : j = F[12], F[13] !== W || F[14] !== j ? (C = {
            proxyAddress: W,
            select: j
        }, F[13] = W, F[14] = j, F[15] = C) : C = F[15];
        let {
            optimisticPositions: er
        } = (0, m.default)(C), ea = Array.isArray(er) && er.length > 0;
        F[16] !== H.closed ? (_ = H.closed ? [] : [v.Book], F[16] = H.closed, F[17] = _) : _ = F[17], F[18] !== H.enableOrderBook ? (T = H.enableOrderBook ? [v.Chart] : [], F[18] = H.enableOrderBook, F[19] = T) : T = F[19], F[20] !== _ || F[21] !== T ? (M = [..._, ...T], F[20] = _, F[21] = T, F[22] = M) : M = F[22];
        let [ei, en] = (0, o.useState)(M), [es, eo] = (0, o.useState)(0), el = es <= ei.length ? ei[es] : ei[0];
        F[23] !== H.id ? (N = ["/api/market/resolutionData", H.id], F[23] = H.id, F[24] = N) : N = F[24], F[25] !== H ? (I = () => (0, g.getResolutionData)(H), F[25] = H, F[26] = I) : I = F[26], F[27] !== H.resolutionData ? (P = () => H.resolutionData, F[27] = H.resolutionData, F[28] = P) : P = F[28];
        let ec = !H.resolutionData;
        F[29] === Symbol.for("react.memo_cache_sentinel") ? (E = {
            errorContext: {
                tag: "[EventDetailTabContext > marketResolutionData]"
            }
        }, F[29] = E) : E = F[29], F[30] !== N || F[31] !== I || F[32] !== P || F[33] !== ec ? (A = {
            queryKey: N,
            queryFn: I,
            initialData: P,
            enabled: ec,
            refetchOnMount: !1,
            refetchOnReconnect: !1,
            refetchOnWindowFocus: !1,
            placeholderData: i.keepPreviousData,
            meta: E
        }, F[30] = N, F[31] = I, F[32] = P, F[33] = ec, F[34] = A) : A = F[34];
        let {
            data: ed
        } = (0, n.useQuery)(A);
        F[35] !== U || F[36] !== J || F[37] !== X || F[38] !== ea || F[39] !== H.closed || F[40] !== H.enableOrderBook || F[41] !== H.resolutionData || F[42] !== ee || F[43] !== ed || F[44] !== el || F[45] !== et || F[46] !== ei ? (O = () => {
            let e = [...H.closed ? [] : [v.Book], ...H.enableOrderBook ? [v.Chart] : []];
            U && (X && e.unshift(v.OpenOrders), (et.some(b) || ea) && e.unshift(v.Positions), H.enableOrderBook && (ee === l.OrderType.Limit || ee === l.OrderType.Market) && J && e.push(v.History)), (H.resolutionData || ed) && e.push(v.Resolution), (0, s.isEqual)(ei, e) || (en(e), e.includes(el) ? eo(e.indexOf(el)) : eo(0))
        }, F[35] = U, F[36] = J, F[37] = X, F[38] = ea, F[39] = H.closed, F[40] = H.enableOrderBook, F[41] = H.resolutionData, F[42] = ee, F[43] = ed, F[44] = el, F[45] = et, F[46] = ei, F[47] = O) : O = F[47], F[48] !== U || F[49] !== J || F[50] !== X || F[51] !== ea || F[52] !== H.enableOrderBook || F[53] !== ee || F[54] !== et ? (D = [X, J, H.enableOrderBook, U, et, ea, ee], F[48] = U, F[49] = J, F[50] = X, F[51] = ea, F[52] = H.enableOrderBook, F[53] = ee, F[54] = et, F[55] = D) : D = F[55], (0, o.useEffect)(O, D), F[56] !== H || F[57] !== ed ? (L = ed ? { ...H,
            resolutionData: ed
        } : H, F[56] = H, F[57] = ed, F[58] = L) : L = F[58];
        let eu = L,
            em = ed ? ? void 0;
        F[59] !== B || F[60] !== G || F[61] !== eu || F[62] !== Q || F[63] !== el || F[64] !== es || F[65] !== em || F[66] !== ei ? (z = {
            market: eu,
            resolutionData: em,
            tabs: ei,
            selected: el,
            selectedIndex: es,
            setSelectedIndex: eo,
            filledOrders: G,
            openOrders: Q,
            event: B
        }, F[59] = B, F[60] = G, F[61] = eu, F[62] = Q, F[63] = el, F[64] = es, F[65] = em, F[66] = ei, F[67] = z) : z = F[67];
        let ep = z;
        return F[68] !== q || F[69] !== ep ? (R = (0, r.jsx)(y.Provider, {
            values: ep,
            children: q
        }), F[68] = q, F[69] = ep, F[70] = R) : R = F[70], R
    }, "useEventDetailTabContext", 0, e => (0, x.useSplitContext)(y, e)], 227865)
}, 230684, e => {
    "use strict";
    e.s(["useRedeem", () => D]);
    var t = e.i(999061),
        r = e.i(328113),
        a = e.i(416340),
        i = e.i(73836),
        n = e.i(423708),
        s = e.i(246290),
        o = e.i(628684),
        l = e.i(112014),
        c = e.i(101008),
        d = e.i(249792),
        u = e.i(606572),
        m = e.i(51800),
        p = e.i(430849),
        h = e.i(460649),
        f = e.i(780641),
        x = e.i(631503),
        g = e.i(600326),
        v = e.i(502980),
        y = e.i(99417),
        b = e.i(604777),
        k = e.i(784521),
        w = e.i(400819),
        S = e.i(399336),
        j = e.i(269101),
        C = e.i(880809),
        _ = e.i(885092),
        T = e.i(921807),
        M = e.i(660006),
        N = e.i(196593),
        I = e.i(450091),
        P = e.i(631222),
        E = e.i(324277),
        A = e.i(504404),
        O = e.i(118818);
    let D = () => {
        let e = (0, b.useTranslations)(),
            D = (0, d.useToast)(),
            {
                positions: L
            } = (0, j.useEventPositionsContext)(["positions"]),
            {
                switchChainAsync: z
            } = (0, i.useSwitchChain)(),
            {
                enqueueTransaction: R
            } = (0, _.useTransactionContext)(),
            F = (0, h.default)(),
            $ = (0, T.useTransactionStore)(),
            B = (0, y.useInvalidatePositions)(),
            {
                generateApiCreds: q
            } = (0, w.useClobCredentialContext)(),
            {
                triggerAllApprovals: V
            } = (0, l.useAllowanceContext)(),
            {
                deploySafe: H
            } = (0, o.useSafe)(),
            {
                activeMarket: U
            } = (0, S.useEventActiveMarketContext)(["activeMarket"]),
            {
                setOpen: W
            } = (0, O.useMobileMarketContext)(),
            {
                setDisableErrorComponent: G
            } = (0, C.useTradeContext)(["setDisableErrorComponent"]),
            Z = a.default.useRef(null),
            K = a.default.useRef(null),
            Y = a.default.useRef(null),
            [Q, X] = a.default.useState("rest"),
            J = a.default.useMemo(() => U.conditionId, [U.conditionId]),
            ee = (0, p.default)(J),
            et = a.default.useMemo(() => (L ? ? []).map(e => {
                let t;
                return t = ee.map(e => (0, N.parseUSDCUnits)(e.toFixed(6))), { ...e,
                    netQuantity: t ? .[Number(e ? .outcomeIndex)] ? .toString() ? ? e.netQuantity
                }
            }), [L, ee]),
            er = a.default.useMemo(() => et.reduce((e, t) => e + (0, I.getCurrentValueOfPosition)(t), 0 n), [et]),
            ea = (() => {
                let e, a, i, c, d = (0, t.c)(18);
                d[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], d[0] = e) : e = d[0];
                let {
                    authenticated: u
                } = (0, k.useAccountContext)(e), {
                    accountWalletPreferences: p
                } = (0, m.default)(), {
                    chainId: h,
                    address: x,
                    proxyAddress: g,
                    authenticationType: v,
                    walletMode: y
                } = (0, s.useAccount)(), {
                    clob: b
                } = (0, w.useClobCredentialContext)(), {
                    areAllAllowancesApproved: j,
                    isUpdatingAllowances: C
                } = (0, l.useAllowanceContext)(), {
                    isSafeDeployed: _
                } = (0, o.useSafe)();
                d[1] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                    chainId: P.MATIC_CONFIG.chainId
                }, d[1] = a) : a = d[1];
                let {
                    data: T
                } = (0, n.useWalletClient)(a);
                d[2] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], d[2] = i) : i = d[2];
                let {
                    activeMarket: M
                } = (0, S.useEventActiveMarketContext)(i), N = (0, f.usePermissions)(), I = (0, r.useLatest)(h), E = (0, r.useLatest)(_), A = (0, r.useLatest)(v), O = (0, r.useLatest)(y), D = (0, r.useLatest)(b), L = (0, r.useLatest)(j), z = (0, r.useLatest)(C), R = (0, r.useLatest)(M), F = (0, r.useLatest)(p), $ = (0, r.useLatest)(x), B = (0, r.useLatest)(g), q = (0, r.useLatest)(T), V = (0, r.useLatest)(u), H = (0, r.useLatest)(N);
                return d[3] !== F || d[4] !== $ || d[5] !== L || d[6] !== V || d[7] !== A || d[8] !== I || d[9] !== D || d[10] !== E || d[11] !== z || d[12] !== R || d[13] !== H || d[14] !== B || d[15] !== q || d[16] !== O ? (c = {
                    chainIdRef: I,
                    isSafeDeployedRef: E,
                    authenticationTypeRef: A,
                    walletModeRef: O,
                    clobRef: D,
                    areAllAllowancesApprovedRef: L,
                    isUpdatingAllowancesRef: z,
                    marketRef: R,
                    accountWalletPreferencesRef: F,
                    addressRef: $,
                    proxyAddressRef: B,
                    signerRef: q,
                    authenticatedRef: V,
                    permissionsRef: H
                }, d[3] = F, d[4] = $, d[5] = L, d[6] = V, d[7] = A, d[8] = I, d[9] = D, d[10] = E, d[11] = z, d[12] = R, d[13] = H, d[14] = B, d[15] = q, d[16] = O, d[17] = c) : c = d[17], c
            })(),
            ei = (0, r.useLatest)(et),
            en = a.default.useCallback(async (...t) => {
                let r = ei.current,
                    {
                        chainIdRef: {
                            current: a
                        },
                        isSafeDeployedRef: {
                            current: i
                        },
                        authenticationTypeRef: {
                            current: n
                        },
                        walletModeRef: {
                            current: s
                        },
                        clobRef: {
                            current: o
                        },
                        areAllAllowancesApprovedRef: {
                            current: l
                        },
                        isUpdatingAllowancesRef: {
                            current: d
                        },
                        marketRef: {
                            current: m
                        },
                        accountWalletPreferencesRef: {
                            current: p
                        },
                        addressRef: {
                            current: h
                        },
                        proxyAddressRef: {
                            current: f
                        },
                        signerRef: {
                            current: y
                        },
                        authenticatedRef: {
                            current: b
                        },
                        permissionsRef: {
                            current: k
                        }
                    } = ea,
                    [w, S, j, C, _] = t;
                if (b && k ? .canRedeem) try {
                    P.MATIC_CONFIG.chainId !== a && (X("switching-networks"), await z({
                        chainId: P.MATIC_CONFIG.chainId
                    })), !i && (0, x.requiresWalletDeployment)(s) && (X("deploy-safe"), await H()), "magic" !== n && (0, c.mustGenerateApiKeys)(o, s) && (X("generate-api-key"), await q(h, f, y)), "magic" !== n && (0, c.mustApproveAllowances)({
                        walletMode: s,
                        areAllAllowancesApproved: l,
                        isUpdatingAllowances: d
                    }) && (X("sign-approvals"), await V(!1, "MobileDrawer")), G(!0);
                    let t = [0 n, 0 n];
                    r ? .length && r.forEach(e => {
                        t[parseInt(e.outcomeIndex, 10)] = BigInt(e.netQuantity)
                    });
                    let b = (0, A.getRedeemPositionsTransaction)({
                            chainId: P.MATIC_CONFIG.chainId,
                            chainConfig: P.chainConfig,
                            conditionId: m.conditionId,
                            negRisk: !!m ? .negRisk,
                            outcomeCount: m.outcomes.length,
                            amounts: t
                        }),
                        k = (0, v.computeRedeemImpact)(er);
                    if ("magic" === n && f) {
                        let t = (0, A.formatSyntheticRedeemTransaction)({
                            conditionId: m.conditionId,
                            amount: er,
                            proxyAddress: f
                        });
                        Y.current = t, await F(t, m), B(f), D.success(new u.ToastBuilder().position({
                            side: "top"
                        }).title(e("portfolio.modals.redeem.claimProceeds")).description(m.question)), k.shareValue.some(e => e > .01) && j ? .(w, S), W ? .(!1), _ ? .(), G(!1), X("rest"), (0, E.executeOptimisticCTFTransaction)({
                            syntheticTxn: t,
                            syntheticTxnRef: Y,
                            transaction: b,
                            market: m,
                            txnType: g.CTFTxnType.Redeem,
                            outcome: "NA",
                            quantity: er,
                            usdc: er,
                            impact: k,
                            errorTag: "Redeem Shares (background)",
                            proxyAddress: f,
                            transactionStore: $,
                            enqueueTransaction: R,
                            gasPreference: p ? .advancedMode ? p.gasPreference : null,
                            customGasPrice: p ? .advancedMode ? p.customGasPrice : null,
                            onFailure: () => D.error(new u.ToastBuilder().position({
                                side: "top"
                            }).title(e("portfolio.messages.failedToRedeem")).description(e("comments.pleaseTryAgain")))
                        });
                        return
                    }
                    X("submitting"), await R(b, P.Network.Matic, g.CTFTxnType.Redeem, "NA", er, er, m, k, p ? .advancedMode ? p.gasPreference : null, p ? .advancedMode ? p.customGasPrice : null, null, null, null, !1) && (X("success"), k.shareValue.some(e => e > .01) && j ? .(w, S), Z.current = setTimeout(() => {
                        W ? .(!1), _ ? .()
                    }, 2e3), K.current = setTimeout(() => {
                        X("rest"), G(!1)
                    }, 3e3))
                } catch (e) {
                    X("rest"), G(!1), (0, M.handleError)(e, "[BuySellWidget > BuySellButton > handleClick]", f)
                }
            }, [R, F, $, B, er, z, H, q, V, W, X, ea, ei, G, e, D]);
        return a.default.useEffect(() => () => {
            Z.current && clearTimeout(Z.current), K.current && clearTimeout(K.current)
        }, []), a.default.useMemo(() => ({
            redeem: en,
            orderCreationState: Q,
            redemptionValue: parseFloat((0, N.formatUSDCUnits)(er))
        }), [en, Q, er])
    }
}, 892974, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(86831),
        i = e.i(474280),
        n = e.i(934993);

    function s(e) {
        e.stopPropagation()
    }

    function o(e) {
        return e.stopPropagation()
    }
    e.s(["Toast", 0, function(e) {
        let l, c, d, u, m, p, h, f, x, g = (0, r.c)(19);
        g[0] !== e ? ({
            label: c,
            withClose: u,
            className: l,
            ...d
        } = e, g[0] = e, g[1] = l, g[2] = c, g[3] = d, g[4] = u) : (l = g[1], c = g[2], d = g[3], u = g[4]);
        let v = void 0 === u || u;
        g[5] !== l ? (m = (0, a.cn)("flex h-10 w-full items-center justify-between rounded-full border border-neutral-200 bg-neutral-50 px-2", l), g[5] = l, g[6] = m) : m = g[6];
        let y = v ? "ml-6" : "ml-0";
        return g[7] !== y ? (p = (0, a.cn)("flex-1 text-center text-base leading-[21px] text-text-primary", y), g[7] = y, g[8] = p) : p = g[8], g[9] !== c || g[10] !== p ? (h = (0, t.jsx)("p", {
            "data-prevent-drawer-dismiss": !0,
            className: p,
            children: c
        }), g[9] = c, g[10] = p, g[11] = h) : h = g[11], g[12] !== v ? (f = v && (0, t.jsx)(n.Toast.ToastClose, {
            "data-prevent-drawer-dismiss": !0,
            "aria-label": "Close",
            className: "flex size-6 cursor-pointer items-center justify-center justify-self-end rounded-full bg-neutral-200 opacity-100 transition-all duration-80 hover:bg-neutral-500 focus:bg-neutral-500 active:bg-neutral-500",
            onClick: s,
            children: (0, t.jsx)(i.IconXmarkFill18, {
                className: "size-5"
            })
        }), g[12] = v, g[13] = f) : f = g[13], g[14] !== d || g[15] !== m || g[16] !== h || g[17] !== f ? (x = (0, t.jsxs)("div", {
            className: m,
            onClick: o,
            ...d,
            children: [h, f]
        }), g[14] = d, g[15] = m, g[16] = h, g[17] = f, g[18] = x) : x = g[18], x
    }])
}, 767592, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(740594),
        a = e.i(723823);
    e.i(416340);
    var i = e.i(635868),
        n = e.i(551068),
        s = e.i(458164),
        o = e.i(880809);
    e.s(["useSlippage", 0, () => {
        let e, l, c, d = (0, t.c)(5);
        d[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "shares", "slippageTolerance", "orderType", "selectedOutcomeIdx"], d[0] = e) : e = d[0];
        let {
            side: u,
            shares: m,
            slippageTolerance: p,
            orderType: h,
            selectedOutcomeIdx: f
        } = (0, o.useTradeContext)(e);
        d[1] === Symbol.for("react.memo_cache_sentinel") ? (l = ["market"], d[1] = l) : l = d[1];
        let {
            market: x
        } = (0, i.useBookContext)(l), g = (0, a.useBestPrice)(x, f, "ask"), v = (0, a.useBestPrice)(x, f, "bid"), {
            calculateWorstPrice: y
        } = (0, n.useCalculateWorstPrice)(), b = u === r.Side.BUY ? g : v;
        e: {
            if (h === s.OrderType.Market) {
                let e, t = y(m, p, u, x.orderPriceMinTickSize);
                if (0 === t) {
                    c = 0;
                    break e
                }
                d[2] !== b.value || d[3] !== t ? (e = Math.abs(t - b.value), d[2] = b.value, d[3] = t, d[4] = e) : e = d[4], c = e;
                break e
            }
            c = 0
        }
        return c
    }])
}, 909576, e => {
    "use strict";
    e.s(["CashOutTxContextProvider", () => P, "useCashOutTxContext", () => E], 909576);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(780641),
        n = e.i(429411),
        s = e.i(399336),
        o = e.i(6204),
        l = e.i(230684),
        c = e.i(328113),
        d = e.i(73836),
        u = e.i(423708),
        m = e.i(88240),
        p = e.i(246290),
        h = e.i(628684),
        f = e.i(112014),
        x = e.i(97594),
        g = e.i(101008),
        v = e.i(249792),
        y = e.i(606572),
        b = e.i(631503),
        k = e.i(922445),
        w = e.i(69036),
        S = e.i(784521),
        j = e.i(400819),
        C = e.i(880809),
        _ = e.i(660006),
        T = e.i(631222),
        M = e.i(892974),
        N = e.i(767592);
    let I = a.default.createContext({}),
        P = e => {
            let P, E, A, O, D, L, z, R, F, $, B = (0, r.c)(28),
                {
                    children: q,
                    orderTrackingPage: V
                } = e;
            B[0] === Symbol.for("react.memo_cache_sentinel") ? (P = ["isSportsPage"], B[0] = P) : P = B[0];
            let {
                isSportsPage: H
            } = (0, o.useSportsContext)(P), [U, W] = a.default.useState(!1), [G, Z] = a.default.useState("all");
            B[1] === Symbol.for("react.memo_cache_sentinel") ? (E = [], B[1] = E) : E = B[1];
            let [K, Y] = a.default.useState(E);
            B[2] === Symbol.for("react.memo_cache_sentinel") ? (A = ["activeMarket"], B[2] = A) : A = B[2];
            let {
                activeMarket: Q
            } = (0, s.useEventActiveMarketContext)(A), X = (0, i.usePermissions)(), {
                redeem: J,
                orderCreationState: ee,
                redemptionValue: et
            } = (0, l.useRedeem)();
            B[3] !== V ? (O = {
                page: V,
                source: "cash-out-modal"
            }, B[3] = V, B[4] = O) : O = B[4];
            let {
                sell: er,
                orderCreationState: ea,
                sellValue: ei
            } = (e => {
                let s, o = a.default.useRef(null),
                    l = a.default.useRef(null),
                    I = (0, v.useToast)(),
                    {
                        setShares: P,
                        setAmountUpdateLocation: E,
                        setHasClicked: A,
                        setHasTouchedShares: O,
                        setHasTouchedPrice: D,
                        side: L,
                        selectedOutcomeIdx: z,
                        shouldShowSlippageWarning: R,
                        setShouldShowSlippageWarning: F,
                        setDisableErrorComponent: $
                    } = (0, C.useTradeContext)(["setShares", "setAmountUpdateLocation", "setHasClicked", "setHasTouchedShares", "setHasTouchedPrice", "side", "selectedOutcomeIdx", "shouldShowSlippageWarning", "setShouldShowSlippageWarning", "setDisableErrorComponent"]),
                    {
                        switchChainAsync: B
                    } = (0, d.useSwitchChain)(),
                    {
                        generateApiCreds: q
                    } = (0, j.useClobCredentialContext)(),
                    {
                        triggerAllApprovals: V
                    } = (0, f.useAllowanceContext)(),
                    {
                        deploySafe: H
                    } = (0, h.useSafe)(),
                    U = (0, m.useCreateOrder)(),
                    W = (0, n.useCallbackRef)(U),
                    [G, Z] = a.default.useState("rest"),
                    K = a.default.useCallback(() => {
                        P(""), E("click"), A(!1), D(!1), O(!1)
                    }, [P, D, O, A, E]),
                    Y = (() => {
                        let e, t, a, n = (0, r.c)(17);
                        n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated", "authenticationType", "walletMode"], n[0] = e) : e = n[0];
                        let {
                            authenticated: s,
                            authenticationType: o,
                            walletMode: l
                        } = (0, S.useAccountContext)(e), {
                            isOrderInvalid: d,
                            orderError: m
                        } = (0, x.useOrderValidation)(), {
                            chainId: g,
                            proxyAddress: v,
                            address: y
                        } = (0, p.useAccount)(), b = (0, i.usePermissions)();
                        n[1] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                            chainId: T.MATIC_CONFIG.chainId
                        }, n[1] = t) : t = n[1];
                        let {
                            data: k
                        } = (0, u.useWalletClient)(t), {
                            clob: w
                        } = (0, j.useClobCredentialContext)(), {
                            areAllAllowancesApproved: C,
                            isUpdatingAllowances: _
                        } = (0, f.useAllowanceContext)(), {
                            isSafeDeployed: M
                        } = (0, h.useSafe)(), N = (0, c.useLatest)(d), I = (0, c.useLatest)(m), P = (0, c.useLatest)(g), E = (0, c.useLatest)(M), A = (0, c.useLatest)(o), O = (0, c.useLatest)(l), D = (0, c.useLatest)(w), L = (0, c.useLatest)(C), z = (0, c.useLatest)(_), R = (0, c.useLatest)(y), F = (0, c.useLatest)(v), $ = (0, c.useLatest)(k), B = (0, c.useLatest)(s), q = (0, c.useLatest)(b);
                        return n[2] !== R || n[3] !== L || n[4] !== B || n[5] !== A || n[6] !== P || n[7] !== D || n[8] !== N || n[9] !== E || n[10] !== z || n[11] !== I || n[12] !== q || n[13] !== F || n[14] !== $ || n[15] !== O ? (a = {
                            isOrderInvalidRef: N,
                            orderErrorRef: I,
                            chainIdRef: P,
                            isSafeDeployedRef: E,
                            authenticationTypeRef: A,
                            walletModeRef: O,
                            clobRef: D,
                            areAllAllowancesApprovedRef: L,
                            isUpdatingAllowancesRef: z,
                            addressRef: R,
                            proxyAddressRef: F,
                            signerRef: $,
                            authenticatedRef: B,
                            permissionsRef: q
                        }, n[2] = R, n[3] = L, n[4] = B, n[5] = A, n[6] = P, n[7] = D, n[8] = N, n[9] = E, n[10] = z, n[11] = I, n[12] = q, n[13] = F, n[14] = $, n[15] = O, n[16] = a) : a = n[16], a
                    })(),
                    Q = (s = (0, N.useSlippage)(), (0, c.useLatest)(s)),
                    X = a.default.useRef(!1);
                a.default.useEffect(() => {
                    R || (X.current = !1)
                }, [R]);
                let J = a.default.useCallback(async (...r) => {
                    let {
                        isOrderInvalidRef: {
                            current: a
                        },
                        orderErrorRef: {
                            current: i
                        },
                        chainIdRef: {
                            current: n
                        },
                        isSafeDeployedRef: {
                            current: s
                        },
                        authenticationTypeRef: {
                            current: c
                        },
                        walletModeRef: {
                            current: d
                        },
                        clobRef: {
                            current: u
                        },
                        areAllAllowancesApprovedRef: {
                            current: p
                        },
                        isUpdatingAllowancesRef: {
                            current: h
                        },
                        addressRef: {
                            current: f
                        },
                        proxyAddressRef: {
                            current: x
                        },
                        signerRef: {
                            current: v
                        },
                        authenticatedRef: {
                            current: S
                        },
                        permissionsRef: {
                            current: j
                        }
                    } = Y, [C, N, E, A, O] = r;
                    if (S && j ? .canSell && (!a || !i)) {
                        if (!X.current && (Q.current ? ? 0) >= T.PRICE_CHANGE_WARNING_CLOB) {
                            F(!0), X.current = !0;
                            return
                        }
                        X.current || (X.current = !1, F(!1));
                        try {
                            T.MATIC_CONFIG.chainId !== n && (Z("switching-networks"), await B({
                                chainId: T.MATIC_CONFIG.chainId
                            })), !s && (0, b.requiresWalletDeployment)(d) && (Z("deploy-safe"), await H()), "magic" !== c && (0, g.mustGenerateApiKeys)(u, d) && (Z("generate-api-key"), await q(f, x, v)), "magic" !== c && (0, g.mustApproveAllowances)({
                                walletMode: d,
                                areAllAllowancesApproved: p,
                                isUpdatingAllowances: h
                            }) && (Z("sign-approvals"), await V(!1, "MobileDrawer")), $(!0), (0, b.requiresManualTradingSetup)(d) && Z("submitting");
                            let r = W({
                                options: {
                                    successToast: !1,
                                    errorToast: !(0, k.isNarrowViewport)()
                                },
                                values: {
                                    side: L,
                                    selectedOutcomeIdx: z
                                },
                                tracking: e
                            });
                            "magic" === c && (Z("success"), E ? .(C, N), K(), l.current && clearTimeout(l.current), o.current = setTimeout(() => {
                                O ? .()
                            }, 2e3), l.current = setTimeout(() => {
                                Z("rest"), $(!1)
                            }, 3e3));
                            let a = await r;
                            if (a === m.TransactionResponseState.GeneralError || a === m.TransactionResponseState.SignatureError) {
                                (0, k.isNarrowViewport)() && I.custom(new y.ToastBuilder().custom((0, t.jsx)(M.Toast, {
                                    label: a === m.TransactionResponseState.SignatureError ? "Request cancelled" : "An unexpected error occurred"
                                })).position({
                                    side: "top"
                                }).zIndex(w.zIndices.drawer + 11)), Z("rest"), $(!1);
                                return
                            }
                            "magic" !== c && (0, b.requiresManualTradingSetup)(d) && (Z("success"), K(), E ? .(C, N), o.current && clearTimeout(o.current), l.current && clearTimeout(l.current), o.current = setTimeout(() => {
                                O ? .()
                            }, 2e3), l.current = setTimeout(() => {
                                P(""), Z("rest"), $(!1)
                            }, 3e3))
                        } catch (r) {
                            Z("rest"), $(!1), (0, k.isNarrowViewport)() && I.custom(new y.ToastBuilder().custom((0, t.jsx)(M.Toast, {
                                label: "An unexpected error occurred"
                            })).position({
                                side: "top"
                            }).zIndex(w.zIndices.drawer + 11)), (0, _.handleError)(r, "sports_sell_error", x ? ? "", "high", {
                                orderCreationState: G,
                                orderTrackingParams: e,
                                authenticationType: c,
                                chainId: n,
                                isSafeDeployed: s,
                                areAllAllowancesApproved: p,
                                isUpdatingAllowances: h,
                                permissions: j,
                                slippage: Q.current,
                                shouldShowSlippageWarning: R,
                                isMobileQuery: (0, k.isNarrowViewport)(),
                                hasOrderValidation: a,
                                orderErrorMessage: i ? .message
                            })
                        }
                    }
                }, [W, B, H, q, V, P, K, I, Y, L, z, F, R, Q, e, $, G]);
                return a.default.useEffect(() => () => {
                    o.current && clearTimeout(o.current), l.current && clearTimeout(l.current)
                }, []), a.default.useMemo(() => ({
                    sell: J,
                    orderCreationState: G,
                    sellValue: 0
                }), [J, G])
            })(O), en = (0, n.useCallbackRef)(J), es = (0, n.useCallbackRef)(er);
            B[5] !== Q.closed || B[6] !== en || B[7] !== es ? (D = async (...e) => Q.closed ? en(...e) : es(...e), B[5] = Q.closed, B[6] = en, B[7] = es, B[8] = D) : D = B[8];
            let eo = D,
                el = Q.closed ? et : ei,
                ec = Q.closed ? ee : ea;
            B[9] === Symbol.for("react.memo_cache_sentinel") ? (L = e => {
                let {
                    open: t,
                    mode: r,
                    conditionIds: a
                } = e;
                Z(r), Y(void 0 === a ? [] : a), W(t)
            }, B[9] = L) : L = B[9];
            let ed = L;
            B[10] !== U || B[11] !== H ? (z = () => {
                U || (Z(H ? "all" : "single"), Y([]))
            }, B[10] = U, B[11] = H, B[12] = z) : z = B[12], B[13] !== U ? (R = [U], B[13] = U, B[14] = R) : R = B[14], a.default.useEffect(z, R);
            let eu = Q.closed ? X.canRedeem : X.canSell,
                em = H ? G : "single";
            B[15] !== eo || B[16] !== U || B[17] !== el || B[18] !== ec || B[19] !== X.canRedeem || B[20] !== X.canSell || B[21] !== K || B[22] !== em || B[23] !== eu ? (F = {
                cashOut: eo,
                orderCreationState: ec,
                canCashOut: eu,
                canRedeem: X.canRedeem,
                canSell: X.canSell,
                cashOutValue: el,
                cashOutDialogOpen: U,
                setCashOutDialogOpen: W,
                cashOutMode: em,
                setCashOutMode: Z,
                redemptionConditionIds: K,
                setRedemptionConditionIds: Y,
                setSportsCashOutState: ed
            }, B[15] = eo, B[16] = U, B[17] = el, B[18] = ec, B[19] = X.canRedeem, B[20] = X.canSell, B[21] = K, B[22] = em, B[23] = eu, B[24] = F) : F = B[24];
            let ep = F;
            return B[25] !== q || B[26] !== ep ? ($ = (0, t.jsx)(I.Provider, {
                value: ep,
                children: q
            }), B[25] = q, B[26] = ep, B[27] = $) : $ = B[27], $
        },
        E = () => a.default.useContext(I)
}, 313181, e => {
    "use strict";
    e.s(["useTradeState", () => u]);
    var t = e.i(740594),
        r = e.i(416340),
        a = e.i(458164),
        i = e.i(134709),
        n = e.i(399336),
        s = e.i(880809),
        o = e.i(313582),
        l = e.i(196593),
        c = e.i(156591),
        d = e.i(118818);
    let u = () => {
        let e = (0, i.default)(),
            {
                setActiveMarket: u,
                setActiveMarketFromSlug: m
            } = (0, n.useEventActiveMarketContext)(["setActiveMarket", "setActiveMarketFromSlug"]),
            {
                setSelectedOutcomeIdx: p,
                setOrderType: h,
                setPrice: f,
                priceUpdateLocation: x,
                setPriceUpdateLocation: g,
                setAmountUpdateLocation: v,
                setSide: y,
                setShares: b,
                marketForMobile: k,
                setMarketForMobile: w
            } = (0, s.useTradeContext)(["setSelectedOutcomeIdx", "setOrderType", "setPrice", "priceUpdateLocation", "setPriceUpdateLocation", "setAmountUpdateLocation", "setSide", "setShares", "marketForMobile", "setMarketForMobile"]),
            {
                market: S,
                setView: j,
                setLimitOrderPage: C,
                setOpen: _,
                open: T,
                mode: M,
                view: N
            } = (0, d.useMobileMarketContext)(),
            [I, P] = r.default.useState(!1),
            [E, A] = r.default.useState("trade"),
            [O, D] = r.default.useState("all"),
            [L, z] = r.default.useState([]),
            R = r.default.useMemo(() => (0, c.getPrecisionFromTickSize)(S.orderPriceMinTickSize), [S.orderPriceMinTickSize]),
            [, F] = r.default.useTransition(),
            $ = r.default.useCallback(({
                type: e,
                side: t,
                outcomeIdx: r,
                open: a = !0,
                view: i,
                market: n,
                marketSlug: s,
                orderType: o,
                price: c,
                shares: d,
                updatePriceLocation: x = !0,
                updateAmountLocation: k = !0,
                sportsRedemptionType: w,
                sportsRedemptionConditionIds: S
            }) => {
                F(() => {
                    "sports-redeem" === e && w && (D(w), "injected" === w && S ? .length && z(S)), i && j(i), a && _(!0), n && u(n), s && m(s), e && A(e), P(!1), o && h(o), void 0 !== r && p(r), t && y(t), c && (f((0, l.showPaddedCentsOnly)(c, R)), x && g("click")), d && (b(d), k && v("click"))
                })
            }, [A, _, p, f, R, y, j, u, h, m, b, g, v, D, z]),
            B = r.default.useRef(!0);
        return r.default.useEffect(() => {
            if ("click" === x && e && ("single" === M || "group" === M && "smp" === N) && "redeem" !== E && !T) {
                let e = B.current;
                B.current = !1, $({
                    type: "trade",
                    open: !0,
                    orderType: e ? void 0 : a.OrderType.Limit
                })
            }
        }, [x]), r.default.useEffect(() => {
            if (e) {
                let e = localStorage.getItem(o.LS_MARKET_INITIAL_SMP_DRAWER);
                if (e) try {
                    $({
                        marketSlug: e,
                        view: "smp"
                    })
                } finally {
                    localStorage.removeItem(o.LS_MARKET_INITIAL_SMP_DRAWER)
                }
            }
        }, [e]), r.default.useEffect(() => {
            e && !T && k && k === S.conditionId && ($({
                open: !0
            }), w(null))
        }, [k]), r.default.useEffect(() => {
            let r = null;
            return !T && e && (C("resting"), g("type"), r = setTimeout(() => {
                $({
                    type: "trade",
                    open: !1,
                    side: t.Side.BUY
                }), b("")
            }, 200)), () => {
                r && clearTimeout(r)
            }
        }, [T]), r.default.useEffect(() => {
            "sports-redeem" !== E && (D("all"), z([]))
        }, [E]), r.default.useMemo(() => ({
            hasClicked: I,
            setHasClicked: P,
            setTradeState: $,
            setTradeType: A,
            tradeType: E,
            sportsRedemptionType: O,
            sportsRedemptionConditionIds: L
        }), [I, P, $, A, E, O, L])
    }
}, 422868, 214901, e => {
    "use strict";
    e.s(["MobileMarketPositionContextProvider", () => I, "useMobileMarketPositionContext", () => P], 422868);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(399336),
        n = e.i(891685),
        s = e.i(6204),
        o = e.i(196593),
        l = e.i(210308),
        c = e.i(880809),
        d = e.i(458164),
        u = e.i(273587),
        m = e.i(189890),
        p = e.i(845923),
        h = e.i(100825),
        f = e.i(269101);

    function x(e) {
        return e.markets
    }

    function g(e, t) {
        let r;
        return e[t.conditionId.toLowerCase()] = {
            positions: [{ ...r = {
                    market: {
                        id: t.conditionId.toLowerCase(),
                        outcomeTokenPrices: t.outcomePrices,
                        conditions: [{
                            payouts: null
                        }],
                        negRisk: t.negRisk,
                        closed: t.closed
                    },
                    quantityBought: "",
                    netQuantity: "0",
                    valueBought: "0",
                    totalQuantityBought: "0",
                    totalValueBought: "0",
                    realizedProfit: "0",
                    netValue: "0",
                    hasBalance: !1,
                    netQuantityNum: 0
                },
                outcomeIndex: "0"
            }, { ...r,
                outcomeIndex: "1"
            }],
            state: {
                hasSomeShares: !1,
                hasAllShares: !1
            }
        }, e
    }

    function v(e) {
        return e.hasBalance
    }

    function y(e) {
        return e.hasBalance
    }
    let b = a.default.createContext({}),
        k = () => a.default.useContext(b);

    function w(e) {
        return parseFloat(e.qty) > .01
    }

    function S(e, t) {
        return Number(e ? .outcomeIndex) - Number(t ? .outcomeIndex)
    }

    function j(e, t) {
        return Number(e ? .outcomeIndex) - Number(t ? .outcomeIndex)
    }

    function C(e) {
        return e.sell.isClosed
    }

    function _(e, t) {
        let r = t.value.currentMarketValue;
        return Number.isNaN(r) ? e : e + r
    }

    function T(e) {
        return e.netQuantityNum
    }
    e.s(["EventPositionContextProvider", 0, e => {
        let a, i, s = (0, r.c)(5),
            {
                children: l
            } = e,
            {
                positionMap: c
            } = (() => {
                let e, t, a, i, s, l, c = (0, r.c)(14),
                    d = (0, h.useSportsEventsSelector)();
                c[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], c[0] = e) : e = c[0];
                let {
                    event: u
                } = (0, n.useEventContext)(e);
                c[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["positions"], c[1] = t) : t = c[1];
                let {
                    positions: m
                } = (0, f.useEventPositionsContext)(t);
                c[2] !== d || c[3] !== u ? (a = d ? ? [u], c[2] = d, c[3] = u, c[4] = a) : a = c[4];
                let p = a;
                c[5] !== p ? (i = p.flatMap(x).reduce(g, {}), c[5] = p, c[6] = i) : i = c[6];
                let b = i;
                if (c[7] !== b || c[8] !== m) {
                    let e;
                    c[10] !== b ? (e = (e, t) => {
                        let r = t.market.id.toLowerCase(),
                            a = e[r] ? ? b[r];
                        if (a) {
                            let i = (({
                                position: e,
                                positions: t
                            }) => {
                                let r = e.trackedPositionMetadata ? e.trackedPositionMetadata.netQuantity.optimistic : parseFloat((0, o.formatUSDCUnits)(BigInt(e.netQuantity))),
                                    a = { ...e,
                                        netQuantityNum: r,
                                        hasBalance: r > .01
                                    };
                                return 0 === parseInt(a.outcomeIndex, 10) ? [a, t[1]] : [t[0], a]
                            })({
                                position: t,
                                positions: a.positions
                            });
                            e[r] = {
                                positions: i,
                                state: {
                                    hasSomeShares: i.some(v),
                                    hasAllShares: i.every(y)
                                }
                            }
                        }
                        return e
                    }, c[10] = b, c[11] = e) : e = c[11], s = (m ? ? []).reduce(e, { ...b
                    }), c[7] = b, c[8] = m, c[9] = s
                } else s = c[9];
                return c[12] !== s ? (l = {
                    positionMap: s
                }, c[12] = s, c[13] = l) : l = c[13], l
            })();
        s[0] !== c ? (a = {
            positionMap: c
        }, s[0] = c, s[1] = a) : a = s[1];
        let d = a;
        return s[2] !== l || s[3] !== d ? (i = (0, t.jsx)(b.Provider, {
            value: d,
            children: l
        }), s[2] = l, s[3] = d, s[4] = i) : i = s[4], i
    }, "useEventPositionContext", 0, k], 214901);
    var M = e.i(118818);
    let N = a.default.createContext({
            numericalShareBalances: [0, 0],
            formattedSharesForOutcome: "",
            hasSharesForOutcome: !1,
            hasSomeShares: !1,
            hasAllShares: !1
        }),
        I = e => {
            let a, h, f, x, g, v, y = (0, r.c)(12),
                {
                    children: b
                } = e;
            y[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], y[0] = a) : a = y[0];
            let {
                event: I
            } = (0, n.useEventContext)(a);
            y[1] === Symbol.for("react.memo_cache_sentinel") ? (h = ["isSportsPage"], y[1] = h) : h = y[1];
            let {
                isSportsPage: P
            } = (0, s.useSportsContext)(h), {
                market: E,
                open: A
            } = (0, M.useMobileMarketContext)();
            y[2] === Symbol.for("react.memo_cache_sentinel") ? (f = ["activeMarket"], y[2] = f) : f = y[2];
            let {
                activeMarket: O
            } = (0, i.useEventActiveMarketContext)(f);
            if (y[3] !== I.markets) {
                for (let e of I.markets)
                    if ((e.sportsMarketType ? ? "moneyline") === "moneyline" && e.teams && 2 === e.teams.length) {
                        x = e;
                        break
                    }
                y[3] = I.markets, y[4] = x
            } else x = y[4];
            let D = x ? .teams,
                L = A && P ? O : E;
            y[5] !== P || y[6] !== L || y[7] !== D ? (g = {
                market: L,
                isSports: P,
                teams: D
            }, y[5] = P, y[6] = L, y[7] = D, y[8] = g) : g = y[8];
            let z = (e => {
                let t, a, i, n = (0, r.c)(10);
                n[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["selectedOutcomeIdx"], n[0] = t) : t = n[0];
                let {
                    selectedOutcomeIdx: s
                } = (0, c.useTradeContext)(t), {
                    positions: h,
                    hasSomeShares: f,
                    hasAllShares: x,
                    portfolioPositions: g,
                    chainPositions: v,
                    subPositions: y
                } = (e => {
                    let t, a, i, n, s, l, h = (0, r.c)(44),
                        {
                            market: f,
                            isSports: x,
                            teams: g
                        } = e,
                        {
                            positionMap: v
                        } = k();
                    h[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["orderType"], h[0] = t) : t = h[0];
                    let {
                        orderType: y
                    } = (0, c.useTradeContext)(t), {
                        ammMarketPositionsFromChain: b
                    } = (0, m.default)(f), {
                        zeroLastPrice: C,
                        oneLastPrice: _
                    } = (0, u.useLastExecutedTrade)();
                    e: {
                        let e, t = f.conditionId.toLowerCase();
                        if (v[t]) {
                            let e, r = v[t],
                                i = v[t],
                                n = v[t];
                            h[1] !== r.positions || h[2] !== i.state.hasAllShares || h[3] !== n.state.hasSomeShares ? (e = {
                                positions: r.positions,
                                hasAllShares: i.state.hasAllShares,
                                hasSomeShares: n.state.hasSomeShares
                            }, h[1] = r.positions, h[2] = i.state.hasAllShares, h[3] = n.state.hasSomeShares, h[4] = e) : e = h[4], a = e;
                            break e
                        }
                        h[5] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                            positions: [],
                            hasAllShares: !1,
                            hasSomeShares: !1
                        }, h[5] = e) : e = h[5],
                        a = e
                    }
                    let {
                        positions: T,
                        hasSomeShares: M,
                        hasAllShares: N
                    } = a;
                    if (h[6] !== f || h[7] !== _ ? .price || h[8] !== y || h[9] !== T || h[10] !== C ? .price) {
                        let e, t;
                        h[12] !== f.outcomePrices || h[13] !== C ? .price ? (e = C ? .price ? .toString() ? ? (2 === f.outcomePrices.length ? f.outcomePrices[0] : "0"), h[12] = f.outcomePrices, h[13] = C ? .price, h[14] = e) : e = h[14], h[15] !== f.outcomePrices || h[16] !== _ ? .price ? (t = _ ? .price ? .toString() ? ? (2 === f.outcomePrices.length ? f.outcomePrices[1] : "0"), h[15] = f.outcomePrices, h[16] = _ ? .price, h[17] = t) : t = h[17], i = (0, p.fromPositionToPortfolioInjectedPrices)(f, T ? ? [], y !== d.OrderType.AMM, [parseFloat(e), parseFloat(t)]).filter(w), h[6] = f, h[7] = _ ? .price, h[8] = y, h[9] = T, h[10] = C ? .price, h[11] = i
                    } else i = h[11];
                    let I = i;
                    t: {
                        let e;
                        if (!Array.isArray(I)) {
                            let e;
                            h[18] === Symbol.for("react.memo_cache_sentinel") ? (e = [], h[18] = e) : e = h[18], n = e;
                            break t
                        }
                        if (h[19] !== x || h[20] !== f.image || h[21] !== I || h[22] !== g) {
                            let t;
                            h[24] !== x || h[25] !== f.image || h[26] !== g ? (t = e => {
                                let t = parseFloat(e.qty),
                                    r = 100 * parseFloat(e.priceAvg);
                                return {
                                    isPending: e.isPending,
                                    qty: (0, o.formatNum)(t, {
                                        decimals: 2 * (t < 10)
                                    }),
                                    avgPrice: `${(0,o.formatNum)(r,{decimals:1,optionalDecimals:!0,commas:!1})}\xa2`,
                                    value: {
                                        currentMarketValue: parseFloat(e.currentMarketValue) || 0,
                                        cost: e.valueInit
                                    },
                                    totalReturn: {
                                        totalProfit: (0, o.toUSCurrency)(e.totalProfit, {
                                            signDisplay: "always"
                                        }),
                                        totalProfitPercent: (0, o.formatPercent)(parseFloat(e.totalProfitPercent) / 100, {
                                            decimals: 2,
                                            sign: !0
                                        }),
                                        realizedProfit: (0, o.toUSCurrency)(e.realizedProfit, {
                                            signDisplay: "always"
                                        }),
                                        unrealizedProfit: (0, o.toUSCurrency)(e.profit, {
                                            signDisplay: "always"
                                        }),
                                        unrealizedProfitPercent: (0, o.formatPercent)(parseFloat(e.loss) / 100, {
                                            decimals: 2,
                                            sign: !0
                                        }),
                                        color: `${0>parseFloat(e.totalProfitPercent)?"red":"green"}`
                                    },
                                    sell: {
                                        qty: e.qty,
                                        outcomeIdx: e.outcomeIndex,
                                        outcome: e.outcome,
                                        isClosed: e.isClosed
                                    },
                                    outcomeDetail: {
                                        color: x ? "blue" : 0 === e.outcomeIndex ? "green" : "red",
                                        icon: x && g ? g[e.outcomeIndex].logo ? ? f.image : f.image
                                    }
                                }
                            }, h[24] = x, h[25] = f.image, h[26] = g, h[27] = t) : t = h[27], e = I.sort(S).map(t), h[19] = x, h[20] = f.image, h[21] = I, h[22] = g, h[23] = e
                        } else e = h[23];n = e
                    }
                    let P = n;
                    if (h[28] !== b || h[29] !== x || h[30] !== f.image || h[31] !== g) {
                        let e;
                        h[33] !== x || h[34] !== f.image || h[35] !== g ? (e = e => ({
                            qty: (0, o.formatNum)(e.qty, {
                                decimals: 0
                            }),
                            avgPrice: "-",
                            value: {
                                currentMarketValue: parseFloat(e.currentMarketValue) || 0,
                                cost: "-"
                            },
                            totalReturn: {
                                totalProfit: "-",
                                totalProfitPercent: void 0,
                                color: void 0,
                                realizedProfit: void 0,
                                unrealizedProfit: void 0,
                                unrealizedProfitPercent: void 0
                            },
                            isPending: e.isPending,
                            sell: {
                                qty: e.qty,
                                outcomeIdx: e.outcomeIndex,
                                outcome: e.outcome,
                                isClosed: e.isClosed
                            },
                            outcomeDetail: {
                                color: "blue",
                                icon: x && g ? g[e.outcomeIndex].logo ? ? f.image : f.image
                            }
                        }), h[33] = x, h[34] = f.image, h[35] = g, h[36] = e) : e = h[36], s = b.sort(j).map(e), h[28] = b, h[29] = x, h[30] = f.image, h[31] = g, h[32] = s
                    } else s = h[32];
                    let E = s;
                    return h[37] !== E || h[38] !== N || h[39] !== M || h[40] !== I || h[41] !== T || h[42] !== P ? (l = {
                        positions: T,
                        hasSomeShares: M,
                        hasAllShares: N,
                        portfolioPositions: I,
                        chainPositions: E,
                        subPositions: P
                    }, h[37] = E, h[38] = N, h[39] = M, h[40] = I, h[41] = T, h[42] = P, h[43] = l) : l = h[43], l
                })(e);
                return n[1] !== v || n[2] !== x || n[3] !== f || n[4] !== g || n[5] !== h || n[6] !== s || n[7] !== y ? (a = () => {
                    let e;
                    y.some(C) && (e = y.reduce(_, 0));
                    let t = h.map(T),
                        r = Math.min(...t),
                        a = g.find(e => e.outcomeIndex === s),
                        i = a ? parseFloat(a.priceAvg) : void 0,
                        n = t[s];
                    return {
                        numericalShareBalances: t,
                        formattedSharesForOutcome: (0, o.formatNum)(n, {
                            decimals: 2
                        }),
                        hasSharesForOutcome: n > 0,
                        avgPriceForOutcome: i,
                        quantityForOutcome: n,
                        redemptionValue: e,
                        redemptionValueFormatted: void 0 !== e ? (0, o.formatCurrency)(e, {
                            decimals: 2
                        }) : void 0,
                        positions: h,
                        hasSomeShares: f,
                        hasAllShares: x,
                        mergeableShares: r,
                        formattedMergeableShares: (0, o.formatNum)(r, {
                            decimals: 2
                        }),
                        portfolioPositions: g,
                        chainPositions: v,
                        subPositions: y
                    }
                }, i = [s, h, f, x, g, v, y], n[1] = v, n[2] = x, n[3] = f, n[4] = g, n[5] = h, n[6] = s, n[7] = y, n[8] = a, n[9] = i) : (a = n[8], i = n[9]), (0, l.useDeepCompareMemo)(a, i)
            })(g);
            return y[9] !== b || y[10] !== z ? (v = (0, t.jsx)(N.Provider, {
                value: z,
                children: b
            }), y[9] = b, y[10] = z, y[11] = v) : v = y[11], v
        },
        P = () => a.default.useContext(N)
}, 910591, 716084, e => {
    "use strict";
    e.s(["useMerge", () => z], 910591);
    var t = e.i(221628),
        r = e.i(306243),
        a = e.i(416340),
        i = e.i(73836),
        n = e.i(827681),
        s = e.i(246290),
        o = e.i(863828),
        l = e.i(249792),
        c = e.i(606572),
        d = e.i(51800),
        u = e.i(82056),
        m = e.i(460649),
        p = e.i(600326),
        h = e.i(99417),
        f = e.i(502980),
        x = e.i(668122),
        g = e.i(79075),
        v = e.i(69036),
        y = e.i(604777),
        b = e.i(784521),
        k = e.i(305457),
        w = e.i(399336),
        S = e.i(684686),
        j = e.i(885092),
        C = e.i(921807),
        _ = e.i(799471),
        T = e.i(306941),
        M = e.i(660006),
        N = e.i(324277),
        I = e.i(196593),
        P = e.i(631222),
        E = e.i(974603),
        A = e.i(892974),
        O = e.i(118818),
        D = e.i(422868),
        L = e.i(879756);
    let z = () => {
        let e = (0, y.useTranslations)(),
            z = (0, k.useAmplitudeAnalytics)(),
            R = (0, l.useToast)(),
            F = (0, S.useGeoStore)(e => e.permissions),
            {
                authenticated: $,
                authenticationType: B,
                closedDynamic: q
            } = (0, b.useAccountContext)(["authenticated", "authenticationType", "closedDynamic"]),
            {
                accountWalletPreferences: V
            } = (0, d.default)(),
            {
                enqueueTransaction: H
            } = (0, j.useTransactionContext)(),
            U = (0, m.default)(),
            W = (0, C.useTransactionStore)(),
            G = (0, h.useInvalidatePositions)(),
            {
                numericalShareBalances: Z,
                hasAllShares: K
            } = (0, D.useMobileMarketPositionContext)(),
            {
                setOpen: Y,
                setView: Q
            } = (0, O.useMobileMarketContext)(),
            {
                activeMarket: X
            } = (0, w.useEventActiveMarketContext)(["activeMarket"]),
            {
                tradeType: J
            } = (0, L.useMobileTradeContext)(),
            {
                setOpen: ee,
                setConnectorRoute: et
            } = (0, o.useSiwx)(),
            {
                chainId: er,
                proxyAddress: ea
            } = (0, s.useAccount)(),
            {
                switchChainAsync: ei
            } = (0, i.useSwitchChain)(),
            en = a.default.useRef(null),
            es = a.default.useRef(null),
            eo = a.default.useRef(null),
            [el, ec] = a.default.useState("rest"),
            ed = (0, _.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(ea, F, q),
            eu = a.default.useMemo(() => Z.map(e => (0, I.parseUSDCUnits)(e.toFixed(6))), [Z]),
            [em, ep] = a.default.useState(!1),
            eh = eu.reduce((e, t) => e > t ? t : e, r.maxUint256),
            [ef, ex] = a.default.useState((0, I.formatUSDCUnits)(eh)),
            eg = (0, I.parseUSDCUnits)(ef || "0"),
            ev = a.default.useCallback(e => {
                ep(!1), "" === e && ex(e);
                try {
                    (0, I.parseUSDCUnits)(e), ex(e)
                } catch {
                    ex(e.slice(0, e.indexOf(".") + P.USDC_DECIMALS + 1))
                }
            }, [ep, ex]),
            {
                hasError: ey,
                errorText: eb
            } = (0, u.useTxUnprocessableError)({
                units: "shares",
                isTradeLargerThanBalance: eg > eh,
                hasTooFewShares: eg <= 0 n
            }),
            ek = "magic" === B,
            ew = a.default.useCallback(async (...r) => {
                let [a, i, s] = r;
                if (!$) {
                    let e = Date.now();
                    (0, g.markSignupPromptOpened)("trade", {
                        now: e,
                        route: "login"
                    }), z.trackEvent(x.Events.SignupPromptOpened, (0, g.getSignupPromptOpenedEventProperties)({
                        source: "trade",
                        route: "login"
                    })), Y(!1), Q("default"), et(n.ConnectorRoute.LOGIN), ee(!0);
                    return
                }
                if (ep(!0), ey) return void R.custom(new c.ToastBuilder().custom((0, t.jsx)(A.Toast, {
                    label: eb
                })).position({
                    side: "top"
                }).zIndex(v.zIndices.drawer + 11));
                try {
                    P.MATIC_CONFIG.chainId !== er && (ec("switching-networks"), await ei({
                        chainId: P.MATIC_CONFIG.chainId
                    }));
                    let r = (0, E.getMergePositionsTransaction)({
                        chainId: P.MATIC_CONFIG.chainId,
                        chainConfig: P.chainConfig,
                        conditionId: X.conditionId ? ? "",
                        outcomeCount: X.outcomes.length ? ? 0,
                        negRisk: !!X.negRisk,
                        amount: eg
                    });
                    if (ek && ea) {
                        let n = (0, E.formatSyntheticMergeTransaction)({
                            conditionId: X.conditionId ? ? "",
                            amount: eg,
                            outcomePrices: X.outcomePrices,
                            proxyAddress: ea
                        });
                        eo.current = n, await U(n, X), G(ea), R.success(new c.ToastBuilder().position({
                            side: "top"
                        }).title(e("trading.mergeShares.title")).description(X.question)), s ? .(a, i), Y(!1), ex(""), ep(!1), ec("rest"), (0, N.executeOptimisticCTFTransaction)({
                            syntheticTxn: n,
                            syntheticTxnRef: eo,
                            transaction: r,
                            market: X,
                            txnType: p.CTFTxnType.Merge,
                            outcome: "",
                            quantity: eg,
                            usdc: 0 n,
                            impact: (0, f.computeMergeImpact)(eg, X.outcomePrices),
                            errorTag: "Merge Shares (background)",
                            proxyAddress: ea,
                            transactionStore: W,
                            enqueueTransaction: H,
                            gasPreference: V ? .advancedMode ? V.gasPreference : null,
                            customGasPrice: V ? .advancedMode ? V.customGasPrice : null,
                            onFailure: () => R.custom(new c.ToastBuilder().custom((0, t.jsx)(A.Toast, {
                                label: e("trading.mergeShares.failed")
                            })).position({
                                side: "top"
                            }).zIndex(v.zIndices.drawer + 11))
                        });
                        return
                    }
                    ec("submitting"), await H(r, P.Network.Matic, p.CTFTxnType.Merge, "", eg, 0 n, X, (0, f.computeMergeImpact)(eg, X.outcomePrices), V ? .advancedMode ? V.gasPreference : null, V ? .advancedMode ? V.customGasPrice : null, void 0, void 0, void 0, !1), ec("success"), s ? .(a, i), en.current = setTimeout(() => {
                        Y(!1)
                    }, 2e3), es.current = setTimeout(() => {
                        ex(""), ep(!1), ec("rest")
                    }, 3e3)
                } catch (e) {
                    try {
                        if ((0, T.isUserRejection)(e)) return void R.custom(new c.ToastBuilder().custom((0, t.jsx)(A.Toast, {
                            label: "Request Cancelled"
                        })).position({
                            side: "top"
                        }).zIndex(v.zIndices.drawer + 11));
                        R.custom(new c.ToastBuilder().custom((0, t.jsx)(A.Toast, {
                            label: "An unexpected error occured"
                        })).position({
                            side: "top"
                        }).zIndex(v.zIndices.drawer + 11)), (0, M.handleError)(e, "Merge Shares", ea, M.BUG_CATEGORIES.MISSION_CRITICAL)
                    } finally {
                        ec("rest")
                    }
                }
            }, [$, B, z, ey, ea, X, er, eg, H, V ? .advancedMode, V ? .gasPreference, V ? .customGasPrice, ei, ee, Y, eb, et, R, Q, ek, U, W, G]);
        return a.default.useEffect(() => () => {
            en.current && clearTimeout(en.current), es.current && clearTimeout(es.current)
        }, []), a.default.useEffect(() => {
            "merge" === J && ex((0, I.formatUSDCUnits)(eh))
        }, [J]), a.default.useMemo(() => ({
            merge: ew,
            maxMergeAmount: eh,
            amount: ef,
            onChangeAmount: ev,
            hasError: ey,
            hasClicked: em,
            orderCreationState: el,
            canMerge: ed.canMerge,
            hasAllShares: K,
            disabled: !ed.canMerge || !K || em && (ey || "" === ef || "0" === ef)
        }), [ew, eh, ef, ev, ey, em, el, ed.canMerge, K])
    };
    e.s(["useSplit", () => V], 716084);
    var R = e.i(294781),
        F = e.i(348262),
        $ = e.i(5146),
        B = e.i(248131),
        q = e.i(679892);
    let V = () => {
        let e = (0, y.useTranslations)(),
            r = (0, k.useAmplitudeAnalytics)(),
            E = (0, l.useToast)(),
            D = (0, S.useGeoStore)(e => e.permissions),
            {
                authenticated: L,
                authenticationType: z,
                closedDynamic: V
            } = (0, b.useAccountContext)(["authenticated", "authenticationType", "closedDynamic"]),
            {
                accountWalletPreferences: H
            } = (0, d.default)(),
            {
                enqueueTransaction: U
            } = (0, j.useTransactionContext)(),
            W = (0, m.default)(),
            G = (0, C.useTransactionStore)(),
            Z = (0, h.useInvalidatePositions)(),
            {
                setOpen: K,
                setView: Y
            } = (0, O.useMobileMarketContext)(),
            {
                setOpen: Q,
                setConnectorRoute: X
            } = (0, o.useSiwx)(),
            {
                activeMarket: J
            } = (0, w.useEventActiveMarketContext)(["activeMarket"]),
            {
                trackedProxyUsdcBalance: ee
            } = (0, $.default)(),
            {
                chainId: et,
                proxyAddress: er
            } = (0, s.useAccount)(),
            {
                switchChainAsync: ea
            } = (0, i.useSwitchChain)(),
            ei = a.default.useRef(null),
            en = a.default.useRef(null),
            es = a.default.useRef(null),
            [eo, el] = a.default.useState("rest"),
            ec = (0, _.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(er, D, V),
            [ed, eu] = a.default.useState(!1),
            [em, ep] = a.default.useState(""),
            eh = (0, I.parseUSDCUnits)(em || "0"),
            ef = a.default.useCallback(e => {
                eu(!1), "" === e && ep(e);
                try {
                    (0, I.parseUSDCUnits)(e), ep(e)
                } catch {
                    ep(e.slice(0, e.indexOf(".") + P.USDC_DECIMALS + 1))
                }
            }, [eu, ep]),
            {
                hasError: ex,
                errorText: eg
            } = (0, u.useTxUnprocessableError)({
                units: "USDC",
                isTradeLargerThanBalance: parseFloat(em) > ee.current,
                hasTooFewShares: eh <= 0 n
            }),
            ev = "magic" === z,
            ey = (0, R.useRouter)(),
            eb = a.default.useCallback(() => {
                ey ? ey.push(B.Location.Portfolio) : window.location.assign(B.Location.Portfolio)
            }, [ey]),
            ek = a.default.useCallback(async (...a) => {
                let [i, s, o] = a;
                if (!L) {
                    let e = Date.now();
                    (0, g.markSignupPromptOpened)("trade", {
                        now: e,
                        route: "login"
                    }), r.trackEvent(x.Events.SignupPromptOpened, (0, g.getSignupPromptOpenedEventProperties)({
                        source: "trade",
                        route: "login"
                    })), K(!1), Y("default"), X(n.ConnectorRoute.LOGIN), Q(!0);
                    return
                }
                if (ee.current < .01) return void eb();
                if (eu(!0), ex) return void E.custom(new c.ToastBuilder().custom((0, t.jsx)(A.Toast, {
                    label: eg
                })).position({
                    side: "top"
                }).zIndex(v.zIndices.drawer + 11));
                try {
                    P.MATIC_CONFIG.chainId !== et && (el("switching-networks"), await ea({
                        chainId: P.MATIC_CONFIG.chainId
                    }));
                    let r = (0, q.getSplitPositionTransaction)({
                        chainId: P.MATIC_CONFIG.chainId,
                        chainConfig: P.chainConfig,
                        conditionId: J.conditionId ? ? "",
                        outcomeCount: J.outcomes.length ? ? 0,
                        negRisk: J.negRisk,
                        amount: eh
                    });
                    if (ev && er) {
                        let a = (0, q.formatSyntheticSplitTransaction)({
                            conditionId: J.conditionId ? ? "",
                            amount: eh,
                            outcomePrices: J.outcomePrices,
                            proxyAddress: er
                        });
                        es.current = a, await W(a, J), Z(er), E.success(new c.ToastBuilder().position({
                            side: "top"
                        }).title(e("trading.splitShares.title")).description(J.question)), o ? .(i, s), K(!1), ep(""), eu(!1), el("rest"), (0, N.executeOptimisticCTFTransaction)({
                            syntheticTxn: a,
                            syntheticTxnRef: es,
                            transaction: r,
                            market: J,
                            txnType: p.CTFTxnType.Split,
                            outcome: "",
                            quantity: 0 n,
                            usdc: eh,
                            impact: (0, f.computeSplitImpact)(eh, J.outcomePrices),
                            errorTag: "Split Shares (background)",
                            proxyAddress: er,
                            transactionStore: G,
                            enqueueTransaction: U,
                            gasPreference: H ? .advancedMode ? H.gasPreference : null,
                            customGasPrice: H ? .advancedMode ? H.customGasPrice : null,
                            onFailure: () => E.custom(new c.ToastBuilder().custom((0, t.jsx)(A.Toast, {
                                label: e("trading.splitShares.failed")
                            })).position({
                                side: "top"
                            }).zIndex(v.zIndices.drawer + 11))
                        });
                        return
                    }
                    el("submitting"), await U(r, P.Network.Matic, p.CTFTxnType.Split, "", 0 n, eh, J, (0, f.computeSplitImpact)(eh, J.outcomePrices), H ? .advancedMode ? H.gasPreference : null, H ? .advancedMode ? H.customGasPrice : null, void 0, void 0, void 0, !1), el("success"), o ? .(i, s), ei.current = setTimeout(() => {
                        K(!1)
                    }, 2e3), en.current = setTimeout(() => {
                        ep(""), eu(!1), el("rest")
                    }, 3e3)
                } catch (e) {
                    try {
                        if ((0, T.isUserRejection)(e)) return void E.custom(new c.ToastBuilder().custom((0, t.jsx)(A.Toast, {
                            label: "Request Cancelled"
                        })).position({
                            side: "top"
                        }).zIndex(v.zIndices.drawer + 11));
                        E.custom(new c.ToastBuilder().custom((0, t.jsx)(A.Toast, {
                            label: "An unexpected error occured"
                        })).position({
                            side: "top"
                        }).zIndex(v.zIndices.drawer + 11)), (0, M.handleError)(e, "Split Shares", er, M.BUG_CATEGORIES.MISSION_CRITICAL)
                    } finally {
                        el("rest")
                    }
                }
            }, [ee, r, L, z, ex, K, X, Q, E, eg, et, J, eh, U, H ? .advancedMode, H ? .gasPreference, H ? .customGasPrice, ea, er, Y, ev, W, G, Z, eb]),
            ew = a.default.useMemo(() => [{
                step: 1,
                label: "+$1",
                id: "split-inc-1-adornment",
                fn: () => ep(e => (0, F.handleStep)(e, "increment", 1))
            }, {
                step: 5,
                label: "+$5",
                id: "split-inc-5-adornment",
                fn: () => ep(e => (0, F.handleStep)(e, "increment", 5))
            }, {
                step: 10,
                id: "split-inc-10-adornment",
                label: "+$10",
                fn: () => ep(e => (0, F.handleStep)(e, "increment", 10))
            }, {
                step: 100,
                id: "split-inc-100-adornment",
                label: "+$100",
                fn: () => ep(e => (0, F.handleStep)(e, "increment", 100))
            }], []);
        return a.default.useEffect(() => () => {
            ei.current && clearTimeout(ei.current), en.current && clearTimeout(en.current)
        }, []), a.default.useMemo(() => ({
            trackedProxyUsdcBalance: ee,
            onChangeAmount: ef,
            increments: ew,
            canSplit: ec.canSplit,
            hasClicked: ed,
            hasError: ex,
            amount: em,
            split: ek,
            orderCreationState: eo,
            label: ee.current < .01 ? "Deposit" : "Split",
            disabled: !ec.canSplit || ed && (ex || "" === em || "0" === em)
        }), [ef, ew, ec.canSplit, ee, ed, ex, em, ek, eo])
    }
}, 369038, 986558, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340),
        a = e.i(269101),
        i = e.i(196593);
    let n = e => {
        let r, n, l, c, d, u, m = (0, t.c)(12);
        m[0] === Symbol.for("react.memo_cache_sentinel") ? (r = ["positions"], m[0] = r) : r = m[0];
        let {
            positions: p
        } = (0, a.useEventPositionsContext)(r);
        if (m[1] !== e || m[2] !== p) {
            let t = [0, 0];
            l = [0, 0], n = [0, 0], (p ? ? []).filter(t => t.market.id.toLowerCase() === e.toLowerCase()).forEach(e => {
                let r = parseInt(e.outcomeIndex, 10);
                if (0 !== r && 1 !== r) return;
                let a = e.trackedPositionMetadata ? e.trackedPositionMetadata.netQuantity.current : parseFloat((0, i.formatUSDCUnits)(BigInt(e.netQuantity))),
                    s = e.trackedPositionMetadata ? e.trackedPositionMetadata.netQuantity.pending : 0,
                    o = e.trackedPositionMetadata ? e.trackedPositionMetadata.quantityBought.pending : 0;
                if (l[r] = l[r] + s, n[r] = n[r] + o, !Number.isFinite(a) || !Number.isFinite(s)) return;
                let c = s < 0 ? Math.abs(s) : 0;
                t[r] = t[r] + Math.max(a - c, 0)
            }), c = t.map(s), m[1] = e, m[2] = p, m[3] = n, m[4] = l, m[5] = c
        } else n = m[3], l = m[4], c = m[5];
        let h = c;
        m[6] !== n ? (d = n.map(o), m[6] = n, m[7] = d) : d = m[7];
        let f = d;
        return m[8] !== l || m[9] !== h || m[10] !== f ? (u = {
            sellable: h,
            pending: l,
            pendingBuys: f
        }, m[8] = l, m[9] = h, m[10] = f, m[11] = u) : u = m[11], u
    };

    function s(e) {
        return Math.max(e, 0)
    }

    function o(e) {
        return Math.max(e, 0)
    }
    e.s(["default", 0, n], 986558);
    var l = e.i(880809),
        c = e.i(97594);
    let d = () => {
        let {
            activeMarket: e,
            limitBuyMax: t,
            marketBuyMax: a,
            sellMax: s
        } = (0, c.useOrderLimits)(), {
            selectedOutcomeIdx: o
        } = (0, l.useTradeContext)(["selectedOutcomeIdx"]), {
            pendingBuys: d
        } = n(e.conditionId), u = d ? .[o] ? ? 0, m = (0, r.useMemo)(() => !Number.isFinite(u) || u <= 0 ? 0 n : (0, i.parseUSDCUnits)(u.toFixed(6)), [u]);
        return {
            activeMarket: e,
            limitBuyMax: t,
            marketBuyMax: a,
            sellMax: (0, r.useMemo)(() => 0 n === m ? s : s > m ? s - m : 0 n, [s, m])
        }
    };
    e.s(["useOrderLimitsWithPendingSell", 0, d, "useOrderValidationWithPendingSell", 0, () => {
        let e, r = (0, t.c)(5),
            a = (0, c.useOrderValidation)(),
            {
                limitBuyMax: i,
                marketBuyMax: n,
                sellMax: s
            } = d();
        return r[0] !== s || r[1] !== i || r[2] !== n || r[3] !== a ? (e = { ...a,
            limitBuyMax: i,
            marketBuyMax: n,
            sellMax: s
        }, r[0] = s, r[1] = i, r[2] = n, r[3] = a, r[4] = e) : e = r[4], e
    }], 369038)
}, 688608, 554637, 202187, e => {
    "use strict";
    e.s(["ENABLE_ABBREVIATED_SPORTS_OUTCOMES", 0, !0, "ENABLE_IN_GAME_DELAY_STATES", 0, !0, "ENABLE_NEG_RISK_COLORS", 0, !0, "ENABLE_SPORTS_COLORS", 0, !0, "ENABLE_USE_BLUE_NEG_RISK_COLORS", 0, !0], 688608);
    var t = e.i(999061);
    e.i(416340);
    var r = e.i(6204),
        a = e.i(909420);
    let i = ({
        team: e
    }) => {
        let t = e ? .color;
        return t ? {
            color: "custom",
            customColors: {
                backgroundColor: t,
                color: "var(--color-white)"
            }
        } : {
            color: "blue",
            customColors: void 0
        }
    };
    e.s(["getDefaultButtonColors", 0, ({
        outcomeIdx: e,
        isNegRisk: t
    }) => t && 1 ? {
        color: "blue",
        customColors: void 0
    } : {
        color: 0 === e ? "green" : "red",
        customColors: void 0
    }, "getSportsButtonColor", 0, i, "useSportsButtonColor", 0, (e, n, s) => {
        let o, l, c = (0, t.c)(11);
        c[0] === Symbol.for("react.memo_cache_sentinel") ? (o = ["isSportsPage"], c[0] = o) : o = c[0];
        let {
            isSportsPage: d
        } = (0, r.useSportsContext)(o);
        if (c[1] !== s || c[2] !== d || c[3] !== e || c[4] !== n) {
            e: {
                if (!d) {
                    let e;
                    c[6] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        color: void 0,
                        customColors: void 0
                    }, c[6] = e) : e = c[6], l = e;
                    break e
                }
                let t = (0, a.getTeam)({
                    market: e,
                    outcomeIndex: n
                });
                if (!t) {
                    let e;
                    c[10] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        color: "blue",
                        customColors: void 0
                    }, c[10] = e) : e = c[10], l = e;
                    break e
                }
                l = i({
                    team: t
                })
            }
            c[1] = s,
            c[2] = d,
            c[3] = e,
            c[4] = n,
            c[5] = l
        }
        else l = c[5];
        return l
    }], 554637);
    var n = e.i(945374);
    e.s(["useOnTapConfetti", 0, () => {
        let e, r, a = (0, t.c)(5),
            {
                rainConfetti: i,
                throwDefaultConfetti: s
            } = (0, n.useConfettiContext)();
        a[0] !== i || a[1] !== s ? (e = e => {
            let {
                e: t,
                info: r,
                mode: a
            } = e, {
                type: n,
                location: o
            } = void 0 === a ? {} : a, l = void 0 === n ? "tap-info" : n, c = void 0 === o ? "center" : o;
            if ("tap-info" === l && r) return void i({
                origin: {
                    x: r.point.x / window.innerWidth,
                    y: r.point.y / window.innerHeight
                }
            });
            if (("event" === l || "tap-info" === l) && t) {
                if (window.TouchEvent && t instanceof TouchEvent) {
                    let e = ((e, t) => {
                        let r = e.target.getBoundingClientRect();
                        if (r) {
                            if ("center" === t) {
                                let e = r.left + r.width / 2,
                                    t = r.top + r.height / 2;
                                return {
                                    x: e / window.innerWidth,
                                    y: t / window.innerHeight
                                }
                            }
                            if ("click" === t) {
                                let t = e.touches[0];
                                return {
                                    x: t.clientX / window.innerWidth,
                                    y: t.clientY / window.innerHeight
                                }
                            }
                        }
                    })(t, c);
                    if (e) return void i({
                        origin: e
                    })
                }
                if (t instanceof MouseEvent || t instanceof PointerEvent) {
                    let e = ((e, t) => {
                        let r = e.target.getBoundingClientRect();
                        if (r) {
                            if ("center" === t) {
                                let e = r.left + r.width / 2,
                                    t = r.top + r.height / 2;
                                return {
                                    x: e / window.innerWidth,
                                    y: t / window.innerHeight
                                }
                            }
                            if ("click" === t) return {
                                x: e.clientX / window.innerWidth,
                                y: e.clientY / window.innerHeight
                            }
                        }
                    })(t, c);
                    if (e) return void i({
                        origin: e
                    })
                }
            }
            "sides" === l && s()
        }, a[0] = i, a[1] = s, a[2] = e) : e = a[2];
        let o = e;
        return a[3] !== o ? (r = {
            confetti: o
        }, a[3] = o, a[4] = r) : r = a[4], r
    }], 202187)
}, 879756, 709638, e => {
    "use strict";
    e.s(["MobileTradeContextProvider", () => Q, "useMobileTradeContext", () => X], 879756);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(313181);
    e.s(["MobileTransactionContextProvider", () => Z, "useMobileTransactionContext", () => K], 709638);
    var n = e.i(740594),
        s = e.i(827681),
        o = e.i(863828),
        l = e.i(780641),
        c = e.i(668122),
        d = e.i(79075),
        u = e.i(784521),
        m = e.i(305457),
        p = e.i(604777),
        h = e.i(880809),
        f = e.i(910591),
        x = e.i(716084),
        g = e.i(723823),
        v = e.i(140527),
        y = e.i(73836),
        b = e.i(423708),
        k = e.i(88240),
        w = e.i(246290),
        S = e.i(628684),
        j = e.i(100825),
        C = e.i(112014),
        _ = e.i(635868),
        T = e.i(551068),
        M = e.i(369038),
        N = e.i(101008),
        I = e.i(458164),
        P = e.i(593332),
        E = e.i(631503),
        A = e.i(400819),
        O = e.i(399336),
        D = e.i(891685),
        L = e.i(6204),
        z = e.i(660006),
        R = e.i(631222),
        F = e.i(688608),
        $ = e.i(118818),
        B = e.i(488758),
        q = e.i(909420),
        V = e.i(554637),
        H = e.i(202187);
    let U = ["gameState"],
        W = {
            label: "Unavailable",
            color: "gray",
            disabled: !0,
            onTap: async (...e) => {},
            orderCreationState: "rest",
            customColors: void 0
        },
        G = a.default.createContext({}),
        Z = ({
            children: e
        }) => {
            let r = (0, p.useTranslations)(),
                i = (0, m.useAmplitudeAnalytics)(),
                {
                    authenticated: Z
                } = (0, u.useAccountContext)(["authenticated"]),
                {
                    tradeType: K
                } = X(),
                {
                    setOpen: Y,
                    setView: Q
                } = (0, $.useMobileMarketContext)(),
                {
                    setConnectorRoute: J,
                    setOpen: ee
                } = (0, o.useSiwx)(),
                {
                    side: et
                } = (0, h.useTradeContext)(["side"]),
                er = (0, l.usePermissions)(),
                ea = a.default.useCallback(async (...e) => {
                    let t = Date.now();
                    (0, d.markSignupPromptOpened)("trade", {
                        now: t,
                        route: "login"
                    }), i.trackEvent(c.Events.SignupPromptOpened, (0, d.getSignupPromptOpenedEventProperties)({
                        source: "trade",
                        route: "login"
                    })), Y(!1), Q("default"), setTimeout(() => {
                        J(s.ConnectorRoute.LOGIN), ee(!0)
                    }, 0)
                }, [i, Y, J, ee, Q]),
                ei = (0, x.useSplit)(),
                en = (0, f.useMerge)(),
                es = (() => {
                    let e = (0, m.useAmplitudeAnalytics)(),
                        t = a.default.useRef(null),
                        r = a.default.useRef(null),
                        {
                            authenticated: i,
                            authenticationType: l,
                            walletMode: p
                        } = (0, u.useAccountContext)(["authenticated", "authenticationType", "walletMode"]),
                        {
                            isOrderInvalid: f,
                            orderError: x
                        } = (0, M.useOrderValidationWithPendingSell)(),
                        {
                            side: W,
                            setShares: G,
                            selectedOutcome: Z,
                            selectedOutcomeIdx: K,
                            orderType: Y,
                            setAmountUpdateLocation: Q,
                            setHasTouchedPrice: J,
                            setHasTouchedShares: ee,
                            shares: et,
                            slippageTolerance: er,
                            setShouldShowSlippageWarning: ea,
                            setDisableErrorComponent: ei
                        } = (0, h.useTradeContext)(["side", "setShares", "selectedOutcome", "selectedOutcomeIdx", "orderType", "setAmountUpdateLocation", "setHasTouchedPrice", "setHasTouchedShares", "shares", "slippageTolerance", "setShouldShowSlippageWarning", "setDisableErrorComponent"]),
                        {
                            market: en
                        } = (0, _.useBookContext)(["market"]),
                        es = (0, g.useBestPrice)(en, K, "ask"),
                        eo = (0, g.useBestPrice)(en, K, "bid"),
                        {
                            calculateWorstPrice: el
                        } = (0, T.useCalculateWorstPrice)(),
                        {
                            tradeType: ec,
                            setHasClicked: ed,
                            hasClicked: eu
                        } = X(),
                        {
                            setOpen: em,
                            market: {
                                closed: ep
                            },
                            setView: eh
                        } = (0, $.useMobileMarketContext)(),
                        {
                            event: ef
                        } = (0, D.useEventContext)(["event"]),
                        {
                            activeMarket: ex
                        } = (0, O.useEventActiveMarketContext)(["activeMarket"]),
                        {
                            isSportsPage: eg
                        } = (0, L.useSportsContext)(["isSportsPage"]),
                        {
                            gameState: ev
                        } = (0, j.useSportsGameSelector)(ef.slug, U),
                        {
                            chainId: ey,
                            proxyAddress: eb,
                            address: ek
                        } = (0, w.useAccount)(),
                        {
                            switchChainAsync: ew
                        } = (0, y.useSwitchChain)(),
                        {
                            setOpen: eS,
                            setConnectorRoute: ej
                        } = (0, o.useSiwx)(),
                        {
                            data: eC
                        } = (0, b.useWalletClient)({
                            chainId: R.MATIC_CONFIG.chainId
                        }),
                        {
                            clob: e_,
                            generateApiCreds: eT
                        } = (0, A.useClobCredentialContext)(),
                        {
                            areAllAllowancesApproved: eM,
                            isUpdatingAllowances: eN,
                            triggerAllApprovals: eI
                        } = (0, C.useAllowanceContext)(),
                        {
                            isSafeDeployed: eP,
                            deploySafe: eE
                        } = (0, S.useSafe)(),
                        eA = (0, k.useCreateOrder)(),
                        eO = W === n.Side.BUY ? es : eo,
                        eD = (0, a.useMemo)(() => {
                            let e = el(et, er, W, en.orderPriceMinTickSize);
                            return 0 === e ? 0 : Math.abs(e - eO.value)
                        }, [et, er, W, el, eO, en.orderPriceMinTickSize]),
                        {
                            isNegRisk: eL
                        } = (0, B.useSportsItemContext)(),
                        {
                            confetti: ez
                        } = (0, H.useOnTapConfetti)(),
                        eR = (0, V.useSportsButtonColor)(ex, K, eL),
                        [eF, e$] = a.default.useState("rest"),
                        eB = a.default.useCallback(() => {
                            Y === I.OrderType.Market && G(""), Q("click"), ed(!1), J(!1), ee(!1)
                        }, [G, J, ee, ed, Q, Y]),
                        eq = a.default.useCallback(async (...a) => {
                            let [o, u, m, h] = a;
                            if (!i) {
                                let t = Date.now();
                                (0, d.markSignupPromptOpened)("trade", {
                                    now: t,
                                    route: "login"
                                }), e.trackEvent(c.Events.SignupPromptOpened, (0, d.getSignupPromptOpenedEventProperties)({
                                    source: "trade",
                                    route: "login"
                                })), em(!1), eh("default"), ej(s.ConnectorRoute.LOGIN), eS(!0);
                                return
                            }
                            if (f && x) return void ed(!0);
                            if (eD >= R.PRICE_CHANGE_WARNING_CLOB && !h && Y === I.OrderType.Market) return void ea(!0);
                            ed(!0);
                            let g = Date.now(),
                                v = F.ENABLE_IN_GAME_DELAY_STATES && ev === P.GameState.Live && ex.secondsDelay,
                                y = "magic" === l && !v;
                            try {
                                R.MATIC_CONFIG.chainId !== ey && (e$("switching-networks"), await ew({
                                    chainId: R.MATIC_CONFIG.chainId
                                })), !eP && (0, E.requiresWalletDeployment)(p) && (e$("deploy-safe"), await eE()), "magic" !== l && (0, N.mustGenerateApiKeys)(e_, p) && (e$("generate-api-key"), await eT(ek, eb, eC)), "magic" !== l && (0, N.mustApproveAllowances)({
                                    walletMode: p,
                                    areAllAllowancesApproved: eM,
                                    isUpdatingAllowances: eN
                                }) && (e$("sign-approvals"), await eI(!1, "MobileDrawer"), await new Promise(e => setTimeout(e, 1e4))), ei(!0), (0, E.requiresManualTradingSetup)(p) && e$("submitting");
                                let e = eA({
                                    options: {
                                        successToast: !0,
                                        errorToast: !0
                                    },
                                    values: {
                                        side: W,
                                        selectedOutcomeIdx: K
                                    },
                                    tracking: {
                                        page: eg ? "sports" : "events",
                                        source: "buy-sell-widget"
                                    }
                                });
                                y ? (e$("success"), Y === I.OrderType.Market && W === n.Side.BUY && ez({
                                    e: o,
                                    info: u,
                                    mode: {
                                        type: "event",
                                        location: "center"
                                    }
                                }), m ? .(o, u), r.current && clearTimeout(r.current), t.current = setTimeout(() => {
                                    em(!1)
                                }, 800), r.current = setTimeout(() => {
                                    eB(), e$("rest"), ei(!1)
                                }, 1200)) : v && "magic" === l && e$("in-game-delay");
                                let a = await e;
                                if (a === k.TransactionResponseState.GeneralError || a === k.TransactionResponseState.SignatureError) {
                                    e$("rest"), ei(!1);
                                    return
                                }
                                if (!y) {
                                    if (v && "magic" === l) {
                                        let e = Date.now() - g,
                                            t = (ex.secondsDelay ? ? 3) * 1e3;
                                        e < t && await new Promise(r => setTimeout(r, t - e)), e$("submitting"), await new Promise(e => setTimeout(e, 2e3))
                                    }
                                    e$("success"), m ? .(o, u), t.current && clearTimeout(t.current), t.current = setTimeout(() => {
                                        em(!1)
                                    }, 800), r.current = setTimeout(() => {
                                        eB(), e$("rest"), ei(!1)
                                    }, 1200)
                                }
                            } catch (e) {
                                e$("rest"), ei(!1), (0, z.handleError)(e, "events_trade_flow_error", eb, "high", {
                                    orderCreationState: eF,
                                    tradeType: ec,
                                    side: W,
                                    orderType: Y,
                                    selectedOutcome: Z,
                                    selectedOutcomeIdx: K,
                                    shares: et,
                                    slippageTolerance: er,
                                    authenticationType: l,
                                    chainId: ey,
                                    marketInfo: {
                                        slug: ex ? .slug,
                                        conditionId: ex ? .conditionId,
                                        question: ex ? .question,
                                        sportsMarketType: ex ? .sportsMarketType
                                    },
                                    gameState: ev,
                                    hasDelay: v,
                                    shouldSucceedOptimistically: y,
                                    isSports: eg,
                                    isNegRisk: eL,
                                    bestPrice: eO,
                                    slippage: eD,
                                    isSafeDeployed: eP,
                                    areAllAllowancesApproved: eM,
                                    isUpdatingAllowances: eN
                                })
                            }
                        }, [e, i, ed, f, x, em, ej, eS, ey, eP, l, p, e_, eM, eN, eA, ew, eE, eT, ek, eb, eC, eI, eh, Y, ez, eB, K, Z, et, er, W, eD, ea, ev, ex, eg, eL, eO, ei, eF, ec]);
                    a.default.useEffect(() => () => {
                        t.current && clearTimeout(t.current)
                    }, []);
                    let {
                        label: eV,
                        disabled: eH,
                        color: eU,
                        customColors: eW
                    } = a.default.useMemo(() => {
                        let e = { ...eR
                        };
                        return eg && (eL && ("draw" === ex.negRiskSportsMarketType && (e = {
                            color: "blue",
                            customColors: void 0
                        }), ex.negRiskSportsMarketType && ex.team && ex.team.color && (e = {
                            color: "custom",
                            customColors: {
                                backgroundColor: ex.team.color,
                                color: "var(--color-white)"
                            }
                        })), "totals" === ex.sportsMarketType && ex.line && (e = {
                            color: 0 === K ? "green" : "red",
                            customColors: void 0
                        })), { ...(({
                                side: e,
                                tradeType: t,
                                closed: r,
                                selectedOutcome: a,
                                selectedOutcomeIdx: i,
                                sportsMarketType: s,
                                line: o,
                                market: l,
                                orderType: c
                            }) => {
                                if ("redeem" === t || r) return {
                                    label: "Redeem",
                                    color: "green"
                                };
                                if (c === I.OrderType.Limit) {
                                    let t = e === n.Side.BUY ? "buy" : "sell";
                                    return {
                                        label: `Place ${t} order`,
                                        color: 0 === i ? "green" : "red"
                                    }
                                }
                                if ("spreads" === s) {
                                    let t = (0, q.getSpreadLineForOutcome)({
                                        market: l,
                                        outcomeIndex: i
                                    });
                                    if (void 0 !== t) {
                                        let r = (0, q.getFormattedSpread)(t);
                                        return {
                                            label: `${(0,v.capitalize)(e)} ${a} ${r}`,
                                            color: "blue"
                                        }
                                    }
                                    return {
                                        label: `${(0,v.capitalize)(e)} ${a}`,
                                        color: "blue"
                                    }
                                }
                                if ("totals" === s && void 0 !== o) {
                                    let t = (0, q.getFormattedOverUnder)({
                                        line: o,
                                        outcomeIndex: i
                                    });
                                    return {
                                        label: `${(0,v.capitalize)(e)} ${t}`,
                                        color: 0 === i ? "red" : "green"
                                    }
                                }
                                return {
                                    label: `${(0,v.capitalize)(e)} ${a}`,
                                    color: 0 === i ? "green" : "red"
                                }
                            })({
                                side: W,
                                closed: ep,
                                tradeType: ec,
                                selectedOutcome: Z ? ? "",
                                selectedOutcomeIdx: K,
                                sportsMarketType: ex.sportsMarketType,
                                line: ex.line,
                                market: ex,
                                orderType: Y
                            }),
                            ...e.color && "success" !== eF && "redeem" !== ec && { ...e
                            },
                            ..."success" === eF && {
                                color: "green"
                            },
                            disabled: "submitting" === eF || "switching-networks" === eF || f && eu
                        }
                    }, [eF, f, ec, eu, W, ep, Z, eg, eL, eR, ex, K, Y]);
                    return a.default.useMemo(() => ({
                        label: eV,
                        disabled: eH,
                        color: eU,
                        customColors: eW,
                        onTap: eq,
                        orderCreationState: eF
                    }), [eV, eH, eU, eW, eq, eF])
                })(),
                {
                    label: eo,
                    color: el,
                    customColors: ec,
                    disabled: ed,
                    onTap: eu,
                    orderCreationState: em
                } = a.default.useMemo(() => Z ? "merge" === K ? er.canMerge ? {
                    label: "Merge",
                    color: "blue",
                    disabled: en.disabled,
                    onTap: en.merge,
                    orderCreationState: en.orderCreationState,
                    customColors: void 0
                } : W : "split" === K ? er.canSplit ? {
                    label: ei.label,
                    color: "blue",
                    disabled: ei.disabled,
                    onTap: ei.split,
                    orderCreationState: ei.orderCreationState,
                    customColors: void 0
                } : W : (et !== n.Side.BUY || er.canBuy) && (et !== n.Side.SELL || er.canSell) ? {
                    label: er.canBuy ? es.label : "Unavailable",
                    color: er.canBuy ? es.color : "gray",
                    customColors: er.canBuy ? es.customColors : void 0,
                    disabled: es.disabled,
                    onTap: es.onTap,
                    orderCreationState: es.orderCreationState
                } : W : {
                    label: r("trading.trade"),
                    color: "blue",
                    disabled: !1,
                    onTap: ea,
                    orderCreationState: "rest",
                    customColors: void 0
                }, [et, K, en, ei, es, Z, ea, er]),
                ep = a.default.useMemo(() => ({
                    split: ei,
                    merge: en,
                    trade: es,
                    label: eo,
                    color: el,
                    customColors: ec,
                    disabled: ed,
                    onTap: eu,
                    orderCreationState: em
                }), [ei, en, es, eo, el, ec, ed, eu, em]);
            return (0, t.jsx)(G.Provider, {
                value: ep,
                children: e
            })
        },
        K = () => a.default.useContext(G),
        Y = a.default.createContext({}),
        Q = e => {
            let a, n, s, o = (0, r.c)(13),
                {
                    children: l
                } = e,
                {
                    hasClicked: c,
                    setHasClicked: d,
                    setTradeState: u,
                    setTradeType: m,
                    tradeType: p,
                    sportsRedemptionType: h,
                    sportsRedemptionConditionIds: f
                } = (0, i.useTradeState)();
            o[0] !== c || o[1] !== d || o[2] !== u || o[3] !== m || o[4] !== f || o[5] !== h || o[6] !== p ? (a = {
                hasClicked: c,
                setHasClicked: d,
                setTradeState: u,
                setTradeType: m,
                tradeType: p,
                sportsRedemptionType: h,
                sportsRedemptionConditionIds: f
            }, o[0] = c, o[1] = d, o[2] = u, o[3] = m, o[4] = f, o[5] = h, o[6] = p, o[7] = a) : a = o[7];
            let x = a;
            return o[8] !== l ? (n = (0, t.jsx)(Z, {
                children: l
            }), o[8] = l, o[9] = n) : n = o[9], o[10] !== n || o[11] !== x ? (s = (0, t.jsx)(Y.Provider, {
                value: x,
                children: n
            }), o[10] = n, o[11] = x, o[12] = s) : s = o[12], s
        },
        X = () => a.default.useContext(Y)
}, 184062, 318121, e => {
    "use strict";
    e.s(["PositionChip", () => C, "default", () => A], 184062);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(740594),
        i = e.i(723823),
        n = e.i(766181),
        s = e.i(474280),
        o = e.i(416340),
        l = e.i(458164),
        c = e.i(30704),
        d = e.i(909576),
        u = e.i(879756),
        m = e.i(780641),
        p = e.i(944891),
        h = e.i(870555),
        f = e.i(399336),
        x = e.i(880809),
        g = e.i(196593),
        v = e.i(23128),
        y = e.i(525962),
        b = e.i(577103),
        k = e.i(604777);

    function w(e) {
        let a, i, n, s, l, c, d, u, m, p, h, x, g, w, S, j, C = (0, r.c)(39),
            {
                Trigger: _,
                openOrders: T
            } = e,
            M = (0, k.useTranslations)(),
            [N, I] = (0, o.useState)(!1);
        C[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], C[0] = a) : a = C[0];
        let {
            activeMarket: P
        } = (0, f.useEventActiveMarketContext)(a);
        C[1] !== P || C[2] !== T ? (i = {
            openOrders: T,
            market: P
        }, C[1] = P, C[2] = T, C[3] = i) : i = C[3];
        let E = (0, b.useCancelAllOpenOrders)(i);
        return C[4] !== _ ? (n = (0, t.jsx)(y.ModalTrigger, {
            asChild: !0,
            children: _
        }), C[4] = _, C[5] = n) : n = C[5], C[6] !== T.length || C[7] !== M ? (s = 1 === T.length ? M("orders.cancelOneOpenOrder") : M("orders.cancelNOpenOrders", {
            count: String(T.length)
        }), C[6] = T.length, C[7] = M, C[8] = s) : s = C[8], C[9] !== s ? (l = (0, t.jsx)(y.ModalTitle, {
            children: s
        }), C[9] = s, C[10] = l) : l = C[10], C[11] !== M ? (c = M("orders.cannotBeUndone"), C[11] = M, C[12] = c) : c = C[12], C[13] !== c ? (d = (0, t.jsx)(y.ModalDescription, {
            children: c
        }), C[13] = c, C[14] = d) : d = C[14], C[15] === Symbol.for("react.memo_cache_sentinel") ? (u = () => I(!1), C[15] = u) : u = C[15], C[16] !== M ? (m = M("auth.back"), C[16] = M, C[17] = m) : m = C[17], C[18] !== m ? (p = (0, t.jsx)(v.Button, {
            variant: "outline",
            onClick: u,
            children: m
        }), C[18] = m, C[19] = p) : p = C[19], C[20] !== E ? (h = () => {
            E(), I(!1)
        }, C[20] = E, C[21] = h) : h = C[21], C[22] !== T.length || C[23] !== M ? (x = 1 === T.length ? M("orders.cancelOneOrder") : M("orders.cancelNOrders", {
            count: String(T.length)
        }), C[22] = T.length, C[23] = M, C[24] = x) : x = C[24], C[25] !== h || C[26] !== x ? (g = (0, t.jsx)(v.Button, {
            variant: "destructive",
            onClick: h,
            children: x
        }), C[25] = h, C[26] = x, C[27] = g) : g = C[27], C[28] !== p || C[29] !== g ? (w = (0, t.jsxs)(y.ModalFooter, {
            children: [p, g]
        }), C[28] = p, C[29] = g, C[30] = w) : w = C[30], C[31] !== w || C[32] !== l || C[33] !== d ? (S = (0, t.jsxs)(y.ModalContent, {
            children: [l, d, w]
        }), C[31] = w, C[32] = l, C[33] = d, C[34] = S) : S = C[34], C[35] !== N || C[36] !== S || C[37] !== n ? (j = (0, t.jsxs)(y.Modal, {
            open: N,
            onOpenChange: I,
            size: "sm",
            children: [n, S]
        }), C[35] = N, C[36] = S, C[37] = n, C[38] = j) : j = C[38], j
    }

    function S(e) {
        e.stopPropagation()
    }
    e.s(["EventDetailCancelAllDialog", 0, w], 318121);
    let j = (0, n.cva)("mr-1 rounded-sm font-semibold text-xs py-1 px-2 relative inline-flex items-center cursor-pointer transition-[padding-right] duration-200 ease-in-out", {
        variants: {
            variant: {
                green: "bg-green-600/10 dark:bg-green-400/15 text-green-600 dark:text-green-400",
                red: "bg-red-500/10 text-red-500",
                yellow: "bg-yellow-600/10 text-yellow-700 dark:bg-yellow-500/10 dark:text-yellow-500",
                blue: "bg-brand-500/10 text-brand-500"
            }
        }
    });

    function C(e) {
        let a, i, n, s, o, l = (0, r.c)(10);
        return l[0] !== e ? ({
            className: a,
            variant: n,
            ...i
        } = e, l[0] = e, l[1] = a, l[2] = i, l[3] = n) : (a = l[1], i = l[2], n = l[3]), l[4] !== a || l[5] !== n ? (s = (0, h.cn)(j({
            variant: n
        }), a), l[4] = a, l[5] = n, l[6] = s) : s = l[6], l[7] !== i || l[8] !== s ? (o = (0, t.jsx)("span", {
            className: s,
            ...i
        }), l[7] = i, l[8] = s, l[9] = o) : o = l[9], o
    }

    function _(e) {
        let a, i, n = (0, r.c)(3),
            {
                variant: o
            } = e;
        n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
            green: "text-green-600 dark:text-green-400",
            red: "text-red-500",
            yellow: "text-yellow-700 dark:text-yellow-500",
            blue: "text-brand-500"
        }, n[0] = a) : a = n[0];
        let l = a[o] || "";
        return n[1] !== l ? (i = (0, t.jsx)(s.IconXmarkFill18, {
            className: l,
            size: 14
        }), n[1] = l, n[2] = i) : i = n[2], i
    }

    function T(e) {
        let i, n, s, o, c, u, m, p = (0, r.c)(30),
            {
                label: v,
                variant: y,
                positionAmount: b,
                positionOutcomeIdx: k,
                positionIsClosed: w,
                isPendingBuy: S,
                market: j
            } = e;
        p[0] === Symbol.for("react.memo_cache_sentinel") ? (i = ["setShares", "setOrderType", "setSelectedOutcomeIdx", "setSide", "setOrderExpiration", "setAmountUpdateLocation", "shares"], p[0] = i) : i = p[0];
        let {
            setShares: T,
            setOrderType: M,
            setSelectedOutcomeIdx: N,
            setSide: I,
            setOrderExpiration: P,
            setAmountUpdateLocation: E,
            shares: A
        } = (0, x.useTradeContext)(i), {
            setCashOutDialogOpen: O,
            canSell: D,
            canRedeem: L
        } = (0, d.useCashOutTxContext)();
        p[1] === Symbol.for("react.memo_cache_sentinel") ? (n = ["setActiveMarketFromSlug"], p[1] = n) : n = p[1];
        let {
            setActiveMarketFromSlug: z
        } = (0, f.useEventActiveMarketContext)(n), R = (D || L) && !S;
        p[2] !== R || p[3] !== j || p[4] !== b || p[5] !== w || p[6] !== k || p[7] !== z || p[8] !== E || p[9] !== O || p[10] !== P || p[11] !== M || p[12] !== N || p[13] !== T || p[14] !== I || p[15] !== A ? (s = e => {
            if (R) {
                if (e.preventDefault(), e.stopPropagation(), z(j.slug), !w) {
                    let e = (0, g.formatNoRound)(parseFloat(b));
                    e !== A && (T(e), E("click")), N(k), P(void 0), M(l.OrderType.Market), I(a.Side.SELL)
                }
                O(!0)
            }
        }, p[2] = R, p[3] = j, p[4] = b, p[5] = w, p[6] = k, p[7] = z, p[8] = E, p[9] = O, p[10] = P, p[11] = M, p[12] = N, p[13] = T, p[14] = I, p[15] = A, p[16] = s) : s = p[16];
        let F = s,
            $ = R ? "hover:pr-6" : "cursor-default";
        return p[17] !== $ ? (o = (0, h.cn)("group/position-chip", $), p[17] = $, p[18] = o) : o = p[18], p[19] !== v ? (c = (0, t.jsx)("span", {
            className: "z-1",
            children: v
        }), p[19] = v, p[20] = c) : c = p[20], p[21] !== F || p[22] !== R || p[23] !== y ? (u = R ? (0, t.jsx)("button", {
            type: "button",
            className: (0, h.cn)("flex items-center justify-center absolute right-0 h-full px-1 cursor-pointer transition-opacity duration-200 ease-in-out", "opacity-0 hover:bg-black/5 hover:rounded hover:rounded-l-none", "group-hover/position-chip:opacity-100 group-hover/position-chip:delay-100"),
            onClick: F,
            children: (0, t.jsx)(_, {
                variant: y
            })
        }) : null, p[21] = F, p[22] = R, p[23] = y, p[24] = u) : u = p[24], p[25] !== o || p[26] !== c || p[27] !== u || p[28] !== y ? (m = (0, t.jsxs)(C, {
            variant: y,
            className: o,
            children: [c, u]
        }), p[25] = o, p[26] = c, p[27] = u, p[28] = y, p[29] = m) : m = p[29], m
    }

    function M(e) {
        let n, s, o, c, d, p = (0, r.c)(21),
            {
                label: x,
                variant: g,
                positionAmount: v,
                positionOutcomeIdx: y,
                isPendingBuy: b,
                market: k
            } = e,
            {
                setTradeState: w
            } = (0, u.useMobileTradeContext)();
        p[0] === Symbol.for("react.memo_cache_sentinel") ? (n = ["setActiveMarketFromSlug"], p[0] = n) : n = p[0];
        let {
            setActiveMarketFromSlug: S
        } = (0, f.useEventActiveMarketContext)(n), j = (0, m.usePermissions)();
        e: {
            if (k.clobTokenIds && k.orderPriceMinTickSize) {
                let e;
                p[1] !== k.clobTokenIds || p[2] !== k.orderPriceMinTickSize ? (e = {
                    clobTokenIds: k.clobTokenIds,
                    orderPriceMinTickSize: k.orderPriceMinTickSize
                }, p[1] = k.clobTokenIds, p[2] = k.orderPriceMinTickSize, p[3] = e) : e = p[3], s = e;
                break e
            }
            s = void 0
        }
        let _ = s,
            T = (0, i.useGetBestPrice)();
        p[4] !== _ || p[5] !== T || p[6] !== b || p[7] !== k.slug || p[8] !== j || p[9] !== v || p[10] !== y || p[11] !== S || p[12] !== w ? (o = e => {
            if (b || !w || !j.canSell && !j.canRedeem) return;
            e.preventDefault(), e.stopPropagation(), S(k.slug);
            let t = T(_, y, "bid");
            w({
                type: "redeem",
                outcomeIdx: y,
                open: !0,
                orderType: l.OrderType.Market,
                side: a.Side.SELL,
                ...t && {
                    price: t
                },
                shares: v
            })
        }, p[4] = _, p[5] = T, p[6] = b, p[7] = k.slug, p[8] = j, p[9] = v, p[10] = y, p[11] = S, p[12] = w, p[13] = o) : o = p[13];
        let M = o,
            N = b && "cursor-default";
        return p[14] !== N ? (c = (0, h.cn)(N), p[14] = N, p[15] = c) : c = p[15], p[16] !== M || p[17] !== x || p[18] !== c || p[19] !== g ? (d = (0, t.jsx)(C, {
            onClick: M,
            variant: g,
            className: c,
            children: x
        }), p[16] = M, p[17] = x, p[18] = c, p[19] = g, p[20] = d) : d = p[20], d
    }

    function N(e) {
        let a, i, n, s, o, l = (0, r.c)(16),
            {
                openOrdersCount: d,
                market: u
            } = e,
            {
                userOpenOrders: m
            } = (0, c.default)();
        e: {
            let e;
            if (!u) {
                let e;
                l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = [], l[0] = e) : e = l[0], a = e;
                break e
            }
            if (l[1] !== u || l[2] !== m) {
                let t, r;
                l[4] !== u ? (t = e => e.market.toLowerCase() === u.conditionId.toLowerCase(), l[4] = u, l[5] = t) : t = l[5], l[6] !== u ? (r = e => ({ ...e,
                    associatedMarket: u
                }), l[6] = u, l[7] = r) : r = l[7], e = m.filter(t).map(r), l[1] = u, l[2] = m, l[3] = e
            } else e = l[3];a = e
        }
        let p = a,
            f = `${d} open order${d>1?"s":""}`;
        return l[8] !== f ? (i = (0, t.jsx)("span", {
            className: "z-1",
            children: f
        }), l[8] = f, l[9] = i) : i = l[9], l[10] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)("span", {
            className: (0, h.cn)("flex items-center justify-center absolute right-0 h-full px-1 cursor-pointer transition-opacity duration-200 ease-in-out", "opacity-0 hover:bg-black/5 hover:rounded hover:rounded-l-none", "group-hover/position-chip:opacity-100 group-hover/position-chip:delay-100"),
            children: (0, t.jsx)(_, {
                variant: "yellow"
            })
        }), l[10] = n) : n = l[10], l[11] !== i ? (s = (0, t.jsxs)(C, {
            variant: "yellow",
            className: "group/position-chip hover:pr-6",
            onClick: S,
            children: [i, n]
        }), l[11] = i, l[12] = s) : s = l[12], l[13] !== p || l[14] !== s ? (o = (0, t.jsx)(w, {
            openOrders: p,
            Trigger: s
        }), l[13] = p, l[14] = s, l[15] = o) : o = l[15], o
    }

    function I(e) {
        return (0, t.jsxs)(o.default.Fragment, {
            children: [(0, t.jsx)(p.Media, {
                lessThan: "lg",
                children: (0, t.jsx)(M, { ...e
                })
            }), (0, t.jsx)(p.Media, {
                greaterThanOrEqual: "lg",
                children: (0, t.jsx)(T, { ...e
                })
            })]
        }, `${e.market.slug}:${e.positionOutcomeIdx}:${e.isPendingBuy?"pending-buy":"pos"}`)
    }

    function P(e, t) {
        return Number(e.positionOutcomeIdx) - Number(t.positionOutcomeIdx)
    }

    function E(e, t) {
        return Number(e.outcomeIndex) - Number(t.outcomeIndex)
    }
    let A = function(e) {
        let a, i, n, s, o = (0, r.c)(19),
            {
                portfolioPositions: l,
                openOrdersCount: c,
                isNeutral: d,
                shouldShowGroupItemTitle: u,
                shouldAbbreviate: m,
                event: h,
                market: f
            } = e;
        if (o[0] !== h ? .markets || o[1] !== d || o[2] !== l || o[3] !== m || o[4] !== u) {
            let e, t = [...l].sort(E);
            o[6] !== h ? .markets || o[7] !== d || o[8] !== m || o[9] !== u ? (e = e => {
                let t = u ? e.groupItemTitle : e.outcome,
                    r = `${m?t.slice(0,3):t} ${(0,g.numberStringForPositionAmount)(e.qty)} \xb7 ${(0,g.showCentsOnly)(e.priceAvg,3,!0)}\xa2`,
                    a = 0 === e.outcomeIndex || "0" === e.outcomeIndex.toString(),
                    i = d ? "blue" : a ? "green" : "red",
                    n = h ? .markets.find(t => t.slug === e.market);
                return {
                    label: r,
                    variant: i,
                    positionOutcome: t,
                    positionAmount: e.qty,
                    positionOutcomeIdx: e.outcomeIndex,
                    positionIsClosed: e.isClosed,
                    isPendingBuy: !1,
                    market: {
                        slug: e.slug,
                        clobTokenIds: n ? .clobTokenIds,
                        outcomes: n ? .outcomes,
                        orderPriceMinTickSize: n ? .orderPriceMinTickSize
                    }
                }
            }, o[6] = h ? .markets, o[7] = d, o[8] = m, o[9] = u, o[10] = e) : e = o[10], a = [...t.map(e)].sort(P), o[0] = h ? .markets, o[1] = d, o[2] = l, o[3] = m, o[4] = u, o[5] = a
        } else a = o[5];
        let x = a;
        return x.length || 0 !== c ? (o[11] !== f || o[12] !== c ? (i = c > 0 ? (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(p.Media, {
                lessThan: "lg",
                children: (0, t.jsx)(C, {
                    variant: "yellow",
                    children: `${c} open order${c>1?"s":""}`
                })
            }), (0, t.jsx)(p.Media, {
                greaterThanOrEqual: "lg",
                children: (0, t.jsx)(N, {
                    openOrdersCount: c,
                    market: f
                })
            })]
        }) : null, o[11] = f, o[12] = c, o[13] = i) : i = o[13], o[14] !== x ? (n = x.map(I), o[14] = x, o[15] = n) : n = o[15], o[16] !== i || o[17] !== n ? (s = (0, t.jsxs)(t.Fragment, {
            children: [i, n]
        }), o[16] = i, o[17] = n, o[18] = s) : s = o[18], s) : null
    }
}, 131262, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340),
        a = e.i(130278),
        i = e.i(112130),
        n = e.i(236316),
        s = e.i(463621),
        o = e.i(478088),
        l = e.i(912504),
        c = e.i(675702),
        d = e.i(578740),
        u = e.i(936404),
        m = e.i(986179),
        p = e.i(562806),
        h = e.i(987222),
        f = e.i(631222);
    e.i(512186);
    let x = e => Array.isArray(e) ? e.findIndex(e => "1.00" === Number.parseFloat(e).toFixed(2)) : -1;
    var g = e.i(660006),
        v = e.i(53950),
        y = e.i(866192);
    let b = (e, v, b) => {
        let w, S, j, C, _, T, M, N = (0, t.c)(31);
        N[0] !== e ? .conditionId ? (w = e ? .conditionId ? .toLowerCase(), N[0] = e ? .conditionId, N[1] = w) : w = N[1];
        let I = w;
        if (N[2] !== e) S = !!e ? .slug && (0, h.isUpDownSlug)(e.slug) && (0, p.isCryptoMarketSlug)(e.slug) && !(0, h.matchesDailyUpDown)(e.slug), N[2] = e, N[3] = S;
        else S = N[3];
        let P = S,
            E = b ? .enableNonAutoChainFallback ? ? !1;
        if (N[4] !== e) j = e ? .ssrFinalResolution ? ? null, N[4] = e, N[5] = j;
        else j = N[5];
        let A = j,
            O = A ? .source === "chain" ? A.outcomePrices : null,
            D = (0, y.findWinningIndex)(e),
            L = !!e && (void 0 === v || v) && "string" == typeof I && (P || E);
        N[6] !== e ? (C = e ? .endDate && !Number.isNaN(new Date(e.endDate).getTime()) ? new Date(e.endDate).getTime() : null, N[6] = e, N[7] = C) : C = N[7];
        let z = C,
            {
                hasEnded: R
            } = (0, d.useMarketEnd)(z, L),
            {
                payoutsFromChain: F,
                payoutsFromChainUpdatedAt: $,
                refetchPayoutsFromChain: B,
                isPayoutsFromChainLoading: q,
                isPayoutsFromChainPending: V,
                isPayoutsFromChainFetching: H,
                isPayoutsFromChainErroring: U
            } = ((e, d) => {
                let p, h, x, v, y, b, w, S, j, C, _, T, M, N, I, P = (0, t.c)(41),
                    E = void 0 === d || d;
                P[0] !== e ? (p = e ? .toLowerCase() ? ? "", P[0] = e, P[1] = p) : p = P[1];
                let A = p;
                P[2] === Symbol.for("react.memo_cache_sentinel") ? (h = BigInt(0), P[2] = h) : h = P[2], P[3] !== A ? (x = {
                    address: f.CONDITIONAL_TOKENS_ADDRESS,
                    abi: c.ConditionalTokensAbi,
                    functionName: "payoutNumerators",
                    chainId: 137,
                    args: [A, h]
                }, P[3] = A, P[4] = x) : x = P[4], P[5] === Symbol.for("react.memo_cache_sentinel") ? (v = BigInt(1), P[5] = v) : v = P[5], P[6] !== A ? (y = {
                    address: f.CONDITIONAL_TOKENS_ADDRESS,
                    abi: c.ConditionalTokensAbi,
                    functionName: "payoutNumerators",
                    chainId: 137,
                    args: [A, v]
                }, P[6] = A, P[7] = y) : y = P[7], P[8] !== x || P[9] !== y ? (b = [x, y], P[8] = x, P[9] = y, P[10] = b) : b = P[10];
                let O = E && !!A;
                P[11] !== O ? (w = {
                    enabled: O,
                    gcTime: 3e5,
                    staleTime: 15e3
                }, P[11] = O, P[12] = w) : w = P[12], P[13] !== b || P[14] !== w ? (S = {
                    contracts: b,
                    query: w
                }, P[13] = b, P[14] = w, P[15] = S) : S = P[15];
                let {
                    data: D,
                    dataUpdatedAt: L,
                    refetch: z,
                    isLoading: R,
                    isPending: F,
                    isFetching: $,
                    isError: B,
                    error: q
                } = (0, a.useReadContracts)(S);
                P[16] !== e || P[17] !== q || P[18] !== B ? (j = () => {
                    B && q && (0, g.handleError)(q, "useChainPayouts", e)
                }, P[16] = e, P[17] = q, P[18] = B, P[19] = j) : j = P[19], P[20] !== q || P[21] !== B ? (C = [B, q], P[20] = q, P[21] = B, P[22] = C) : C = P[22], r.default.useEffect(j, C), P[23] !== D ? (_ = (e => {
                    if (!e || !Array.isArray(e) || e.some(e => "bigint" != typeof e) || 2 !== e.length) return ["0", "0"];
                    let [t, r] = e, a = (0, m.parseEther)("1");
                    if (t > 1 n && r > 1 n) {
                        let e = (0, u.formatEther)(a - t);
                        return [(0, u.formatEther)(t).toString(), e.toString()]
                    }
                    return 1 n === t && 1 n === r ? ["0.5", "0.5"] : e.map(e => e === a ? (0, u.formatEther)(e).toString() : e.toString())
                })(D ? .map(k)), P[23] = D, P[24] = _) : _ = P[24];
                let V = _;
                P[25] !== A ? (T = A ? {
                    conditionId: A
                } : void 0, P[25] = A, P[26] = T) : T = P[26];
                let H = E && !!A;
                return P[27] !== z ? (M = e => {
                    e.length > 0 && z()
                }, P[27] = z, P[28] = M) : M = P[28], P[29] !== T || P[30] !== H || P[31] !== M ? (N = {
                    address: f.CONDITIONAL_TOKENS_ADDRESS,
                    abi: c.ConditionalTokensAbi,
                    chainId: 137,
                    eventName: "ConditionResolution",
                    args: T,
                    enabled: H,
                    batch: !1,
                    poll: !0,
                    pollingInterval: 1e3,
                    onLogs: M
                }, P[29] = T, P[30] = H, P[31] = M, P[32] = N) : N = P[32], ! function(e = {}) {
                    let {
                        enabled: t = !0,
                        onLogs: a,
                        config: c,
                        ...d
                    } = e, u = (0, l.useConfig)(e), m = (0, o.useChainId)({
                        config: u
                    }), p = e.chainId ? ? m, h = (0, r.useRef)(a), f = (0, r.useRef)(d.onError);
                    h.current = a, f.current = d.onError;
                    let x = (0, r.useRef)(d.abi),
                        g = (0, r.useRef)(d.address),
                        v = (0, r.useRef)(d.args);
                    x.current && (0, i.deepEqual)(x.current, d.abi) || (x.current = d.abi), g.current && (0, i.deepEqual)(g.current, d.address) || (g.current = d.address), v.current && (0, i.deepEqual)(v.current, d.args) || (v.current = d.args), (0, r.useEffect)(() => {
                        if (t && h.current) return function(e, t) {
                            let r, a, {
                                    syncConnectedChain: i = e._internal.syncConnectedChain,
                                    ...o
                                } = t,
                                l = t => {
                                    r && r();
                                    let a = e.getClient({
                                        chainId: t
                                    });
                                    return r = (0, s.getAction)(a, n.watchContractEvent, "watchContractEvent")(o)
                                },
                                c = l(t.chainId);
                            return i && !t.chainId && (a = e.subscribe(({
                                chainId: e
                            }) => e, async e => l(e))), () => {
                                c ? .(), a ? .()
                            }
                        }(u, { ...d,
                            chainId: p,
                            onLogs: e => h.current ? .(e),
                            onError: e => f.current ? .(e)
                        })
                    }, [p, u, t, x.current, g.current, v.current, d.batch, d.eventName, d.fromBlock, d.poll, d.pollingInterval, d.strict, d.syncConnectedChain])
                }(N), P[33] !== L || P[34] !== V || P[35] !== B || P[36] !== $ || P[37] !== R || P[38] !== F || P[39] !== z ? (I = {
                    payoutsFromChain: V,
                    payoutsFromChainUpdatedAt: L,
                    refetchPayoutsFromChain: z,
                    isPayoutsFromChainLoading: R,
                    isPayoutsFromChainPending: F,
                    isPayoutsFromChainFetching: $,
                    isPayoutsFromChainErroring: B
                }, P[33] = L, P[34] = V, P[35] = B, P[36] = $, P[37] = R, P[38] = F, P[39] = z, P[40] = I) : I = P[40], I
            })(e ? .conditionId, L),
            W = x(F) > -1 ? F : O ? ? F;
        N[8] !== W || N[9] !== e ? (_ = e ? { ...e,
            outcomePrices: W
        } : void 0, N[8] = W, N[9] = e, N[10] = _) : _ = N[10];
        let G = _,
            Z = x(W),
            K = Z > -1 ? "chain" : !P && D > -1 ? "gamma" : null,
            Y = "chain" === K ? G : e;
        N[11] !== Y ? .outcomePrices ? (T = Y ? .outcomePrices ? ? ["0", "0"], N[11] = Y ? .outcomePrices, N[12] = T) : T = N[12];
        let Q = T,
            X = "chain" === K ? Z : D,
            J = null !== K ? "resolved" : P && R ? "determining" : "trading",
            ee = X > -1 && e ? .outcomes ? e.outcomes[X] ? ? null : null;
        return N[13] !== Z || N[14] !== D || N[15] !== R || N[16] !== P || N[17] !== U || N[18] !== H || N[19] !== q || N[20] !== V || N[21] !== Q || N[22] !== Y || N[23] !== F || N[24] !== $ || N[25] !== B || N[26] !== J || N[27] !== K || N[28] !== X || N[29] !== ee ? (M = {
            isAutoResolvingMarket: P,
            hasEnded: R,
            resolutionPhase: J,
            latestResolvedMarket: Y,
            latestOutcomePrices: Q,
            resolutionSource: K,
            winnerIndex: X,
            winnerOutcome: ee,
            gammaWinnerIndex: D,
            chainWinnerIndex: Z,
            payoutsFromChain: F,
            payoutsFromChainUpdatedAt: $,
            refetchPayoutsFromChain: B,
            isPayoutsFromChainLoading: q,
            isPayoutsFromChainPending: V,
            isPayoutsFromChainFetching: H,
            isPayoutsFromChainErroring: U
        }, N[13] = Z, N[14] = D, N[15] = R, N[16] = P, N[17] = U, N[18] = H, N[19] = q, N[20] = V, N[21] = Q, N[22] = Y, N[23] = F, N[24] = $, N[25] = B, N[26] = J, N[27] = K, N[28] = X, N[29] = ee, N[30] = M) : M = N[30], M
    };

    function k(e) {
        return "failure" === e.status ? 0 n : e.result || 0 n
    }

    function w() {
        return null
    }
    e.s(["useHandlePayouts", 0, (e, a) => {
        let i, n, s, o, l, c, d, u, m, p = (0, t.c)(39),
            h = void 0 === a || a;
        p[0] !== e ? .conditionId ? (i = e ? .conditionId ? .toLowerCase(), p[0] = e ? .conditionId, p[1] = i) : i = p[1];
        let f = i,
            x = (0, y.findWinningIndex)(e),
            g = r.default.useRef(void 0),
            k = r.default.useRef(0),
            S = !!e && h && "string" == typeof f && x < 0;
        p[2] !== S ? (n = {
            enableNonAutoChainFallback: S
        }, p[2] = S, p[3] = n) : n = p[3];
        let {
            isAutoResolvingMarket: j,
            resolutionPhase: C,
            latestResolvedMarket: _,
            latestOutcomePrices: T,
            resolutionSource: M,
            gammaWinnerIndex: N,
            chainWinnerIndex: I,
            payoutsFromChain: P,
            payoutsFromChainUpdatedAt: E,
            refetchPayoutsFromChain: A,
            isPayoutsFromChainLoading: O,
            isPayoutsFromChainPending: D,
            isPayoutsFromChainFetching: L,
            isPayoutsFromChainErroring: z
        } = b(e, h, n), R = !!e && h && "string" == typeof f;
        if (p[4] !== f ? (s = () => {
                g.current && f && g.current !== f && (k.current = Date.now()), g.current = f
            }, o = [f], p[4] = f, p[5] = s, p[6] = o) : (s = p[5], o = p[6]), r.default.useEffect(s, o), p[7] !== R || p[8] !== I || p[9] !== N || p[10] !== z || p[11] !== L || p[12] !== D || p[13] !== e || p[14] !== P || p[15] !== E ? (l = () => {
                !e || !R || L || D || z || E < k.current || N < 0 || I < 0 || N !== I && v.logger.info("[useHandlePayouts] Gamma and on-chain resolution disagree", {
                    conditionId: e.conditionId,
                    slug: e.slug,
                    gammaOutcomePrices: e.outcomePrices,
                    chainOutcomePrices: P,
                    gammaWinnerIndex: N,
                    chainWinnerIndex: I,
                    gammaWinnerOutcome: e.outcomes[N],
                    chainWinnerOutcome: e.outcomes[I]
                })
            }, c = [e, R, N, I, P, E, L, D, z], p[7] = R, p[8] = I, p[9] = N, p[10] = z, p[11] = L, p[12] = D, p[13] = e, p[14] = P, p[15] = E, p[16] = l, p[17] = c) : (l = p[16], c = p[17]), r.default.useEffect(l, c), !e) {
            let e;
            return p[18] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                payouts: ["0", "0"],
                payoutsString: "",
                refetchPayoutsFromChain: w,
                isPayoutsFromChainLoading: !1,
                isPayoutsFromChainPending: !1,
                isPayoutsFromChainFetching: !1,
                isPayoutsFromChainErroring: !1
            }, p[18] = e) : e = p[18], e
        }
        if (j && "determining" === C) {
            let e;
            p[19] === Symbol.for("react.memo_cache_sentinel") ? (e = ["0", "0"], p[19] = e) : e = p[19], d = e, u = "Loading"
        } else if (M && _) {
            let e;
            d = T, p[20] !== _ ? (e = (0, y.getResolutionNameWithoutValue)(_, 2), p[20] = _, p[21] = e) : e = p[21], u = e
        } else if (S && (L || D)) {
            let e;
            p[22] === Symbol.for("react.memo_cache_sentinel") ? (e = ["0", "0"], p[22] = e) : e = p[22], d = e, u = "Loading"
        } else {
            let t, r;
            d = T, p[23] !== T || p[24] !== _ || p[25] !== e ? (t = _ ? ? { ...e,
                outcomePrices: T
            }, p[23] = T, p[24] = _, p[25] = e, p[26] = t) : t = p[26], p[27] !== t ? (r = (0, y.displayOutcomeString)(t, 2), p[27] = t, p[28] = r) : r = p[28], u = r
        }
        return p[29] !== z || p[30] !== L || p[31] !== O || p[32] !== D || p[33] !== d || p[34] !== u || p[35] !== A || p[36] !== C || p[37] !== M ? (m = {
            payouts: d,
            payoutsString: u,
            resolutionPhase: C,
            resolutionSource: M,
            refetchPayoutsFromChain: A,
            isPayoutsFromChainLoading: O,
            isPayoutsFromChainPending: D,
            isPayoutsFromChainFetching: L,
            isPayoutsFromChainErroring: z
        }, p[29] = z, p[30] = L, p[31] = O, p[32] = D, p[33] = d, p[34] = u, p[35] = A, p[36] = C, p[37] = M, p[38] = m) : m = p[38], m
    }, "useLatestFinalResolution", 0, b], 131262)
}, 494888, 724210, 29438, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(11408),
        i = e.i(831089),
        n = e.i(131262),
        s = e.i(227865);
    e.s(["EventDetailPayouts", 0, () => {
        let e, o, l, c, d, u = (0, r.c)(11);
        u[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["market"], u[0] = e) : e = u[0];
        let {
            market: m
        } = (0, s.useEventDetailTabContext)(e), {
            payoutsString: p
        } = (0, n.useHandlePayouts)(m), h = p || "-";
        return u[1] !== h ? (o = (0, t.jsx)("p", {
            className: "font-medium text-text text-right whitespace-nowrap text-base",
            children: h
        }), u[1] = h, u[2] = o) : o = u[2], u[3] !== p ? (l = "yes" === p.toLowerCase() && (0, t.jsx)("div", {
            className: "text-green-600 dark:text-green-500",
            children: (0, t.jsx)(a.IconCircleCheckFill18, {})
        }), u[3] = p, u[4] = l) : l = u[4], u[5] !== p ? (c = "no" === p.toLowerCase() && (0, t.jsx)("div", {
            className: "text-red-500",
            children: (0, t.jsx)(i.IconCircleXmarkFill18, {})
        }), u[5] = p, u[6] = c) : c = u[6], u[7] !== o || u[8] !== l || u[9] !== c ? (d = (0, t.jsxs)(t.Fragment, {
            children: [o, l, c]
        }), u[7] = o, u[8] = l, u[9] = c, u[10] = d) : d = u[10], d
    }], 494888);
    var o = e.i(23128),
        l = e.i(604777),
        c = e.i(870555);
    e.s(["default", 0, e => {
        let a, i, n, s, d, u, m, p = (0, r.c)(15),
            h = (0, l.useTranslations)();
        return p[0] !== e ? ({
            onClick: i,
            className: a,
            ...n
        } = e, p[0] = e, p[1] = a, p[2] = i, p[3] = n) : (a = p[1], i = p[2], n = p[3]), p[4] !== a ? (s = (0, c.cn)("hover:bg-brand-500/10 px-2 h-6 z-10", a), p[4] = a, p[5] = s) : s = p[5], p[6] !== h ? (d = h("events.resolution.inReview"), p[6] = h, p[7] = d) : d = p[7], p[8] !== d ? (u = (0, t.jsx)("p", {
            className: "text-text-brand font-semibold whitespace-nowrap text-xs",
            children: d
        }), p[8] = d, p[9] = u) : u = p[9], p[10] !== i || p[11] !== n || p[12] !== s || p[13] !== u ? (m = (0, t.jsx)(o.Button, {
            variant: "ghost",
            size: "sm",
            onClick: i,
            className: s,
            ...n,
            children: u
        }), p[10] = i, p[11] = n, p[12] = s, p[13] = u, p[14] = m) : m = p[14], m
    }], 724210);
    var d = e.i(723823),
        u = e.i(491636),
        m = e.i(390960),
        p = e.i(204996),
        h = e.i(184612),
        f = e.i(416340),
        x = e.i(100825),
        g = e.i(635868),
        v = e.i(289981),
        y = e.i(593332),
        b = e.i(864006),
        k = e.i(399336),
        w = e.i(880809),
        S = e.i(196593),
        j = e.i(156591),
        C = e.i(206617),
        _ = e.i(935786);
    let T = {
        blackOnGray: "bg-(--color-neutral-100) text-(--color-text-primary)",
        grayOnGray: "bg-(--color-neutral-50) text-(--color-text-secondary)",
        blue: "bg-(--color-bg-brand) text-white",
        black: "bg-(--color-neutral-0) text-(--color-background)"
    };

    function M(e) {
        let a, i, n = (0, r.c)(4),
            {
                className: s
            } = e;
        return n[0] !== s ? (a = (0, c.cn)("w-full h-[18px] bg-(--color-neutral-100) rounded", s), n[0] = s, n[1] = a) : a = n[1], n[2] !== a ? (i = (0, t.jsx)("div", {
            className: a
        }), n[2] = a, n[3] = i) : i = n[3], i
    }

    function N(e) {
        let a, i, n = (0, r.c)(6),
            {
                color: s,
                className: o,
                children: l
            } = e,
            d = T[void 0 === s ? "grayOnGray" : s];
        return n[0] !== o || n[1] !== d ? (a = (0, c.cn)("flex text-xs font-medium p-1 rounded justify-center items-center", d, o), n[0] = o, n[1] = d, n[2] = a) : a = n[2], n[3] !== l || n[4] !== a ? (i = (0, t.jsx)("div", {
            className: a,
            children: l
        }), n[3] = l, n[4] = a, n[5] = i) : i = n[5], i
    }
    let I = e => {
            let a, i, n, s, o, c, d, u, m = (0, r.c)(24),
                {
                    teamZero: p,
                    volume: h,
                    formattedDate: f
                } = e,
                x = (0, l.useTranslations)(),
                g = y.GameState.NotStarted;
            return m[0] !== p ? (a = !p && (0, t.jsx)(M, {
                className: "w-[60px]"
            }), m[0] = p, m[1] = a) : a = m[1], m[2] !== f || m[3] !== p ? (i = p && g === y.GameState.NotStarted ? (0, t.jsx)(N, {
                color: "blackOnGray",
                children: f
            }) : null, m[2] = f, m[3] = p, m[4] = i) : i = m[4], m[5] !== x || m[6] !== p ? (n = p && g === y.GameState.Live ? (0, t.jsxs)("div", {
                className: "flex items-center",
                children: [(0, t.jsx)("p", {
                    className: "font-bold text-[11px] tracking-[2px] text-[#FF5842] uppercase",
                    children: x("cards.live")
                }), (0, t.jsx)("div", {
                    className: "w-2 h-2 rounded-full bg-[#FF5842] mx-2"
                }), p.elapsed ? (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)("p", {
                        className: "font-bold text-[11px] tracking-[2px] text-[#FF5842] mx-[3px]",
                        children: "-"
                    }), (0, t.jsx)("p", {
                        className: "font-bold text-[11px] tracking-[2px] text-[#FF5842]",
                        children: p.elapsed
                    })]
                }) : null]
            }) : null, m[5] = x, m[6] = p, m[7] = n) : n = m[7], m[8] !== x || m[9] !== p ? (s = p && g === y.GameState.Finished ? (0, t.jsx)(N, {
                color: "black",
                className: "py-[3px] px-1.5",
                children: x("sports.final")
            }) : null, m[8] = x, m[9] = p, m[10] = s) : s = m[10], m[11] !== h ? (o = (0, S.formatCurrency)(h, {
                decimals: 0
            }), m[11] = h, m[12] = o) : o = m[12], m[13] !== x ? (c = x("events.headerMeta.volume"), m[13] = x, m[14] = c) : c = m[14], m[15] !== o || m[16] !== c ? (d = (0, t.jsxs)("p", {
                className: "ml-4 text-xs whitespace-nowrap text-neutral-500",
                children: [o, " ", c]
            }), m[15] = o, m[16] = c, m[17] = d) : d = m[17], m[18] !== a || m[19] !== i || m[20] !== n || m[21] !== s || m[22] !== d ? (u = (0, t.jsxs)("div", {
                className: "flex items-center mb-4 w-full h-[22px] lg:justify-start max-lg:justify-between",
                children: [a, i, n, s, d]
            }), m[18] = a, m[19] = i, m[20] = n, m[21] = s, m[22] = d, m[23] = u) : u = m[23], u
        },
        P = e => {
            let a, i, n, s, o, l, d, u, m = (0, r.c)(24),
                {
                    team: x,
                    isWinner: g,
                    idx: v
                } = e,
                b = y.GameState.NotStarted,
                k = x && "string" == typeof x.logo ? x.logo : void 0,
                [w, S] = f.default.useState(!1);
            m[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => {
                S(!1)
            }, m[0] = a) : a = m[0], m[1] !== k ? (i = [k], m[1] = k, m[2] = i) : i = m[2], f.default.useEffect(a, i);
            let j = x ? `${x.name} ${x.score}` : `skeleton-${v}`,
                C = 0 === v ? "mb-1" : "mb-0";
            if (m[3] !== C ? (n = (0, c.cn)("flex items-center justify-start text-(--color-text-primary)", C), m[3] = C, m[4] = n) : n = m[4], m[5] !== g || m[6] !== x) s = (0, t.jsx)("div", {
                className: "flex mr-1 w-8",
                children: x ? (0, t.jsx)(N, {
                    color: b === y.GameState.Live ? "blackOnGray" : b === y.GameState.Finished && g ? "blue" : "grayOnGray",
                    className: "w-full",
                    children: b === y.GameState.NotStarted ? "--" : x.score
                }) : (0, t.jsx)(M, {
                    className: "w-full"
                })
            }), m[5] = g, m[6] = x, m[7] = s;
            else s = m[7];
            return m[8] !== w || m[9] !== k || m[10] !== x ? (o = x ? k ? (0, t.jsx)("div", {
                className: "flex w-6 mr-2",
                children: w ? null : (0, t.jsx)(h.default, {
                    src: k,
                    alt: "",
                    width: 24,
                    height: 24,
                    onError: () => S(!0)
                })
            }) : null : (0, t.jsx)("div", {
                className: "flex w-6 mr-2",
                children: (0, t.jsx)(M, {
                    className: "w-full"
                })
            }), m[8] = w, m[9] = k, m[10] = x, m[11] = o) : o = m[11], m[12] !== g || m[13] !== x ? (l = (0, t.jsx)("div", {
                className: "flex mr-2",
                children: x ? (0, t.jsxs)("p", {
                    className: (0, c.cn)("font-bold text-sm", b !== y.GameState.Finished || g ? "text-(--color-text-primary)" : "text-(--color-text-secondary)"),
                    children: [x.abbreviation && (0, t.jsx)("span", {
                        className: "hidden min-[1023px]:inline min-[1221px]:hidden",
                        children: (0, p.upperCase)(x.abbreviation)
                    }), (0, t.jsx)("span", {
                        className: x.abbreviation ? "min-[1023px]:hidden min-[1221px]:inline" : "",
                        children: x.alias ? ? x.name
                    })]
                }) : (0, t.jsx)(M, {
                    className: "w-full"
                })
            }), m[12] = g, m[13] = x, m[14] = l) : l = m[14], m[15] !== x ? (d = (0, t.jsx)("div", {
                className: "flex min-w-5 min-[1023px]:hidden min-[1051px]:flex",
                children: x ? (0, t.jsx)("p", {
                    className: "text-xs text-(--color-text-secondary) font-medium",
                    children: x.record
                }) : (0, t.jsx)(M, {
                    className: "w-full"
                })
            }), m[15] = x, m[16] = d) : d = m[16], m[17] !== j || m[18] !== n || m[19] !== s || m[20] !== o || m[21] !== l || m[22] !== d ? (u = (0, t.jsxs)("div", {
                className: n,
                children: [s, o, l, d]
            }, j), m[17] = j, m[18] = n, m[19] = s, m[20] = o, m[21] = l, m[22] = d, m[23] = u) : u = m[23], u
        },
        E = ["result"],
        A = e => {
            let a, i, n, s, l, u, m = (0, r.c)(13),
                {
                    isNegRisk: p,
                    market: h,
                    handleOutcomeClick: f
                } = e;
            m[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], m[0] = a) : a = m[0];
            let {
                activeMarket: x
            } = (0, k.useEventActiveMarketContext)(a);
            m[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["isBookRefreshing"], m[1] = i) : i = m[1];
            let {
                isBookRefreshing: v
            } = (0, g.useBookContext)(i);
            m[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["selectedOutcome", "side"], m[2] = n) : n = m[2];
            let {
                selectedOutcome: y,
                side: b
            } = (0, w.useTradeContext)(n), C = (0, j.getPrecisionFromTickSize)(h ? .orderPriceMinTickSize), T = (0, d.useMarketBestPrices)(h), M = `sm-${h.id}`;
            m[3] !== p || m[4] !== h.groupItemTitle ? (s = p ? (0, t.jsx)("p", {
                className: "mb-2 text-sm font-semibold tracking-[0.15px]",
                children: h.groupItemTitle
            }) : null, m[3] = p, m[4] = h.groupItemTitle, m[5] = s) : s = m[5];
            let N = h.outcomes.map((e, r) => {
                let a = h.slug === x.slug && e === y,
                    i = T ? .[0 === r ? "~zero" : "~one"] ? .[b ? .toLowerCase()],
                    n = h.outcomePrices[r],
                    s = i || n,
                    l = (0, S.showPaddedCentsOnly)(s, C);
                return (0, t.jsx)(o.Button, {
                    onClick: e => {
                        e.preventDefault(), e.stopPropagation(), f(r, l, h.id)
                    },
                    className: (0, c.cn)("flex place-content-center gap-x-1 py-4 px-0 rounded-[5px] border border-transparent font-semibold hover:opacity-90", p ? ["h-8 w-[70px]", "max-lg:flex-1", "max-[1220px]:p-1 max-[1220px]:h-auto max-[1220px]:w-auto max-[1220px]:min-h-8", "min-[1221px]:h-8 min-[1221px]:w-[70px]"] : ["max-lg:w-full max-lg:grow", "lg:h-12 lg:w-[134px]"], !p && [a ? "bg-brand-blue text-white" : "bg-brand-blue/10 text-brand-blue"], p && 0 === r && [a ? "bg-green-600 text-white" : "bg-green-500/15 text-green-600 hover:bg-green-500/25", "active:bg-green-600 active:text-white active:border-green-600"], p && 1 === r && [a ? "bg-red-500 text-white" : "bg-red-500/10 text-red-500 hover:bg-red-500/20", "active:bg-red-500 active:text-white active:border-red-500"], v && "*:animate-pulse"),
                    children: (0, _.getOutcome)({
                        side: void 0,
                        outcome: e,
                        price: s,
                        precision: C
                    })
                }, `binary-${h.id}-${e}`)
            });
            return m[6] !== N ? (l = (0, t.jsx)("div", {
                className: "flex justify-end gap-2 items-center z-1 max-lg:w-full",
                children: N
            }), m[6] = N, m[7] = l) : l = m[7], m[8] !== l || m[9] !== M || m[10] !== z || m[11] !== s ? (u = (0, t.jsxs)("div", {
                onClick: z,
                className: "flex flex-col justify-center items-center max-lg:w-full",
                children: [s, l]
            }, M), m[8] = l, m[9] = M, m[10] = z, m[11] = s, m[12] = u) : u = m[12], u
        };

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

    function D(e) {
        return !!e && !!e ? .name
    }

    function L(e, r) {
        return (0, t.jsx)(P, {
            team: void 0,
            idx: r,
            isWinner: !1
        }, `sports-skeleton-${r}`)
    }

    function z(e) {
        e.preventDefault(), e.stopPropagation()
    }
    e.s(["SportOutcomes", 0, e => {
        let a, i, n, s, o, l = (0, r.c)(14),
            {
                event: d,
                className: u,
                handleOutcomeClick: m
            } = e;
        l[0] !== d ? (a = (0, C.getIsNegRiskSportsEvent)(d), l[0] = d, l[1] = a) : a = l[1];
        let p = a;
        if (l[2] !== d || l[3] !== p) i = d && Array.isArray(d ? .markets) ? p ? d.markets.map(e => e.groupItemTitle ? { ...e,
            groupItemTitle: e.groupItemTitle.toLowerCase().includes("draw") ? "Draw" : e.groupItemTitle
        } : e).sort((e, t) => Number(e.groupItemThreshold) - Number(t.groupItemThreshold)) : d.markets : void 0, l[2] = d, l[3] = p, l[4] = i;
        else i = l[4];
        let h = i;
        return l[5] !== u ? (n = (0, c.cn)("flex flex-1 w-full gap-x-2", "lg:max-w-[372px] lg:min-w-[372px] lg:justify-end lg:pr-2", "max-lg:justify-start", u), l[5] = u, l[6] = n) : n = l[6], l[7] !== m || l[8] !== p || l[9] !== h ? (s = h && Array.isArray(h) ? h.map(e => (0, t.jsx)(g.BookContextProvider, {
            market: e,
            prefetch: {
                book: "never",
                lastPrice: "never"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)(A, {
                market: e,
                isNegRisk: p,
                handleOutcomeClick: m
            })
        }, `bcp-${e.id??e.slug??e.question}`)) : null, l[7] = m, l[8] = p, l[9] = h, l[10] = s) : s = l[10], l[11] !== n || l[12] !== s ? (o = (0, t.jsx)("div", {
            className: n,
            children: s
        }), l[11] = n, l[12] = s, l[13] = o) : o = l[13], o
    }, "SportScores", 0, e => {
        let a, i, n, s, o, l, d = (0, r.c)(21),
            {
                event: p,
                className: h
            } = e,
            f = (0, b.useLocale)(),
            {
                result: g
            } = (0, x.useSportsGameSelector)(p ? .slug ? ? "", E);
        e: {
            let e;
            if (!p) {
                a = void 0;
                break e
            }
            d[0] !== p.markets ? (e = p.markets.filter(O), d[0] = p.markets, d[1] = e) : e = d[1];
            let t = e;
            if (1 === t.length) {
                a = t[0].teams;
                break e
            }
            if (3 === t.length && t[0].team && t[2].team) {
                let e;
                d[2] !== t[0].team || d[3] !== t[2].team ? (e = [t[0].team, t[2].team], d[2] = t[0].team, d[3] = t[2].team, d[4] = e) : e = d[4], a = e;
                break e
            }
            a = void 0
        }
        let v = a,
            y = p ? .markets ? .length === 1,
            k = p ? .markets ? .[0] ? .volume ? ? "0",
            w = p ? .volume ? ? "0";
        d[5] !== p || d[6] !== f ? (i = ((e, t) => {
            if (!e || !e.startTime) return "TBD";
            try {
                let r = new Date(e.startTime);
                return (0, u.format)(r, "p", {
                    locale: (0, m.getDateFnsLocale)(t)
                })
            } catch {
                return "TBD"
            }
        })(p, f), d[5] = p, d[6] = f, d[7] = i) : i = d[7];
        let S = i;
        if (!v) return null;
        d[8] !== h ? (n = (0, c.cn)("flex h-full flex-col items-start min-h-[90px] min-w-[150px] whitespace-nowrap overflow-hidden text-ellipsis", "lg:mr-4 lg:items-center lg:ml-2", "min-[1024px]:max-[1380px]:min-w-[125px]", h), d[8] = h, d[9] = n) : n = d[9];
        let j = v ? .[0],
            C = y ? k : w;
        return d[10] !== S || d[11] !== j || d[12] !== C ? (s = (0, t.jsx)(I, {
            teamZero: j,
            volume: C,
            formattedDate: S
        }), d[10] = S, d[11] = j, d[12] = C, d[13] = s) : s = d[13], d[14] !== g || d[15] !== v ? (o = v.every(D) ? v.map((e, r) => (0, t.jsx)(P, {
            team: e,
            idx: r,
            isWinner: g ? .status === "win-loss" && g.winningIdx === r
        }, `${e.name} ${e.score}`)) : Array.from({
            length: 2
        }, L), d[14] = g, d[15] = v, d[16] = o) : o = d[16], d[17] !== n || d[18] !== s || d[19] !== o ? (l = (0, t.jsxs)("div", {
            className: n,
            children: [s, o]
        }), d[17] = n, d[18] = s, d[19] = o, d[20] = l) : l = d[20], l
    }, "getWinStatus", 0, (e, t, r) => "number" != typeof e ? .score || "number" != typeof t ? .score ? "in-game" : e.score === t.score ? "draw" : 0 === r && e.score > t.score || 1 === r && e.score < t.score ? "win" : "loss"], 29438)
}, 754325, 842830, 94214, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconShareUpRightOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...a
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...a
    }, t.default.createElement("polyline", {
        points: "10.5 2.75 15.25 2.75 15.25 7.5",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), t.default.createElement("line", {
        x1: "15.25",
        y1: "2.75",
        x2: "9",
        y2: "9",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), t.default.createElement("path", {
        d: "M15.25,10.5v2.75c0,1.105-.895,2-2,2H4.75c-1.105,0-2-.895-2-2V4.75c0-1.105,.895-2,2-2h2.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))], 754325);
    var a = e.i(188734),
        i = e.i(797055);
    e.s(["useInterval", 0, function(e, r, n) {
        void 0 === n && (n = {});
        var s = (0, a.default)(e),
            o = (0, t.useRef)(null),
            l = (0, t.useCallback)(function() {
                o.current && clearInterval(o.current)
            }, []);
        return (0, t.useEffect)(function() {
            if ((0, i.isNumber)(r) && !(r < 0)) return n.immediate && s(), o.current = setInterval(s, r), l
        }, [r, n.immediate]), l
    }], 842830);
    var n = e.i(631222);
    e.s(["parseUmaLink", 0, e => {
        let t = "project=Polymarket";
        if (!e) return `${n.UMA_OO_DAPP}propose?${t}`;
        let r = "posed" === e.status || "initialized" === e.status || "challenged" === e.status ? "propose" : "resolved" === e.status ? "settled" : "",
            a = e.transactionHash,
            i = e.logIndex;
        return a && void 0 !== i ? `${n.UMA_OO_DAPP}${r}?${t}&transactionHash=${a}&eventIndex=${i}` : `${n.UMA_OO_DAPP}${r}?${t}`
    }], 94214)
}, 148031, e => {
    "use strict";
    var t, r = e.i(221628),
        a = e.i(999061),
        i = e.i(23128),
        n = e.i(471027),
        s = e.i(754325),
        o = e.i(122538),
        l = e.i(964974),
        c = e.i(842830),
        d = e.i(539868),
        u = e.i(416340),
        m = e.i(604777),
        p = e.i(870555),
        h = e.i(399336),
        f = e.i(891685),
        x = e.i(94214),
        g = e.i(74156),
        v = e.i(355429),
        y = ((t = y || {})[t.posed = 0] = "posed", t[t.proposed = 1] = "proposed", t[t.resolvedSimple = 2] = "resolvedSimple", t[t.challenged = 3] = "challenged", t[t.reproposed = 4] = "reproposed", t[t.resolvedChallenged = 5] = "resolvedChallenged", t[t.disputed = 6] = "disputed", t[t.resolvedDisputed = 7] = "resolvedDisputed", t);

    function b(e) {
        let t, n, s, c, d, u, m, v, y, b, k, w = (0, a.c)(24),
            {
                text: S,
                className: j
            } = e;
        w[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["event"], w[0] = t) : t = w[0];
        let {
            event: C
        } = (0, f.useEventContext)(t);
        w[1] === Symbol.for("react.memo_cache_sentinel") ? (n = ["activeMarket"], w[1] = n) : n = w[1];
        let {
            activeMarket: _
        } = (0, h.useEventActiveMarketContext)(n);
        w[2] !== _.id ? (s = ["/api/market/resolutionData", _.id], w[2] = _.id, w[3] = s) : s = w[3], w[4] !== _ ? (c = () => (0, g.getResolutionData)(_), w[4] = _, w[5] = c) : c = w[5], w[6] !== _.resolutionData ? (d = () => _.resolutionData, w[6] = _.resolutionData, w[7] = d) : d = w[7];
        let T = !!_.resolutionData && 1 === C.markets.length;
        w[8] === Symbol.for("react.memo_cache_sentinel") ? (u = {
            errorContext: {
                tag: "[EventResolutionSection > marketResolutionData]"
            }
        }, w[8] = u) : u = w[8], w[9] !== s || w[10] !== c || w[11] !== d || w[12] !== T ? (m = {
            queryKey: s,
            queryFn: c,
            initialData: d,
            enabled: T,
            refetchOnMount: !1,
            refetchOnReconnect: !1,
            refetchOnWindowFocus: !0,
            placeholderData: o.keepPreviousData,
            staleTime: 6e4,
            gcTime: 6e4,
            meta: u
        }, w[9] = s, w[10] = c, w[11] = d, w[12] = T, w[13] = m) : m = w[13];
        let {
            data: M
        } = (0, l.useQuery)(m);
        w[14] !== M ? (v = (0, x.parseUmaLink)(M), w[14] = M, w[15] = v) : v = w[15];
        let N = v;
        return w[16] !== j ? (y = (0, p.cn)("rounded-full px-2.5", j), w[16] = j, w[17] = y) : y = w[17], w[18] !== y || w[19] !== S ? (b = (0, r.jsx)(i.Button, {
            variant: "outline",
            size: "sm",
            className: y,
            children: S
        }), w[18] = y, w[19] = S, w[20] = b) : b = w[20], w[21] !== N || w[22] !== b ? (k = (0, r.jsx)("a", {
            href: N,
            target: "_blank",
            rel: "noopener noreferrer",
            className: "text-inherit [-webkit-tap-highlight-color:rgba(0,0,0,0.2)]",
            children: b
        }), w[21] = N, w[22] = b, w[23] = k) : k = w[23], k
    }

    function k(e) {
        let t, i, s, o, l, m, h, f, x, g, v, y, k = (0, a.c)(34),
            {
                text: w,
                challengeWindowTimestamp: S,
                icon: j,
                status: C,
                first: _,
                showButton: T,
                buttonText: M
            } = e,
            [N, I] = (0, u.useState)(""),
            [P] = (0, u.useState)(!!S),
            E = "challenge" === j && "complete" === C;
        k[0] !== S ? (t = () => {
            if (!S) return "";
            let e = 1e3 * S - new Date().getTime();
            if (e < 0) return "";
            let t = Math.floor(e / 864e5),
                r = Math.floor(e % 864e5 / 36e5),
                a = Math.floor(e % 36e5 / 6e4),
                i = Math.floor(e % 6e4 / 1e3);
            return `${0!==t?`${t}d `:""}${0!==r?`${r}h `:""}${0!==a?`${a}m `:""}${0!==i?`${i}s`:""}`
        }, k[0] = S, k[1] = t) : t = k[1];
        let A = t;
        k[2] !== A ? (i = () => {
            I(A())
        }, k[2] = A, k[3] = i) : i = k[3], (0, c.useInterval)(i, P ? 1e3 : void 0);
        let O = _ ? "bg-transparent" : "pending" !== C ? "bg-brand-500" : "bg-neutral-100";
        k[4] !== O ? (s = (0, p.cn)("relative left-[13px] -top-5 w-0.5 h-4 z-2", O), k[4] = O, k[5] = s) : s = k[5], k[6] !== s ? (o = (0, r.jsx)("div", {
            className: s
        }), k[6] = s, k[7] = o) : o = k[7];
        let D = E ? "border-neutral-100 bg-neutral-100" : "pending" === C ? "border-2 border-neutral-100 bg-transparent" : "border-2 border-brand-500",
            L = !E && "complete" === C && "bg-brand-500";
        k[8] !== D || k[9] !== L ? (l = (0, p.cn)("flex items-center justify-center size-6 rounded-full mr-4", D, L), k[8] = D, k[9] = L, k[10] = l) : l = k[10], k[11] !== j || k[12] !== C ? (m = "pending" === C || "current" === C ? null : "check" === j ? (0, r.jsx)(d.IconCheckFill18, {
            className: "text-2xl text-white p-0.5"
        }) : (0, r.jsx)(n.IconGavelOutline18, {
            className: "text-2xl p-1 text-text"
        }), k[11] = j, k[12] = C, k[13] = m) : m = k[13], k[14] !== l || k[15] !== m ? (h = (0, r.jsx)("div", {
            className: l,
            children: m
        }), k[14] = l, k[15] = m, k[16] = h) : h = k[16];
        let z = "pending" !== C ? "text-text" : "text-neutral-500";
        return k[17] !== z ? (f = (0, p.cn)("font-normal text-sm whitespace-nowrap", z), k[17] = z, k[18] = f) : f = k[18], k[19] !== f || k[20] !== w ? (x = (0, r.jsx)("p", {
            className: f,
            children: w
        }), k[19] = f, k[20] = w, k[21] = x) : x = k[21], k[22] !== S || k[23] !== N ? (g = S && (0, r.jsx)("div", {
            className: "ml-2",
            children: (0, r.jsx)("p", {
                className: "font-medium text-body-base text-brand-500 whitespace-nowrap tabular-nums tracking-tight",
                children: N
            })
        }), k[22] = S, k[23] = N, k[24] = g) : g = k[24], k[25] !== M || k[26] !== T ? (v = T && M && (0, r.jsx)(b, {
            text: M,
            className: "ml-4"
        }), k[25] = M, k[26] = T, k[27] = v) : v = k[27], k[28] !== h || k[29] !== x || k[30] !== g || k[31] !== v || k[32] !== o ? (y = (0, r.jsxs)("div", {
            className: "flex w-full justify-start items-center max-h-6",
            children: [o, h, x, g, v]
        }), k[28] = h, k[29] = x, k[30] = g, k[31] = v, k[32] = o, k[33] = y) : y = k[33], y
    }

    function w({
        resolutionData: e,
        market: t,
        className: a
    }) {
        let i = (0, m.useTranslations)(),
            n = (0, u.useMemo)(() => {
                if (e)
                    if (e.newVersionQ) {
                        if (e.status === v.ResolutionStatus.posed && !e.wasDisputed && "69" === e.proposedPrice && "69" === e.reproposedPrice && "69" === e.price) return 0;
                        if (e.status === v.ResolutionStatus.proposed && !e.wasDisputed && "69" !== e.proposedPrice && "69" === e.reproposedPrice && "69" === e.price) return 1;
                        if (e.status === v.ResolutionStatus.resolved && !e.wasDisputed && "69" !== e.proposedPrice && "69" === e.reproposedPrice && "69" !== e.price) return 2;
                        if (e.status === v.ResolutionStatus.challenged && "69" !== e.proposedPrice && "69" === e.reproposedPrice && "69" === e.price) return 3;
                        if (e.status === v.ResolutionStatus.reproposed && !e.wasDisputed && "69" !== e.proposedPrice && "69" !== e.reproposedPrice && "69" === e.price) return 4;
                        if (e.status === v.ResolutionStatus.resolved && !e.wasDisputed && "69" !== e.proposedPrice && "69" !== e.reproposedPrice && "69" !== e.price) return 5;
                        if (e.status === v.ResolutionStatus.disputed && e.wasDisputed && "69" !== e.proposedPrice && "69" !== e.reproposedPrice && "69" === e.price) return 6;
                        if (e.status === v.ResolutionStatus.resolved && e.wasDisputed && "69" !== e.proposedPrice && "69" !== e.reproposedPrice && "69" !== e.price) return 7;
                        if (e.status === v.ResolutionStatus.resolved) return 2
                    } else {
                        if (e.status === v.ResolutionStatus.initialized || e.status === v.ResolutionStatus.posed) return 0;
                        if (e.status === v.ResolutionStatus.proposed) return 1;
                        if (e.status === v.ResolutionStatus.resolved && !e.wasDisputed) return 2;
                        if (e.status === v.ResolutionStatus.disputed) return 6;
                        if (e.status === v.ResolutionStatus.resolved && e.wasDisputed) return 7
                    }
                return 0
            }, [e]),
            s = !!(t.sportsMarketType || t.teams),
            o = e => {
                if (e.startsWith("5")) return `${t.outcomes[0]} 0.50, ${t.outcomes[1]} 0.50`;
                if ("69" === e) return "";
                if (s && Array.isArray(t.outcomePrices)) {
                    let e = t.outcomePrices.findIndex(e => 1 === parseFloat(e));
                    if (-1 !== e) return t.outcomes[e]
                }
                return "0" === e ? t.outcomes[1] : t.outcomes[0]
            },
            l = (0, u.useMemo)(() => e ? o(e.proposedPrice) : "", [e, t.outcomes, t.outcomePrices, s]),
            c = (0, u.useMemo)(() => e ? o(e.reproposedPrice) : "", [e, t.outcomes, t.outcomePrices, s]),
            d = (0, u.useMemo)(() => e ? o(e.price) : "", [e, t.outcomes, t.outcomePrices, s]),
            h = e ? .lastUpdateTimestamp && (1 === n || 4 === n) ? (parseFloat(e.lastUpdateTimestamp) + 7200) * 1e3 - new Date().getTime() : null;
        return (0, r.jsxs)("div", {
            className: (0, p.cn)("flex w-full flex-col gap-4", a),
            children: [!e && (0, r.jsx)(b, {
                text: i("events.resolution.proposeResolution")
            }), e ? .newVersionQ ? (0, r.jsxs)(r.Fragment, {
                children: [0 === n && (0, r.jsx)(b, {
                    text: i("events.resolution.proposeResolution")
                }), 1 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputeWindow"),
                        icon: h && h > 0 ? "challenge" : "check",
                        status: h && h > 0 ? "current" : "complete",
                        challengeWindowTimestamp: h && h > 0 ? parseFloat(e.lastUpdateTimestamp) + 7200 : void 0,
                        showButton: !!(h && h > 0),
                        buttonText: i("events.resolution.dispute")
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.final"),
                        icon: "check",
                        status: h && h > 0 ? "pending" : "current"
                    })]
                }), 2 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.noDispute"),
                        icon: "check",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: `${i("events.resolution.finalOutcome")}: ${d}`,
                        icon: "check",
                        status: "complete"
                    })]
                }), 3 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputed"),
                        icon: "challenge",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.outcomeProposal"),
                        icon: "check",
                        status: "current",
                        showButton: !0,
                        buttonText: i("events.resolution.proposeResolution")
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.finalDispute"),
                        icon: "check",
                        status: "pending"
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.final"),
                        icon: "check",
                        status: "pending"
                    })]
                }), 4 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputed"),
                        icon: "challenge",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${c}`,
                        icon: "check",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.finalDispute"),
                        icon: h && h > 0 ? "challenge" : "check",
                        status: h && h > 0 ? "current" : "complete",
                        challengeWindowTimestamp: h && h > 0 ? parseFloat(e.lastUpdateTimestamp) + 7200 : void 0,
                        showButton: !!(h && h > 0),
                        buttonText: i("events.resolution.dispute")
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.final"),
                        icon: "check",
                        status: "pending"
                    })]
                }), 5 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputed"),
                        icon: "challenge",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${c}`,
                        icon: "check",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.noDispute"),
                        icon: "check",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: `${i("events.resolution.finalOutcome")}: ${d}`,
                        icon: "check",
                        status: "complete"
                    })]
                }), 6 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputed"),
                        icon: "challenge",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${c}`,
                        icon: "check",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputed"),
                        icon: "challenge",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.finalReview"),
                        icon: "check",
                        status: "current",
                        challengeWindowTimestamp: parseFloat(e.lastUpdateTimestamp) + (86400 - parseFloat(e.lastUpdateTimestamp) % 86400) + 172800
                    })]
                }), 7 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputed"),
                        icon: "challenge",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${c}`,
                        icon: "check",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputed"),
                        icon: "challenge",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: `${i("events.resolution.finalOutcome")}: ${d}`,
                        icon: "check",
                        status: "complete"
                    })]
                })]
            }) : e && !e.newVersionQ ? (0, r.jsxs)(r.Fragment, {
                children: [0 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)("p", {
                        className: "text-sm",
                        children: i("events.resolution.noOutcomeProposedYet")
                    }), (0, r.jsx)(b, {
                        text: i("events.resolution.proposeResolution")
                    })]
                }), 1 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputeWindow"),
                        icon: "check",
                        status: "current",
                        challengeWindowTimestamp: parseFloat(e.lastUpdateTimestamp) + 7200,
                        showButton: !0,
                        buttonText: i("events.resolution.dispute")
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.final"),
                        icon: "check",
                        status: "pending"
                    })]
                }), 2 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.noDispute"),
                        icon: "check",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: `${i("events.resolution.finalOutcome")}: ${d}`,
                        icon: "check",
                        status: "complete"
                    })]
                }), 6 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputed"),
                        icon: "challenge",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.finalReview"),
                        icon: "check",
                        status: "current",
                        challengeWindowTimestamp: parseFloat(e.lastUpdateTimestamp) + (86400 - parseFloat(e.lastUpdateTimestamp) % 86400) + 172800
                    })]
                }), 7 === n && (0, r.jsxs)(r.Fragment, {
                    children: [(0, r.jsx)(k, {
                        text: `${i("events.resolution.outcomeProposed")}: ${l}`,
                        icon: "check",
                        status: "complete",
                        first: !0
                    }), (0, r.jsx)(k, {
                        text: i("events.resolution.disputed"),
                        icon: "challenge",
                        status: "complete"
                    }), (0, r.jsx)(k, {
                        text: `${i("events.resolution.finalOutcome")}: ${d}`,
                        icon: "check",
                        status: "complete"
                    })]
                })]
            }) : null]
        })
    }
    e.s(["EventResolutionStepper", 0, w, "UmaExternalLink", 0, function(e) {
        let t, n, o, l, c, d, u = (0, a.c)(12),
            {
                resolutionData: p
            } = e,
            h = (0, m.useTranslations)();
        u[0] !== p ? (t = (0, x.parseUmaLink)(p), u[0] = p, u[1] = t) : t = u[1];
        let f = t;
        return u[2] !== h ? (n = h("events.resolution.viewDetails"), u[2] = h, u[3] = n) : n = u[3], u[4] !== n ? (o = (0, r.jsx)("p", {
            children: n
        }), u[4] = n, u[5] = o) : o = u[5], u[6] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, r.jsx)(s.IconShareUpRightOutline18, {
            size: 18
        }), u[6] = l) : l = u[6], u[7] !== o ? (c = (0, r.jsxs)(i.Button, {
            variant: "link",
            size: "sm",
            className: "text-text-secondary! gap-1",
            children: [o, l]
        }), u[7] = o, u[8] = c) : c = u[8], u[9] !== f || u[10] !== c ? (d = (0, r.jsx)("a", {
            href: f,
            target: "_blank",
            rel: "noopener noreferrer",
            children: c
        }), u[9] = f, u[10] = c, u[11] = d) : d = u[11], d
    }, "default", 0, function(e) {
        let t, i, n, s, o = (0, a.c)(9);
        if (o[0] !== e) {
            let {
                showLinkInHeader: r,
                ...a
            } = e;
            t = a, o[0] = e, o[1] = t
        } else t = o[1];
        o[2] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], o[2] = i) : i = o[2];
        let {
            activeMarket: l
        } = (0, h.useEventActiveMarketContext)(i), c = l ? .resolutionData ? l.resolutionData : void 0;
        return o[3] !== l || o[4] !== c ? (n = (0, r.jsx)(w, {
            resolutionData: c,
            market: l
        }), o[3] = l, o[4] = c, o[5] = n) : n = o[5], o[6] !== t || o[7] !== n ? (s = (0, r.jsx)("div", { ...t,
            children: n
        }), o[6] = t, o[7] = n, o[8] = s) : s = o[8], s
    }])
}, 591925, 661267, 816864, 571798, e => {
    "use strict";
    e.s(["default", () => eL], 591925);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(23128),
        i = e.i(158789),
        n = e.i(798631),
        s = e.i(635973),
        o = e.i(416340),
        l = e.i(16674);
    e.s(["EventDetailAccordionItem", () => eb, "EventDetailAccordionItemOther", () => ey, "scrollToEventDetailAccordionItem", () => ev], 571798);
    var c = e.i(723823),
        d = e.i(853037),
        u = e.i(219469),
        m = e.i(215959),
        p = e.i(985185),
        h = e.i(810912),
        f = e.i(635868),
        x = e.i(488549),
        g = e.i(458164),
        v = e.i(273587),
        y = e.i(30704),
        b = e.i(177600),
        k = e.i(911472),
        w = e.i(421504),
        S = e.i(227865),
        j = e.i(12884),
        C = e.i(3643),
        _ = e.i(922445),
        T = e.i(604777),
        M = e.i(870555),
        N = e.i(784521),
        I = e.i(399336),
        P = e.i(891685),
        E = e.i(269101),
        A = e.i(6204),
        O = e.i(880809),
        D = e.i(196593),
        L = e.i(845923),
        z = e.i(156591),
        R = e.i(184062),
        F = e.i(494888),
        $ = e.i(724210),
        B = e.i(29438),
        q = e.i(992805),
        V = e.i(86831),
        H = e.i(981772),
        U = e.i(27235),
        W = e.i(328951),
        G = e.i(455145),
        Z = e.i(469870),
        K = e.i(394341),
        Y = e.i(19303),
        Q = e.i(699291),
        X = e.i(661879),
        J = e.i(122054),
        ee = e.i(982214),
        et = e.i(715877),
        er = e.i(925437),
        ea = e.i(898224),
        ei = e.i(631222),
        en = e.i(815940),
        es = e.i(532766),
        eo = e.i(148031);
    let el = e => {
        let a, i, n, s, o, l, c, u, m, p, h, f, x, g, v, b, k, w, j, C, _, M, I, E, A, D, L, z = (0, r.c)(89),
            {
                onHeightChange: R
            } = e,
            F = (0, T.useTranslations)();
        z[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["market", "resolutionData", "tabs", "selected", "setSelectedIndex"], z[0] = a) : a = z[0];
        let {
            market: $,
            resolutionData: B,
            tabs: el,
            selected: ec,
            setSelectedIndex: ed
        } = (0, S.useEventDetailTabContext)(a);
        z[1] !== F ? (i = e => {
            switch (e) {
                case Q.EVENT_DETAIL_TABS.Book:
                    return F("events.tabs.orderBook");
                case Q.EVENT_DETAIL_TABS.Chart:
                    return F("events.tabs.graph");
                case Q.EVENT_DETAIL_TABS.Positions:
                    return F("events.tabs.positions");
                case Q.EVENT_DETAIL_TABS.OpenOrders:
                    return F("events.tabs.openOrders");
                case Q.EVENT_DETAIL_TABS.History:
                    return F("events.tabs.history");
                case Q.EVENT_DETAIL_TABS.Resolution:
                    return F("events.tabs.resolution");
                default:
                    return e
            }
        }, z[1] = F, z[2] = i) : i = z[2];
        let eu = i;
        z[3] === Symbol.for("react.memo_cache_sentinel") ? (n = ["event"], z[3] = n) : n = z[3];
        let {
            event: em
        } = (0, P.useEventContext)(n), ep = (0, ea.useMediaQuery)("(max-width: 767px)"), {
            filledOrders: eh,
            hasNextPage: ef,
            fetchNextPage: ex,
            isFetching: eg
        } = (0, K.useFilledOrders)(), ev = $ ? .clobTokenIds, ey = $ ? .conditionId, eb = $ ? .orderPriceMinTickSize;
        z[4] !== ev || z[5] !== ey || z[6] !== eb ? (s = {
            clobTokenIds: ev,
            conditionId: ey,
            orderPriceMinTickSize: eb
        }, z[4] = ev, z[5] = ey, z[6] = eb, z[7] = s) : s = z[7];
        let {
            userOpenOrders: ek
        } = (0, y.default)(s);
        z[8] === Symbol.for("react.memo_cache_sentinel") ? (o = ["authenticated"], z[8] = o) : o = z[8];
        let {
            authenticated: ew
        } = (0, N.useAccountContext)(o);
        z[9] !== $.closed ? (l = $.closed && {
            chartWindow: er.CHART_WINDOWS[er.CHART_WINDOWS.length - 1]
        }, z[9] = $.closed, z[10] = l) : l = z[10], z[11] !== l ? (c = {
            annotationMode: "bottom-bar",
            mode: "single",
            outcomeMode: "single",
            height: 300,
            ...l,
            showOptions: !1
        }, z[11] = l, z[12] = c) : c = z[12];
        let eS = c,
            ej = (0, et.useConvertBinaryMarketToChartMarkets)($),
            eC = em.negRisk || em.markets && em.markets.length > 1,
            e_ = (0, X.useAnnotations)(em.slug);
        e: {
            let e, t;
            if (!eC) {
                u = e_;
                break e
            }
            let r = $.groupItemTitle || $.question || "";z[13] !== r ? (e = r.toLowerCase().trim(), z[13] = r, z[14] = e) : e = z[14];
            let a = e;
            if (!a) {
                u = e_;
                break e
            }
            if (z[15] !== e_ || z[16] !== a) {
                let e;
                z[18] !== a ? (e = e => null != e.outcome && e.outcome.toLowerCase().trim() === a, z[18] = a, z[19] = e) : e = z[19], t = e_.filter(e), z[15] = e_, z[16] = a, z[17] = t
            } else t = z[17];u = t
        }
        let eT = u,
            eM = (e => {
                let t, a, i, n, s, o, l = (0, r.c)(12);
                l[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["selectedOutcome"], l[0] = t) : t = l[0];
                let {
                    selectedOutcome: c
                } = (0, O.useTradeContext)(t), d = (0, G.useOnPriceLevelClick)(e), u = (0, Z.useOnSpreadClick)(), m = `Trade ${c}`;
                return l[1] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                    enabled: !0
                }, l[1] = a) : a = l[1], l[2] !== m ? (i = {
                    label: m,
                    recenter: a,
                    className: "bg-background"
                }, l[2] = m, l[3] = i) : i = l[3], l[4] !== u ? (n = {
                    recenter: !0,
                    onClick: u,
                    className: "bg-background"
                }, l[4] = u, l[5] = n) : n = l[5], l[6] !== d ? (s = {
                    onClick: d
                }, l[6] = d, l[7] = s) : s = l[7], l[8] !== i || l[9] !== n || l[10] !== s ? (o = {
                    headerOptions: i,
                    spreadOptions: n,
                    rowOptions: s
                }, l[8] = i, l[9] = n, l[10] = s, l[11] = o) : o = l[11], o
            })($);
        if (z[20] !== eu || z[21] !== el) {
            let e;
            z[23] !== eu ? (e = e => ({
                value: e,
                label: eu(e)
            }), z[23] = eu, z[24] = e) : e = z[24], m = el.map(e), z[20] = eu, z[21] = el, z[22] = m
        } else m = z[22];
        let eN = m;
        z[25] !== ed || z[26] !== el ? (p = e => {
            let t = el.indexOf(e); - 1 !== t && ed(t)
        }, z[25] = ed, z[26] = el, z[27] = p) : p = z[27];
        let eI = p;
        z[28] !== eI || z[29] !== ec || z[30] !== eN ? (h = (0, t.jsx)(q.TextTabs, {
            items: eN,
            value: ec,
            onValueChange: eI,
            size: "sm",
            className: "flex items-center h-12"
        }), z[28] = eI, z[29] = ec, z[30] = eN, z[31] = h) : h = z[31], z[32] !== $.feesEnabled ? (f = $.feesEnabled && (0, t.jsx)(H.MakerRebateTooltip, {}), z[32] = $.feesEnabled, z[33] = f) : f = z[33], z[34] === Symbol.for("react.memo_cache_sentinel") ? (x = (0, t.jsx)(d.default, {}), g = (0, t.jsx)(Y.ClobRefreshButtonWithTooltip, {}), v = (0, t.jsx)(J.TickSizeWidget, {
            mode: "toggle"
        }), z[34] = x, z[35] = g, z[36] = v) : (x = z[34], g = z[35], v = z[36]), z[37] !== f ? (b = (0, t.jsxs)("div", {
            className: "flex items-center",
            children: [f, x, g, v]
        }), z[37] = f, z[38] = b) : b = z[38], z[39] !== h || z[40] !== b ? (k = (0, t.jsxs)("div", {
            className: "relative flex w-full justify-between border-b",
            children: [h, b]
        }), z[39] = h, z[40] = b, z[41] = k) : k = z[41];
        let eP = ec === Q.EVENT_DETAIL_TABS.Chart && "pt-4";
        return z[42] !== eP ? (w = (0, V.cn)("w-full", eP), z[42] = eP, z[43] = w) : w = z[43], z[44] !== ep || z[45] !== eC || z[46] !== $ || z[47] !== R || z[48] !== eM || z[49] !== ec ? (j = ec === Q.EVENT_DETAIL_TABS.Book && !$.closed && (0, t.jsx)(W.OrderBook, {
            market: $,
            className: "w-full",
            options: eM,
            maxHeight: 360,
            onHeightChange: R,
            compactPadding: !ep && eC
        }), z[44] = ep, z[45] = eC, z[46] = $, z[47] = R, z[48] = eM, z[49] = ec, z[50] = j) : j = z[50], z[51] !== ej || z[52] !== eS || z[53] !== em || z[54] !== eT || z[55] !== ec ? (C = ec === Q.EVENT_DETAIL_TABS.Chart && 137 === ei.MATIC_CONFIG.chainId && (0, t.jsx)("div", {
            className: "overflow-visible",
            children: (0, t.jsx)(ee.GroupChart, {
                markets: ej,
                lowChanceMarkets: [],
                resolvedMarkets: [],
                event: em,
                options: eS,
                annotations: eT
            })
        }), z[51] = ej, z[52] = eS, z[53] = em, z[54] = eT, z[55] = ec, z[56] = C) : C = z[56], z[57] !== $ || z[58] !== ek || z[59] !== ec ? (_ = ec === Q.EVENT_DETAIL_TABS.OpenOrders && (0, t.jsx)(en.default, {
            market: $,
            openOrders: ek,
            headerClassName: "hidden",
            bodyClassName: "px-0 overflow-y-hidden"
        }), z[57] = $, z[58] = ek, z[59] = ec, z[60] = _) : _ = z[60], z[61] !== $ || z[62] !== ec ? (M = ec === Q.EVENT_DETAIL_TABS.Positions && (0, t.jsx)(es.default, {
            market: $,
            headerStyles: {
                display: "none"
            },
            bodyStyles: {
                paddingLeft: 0,
                paddingRight: 0,
                overflowX: "scroll",
                overflowY: "scroll"
            },
            tableBodyItemStyles: {
                alignSelf: "center"
            }
        }), z[61] = $, z[62] = ec, z[63] = M) : M = z[63], z[64] !== ew || z[65] !== ex || z[66] !== eh || z[67] !== ef || z[68] !== eg || z[69] !== $ || z[70] !== ec ? (I = ec === Q.EVENT_DETAIL_TABS.History && (0, t.jsx)(t.Fragment, {
            children: $.enableOrderBook && (0, t.jsx)(U.default, {
                filledOrders: eh,
                hasNextPage: ef,
                fetchNextPage: ex,
                isFetchingNextPage: eg,
                isAuthenticated: !!ew,
                omitHeader: !0,
                activeMarket: $,
                viewAll: !0,
                containerClassName: `overflow-x-hidden ${eh.length>=U.TRADES_TO_SHOW_COUNT?"pb-4":""}`
            })
        }), z[64] = ew, z[65] = ex, z[66] = eh, z[67] = ef, z[68] = eg, z[69] = $, z[70] = ec, z[71] = I) : I = z[71], z[72] !== $ || z[73] !== B || z[74] !== ec ? (E = ec === Q.EVENT_DETAIL_TABS.Resolution && $.resolutionData && (0, t.jsxs)("div", {
            className: "flex flex-row",
            children: [(0, t.jsx)("div", {
                className: "flex flex-col grow w-full",
                children: (0, t.jsx)(eo.EventResolutionStepper, {
                    market: $,
                    resolutionData: B,
                    className: "py-4"
                })
            }), (0, t.jsx)("div", {
                className: "flex flex-col justify-center",
                children: (0, t.jsx)(eo.UmaExternalLink, {
                    resolutionData: B
                })
            })]
        }), z[72] = $, z[73] = B, z[74] = ec, z[75] = E) : E = z[75], z[76] !== j || z[77] !== C || z[78] !== _ || z[79] !== M || z[80] !== I || z[81] !== E ? (A = (0, t.jsxs)("div", {
            className: "w-full",
            children: [j, C, _, M, I, E]
        }), z[76] = j, z[77] = C, z[78] = _, z[79] = M, z[80] = I, z[81] = E, z[82] = A) : A = z[82], z[83] !== w || z[84] !== A ? (D = (0, t.jsx)("div", {
            className: w,
            children: A
        }), z[83] = w, z[84] = A, z[85] = D) : D = z[85], z[86] !== k || z[87] !== D ? (L = (0, t.jsxs)("div", {
            className: "flex flex-col w-full h-auto",
            children: [k, D]
        }), z[86] = k, z[87] = D, z[88] = L) : L = z[88], L
    };
    var ec = e.i(896414);
    let ed = e => {
        let a, i, n = (0, r.c)(4),
            {
                marketImage: s,
                marketName: o
            } = e;
        n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], n[0] = a) : a = n[0];
        let {
            event: l
        } = (0, P.useEventContext)(a), {
            showMarketImages: c
        } = l;
        return c ? (n[1] !== s || n[2] !== o ? (i = (0, t.jsx)(ec.MarketImage, {
            image: s,
            marketName: o,
            containerClassName: "rounded-sm overflow-hidden",
            skeletonClassName: "hidden",
            size: 40
        }), n[1] = s, n[2] = o, n[3] = i) : i = n[3], i) : null
    };
    e.s(["EventDetailAccordionMarketImage", 0, ed], 661267);
    var eu = e.i(935786);
    let em = e => {
        let i, n, s, o, l, c, d, u, m, p, h, x, v = (0, r.c)(32),
            {
                outcome: y,
                idx: b,
                ammChainPrices: k,
                bestPrices: w,
                onOutcomeClick: S
            } = e,
            j = (0, T.useTranslations)();
        v[0] === Symbol.for("react.memo_cache_sentinel") ? (i = ["market"], v[0] = i) : i = v[0];
        let {
            market: C
        } = (0, f.useBookContext)(i);
        v[1] === Symbol.for("react.memo_cache_sentinel") ? (n = ["activeMarket"], v[1] = n) : n = v[1];
        let {
            activeMarket: _
        } = (0, I.useEventActiveMarketContext)(n);
        v[2] === Symbol.for("react.memo_cache_sentinel") ? (s = ["selectedOutcome", "orderType", "side"], v[2] = s) : s = v[2];
        let {
            selectedOutcome: M,
            orderType: N,
            side: P
        } = (0, O.useTradeContext)(s), E = C.slug === _.slug && y === M, A = C.enableOrderBook && N !== g.OrderType.AMM ? w ? .[0 === b ? "~zero" : "~one"] ? .[P ? .toLowerCase()] ? ? "0" : k ? .[b] ? ? "0";
        v[3] !== C.orderPriceMinTickSize || v[4] !== y || v[5] !== A || v[6] !== P ? (o = (0, z.getPrecisionFromTickSize)(C ? .orderPriceMinTickSize), l = (0, eu.getOutcomeMetrics)({
            side: P,
            outcome: y,
            price: A,
            precision: o,
            withoutSidePrefix: !1
        }), v[3] = C.orderPriceMinTickSize, v[4] = y, v[5] = A, v[6] = P, v[7] = o, v[8] = l) : (o = v[7], l = v[8]);
        let L = l;
        v[9] !== P || v[10] !== j ? (c = P ? j("buy" === P.toLowerCase() ? "trading.buy" : "trading.sell") : "", v[9] = P, v[10] = j, v[11] = c) : c = v[11];
        let R = c,
            F = 0 === b ? E ? "outcome-yes-active" : "outcome-yes" : E ? "outcome-no-active" : "outcome-no";
        return v[12] !== b || v[13] !== S || v[14] !== o || v[15] !== A ? (d = e => {
            e.preventDefault(), S(b, (0, D.showPaddedCentsOnly)(A, o))
        }, u = e => {
            e.preventDefault(), e.stopPropagation(), S(b, (0, D.showPaddedCentsOnly)(A, o))
        }, v[12] = b, v[13] = S, v[14] = o, v[15] = A, v[16] = d, v[17] = u) : (d = v[16], u = v[17]), v[18] !== L.outcome || v[19] !== R ? (m = (0, t.jsxs)("span", {
            className: "min-w-0 truncate opacity-80 capitalize",
            children: [R, " ", L.outcome]
        }), v[18] = L.outcome, v[19] = R, v[20] = m) : m = v[20], v[21] !== L.price ? (p = (0, t.jsxs)("span", {
            className: "shrink-0 text-base",
            children: [L.price, "¢"]
        }), v[21] = L.price, v[22] = p) : p = v[22], v[23] !== p || v[24] !== m ? (h = (0, t.jsxs)("span", {
            className: "flex items-center gap-1 min-w-0 w-fit",
            children: [m, p]
        }), v[23] = p, v[24] = m, v[25] = h) : h = v[25], v[26] !== E || v[27] !== h || v[28] !== F || v[29] !== d || v[30] !== u ? (x = (0, t.jsx)(a.Button, {
            "data-active": E,
            variant: F,
            className: "h-12 gap-1 w-[136px] rounded-sm cursor-pointer font-semibold",
            onMouseOver: ep,
            onMouseDown: d,
            onClick: u,
            children: h
        }), v[26] = E, v[27] = h, v[28] = F, v[29] = d, v[30] = u, v[31] = x) : x = v[31], x
    };

    function ep(e) {
        e.stopPropagation()
    }

    function eh(e) {
        let a, i, n, s, l, c, d, u, m, p, h, x, g, v, y = (0, r.c)(26);
        y[0] !== e ? ({
            ref: n,
            lastPriceDetail: i,
            className: a,
            style: l,
            ...s
        } = e, y[0] = e, y[1] = a, y[2] = i, y[3] = n, y[4] = s, y[5] = l) : (a = y[1], i = y[2], n = y[3], s = y[4], l = y[5]);
        let b = o.default.useRef(null),
            [k, w] = o.default.useState(!1);
        y[6] === Symbol.for("react.memo_cache_sentinel") ? (c = ["isRefreshingAllBooks"], y[6] = c) : c = y[6];
        let {
            isRefreshingAllBooks: S
        } = (0, P.useEventContext)(c);
        y[7] === Symbol.for("react.memo_cache_sentinel") ? (d = ["isBookRefreshing"], y[7] = d) : d = y[7];
        let {
            isBookRefreshing: j
        } = (0, f.useBookContext)(d);
        y[8] !== j || y[9] !== S ? (u = () => {
            j && S && (w(!0), b.current = setTimeout(() => {
                w(!1)
            }, 750))
        }, m = [j, S], y[8] = j, y[9] = S, y[10] = u, y[11] = m) : (u = y[10], m = y[11]), o.default.useEffect(u, m), y[12] === Symbol.for("react.memo_cache_sentinel") ? (p = () => () => {
            b.current && clearTimeout(b.current)
        }, h = [], y[12] = p, y[13] = h) : (p = y[12], h = y[13]), o.default.useEffect(p, h);
        let C = i.showLastPrice ? i.lastPriceString : "-",
            _ = ["-", "<1%"].includes(C) ? .25 : 1,
            T = k && "animate-pulse";
        return y[14] !== a || y[15] !== T ? (x = (0, M.cn)("font-semibold text-heading-2xl text-[28px] text-text-primary", T, a), y[14] = a, y[15] = T, y[16] = x) : x = y[16], y[17] !== _ || y[18] !== l ? (g = {
            opacity: _,
            ...l
        }, y[17] = _, y[18] = l, y[19] = g) : g = y[19], y[20] !== C || y[21] !== n || y[22] !== s || y[23] !== x || y[24] !== g ? (v = (0, t.jsx)("p", {
            ref: n,
            className: x,
            style: g,
            ...s,
            children: C
        }), y[20] = C, y[21] = n, y[22] = s, y[23] = x, y[24] = g, y[25] = v) : v = y[25], v
    }
    e.s(["EventDetailPercentChance", 0, eh], 816864);
    let ef = {
            initial: {
                height: 0,
                opacity: 0
            },
            animate: {
                height: 24,
                opacity: 1,
                transition: {
                    ease: "anticipate",
                    duration: .2,
                    delay: 0
                }
            },
            exit: {
                height: 0,
                opacity: 0,
                transition: {
                    ease: "anticipate",
                    duration: .2,
                    delay: 0
                }
            }
        },
        ex = e => {
            let a, i, n = (0, r.c)(4),
                {
                    shouldExpandHorizontal: s
                } = e,
                o = s ? "-left-3 -right-3 rounded-md" : "left-0 right-0 rounded-none";
            return n[0] !== o ? (a = (0, M.cn)("absolute -top-px -bottom-px group-hover:bg-neutral-50/50", o), n[0] = o, n[1] = a) : a = n[1], n[2] !== a ? (i = (0, t.jsx)("div", {
                className: a
            }), n[2] = a, n[3] = i) : i = n[3], i
        },
        eg = e => {
            let a, i, n, s, l, p, f, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er, ea, ei, en, es = (0, r.c)(102),
                {
                    ammChainPrices: eo,
                    setResolutionDataToView: el,
                    setResolutionDialogOpen: ec,
                    onOutcomeSelect: eu
                } = e,
                ep = (0, T.useTranslations)();
            es[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["isNegRiskSportsEvent", "event"], es[0] = a) : a = es[0];
            let {
                isNegRiskSportsEvent: eg,
                event: ev
            } = (0, P.useEventContext)(a);
            es[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["market"], es[1] = i) : i = es[1];
            let {
                market: ey
            } = (0, S.useEventDetailTabContext)(i);
            es[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["authenticated"], es[2] = n) : n = es[2];
            let {
                authenticated: eb
            } = (0, N.useAccountContext)(n), ej = (0, c.useMarketBestPrices)(ey), eC = (0, c.useHasResolvedProbability)(ey), e_ = (0, I.useEventActiveMarketContextValue)();
            es[3] === Symbol.for("react.memo_cache_sentinel") ? (s = ["positions"], es[3] = s) : s = es[3];
            let {
                positions: eT
            } = (0, E.useEventPositionsContext)(s);
            es[4] === Symbol.for("react.memo_cache_sentinel") ? (l = ["orderType"], es[4] = l) : l = es[4];
            let {
                orderType: eM
            } = (0, O.useTradeContext)(l), eN = (0, O.useTradeContextValue)();
            es[5] === Symbol.for("react.memo_cache_sentinel") ? (p = ["isSportsPage"], es[5] = p) : p = es[5];
            let {
                isSportsPage: eI
            } = (0, A.useSportsContext)(p), eP = eI && eg, eE = ey ? .clobTokenIds, eA = ey ? .conditionId, eO = ey ? .orderPriceMinTickSize;
            es[6] !== eE || es[7] !== eA || es[8] !== eO ? (f = {
                clobTokenIds: eE,
                conditionId: eA,
                orderPriceMinTickSize: eO
            }, es[6] = eE, es[7] = eA, es[8] = eO, es[9] = f) : f = es[9];
            let {
                userLimitOrderCountMap: eD,
                getUserLimitOrderCountMap: eL
            } = (0, y.default)(f);
            es[10] !== ev ? .markets || es[11] !== eL || es[12] !== eP || es[13] !== ey.conditionId || es[14] !== eD ? (q = eP ? eL(ev ? .markets.map(ek) ? ? []) : eD ? .[ey ? .conditionId] ? ? 0, es[10] = ev ? .markets, es[11] = eL, es[12] = eP, es[13] = ey.conditionId, es[14] = eD, es[15] = q) : q = es[15];
            let ez = q,
                {
                    zeroLastPrice: eR,
                    oneLastPrice: eF
                } = (0, v.useLastExecutedTrade)();
            if (es[16] !== ev ? .markets || es[17] !== eP || es[18] !== ey || es[19] !== eF ? .price || es[20] !== eM || es[21] !== eT || es[22] !== eR ? .price) {
                let e, t, r = (0, w.filterTrackedPositionsCallback)(eT, eP ? ev ? .markets : ey);
                V = (ev ? .markets ? ? []).reduce((e, t) => ((0, L.fromPositionToPortfolioInjectedPrices)(t, r ? ? [], !1, [parseFloat("0"), parseFloat("0")]).filter(ew).forEach(t => e.push(t)), e), []), es[25] !== eR ? .price ? (e = eR ? .price ? .toString() ? ? "0", es[25] = eR ? .price, es[26] = e) : e = es[26], es[27] !== eF ? .price ? (t = eF ? .price ? .toString() ? ? "0", es[27] = eF ? .price, es[28] = t) : t = es[28], H = (0, L.fromPositionToPortfolioInjectedPrices)(ey, r ? ? [], eM !== g.OrderType.AMM, [parseFloat(e), parseFloat(t)]).filter(eS), es[16] = ev ? .markets, es[17] = eP, es[18] = ey, es[19] = eF ? .price, es[20] = eM, es[21] = eT, es[22] = eR ? .price, es[23] = V, es[24] = H
            } else V = es[23], H = es[24];
            let e$ = H,
                eB = eP ? V : e$;
            es[29] !== ev || es[30] !== e_.current || es[31] !== ey || es[32] !== eu || es[33] !== eN.current ? (U = (e, t, r) => {
                let {
                    setSelectedOutcomeIdx: a,
                    setPrice: i,
                    setPriceUpdateLocation: n,
                    setCursorActive: s,
                    setOrderType: l
                } = eN.current, {
                    setActiveMarket: c,
                    setAccordionMarketSlug: d,
                    accordionMarketSlug: u
                } = e_.current, m = ey;
                if (r && ev) {
                    let e = ev.markets.find(e => e.id.toString() === r.toString());
                    e && (m = { ...e
                    })
                }
                m.slug && u && (u !== m.slug && d(m.slug), eu ? .(m.slug)), (0, o.startTransition)(() => {
                    m.enableOrderBook || l(g.OrderType.AMM), c(m), void 0 !== e && a(e), "string" == typeof t && (i(t), n("click")), (0, _.isNarrowViewport)() || s(!0)
                })
            }, es[29] = ev, es[30] = e_.current, es[31] = ey, es[32] = eu, es[33] = eN.current, es[34] = U) : U = es[34];
            let eq = U;
            es[35] !== ej || es[36] !== eq || es[37] !== ey.orderPriceMinTickSize || es[38] !== ey.outcomes ? .[0] || es[39] !== eN.current ? (W = () => {
                let {
                    selectedOutcomeIdx: e,
                    side: t
                } = eN.current, r = ej ? .[0 === e ? "~zero" : "~one"] ? .[t ? .toLowerCase()];
                if (!r) return;
                let a = (0, D.showPaddedCentsOnly)(r, (0, z.getPrecisionFromTickSize)(ey ? .orderPriceMinTickSize));
                "string" == typeof ey ? .outcomes ? .[0] && 0 === e ? eq(0, a) : eq(void 0, a)
            }, es[35] = ej, es[36] = eq, es[37] = ey.orderPriceMinTickSize, es[38] = ey.outcomes ? .[0], es[39] = eN.current, es[40] = W) : W = es[40];
            let eV = W,
                eH = (0, C.usePercentChance)(ey, 2),
                {
                    probabilitySeries: eU
                } = (0, j.useChartContext)();
            eH ? .lastPrice;
            e: {
                let e, t = eH ? .lastPrice;
                if (void 0 === t) {
                    G = void 0;
                    break e
                }
                if (es[41] !== ey || es[42] !== eU) {
                    let t;
                    es[44] !== ey ? (t = e => e.label.toLowerCase() === ey.groupItemTitle ? .toLowerCase() || e.id === (0, x.getAssetId)(ey), es[44] = ey, es[45] = t) : t = es[45], e = eU.find(t), es[41] = ey, es[42] = eU, es[43] = e
                } else e = es[43];
                let r = e;
                if (!r ? .data ? .length) {
                    G = void 0;
                    break e
                }
                let a = r.data[0];
                if (!a) {
                    G = void 0;
                    break e
                }
                G = (t - Math.round(100 * a.value)) / 100
            }
            let eW = G,
                [, eG] = (0, o.useState)(!1),
                eZ = !!ey.resolutionData && ey.resolutionData ? .status !== "initialized" && ey.resolutionData ? .status !== "posed" && ey.resolutionData ? .status !== "resolved" && ey.resolutionData ? .status !== "challenged";
            es[46] === Symbol.for("react.memo_cache_sentinel") ? (Z = () => eG(!0), K = () => eG(!1), es[46] = Z, es[47] = K) : (Z = es[46], K = es[47]);
            let eK = !eI;
            return es[48] !== eK ? (Y = (0, t.jsx)(ex, {
                shouldExpandHorizontal: eK
            }), es[48] = eK, es[49] = Y) : Y = es[49], es[50] !== ev || es[51] !== eI || es[52] !== ey || es[53] !== ep ? (Q = eI ? (0, t.jsx)(B.SportScores, {
                event: ev,
                className: "z-1"
            }) : (0, t.jsxs)("div", {
                className: "flex items-center gap-4 w-full flex-3 z-1",
                children: [(0, t.jsx)(ed, {
                    marketImage: ey.image,
                    marketName: ey.groupItemTitle ? ? ey.question
                }), (0, t.jsx)("div", {
                    className: "flex flex-1 items-start justify-between min-w-0",
                    children: (0, t.jsxs)("div", {
                        className: "flex flex-col gap-y-1",
                        children: [(0, t.jsx)("div", {
                            className: "overflow-hidden text-ellipsis whitespace-nowrap max-w-[280px]",
                            children: (0, t.jsx)("p", {
                                className: (0, M.cn)("overflow-hidden whitespace-nowrap text-ellipsis font-semibold text-heading-lg", "max-w-[400px]", "min-[1024px]:max-[1050px]:max-w-[170px]", "min-[1050px]:max-[1080px]:max-w-[200px]", "min-[1080px]:max-[1140px]:max-w-[230px]", "min-[1140px]:max-[1220px]:max-w-[320px]"),
                                children: ey.groupItemTitle
                            })
                        }), (0, t.jsxs)("div", {
                            className: "flex items-center gap-1.5 min-h-5 [&_button]:size-5",
                            children: [(0, t.jsxs)("p", {
                                className: "text-body-sm text-text-secondary whitespace-nowrap leading-none",
                                children: [(0, D.formatCurrency)(ey.volume, {
                                    decimals: 0
                                }), " ", ep("events.headerMeta.volume")]
                            }), (0, k.hasRewardsConfig)(ey) ? (0, t.jsx)(d.default, {
                                asIcon: !0,
                                lazyLoad: !0,
                                activeMarketProp: ey
                            }) : null]
                        })]
                    })
                })]
            }), es[50] = ev, es[51] = eI, es[52] = ey, es[53] = ep, es[54] = Q) : Q = es[54], es[55] !== eC || es[56] !== eI || es[57] !== eH || es[58] !== ey || es[59] !== eW || es[60] !== el || es[61] !== ec || es[62] !== eZ ? (X = !eI && !ey.closed && (0, t.jsx)("div", {
                className: "flex items-center justify-center flex-1 z-10 relative @container",
                children: (0, t.jsxs)("div", {
                    className: "relative",
                    children: [eC ? (0, t.jsx)("span", {
                        className: "font-semibold text-heading-3xl text-[28px] text-text-primary",
                        children: ey.resolutionData ? .proposedPrice === "0" ? "0%" : "100%"
                    }) : (0, t.jsx)(eh, {
                        lastPriceDetail: eH
                    }), eZ ? (0, t.jsx)($.default, {
                        onClick: e => {
                            e.preventDefault(), e.stopPropagation(), el && el(ey), ec && ec(!0)
                        },
                        className: "absolute z-100 top-1/2 -translate-y-1/2 left-[calc(100%+0.325rem)] hidden @[110px]:block"
                    }) : eH ? .noLastPrice ? null : (0, t.jsx)("div", {
                        className: "absolute left-[calc(100%+0.325rem)] top-1/2 -translate-y-1/2 hidden @[110px]:block",
                        children: (0, t.jsx)(b.PriceChange, {
                            priceChange: eW,
                            size: 10,
                            hideOnZeroValue: !0,
                            decimalCount: 0,
                            textClassName: "font-semibold"
                        })
                    })]
                })
            }), es[55] = eC, es[56] = eI, es[57] = eH, es[58] = ey, es[59] = eW, es[60] = el, es[61] = ec, es[62] = eZ, es[63] = X) : X = es[63], es[64] !== eP || es[65] !== ey.closed ? (J = ey.closed && !eP ? (0, t.jsx)("div", {
                className: "flex justify-end gap-2 z-1",
                children: (0, t.jsx)("div", {
                    className: "flex justify-end items-center w-[calc(300px+0.5rem)] gap-x-2 rounded-[5px] transition-all duration-200 cursor-pointer",
                    children: (0, t.jsx)("div", {
                        className: "flex flex-col items-end",
                        children: (0, t.jsx)("div", {
                            className: "flex items-center gap-1.5",
                            children: (0, t.jsx)(F.EventDetailPayouts, {})
                        })
                    })
                })
            }) : null, es[64] = eP, es[65] = ey.closed, es[66] = J) : J = es[66], es[67] !== ev || es[68] !== eq || es[69] !== eP || es[70] !== ey.closed ? (ee = ey.closed && eP ? (0, t.jsx)(B.SportOutcomes, {
                event: ev,
                handleOutcomeClick: eq
            }) : null, es[67] = ev, es[68] = eq, es[69] = eP, es[70] = ey.closed, es[71] = ee) : ee = es[71], es[72] !== eo || es[73] !== ej || es[74] !== ev || es[75] !== eq || es[76] !== eI || es[77] !== ey.closed || es[78] !== ey.id || es[79] !== ey.outcomes ? (et = ey.closed ? null : (0, t.jsx)("div", {
                className: "flex justify-end items-center gap-2 flex-3 z-1",
                children: !eI && ej ? ey.outcomes.map((e, r) => (0, t.jsx)(em, {
                    outcome: e,
                    idx: r,
                    ammChainPrices: eo,
                    bestPrices: ej,
                    onOutcomeClick: eq
                }, `${ey.id}-${e}`)) : eI ? (0, t.jsx)(B.SportOutcomes, {
                    event: ev,
                    handleOutcomeClick: eq
                }) : null
            }), es[72] = eo, es[73] = ej, es[74] = ev, es[75] = eq, es[76] = eI, es[77] = ey.closed, es[78] = ey.id, es[79] = ey.outcomes, es[80] = et) : et = es[80], es[81] !== Q || es[82] !== X || es[83] !== J || es[84] !== ee || es[85] !== et ? (er = (0, t.jsxs)("div", {
                className: "w-full flex flex-row justify-between min-h-12 z-1",
                children: [Q, X, J, ee, et]
            }), es[81] = Q, es[82] = X, es[83] = J, es[84] = ee, es[85] = et, es[86] = er) : er = es[86], es[87] !== eb || es[88] !== ev || es[89] !== eP || es[90] !== eI || es[91] !== ey || es[92] !== eB || es[93] !== ez ? (ea = eb && (eB.length || ez > 0) ? (0, t.jsx)(m.motion.div, {
                variants: ef,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                className: "z-1",
                children: (0, t.jsx)("div", {
                    className: "flex items-center will-change-auto",
                    children: (0, t.jsx)(R.default, {
                        event: ev,
                        market: ey,
                        portfolioPositions: eB,
                        openOrdersCount: ez,
                        isNeutral: !!eI && !eP,
                        shouldShowGroupItemTitle: eP,
                        shouldAbbreviate: eB.length > 4 && eP
                    })
                })
            }) : null, es[87] = eb, es[88] = ev, es[89] = eP, es[90] = eI, es[91] = ey, es[92] = eB, es[93] = ez, es[94] = ea) : ea = es[94], es[95] !== ea ? (ei = (0, t.jsx)(u.AnimatePresence, {
                children: ea
            }), es[95] = ea, es[96] = ei) : ei = es[96], es[97] !== eV || es[98] !== Y || es[99] !== er || es[100] !== ei ? (en = (0, t.jsx)(h.Accordion.Trigger, {
                asChild: !0,
                children: (0, t.jsxs)("div", {
                    className: "w-full flex flex-col transition py-3 gap-3 overflow-visible relative group cursor-pointer",
                    onClick: eV,
                    onPointerEnter: Z,
                    onPointerLeave: K,
                    children: [Y, er, ei]
                })
            }), es[97] = eV, es[98] = Y, es[99] = er, es[100] = ei, es[101] = en) : en = es[101], en
        },
        ev = e => {
            document.querySelector(`[data-scroll-anchor="event-detail-accordion-item-${e.id}-${e.slug}"]`) ? .scrollIntoView()
        },
        ey = e => {
            let a, i, n, s, o, l = (0, r.c)(7),
                {
                    size: c
                } = e;
            l[0] !== c ? (a = (0, D.twoDecimals)(c), l[0] = c, l[1] = a) : a = l[1];
            let d = `${a} Yes`;
            return l[2] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(ex, {
                shouldExpandHorizontal: !0
            }), n = (0, t.jsx)("p", {
                className: (0, M.cn)("overflow-hidden whitespace-nowrap text-ellipsis font-semibold text-base leading-5", "max-w-[400px]"),
                children: "Other"
            }), l[2] = i, l[3] = n) : (i = l[2], n = l[3]), l[4] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)(p.IconLockFill18, {
                className: "size-4"
            }), l[4] = s) : s = l[4], l[5] !== d ? (o = (0, t.jsxs)("div", {
                className: "w-full flex flex-col transition-all duration-200 py-3 gap-3 overflow-visible relative bg-background border-t border-b border-border hover:bg-gray-50/50",
                children: [i, n, (0, t.jsx)(R.PositionChip, {
                    variant: "green",
                    className: "z-2 w-fit",
                    children: (0, t.jsxs)("div", {
                        className: "flex items-center gap-1",
                        children: [s, d]
                    })
                })]
            }), l[5] = d, l[6] = o) : o = l[6], o
        },
        eb = o.default.memo(e => {
            let a, i, n, s, l, c, d, u, m, p, x = (0, r.c)(23),
                {
                    ammChainPrices: g,
                    setResolutionDataToView: v,
                    setResolutionDialogOpen: y,
                    onOutcomeSelect: b,
                    animate: k
                } = e,
                w = o.default.useRef(null);
            x[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["market"], x[0] = a) : a = x[0];
            let {
                market: j
            } = (0, S.useEventDetailTabContext)(a);
            x[1] === Symbol.for("react.memo_cache_sentinel") ? (i = e => {
                let t = w.current;
                t && t.style.setProperty("--radix-collapsible-content-height", `${e+48}px`)
            }, x[1] = i) : i = x[1];
            let C = i;
            x[2] === Symbol.for("react.memo_cache_sentinel") ? (n = {
                book: "never",
                lastPrice: "once-when-stale"
            }, x[2] = n) : n = x[2];
            let _ = j.slug,
                T = `event-detail-accordion-item-${j.id}-${j.slug}`;
            x[3] !== g ? (s = g ? ? [], x[3] = g, x[4] = s) : s = x[4], x[5] !== b || x[6] !== v || x[7] !== y || x[8] !== s ? (l = (0, t.jsx)(h.Accordion.Header, {
                asChild: !0,
                children: (0, t.jsx)("div", {
                    className: "flex items-center justify-between flex-1 w-full bg-background font-medium text-base leading-none text-text cursor-pointer transition-all duration-200",
                    children: (0, t.jsx)(eg, {
                        ammChainPrices: s,
                        setResolutionDialogOpen: y,
                        setResolutionDataToView: v,
                        onOutcomeSelect: b
                    })
                })
            }), x[5] = b, x[6] = v, x[7] = y, x[8] = s, x[9] = l) : l = x[9];
            let N = (void 0 === k || k) && "data-[state=open]:animate-accordionSlideDown data-[state=closed]:animate-accordionSlideUp";
            return x[10] !== N ? (c = (0, M.cn)("overflow-hidden text-base text-text bg-background", N), x[10] = N, x[11] = c) : c = x[11], x[12] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)(el, {
                onHeightChange: C
            }), x[12] = d) : d = x[12], x[13] !== c ? (u = (0, t.jsx)(h.Accordion.Content, {
                ref: w,
                className: c,
                children: d
            }), x[13] = c, x[14] = u) : u = x[14], x[15] !== j.slug || x[16] !== u || x[17] !== T || x[18] !== l ? (m = (0, t.jsxs)(h.Accordion.Item, {
                value: _,
                "data-scroll-anchor": T,
                className: "[&+&]:border-t [&+&]:border-border",
                children: [l, u]
            }), x[15] = j.slug, x[16] = u, x[17] = T, x[18] = l, x[19] = m) : m = x[19], x[20] !== j || x[21] !== m ? (p = (0, t.jsx)(f.BookContextProvider, {
                market: j,
                prefetch: n,
                poll: "when-inactive",
                subscribe: "never",
                defer: "always",
                deferMs: 1e3,
                children: m
            }), x[20] = j, x[21] = m, x[22] = p) : p = x[22], p
        });

    function ek(e) {
        return e.conditionId
    }

    function ew(e) {
        return parseFloat(e.qty) > .01
    }

    function eS(e) {
        return parseFloat(e.qty) > .01
    }
    var ej = e.i(492951),
        eC = e.i(794823),
        e_ = e.i(98191),
        eT = e.i(72568),
        eM = e.i(593332),
        eN = e.i(510954),
        eI = e.i(57096),
        eP = e.i(619264),
        eE = e.i(357967),
        eA = e.i(131878),
        eO = e.i(318594);
    let eD = o.default.memo(eP.ActivitySmpCard, (e, t) => e.activity === t.activity && e.value === t.value && e.titleForGMP === t.titleForGMP && e.onGmpOutcomeClick === t.onGmpOutcomeClick && e.style === t.style && e.formattedDate === t.formattedDate && e.isLast === t.isLast),
        eL = e => {
            let c, d, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C, _, M, N, P, E, O, D, L, z, R, F, $ = (0, r.c)(104),
                {
                    sortedMarkets: B,
                    shouldShowDropdown: q
                } = e,
                V = (0, T.useTranslations)(),
                [H, U] = (0, o.useState)(!0),
                [W, G] = (0, o.useState)(null);
            $[0] === Symbol.for("react.memo_cache_sentinel") ? (c = ["activeMarket", "setActiveMarket", "setAccordionMarketSlug"], $[0] = c) : c = $[0];
            let {
                activeMarket: Z,
                setActiveMarket: K,
                setAccordionMarketSlug: Y
            } = (0, I.useEventActiveMarketContext)(c);
            $[1] !== B ? (d = B.map(ez), $[1] = B, $[2] = d) : d = $[2];
            let Q = d,
                X = void 0 !== q && q || Q.length > 1 && "string" == typeof Z ? .groupItemTitle;
            $[3] !== Q ? (u = Q.reduce(eR, {}), $[3] = Q, $[4] = u) : u = $[4];
            let J = u,
                [ee, et] = (0, o.useState)(eT.AmountFilter.One);
            $[5] !== Z || $[6] !== Q ? (m = ((e, t) => {
                if (!e || !Array.isArray(e.events)) return {
                    eventId: "",
                    conditionIds: [],
                    conditionIdsString: "",
                    conditionId: ""
                };
                let r = t.map(e => e.conditionId),
                    a = r.join(","),
                    i = e.conditionId;
                return {
                    eventId: e.events[0].id.toString(),
                    conditionIds: r,
                    conditionIdsString: a,
                    conditionId: i
                }
            })(Z, Q), $[5] = Z, $[6] = Q, $[7] = m) : m = $[7];
            let {
                eventId: er,
                conditionIds: ea,
                conditionIdsString: ei,
                conditionId: en
            } = m;
            $[8] !== ee || $[9] !== en || $[10] !== ei || $[11] !== er || $[12] !== H ? (p = eN.queryKeys[eI.QueryKey.Activity].event(ei, ee, er, en, H), $[8] = ee, $[9] = en, $[10] = ei, $[11] = er, $[12] = H, $[13] = p) : p = $[13];
            let es = p,
                eo = !!er && ea.length > 0;
            $[14] !== es.queryKey || $[15] !== eo ? (h = {
                queryKey: es.queryKey,
                queryFn: eT.activityEventPageFetcher,
                initialPageParam: 0,
                getNextPageParam: eF,
                refetchOnMount: !1,
                enabled: eo
            }, $[14] = es.queryKey, $[15] = eo, $[16] = h) : h = $[16];
            let {
                data: el,
                fetchNextPage: ec,
                hasNextPage: ed,
                status: eu,
                isFetchingNextPage: em
            } = (0, s.useInfiniteQuery)(h);
            $[17] === Symbol.for("react.memo_cache_sentinel") ? (f = ["isSportsPage", "sportSlug"], $[17] = f) : f = $[17];
            let {
                isSportsPage: ep,
                sportSlug: eh
            } = (0, A.useSportsContext)(f), ef = ep && eh !== eM.SportSlug.EPL && eh !== eM.SportSlug.UEL && eh !== eM.SportSlug.UCL;
            e: {
                let e;
                if (!el || !Array.isArray(el ? .pages)) {
                    x = void 0;
                    break e
                }
                if ($[18] !== el.pages) {
                    let t = el.pages.flat().filter(e$);
                    e = (0, eA.deduplicateTrades)(t), $[18] = el.pages, $[19] = e
                } else e = $[19];x = e
            }
            let ex = x;
            t: {
                let e;
                if (!ex) {
                    let e;
                    $[20] === Symbol.for("react.memo_cache_sentinel") ? (e = [], $[20] = e) : e = $[20], g = e;
                    break t
                }
                $[21] !== ex ? (e = ex.map(eB), $[21] = ex, $[22] = e) : e = $[22],
                g = e
            }
            let eg = g,
                ey = (0, ej.useRelativeTime)(eg);
            $[23] === Symbol.for("react.memo_cache_sentinel") ? (v = {
                threshold: 0
            }, $[23] = v) : v = $[23];
            let {
                ref: eb,
                inView: ek
            } = (0, l.useInView)(v);
            $[24] !== ex || $[25] !== ec || $[26] !== ed || $[27] !== ek || $[28] !== em ? (y = () => {
                ek && ex && Array.isArray(ex) && !em && ed && ec()
            }, $[24] = ex, $[25] = ec, $[26] = ed, $[27] = ek, $[28] = em, $[29] = y) : y = $[29], $[30] !== ex || $[31] !== ec || $[32] !== ed || $[33] !== ek || $[34] !== em || $[35] !== eu ? (b = [ex, ec, em, eu, ek, ed], $[30] = ex, $[31] = ec, $[32] = ed, $[33] = ek, $[34] = em, $[35] = eu, $[36] = b) : b = $[36], (0, o.useEffect)(y, b), $[37] !== Z || $[38] !== ea || $[39] !== H ? (k = H && ea.length > 0 ? ea : [Z.conditionId], $[37] = Z, $[38] = ea, $[39] = H, $[40] = k) : k = $[40], $[41] !== es || $[42] !== k ? (w = {
                queryKey: es,
                conditionIds: k
            }, $[41] = es, $[42] = k, $[43] = w) : w = $[43];
            let {
                addEventTradeWebsocket: ew
            } = (e => {
                let t, a, i = (0, r.c)(9),
                    {
                        queryKey: n,
                        conditionIds: s
                    } = e,
                    o = (0, eO.useQueryClient)(),
                    [, , , l, , c, d] = n.queryKey;
                i[0] !== l || i[1] !== c || i[2] !== s || i[3] !== o || i[4] !== n.queryKey || i[5] !== d ? (t = e => {
                    if (!e ? .conditionId || !(({
                            trade: e,
                            conditionIds: t,
                            conditionId: r,
                            shouldShowAll: a
                        }) => !!e.conditionId && !!Array.isArray(t) && (a ? e.conditionId === r : t.includes(e.conditionId)))({
                            trade: e,
                            conditionIds: s,
                            conditionId: c,
                            shouldShowAll: d
                        }) || !((e, t) => {
                            try {
                                let r = Number(e.price) * Number(e.size),
                                    a = Number(t);
                                if (!Number.isFinite(a) || !Number.isFinite(e.price) || !Number.isFinite(e.size) || !Number.isFinite(r)) return !1;
                                return r > a
                            } catch {
                                return !1
                            }
                        })(e, l)) return;
                    o.cancelQueries({
                        queryKey: n.queryKey
                    });
                    let t = o.getQueryData(n.queryKey);
                    if (!t || (0, eA.doesTradeExist)(t.pages, e)) return;
                    let r = {
                        pageParams: t.pageParams,
                        pages: []
                    };
                    r.pages = ((e, t) => {
                        if (!t) return e ? .pages ? ? [];
                        let r = e ? .pages ? ? [];
                        return 0 === r.length ? [
                            [t]
                        ] : [
                            [t, ...r[0]], ...r.slice(1)
                        ]
                    })(t, e), o.setQueryData(n.queryKey, r)
                }, i[0] = l, i[1] = c, i[2] = s, i[3] = o, i[4] = n.queryKey, i[5] = d, i[6] = t) : t = i[6];
                let u = t;
                return i[7] !== u ? (a = {
                    addEventTradeWebsocket: u
                }, i[7] = u, i[8] = a) : a = i[8], a
            })(w), {
                registerTradeHandler: eS,
                unregisterTradeHandler: eL
            } = (0, eC.useEventTrade)();
            $[44] !== ew || $[45] !== eS || $[46] !== eL ? (S = () => (eS("live-activity-rest", ew), () => {
                eL("live-activity-rest")
            }), j = [ew, eS, eL], $[44] = ew, $[45] = eS, $[46] = eL, $[47] = S, $[48] = j) : (S = $[47], j = $[48]), (0, o.useEffect)(S, j), $[49] !== Y || $[50] !== K || $[51] !== B ? (C = e => {
                if (!e || !Array.isArray(B)) return;
                let t = B.find(t => t.conditionId === e);
                t && (K(t), Y(t.slug), ev(t))
            }, $[49] = Y, $[50] = K, $[51] = B, $[52] = C) : C = $[52];
            let eV = C;
            $[53] !== Z ? .groupItemTitle || $[54] !== Q || $[55] !== W || $[56] !== K || $[57] !== H || $[58] !== X || $[59] !== B || $[60] !== V ? (_ = X && (0, t.jsxs)(i.DropdownMenu, {
                open: "market" === W,
                onOpenChange: e => G(e ? "market" : null),
                children: [(0, t.jsx)(i.DropdownMenuTrigger, {
                    asChild: !0,
                    children: (0, t.jsxs)(a.Button, {
                        variant: "outline",
                        size: "lg",
                        "aria-label": "sort-markets-by",
                        className: "group rounded-full focus-visible:ring-0 bg-neutral-50 hover:bg-neutral-100 border-0 flex items-center gap-2 px-4 shrink-0 w-fit",
                        children: [(0, t.jsx)("span", {
                            className: "font-semibold normal-case",
                            children: H ? V("activity.all") : Z ? .groupItemTitle
                        }), (0, t.jsx)(n.IconChevronDownOutline12, {
                            className: "transition-transform duration-200 group-data-[state=open]:rotate-180"
                        })]
                    })
                }), (0, t.jsx)(i.DropdownMenuContent, {
                    className: "w-fit max-h-[400px] overflow-y-scroll",
                    align: "start",
                    children: [{
                        conditionId: "null",
                        groupItemTitle: V("activity.all")
                    }, ...Q].map(e => (0, t.jsx)(i.DropdownMenuItem, {
                        className: "cursor-pointer",
                        onClick: () => {
                            if (!Array.isArray(B)) return;
                            if ("null" === e.conditionId || !e.conditionId) return void U(!0);
                            let t = B.find(t => t.conditionId === e.conditionId);
                            t && (U(!1), K(t))
                        },
                        children: e.groupItemTitle
                    }, e.conditionId))
                })]
            }), $[53] = Z ? .groupItemTitle, $[54] = Q, $[55] = W, $[56] = K, $[57] = H, $[58] = X, $[59] = B, $[60] = V, $[61] = _) : _ = $[61];
            let eH = "amount" === W;
            return $[62] === Symbol.for("react.memo_cache_sentinel") ? (M = e => G(e ? "amount" : null), $[62] = M) : M = $[62], $[63] !== ee || $[64] !== eH ? (N = (0, t.jsx)(eE.default, {
                amountFilter: ee,
                setAmountFilter: et,
                isOpen: eH,
                handleOpen: M,
                variant: "outline",
                size: "lg",
                triggerClassName: "rounded-full bg-neutral-50 hover:bg-neutral-100 border-0 flex items-center gap-2 px-4 shrink-0 w-fit"
            }), $[63] = ee, $[64] = eH, $[65] = N) : N = $[65], $[66] !== _ || $[67] !== N ? (P = (0, t.jsxs)("div", {
                className: "flex items-center gap-2",
                children: [_, N]
            }), $[66] = _, $[67] = N, $[68] = P) : P = $[68], $[69] !== Z ? .closed || $[70] !== H || $[71] !== B || $[72] !== V ? (E = (H ? B.some(eq) : !Z ? .closed) ? (0, t.jsxs)("div", {
                className: "flex items-center gap-2.5",
                children: [(0, t.jsxs)("span", {
                    className: "relative flex h-2.5 w-2.5 items-center justify-center",
                    children: [(0, t.jsx)("span", {
                        className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-red-500 opacity-85 [animation-duration:1.2s]"
                    }), (0, t.jsx)("span", {
                        className: "relative inline-flex h-2 w-2 rounded-full bg-red-500"
                    })]
                }), (0, t.jsx)("span", {
                    className: "text-sm font-semibold text-red-500",
                    children: V("activity.live")
                })]
            }) : null, $[69] = Z ? .closed, $[70] = H, $[71] = B, $[72] = V, $[73] = E) : E = $[73], $[74] !== P || $[75] !== E ? (O = (0, t.jsxs)("div", {
                className: "mb-2 flex items-center justify-between",
                children: [P, E]
            }), $[74] = P, $[75] = E, $[76] = O) : O = $[76], $[77] !== ex || $[78] !== ea || $[79] !== J || $[80] !== eV || $[81] !== ey || $[82] !== ef ? (D = Array.isArray(ex) && ex.length > 0 ? ex.map((e, r) => {
                var a, i;
                let n = (0, eA.getActivityId)(e),
                    s = (a = e.price, i = e.size, Number.isFinite(a) && Number.isFinite(i) ? a * i : 0),
                    o = ey[n] || "now",
                    l = r === ex.length - 1;
                return (0, t.jsx)(eD, {
                    activity: e,
                    formattedDate: o,
                    onGmpOutcomeClick: eV,
                    style: ef ? "sports" : "events",
                    titleForGMP: ea.length > 1 && J[e.conditionId],
                    value: s,
                    isLast: l
                }, n)
            }) : null, $[77] = ex, $[78] = ea, $[79] = J, $[80] = eV, $[81] = ey, $[82] = ef, $[83] = D) : D = $[83], $[84] !== ex || $[85] !== ee || $[86] !== H || $[87] !== V ? (L = Array.isArray(ex) && 0 === ex.length && ee === eT.AmountFilter.One && !1 === H ? (0, t.jsx)("p", {
                className: "mt-9 text-text-secondary font-medium text-sm text-center",
                children: V("activity.noActivityYet")
            }) : null, $[84] = ex, $[85] = ee, $[86] = H, $[87] = V, $[88] = L) : L = $[88], $[89] !== ex || $[90] !== ef ? (z = Array.isArray(ex) ? null : Array.from({
                length: 10
            }).map((e, r) => (0, t.jsx)(eP.ActivitySmpCard, {
                activity: void 0,
                formattedDate: void 0,
                style: ef ? "sports" : "events",
                titleForGMP: !1,
                value: void 0
            }, `skeleton-${r}`)), $[89] = ex, $[90] = ef, $[91] = z) : z = $[91], $[92] !== ex || $[93] !== ed || $[94] !== em || $[95] !== eb || $[96] !== V ? (R = ex && Array.isArray(ex) && ex.length > 0 && ed ? (0, t.jsxs)(a.Button, {
                ref: eb,
                variant: "ghost",
                className: "m-4 text-text-secondary cursor-pointer text-base",
                children: [em ? (0, t.jsx)(e_.default, {
                    height: "32px",
                    width: "32px",
                    color: "var(--color-text-secondary)"
                }) : null, em ? V("activity.loadingMore") : null]
            }) : null, $[92] = ex, $[93] = ed, $[94] = em, $[95] = eb, $[96] = V, $[97] = R) : R = $[97], $[98] !== O || $[99] !== D || $[100] !== L || $[101] !== z || $[102] !== R ? (F = (0, t.jsxs)("div", {
                className: "w-full flex flex-col",
                children: [O, D, L, z, R]
            }), $[98] = O, $[99] = D, $[100] = L, $[101] = z, $[102] = R, $[103] = F) : F = $[103], F
        };

    function ez(e) {
        let {
            conditionId: t,
            groupItemTitle: r
        } = e;
        return {
            conditionId: t,
            groupItemTitle: r
        }
    }

    function eR(e, t) {
        return e[t.conditionId] || "string" != typeof t.conditionId || "string" != typeof t.groupItemTitle || (e[t.conditionId] = t.groupItemTitle), e
    }

    function eF(e, t) {
        if (Array.isArray(e) && e.length > 0) return t.length
    }

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

    function eB(e) {
        return {
            id: (0, eA.getActivityId)(e),
            timestamp: 1e3 * e.timestamp
        }
    }

    function eq(e) {
        return !e.closed
    }
}, 222691, 379224, 162181, 859938, 99645, 59874, 560127, 944277, e => {
    "use strict";
    e.s(["PriceChart", () => tv], 222691);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(688589),
        n = e.i(53950),
        s = e.i(85510),
        o = e.i(225914),
        l = e.i(275042),
        c = e.i(219469),
        d = e.i(215959),
        u = e.i(97271),
        m = e.i(507909),
        p = e.i(134709),
        h = e.i(891685),
        f = e.i(445930),
        x = e.i(96515),
        g = e.i(982214),
        v = e.i(715877),
        y = e.i(399336),
        b = e.i(562806),
        k = e.i(847979);
    let w = e => {
        let a, i, n, s, o, c, d, u, m, p, f = (0, r.c)(21);
        f[0] !== e ? ({
            ref: i,
            ...a
        } = e, f[0] = e, f[1] = a, f[2] = i) : (a = f[1], i = f[2]), f[3] === Symbol.for("react.memo_cache_sentinel") ? (n = ["event"], f[3] = n) : n = f[3];
        let {
            event: x
        } = (0, h.useEventContext)(n);
        f[4] === Symbol.for("react.memo_cache_sentinel") ? (s = ["activeMarket"], f[4] = s) : s = f[4];
        let {
            activeMarket: w
        } = (0, y.useEventActiveMarketContext)(s), {
            height: S
        } = (0, l.usePriceLineChartContext)(), j = (0, b.getCryptoMarketSettings)(x.slug), C = (0, k.getEquityMarketSettings)(x.slug), _ = j ? .isDailyUpOrDown || C ? .isDailyUpOrDown || !1, T = S + 26;
        f[5] !== w.closed ? (o = w.closed && {
            forcedWindow: "1d"
        }, f[5] = w.closed, f[6] = o) : o = f[6];
        let M = w.closed || _ ? "1d" : "1h";
        f[7] !== T || f[8] !== o || f[9] !== M ? (c = {
            mode: "single",
            outcomeMode: "single",
            height: T,
            ...o,
            showOptions: !1,
            showSettings: !1,
            showTimeWindows: !1,
            showSingleModeLegend: !0,
            initialWindow: M,
            marketType: "price-market"
        }, f[7] = T, f[8] = o, f[9] = M, f[10] = c) : c = f[10];
        let N = c,
            I = (0, v.useConvertBinaryMarketToChartMarkets)(w);
        return f[11] === Symbol.for("react.memo_cache_sentinel") ? (d = [], u = [], f[11] = d, f[12] = u) : (d = f[11], u = f[12]), f[13] !== I || f[14] !== N || f[15] !== x ? (m = (0, t.jsx)("div", {
            className: "w-full h-full relative overflow-hidden -translate-y-13 lg:-translate-y-14",
            children: (0, t.jsx)(g.GroupChart, {
                markets: I,
                lowChanceMarkets: d,
                resolvedMarkets: u,
                event: x,
                options: N
            })
        }), f[13] = I, f[14] = N, f[15] = x, f[16] = m) : m = f[16], f[17] !== a || f[18] !== i || f[19] !== m ? (p = (0, t.jsx)("div", {
            ref: i,
            ...a,
            children: m
        }), f[17] = a, f[18] = i, f[19] = m, f[20] = p) : p = f[20], p
    };
    w.displayName = "AssetChart";
    var S = e.i(491636),
        j = e.i(804599),
        C = e.i(425010),
        _ = e.i(390960),
        T = e.i(864006),
        M = e.i(604777);
    let N = {
            "5m": {
                seconds: 300,
                apiInterval: "5m"
            },
            "15m": {
                seconds: 900,
                apiInterval: "15m"
            }
        },
        I = () => {
            let e, i, n, s, c, d, u, m, g, v, y, b, k, w, I, E, A, O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q, X, J = (0, r.c)(75),
                ee = (0, M.useTranslations)(),
                et = (0, T.useLocale)(),
                {
                    abbreviation: er,
                    assetType: ea
                } = (0, o.usePriceChartContext)(),
                {
                    width: ei,
                    height: en
                } = (0, l.usePriceLineChartContext)(),
                {
                    resolvedTheme: es
                } = (0, C.useTheme)(),
                eo = (0, p.default)();
            J[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["eventSettings"], J[0] = e) : e = J[0];
            let {
                eventSettings: el
            } = (0, h.useEventContext)(e), ec = "candlestick" === (0, f.useChartDataStore)(P);
            e: {
                let e = el.priceMarketSettings;
                if (e.priceMarketsUiEnabled && "fifteen" === e.variant) {
                    i = "15m";
                    break e
                }
                i = "5m"
            }
            let {
                candles: ed,
                loading: eu,
                loadingMore: em,
                error: ep,
                hasMore: eh,
                fetchMore: ef
            } = ((e, t, r, i) => {
                let [n, s] = a.default.useState([]), [o, l] = a.default.useState(!1), [c, d] = a.default.useState(!1), [u, m] = a.default.useState(null), [p, h] = a.default.useState(!0), g = a.default.useRef(!1), v = (0, f.useBoundChartDataStore)(), {
                    seconds: y,
                    apiInterval: b
                } = N[r], k = a.default.useMemo(() => (0, x.getChartSymbol)(e, t), [e, t]), w = a.default.useCallback(async () => {
                    g.current || l(!0), m(null);
                    try {
                        let t = new URLSearchParams({
                                symbol: e,
                                interval: b,
                                limit: String(30)
                            }),
                            r = await fetch(`/api/chainlink-candles?${t}`);
                        if (!r.ok) {
                            let e = await r.json().catch(() => ({
                                error: "Fetch failed"
                            }));
                            throw Error(e.error || `HTTP ${r.status}`)
                        }
                        let a = (await r.json()).candles || [];
                        g.current ? s(e => {
                            if (0 === e.length) return a;
                            let t = new Set(a.map(e => e.time)),
                                r = a.length > 0 ? a[0].time : 1 / 0,
                                i = a.length > 0 ? a[a.length - 1].time : -1 / 0,
                                n = [...e.filter(e => (e.time < r || e.time > i) && !t.has(e.time)), ...a];
                            return n.sort((e, t) => e.time - t.time), n
                        }) : (s(a), h(a.length >= 30), g.current = !0)
                    } catch (e) {
                        m(e instanceof Error ? e.message : "Failed to fetch candle data")
                    } finally {
                        l(!1)
                    }
                }, [e, b]), S = a.default.useCallback(async () => {
                    if (!c && p) {
                        d(!0);
                        try {
                            let t = n[0];
                            if (!t) return;
                            let r = 1e3 * t.time - 1,
                                a = new URLSearchParams({
                                    symbol: e,
                                    interval: b,
                                    limit: String(30),
                                    endTime: String(r)
                                }),
                                i = await fetch(`/api/chainlink-candles?${a}`);
                            if (!i.ok) return;
                            let o = (await i.json()).candles || [];
                            if (0 === o.length) return void h(!1);
                            o.length < 30 && h(!1), s(e => {
                                let t = new Set(e.map(e => e.time));
                                return [...o.filter(e => !t.has(e.time)), ...e]
                            })
                        } catch {} finally {
                            d(!1)
                        }
                    }
                }, [e, b, n, c, p]);
                return a.default.useEffect(() => {
                    if (!i) {
                        s([]), m(null), h(!0), g.current = !1;
                        return
                    }
                    g.current = !1, s([]), h(!0), w();
                    let e = setInterval(w, 1e3 * y);
                    return () => clearInterval(e)
                }, [i, w, y]), a.default.useEffect(() => {
                    if (i) return v.subscribe((e, t) => {
                        let r = e.chartData[k] ? .data,
                            a = t.chartData[k] ? .data;
                        if (!r ? .length || r === a) return;
                        let i = r[r.length - 1],
                            n = i.value,
                            o = Math.floor(i.time / y) * y;
                        s(e => {
                            if (!e.length) return e;
                            let t = [...e],
                                r = t.length - 1;
                            if (t[r].time === o) {
                                let e = { ...t[r]
                                };
                                e.close = n, e.high = Math.max(e.high, n), e.low = Math.min(e.low, n), t[r] = e
                            } else o > t[r].time && t.push({
                                time: o,
                                open: n,
                                high: n,
                                low: n,
                                close: n
                            });
                            return t
                        })
                    })
                }, [i, v, k, y]), {
                    candles: n,
                    loading: o,
                    loadingMore: c,
                    error: u,
                    hasMore: p,
                    fetchMore: S
                }
            })(er, ea, i, ec), ex = a.default.useRef(null), eg = a.default.useRef(null), ev = a.default.useRef(null), ey = a.default.useRef(0), eb = a.default.useRef(ef), ek = a.default.useRef(eh), ew = a.default.useRef(em);
            J[1] !== ef || J[2] !== eh || J[3] !== em ? (n = () => {
                eb.current = ef, ek.current = eh, ew.current = em
            }, s = [ef, eh, em], J[1] = ef, J[2] = eh, J[3] = em, J[4] = n, J[5] = s) : (n = J[4], s = J[5]), a.default.useEffect(n, s);
            let eS = "dark" === es,
                ej = eS ? "#7b8996" : "#77808d";
            J[6] === Symbol.for("react.memo_cache_sentinel") ? (c = {
                type: j.ColorType.Solid,
                color: "transparent"
            }, J[6] = c) : c = J[6], J[7] !== ej ? (d = {
                textColor: ej,
                background: c,
                attributionLogo: !1,
                fontFamily: '"Open Sauce One", sans-serif',
                fontSize: 11
            }, J[7] = ej, J[8] = d) : d = J[8];
            let eC = eS ? "#1e2a35" : "#f0f2f5";
            J[9] !== eC ? (u = {
                color: eC
            }, J[9] = eC, J[10] = u) : u = J[10], J[11] === Symbol.for("react.memo_cache_sentinel") ? (m = {
                visible: !1
            }, J[11] = m) : m = J[11], J[12] !== u ? (g = {
                horzLines: u,
                vertLines: m
            }, J[12] = u, J[13] = g) : g = J[13];
            let e_ = eS ? "#7b89964D" : "#77808d4D";
            J[14] !== et ? (v = e => (0, S.format)(1e3 * e, "p", {
                locale: (0, _.getDateFnsLocale)(et)
            }), J[14] = et, J[15] = v) : v = J[15], J[16] !== e_ || J[17] !== v ? (y = {
                borderVisible: !0,
                borderColor: e_,
                timeVisible: !0,
                secondsVisible: !1,
                shiftVisibleRangeOnNewBar: !0,
                fixLeftEdge: !1,
                fixRightEdge: !1,
                rightOffset: 5,
                tickMarkFormatter: v,
                tickMarkMaxCharacterLength: 8,
                allowBoldLabels: !1
            }, J[16] = e_, J[17] = v, J[18] = y) : y = J[18], J[19] === Symbol.for("react.memo_cache_sentinel") ? (b = {
                visible: !0,
                borderVisible: !1,
                scaleMargins: {
                    top: .1,
                    bottom: .1
                }
            }, k = {
                visible: !1
            }, J[19] = b, J[20] = k) : (b = J[19], k = J[20]);
            let eT = eS ? "#97A5B44D" : "#aeb4bc66";
            J[21] !== eT ? (w = {
                visible: !0,
                style: 2,
                color: eT,
                labelVisible: !0,
                width: 1
            }, J[21] = eT, J[22] = w) : w = J[22];
            let eM = eS ? "#97A5B44D" : "#aeb4bc66";
            J[23] !== eM ? (I = {
                visible: !0,
                style: 2,
                color: eM,
                labelVisible: !0
            }, J[23] = eM, J[24] = I) : I = J[24], J[25] !== w || J[26] !== I ? (E = {
                mode: 0,
                vertLine: w,
                horzLine: I
            }, J[25] = w, J[26] = I, J[27] = E) : E = J[27], J[28] === Symbol.for("react.memo_cache_sentinel") ? (A = {
                mouseWheel: !0,
                pressedMouseMove: !0
            }, O = {
                mouseWheel: !0,
                pinch: !0
            }, J[28] = A, J[29] = O) : (A = J[28], O = J[29]), J[30] !== en || J[31] !== g || J[32] !== y || J[33] !== E || J[34] !== d || J[35] !== ei ? (D = {
                width: ei,
                height: en,
                layout: d,
                grid: g,
                autoSize: !1,
                timeScale: y,
                rightPriceScale: b,
                leftPriceScale: k,
                crosshair: E,
                handleScroll: A,
                handleScale: O
            }, J[30] = en, J[31] = g, J[32] = y, J[33] = E, J[34] = d, J[35] = ei, J[36] = D) : D = J[36];
            let eN = D;
            J[37] === Symbol.for("react.memo_cache_sentinel") ? (L = {
                upColor: "#22c55e",
                downColor: "#ef4444",
                wickUpColor: "#22c55e",
                wickDownColor: "#ef4444",
                borderVisible: !1
            }, J[37] = L) : L = J[37];
            let eI = L;
            J[38] === Symbol.for("react.memo_cache_sentinel") ? (z = e => {
                e && !ew.current && ek.current && e.from <= 5 && eb.current()
            }, J[38] = z) : z = J[38];
            let eP = z;
            return (J[39] !== eN || J[40] !== ec || J[41] !== eo ? (R = () => {
                if (!eo || !ex.current || !ec) return;
                let e = (0, j.createChart)(ex.current, eN);
                return eg.current = e, ev.current = e.addSeries(j.CandlestickSeries, eI), ey.current = 0, e.timeScale().subscribeVisibleLogicalRangeChange(eP), () => {
                    e.timeScale().unsubscribeVisibleLogicalRangeChange(eP), e.remove(), eg.current = null, ev.current = null, ey.current = 0
                }
            }, J[39] = eN, J[40] = ec, J[41] = eo, J[42] = R) : R = J[42], J[43] !== ec || J[44] !== eo ? (F = [eo, ec], J[43] = ec, J[44] = eo, J[45] = F) : F = J[45], a.default.useEffect(R, F), J[46] !== eN ? ($ = () => {
                eg.current && eg.current.applyOptions(eN)
            }, B = [eN], J[46] = eN, J[47] = $, J[48] = B) : ($ = J[47], B = J[48]), a.default.useEffect($, B), J[49] === Symbol.for("react.memo_cache_sentinel") ? (q = () => {
                ev.current && ev.current.applyOptions(eI)
            }, V = [eI], J[49] = q, J[50] = V) : (q = J[49], V = J[50]), a.default.useEffect(q, V), J[51] !== en || J[52] !== ei ? (H = () => {
                eg.current && eg.current.resize(ei, en)
            }, U = [ei, en], J[51] = en, J[52] = ei, J[53] = H, J[54] = U) : (H = J[53], U = J[54]), a.default.useEffect(H, U), J[55] !== ed ? (W = () => {
                if (!ev.current || !ed.length) return;
                let e = ed.map(e => ({
                    time: e.time,
                    open: e.open,
                    high: e.high,
                    low: e.low,
                    close: e.close
                }));
                if (0 === ey.current) {
                    ev.current.setData(e), eg.current ? .timeScale().fitContent(), ey.current = ed.length;
                    return
                }
                let t = ey.current,
                    r = ed.length,
                    a = r - t;
                if (a >= 1) {
                    let t = eg.current ? .timeScale().getVisibleLogicalRange();
                    ev.current.setData(e), t && eg.current ? .timeScale().setVisibleLogicalRange({
                        from: t.from + a,
                        to: t.to + a
                    })
                } else {
                    let t = e[e.length - 1];
                    t && ev.current.update(t)
                }
                ey.current = r
            }, G = [ed], J[55] = ed, J[56] = W, J[57] = G) : (W = J[56], G = J[57]), a.default.useEffect(W, G), eo && ec) ? (J[58] !== ed || J[59] !== eu ? (Z = eu && 0 === ed.length && (0, t.jsx)("div", {
                className: "absolute inset-0 flex items-center justify-center z-10",
                children: (0, t.jsx)("div", {
                    className: "h-6 w-6 animate-spin rounded-full border-2 border-text-secondary border-t-transparent"
                })
            }), J[58] = ed, J[59] = eu, J[60] = Z) : Z = J[60], J[61] !== ed || J[62] !== ep || J[63] !== ee ? (K = ep && 0 === ed.length && (0, t.jsx)("div", {
                className: "absolute inset-0 flex items-center justify-center z-10",
                children: (0, t.jsx)("p", {
                    className: "text-sm text-text-secondary",
                    children: ee("events.unableToLoadChart")
                })
            }), J[61] = ed, J[62] = ep, J[63] = ee, J[64] = K) : K = J[64], J[65] !== em ? (Y = em && (0, t.jsx)("div", {
                className: "absolute top-2 left-2 z-10",
                children: (0, t.jsx)("div", {
                    className: "h-4 w-4 animate-spin rounded-full border-2 border-text-secondary border-t-transparent"
                })
            }), J[65] = em, J[66] = Y) : Y = J[66], J[67] !== en || J[68] !== ei ? (Q = (0, t.jsx)("div", {
                ref: ex,
                style: {
                    width: ei,
                    height: en
                }
            }), J[67] = en, J[68] = ei, J[69] = Q) : Q = J[69], J[70] !== Z || J[71] !== K || J[72] !== Y || J[73] !== Q ? (X = (0, t.jsxs)("div", {
                className: "w-full h-full relative",
                children: [Z, K, Y, Q]
            }), J[70] = Z, J[71] = K, J[72] = Y, J[73] = Q, J[74] = X) : X = J[74], X) : null
        };

    function P(e) {
        return e.chartType
    }
    var E = e.i(208956),
        A = e.i(481640),
        O = e.i(233522),
        D = e.i(476001),
        L = e.i(660635),
        z = e.i(944891),
        R = e.i(870555),
        F = e.i(23128),
        $ = e.i(169010),
        B = e.i(402947),
        q = e.i(213567);
    let V = (e, t = 2) => {
        let r = Math.abs(e).toLocaleString("en-US", {
            style: "decimal",
            minimumFractionDigits: t,
            maximumFractionDigits: t
        });
        return e < 0 ? `-$${r}` : `$${r}`
    };
    var H = e.i(994883),
        U = e.i(458255),
        W = e.i(162923),
        G = e.i(471027);
    e.i(304697);
    var Z = e.i(179645),
        K = e.i(991092);
    let Y = e => {
        let i, n, s, o, l, c, d, u, m = (0, r.c)(24),
            {
                event: p,
                isLive: h
            } = e,
            f = (0, M.useTranslations)(),
            x = (0, T.useLocale)(),
            g = {
                locale: (0, _.getDateFnsLocale)(x)
            };
        m[0] === Symbol.for("react.memo_cache_sentinel") ? (i = {
            hasEnded: !1,
            days: 0,
            hours: 0,
            minutes: 0
        }, m[0] = i) : i = m[0];
        let [v, y] = (0, a.useState)(i), {
            endDate: b,
            closedTime: k,
            closed: w
        } = p;
        if (m[1] !== w || m[2] !== k || m[3] !== b ? (w && k ? n = k : b && (n = b), m[1] = w, m[2] = k, m[3] = b, m[4] = n) : n = m[4], m[5] !== n ? (s = () => {
                if (!n) return;
                let e = new Date(n);
                if (!(0, K.isValid)(e)) return;
                let t = () => {
                    y((e => {
                        let t = e.getTime() - (0, L.getServerNow)();
                        if (t <= 0) return {
                            hasEnded: !0,
                            days: 0,
                            hours: 0,
                            minutes: 0
                        };
                        let r = Math.floor(t / 864e5);
                        return {
                            hasEnded: !1,
                            days: r,
                            hours: Math.floor(t % 864e5 / 36e5),
                            minutes: Math.floor(t % 36e5 / 6e4)
                        }
                    })(e))
                };
                t();
                let r = setInterval(t, 1e3);
                return () => clearInterval(r)
            }, m[5] = n, m[6] = s) : s = m[6], m[7] !== n ? (o = [n], m[7] = n, m[8] = o) : o = m[8], (0, a.useEffect)(s, o), !n) return null;
        let j = new Date(n);
        if (!(0, K.isValid)(j)) return null;
        let {
            timezone: C
        } = (0, W.getSeriesSettings)(p.slug), N = new Z.TZDate(j, C), I = new Z.TZDate(j, "UTC"), P = (0, S.format)(N, "zzz");
        "America/New_York" === C && (P = "ET");
        let E = "UTC" === C || "UTC" === P;
        m[9] !== f || m[10] !== v.days || m[11] !== v.hasEnded || m[12] !== v.hours || m[13] !== v.minutes ? (l = () => {
            if (v.hasEnded) return (0, t.jsxs)("div", {
                className: "flex items-center gap-1.5",
                children: [(0, t.jsx)(G.IconGavelOutline18, {
                    className: "text-text-primary",
                    size: 18
                }), (0, t.jsx)("span", {
                    className: "font-medium text-sm text-text-primary",
                    children: f("events.resolutionCountdown.eventHasEnded")
                })]
            });
            let e = [];
            return v.days > 0 && e.push((0, t.jsx)("span", {
                className: "mr-1 my-auto",
                children: (0, t.jsxs)("span", {
                    className: "font-medium text-xs text-text-primary",
                    children: [v.days, " ", 1 === v.days ? f("events.resolutionCountdown.day") : f("events.resolutionCountdown.days")]
                })
            }, "days")), v.hours > 0 && e.push((0, t.jsx)("span", {
                className: "mr-1 my-auto",
                children: (0, t.jsxs)("span", {
                    className: "font-medium text-xs text-text-primary",
                    children: [v.hours, " ", 1 === v.hours ? f("events.resolutionCountdown.hr") : f("events.resolutionCountdown.hrs")]
                })
            }, "hours")), e.push((0, t.jsxs)("span", {
                className: "my-auto",
                children: [(0, t.jsxs)("span", {
                    className: "font-medium text-xs text-neutral-950",
                    children: [v.minutes, " ", 1 === v.minutes ? f("events.resolutionCountdown.min") : f("events.resolutionCountdown.mins"), " "]
                }), (0, t.jsx)("span", {
                    className: "text-text-secondary font-normal text-xs",
                    children: f("events.resolutionCountdown.left")
                })]
            }, "minutes")), (0, t.jsx)("div", {
                className: "flex text-xs",
                children: e
            })
        }, m[9] = f, m[10] = v.days, m[11] = v.hasEnded, m[12] = v.hours, m[13] = v.minutes, m[14] = l) : l = m[14];
        let A = l;
        return m[15] !== h || m[16] !== A || m[17] !== f || m[18] !== v.hasEnded ? (c = !v.hasEnded && h ? (0, t.jsxs)("div", {
            className: "mb-3.5 flex items-center justify-between",
            children: [(0, t.jsxs)("div", {
                className: "flex items-center my-auto",
                children: [(0, t.jsxs)("div", {
                    className: "relative",
                    children: [(0, t.jsx)("div", {
                        className: "w-1.5 h-1.5 bg-red-500 rounded-full"
                    }), (0, t.jsx)("div", {
                        className: "absolute -inset-0.5 w-2.5 h-2.5 bg-red-500 rounded-full opacity-75",
                        style: {
                            animation: "ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite"
                        }
                    })]
                }), (0, t.jsx)("span", {
                    className: "text-red-500 font-semibold text-xs ml-2.5 uppercase",
                    children: f("cards.live")
                })]
            }), (0, t.jsx)("div", {
                className: "my-auto",
                children: A()
            })]
        }) : (0, t.jsx)("div", {
            className: "mb-3.5",
            children: A()
        }), m[15] = h, m[16] = A, m[17] = f, m[18] = v.hasEnded, m[19] = c) : c = m[19], m[20] !== f ? (d = f("events.resolutionCountdown.resolutionTime"), m[20] = f, m[21] = d) : d = m[21], m[22] !== d ? (u = (0, t.jsx)("div", {
            className: "mb-2 text-xs font-normal text-text-secondary",
            children: d
        }), m[22] = d, m[23] = u) : u = m[23], (0, t.jsxs)("div", {
            className: "text-left leading-6 min-w-[280px] py-2 px-1 text-neutral-950",
            children: [c, u, (0, t.jsxs)("div", {
                className: `${E?"mb-0":"mb-1"} flex items-center justify-between text-neutral-950`,
                children: [(0, t.jsxs)("div", {
                    className: "flex items-center",
                    children: [(0, t.jsx)("span", {
                        className: "inline-block bg-neutral-50 text-neutral-950 py-0.5 px-1.5 rounded text-xs font-medium mr-2 min-w-[30px] text-center",
                        children: P
                    }), (0, t.jsx)("span", {
                        children: (0, S.format)(N, "MMM d, yyyy", g)
                    })]
                }), (0, t.jsx)("span", {
                    className: "font-medium",
                    children: (0, S.format)(N, "p", g)
                })]
            }), !E && (0, t.jsxs)("div", {
                className: "flex items-center justify-between text-neutral-950",
                children: [(0, t.jsxs)("div", {
                    className: "flex items-center",
                    children: [(0, t.jsx)("span", {
                        className: "inline-block bg-neutral-50 text-neutral-950 py-0.5 px-1.5 rounded text-xs font-medium mr-2 min-w-[30px] text-center",
                        children: "UTC"
                    }), (0, t.jsx)("span", {
                        children: (0, S.format)(I, "MMM d, yyyy", g)
                    })]
                }), (0, t.jsx)("span", {
                    className: "font-medium",
                    children: (0, S.format)(I, "p", g)
                })]
            })]
        })
    };
    var Q = e.i(294472);
    let X = e => {
        let a, i, n, s, o, l = (0, r.c)(7),
            {
                digit: u,
                digitKey: m
            } = e;
        return l[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
            y: 20,
            opacity: 0
        }, i = {
            y: 0,
            opacity: 1
        }, n = {
            y: -20,
            opacity: 0
        }, s = {
            duration: .3,
            ease: "easeInOut"
        }, l[0] = a, l[1] = i, l[2] = n, l[3] = s) : (a = l[0], i = l[1], n = l[2], s = l[3]), l[4] !== u || l[5] !== m ? (o = (0, t.jsx)("div", {
            className: "relative inline-block w-[1ch] h-[1.38rem] overflow-hidden",
            children: (0, t.jsx)(c.AnimatePresence, {
                mode: "popLayout",
                children: (0, t.jsx)(d.motion.div, {
                    initial: a,
                    animate: i,
                    exit: n,
                    transition: s,
                    className: "absolute inset-0 flex items-center justify-center",
                    children: u
                }, m)
            })
        }), l[4] = u, l[5] = m, l[6] = o) : o = l[6], o
    };
    (0, a.memo)(e => {
        let i, n, s, o, l = (0, r.c)(15),
            {
                value: c,
                className: d
            } = e,
            u = c.toString().padStart(2, "0"),
            m = (0, a.useRef)(u),
            [p, h] = (0, a.useState)(u.split("").map(et));
        l[0] !== p || l[1] !== u || l[2] !== m ? (i = () => {
            let e = u.split(""),
                t = m.current.split("");
            if (u !== m.current) {
                let r = Date.now();
                h(e.map((e, a) => e !== t[a] ? `${a}-${e}-${r}` : p[a])), m.current = u
            }
        }, l[0] = p, l[1] = u, l[2] = m, l[3] = i) : i = l[3], l[4] !== p || l[5] !== u ? (n = [u, p], l[4] = p, l[5] = u, l[6] = n) : n = l[6], (0, a.useEffect)(i, n);
        let f = `flex ${d}`;
        if (l[7] !== p || l[8] !== u) {
            let e;
            l[10] !== p ? (e = (e, r) => (0, t.jsx)(X, {
                digit: e,
                digitKey: p[r]
            }, p[r]), l[10] = p, l[11] = e) : e = l[11], s = u.split("").map(e), l[7] = p, l[8] = u, l[9] = s
        } else s = l[9];
        return l[12] !== f || l[13] !== s ? (o = (0, t.jsx)("div", {
            className: f,
            children: s
        }), l[12] = f, l[13] = s, l[14] = o) : o = l[14], o
    }).displayName = "AnimatedNumber";
    let J = (0, a.memo)(e => {
        let a, i, n, s, o, l = (0, r.c)(11),
            {
                val: c,
                label: d,
                isOverOneDay: u
            } = e,
            m = u ? "var(--neutral-500)" : "#ef4444";
        return l[0] !== m ? (a = {
            color: m
        }, l[0] = m, l[1] = a) : a = l[1], l[2] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(U.AnimatedNumber.Digits, {}), l[2] = i) : i = l[2], l[3] !== a || l[4] !== c ? (n = (0, t.jsx)(U.AnimatedNumber.Root, {
            value: c,
            decimalCount: 0,
            fontSize: 24,
            padding: 0,
            noDebounce: !0,
            zeroPadBeforeDecimal: !0,
            className: "flex justify-center font-semibold",
            style: a,
            children: i
        }), l[3] = a, l[4] = c, l[5] = n) : n = l[5], l[6] !== d ? (s = (0, t.jsx)("span", {
            className: "text-[10px] font-semibold text-neutral-500 mt-[0.25rem] text-center w-full uppercase",
            children: d
        }), l[6] = d, l[7] = s) : s = l[7], l[8] !== n || l[9] !== s ? (o = (0, t.jsxs)("div", {
            className: "flex flex-col items-center justify-center w-10",
            children: [n, s]
        }), l[8] = n, l[9] = s, l[10] = o) : o = l[10], o
    });
    J.displayName = "Unit";
    let ee = e => {
        let i, n, s, o, l, c, d, u, m, p = (0, r.c)(33),
            {
                endDate: h,
                endDateIso: f,
                slug: x,
                closed: g,
                onComplete: v
            } = e,
            y = void 0 === x ? "" : x,
            b = (0, M.useTranslations)(),
            [k, w] = (0, a.useState)(null);
        p[0] !== y ? (i = (0, W.getSeriesSettings)(y), p[0] = y, p[1] = i) : i = p[1];
        let {
            shouldShowDetailedTime: S
        } = i, j = a.default.useRef(null);
        if (p[2] !== h || p[3] !== f || p[4] !== v || p[5] !== S || p[6] !== y ? (n = () => {
                (0, L.calibrateClock)();
                let e = () => {
                    ((e, t, r, a, i, n, s) => {
                        if ((0, L.isClockCalibrated)()) {
                            if (!(e || t)) {
                                r && s(null);
                                return
                            }
                            try {
                                let o = e ? new Date(e) : (0, H.parse)(t, "yyyy-MM-dd", new Date);
                                if (Number.isNaN(o.getTime())) {
                                    r && s(null);
                                    return
                                }
                                let l = o.getTime() - (0, L.getServerNow)();
                                if (l < 0) {
                                    r && s(null), i.current !== a && n ? .(a, e, t);
                                    return
                                }
                                s((0, Q.getTimeBreakdown)(l))
                            } catch {
                                r && s(null)
                            }
                        }
                    })(h, f, S, y, j, v, w)
                };
                e();
                let t = setInterval(e, 1e3),
                    r = () => {
                        document.hidden || (w(null), e())
                    };
                return window.addEventListener("visibilitychange", r), window.addEventListener("focus", r), () => {
                    clearInterval(t), window.removeEventListener("visibilitychange", r), window.removeEventListener("focus", r)
                }
            }, p[2] = h, p[3] = f, p[4] = v, p[5] = S, p[6] = y, p[7] = n) : n = p[7], p[8] !== h || p[9] !== f || p[10] !== S ? (s = [h, f, S], p[8] = h, p[9] = f, p[10] = S, p[11] = s) : s = p[11], (0, a.useEffect)(n, s), !S || !k || k.d >= 30) return null;
        let C = "events.resolutionCountdown";
        p[12] !== b || p[13] !== k.d || p[14] !== k.h || p[15] !== k.m || p[16] !== k.s ? (o = k.d > 0 ? [{
            val: k.d,
            label: b(1 === k.d ? `${C}.day` : `${C}.days`),
            key: "day"
        }, {
            val: k.h,
            label: b(1 === k.h ? `${C}.hr` : `${C}.hrs`),
            key: "hour"
        }, {
            val: k.m,
            label: b(1 === k.m ? `${C}.min` : `${C}.mins`),
            key: "minute"
        }] : k.h > 0 ? [{
            val: k.h,
            label: b(1 === k.h ? `${C}.hr` : `${C}.hrs`),
            key: "hour"
        }, {
            val: k.m,
            label: b(1 === k.m ? `${C}.min` : `${C}.mins`),
            key: "minute"
        }, {
            val: k.s,
            label: b(1 === k.s ? `${C}.sec` : `${C}.secs`),
            key: "second"
        }] : [{
            val: k.m,
            label: b(1 === k.m ? `${C}.min` : `${C}.mins`),
            key: "minute"
        }, {
            val: k.s,
            label: b(1 === k.s ? `${C}.sec` : `${C}.secs`),
            key: "second"
        }], p[12] = b, p[13] = k.d, p[14] = k.h, p[15] = k.m, p[16] = k.s, p[17] = o) : o = p[17];
        let _ = o;
        p[18] !== h || p[19] !== f ? (l = h || (f ? (0, H.parse)(f, "yyyy-MM-dd", new Date).toISOString() : ""), p[18] = h, p[19] = f, p[20] = l) : l = p[20];
        let T = y || "";
        p[21] !== l || p[22] !== T ? (c = {
            endDate: l,
            closed: !1,
            closedTime: void 0,
            slug: T
        }, p[21] = l, p[22] = T, p[23] = c) : c = p[23];
        let N = c,
            I = !!k && !(void 0 !== g && g),
            P = k.d >= 1;
        return p[24] !== N || p[25] !== I ? (d = (0, t.jsx)(Y, {
            event: N,
            isLive: I
        }), p[24] = N, p[25] = I, p[26] = d) : d = p[26], p[27] !== P || p[28] !== _ ? (u = (0, t.jsx)("div", {
            className: "flex items-center gap-1.5 my-auto cursor-pointer hover:opacity-90",
            children: _.map(e => (0, t.jsx)(J, {
                val: e.val,
                label: e.label,
                isOverOneDay: P
            }, e.key))
        }), p[27] = P, p[28] = _, p[29] = u) : u = p[29], p[30] !== d || p[31] !== u ? (m = (0, t.jsx)($.Tooltip, {
            content: d,
            sideOffset: 16,
            children: u
        }), p[30] = d, p[31] = u, p[32] = m) : m = p[32], m
    };

    function et(e, t) {
        return `${t}-${e}`
    }
    e.s(["MarketCountdownTimer", 0, ee], 379224);
    let er = () => {
        let {
            event: e
        } = (0, h.useEventContext)(["event"]), {
            activeMarket: r
        } = (0, y.useEventActiveMarketContext)(["activeMarket"]), {
            shouldShowDetailedTime: i
        } = (0, W.getSeriesSettings)(e.slug), [n] = a.default.useState(() => (0, L.getServerNow)()), s = a.default.useMemo(() => {
            if (!i || !r.endDate && !r.endDateIso) return !1;
            try {
                let e = r.endDate ? new Date(r.endDate) : (0, H.parse)(r.endDateIso, "yyyy-MM-dd", new Date);
                if (Number.isNaN(e.getTime())) return !1;
                let t = e.getTime() - n;
                if (t < 0) return !1;
                return 30 > Math.floor(t / 864e5)
            } catch {
                return !1
            }
        }, [i, r.endDate, r.endDateIso, n]);
        return (0, t.jsx)(c.AnimatePresence, {
            mode: "popLayout",
            initial: !1,
            children: s && (0, t.jsx)(ee, {
                endDate: r.endDate,
                endDateIso: r.endDateIso,
                slug: e.slug,
                closed: r.closed ? ? !1
            })
        })
    };
    var ea = e.i(177600);
    e.i(686518);
    var ei = e.i(907855),
        en = e.i(787909);
    let es = e => {
        let a, i, n, s, o, l, c, d = (0, r.c)(19),
            {
                value: u,
                color: m,
                changePosition: p,
                change: h,
                decimals: f,
                priceClassName: x
            } = e,
            g = void 0 === p ? "bottom" : p,
            v = void 0 === f ? 2 : f;
        d[0] !== v || d[1] !== u ? (a = Number.isFinite(u) ? parseFloat(u.toFixed(v)) : 0, d[0] = v, d[1] = u, d[2] = a) : a = d[2];
        let y = a,
            b = `${void 0===x?"text-heading-2xl":x} normal-nums!`;
        return d[3] !== m ? (i = {
            color: m
        }, d[3] = m, d[4] = i) : i = d[4], d[5] !== v ? (n = {
            minimumFractionDigits: v,
            maximumFractionDigits: v
        }, d[5] = v, d[6] = n) : n = d[6], d[7] === Symbol.for("react.memo_cache_sentinel") ? (s = {
            duration: 450,
            easing: "linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"
        }, d[7] = s) : s = d[7], d[8] !== y || d[9] !== b || d[10] !== i || d[11] !== n ? (o = (0, t.jsx)(ei.default, {
            prefix: "$",
            value: y,
            className: b,
            style: i,
            trend: 0,
            format: n,
            transformTiming: s
        }), d[8] = y, d[9] = b, d[10] = i, d[11] = n, d[12] = o) : o = d[12], d[13] !== h || d[14] !== g ? (l = void 0 !== h && "bottom" === g && (0, t.jsx)(ea.PriceChange, {
            className: "mt-1",
            priceChange: h,
            noDebounce: !0,
            decimalCount: 1,
            size: 12,
            delay: 0,
            hideOnZeroValue: !1
        }), d[13] = h, d[14] = g, d[15] = l) : l = d[15], d[16] !== l || d[17] !== o ? (c = (0, t.jsx)("div", {
            className: "font-[620] flex items-center gap-1",
            children: (0, t.jsxs)(en.NumberFlowGroup, {
                children: [o, l]
            })
        }), d[16] = l, d[17] = o, d[18] = c) : c = d[18], c
    };
    var eo = e.i(766181);
    let el = (0, eo.cva)("text-heading-2xl mt-1 tracking-wide font-[620]", {
            variants: {
                color: {
                    secondary: "text-text-secondary",
                    primary: "text-text"
                }
            },
            defaultVariants: {
                color: "primary"
            }
        }),
        ec = e => {
            let a, i, n, s = (0, r.c)(11),
                {
                    value: o,
                    color: l,
                    formatter: c,
                    isPlaceholder: d,
                    decimals: u,
                    priceClassName: m
                } = e,
                p = void 0 === c ? V : c,
                h = void 0 !== d && d,
                f = void 0 === m ? "text-heading-2xl" : m;
            return s[0] !== l || s[1] !== f ? (a = (0, R.cn)(el({
                color: l
            }), f), s[0] = l, s[1] = f, s[2] = a) : a = s[2], s[3] !== u || s[4] !== p || s[5] !== h || s[6] !== o ? (i = h ? "--" : p(o, u), s[3] = u, s[4] = p, s[5] = h, s[6] = o, s[7] = i) : i = s[7], s[8] !== a || s[9] !== i ? (n = (0, t.jsx)("span", {
                className: a,
                children: i
            }), s[8] = a, s[9] = i, s[10] = n) : n = s[10], n
        },
        ed = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: m.opacityTransition
            },
            exit: {
                opacity: 0,
                transition: m.opacityTransition
            }
        },
        eu = e => {
            let a, i, n, s, o, l, c, u, m, p, h, f, x, g, v = (0, r.c)(36);
            v[0] !== e ? ({
                ref: l,
                className: i,
                label: n,
                changeDecimals: a,
                priceClassName: s,
                ...o
            } = e, v[0] = e, v[1] = a, v[2] = i, v[3] = n, v[4] = s, v[5] = o, v[6] = l) : (a = v[1], i = v[2], n = v[3], s = v[4], o = v[5], l = v[6]);
            let y = a ? ? o.decimals ? ? 2;
            e: {
                let e;
                if ("animated" === o.variant) {
                    let e;
                    v[7] !== o.color ? (e = {
                        color: o.color,
                        opacity: .8
                    }, v[7] = o.color, v[8] = e) : e = v[8], c = e;
                    break e
                }
                if ("default" === o.variant) {
                    let e, t = "primary" === o.color ? "var(--color-text)" : "var(--color-text-secondary)";
                    v[9] !== t ? (e = {
                        color: t,
                        opacity: .8
                    }, v[9] = t, v[10] = e) : e = v[10], c = e;
                    break e
                }
                v[11] === Symbol.for("react.memo_cache_sentinel") ? (e = {}, v[11] = e) : e = v[11],
                c = e
            }
            let b = c;
            return v[12] !== i ? (u = (0, R.cn)("flex flex-col", i), v[12] = i, v[13] = u) : u = v[13], v[14] !== n || v[15] !== b ? (m = (0, t.jsx)("span", {
                className: "text-body-xs font-semibold",
                style: b,
                children: n
            }), v[14] = n, v[15] = b, v[16] = m) : m = v[16], v[17] !== y || v[18] !== o.change || v[19] !== o.changePosition ? (p = void 0 !== o.change && "top" === o.changePosition && (0, t.jsx)(ea.PriceChange, {
                priceChange: o.change,
                noDebounce: !0,
                decimalCount: y ? ? 2,
                size: 11,
                fontSize: 11,
                textClassName: "font-semibold normal-nums!",
                delay: 0,
                hideOnZeroValue: !1,
                coerceToDollars: !0
            }), v[17] = y, v[18] = o.change, v[19] = o.changePosition, v[20] = p) : p = v[20], v[21] !== m || v[22] !== p ? (h = (0, t.jsxs)("div", {
                className: "flex items-center gap-1 justify-between",
                children: [m, p]
            }), v[21] = m, v[22] = p, v[23] = h) : h = v[23], v[24] !== s || v[25] !== o ? (f = "animated" === o.variant && (0, t.jsx)(es, { ...o,
                priceClassName: s
            }), v[24] = s, v[25] = o, v[26] = f) : f = v[26], v[27] !== s || v[28] !== o ? (x = "default" === o.variant && (0, t.jsx)(ec, { ...o,
                priceClassName: s
            }), v[27] = s, v[28] = o, v[29] = x) : x = v[29], v[30] !== l || v[31] !== u || v[32] !== h || v[33] !== f || v[34] !== x ? (g = (0, t.jsxs)(d.motion.div, {
                ref: l,
                className: u,
                variants: ed,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                children: [h, f, x]
            }), v[30] = l, v[31] = u, v[32] = h, v[33] = f, v[34] = x, v[35] = g) : g = v[35], g
        };

    function em() {
        return (0, L.isClockCalibrated)() ? (0, L.getServerNow)() : 0
    }
    eu.displayName = "TitlePrice", e.s(["TitlePrice", 0, eu], 162181);
    let ep = ({
        ref: e,
        className: i,
        ...n
    }) => {
        let s = (0, M.useTranslations)(),
            {
                event: l,
                eventSettings: d
            } = (0, h.useEventContext)(["event", "eventSettings"]),
            {
                activeMarket: u
            } = (0, y.useEventActiveMarketContext)(["activeMarket"]),
            {
                resolvedTheme: m
            } = (0, C.useTheme)(),
            p = "dark" === m,
            {
                abbreviation: g,
                assetType: v
            } = (0, o.usePriceChartContext)(),
            b = a.default.useMemo(() => (0, x.getPriceMarketAssetColorMap)(p)[g], [g, p]),
            k = ((e, t) => {
                let a, i = (0, r.c)(3);
                if (i[0] !== e || i[1] !== t) {
                    let r;
                    r = (0, x.getChartSymbol)(e, t), a = e => {
                        let t = e.chartData[r];
                        return t && t.data && 0 !== t.data.length ? t.data[t.data.length - 1] ? .value ? ? 0 : 0
                    }, i[0] = e, i[1] = t, i[2] = a
                } else a = i[2];
                let n = a;
                return (0, f.useChartDataStore)(n, O.shallow)
            })(g, v),
            {
                targetPrice: w,
                finalPrice: S
            } = ((e, t) => {
                let a, i = (0, r.c)(3);
                if (i[0] !== e || i[1] !== t) {
                    let r;
                    r = (0, x.getChartSymbol)(e, t), a = e => {
                        let t = e.chartData[r];
                        return t ? {
                            targetPrice: t.target ? ? void 0,
                            finalPrice: t.final ? ? void 0
                        } : {
                            targetPrice: void 0,
                            finalPrice: void 0
                        }
                    }, i[0] = e, i[1] = t, i[2] = a
                } else a = i[2];
                let n = a;
                return (0, f.useChartDataStore)(n, O.shallow)
            })(g, v),
            {
                hasStarted: j,
                hasEnded: _
            } = a.default.useMemo(() => d.priceMarketSettings.priceMarketsUiEnabled ? {
                hasStarted: d.priceMarketSettings.hasStarted,
                hasEnded: d.priceMarketSettings.hasEnded
            } : {
                hasStarted: !1,
                hasEnded: !1
            }, [d.priceMarketSettings]),
            T = a.default.useMemo(() => !!l ? .slug && /-(5m|15m)-\d{10}$/.test(l.slug), [l ? .slug]) && d.priceMarketSettings.priceMarketsUiEnabled && !_,
            N = function(e) {
                let t, i, n = (0, r.c)(4),
                    [s, o] = a.default.useState(em);
                return n[0] !== e || 1e3 !== n[1] ? (t = () => {
                    if (!e) return;
                    (0, L.calibrateClock)();
                    let t = setInterval(() => {
                        (0, L.isClockCalibrated)() && o((0, L.getServerNow)())
                    }, 1e3);
                    return () => clearInterval(t)
                }, i = [e, 1e3], n[0] = e, n[1] = 1e3, n[2] = t, n[3] = i) : (t = n[2], i = n[3]), a.default.useEffect(t, i), s
            }(T),
            I = a.default.useMemo(() => {
                if (_) return !0;
                if (!T) return _;
                let e = u ? .endDate ? ? u ? .endDateIso;
                if (!e) return !1;
                let t = new Date(e).getTime();
                return !Number.isNaN(t) && t < N
            }, [_, T, u ? .endDate, u ? .endDateIso, N]),
            P = a.default.useMemo(() => I ? (0, D.getLiveCryptoMarketHref)(l ? .slug) : null, [l ? .slug, I]),
            H = s("homepageV2.priceToBeat"),
            U = s("events.finalPrice"),
            W = s("homepageV2.currentPrice"),
            {
                priceChangeDecimals: G,
                priceChange: Z,
                finalPriceChange: K
            } = a.default.useMemo(() => {
                if (void 0 === w) return {
                    priceChangeDecimals: 0,
                    priceChange: void 0,
                    finalPriceChange: void 0
                };
                let e = void 0 !== k && 0 !== k ? k - w : void 0,
                    t = void 0 !== S ? S - w : void 0,
                    r = Math.abs(e ? ? t ? ? 0);
                return g === x.PriceMarketAssetAbbr.Dogecoin ? {
                    priceChangeDecimals: 6,
                    priceChange: e,
                    finalPriceChange: t
                } : g === x.PriceMarketAssetAbbr.XRP || g === x.PriceMarketAssetAbbr.Hyperliquid || g === x.PriceMarketAssetAbbr.BNB ? {
                    priceChangeDecimals: 4,
                    priceChange: e,
                    finalPriceChange: t
                } : r < 1 ? {
                    priceChangeDecimals: 2,
                    priceChange: e,
                    finalPriceChange: t
                } : {
                    priceChangeDecimals: 0,
                    priceChange: e,
                    finalPriceChange: t
                }
            }, [g, k, w, S]),
            Y = a.default.useMemo(() => {
                let e = d.seriesSettings.decimalPlaces;
                if (!I || void 0 === S || void 0 === w) return e;
                for (let t = e; t <= e + 2; t++)
                    if (w.toFixed(t) !== S.toFixed(t)) return t;
                return e + 2
            }, [I, S, w, d.seriesSettings.decimalPlaces]),
            Q = a.default.useMemo(() => {
                if (!I || void 0 === S || void 0 === w) return null;
                for (let e = Y; e <= 6; e++)
                    if (w.toFixed(e) !== S.toFixed(e)) {
                        if (e > Y) return V(S, e);
                        return null
                    }
                return V(S, 6)
            }, [I, S, w, Y]),
            X = ({
                compact: e = !1
            } = {}) => I && P ? (0, t.jsx)(E.default, {
                href: P,
                prefetch: !1,
                children: (0, t.jsxs)(F.Button, {
                    variant: "secondary",
                    size: "default",
                    className: (0, R.cn)("rounded-full pr-3", e && "max-[400px]:translate-x-1"),
                    "aria-label": s("events.goToLiveMarket"),
                    children: [(0, t.jsx)(B.default, {}), e ? (0, t.jsxs)(t.Fragment, {
                        children: [(0, t.jsx)("p", {
                            className: "shrink-0",
                            children: s("homepageV2.live")
                        }), (0, t.jsx)(A.IconChevronRightOutline12, {
                            className: "shrink-0"
                        })]
                    }) : (0, t.jsxs)(t.Fragment, {
                        children: [(0, t.jsx)("p", {
                            children: s("events.goToLiveMarket")
                        }), (0, t.jsx)(A.IconChevronRightOutline12, {
                            className: "shrink-0"
                        })]
                    })]
                })
            }) : null;
        return (0, t.jsxs)("div", {
            ref: e,
            className: (0, R.cn)("absolute -top-2 translate-y-[-100%] left-0 w-full flex justify-between items-center", i),
            ...n,
            children: [(0, t.jsxs)("div", {
                className: "flex w-max",
                children: [(0, t.jsx)(c.AnimatePresence, {
                    mode: "popLayout",
                    initial: !1,
                    children: (!!w || !j) && (0, t.jsx)(eu, {
                        label: H,
                        variant: "default",
                        value: w ? ? 0,
                        isPlaceholder: !w,
                        color: "secondary",
                        decimals: Y
                    })
                }), (0, t.jsx)(c.AnimatePresence, {
                    mode: "popLayout",
                    initial: !1,
                    children: (!!k || !!S) && (0, t.jsx)("div", {
                        className: "w-px h-8 border-r my-auto mx-2 sm:mx-3 lg:mx-5"
                    })
                }), (0, t.jsx)(c.AnimatePresence, {
                    mode: "popLayout",
                    initial: !1,
                    children: !I && !!k && (0, t.jsx)(eu, {
                        label: W,
                        variant: "animated",
                        value: k,
                        color: b,
                        change: Z,
                        changePosition: "top",
                        decimals: Y,
                        changeDecimals: G
                    })
                }), (0, t.jsx)(c.AnimatePresence, {
                    mode: "popLayout",
                    initial: !1,
                    children: I && !!S && (0, t.jsx)(eu, {
                        label: U,
                        variant: "default",
                        value: S,
                        color: "primary",
                        decimals: Y,
                        change: K,
                        changeDecimals: Y,
                        changePosition: "top"
                    })
                }), I && !!S && !!Q && (0, t.jsx)($.Tooltip, {
                    content: (0, t.jsxs)("div", {
                        className: "flex flex-col gap-0.5",
                        children: [(0, t.jsx)("span", {
                            className: "text-text-secondary",
                            children: "Exact final price"
                        }), (0, t.jsx)("span", {
                            className: "font-mono",
                            children: Q
                        })]
                    }),
                    showArrow: !1,
                    sideOffset: 8,
                    className: "text-xs py-2",
                    children: (0, t.jsx)(q.IconCircleInfoOutline12, {
                        className: "text-text-secondary self-end mb-1.5 ml-1 shrink-0",
                        size: 10
                    })
                })]
            }), (0, t.jsx)(z.Media, {
                lessThan: "lg",
                children: X({
                    compact: !0
                })
            }), (0, t.jsx)(z.Media, {
                greaterThanOrEqual: "lg",
                children: X() ? ? (0, t.jsx)(er, {})
            })]
        })
    };
    ep.displayName = "Title";
    let eh = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: m.opacityTransition
            },
            exit: {
                opacity: 0,
                transition: m.opacityTransition
            }
        },
        ef = (0, u.default)(() => e.A(843685), {
            loadableGenerated: {
                modules: [302878]
            },
            ssr: !1
        }),
        ex = () => {
            let e, i, n, s = (0, r.c)(7),
                o = a.default.useRef(null);
            s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], s[0] = e) : e = s[0];
            let {
                event: l
            } = (0, h.useEventContext)(e), u = (0, f.useChartDataStore)(eg);
            s[1] !== u || s[2] !== l.slug ? (i = (0, x.shouldDisableLivePriceChart)(l.slug) ? "asset-price" : u, s[1] = u, s[2] = l.slug, s[3] = i) : i = s[3];
            let m = i,
                g = (0, p.default)();
            return s[4] !== m || s[5] !== g ? (n = g ? (0, t.jsx)("div", {
                ref: o,
                className: "w-full h-full relative overflow-visible",
                children: (0, t.jsxs)(c.AnimatePresence, {
                    mode: "wait",
                    initial: !1,
                    children: ["crypto-price" === m && (0, t.jsxs)(d.motion.div, {
                        variants: eh,
                        initial: "initial",
                        animate: "animate",
                        exit: "exit",
                        children: [(0, t.jsx)(d.motion.div, {
                            initial: {
                                opacity: 0
                            },
                            animate: {
                                opacity: 1
                            },
                            exit: {
                                opacity: 0
                            },
                            children: (0, t.jsx)(ep, {})
                        }, "title"), (0, t.jsx)(ef, {})]
                    }, "crypto-price"), "asset-price" === m && (0, t.jsx)(d.motion.div, {
                        variants: eh,
                        initial: "initial",
                        animate: "animate",
                        exit: "exit",
                        children: (0, t.jsx)(w, {})
                    }, "asset-price"), "candlestick" === m && (0, t.jsxs)(d.motion.div, {
                        variants: eh,
                        initial: "initial",
                        animate: "animate",
                        exit: "exit",
                        children: [(0, t.jsx)(d.motion.div, {
                            initial: {
                                opacity: 0
                            },
                            animate: {
                                opacity: 1
                            },
                            exit: {
                                opacity: 0
                            },
                            children: (0, t.jsx)(ep, {})
                        }, "title"), (0, t.jsx)(I, {})]
                    }, "candlestick")]
                })
            }) : null, s[4] = m, s[5] = g, s[6] = n) : n = s[6], n
        };

    function eg(e) {
        return e.chartType
    }
    ex.displayName = "LineChartLayout";
    let ev = e => {
        let a, i, n, c = (0, r.c)(10),
            {
                height: d
            } = e,
            {
                id: u
            } = (0, o.usePriceChartContext)(),
            [m, p] = (0, s.useMeasure)();
        c[0] !== d ? (a = {
            "--chart-height": d,
            position: "relative"
        }, c[0] = d, c[1] = a) : a = c[1];
        let h = a,
            f = `price-chart-container-${u}`;
        return c[2] !== p.height || c[3] !== p.width ? (i = p.width > 0 && p.height > 0 && (0, t.jsx)(l.PriceLineChartContextProvider, {
            width: p.width,
            height: p.height,
            children: (0, t.jsx)(ex, {})
        }), c[2] = p.height, c[3] = p.width, c[4] = i) : i = c[4], c[5] !== m || c[6] !== h || c[7] !== f || c[8] !== i ? (n = (0, t.jsx)("div", {
            ref: m,
            id: "price-chart-container",
            className: "flex flex-1 min-w-full w-full max-w-full lg:min-w-0 lg:w-auto lg:max-w-none min-h-(--chart-height) h-(--chart-height) max-h-(--chart-height) relative box-border mt-16 lg:mt-8",
            style: h,
            children: i
        }, f), c[5] = m, c[6] = h, c[7] = f, c[8] = i, c[9] = n) : n = c[9], n
    };
    var ey = e.i(743959),
        eb = e.i(20655),
        ek = e.i(175865),
        ew = e.i(583730);

    function eS({
        children: e,
        isValidProp: r,
        ...i
    }) {
        r && (0, ek.loadExternalIsValidProp)(r);
        let n = (0, a.useContext)(eb.MotionConfigContext);
        (i = { ...n,
            ...i
        }).transition = (0, ey.resolveTransition)(i.transition, n.transition), i.isStatic = (0, ew.useConstant)(() => i.isStatic);
        let s = (0, a.useMemo)(() => i, [JSON.stringify(i.transition), i.transformPagePoint, i.reducedMotion, i.skipAnimations]);
        return (0, t.jsx)(eb.MotionConfigContext.Provider, {
            value: s,
            children: e
        })
    }
    e.s(["MotionConfig", 0, eS], 859938);
    var ej = e.i(158789),
        eC = e.i(254380),
        e_ = e.i(936712),
        eT = e.i(678714),
        eM = e.i(798631),
        eN = e.i(336896),
        eI = e.i(964974),
        eP = e.i(255760),
        eE = e.i(987222),
        eA = e.i(655740);

    function eO(e, t = !0, r, i) {
        let n = i ? .count ? ? 4,
            s = e ? function(e, t = 4) {
                let r = e.markets ? .[0];
                if (!r ? .eventStartTime) return null;
                let a = e.slug;
                if (!(0, eE.isUpDownSlug)(a)) return null;
                let i = (0, b.isCryptoMarketSlug)(a) ? "crypto" : (0, k.isEquityMarketSlug)(a) ? "equity" : null;
                if (!i) return null;
                let n = null;
                if ((0, eE.matchesFiveMinuteUpDown)(a) ? n = "fiveminute" : (0, eE.matchesFifteenMinuteUpDown)(a) ? n = "fifteen" : (0, eE.matchesFourHourUpDown)(a) ? n = "fourhour" : a.includes("-up-or-down-on-") ? n = "daily" : a.match(/-\d+(am|pm)-et$/) && (n = "hourly"), !n) return null;
                let s = (0, eP.getAssetNames)(a.split("-")[0]);
                if (!s.abbreviation) return null;
                let o = Number.isFinite(t) && t > 0 ? Math.floor(t) : 4;
                return {
                    symbol: s.abbreviation,
                    variant: n,
                    assetType: i,
                    currentEventStartTime: r.eventStartTime,
                    endDate: r.endDate ? ? r.endDateIso ? ? null,
                    count: o
                }
            }(e, n) : null,
            o = i ? .includeOutcomesBySlug ? ? !1,
            l = (i ? .outcomesOnly ? ? !1) && o,
            c = a.default.useMemo(() => i ? .pastEventSlugs ? .length ? [...new Set(i.pastEventSlugs.filter(Boolean))].sort() : [], [i ? .pastEventSlugs]),
            d = a.default.useMemo(() => {
                if (l || !e || !s) return null;
                let t = Date.now();
                if (!(new Date(s.currentEventStartTime).getTime() > t) || !r || 0 === r.length) return s.currentEventStartTime;
                let a = r.filter(e => !e.closed);
                if (0 === a.length) return s.currentEventStartTime;
                let i = a.sort((e, t) => new Date(e.endDate).getTime() - new Date(t.endDate).getTime()).find(e => new Date(e.endDate).getTime() > t);
                if (i) {
                    let e = i.startTime || i.startDate;
                    if (e) return e
                }
                return s.currentEventStartTime
            }, [e, l, s, r]),
            u = l ? ["past-results", "outcomes-by-slug", c] : ["past-results", s ? .symbol, s ? .variant, s ? .count, d, o, c];
        return (0, eI.useQuery)({
            queryKey: u,
            queryFn: async () => {
                if (!s && !l) return {
                    status: "error",
                    error: "Invalid parameters"
                };
                if (o || l) {
                    let e = new URLSearchParams;
                    for (let t of (s && d && (e.set("symbol", s.symbol), e.set("variant", s.variant), e.set("assetType", s.assetType), e.set("currentEventStartTime", d), e.set("count", String(s.count)), s.endDate && e.set("endDate", s.endDate)), o && e.set("includeOutcomesBySlug", "true"), l && e.set("outcomesOnly", "true"), c)) e.append("pastEventSlugs", t);
                    let t = e.toString(),
                        {
                            data: r
                        } = t.length <= 6e3 ? await eA.axios.get(`/api/past-results?${t}`) : await eA.axios.post("/api/past-results", { ...s && d && {
                                symbol: s.symbol,
                                variant: s.variant,
                                assetType: s.assetType,
                                currentEventStartTime: d,
                                endDate: s.endDate,
                                count: s.count
                            },
                            includeOutcomesBySlug: o,
                            outcomesOnly: l,
                            pastEventSlugs: c
                        });
                    return r
                }
                let {
                    data: e
                } = await eA.axios.get("/api/past-results", {
                    params: {
                        symbol: s ? .symbol,
                        variant: s ? .variant,
                        assetType: s ? .assetType,
                        currentEventStartTime: d,
                        endDate: s ? .endDate,
                        count: s ? .count
                    }
                });
                return e
            },
            enabled: t && (l ? c.length > 0 : !!s && !!d),
            staleTime: 1 / 0,
            gcTime: 18e5,
            refetchOnWindowFocus: !1,
            refetchOnReconnect: !1
        })
    }
    var eD = e.i(248131);
    let eL = (e, t) => {
        let a, i, n, s, o = (0, r.c)(11);
        if (o[0] !== e) a = ["/api/series/events", e.seriesId ? String(e.seriesId) : "", e.seriesSlug ? ? "", e.closed, e.limit, e.order, e.ascending, e.active, e.archived, e.afterCursor], o[0] = e, o[1] = a;
        else a = o[1];
        o[2] !== e ? (i = () => {
            let t;
            return t = new URLSearchParams, e.seriesId ? t.set("seriesId", String(e.seriesId)) : e.seriesSlug && t.set("seriesSlug", e.seriesSlug), "boolean" == typeof e.closed && t.set("closed", String(e.closed)), "boolean" == typeof e.active && t.set("active", String(e.active)), "boolean" == typeof e.archived && t.set("archived", String(e.archived)), "boolean" == typeof e.ascending && t.set("ascending", String(e.ascending)), e.limit && t.set("limit", String(e.limit)), e.order && t.set("order", e.order), e.afterCursor && t.set("afterCursor", e.afterCursor), eA.axios.get(`/api/series/events?${t.toString()}`).then(({
                data: e
            }) => e)
        }, o[2] = e, o[3] = i) : i = o[3];
        let l = (void 0 === t || t) && !!(e.seriesId || e.seriesSlug),
            c = `useSeriesEvents (${e.seriesId??e.seriesSlug})`;
        return o[4] !== c ? (n = {
            errorContext: {
                tag: c
            }
        }, o[4] = c, o[5] = n) : n = o[5], o[6] !== a || o[7] !== i || o[8] !== l || o[9] !== n ? (s = {
            queryKey: a,
            queryFn: i,
            refetchOnWindowFocus: !1,
            refetchOnReconnect: !1,
            refetchOnMount: !1,
            enabled: l,
            meta: n
        }, o[6] = a, o[7] = i, o[8] = l, o[9] = n, o[10] = s) : s = o[10], (0, eI.useQuery)(s)
    };

    function ez(e) {
        let i, n, s, o, l, c, d, u, m, p, h, f = (0, r.c)(30),
            {
                event: x,
                pastEvents: g,
                seriesEvents: v
            } = e,
            y = (0, T.useLocale)(),
            [w, j] = (0, a.useState)(null);
        f[0] !== g ? (i = [...g].filter(e$).sort(eF), f[0] = g, f[1] = i) : i = f[1];
        let C = i;
        f[2] !== C ? (n = C.map(eR), f[2] = C, f[3] = n) : n = f[3];
        let M = n,
            N = M.length > 0;
        f[4] !== M || f[5] !== N ? (s = {
            includeOutcomesBySlug: N,
            pastEventSlugs: M
        }, f[4] = M, f[5] = N, f[6] = s) : s = f[6];
        let {
            data: I,
            isError: P
        } = eO(x, !0, v ? ? C, s);
        I ? .data ? .outcomesBySlug;
        e: {
            let e, t = I ? .data ? .outcomesBySlug;
            if (!t) {
                let e;
                f[7] === Symbol.for("react.memo_cache_sentinel") ? (e = new Map, f[7] = e) : e = f[7], o = e;
                break e
            }
            f[8] !== t ? (e = new Map(Object.entries(t)), f[8] = t, f[9] = e) : e = f[9],
            o = e
        }
        let A = o;
        if (P || !I ? .data ? .results || 0 === I.data.results.length) return null;
        let O = I.data.results;
        if (f[10] !== x.slug || f[11] !== w || f[12] !== y || f[13] !== A || f[14] !== C || f[15] !== O) {
            let e = (0, b.getCryptoMarketSettings)(x.slug),
                r = (0, k.getEquityMarketSettings)(x.slug),
                a = e ? .isDailyUpOrDown || r ? .isDailyUpOrDown || !1,
                {
                    timezone: i
                } = (0, W.getSeriesSettings)(x.slug),
                n = x.slug,
                s = "hourly";
            (0, eE.matchesFiveMinuteUpDown)(n) ? s = "fiveminute": (0, eE.matchesFifteenMinuteUpDown)(n) ? s = "fifteen" : (0, eE.matchesFourHourUpDown)(n) ? s = "fourhour" : n.includes("-up-or-down-on-") && (s = "daily"), f[21] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, t.jsx)("div", {
                className: "w-px h-4 bg-neutral-200 mx-1.5"
            }), f[21] = u) : u = f[21], m = (0, t.jsx)(z.Media, {
                greaterThanOrEqual: "lg",
                children: O.slice(0, 4).map((e, r) => {
                    let n, o = new Date(e.endTime),
                        l = new Z.TZDate(o, i);
                    n = a ? (0, S.format)(l, "MMM d", {
                        locale: (0, _.getDateFnsLocale)(y)
                    }) : (0, S.format)(l, "p", {
                        locale: (0, _.getDateFnsLocale)(y)
                    });
                    let c = (0, W.findMatchingPastEvent)(e, C, a),
                        d = c ? .slug || (0, W.constructPastMarketSlug)(x.slug, e.startTime, e.endTime, s),
                        u = (c ? A.get(c.slug) : void 0) ? ? e.outcome;
                    return (0, t.jsx)($.Tooltip, {
                        content: n,
                        sideOffset: 8,
                        triggerAsChild: !0,
                        children: (0, t.jsx)(E.default, {
                            href: eD.Location.EventDetail,
                            as: d,
                            onMouseEnter: () => {
                                j(r)
                            },
                            onMouseLeave: () => {
                                j(null)
                            },
                            className: (0, R.cn)("flex items-center justify-center rounded-full w-5 h-5 shrink-0 cursor-pointer", "up" === u ? "bg-green-600" : "bg-red-500", null !== w && w !== r && "opacity-30"),
                            children: "up" === u ? (0, t.jsx)(eT.IconCaretUpFill12, {
                                size: 10,
                                color: "white"
                            }) : (0, t.jsx)(e_.IconCaretDownFill12, {
                                size: 10,
                                color: "white"
                            })
                        })
                    }, r)
                })
            }), l = z.Media, c = "lg", d = O.slice(-3).map((e, r) => {
                let n, o = Math.max(0, O.length - 3) + r,
                    l = new Date(e.endTime),
                    c = new Z.TZDate(l, i);
                n = a ? (0, S.format)(c, "MMM d", {
                    locale: (0, _.getDateFnsLocale)(y)
                }) : (0, S.format)(c, "p", {
                    locale: (0, _.getDateFnsLocale)(y)
                });
                let d = (0, W.findMatchingPastEvent)(e, C, a),
                    u = d ? d.slug : (0, W.constructPastMarketSlug)(x.slug, e.startTime, e.endTime, s),
                    m = (d ? A.get(d.slug) : void 0) ? ? e.outcome;
                return (0, t.jsx)($.Tooltip, {
                    content: n,
                    sideOffset: 8,
                    triggerAsChild: !0,
                    children: (0, t.jsx)(E.default, {
                        href: eD.Location.EventDetail,
                        as: u,
                        onMouseEnter: () => {
                            j(o)
                        },
                        onMouseLeave: () => {
                            j(null)
                        },
                        className: (0, R.cn)("flex items-center justify-center rounded-full w-5 h-5 shrink-0 cursor-pointer", "up" === m ? "bg-green-600" : "bg-red-500", null !== w && w !== o && "opacity-30"),
                        children: "up" === m ? (0, t.jsx)(eT.IconCaretUpFill12, {
                            size: 10,
                            color: "white"
                        }) : (0, t.jsx)(e_.IconCaretDownFill12, {
                            size: 10,
                            color: "white"
                        })
                    })
                }, r)
            }), f[10] = x.slug, f[11] = w, f[12] = y, f[13] = A, f[14] = C, f[15] = O, f[16] = l, f[17] = c, f[18] = d, f[19] = u, f[20] = m
        } else l = f[16], c = f[17], d = f[18], u = f[19], m = f[20];
        return f[22] !== l || f[23] !== c || f[24] !== d ? (p = (0, t.jsx)(l, {
            lessThan: c,
            children: d
        }), f[22] = l, f[23] = c, f[24] = d, f[25] = p) : p = f[25], f[26] !== p || f[27] !== u || f[28] !== m ? (h = (0, t.jsxs)(t.Fragment, {
            children: [u, m, p]
        }), f[26] = p, f[27] = u, f[28] = m, f[29] = h) : h = f[29], h
    }

    function eR(e) {
        return e.slug
    }

    function eF(e, t) {
        return new Date(t.endDate).getTime() - new Date(e.endDate).getTime()
    }

    function e$(e) {
        return e.closed
    }
    let eB = e => {
        let a, i = (0, r.c)(9),
            {
                children: n,
                event: s,
                sideOffset: o,
                isLive: l
            } = e,
            c = void 0 === o ? 16 : o,
            {
                shouldShowDetailedTime: d
            } = (0, W.getSeriesSettings)(s.slug);
        if (d) {
            let e, r;
            return i[0] !== s || i[1] !== l ? (e = (0, t.jsx)(Y, {
                event: s,
                isLive: l
            }), i[0] = s, i[1] = l, i[2] = e) : e = i[2], i[3] !== n || i[4] !== c || i[5] !== e ? (r = (0, t.jsx)($.Tooltip, {
                content: e,
                sideOffset: c,
                children: n
            }), i[3] = n, i[4] = c, i[5] = e, i[6] = r) : r = i[6], r
        }
        return i[7] !== n ? (a = (0, t.jsx)(t.Fragment, {
            children: n
        }), i[7] = n, i[8] = a) : a = i[8], a
    };

    function eq(e) {
        let i, n, s, o = (0, r.c)(7),
            {
                children: l
            } = e,
            c = a.default.useRef(null);
        return o[0] !== l ? (i = (0, t.jsx)(z.Media, {
            greaterThanOrEqual: "lg",
            children: l
        }), o[0] = l, o[1] = i) : i = o[1], o[2] !== l ? (n = (0, t.jsx)(z.Media, {
            lessThan: "lg",
            children: (0, t.jsx)("div", {
                className: "w-[calc(100vw)] -translate-x-4",
                children: (0, t.jsx)(eC.ScrollContainer, {
                    className: "flex overflow-x-auto snap-x scroll-px-3 snap-mandatory min-w-0 no-scrollbar px-4 items-center",
                    containerRef: c,
                    children: l
                })
            })
        }), o[2] = l, o[3] = n) : n = o[3], o[4] !== i || o[5] !== n ? (s = (0, t.jsxs)(t.Fragment, {
            children: [i, n]
        }), o[4] = i, o[5] = n, o[6] = s) : s = o[6], s
    }
    let eV = (e, t = {}) => {
            let {
                shouldShowYear: r,
                shouldShowTime: a,
                isHourlyMarket: i,
                checkTodayTomorrow: n,
                todayLabel: s,
                tomorrowLabel: o,
                locale: l
            } = t, c = e.eventDate ? ? e.endDate;
            if (c) {
                let t = new Date(c);
                if ((0, K.isValid)(t)) {
                    let {
                        shouldShowDetailedTime: c,
                        timezone: d
                    } = (0, W.getSeriesSettings)(e.slug), u = c ? d : "UTC", m = new Z.TZDate(t, u), p = (0, _.getDateFnsLocale)(l);
                    if (n) {
                        let e = new Z.TZDate((0, L.getServerNow)(), u),
                            t = new Z.TZDate(e.getTime(), u);
                        t.setDate(e.getDate() + 1);
                        let r = (0, S.format)(m, "yyyy-MM-dd"),
                            a = (0, S.format)(e, "yyyy-MM-dd"),
                            i = (0, S.format)(t, "yyyy-MM-dd");
                        if (r === a) return s ? ? "Today";
                        if (r === i) return o ? ? "Tomorrow"
                    }
                    let h = new Z.TZDate((0, L.getServerNow)(), u).getFullYear(),
                        f = m.getFullYear(),
                        x = (void 0 !== r ? r : f !== h) && !i ? "MMM d, yyyy" : "MMM d";
                    return a && (x = `p ${x}`), (0, S.format)(m, x, {
                        locale: p
                    })
                }
            }
            return null
        },
        eH = e => {
            if (!e) return e;
            let r = e.match(/(.*?)(\s?)(AM|PM)(.*)$/i);
            if (r) {
                let [, e, , a, i] = r, n = i ? "mx-0.5" : "ml-0.5";
                return (0, t.jsxs)(t.Fragment, {
                    children: [e, (0, t.jsx)("span", {
                        className: `text-xs ${n}`,
                        children: a
                    }), i]
                })
            }
            return e
        },
        eU = (e, t, r, a) => {
            let {
                useHourlyFiltering: i,
                timezone: n
            } = (0, W.getSeriesSettings)(e.slug), s = (0, _.getDateFnsLocale)(a);
            if (!i) return {
                timeText: eV(e, {
                    shouldShowYear: !0,
                    shouldShowTime: !1,
                    isHourlyMarket: !1,
                    checkTodayTomorrow: !1,
                    locale: a
                }),
                dateText: null
            };
            let o = e.endDate ? ? e.eventDate;
            if (o) {
                let e, a = new Date(o),
                    i = new Z.TZDate(a, n),
                    l = new Z.TZDate((0, L.getServerNow)(), n),
                    c = new Z.TZDate(l.getTime(), n);
                c.setDate(c.getDate() + 1);
                let d = (0, S.format)(i, "yyyy-MM-dd"),
                    u = (0, S.format)(l, "yyyy-MM-dd"),
                    m = (0, S.format)(c, "yyyy-MM-dd"),
                    p = (0, S.format)(i, "zzz");
                "America/New_York" === n && (p = "ET");
                let h = (0, S.format)(i, "p", {
                    locale: s
                }).replace(/\s+(AM|PM)/i, "$1");
                if (d === u) e = t;
                else if (d === m) e = r;
                else {
                    let t = new Date().getFullYear(),
                        r = i.getFullYear();
                    e = (0, S.format)(i, r !== t ? "MMM d, yyyy" : "MMM d", {
                        locale: s
                    })
                }
                return {
                    timeText: `${h} ${p}`,
                    dateText: e
                }
            }
            return {
                timeText: eV(e, {
                    shouldShowYear: !0,
                    shouldShowTime: !1,
                    isHourlyMarket: !1,
                    checkTodayTomorrow: !1,
                    locale: a
                }),
                dateText: null
            }
        },
        eW = e => {
            let i, n, s, o, l, c, d, u, m, p, f, x, g, v, y, b, k, w, j, C, N, I, P, A, O, D = (0, r.c)(98),
                {
                    currentEvent: z,
                    series: F,
                    className: $
                } = e,
                B = (0, eN.useRouter)(),
                q = (0, M.useTranslations)(),
                V = (0, T.useLocale)(),
                H = F.id,
                U = F.slug;
            D[0] !== H || D[1] !== U ? (i = {
                seriesId: H,
                seriesSlug: U,
                closed: !1,
                active: !0,
                archived: !1,
                order: "endDate",
                ascending: !0,
                limit: 100
            }, D[0] = H, D[1] = U, D[2] = i) : i = D[2];
            let Y = eL(i);
            D[3] !== H || D[4] !== U ? (n = {
                seriesId: H,
                seriesSlug: U,
                closed: !0,
                active: !0,
                archived: !1,
                order: "endDate",
                ascending: !1,
                limit: 50
            }, D[3] = H, D[4] = U, D[5] = n) : n = D[5];
            let Q = eL(n),
                [X, J] = (0, a.useState)(!1),
                [ee, et] = (0, a.useState)(!1);
            D[6] === Symbol.for("react.memo_cache_sentinel") ? (s = ["eventSettings"], D[6] = s) : s = D[6];
            let {
                eventSettings: er
            } = (0, h.useEventContext)(s);
            Y.data ? .events;
            e: {
                let e = Y.data ? .events;
                if (e ? .length) {
                    let t;
                    D[7] !== e ? (t = [...e].filter(eG).sort(eZ), D[7] = e, D[8] = t) : t = D[8], o = t;
                    break e
                }
                o = null
            }
            let ea = o;
            D[9] !== Q.data ? .events ? (l = () => {
                let e = Q.data ? .events;
                return e ? .length ? e.filter(eK).sort(eY) : null
            }, D[9] = Q.data ? .events, D[10] = l) : l = D[10], Q.data ? .events, D[11] !== l ? (c = l(), D[11] = l, D[12] = c) : c = D[12];
            let ei = c;
            t: {
                let e;
                if (!ei ? .length) {
                    let e;
                    D[13] === Symbol.for("react.memo_cache_sentinel") ? (e = [], D[13] = e) : e = D[13], d = e;
                    break t
                }
                D[14] !== ei ? (e = ei.map(eQ), D[14] = ei, D[15] = e) : e = D[15],
                d = e
            }
            let en = d;
            D[16] !== B ? (u = e => {
                B.push(e)
            }, D[16] = B, D[17] = u) : u = D[17];
            let es = u;
            D[18] !== ea ? (m = ea ? ? [], D[18] = ea, D[19] = m) : m = D[19], D[20] !== ei ? (p = ei ? ? [], D[20] = ei, D[21] = p) : p = D[21], D[22] !== p || D[23] !== m ? (f = [...m, ...p], D[22] = p, D[23] = m, D[24] = f) : f = D[24];
            let eo = f;
            D[25] !== z.slug ? (x = (0, eE.isUpDownSlug)(z.slug), D[25] = z.slug, D[26] = x) : x = D[26];
            let el = x;
            D[27] !== en ? (g = {
                includeOutcomesBySlug: !0,
                outcomesOnly: !0,
                pastEventSlugs: en
            }, D[27] = en, D[28] = g) : g = D[28];
            let {
                data: ec
            } = eO(z, el && en.length > 0, eo, g);
            ec ? .data ? .outcomesBySlug;
            r: {
                let e, t = ec ? .data ? .outcomesBySlug;
                if (!t) {
                    let e;
                    D[29] === Symbol.for("react.memo_cache_sentinel") ? (e = new Map, D[29] = e) : e = D[29], v = e;
                    break r
                }
                D[30] !== t ? (e = new Map(Object.entries(t)), D[30] = t, D[31] = e) : e = D[31],
                v = e
            }
            let ed = v,
                [eu, em] = (0, a.useState)(L.getServerNow);
            a: {
                let e, t;
                if (!ea || 0 === ea.length) {
                    let e;
                    D[32] === Symbol.for("react.memo_cache_sentinel") ? (e = new Set, D[32] = e) : e = D[32], y = e;
                    break a
                }
                if (D[33] !== eu || D[34] !== ea) {
                    let t;
                    D[36] !== eu ? (t = e => new Date(e.endDate).getTime() > eu, D[36] = eu, D[37] = t) : t = D[37], e = ea.find(t), D[33] = eu, D[34] = ea, D[35] = e
                } else e = D[35];
                let r = e;D[38] !== r ? (t = r ? new Set([r.slug]) : new Set, D[38] = r, D[39] = t) : t = D[39],
                y = t
            }
            let ep = y;
            if (D[40] !== ea ? (b = () => {
                    if (!ea || 0 === ea.length) return;
                    let e = ea.find(eX);
                    if (!e) return;
                    let t = new Date(e.endDate).getTime() - (0, L.getServerNow)() + 100;
                    if (t <= 0) return void em((0, L.getServerNow)());
                    let r = setTimeout(() => em((0, L.getServerNow)()), t);
                    return () => clearTimeout(r)
                }, D[40] = ea, D[41] = b) : b = D[41], D[42] !== eu || D[43] !== ea ? (k = [ea, eu], D[42] = eu, D[43] = ea, D[44] = k) : k = D[44], a.default.useEffect(b, k), D[45] !== z.closed || D[46] !== z.slug || D[47] !== eu || D[48] !== ea) {
                i: {
                    if (ea && ea.length) {
                        let e, {
                            useHourlyFiltering: t,
                            timezone: r
                        } = (0, W.getSeriesSettings)(z.slug);
                        if (t) {
                            let e, t = new Z.TZDate(eu, r),
                                a = t.getHours(),
                                i = new Z.TZDate(t.getTime(), r);
                            i.setHours(a - 2, 0, 0, 0);
                            let n = new Z.TZDate(t.getTime(), r);
                            n.setHours(a + 4, 0, 0, 0);
                            let s = new Z.TZDate(t.getTime(), r);
                            s.setHours(23, 59, 59, 999);
                            let o = new Z.TZDate(t.getTime(), r);
                            o.setTime(t.getTime() + 1728e5);
                            let l = ea.filter(e => {
                                let a = new Date(e.endDate),
                                    l = new Z.TZDate(a, r);
                                if ((0, S.format)(l, "yyyy-MM-dd") === (0, S.format)(t, "yyyy-MM-dd")) {
                                    let e = z.slug.includes("-above") || z.slug.includes("-below"),
                                        t = z.slug.includes("-4h");
                                    return e || t ? l >= i && l <= s : l >= i && l <= n
                                }
                                return l > t && l <= o
                            });
                            if (l = l.slice(0, 4), D[50] !== z.slug ? (e = e => e.slug === z.slug, D[50] = z.slug, D[51] = e) : e = D[51], !l.some(e) && !z.closed) {
                                let e;
                                D[52] !== z.slug ? (e = e => e.slug === z.slug, D[52] = z.slug, D[53] = e) : e = D[53];
                                let t = ea.find(e);
                                t && (l.push(t), l.sort(eJ))
                            }
                            w = l;
                            break i
                        }
                        D[54] !== ea ? (e = ea.slice(0, 4), D[54] = ea, D[55] = e) : e = D[55], w = e;
                        break i
                    }
                    w = null
                }
                D[45] = z.closed,
                D[46] = z.slug,
                D[47] = eu,
                D[48] = ea,
                D[49] = w
            }
            else w = D[49];
            let eh = w;
            if (D[56] !== z.slug || D[57] !== eh || D[58] !== eu || D[59] !== ea) {
                n: {
                    if (ea && ea.length > 0) {
                        let {
                            useHourlyFiltering: e,
                            timezone: t
                        } = (0, W.getSeriesSettings)(z.slug);
                        if (e && eh && eh.length > 0) {
                            let e;
                            D[61] !== eh ? (e = new Date(eh.reduce(e0).endDate), D[61] = eh, D[62] = e) : e = D[62];
                            let r = e,
                                a = new Z.TZDate(eu, t),
                                i = new Z.TZDate(a.getTime(), t);
                            i.setTime(a.getTime() + 1728e5), j = ea.filter(e => {
                                let n = new Z.TZDate(new Date(e.endDate), t);
                                return n > r && n > a && n <= i
                            });
                            break n
                        }
                        let r = ea.slice(4);
                        if (eh && eh.some(e => e.slug === z.slug)) {
                            let e;
                            D[63] !== z.slug ? (e = e => e.slug !== z.slug, D[63] = z.slug, D[64] = e) : e = D[64], j = r.filter(e);
                            break n
                        }
                        j = r;
                        break n
                    }
                    j = null
                }
                D[56] = z.slug,
                D[57] = eh,
                D[58] = eu,
                D[59] = ea,
                D[60] = j
            }
            else j = D[60];
            let ef = j;
            if (Y.isPending || Q.isPending) {
                if (er.priceMarketSettings.priceMarketsUiEnabled) {
                    let e;
                    return D[65] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)("div", {
                        className: "flex w-[full] h-[44px] lg:h-[52px] invisible"
                    }), D[65] = e) : e = D[65], e
                }
                return null
            }
            return ea || ei ? (D[66] !== $ ? (C = (0, R.cn)("flex gap-2 w-max lg:flex-wrap lg:w-auto", $), D[66] = $, D[67] = C) : C = D[67], D[68] !== z || D[69] !== es || D[70] !== X || D[71] !== V || D[72] !== ei || D[73] !== ed || D[74] !== eo || D[75] !== q ? (N = ei && ei.length > 0 && (0, t.jsxs)(ej.DropdownMenu, {
                open: X,
                onOpenChange: J,
                children: [(0, t.jsx)(ej.DropdownMenuTrigger, {
                    asChild: !0,
                    children: (0, t.jsxs)("button", {
                        type: "button",
                        className: "flex justify-center items-center gap-1.5 px-3 rounded-full border border-transparent bg-neutral-50 h-8 min-h-[32px] leading-none hover:bg-neutral-100 cursor-pointer",
                        "aria-label": "View past events",
                        children: [(0, t.jsx)("span", {
                            className: "font-semibold text-[13px] tracking-[-0.09px] text-text-primary",
                            children: q("time.past")
                        }), (0, t.jsx)(eM.IconChevronDownOutline12, {
                            className: (0, R.cn)("text-text-primary transition-transform duration-200", X && "rotate-180")
                        }), (0, t.jsx)(ez, {
                            event: z,
                            pastEvents: ei ? ? [],
                            seriesEvents: eo
                        })]
                    })
                }), (0, t.jsx)(ej.DropdownMenuContent, {
                    align: "start",
                    className: "w-[200px] max-h-[300px]",
                    sideOffset: 8,
                    children: (0, t.jsx)(ej.DropdownMenuGroup, {
                        children: ei.map(e => {
                            let {
                                timeText: r,
                                dateText: a
                            } = eU(e, q("cards.today"), q("cards.tomorrow"), V), i = ed.get(e.slug);
                            return (0, t.jsx)(ej.DropdownMenuItem, {
                                disabled: e.slug === z.slug,
                                onSelect: () => es(e.slug),
                                children: (0, t.jsxs)("div", {
                                    className: "flex items-center gap-[6px]",
                                    children: [i ? (0, t.jsx)("div", {
                                        className: (0, R.cn)("flex items-center justify-center rounded-full w-[14px] h-[14px] shrink-0", "up" === i ? "bg-green-600" : "bg-red-500"),
                                        children: "up" === i ? (0, t.jsx)(eT.IconCaretUpFill12, {
                                            className: "size-[8px] text-white"
                                        }) : (0, t.jsx)(e_.IconCaretDownFill12, {
                                            className: "size-[8px] text-white"
                                        })
                                    }) : (0, t.jsx)(G.IconGavelOutline18, {
                                        size: 14,
                                        className: e.slug === z.slug ? "text-text-tertiary" : "text-text-primary"
                                    }), a ? (0, t.jsxs)("div", {
                                        className: "flex items-center gap-1 whitespace-nowrap",
                                        children: [(0, t.jsx)("span", {
                                            children: eH(r)
                                        }), (0, t.jsxs)("span", {
                                            className: "text-text-secondary",
                                            children: ["· ", a]
                                        })]
                                    }) : (0, t.jsx)("span", {
                                        className: "whitespace-nowrap",
                                        children: eH(r)
                                    })]
                                })
                            }, e.slug)
                        })
                    })
                })]
            }), D[68] = z, D[69] = es, D[70] = X, D[71] = V, D[72] = ei, D[73] = ed, D[74] = eo, D[75] = q, D[76] = N) : N = D[76], D[77] !== z || D[78] !== V ? (I = z && z.closed && (0, t.jsx)(E.default, {
                href: eD.Location.EventDetail,
                as: `${z.slug}`,
                children: (0, t.jsx)(eB, {
                    event: z,
                    isLive: !1,
                    children: (0, t.jsx)("div", {
                        className: "flex justify-center items-center px-3 h-8 rounded-full border border-transparent cursor-default bg-neutral-950 text-base font-bold min-h-[32px] leading-none",
                        children: (0, t.jsxs)("p", {
                            className: "font-semibold text-[13px] tracking-[-0.09px] whitespace-nowrap text-text-inverse",
                            children: ["Ended: ", eV(z, {
                                shouldShowTime: !1,
                                locale: V
                            })]
                        })
                    })
                })
            }), D[77] = z, D[78] = V, D[79] = I) : I = D[79], D[80] !== z.slug || D[81] !== ep || D[82] !== V || D[83] !== eh ? (P = eh && eh.length > 0 && eh.map(e => {
                let r = ep.has(e.slug),
                    a = ((e, t) => {
                        try {
                            let {
                                useHourlyFiltering: r,
                                timezone: a
                            } = (0, W.getSeriesSettings)(e.slug), i = (0, _.getDateFnsLocale)(t);
                            if (!r) return eV(e, {
                                shouldShowTime: !1,
                                locale: t
                            });
                            let n = e.endDate ? ? e.eventDate;
                            if (n) {
                                let r = new Date(n);
                                if (!(0, K.isValid)(r)) return eV(e, {
                                    shouldShowTime: !1,
                                    locale: t
                                });
                                let s = new Z.TZDate(r, a),
                                    o = (0, S.format)(s, "p", {
                                        locale: i
                                    });
                                return String(o).replace(/\s+(AM|PM)/i, "$1")
                            }
                            return eV(e, {
                                shouldShowTime: !1,
                                locale: t
                            })
                        } catch {
                            return eV(e, {
                                shouldShowTime: !1,
                                locale: t
                            })
                        }
                    })(e, V),
                    i = e.slug === z.slug,
                    n = W.ALLOWED_PREFIXES.some(t => e.slug.startsWith(t)) && (r || i && ep.has(z.slug));
                return (0, t.jsx)(E.default, {
                    href: eD.Location.EventDetail,
                    as: `${e.slug}`,
                    children: (0, t.jsx)(eB, {
                        event: e,
                        isLive: n,
                        children: (0, t.jsx)("div", {
                            className: `flex justify-center items-center px-3 h-8 rounded-full border border-transparent cursor-pointer text-base font-bold min-h-[32px] leading-none ${i?"bg-neutral-950":"bg-neutral-50 hover:bg-neutral-100"}`,
                            children: (0, t.jsxs)("div", {
                                className: "flex items-center gap-[9px]",
                                children: [n && (0, t.jsxs)("div", {
                                    className: "relative",
                                    children: [(0, t.jsx)("div", {
                                        className: "w-1.5 h-1.5 bg-red-500 rounded-full"
                                    }), (0, t.jsx)("div", {
                                        className: "absolute -inset-0.5 w-2.5 h-2.5 bg-red-500 rounded-full opacity-75",
                                        style: {
                                            animation: "ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite"
                                        }
                                    })]
                                }), (0, t.jsx)("p", {
                                    className: (0, R.cn)("font-semibold text-[13px] tracking-[-0.09px] whitespace-nowrap", i ? "text-text-inverse" : "text-text-primary"),
                                    children: a ? eH(a) : a
                                })]
                            })
                        })
                    })
                }, e.slug)
            }), D[80] = z.slug, D[81] = ep, D[82] = V, D[83] = eh, D[84] = P) : P = D[84], D[85] !== z.slug || D[86] !== ef || D[87] !== es || D[88] !== ee || D[89] !== V || D[90] !== q ? (A = ef && ef.length > 0 && (0, t.jsxs)(ej.DropdownMenu, {
                open: ee,
                onOpenChange: et,
                children: [(0, t.jsx)(ej.DropdownMenuTrigger, {
                    asChild: !0,
                    children: (0, t.jsxs)("button", {
                        type: "button",
                        className: "group flex justify-center items-center px-3 gap-1.5 pl-4 h-8 rounded-full border border-transparent cursor-pointer bg-neutral-50 min-h-[32px] leading-none hover:bg-neutral-100 max-w-[220px]",
                        children: [(0, t.jsx)("p", {
                            className: "font-semibold text-[13px] tracking-[-0.09px] text-text-primary",
                            children: "More"
                        }), (0, t.jsx)(eM.IconChevronDownOutline12, {
                            className: (0, R.cn)("text-text-primary transition-transform duration-200", ee && "rotate-180")
                        })]
                    })
                }), (0, t.jsx)(ej.DropdownMenuContent, {
                    align: "start",
                    className: "w-[200px] max-h-[300px]",
                    sideOffset: 8,
                    children: (0, t.jsx)(ej.DropdownMenuGroup, {
                        children: ef.map(e => {
                            let {
                                timeText: r,
                                dateText: a
                            } = eU(e, q("cards.today"), q("cards.tomorrow"), V);
                            return (0, t.jsx)(ej.DropdownMenuItem, {
                                disabled: e.slug === z.slug,
                                onSelect: () => es(e.slug),
                                children: a ? (0, t.jsxs)("div", {
                                    className: "flex items-center gap-1 whitespace-nowrap",
                                    children: [(0, t.jsx)("span", {
                                        children: eH(r)
                                    }), (0, t.jsxs)("span", {
                                        className: "text-text-secondary",
                                        children: ["· ", a]
                                    })]
                                }) : (0, t.jsx)("span", {
                                    className: "whitespace-nowrap",
                                    children: eH(r)
                                })
                            }, e.slug)
                        })
                    })
                })]
            }), D[85] = z.slug, D[86] = ef, D[87] = es, D[88] = ee, D[89] = V, D[90] = q, D[91] = A) : A = D[91], D[92] !== C || D[93] !== N || D[94] !== I || D[95] !== P || D[96] !== A ? (O = (0, t.jsx)(eq, {
                children: (0, t.jsxs)("div", {
                    className: C,
                    children: [N, I, P, A]
                })
            }), D[92] = C, D[93] = N, D[94] = I, D[95] = P, D[96] = A, D[97] = O) : O = D[97], O) : null
        };

    function eG(e) {
        return !e.closed
    }

    function eZ(e, t) {
        return new Date(e.endDate).getTime() - new Date(t.endDate).getTime()
    }

    function eK(e) {
        return e.closed
    }

    function eY(e, t) {
        let r = new Date(e.endDate),
            a = new Date(t.endDate);
        if (!(0, K.isValid)(r) || !(0, K.isValid)(a)) return (0, K.isValid)(r) ? (0, K.isValid)(a) ? 0 : -1 : 1;
        let i = r.getTime(),
            n = a.getTime();
        return i === n ? t.slug.localeCompare(e.slug) : n - i
    }

    function eQ(e) {
        return e.slug
    }

    function eX(e) {
        return new Date(e.endDate).getTime() > (0, L.getServerNow)()
    }

    function eJ(e, t) {
        return new Date(e.endDate).getTime() - new Date(t.endDate).getTime()
    }

    function e0(e, t) {
        return new Date(t.endDate) > new Date(e.endDate) ? t : e
    }
    e.s(["EventSeriesPills", 0, eW], 99645);
    var e1 = e.i(385158),
        e2 = e.i(479399),
        e3 = e.i(515385),
        e4 = e.i(188474),
        e5 = e.i(86831);
    let e6 = (0, eo.cva)("inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium transition-all duration-125 bg-button-ghost-bg hover:bg-button-ghost-bg-hover text-button-ghost-text outline-none cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
            variants: {
                variant: {
                    default: "bg-button-ghost-bg",
                    filled: "bg-neutral-50 text-neutral-500 data-[state=on]:bg-button-primary-bg data-[state=on]:hover:bg-button-primary-bg-hover data-[state=on]:text-button-primary-text",
                    outline: "border border-input bg-transparent shadow-sm hover:bg-button-ghost-bg"
                },
                size: {
                    default: "h-9 px-2 min-w-9",
                    sm: "h-8 px-1.5 min-w-8",
                    lg: "h-10 px-2.5 min-w-10"
                },
                indicatorVariant: {
                    highlight: "text-tabs-text hover:text-tabs-text-hover data-[state=on]:text-text-brand",
                    disabled: ""
                }
            },
            defaultVariants: {
                variant: "default",
                size: "default",
                indicatorVariant: "highlight"
            }
        }),
        e9 = (0, eo.cva)("flex items-center justify-center gap-1", {
            variants: {
                orientation: {
                    horizontal: "flex-row",
                    vertical: "flex-col"
                }
            },
            defaultVariants: {
                orientation: "horizontal"
            }
        }),
        e8 = (0, eo.cva)("absolute pointer-events-none", {
            variants: {
                indicatorVariant: {
                    highlight: "top-1/2 -translate-y-1/2 h-8 rounded-md h-8 bg-bg-brand/10 dark:bg-bg-brand/20",
                    underline: "bottom-0 h-0.5 rounded-none bg-tabs-underline-bg",
                    disabled: ""
                }
            },
            defaultVariants: {
                indicatorVariant: "highlight"
            }
        }),
        e7 = a.createContext({
            size: "default",
            variant: "default",
            indicatorVariant: "highlight",
            hasMeasured: !1
        }),
        te = e => {
            let i, n, s, o, l, c, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C, _, T, M, N = (0, r.c)(52);
            N[0] !== e ? ({
                className: n,
                variant: p,
                size: u,
                orientation: m,
                children: i,
                indicatorVariant: o,
                indicatorClassName: s,
                wrapperClassName: h,
                ref: c,
                ...l
            } = e, N[0] = e, N[1] = i, N[2] = n, N[3] = s, N[4] = o, N[5] = l, N[6] = c, N[7] = u, N[8] = m, N[9] = p, N[10] = h) : (i = N[1], n = N[2], s = N[3], o = N[4], l = N[5], c = N[6], u = N[7], m = N[8], p = N[9], h = N[10]);
            let I = void 0 === m ? "horizontal" : m,
                P = a.useRef(null);
            N[11] === Symbol.for("react.memo_cache_sentinel") ? (f = {
                left: 0,
                width: 0,
                paddingLeft: "0",
                paddingRight: "0"
            }, N[11] = f) : f = N[11];
            let [E, A] = a.useState(f), [O, D] = a.useState(!1), [L, z] = a.useState(!1), R = (0, e4.useComposedRefs)(c, P);
            return N[12] !== L ? (x = () => {
                let e = () => {
                    if (!P.current) return;
                    let e = P.current.querySelector('[data-state="on"]');
                    if (e) {
                        let t = P.current.getBoundingClientRect(),
                            r = e.getBoundingClientRect(),
                            a = getComputedStyle(e),
                            {
                                paddingLeft: i
                            } = a,
                            {
                                paddingRight: n
                            } = a;
                        A({
                            left: r.left - t.left,
                            width: r.width,
                            paddingLeft: i,
                            paddingRight: n
                        }), L || z(!0)
                    }
                };
                e(), window.addEventListener("resize", e);
                let t = new MutationObserver(e);
                return P.current && t.observe(P.current, {
                    attributes: !0,
                    subtree: !0,
                    attributeFilter: ["data-state"]
                }), () => {
                    window.removeEventListener("resize", e), t.disconnect()
                }
            }, g = [L], N[12] = L, N[13] = x, N[14] = g) : (x = N[13], g = N[14]), a.useLayoutEffect(x, g), N[15] !== O || N[16] !== L ? (v = () => {
                if (L && !O) {
                    let e = requestAnimationFrame(() => {
                        D(!0)
                    });
                    return () => cancelAnimationFrame(e)
                }
            }, y = [L, O], N[15] = O, N[16] = L, N[17] = v, N[18] = y) : (v = N[17], y = N[18]), a.useEffect(v, y), N[19] !== h ? (b = (0, e5.cn)("relative", h), N[19] = h, N[20] = b) : b = N[20], N[21] !== n || N[22] !== I ? (k = (0, e5.cn)(e9({
                orientation: I
            }), n), N[21] = n, N[22] = I, N[23] = k) : k = N[23], N[24] !== L || N[25] !== o || N[26] !== u || N[27] !== p ? (w = {
                variant: p,
                size: u,
                indicatorVariant: o,
                hasMeasured: L
            }, N[24] = L, N[25] = o, N[26] = u, N[27] = p, N[28] = w) : w = N[28], N[29] !== i || N[30] !== w ? (S = (0, t.jsx)(e7.Provider, {
                value: w,
                children: i
            }), N[29] = i, N[30] = w, N[31] = S) : S = N[31], N[32] !== R || N[33] !== l || N[34] !== S || N[35] !== k ? (j = (0, t.jsx)(e3.ToggleGroup.Root, {
                ref: R,
                className: k,
                ...l,
                children: S
            }), N[32] = R, N[33] = l, N[34] = S, N[35] = k, N[36] = j) : j = N[36], N[37] !== s || N[38] !== o ? (C = (0, e5.cn)(e8({
                indicatorVariant: o
            }), s), N[37] = s, N[38] = o, N[39] = C) : C = N[39], N[40] !== O || N[41] !== L || N[42] !== E || N[43] !== o ? (_ = (({
                indicatorStyle: e,
                indicatorVariant: t,
                animationEnabled: r,
                hasMeasured: a
            }) => {
                let i = {
                    transform: `translateX(calc(${e.left}px + ${"underline"===t?e.paddingLeft:"0px"}))`,
                    width: `calc(${e.width}px - ${"underline"===t?`calc(${e.paddingLeft} + ${e.paddingRight})`:"0px"})`,
                    transformOrigin: "center",
                    opacity: +!!a
                };
                return {
                    initial: !1,
                    animate: i,
                    exit: i,
                    transition: {
                        default: {
                            duration: .35 * !!r,
                            ease: (0, e2.cubicBezier)(.26, .08, .25, 1)
                        },
                        opacity: {
                            duration: .2 * !!a,
                            ease: (0, e2.cubicBezier)(.26, .08, .25, 1)
                        }
                    }
                }
            })({
                indicatorStyle: E,
                indicatorVariant: o,
                animationEnabled: O,
                hasMeasured: L
            }), N[40] = O, N[41] = L, N[42] = E, N[43] = o, N[44] = _) : _ = N[44], N[45] !== C || N[46] !== _ ? (T = (0, t.jsx)(d.motion.div, {
                className: C,
                ..._
            }), N[45] = C, N[46] = _, N[47] = T) : T = N[47], N[48] !== j || N[49] !== T || N[50] !== b ? (M = (0, t.jsxs)("div", {
                className: b,
                children: [j, T]
            }), N[48] = j, N[49] = T, N[50] = b, N[51] = M) : M = N[51], M
        },
        tt = e => {
            let i, n, s, o, l, c, d = (0, r.c)(16);
            d[0] !== e ? ({
                className: i,
                variant: o,
                size: s,
                ...n
            } = e, d[0] = e, d[1] = i, d[2] = n, d[3] = s, d[4] = o) : (i = d[1], n = d[2], s = d[3], o = d[4]);
            let u = a.useContext(e7);
            return d[5] !== i || d[6] !== u.hasMeasured || d[7] !== u.indicatorVariant || d[8] !== u.size || d[9] !== u.variant || d[10] !== s || d[11] !== o ? (l = (0, e5.cn)(e6({
                variant: u.variant || o,
                size: u.size || s,
                indicatorVariant: u.indicatorVariant
            }), i, u.hasMeasured ? "" : "data-[state=on]:text-text-secondary"), d[5] = i, d[6] = u.hasMeasured, d[7] = u.indicatorVariant, d[8] = u.size, d[9] = u.variant, d[10] = s, d[11] = o, d[12] = l) : l = d[12], d[13] !== n || d[14] !== l ? (c = (0, t.jsx)(e3.ToggleGroup.Item, {
                className: l,
                ...n
            }), d[13] = n, d[14] = l, d[15] = c) : c = d[15], c
        };
    e.s(["ToggleGroup", 0, te, "ToggleGroupItem", 0, tt], 59874);
    var tr = e.i(625797),
        ta = e.i(169177);
    let ti = e => {
        let a, i, n, s, o, l, c = (0, r.c)(12),
            {
                size: d,
                color: u,
                title: m,
                className: p
            } = e,
            h = void 0 === d ? 18 : d,
            f = void 0 === u ? "currentColor" : u,
            x = void 0 === m ? "chart-candlestick" : m;
        return c[0] !== x ? (a = (0, t.jsx)("title", {
            children: x
        }), c[0] = x, c[1] = a) : a = c[1], c[2] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("path", {
            d: "M4.25,5h-.25V1.75c0-.414-.336-.75-.75-.75s-.75,.336-.75,.75v3.25h-.25c-.689,0-1.25,.561-1.25,1.25v3.5c0,.689,.561,1.25,1.25,1.25h.25v2.25c0,.414,.336,.75,.75,.75s.75-.336,.75-.75v-2.25h.25c.689,0,1.25-.561,1.25-1.25v-3.5c0-.689-.561-1.25-1.25-1.25Z"
        }), n = (0, t.jsx)("path", {
            d: "M10,6.5h-.25v-1.25c0-.414-.336-.75-.75-.75s-.75,.336-.75,.75v1.25h-.25c-.689,0-1.25,.561-1.25,1.25v4c0,.689,.561,1.25,1.25,1.25h.25v3.5c0,.414,.336,.75,.75,.75s.75-.336,.75-.75v-3.5h.25c.689,0,1.25-.561,1.25-1.25V7.75c0-.689-.561-1.25-1.25-1.25Z"
        }), s = (0, t.jsx)("path", {
            d: "M15.75,2h-2c-.689,0-1.25,.561-1.25,1.25v7.5c0,.689,.561,1.25,1.25,1.25h.25v2.25c0,.414,.336,.75,.75,.75s.75-.336,.75-.75v-2.25h.25c.689,0,1.25-.561,1.25-1.25V3.25c0-.689-.561-1.25-1.25-1.25Z"
        }), c[2] = i, c[3] = n, c[4] = s) : (i = c[2], n = c[3], s = c[4]), c[5] !== f ? (o = (0, t.jsxs)("g", {
            fill: f,
            children: [i, n, s]
        }), c[5] = f, c[6] = o) : o = c[6], c[7] !== p || c[8] !== h || c[9] !== a || c[10] !== o ? (l = (0, t.jsxs)("svg", {
            height: h,
            width: h,
            viewBox: "0 0 18 18",
            xmlns: "http://www.w3.org/2000/svg",
            className: p,
            children: [a, o]
        }), c[7] = p, c[8] = h, c[9] = a, c[10] = o, c[11] = l) : l = c[11], l
    };
    var tn = e.i(680513);
    let ts = () => {
        let e, i, n, s, l, c, d, u, m, p, g, v, y, b, k, w = (0, r.c)(34),
            {
                abbreviation: S
            } = (0, o.usePriceChartContext)();
        w[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event", "eventSettings"], w[0] = e) : e = w[0];
        let {
            event: j,
            eventSettings: C
        } = (0, h.useEventContext)(e), _ = (0, f.useChartDataStore)(to), T = (0, f.useChartDataStore)(tl), M = (0, x.shouldDisableLivePriceChart)(j.slug);
        e: {
            let e = C.priceMarketSettings;
            if (!e.priceMarketsUiEnabled) {
                i = !1;
                break e
            }
            i = "fiveminute" === e.variant || "fifteen" === e.variant
        }
        let N = i;
        if (w[1] === Symbol.for("react.memo_cache_sentinel") ? (n = {
                value: "asset-price",
                icon: (0, t.jsx)(ta.IconChartLineOutline18, {
                    className: "![width:unset] ![height:unset]"
                })
            }, w[1] = n) : n = w[1], w[2] !== S ? (s = (0, tn.getIcon)(S) ? ? (0, t.jsx)(tr.IconRadioOutline18, {
                className: "![width:unset] ![height:unset]"
            }), w[2] = S, w[3] = s) : s = w[3], w[4] !== s ? (l = {
                value: "crypto-price",
                icon: s,
                className: "data-[state=on]:text-[var(--tabs-asset-color)]"
            }, w[4] = s, w[5] = l) : l = w[5], w[6] !== N || w[7] !== l) {
            if (c = [n, l], N) {
                let e;
                w[9] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    value: "candlestick",
                    icon: (0, t.jsx)(ti, {
                        className: "![width:unset] ![height:unset]"
                    })
                }, w[9] = e) : e = w[9], c.push(e)
            }
            w[6] = N, w[7] = l, w[8] = c
        } else c = w[8];
        let I = x.PriceMarketAssetColorMap[S];
        w[10] !== I ? (d = {
            "--tabs-asset-color": I
        }, w[10] = I, w[11] = d) : d = w[11];
        let P = d;
        w[12] !== c || w[13] !== P ? (u = {
            toggleGroupItems: c,
            style: P
        }, w[12] = c, w[13] = P, w[14] = u) : u = w[14];
        let {
            style: E,
            toggleGroupItems: A
        } = u;
        if (w[15] !== _ || w[16] !== T || w[17] !== N ? (p = () => {
                N || "candlestick" !== _ || T("crypto-price")
            }, m = [N, _, T], w[15] = _, w[16] = T, w[17] = N, w[18] = m, w[19] = p) : (m = w[18], p = w[19]), a.default.useEffect(p, m), M) return null;
        w[20] !== T ? (g = e => {
            e && T(e)
        }, w[20] = T, w[21] = g) : g = w[21];
        let O = "crypto-price" === _ && "bg-[var(--tabs-asset-color)]/10 dark:bg-[var(--tabs-asset-color)]/30";
        return w[22] !== O ? (v = (0, R.cn)("w-8 h-8 shrink-0 rounded-sm !transition-all duration-200", O), w[22] = O, w[23] = v) : v = w[23], w[24] !== A ? (y = A.map(tc), w[24] = A, w[25] = y) : y = w[25], w[26] !== _ || w[27] !== g || w[28] !== v || w[29] !== y ? (b = (0, t.jsx)(te, {
            type: "single",
            value: _,
            onValueChange: g,
            orientation: "horizontal",
            className: "gap-0.5",
            indicatorClassName: v,
            wrapperClassName: "border rounded-lg p-1 lg:bg-background lg:backdrop-blur-none bg-background/5 backdrop-blur-[4px]",
            children: y
        }), w[26] = _, w[27] = g, w[28] = v, w[29] = y, w[30] = b) : b = w[30], w[31] !== E || w[32] !== b ? (k = (0, t.jsx)("div", {
            style: E,
            className: "absolute bottom-[80px] left-0 lg:relative lg:bottom-0",
            children: b
        }), w[31] = E, w[32] = b, w[33] = k) : k = w[33], k
    };

    function to(e) {
        return e.chartType
    }

    function tl(e) {
        return e.setChartType
    }

    function tc(e) {
        return (0, t.jsx)(tt, {
            value: e.value,
            size: "sm",
            variant: "default",
            className: (0, R.cn)("group size-8 shrink-0 flex items-center justify-center !p-0 !transition-none hover:bg-button-ghost-bg cursor-pointer", e.className),
            children: e.icon
        }, e.value)
    }
    let td = e => {
        let a, i, n, s, o, l, c, d, u, m, p = (0, r.c)(21),
            {
                ref: f,
                children: x,
                componentHeight: g,
                className: v
            } = e;
        p[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], p[0] = a) : a = p[0];
        let {
            event: y
        } = (0, h.useEventContext)(a);
        p[1] === Symbol.for("react.memo_cache_sentinel") ? (i = {
            type: "tween",
            duration: .3,
            ease: e1.easeOutExpo
        }, p[1] = i) : i = p[1];
        let b = `calc(${g} + 24px)`;
        return p[2] !== b ? (n = {
            height: "auto",
            width: "auto",
            minHeight: b
        }, p[2] = b, p[3] = n) : n = p[3], p[4] !== v ? (s = (0, R.cn)("flex flex-col w-full box-border lg:pt-6 lg:mt-4 lg:mb-2", v), p[4] = v, p[5] = s) : s = p[5], p[6] !== x ? (o = (0, t.jsx)("div", {
            className: "relative z-1",
            children: x
        }), p[6] = x, p[7] = o) : o = p[7], p[8] !== y ? (l = y && Array.isArray(y.series) && y.series.length > 0 && (0, t.jsx)("div", {
            className: "mb-3 lg:my-3",
            children: (0, t.jsx)(eW, {
                currentEvent: y,
                series: y.series[0]
            })
        }), p[8] = y, p[9] = l) : l = p[9], p[10] !== l ? (c = (0, t.jsx)("div", {
            className: "flex flex-1",
            children: l
        }), p[10] = l, p[11] = c) : c = p[11], p[12] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)(ts, {}), p[12] = d) : d = p[12], p[13] !== c ? (u = (0, t.jsxs)("div", {
            className: "flex w-max justify-between items-center mt-3 lg:mt-4 lg:w-full lg:mb-1 z-[2]",
            children: [c, d]
        }), p[13] = c, p[14] = u) : u = p[14], p[15] !== f || p[16] !== u || p[17] !== n || p[18] !== s || p[19] !== o ? (m = (0, t.jsx)(eS, {
            transition: i,
            children: (0, t.jsxs)("div", {
                ref: f,
                style: n,
                className: s,
                children: [o, u]
            }, "group-chart")
        }), p[15] = f, p[16] = u, p[17] = n, p[18] = s, p[19] = o, p[20] = m) : m = p[20], m
    };
    td.displayName = "ChartLayout";
    var tu = e.i(284553);
    e.i(186897), e.i(930460), e.i(882860);
    let tm = async e => {
        let [t, r, a, i, n, s] = e.queryKey, {
            data: o
        } = await eA.axios.get("/api/crypto/crypto-price", {
            params: {
                symbol: a,
                eventStartTime: i,
                variant: n,
                endDate: s
            }
        });
        return o
    };
    var tp = e.i(510954),
        th = e.i(57096);

    function tf(e) {
        return e
    }
    tu.default.env.PYTH_LAZER_ACCESS_TOKEN;
    let tx = async e => {
        let [t, r, a, i, n, s] = e.queryKey, {
            data: o
        } = await eA.axios.get("/api/equity/equity-price", {
            params: {
                symbol: a,
                eventStartTime: i,
                endDate: s || void 0,
                variant: n
            }
        });
        return o
    };

    function tg(e) {
        return e
    }
    let tv = e => {
        let n, s, l, c, d, u = (0, r.c)(18),
            {
                event: m,
                height: p,
                timestamp: g,
                etDate: v,
                utcDate: y,
                name: b,
                abbreviation: k,
                assetType: w
            } = e,
            S = void 0 === p ? 288 : p;
        ! function() {
            var e, t;
            let i, n, s, o, l, c, d, u, m, p, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, {
                    event: R,
                    eventSettings: F
                } = (0, h.useEventContext)(["event", "eventSettings"]),
                $ = (0, f.useChartDataStore)(e => e.setTarget),
                B = (0, f.useChartDataStore)(e => e.setFinal),
                q = a.default.useMemo(() => R.markets.find(e => e.eventStartTime), [R.markets]),
                {
                    symbol: V,
                    pair: H,
                    enabled: U,
                    startTime: W,
                    endDate: G,
                    variant: Z,
                    assetType: K
                } = a.default.useMemo(() => {
                    if (F.priceMarketSettings.priceMarketsUiEnabled) {
                        let e = F.priceMarketSettings.abbreviation,
                            t = F.priceMarketSettings.assetType,
                            r = e.toUpperCase(),
                            a = (0, x.getChartSymbol)(e, t),
                            i = q ? .eventStartTime || F.priceMarketSettings.eventStartTime,
                            n = q ? .endDate,
                            s = F.priceMarketSettings.variant || "hourly";
                        return R.slug.includes("-5m") && (s = "fiveminute"), R.slug.includes("-15m") && (s = "fifteen"), R.slug.includes("-4h") && (s = "fourhour"), {
                            symbol: r,
                            pair: a,
                            startTime: i,
                            endDate: n,
                            enabled: !!i,
                            variant: s,
                            assetType: t
                        }
                    }
                    return {
                        symbol: "BTC",
                        pair: "BTCUSDT",
                        startTime: q ? .eventStartTime,
                        endDate: void 0,
                        enabled: !1,
                        variant: "hourly",
                        assetType: "crypto"
                    }
                }, [F.priceMarketSettings, q ? .eventStartTime, q ? .endDate, R.slug]),
                Y = (e = U && "crypto" === K, c = (0, r.c)(24), d = void 0 === e || e, u = void 0 === Z ? "hourly" : Z, c[0] !== G ? (i = G && "" !== G.trim(), c[0] = G, c[1] = i) : i = c[1], m = i, c[2] !== G || c[3] !== m ? (n = m && new Date(G).getTime() < Date.now(), c[2] = G, c[3] = m, c[4] = n) : n = c[4], p = n, g = "fifteen" === u || "fiveminute" === u || "fourhour" === u, v = function(e) {
                    if (!e) return null;
                    let t = Number(e);
                    if (!Number.isNaN(t)) return t < 1e12 ? 1e3 * t : t;
                    let r = new Date(e).getTime();
                    return Number.isNaN(r) ? null : r
                }(W), c[5] !== G || c[6] !== W || c[7] !== V || c[8] !== u ? (s = tp.queryKeys[th.QueryKey.CryptoPrices].price(V, W, u, G), c[5] = G, c[6] = W, c[7] = V, c[8] = u, c[9] = s) : s = c[9], y = d && !!V && !!W, b = p ? 1 / 0 : 3e5, k = p ? 1 / 0 : g ? 15e3 : 6e4, w = !p, S = !p, j = g && !p ? 0 : 3, c[10] !== d || c[11] !== v || c[12] !== p || c[13] !== g ? (o = e => {
                    if (!d || !g || p || !v) return !1;
                    let t = Date.now() - v;
                    if (t < 0 || t > 3e5) return !1;
                    let r = e.state.data;
                    return !("number" == typeof r ? .openPrice && Number.isFinite(r.openPrice)) && 3e3
                }, c[10] = d, c[11] = v, c[12] = p, c[13] = g, c[14] = o) : o = c[14], c[15] !== j || c[16] !== o || c[17] !== s.queryKey || c[18] !== y || c[19] !== b || c[20] !== k || c[21] !== w || c[22] !== S ? (l = {
                    queryKey: s.queryKey,
                    queryFn: tm,
                    select: tf,
                    enabled: y,
                    gcTime: b,
                    staleTime: k,
                    refetchOnWindowFocus: w,
                    refetchOnReconnect: S,
                    retry: j,
                    refetchInterval: o
                }, c[15] = j, c[16] = o, c[17] = s.queryKey, c[18] = y, c[19] = b, c[20] = k, c[21] = w, c[22] = S, c[23] = l) : l = c[23], (0, eI.useQuery)(l)),
                Q = (t = U && "equity" === K, N = (0, r.c)(17), I = void 0 === Z ? "daily" : Z, N[0] !== G ? (C = G && "" !== G.trim(), N[0] = G, N[1] = C) : C = N[1], P = C, N[2] !== G || N[3] !== P ? (_ = P && new Date(G).getTime() < Date.now(), N[2] = G, N[3] = P, N[4] = _) : _ = N[4], E = _, N[5] !== G || N[6] !== W || N[7] !== V || N[8] !== I ? (T = tp.queryKeys[th.QueryKey.EquityPrices].price(V, W, I, G), N[5] = G, N[6] = W, N[7] = V, N[8] = I, N[9] = T) : T = N[9], A = (void 0 === t || t) && !!V && !!W, O = E ? 1 / 0 : 3e5, D = E ? 1 / 0 : 6e4, L = !E, z = !E, N[10] !== T.queryKey || N[11] !== A || N[12] !== O || N[13] !== D || N[14] !== L || N[15] !== z ? (M = {
                    queryKey: T.queryKey,
                    queryFn: tx,
                    select: tg,
                    enabled: A,
                    gcTime: O,
                    staleTime: D,
                    refetchOnWindowFocus: L,
                    refetchOnReconnect: z
                }, N[10] = T.queryKey, N[11] = A, N[12] = O, N[13] = D, N[14] = L, N[15] = z, N[16] = M) : M = N[16], (0, eI.useQuery)(M)),
                X = (0, eI.useQuery)({
                    queryKey: ["price-to-beat", R.slug],
                    queryFn: async () => {
                        let {
                            data: e
                        } = await eA.axios.get(`/api/equity/price-to-beat/${R.slug}`);
                        return e
                    },
                    enabled: U && "equity" === K && !!R.slug,
                    staleTime: 1 / 0,
                    gcTime: 1 / 0,
                    refetchOnWindowFocus: !1,
                    refetchOnReconnect: !1
                }),
                J = "equity" === K ? Q : Y,
                ee = J.data,
                {
                    isLoading: et,
                    refetch: er
                } = J,
                ea = a.default.useMemo(() => {
                    if ("daily" === Z && (!G || "" === G.trim()) && W) {
                        let e = parseInt(W, 10);
                        return Date.now() >= e + 864e5
                    }
                    return R.markets.some(e => e.endDate && "" !== e.endDate.trim() && new Date(e.endDate).getTime() < Date.now())
                }, [R.markets, Z, G, W]);
            a.default.useEffect(() => {
                "equity" === K && X.data ? .priceToBeat ? $(H, X.data.priceToBeat) : !et && ee && $(H, ee.openPrice)
            }, [K, X.data, ee, et, H, $]), a.default.useEffect(() => {
                !et && ee && (null !== ee.closePrice ? B(H, ee.closePrice) : ea && "daily" === Z && er())
            }, [ee, et, ea, H, B, Z, er]), a.default.useEffect(() => {
                if (ea && ee && null === ee.closePrice && "daily" === Z) {
                    let e = 0,
                        t = setInterval(() => {
                            e < 3 ? (er(), e++) : clearInterval(t)
                        }, 1e4);
                    return () => clearInterval(t)
                }
            }, [ea, ee, Z, er])
        }(), m ? .series ? .length;
        let j = `${S-32*!!m?.series?.length}px`,
            C = `${S}px`;
        u[0] !== j || u[1] !== C ? (n = {
            chartHeight: j,
            layoutHeight: C
        }, u[0] = j, u[1] = C, u[2] = n) : n = u[2];
        let {
            chartHeight: _,
            layoutHeight: T
        } = n;
        return u[3] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)(t.Fragment, {}), u[3] = s) : s = u[3], u[4] !== _ ? (l = (0, t.jsx)(ev, {
            height: _
        }), u[4] = _, u[5] = l) : l = u[5], u[6] !== T || u[7] !== l ? (c = (0, t.jsx)(td, {
            componentHeight: T,
            children: l
        }), u[6] = T, u[7] = l, u[8] = c) : c = u[8], u[9] !== k || u[10] !== w || u[11] !== v || u[12] !== m || u[13] !== b || u[14] !== c || u[15] !== g || u[16] !== y ? (d = (0, t.jsx)(i.ErrorBoundary, {
            onError: ty,
            fallback: s,
            children: (0, t.jsx)(o.PriceChartContextProvider, {
                event: m,
                timestamp: g,
                etDate: v,
                utcDate: y,
                name: b,
                abbreviation: k,
                assetType: w,
                children: c
            })
        }), u[9] = k, u[10] = w, u[11] = v, u[12] = m, u[13] = b, u[14] = c, u[15] = g, u[16] = y, u[17] = d) : d = u[17], d
    };

    function ty(e, t) {
        return n.logger.error("Error rendering group chart", {
            error: e,
            errorInfo: t
        })
    }
    let tb = new Set(["BTC", "ETH", "SOL", "XRP", "DOGE", "BNB", "HYPE"]),
        tk = new Set(["EURUSD", "GBPUSD", "USDCAD", "USDJPY", "USDKRW"]);

    function tw(e) {
        let t = new Date(1e3 * e);
        return (0, S.format)(t, "MMM d, yyyy h:mm a")
    }

    function tS(e) {
        return {
            time: e.time,
            value: e.close
        }
    }

    function tj(e) {
        return {
            time: e.time,
            open: e.open,
            high: e.high,
            low: e.low,
            close: e.close
        }
    }

    function tC(e) {
        return (0, t.jsx)(tt, {
            value: e.value,
            size: "sm",
            variant: "default",
            className: (0, R.cn)("group size-8 shrink-0 flex items-center justify-center !p-0 !transition-none hover:bg-button-ghost-bg cursor-pointer", e.className),
            children: e.icon
        }, e.value)
    }
    e.s(["HitMarketChart", 0, e => {
        let i, n, s, o, l, c, d, u, m, p, h, g, v, y, b, k, w, _, T, M, N, I, P, E, A, O, D, L, z, F, $, B, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er = (0, r.c)(111),
            {
                data: ea,
                symbol: es,
                startDate: eo,
                endDate: el
            } = e,
            {
                resolvedTheme: ec
            } = (0, C.useTheme)(),
            ed = "dark" === ec,
            [eu, em] = a.default.useState("area"),
            [ep, eh] = a.default.useState(null),
            ef = a.default.useRef(null),
            ex = a.default.useRef(null),
            eg = a.default.useRef(null),
            ev = a.default.useRef(null),
            ey = x.PriceMarketAssetColorMap[es] || "#2962FF";
        er[0] !== es ? (i = (0, tn.getIcon)(es), er[0] = es, er[1] = i) : i = er[1];
        let eb = i;
        er[2] !== es ? (n = tb.has(es), er[2] = es, er[3] = n) : n = er[3];
        let ek = n;
        er[4] !== el ? (s = el ? new Date(el).getTime() : null, er[4] = el, er[5] = s) : s = er[5];
        let ew = s,
            eS = ek && null != ew ? Date.now() < ew : ek;
        e: {
            if (ea.length < 2) {
                o = 300;
                break e
            }
            let e = ea[1].time - ea[0].time;o = e > 0 ? e : 300
        }
        let ej = o,
            eC = ek ? `${es}USDT` : "",
            e_ = (0, f.useBoundChartDataStore)();
        er[6] !== ea || er[7] !== ej || er[8] !== eS || er[9] !== eu || er[10] !== e_ || er[11] !== eC ? (l = () => {
            if (eS && eC) return e_.subscribe((e, t) => {
                let r = e.chartData[eC] ? .data,
                    a = t.chartData[eC] ? .data;
                if (!r ? .length || r === a) return;
                let i = r[r.length - 1];
                ((e, t) => {
                    if (!eg.current || !ea.length || !Number.isFinite(e)) return;
                    let r = ea[ea.length - 1],
                        a = Math.max(Math.floor(t / ej) * ej, r.time);
                    if (a === r.time)
                        if (ev.current && ev.current.time === a) {
                            let t = ev.current;
                            t.high = Math.max(t.high, e), t.low = Math.min(t.low, e), t.close = e
                        } else ev.current = {
                            time: a,
                            open: r.open,
                            high: Math.max(r.high, e),
                            low: Math.min(r.low, e),
                            close: e
                        };
                    else if (ev.current && ev.current.time === a) {
                        let t = ev.current;
                        t.high = Math.max(t.high, e), t.low = Math.min(t.low, e), t.close = e
                    } else ev.current = {
                        time: a,
                        open: e,
                        high: e,
                        low: e,
                        close: e
                    };
                    let i = ev.current;
                    eh(i.close), "area" === eu ? eg.current.update({
                        time: i.time,
                        value: i.close
                    }) : eg.current.update({
                        time: i.time,
                        open: i.open,
                        high: i.high,
                        low: i.low,
                        close: i.close
                    })
                })(i.value, i.time)
            })
        }, c = [e_, eC, eS, ea, ej, eu], er[6] = ea, er[7] = ej, er[8] = eS, er[9] = eu, er[10] = e_, er[11] = eC, er[12] = l, er[13] = c) : (l = er[12], c = er[13]), a.default.useEffect(l, c);
        t: {
            if (eo && el) {
                let e, t;
                er[14] !== el ? (e = new Date(el).getTime(), er[14] = el, er[15] = e) : e = er[15], er[16] !== eo ? (t = new Date(eo).getTime(), er[16] = eo, er[17] = t) : t = er[17];
                let r = e - t;
                if (Number.isFinite(r) && r > 0) {
                    d = r < 1728e5;
                    break t
                }
            }
            if (ea.length < 2) {
                d = !1;
                break t
            }
            d = ea[ea.length - 1].time - ea[0].time < 172800
        }
        let eT = d;
        er[18] !== eb ? (u = eb ? ? (0, t.jsx)(ta.IconChartLineOutline18, {
            className: "![width:unset] ![height:unset]"
        }), er[18] = eb, er[19] = u) : u = er[19];
        let eM = eb ? "data-[state=on]:text-[var(--tabs-asset-color)]" : void 0;
        er[20] !== eM || er[21] !== u ? (m = {
            value: "area",
            icon: u,
            className: eM
        }, er[20] = eM, er[21] = u, er[22] = m) : m = er[22], er[23] === Symbol.for("react.memo_cache_sentinel") ? (p = {
            value: "candlestick",
            icon: (0, t.jsx)(ti, {
                className: "![width:unset] ![height:unset]"
            })
        }, er[23] = p) : p = er[23], er[24] !== m ? (h = [m, p], er[24] = m, er[25] = h) : h = er[25];
        let eN = h;
        er[26] !== ey ? (g = {
            "--tabs-asset-color": ey
        }, er[26] = ey, er[27] = g) : g = er[27];
        let eI = g;
        er[28] !== eN || er[29] !== eI ? (v = {
            toggleGroupItems: eN,
            style: eI
        }, er[28] = eN, er[29] = eI, er[30] = v) : v = er[30];
        let {
            style: eP,
            toggleGroupItems: eE
        } = v, eA = ed ? "#7b8996" : "#77808d";
        er[31] === Symbol.for("react.memo_cache_sentinel") ? (y = {
            type: j.ColorType.Solid,
            color: "transparent"
        }, er[31] = y) : y = er[31], er[32] !== eA ? (b = {
            textColor: eA,
            background: y,
            attributionLogo: !1,
            fontFamily: '"Open Sauce One", sans-serif',
            fontSize: 11
        }, er[32] = eA, er[33] = b) : b = er[33];
        let eO = ed ? "#1e2a35" : "#f0f2f5";
        er[34] !== eO ? (k = {
            color: eO
        }, er[34] = eO, er[35] = k) : k = er[35], er[36] === Symbol.for("react.memo_cache_sentinel") ? (w = {
            visible: !1
        }, er[36] = w) : w = er[36], er[37] !== k ? (_ = {
            horzLines: k,
            vertLines: w
        }, er[37] = k, er[38] = _) : _ = er[38];
        let eD = ed ? "#7b89964D" : "#77808d4D";
        er[39] !== eT ? (T = e => {
            let t = new Date(1e3 * e);
            return (0, S.format)(t, eT ? "h:mm a" : "MMM d")
        }, er[39] = eT, er[40] = T) : T = er[40], er[41] !== eT || er[42] !== eD || er[43] !== T ? (M = {
            borderVisible: !0,
            borderColor: eD,
            timeVisible: eT,
            secondsVisible: !1,
            fixLeftEdge: !0,
            fixRightEdge: !0,
            rightOffset: 5,
            tickMarkFormatter: T,
            allowBoldLabels: !1
        }, er[41] = eT, er[42] = eD, er[43] = T, er[44] = M) : M = er[44], er[45] === Symbol.for("react.memo_cache_sentinel") ? (N = {
            visible: !0,
            borderVisible: !1,
            scaleMargins: {
                top: .1,
                bottom: .1
            }
        }, I = {
            visible: !1
        }, er[45] = N, er[46] = I) : (N = er[45], I = er[46]);
        let eL = ed ? "#97A5B44D" : "#aeb4bc66",
            ez = ed ? "#1e2a35" : "#f0f2f5";
        er[47] !== eL || er[48] !== ez ? (P = {
            visible: !0,
            style: 2,
            color: eL,
            labelVisible: !0,
            labelBackgroundColor: ez,
            width: 1
        }, er[47] = eL, er[48] = ez, er[49] = P) : P = er[49];
        let eR = ed ? "#97A5B44D" : "#aeb4bc66";
        er[50] !== eR ? (E = {
            visible: !0,
            style: 2,
            color: eR,
            labelVisible: !0
        }, er[50] = eR, er[51] = E) : E = er[51], er[52] !== P || er[53] !== E ? (A = {
            mode: 0,
            vertLine: P,
            horzLine: E
        }, er[52] = P, er[53] = E, er[54] = A) : A = er[54], er[55] === Symbol.for("react.memo_cache_sentinel") ? (O = {
            timeFormatter: tw
        }, D = {
            mouseWheel: !0,
            pressedMouseMove: !0
        }, L = {
            mouseWheel: !0,
            pinch: !0
        }, er[55] = O, er[56] = D, er[57] = L) : (O = er[55], D = er[56], L = er[57]), er[58] !== b || er[59] !== _ || er[60] !== M || er[61] !== A ? (z = {
            autoSize: !0,
            height: 320,
            layout: b,
            grid: _,
            timeScale: M,
            rightPriceScale: N,
            leftPriceScale: I,
            crosshair: A,
            localization: O,
            handleScroll: D,
            handleScale: L
        }, er[58] = b, er[59] = _, er[60] = M, er[61] = A, er[62] = z) : z = er[62];
        let eF = z;
        er[63] !== ey || er[64] !== eF || er[65] !== ea || er[66] !== eu ? (F = () => {
            if (!ef.current || !ea.length) return;
            let e = (0, j.createChart)(ef.current, eF);
            if (ex.current = e, "area" === eu) {
                let t = e.addSeries(j.AreaSeries, {
                    lineColor: ey,
                    topColor: `${ey}33`,
                    bottomColor: `${ey}05`,
                    lineWidth: 2,
                    crosshairMarkerVisible: !0,
                    crosshairMarkerRadius: 4,
                    lastValueVisible: !0,
                    priceLineVisible: !1
                });
                t.setData(ea.map(tS)), eg.current = t
            } else {
                let t = e.addSeries(j.CandlestickSeries, {
                    upColor: "#22c55e",
                    downColor: "#ef4444",
                    wickUpColor: "#22c55e",
                    wickDownColor: "#ef4444",
                    borderVisible: !1
                });
                t.setData(ea.map(tj)), eg.current = t
            }
            let t = ev.current;
            return t && ea.length && t.time >= ea[ea.length - 1].time && ("area" === eu ? eg.current.update({
                time: t.time,
                value: t.close
            }) : eg.current.update({
                time: t.time,
                open: t.open,
                high: t.high,
                low: t.low,
                close: t.close
            })), e.timeScale().fitContent(), () => {
                e.remove(), ex.current = null, eg.current = null
            }
        }, er[63] = ey, er[64] = eF, er[65] = ea, er[66] = eu, er[67] = F) : F = er[67], er[68] !== ey || er[69] !== eF || er[70] !== ea || er[71] !== ed || er[72] !== eu || er[73] !== es ? ($ = [ea, eu, ed, ey, eF, es], er[68] = ey, er[69] = eF, er[70] = ea, er[71] = ed, er[72] = eu, er[73] = es, er[74] = $) : $ = er[74], a.default.useEffect(F, $);
        let e$ = ea.length ? ea[0].close : null,
            eB = ea.length ? ea[ea.length - 1].close : null,
            eq = ek ? ep : ep ? ? eB;
        er[75] !== eq ? (B = null != eq ? eq >= 1 ? 2 : eq >= .01 ? 4 : 6 : 2, er[75] = eq, er[76] = B) : B = er[76];
        let eV = B;
        er[77] !== eq || er[78] !== eV ? (q = null != eq && Number.isFinite(eq) ? parseFloat(eq.toFixed(eV)) : null, er[77] = eq, er[78] = eV, er[79] = q) : q = er[79];
        let eH = q,
            eU = null != eq && null != e$ && e$ > 0 ? (eq - e$) / e$ * 100 : null;
        if (0 === ea.length) return null;
        (er[80] === Symbol.for("react.memo_cache_sentinel") ? (V = {
            height: 360
        }, er[80] = V) : V = er[80], er[81] !== es ? (H = (0, t.jsx)("span", {
            className: "text-lg font-bold text-text-primary",
            children: es
        }), er[81] = es, er[82] = H) : H = er[82], er[83] !== eH || er[84] !== eV || er[85] !== es) ? (U = null != eH && (0, t.jsx)(en.NumberFlowGroup, {
            children: (0, t.jsx)(ei.default, {
                value: eH,
                prefix: tk.has(es) ? "" : "$",
                className: "text-lg font-semibold text-text-secondary normal-nums!",
                trend: 0,
                format: {
                    minimumFractionDigits: eV,
                    maximumFractionDigits: eV
                },
                transformTiming: {
                    duration: 450,
                    easing: "linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"
                }
            })
        }), er[83] = eH, er[84] = eV, er[85] = es, er[86] = U) : U = er[86], er[87] !== eU ? (W = null != eU && (0, t.jsxs)("span", {
            className: `text-sm font-medium ${eU>=0?"text-green-500":"text-red-500"}`,
            children: [eU >= 0 ? "+" : "", eU.toFixed(2), "%"]
        }), er[87] = eU, er[88] = W) : W = er[88], er[89] !== H || er[90] !== U || er[91] !== W ? (G = (0, t.jsxs)("div", {
            className: "flex items-center gap-3",
            children: [H, U, W]
        }), er[89] = H, er[90] = U, er[91] = W, er[92] = G) : G = er[92], er[93] === Symbol.for("react.memo_cache_sentinel") ? (Z = e => {
            e && em(e)
        }, er[93] = Z) : Z = er[93];
        let eW = "area" === eu && eb && "bg-[var(--tabs-asset-color)]/10 dark:bg-[var(--tabs-asset-color)]/30";
        return er[94] !== eW ? (K = (0, R.cn)("w-8 h-8 shrink-0 rounded-sm !transition-all duration-200", eW), er[94] = eW, er[95] = K) : K = er[95], er[96] !== eE ? (Y = eE.map(tC), er[96] = eE, er[97] = Y) : Y = er[97], er[98] !== eu || er[99] !== K || er[100] !== Y ? (Q = (0, t.jsx)(te, {
            type: "single",
            value: eu,
            onValueChange: Z,
            orientation: "horizontal",
            className: "gap-0.5",
            indicatorClassName: K,
            wrapperClassName: "border rounded-lg p-1 lg:bg-background lg:backdrop-blur-none bg-background/5 backdrop-blur-[4px]",
            children: Y
        }), er[98] = eu, er[99] = K, er[100] = Y, er[101] = Q) : Q = er[101], er[102] !== eP || er[103] !== Q ? (X = (0, t.jsx)("div", {
            style: eP,
            children: Q
        }), er[102] = eP, er[103] = Q, er[104] = X) : X = er[104], er[105] !== G || er[106] !== X ? (J = (0, t.jsxs)("div", {
            className: "flex items-center justify-between px-1 mb-2",
            children: [G, X]
        }), er[105] = G, er[106] = X, er[107] = J) : J = er[107], er[108] === Symbol.for("react.memo_cache_sentinel") ? (ee = (0, t.jsx)("div", {
            ref: ef,
            style: {
                width: "100%",
                height: 320
            }
        }), er[108] = ee) : ee = er[108], er[109] !== J ? (et = (0, t.jsxs)("div", {
            className: "w-full",
            style: V,
            children: [J, ee]
        }), er[109] = J, er[110] = et) : et = er[110], et
    }], 560127);
    var t_ = e.i(122538),
        tT = e.i(635973),
        tM = e.i(16674),
        tN = e.i(702502),
        tI = e.i(363966),
        tP = e.i(344558),
        tE = e.i(631222);
    let tA = 50,
        tO = async e => {
            let [t, r, a, i, s, o] = e.queryKey, l = ((e, t = tA, r = 0, a = "ALL", i = "TOTAL_PNL", n = "DESC") => {
                let s = new URLSearchParams({
                    market: e,
                    limit: String(t),
                    offset: String(r),
                    status: a,
                    sortBy: i,
                    sortDirection: n
                });
                return `${tE.DATA_API}/v1/market-positions?${s.toString()}`
            })(a, tA, e.pageParam ? ? 0, i, s, o), c = await eA.axios.get(l).then(({
                data: e
            }) => e);
            return Array.isArray(c) ? c.map(e => ({ ...e,
                rawPositionCount: e.positions ? .length ? ? 0,
                positions: (0, tP.filterExcludedWallets)(e.positions)
            })) : (n.logger.error("getMarketPositionsInfiniteFetcher error", {
                res: c
            }), [])
        };

    function tD(e, t) {
        let r = t.length * tA;
        if (!(r >= 1e4) && e.some(e => (e.rawPositionCount ? ? e.positions.length) === tA)) return r
    }
    var tL = e.i(100175),
        tz = e.i(619264),
        tR = e.i(196593),
        tF = e.i(177412);
    let t$ = Array.from({
            length: 20
        }, (e, t) => `skeleton-${t+1}`),
        tB = new Intl.NumberFormat(void 0, {
            style: "currency",
            currency: "USD",
            minimumFractionDigits: 2,
            maximumFractionDigits: 2
        }),
        tq = e => "number" == typeof e && Number.isFinite(e) ? tB.format(e) : "$0.00";

    function tV(e) {
        return e > 0 ? "text-green-500" : e < 0 ? "text-red-500" : "text-text-secondary"
    }

    function tH(e) {
        let a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C, _, T, N, I, P, A, O, D, L, R, F, $, B, q = (0, r.c)(94),
            {
                position: V,
                isSkeleton: H
            } = e,
            U = (0, M.useTranslations)();
        if (q[0] !== V) a = V && "string" == typeof V.proxyWallet ? V.proxyWallet : `0x123${Math.ceil(100*Math.random())}`, i = (0, tN.createProfileUrl)({
            proxyWallet: a,
            name: V ? .name
        }), q[0] = V, q[1] = a, q[2] = i;
        else a = q[1], i = q[2];
        let W = i;
        if (H || !V) {
            let e, r, a;
            return q[3] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(z.Media, {
                greaterThanOrEqual: "lg",
                children: (0, t.jsxs)("div", {
                    className: "flex items-center justify-between border-b border-border h-[44px]",
                    children: [(0, t.jsxs)("div", {
                        className: "flex items-center",
                        children: [(0, t.jsx)("div", {
                            className: "w-8 h-8 mr-4 rounded-full animate-pulse bg-neutral-100"
                        }), (0, t.jsx)("div", {
                            className: "w-[120px] h-6 rounded animate-pulse bg-neutral-100"
                        })]
                    }), (0, t.jsx)("div", {
                        className: "w-16 h-6 rounded animate-pulse bg-neutral-100"
                    })]
                })
            }), q[3] = e) : e = q[3], q[4] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)("div", {
                className: "w-8 h-8 rounded-full animate-pulse bg-neutral-100 shrink-0"
            }), q[4] = r) : r = q[4], q[5] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsxs)(t.Fragment, {
                children: [e, (0, t.jsx)(z.Media, {
                    lessThan: "lg",
                    children: (0, t.jsxs)("div", {
                        className: "flex w-full border-b border-border py-2.5 items-start gap-2",
                        children: [r, (0, t.jsxs)("div", {
                            className: "flex min-w-0 flex-1 flex-col gap-1",
                            children: [(0, t.jsx)("span", {
                                className: "w-[90px] h-4 rounded animate-pulse bg-neutral-100 block"
                            }), (0, t.jsx)("span", {
                                className: "w-[72px] h-3 rounded animate-pulse bg-neutral-100 block"
                            }), (0, t.jsx)("span", {
                                className: "w-[100px] h-3 rounded animate-pulse bg-neutral-100 block"
                            }), (0, t.jsx)("span", {
                                className: "w-[80px] h-4 rounded animate-pulse bg-neutral-100 block"
                            })]
                        })]
                    })
                })]
            }), q[5] = a) : a = q[5], a
        }
        q[6] !== V.profileImage || q[7] !== V.proxyWallet ? (n = (0, t.jsx)(tI.default, {
            address: V.proxyWallet,
            alt: V.proxyWallet,
            height: 32,
            profileImage: V.profileImage,
            quality: 100,
            width: 32
        }), q[6] = V.profileImage, q[7] = V.proxyWallet, q[8] = n) : n = q[8];
        let G = n;
        q[9] !== G ? (s = (0, t.jsx)("div", {
            className: "min-w-[32px] flex items-center",
            children: G
        }), q[9] = G, q[10] = s) : s = q[10], q[11] !== a || q[12] !== V || q[13] !== s ? (o = (0, t.jsx)(z.Media, {
            greaterThanOrEqual: "lg",
            children: (0, t.jsx)(tF.ProfileHoverCard, {
                user: V,
                address: a,
                children: s
            })
        }), q[11] = a, q[12] = V, q[13] = s, q[14] = o) : o = q[14], q[15] !== G || q[16] !== W ? (l = (0, t.jsx)(z.Media, {
            lessThan: "lg",
            children: (0, t.jsx)(E.default, {
                href: W,
                className: "shrink-0",
                children: G
            })
        }), q[15] = G, q[16] = W, q[17] = l) : l = q[17], q[18] !== V ? (c = (0, tz.formatUserName)(V, 25), q[18] = V, q[19] = c) : c = q[19], q[20] !== c ? (d = (0, t.jsx)("span", {
            className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-body-base font-medium hover:underline block",
            children: c
        }), q[20] = c, q[21] = d) : d = q[21], q[22] !== a || q[23] !== V || q[24] !== d ? (u = (0, t.jsx)(z.Media, {
            greaterThanOrEqual: "lg",
            children: (0, t.jsx)(tF.ProfileHoverCard, {
                user: V,
                address: a,
                children: d
            })
        }), q[22] = a, q[23] = V, q[24] = d, q[25] = u) : u = q[25], q[26] !== V ? (m = (0, tz.formatUserName)(V, 18), q[26] = V, q[27] = m) : m = q[27], q[28] !== m ? (p = (0, t.jsx)("span", {
            className: "text-text-primary text-sm font-semibold leading-[20px] truncate block",
            children: m
        }), q[28] = m, q[29] = p) : p = q[29], q[30] !== W || q[31] !== p ? (h = (0, t.jsx)(E.default, {
            href: W,
            className: "min-w-0 flex-1",
            children: p
        }), q[30] = W, q[31] = p, q[32] = h) : h = q[32], q[33] !== V.verified ? (f = V.verified && (0, t.jsx)("span", {
            className: "shrink-0 flex items-center",
            children: (0, t.jsx)(tL.VerifiedBadge, {
                size: "small"
            })
        }), q[33] = V.verified, q[34] = f) : f = q[34], q[35] !== h || q[36] !== f ? (x = (0, t.jsxs)("div", {
            className: "flex items-center gap-1 min-w-0 flex-1",
            children: [h, f]
        }), q[35] = h, q[36] = f, q[37] = x) : x = q[37], q[38] !== U ? (g = U("topHolders.avg"), q[38] = U, q[39] = g) : g = q[39];
        let Z = 100 * V.avgPrice;
        q[40] !== Z ? (v = (0, tR.formatToCents)(Z), q[40] = Z, q[41] = v) : v = q[41];
        let K = `${g} ${v}`;
        q[42] !== K ? (y = (0, t.jsx)("span", {
            className: "shrink-0 text-[11px] leading-4 font-medium text-text-primary",
            children: K
        }), q[42] = K, q[43] = y) : y = q[43], q[44] !== x || q[45] !== y ? (b = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 min-w-0 justify-between w-full",
            children: [x, y]
        }), q[44] = x, q[45] = y, q[46] = b) : b = q[46], q[47] !== V.totalPnl ? (k = tV(V.totalPnl), q[47] = V.totalPnl, q[48] = k) : k = q[48];
        let Y = `text-sm font-semibold leading-5 mt-0.5 truncate ${k}`;
        q[49] !== V.totalPnl ? (w = tq(V.totalPnl), q[49] = V.totalPnl, q[50] = w) : w = q[50], q[51] !== Y || q[52] !== w ? (S = (0, t.jsx)("span", {
            className: Y,
            children: w
        }), q[51] = Y, q[52] = w, q[53] = S) : S = q[53], q[54] !== V.totalBought ? (j = tq(V.totalBought), q[54] = V.totalBought, q[55] = j) : j = q[55], q[56] !== U ? (C = U("topHolders.bought"), q[56] = U, q[57] = C) : C = q[57];
        let Q = `${j} ${C}`;
        q[58] !== Q ? (_ = (0, t.jsx)("span", {
            className: "text-[11px] leading-4 text-text-secondary truncate",
            children: Q
        }), q[58] = Q, q[59] = _) : _ = q[59], q[60] !== b || q[61] !== S || q[62] !== _ ? (T = (0, t.jsx)(z.Media, {
            lessThan: "lg",
            children: (0, t.jsxs)("div", {
                className: "flex min-w-0 flex-1 flex-col",
                children: [b, S, _]
            })
        }), q[60] = b, q[61] = S, q[62] = _, q[63] = T) : T = q[63], q[64] !== V.verified ? (N = V.verified && (0, t.jsx)("span", {
            className: "shrink-0 flex items-center",
            children: (0, t.jsx)(tL.VerifiedBadge, {
                size: "small"
            })
        }), q[64] = V.verified, q[65] = N) : N = q[65], q[66] !== N ? (I = (0, t.jsx)(z.Media, {
            greaterThanOrEqual: "lg",
            children: N
        }), q[66] = N, q[67] = I) : I = q[67], q[68] !== T || q[69] !== I || q[70] !== u ? (P = (0, t.jsxs)("div", {
            className: "ml-4 flex items-center gap-1 overflow-hidden max-lg:w-full",
            children: [u, T, I]
        }), q[68] = T, q[69] = I, q[70] = u, q[71] = P) : P = q[71], q[72] !== U ? (A = U("topHolders.avg"), q[72] = U, q[73] = A) : A = q[73];
        let X = 100 * V.avgPrice;
        q[74] !== X ? (O = (0, tR.formatToCents)(X), q[74] = X, q[75] = O) : O = q[75], q[76] !== A || q[77] !== O ? (D = (0, t.jsxs)("span", {
            className: "ml-2 text-xs text-text-secondary whitespace-nowrap hidden lg:block",
            children: [A, " ", O]
        }), q[76] = A, q[77] = O, q[78] = D) : D = q[78], q[79] !== P || q[80] !== D || q[81] !== o || q[82] !== l ? (L = (0, t.jsxs)("div", {
            className: "flex lg:items-center max-lg:items-start lg:flex-1 lg:min-w-0 lg:mr-2 max-lg:shrink-0 max-lg:w-full",
            children: [o, l, P, D]
        }), q[79] = P, q[80] = D, q[81] = o, q[82] = l, q[83] = L) : L = q[83], q[84] !== V.totalPnl ? (R = tV(V.totalPnl), q[84] = V.totalPnl, q[85] = R) : R = q[85];
        let J = `text-body-base font-semibold ${R}`;
        return q[86] !== V.totalPnl ? (F = tq(V.totalPnl), q[86] = V.totalPnl, q[87] = F) : F = q[87], q[88] !== J || q[89] !== F ? ($ = (0, t.jsx)(z.Media, {
            greaterThanOrEqual: "lg",
            children: (0, t.jsx)("div", {
                className: "flex flex-col items-end shrink-0",
                children: (0, t.jsx)("span", {
                    className: J,
                    children: F
                })
            })
        }), q[88] = J, q[89] = F, q[90] = $) : $ = q[90], q[91] !== L || q[92] !== $ ? (B = (0, t.jsxs)("div", {
            className: "flex border-b border-border lg:items-center lg:justify-between lg:h-[44px] max-lg:py-2.5 max-lg:items-start max-lg:gap-2 max-lg:overflow-hidden",
            children: [L, $]
        }), q[91] = L, q[92] = $, q[93] = B) : B = q[93], B
    }

    function tU(e) {
        let a, i, n, s, o, l, c, d, u, m = (0, r.c)(26),
            {
                positions: p,
                outcome: h,
                hasNoPositions: f,
                isLeftColumn: x
            } = e,
            g = (0, M.useTranslations)(),
            v = `flex min-w-0 flex-col w-1/2 ${x?"pr-2 lg:pr-5":"pl-2 lg:pl-5"}`;
        return m[0] !== h ? (a = (0, t.jsx)("span", {
            className: "text-base font-semibold text-text-primary truncate",
            children: h
        }), m[0] = h, m[1] = a) : a = m[1], m[2] !== g ? (i = g("topHolders.pnl"), m[2] = g, m[3] = i) : i = m[3], m[4] !== i ? (n = (0, t.jsx)("span", {
            className: "text-[10px] font-medium text-text-secondary tracking-wider uppercase hidden lg:block",
            children: i
        }), m[4] = i, m[5] = n) : n = m[5], m[6] !== a || m[7] !== n ? (s = (0, t.jsxs)("div", {
            className: "flex justify-between items-center h-[44px] border-b border-border min-w-0",
            children: [a, n]
        }), m[6] = a, m[7] = n, m[8] = s) : s = m[8], m[9] !== f || m[10] !== g ? (o = f ? (0, t.jsx)("span", {
            className: "mt-6 text-text-secondary font-medium text-sm",
            children: g("events.noPositionsYet")
        }) : null, m[9] = f, m[10] = g, m[11] = o) : o = m[11], m[12] !== f || m[13] !== p ? (l = !f && Array.isArray(p) && p.length > 0 ? p.map(tG) : null, m[12] = f, m[13] = p, m[14] = l) : l = m[14], m[15] !== f || m[16] !== p ? (c = f || void 0 !== p ? null : t$.map(tW), m[15] = f, m[16] = p, m[17] = c) : c = m[17], m[18] !== o || m[19] !== l || m[20] !== c ? (d = (0, t.jsxs)("div", {
            className: "flex flex-col",
            children: [o, l, c]
        }), m[18] = o, m[19] = l, m[20] = c, m[21] = d) : d = m[21], m[22] !== v || m[23] !== s || m[24] !== d ? (u = (0, t.jsxs)("div", {
            className: v,
            children: [s, d]
        }), m[22] = v, m[23] = s, m[24] = d, m[25] = u) : u = m[25], u
    }

    function tW(e) {
        return (0, t.jsx)(tH, {
            position: void 0,
            isSkeleton: !0
        }, e)
    }

    function tG(e) {
        return (0, t.jsx)(tH, {
            position: e,
            isSkeleton: !1
        }, e.proxyWallet)
    }

    function tZ(e) {
        let a, i, n, s, o, l, c, d = (0, r.c)(22),
            {
                isOpen: u,
                onOpenChange: m,
                options: p,
                value: h,
                onSelect: f
            } = e;
        d[0] !== p || d[1] !== h ? (a = p.find(e => e.value === h) ? .label ? ? h, d[0] = p, d[1] = h, d[2] = a) : a = d[2];
        let x = a;
        d[3] !== x ? (i = (0, t.jsx)("span", {
            className: "font-medium",
            children: x
        }), d[3] = x, d[4] = i) : i = d[4];
        let g = `shrink-0 transition-transform duration-200 ${u?"rotate-180":""}`;
        if (d[5] !== g ? (n = (0, t.jsx)(eM.IconChevronDownOutline12, {
                className: g
            }), d[5] = g, d[6] = n) : n = d[6], d[7] !== i || d[8] !== n ? (s = (0, t.jsx)(ej.DropdownMenuTrigger, {
                asChild: !0,
                children: (0, t.jsxs)(F.Button, {
                    variant: "outline",
                    size: "lg",
                    className: "group rounded-md flex items-center gap-1 px-4 focus-visible:ring-0",
                    children: [i, n]
                })
            }), d[7] = i, d[8] = n, d[9] = s) : s = d[9], d[10] !== f || d[11] !== p) {
            let e;
            d[13] !== f ? (e = e => (0, t.jsx)(ej.DropdownMenuItem, {
                className: "cursor-pointer",
                onClick: () => f(e.value),
                children: e.label
            }, e.value), d[13] = f, d[14] = e) : e = d[14], o = p.map(e), d[10] = f, d[11] = p, d[12] = o
        } else o = d[12];
        return d[15] !== o ? (l = (0, t.jsx)(ej.DropdownMenuContent, {
            className: "min-w-[140px]",
            align: "start",
            children: o
        }), d[15] = o, d[16] = l) : l = d[16], d[17] !== u || d[18] !== m || d[19] !== s || d[20] !== l ? (c = (0, t.jsxs)(ej.DropdownMenu, {
            open: u,
            onOpenChange: m,
            children: [s, l]
        }), d[17] = u, d[18] = m, d[19] = s, d[20] = l, d[21] = c) : c = d[21], c
    }
    e.s(["default", 0, function(e) {
        let i, n, s, o, l, c, d, u, m, p, h, f, x, g, v, b, k, w, S, j, C, _, T, N, I, P, E, A, O, D, L = (0, r.c)(93),
            {
                sortedMarkets: z
            } = e;
        L[0] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], L[0] = i) : i = L[0];
        let {
            activeMarket: R
        } = (0, y.useEventActiveMarketContext)(i), $ = (0, M.useTranslations)(), [B, q] = (0, a.useState)(R), [V, H] = (0, a.useState)(!1), [U, W] = (0, a.useState)(!1), [G, Z] = (0, a.useState)(!1), [K, Y] = (0, a.useState)(20), [Q, X] = (0, a.useState)("ALL"), [J, ee] = (0, a.useState)("DESC");
        L[1] !== $ ? (n = [{
            value: "ALL",
            label: $("topHolders.positionFilters.all")
        }, {
            value: "OPEN",
            label: $("topHolders.positionFilters.open")
        }, {
            value: "CLOSED",
            label: $("topHolders.positionFilters.closed")
        }], L[1] = $, L[2] = n) : n = L[2];
        let et = n;
        L[3] !== $ ? (s = [{
            value: "DESC",
            label: $("topHolders.positionFilters.desc")
        }, {
            value: "ASC",
            label: $("topHolders.positionFilters.asc")
        }], L[3] = $, L[4] = s) : s = L[4];
        let er = s;
        L[5] !== R ? (o = () => {
            q(R), Y(20)
        }, l = [R], L[5] = R, L[6] = o, L[7] = l) : (o = L[6], l = L[7]), (0, a.useEffect)(o, l), L[8] !== B ? .conditionId || L[9] !== J || L[10] !== Q ? (c = tp.queryKeys[th.QueryKey.MarketPositions].infinite(B ? .conditionId, Q, "TOTAL_PNL", J), L[8] = B ? .conditionId, L[9] = J, L[10] = Q, L[11] = c) : c = L[11];
        let ea = "string" == typeof B ? .conditionId;
        L[12] !== c.queryKey || L[13] !== ea ? (d = {
            queryKey: c.queryKey,
            queryFn: tO,
            enabled: ea,
            placeholderData: t_.keepPreviousData,
            gcTime: 6e5,
            staleTime: 6e4,
            refetchOnMount: !1,
            initialPageParam: 0,
            getNextPageParam: tD
        }, L[12] = c.queryKey, L[13] = ea, L[14] = d) : d = L[14];
        let {
            data: ei,
            fetchNextPage: en,
            hasNextPage: es,
            isFetchingNextPage: eo
        } = (0, tT.useInfiniteQuery)(d);
        ei ? .pages;
        let el = ei ? .pages;
        L[15] !== el ? (u = function(e) {
            if (!e || 0 === e.length) return;
            let t = {};
            for (let r of e)
                for (let e of r) t[e.token] || (t[e.token] = []), t[e.token].push(...e.positions);
            return Object.entries(t).map(([e, t]) => ({
                token: e,
                positions: t
            }))
        }(el), L[15] = el, L[16] = u) : u = L[16];
        let ec = u;
        e: {
            let e, t, r;
            if (!Array.isArray(ec)) {
                m = void 0;
                break e
            }
            let a = B ? .clobTokenIds ? .[0] ? ? !1,
                i = B ? .clobTokenIds ? .[1] ? ? !1;
            if (!a || !i) {
                m = void 0;
                break e
            }
            if (ec[0] ? .token === a && ec[1] ? .token === i) {
                m = ec;
                break e
            }
            if (L[17] !== ec || L[18] !== a) {
                let t;
                L[20] !== a ? (t = e => e.token === a, L[20] = a, L[21] = t) : t = L[21], e = ec.find(t), L[17] = ec, L[18] = a, L[19] = e
            } else e = L[19];
            let n = e;
            if (L[22] !== ec || L[23] !== i) {
                let e;
                L[25] !== i ? (e = e => e.token === i, L[25] = i, L[26] = e) : e = L[26], t = ec.find(e), L[22] = ec, L[23] = i, L[24] = t
            } else t = L[24];
            let s = t;
            if (n && s) {
                let e;
                L[27] !== s || L[28] !== n ? (e = [n, s], L[27] = s, L[28] = n, L[29] = e) : e = L[29], m = e;
                break e
            }
            L[30] === Symbol.for("react.memo_cache_sentinel") ? (r = [], L[30] = r) : r = L[30],
            m = r
        }
        let ed = m;
        t: {
            if (!ed) {
                p = 0;
                break t
            }
            p = Math.max(ed[0] ? .positions ? .length ? ? 0, ed[1] ? .positions ? .length ? ? 0)
        }
        let eu = p,
            em = K < eu || es;
        L[31] === Symbol.for("react.memo_cache_sentinel") ? (h = {
            threshold: 0
        }, L[31] = h) : h = L[31];
        let {
            ref: ep,
            inView: eh
        } = (0, tM.useInView)(h);
        L[32] !== en || L[33] !== es || L[34] !== eh || L[35] !== eo || L[36] !== eu || L[37] !== K ? (f = () => {
            eh && !eo && (K < eu ? Y(Math.min(K + 20, 1e4)) : es && K < 1e4 && en())
        }, x = [eh, eo, K, eu, es, en], L[32] = en, L[33] = es, L[34] = eh, L[35] = eo, L[36] = eu, L[37] = K, L[38] = f, L[39] = x) : (f = L[38], x = L[39]), (0, a.useEffect)(f, x), L[40] !== B ? .groupItemTitle || L[41] !== z.length ? (g = () => z.length > 1 && "string" == typeof B ? .groupItemTitle, L[40] = B ? .groupItemTitle, L[41] = z.length, L[42] = g) : g = L[42], B ? .groupItemTitle;
        let ef = g(),
            ex = Array.isArray(ec) && 0 === ec.length;
        L[43] === Symbol.for("react.memo_cache_sentinel") ? (v = () => Y(20), L[43] = v) : v = L[43];
        let eg = v;
        L[44] === Symbol.for("react.memo_cache_sentinel") ? (b = e => {
            X(e), eg()
        }, L[44] = b) : b = L[44];
        let ev = b;
        L[45] === Symbol.for("react.memo_cache_sentinel") ? (k = e => {
            ee(e), eg()
        }, L[45] = k) : k = L[45];
        let ey = k;
        L[46] !== V || L[47] !== B ? .groupItemTitle || L[48] !== ef || L[49] !== z ? (w = ef ? (0, t.jsxs)(ej.DropdownMenu, {
            open: V,
            onOpenChange: H,
            children: [(0, t.jsx)(ej.DropdownMenuTrigger, {
                asChild: !0,
                children: (0, t.jsxs)(F.Button, {
                    variant: "outline",
                    size: "lg",
                    className: "group rounded-md flex items-center justify-between px-4 w-full md:w-[250px] focus-visible:ring-0",
                    "aria-label": "sort-markets-by",
                    children: [(0, t.jsx)("span", {
                        className: "font-medium truncate",
                        children: B ? .groupItemTitle
                    }), (0, t.jsx)(eM.IconChevronDownOutline12, {
                        className: `ml-2 shrink-0 transition-transform duration-200 ${V?"rotate-180":""}`
                    })]
                })
            }), (0, t.jsx)(ej.DropdownMenuContent, {
                className: "w-full md:w-[250px] max-h-[400px] overflow-y-auto",
                align: "start",
                children: z.map(e => (0, t.jsx)(ej.DropdownMenuItem, {
                    className: "cursor-pointer",
                    onClick: () => {
                        q(e), eg()
                    },
                    children: (0, t.jsx)("span", {
                        className: "truncate",
                        children: e.groupItemTitle
                    })
                }, e.conditionId))
            })]
        }) : null, L[46] = V, L[47] = B ? .groupItemTitle, L[48] = ef, L[49] = z, L[50] = w) : w = L[50], L[51] !== w ? (S = (0, t.jsx)("div", {
            className: "flex items-center gap-2",
            children: w
        }), L[51] = w, L[52] = S) : S = L[52], L[53] !== U || L[54] !== Q || L[55] !== et ? (j = (0, t.jsx)(tZ, {
            isOpen: U,
            onOpenChange: W,
            options: et,
            value: Q,
            onSelect: ev
        }), L[53] = U, L[54] = Q, L[55] = et, L[56] = j) : j = L[56], L[57] !== er || L[58] !== G || L[59] !== J ? (C = (0, t.jsx)(tZ, {
            isOpen: G,
            onOpenChange: Z,
            options: er,
            value: J,
            onSelect: ey
        }), L[57] = er, L[58] = G, L[59] = J, L[60] = C) : C = L[60], L[61] !== j || L[62] !== C ? (_ = (0, t.jsxs)("div", {
            className: "flex items-center gap-2",
            children: [j, C]
        }), L[61] = j, L[62] = C, L[63] = _) : _ = L[63], L[64] !== S || L[65] !== _ ? (T = (0, t.jsxs)("div", {
            className: "mb-2 flex items-center justify-between flex-wrap gap-2",
            children: [S, _]
        }), L[64] = S, L[65] = _, L[66] = T) : T = L[66], L[67] !== ed ? .[0] ? .positions || L[68] !== K ? (N = ed ? .[0] ? .positions ? .slice(0, K), L[67] = ed ? .[0] ? .positions, L[68] = K, L[69] = N) : N = L[69];
        let eb = B ? .outcomes ? .[0];
        L[70] !== ex || L[71] !== N || L[72] !== eb ? (I = (0, t.jsx)(tU, {
            isLeftColumn: !0,
            positions: N,
            outcome: eb,
            hasNoPositions: ex
        }), L[70] = ex, L[71] = N, L[72] = eb, L[73] = I) : I = L[73], L[74] !== ed ? .[1] ? .positions || L[75] !== K ? (P = ed ? .[1] ? .positions ? .slice(0, K), L[74] = ed ? .[1] ? .positions, L[75] = K, L[76] = P) : P = L[76];
        let ek = B ? .outcomes ? .[1];
        return L[77] !== ex || L[78] !== P || L[79] !== ek ? (E = (0, t.jsx)(tU, {
            isLeftColumn: !1,
            positions: P,
            outcome: ek,
            hasNoPositions: ex
        }), L[77] = ex, L[78] = P, L[79] = ek, L[80] = E) : E = L[80], L[81] !== I || L[82] !== E ? (A = (0, t.jsxs)("div", {
            className: "flex min-w-0",
            children: [I, E]
        }), L[81] = I, L[82] = E, L[83] = A) : A = L[83], L[84] !== em || L[85] !== ex || L[86] !== eo || L[87] !== ep ? (O = em && !ex ? (0, t.jsx)("div", {
            ref: ep,
            className: "flex justify-center py-4",
            children: eo ? (0, t.jsx)("div", {
                className: "w-6 h-6 border-2 border-border border-t-text-primary rounded-full animate-spin"
            }) : null
        }) : null, L[84] = em, L[85] = ex, L[86] = eo, L[87] = ep, L[88] = O) : O = L[88], L[89] !== T || L[90] !== A || L[91] !== O ? (D = (0, t.jsxs)("div", {
            className: "flex w-full flex-col",
            children: [T, A, O]
        }), L[89] = T, L[90] = A, L[91] = O, L[92] = D) : D = L[92], D
    }], 944277)
}, 619305, 105418, 400635, 572902, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(23128),
        i = e.i(158789),
        n = e.i(798631),
        s = e.i(122538),
        o = e.i(635973),
        l = e.i(219469),
        c = e.i(81940),
        d = e.i(215959),
        u = e.i(212017),
        m = e.i(208956),
        p = e.i(416340),
        h = e.i(16674),
        f = e.i(944891),
        x = e.i(399336),
        g = e.i(6204),
        v = e.i(604777),
        y = e.i(702502),
        b = e.i(363966),
        k = e.i(344558),
        w = e.i(655740),
        S = e.i(53950),
        j = e.i(631222);
    let C = 15,
        _ = async e => {
            let [t, r, a] = e.queryKey, i = ((e, t = C, r = 0) => {
                let a = new URLSearchParams({
                    market: e,
                    limit: String(t),
                    offset: String(r)
                });
                return `${j.DATA_API}/holders?${a.toString()}`
            })(a, 20, e.pageParam ? ? 0), n = await w.axios.get(i).then(({
                data: e
            }) => e);
            return Array.isArray(n) ? n.map(e => ({ ...e,
                rawHolderCount: e.holders ? .length ? ? 0,
                holders: (0, k.filterExcludedWallets)(e.holders)
            })) : (S.logger.error("getTopHoldersInfiniteFetcher error", {
                res: n
            }), [])
        };

    function T(e) {
        if (!e || 0 === e.length) return;
        let t = {};
        for (let r of e)
            for (let e of r) t[e.token] || (t[e.token] = []), t[e.token].push(...e.holders);
        return Object.entries(t).map(([e, t]) => ({
            token: e,
            holders: t
        }))
    }

    function M(e, t) {
        let r = 20 * t.length;
        if (!(r >= 50) && e.some(e => (e.rawHolderCount ? ? e.holders.length) === 20)) return r
    }
    e.s(["HOLDERS_DEFAULT", 0, C, "HOLDERS_MAX_PER_SIDE", 0, 50, "getHoldersNextPageParam", 0, M, "getTopHoldersInfiniteFetcher", 0, _, "mergeHolderPages", 0, T], 105418);
    var N = e.i(593332),
        I = e.i(100175),
        P = e.i(619264),
        E = e.i(870555);
    let A = e => {
        let a, i, n, s, o, l, c = (0, r.c)(15);
        if (c[0] !== e) {
            let {
                place: t,
                className: r,
                children: s,
                ...o
            } = e;
            i = r, a = s, n = o, c[0] = e, c[1] = a, c[2] = i, c[3] = n
        } else a = c[1], i = c[2], n = c[3];
        c[4] !== a ? (s = a ? .toString(), c[4] = a, c[5] = s) : s = c[5];
        let d = s,
            u = "1" === d && "bg-[#E1A510]",
            m = "2" === d && "bg-[#96AAB4]",
            p = "3" === d && "bg-[#BD7F6E]";
        return c[6] !== i || c[7] !== u || c[8] !== m || c[9] !== p ? (o = (0, E.cn)("absolute z-[5] pointer-events-none -top-[3px] -right-1.5 w-5 h-5 bg-black rounded-full flex justify-center items-center text-[10px] text-white font-semibold", u, m, p, i), c[6] = i, c[7] = u, c[8] = m, c[9] = p, c[10] = o) : o = c[10], c[11] !== a || c[12] !== n || c[13] !== o ? (l = (0, t.jsx)("div", {
            className: o,
            ...n,
            children: a
        }), c[11] = a, c[12] = n, c[13] = o, c[14] = l) : l = c[14], l
    };
    e.s(["Badge", 0, A], 400635);
    var O = e.i(177412),
        D = e.i(510954),
        L = e.i(57096),
        z = e.i(740594),
        R = e.i(794823);
    let F = new Map;

    function $({
        baseData: e,
        conditionId: t
    }) {
        let {
            registerTradeHandler: r,
            unregisterTradeHandler: a
        } = (0, R.useEventTrade)(), [i, n] = p.default.useState(() => F), [s, o] = p.default.useState(!1), l = p.default.useRef(null), c = p.default.useRef(e), [d] = p.default.useState(() => `top-holders-live-${Math.random().toString(36).slice(2,9)}`);
        return e !== c.current && (c.current = e, i.size > 0 && n(F)), p.default.useEffect(() => {
            n(F), o(!1)
        }, [t]), p.default.useEffect(() => {
            if (t) return r(d, e => {
                e.conditionId !== t || e.asset && e.proxyWallet && Number.isFinite(e.size) && (n(t => {
                    let r, a, i, n;
                    return i = (a = new Map((r = new Map(t)).get(e.asset) ? ? new Map)).get(e.proxyWallet), n = e.side === z.Side.BUY ? e.size : -e.size, a.set(e.proxyWallet, {
                        delta: (i ? .delta ? ? 0) + n,
                        user: {
                            name: e.name,
                            pseudonym: e.pseudonym,
                            proxyWallet: e.proxyWallet,
                            profileImage: e.profileImage,
                            profileImageOptimized: e.profileImageOptimized
                        },
                        outcomeIndex: e.outcomeIndex
                    }), r.set(e.asset, a), r
                }), o(!0), l.current && clearTimeout(l.current), l.current = setTimeout(() => o(!1), 8e3))
            }), () => {
                a(d), l.current && clearTimeout(l.current)
            }
        }, [t, d, r, a]), {
            data: p.default.useMemo(() => {
                if (e) return 0 === i.size ? e : e.map(e => {
                    let t = i.get(e.token);
                    if (!t || 0 === t.size) return e;
                    let r = new Map;
                    for (let t of e.holders) r.set(t.proxyWallet, { ...t
                    });
                    for (let [a, i] of t) {
                        if (k.EXCLUDED_WALLETS.has(a)) continue;
                        let t = r.get(a);
                        t ? t.amount = Math.max(0, t.amount + i.delta) : i.delta > 0 && r.set(a, {
                            name: i.user.name,
                            pseudonym: i.user.pseudonym,
                            bio: null,
                            proxyWallet: i.user.proxyWallet,
                            profileImage: i.user.profileImage ? ? null,
                            profileImageOptimized: i.user.profileImageOptimized ? ? null,
                            address: a,
                            amount: i.delta,
                            asset: e.token,
                            outcomeIndex: i.outcomeIndex
                        })
                    }
                    return { ...e,
                        holders: Array.from(r.values()).filter(e => e.amount > 0).sort((e, t) => t.amount - e.amount)
                    }
                })
            }, [e, i]),
            isLive: s
        }
    }
    e.s(["useTopHoldersLive", 0, $], 572902);
    let B = new Intl.NumberFormat(void 0, {
            minimumFractionDigits: 0,
            maximumFractionDigits: 0
        }),
        q = e => "number" == typeof e && Number.isFinite(e) ? B.format(e) : "0",
        V = e => e && "string" == typeof e.proxyWallet ? e.proxyWallet : `0x123${Math.ceil(100*Math.random())}`;

    function H(e) {
        return ({
            blue: "text-text-brand",
            green: "text-green-500",
            red: "text-red-500"
        })[e]
    }

    function U(e) {
        let a, i, n, s, o, l, c, d = (0, r.c)(21),
            {
                holder: p,
                color: h,
                place: x
            } = e,
            g = (0, v.useTranslations)();
        d[0] !== p ? (a = V(p), i = (0, y.createProfileUrl)({
            proxyWallet: a,
            name: p ? .name
        }), d[0] = p, d[1] = a, d[2] = i) : (a = d[1], i = d[2]);
        let k = i;
        d[3] !== p ? (n = p ? (0, t.jsx)(b.default, {
            address: p.proxyWallet,
            alt: p.proxyWallet,
            height: 32,
            profileImage: p.profileImage,
            quality: 100,
            width: 32
        }) : null, d[3] = p, d[4] = n) : n = d[4];
        let w = n;
        return d[5] !== a || d[6] !== w || d[7] !== h || d[8] !== p || d[9] !== x || d[10] !== k || d[11] !== g ? (s = (0, t.jsx)("div", {
            className: "flex items-center flex-1 min-w-0 whitespace-nowrap lg:overflow-hidden text-ellipsis",
            children: p ? (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)(f.Media, {
                    greaterThanOrEqual: "lg",
                    children: (0, t.jsx)(O.ProfileHoverCard, {
                        user: p,
                        address: a,
                        children: (0, t.jsx)("div", {
                            className: "min-w-[32px] flex items-center",
                            children: w
                        })
                    })
                }), (0, t.jsx)(f.Media, {
                    lessThan: "lg",
                    children: (0, t.jsx)(m.default, {
                        href: k,
                        className: "min-w-[32px]",
                        children: (0, t.jsxs)("div", {
                            className: "h-full flex items-center justify-between relative",
                            children: [(0, t.jsx)(A, {
                                children: x
                            }), (0, t.jsx)("div", {
                                className: "relative z-1",
                                children: w
                            })]
                        })
                    })
                }), (0, t.jsxs)("div", {
                    className: "ml-4 lg:flex lg:items-center lg:gap-1 lg:overflow-hidden max-lg:flex max-lg:flex-col max-lg:max-w-[70%]",
                    children: [(0, t.jsxs)("div", {
                        className: "flex items-center gap-1",
                        children: [(0, t.jsx)(f.Media, {
                            greaterThanOrEqual: "lg",
                            children: (0, t.jsx)(O.ProfileHoverCard, {
                                user: p,
                                address: a,
                                children: (0, t.jsx)("span", {
                                    className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap text-body-base font-medium hover:underline block",
                                    children: (0, P.formatUserName)(p, 40)
                                })
                            })
                        }), (0, t.jsx)(f.Media, {
                            lessThan: "lg",
                            children: (0, t.jsx)(m.default, {
                                href: k,
                                className: "flex-1 min-w-0",
                                children: (0, t.jsx)("span", {
                                    className: "text-text-primary text-sm font-medium leading-[21px] overflow-hidden text-ellipsis whitespace-nowrap block",
                                    children: (0, P.formatUserName)(p, 40)
                                })
                            })
                        }), p.verified && (0, t.jsx)("span", {
                            className: "shrink-0 flex items-center",
                            children: (0, t.jsx)(I.VerifiedBadge, {
                                size: "small"
                            })
                        })]
                    }), (0, t.jsx)(f.Media, {
                        lessThan: "lg",
                        children: (0, t.jsx)(u.AnimatedShares, {
                            value: `${q(p.amount)} ${g("topHolders.shares")}`,
                            className: `whitespace-nowrap text-body-sm font-semibold ${H(h)}`
                        })
                    })]
                })]
            }) : (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)("div", {
                    className: "w-8 h-8 rounded-full animate-pulse bg-neutral-100 lg:mr-4"
                }), (0, t.jsx)("div", {
                    className: "lg:w-[120px] lg:h-6 max-lg:w-[100px] max-lg:h-4 rounded animate-pulse bg-neutral-100 max-lg:ml-4"
                })]
            })
        }), d[5] = a, d[6] = w, d[7] = h, d[8] = p, d[9] = x, d[10] = k, d[11] = g, d[12] = s) : s = d[12], d[13] !== h || d[14] !== p ? (o = (0, t.jsx)(f.Media, {
            greaterThanOrEqual: "lg",
            children: p ? (0, t.jsx)(u.AnimatedShares, {
                value: q(p.amount),
                className: `whitespace-nowrap text-body-base font-semibold text-right ${H(h)}`
            }) : (0, t.jsx)("span", {
                className: `whitespace-nowrap text-body-base font-semibold text-right ${H(h)}`,
                children: (0, t.jsx)("span", {
                    className: "w-10 h-6 rounded animate-pulse bg-neutral-100 block"
                })
            })
        }), l = !p && (0, t.jsx)(f.Media, {
            lessThan: "lg",
            children: (0, t.jsx)("span", {
                className: `whitespace-nowrap text-body-sm font-semibold ${H(h)}`,
                children: (0, t.jsx)("span", {
                    className: "w-[30px] h-3 rounded animate-pulse bg-neutral-100 block"
                })
            })
        }), d[13] = h, d[14] = p, d[15] = o, d[16] = l) : (o = d[15], l = d[16]), d[17] !== s || d[18] !== o || d[19] !== l ? (c = (0, t.jsxs)("div", {
            className: "flex lg:items-center max-lg:items-start border-b border-border lg:h-[44px] lg:justify-between max-lg:py-2 max-lg:w-full",
            children: [s, o, l]
        }), d[17] = s, d[18] = o, d[19] = l, d[20] = c) : c = d[20], c
    }

    function W(e) {
        let a, i, n, s, o, l, m, p, h, f, x = (0, r.c)(32),
            {
                holders: g,
                outcome: y,
                color: b,
                hasNoHolders: k,
                numOptions: w,
                isLeftColumn: S,
                token: j
            } = e,
            _ = (0, v.useTranslations)(),
            T = `flex flex-col w-1/2 ${S?"pr-2 lg:pr-5":"pl-2 lg:pl-5"}`;
        x[0] !== _ ? (a = _("topHolders.holders"), x[0] = _, x[1] = a) : a = x[1];
        let M = `${y} ${a}`;
        return x[2] !== M ? (i = (0, t.jsx)("span", {
            className: "text-base font-semibold text-text-primary",
            children: M
        }), x[2] = M, x[3] = i) : i = x[3], x[4] !== _ ? (n = _("topHolders.shares"), x[4] = _, x[5] = n) : n = x[5], x[6] !== n ? (s = (0, t.jsx)("span", {
            className: "text-[10px] font-medium text-text-secondary tracking-wider uppercase hidden lg:block",
            children: n
        }), x[6] = n, x[7] = s) : s = x[7], x[8] !== i || x[9] !== s ? (o = (0, t.jsxs)("div", {
            className: "flex justify-between items-center h-[44px] border-b border-border",
            children: [i, s]
        }), x[8] = i, x[9] = s, x[10] = o) : o = x[10], x[11] !== k || x[12] !== _ ? (l = k ? (0, t.jsx)("span", {
            className: "mt-6 text-text-secondary font-medium text-sm",
            children: _("topHolders.noHolders")
        }) : null, x[11] = k, x[12] = _, x[13] = l) : l = x[13], x[14] !== b || x[15] !== k || x[16] !== g || x[17] !== j ? (m = !k && Array.isArray(g) && g.length > 0 ? (0, t.jsx)(c.LayoutGroup, {
            id: `holders-${j}`,
            children: g.map((e, r) => (0, t.jsx)(d.motion.div, {
                layout: !0,
                transition: {
                    layout: u.holderRowLayoutTransition
                },
                children: (0, t.jsx)(U, {
                    place: r + 1,
                    holder: e,
                    color: b,
                    isSkeleton: !1
                })
            }, e.address))
        }) : null, x[14] = b, x[15] = k, x[16] = g, x[17] = j, x[18] = m) : m = x[18], x[19] !== b || x[20] !== k || x[21] !== g || x[22] !== w ? (p = k || void 0 !== g ? null : Array.from({
            length: w ? ? C
        }).map((e, r) => (0, t.jsx)(U, {
            isSkeleton: !0,
            color: b,
            holder: void 0,
            place: void 0
        }, `skeleton-${r}`)), x[19] = b, x[20] = k, x[21] = g, x[22] = w, x[23] = p) : p = x[23], x[24] !== p || x[25] !== l || x[26] !== m ? (h = (0, t.jsxs)("div", {
            className: "flex flex-col",
            children: [l, m, p]
        }), x[24] = p, x[25] = l, x[26] = m, x[27] = h) : h = x[27], x[28] !== T || x[29] !== h || x[30] !== o ? (f = (0, t.jsxs)("div", {
            className: T,
            children: [o, h]
        }), x[28] = T, x[29] = h, x[30] = o, x[31] = f) : f = x[31], f
    }
    e.s(["default", 0, function(e) {
        let c, u, m, f, y, b, k, w, S, j, C, I, P, E, A, O, z, R, F, B, q, V, H, U, G, Z, K = (0, r.c)(87),
            {
                sortedMarkets: Y
            } = e;
        K[0] === Symbol.for("react.memo_cache_sentinel") ? (c = ["activeMarket"], K[0] = c) : c = K[0];
        let {
            activeMarket: Q
        } = (0, x.useEventActiveMarketContext)(c);
        K[1] === Symbol.for("react.memo_cache_sentinel") ? (u = ["isSportsPage", "sportSlug"], K[1] = u) : u = K[1];
        let {
            isSportsPage: X,
            sportSlug: J
        } = (0, g.useSportsContext)(u), ee = (0, v.useTranslations)(), [et, er] = (0, p.useState)(Q), [ea, ei] = (0, p.useState)(!1), [en, es] = (0, p.useState)(10);
        K[2] !== Q ? (m = () => {
            er(Q), es(10)
        }, f = [Q], K[2] = Q, K[3] = m, K[4] = f) : (m = K[3], f = K[4]), (0, p.useEffect)(m, f), K[5] !== et ? .conditionId ? (y = D.queryKeys[L.QueryKey.Holders].infinite(et ? .conditionId), K[5] = et ? .conditionId, K[6] = y) : y = K[6];
        let eo = "string" == typeof et ? .conditionId;
        K[7] !== y.queryKey || K[8] !== eo ? (b = {
            queryKey: y.queryKey,
            queryFn: _,
            enabled: eo,
            placeholderData: s.keepPreviousData,
            gcTime: 6e5,
            staleTime: 6e4,
            refetchOnMount: !1,
            initialPageParam: 0,
            getNextPageParam: M
        }, K[7] = y.queryKey, K[8] = eo, K[9] = b) : b = K[9];
        let {
            data: el,
            fetchNextPage: ec,
            hasNextPage: ed,
            isFetchingNextPage: eu
        } = (0, o.useInfiniteQuery)(b);
        el ? .pages;
        let em = el ? .pages;
        K[10] !== em ? (k = T(em), K[10] = em, K[11] = k) : k = K[11];
        let ep = k;
        e: {
            let e, t, r;
            if (!Array.isArray(ep)) {
                w = void 0;
                break e
            }
            let a = et ? .clobTokenIds ? .[0] ? ? !1,
                i = et ? .clobTokenIds ? .[1] ? ? !1;
            if (!a || !i) {
                w = void 0;
                break e
            }
            if (ep[0] ? .token === a && ep[1] ? .token === i) {
                w = ep;
                break e
            }
            if (K[12] !== ep || K[13] !== a) {
                let t;
                K[15] !== a ? (t = e => e.token === a, K[15] = a, K[16] = t) : t = K[16], e = ep.find(t), K[12] = ep, K[13] = a, K[14] = e
            } else e = K[14];
            let n = e;
            if (K[17] !== ep || K[18] !== i) {
                let e;
                K[20] !== i ? (e = e => e.token === i, K[20] = i, K[21] = e) : e = K[21], t = ep.find(e), K[17] = ep, K[18] = i, K[19] = t
            } else t = K[19];
            let s = t;
            if (n && s) {
                let e;
                K[22] !== s || K[23] !== n ? (e = [n, s], K[22] = s, K[23] = n, K[24] = e) : e = K[24], w = e;
                break e
            }
            K[25] === Symbol.for("react.memo_cache_sentinel") ? (r = [], K[25] = r) : r = K[25],
            w = r
        }
        let eh = w,
            ef = et ? .conditionId;
        K[26] !== eh || K[27] !== ef ? (S = {
            baseData: eh,
            conditionId: ef
        }, K[26] = eh, K[27] = ef, K[28] = S) : S = K[28];
        let {
            data: ex,
            isLive: eg
        } = $(S);
        t: {
            if (!ex) {
                j = 0;
                break t
            }
            j = Math.max(ex[0] ? .holders ? .length ? ? 0, ex[1] ? .holders ? .length ? ? 0)
        }
        let ev = j,
            ey = en < ev || ed;
        K[29] === Symbol.for("react.memo_cache_sentinel") ? (C = {
            threshold: 0
        }, K[29] = C) : C = K[29];
        let {
            ref: eb,
            inView: ek
        } = (0, h.useInView)(C);
        K[30] !== ec || K[31] !== ed || K[32] !== ek || K[33] !== eu || K[34] !== ev || K[35] !== en ? (I = () => {
            ek && !eu && (en < ev ? es(Math.min(en + 10, 50)) : ed && en < 50 && ec())
        }, P = [ek, eu, en, ev, ed, ec], K[30] = ec, K[31] = ed, K[32] = ek, K[33] = eu, K[34] = ev, K[35] = en, K[36] = I, K[37] = P) : (I = K[36], P = K[37]), (0, p.useEffect)(I, P), K[38] !== et ? .groupItemTitle || K[39] !== Y.length ? (E = () => Y.length > 1 && "string" == typeof et ? .groupItemTitle, K[38] = et ? .groupItemTitle, K[39] = Y.length, K[40] = E) : E = K[40], et ? .groupItemTitle;
        let ew = E(),
            eS = Array.isArray(ep) && 0 === ep.length,
            ej = X && J !== N.SportSlug.EPL && J !== N.SportSlug.UEL && J !== N.SportSlug.UCL;
        K[41] !== et ? .groupItemTitle || K[42] !== ea || K[43] !== ew || K[44] !== Y ? (A = ew ? (0, t.jsxs)(i.DropdownMenu, {
            open: ea,
            onOpenChange: ei,
            children: [(0, t.jsx)(i.DropdownMenuTrigger, {
                asChild: !0,
                children: (0, t.jsxs)(a.Button, {
                    variant: "outline",
                    size: "lg",
                    className: "group rounded-md flex items-center justify-between px-4 w-full md:w-[250px] focus-visible:ring-0",
                    "aria-label": "sort-markets-by",
                    children: [(0, t.jsx)("span", {
                        className: "font-medium truncate",
                        children: et ? .groupItemTitle
                    }), (0, t.jsx)(n.IconChevronDownOutline12, {
                        className: `ml-2 shrink-0 transition-transform duration-200 ${ea?"rotate-180":""}`
                    })]
                })
            }), (0, t.jsx)(i.DropdownMenuContent, {
                className: "w-full md:w-[250px] max-h-[400px] overflow-y-auto",
                align: "start",
                children: Y.map(e => (0, t.jsx)(i.DropdownMenuItem, {
                    className: "cursor-pointer",
                    onClick: () => {
                        er(e), es(10)
                    },
                    children: (0, t.jsx)("span", {
                        className: "truncate",
                        children: e.groupItemTitle
                    })
                }, e.conditionId))
            })]
        }) : null, K[41] = et ? .groupItemTitle, K[42] = ea, K[43] = ew, K[44] = Y, K[45] = A) : A = K[45], K[46] !== A ? (O = (0, t.jsx)("div", {
            className: "flex items-center gap-2",
            children: A
        }), K[46] = A, K[47] = O) : O = K[47], K[48] !== et ? .closed || K[49] !== eg || K[50] !== ee ? (z = eg && !et ? .closed && (0, t.jsxs)(d.motion.div, {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1
            },
            exit: {
                opacity: 0
            },
            transition: {
                duration: .3
            },
            className: "flex items-center gap-2.5",
            children: [(0, t.jsxs)("span", {
                className: "relative flex h-2.5 w-2.5 items-center justify-center",
                children: [(0, t.jsx)("span", {
                    className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-red-500 opacity-85 [animation-duration:1.2s]"
                }), (0, t.jsx)("span", {
                    className: "relative inline-flex h-2 w-2 rounded-full bg-red-500"
                })]
            }), (0, t.jsx)("span", {
                className: "text-sm font-semibold text-red-500",
                children: ee("topHolders.live")
            })]
        }), K[48] = et ? .closed, K[49] = eg, K[50] = ee, K[51] = z) : z = K[51], K[52] !== z ? (R = (0, t.jsx)(l.AnimatePresence, {
            children: z
        }), K[52] = z, K[53] = R) : R = K[53], K[54] !== O || K[55] !== R ? (F = (0, t.jsxs)("div", {
            className: "mb-2 flex items-center justify-between",
            children: [O, R]
        }), K[54] = O, K[55] = R, K[56] = F) : F = K[56], K[57] !== ex ? .[0] ? .holders || K[58] !== en ? (B = ex ? .[0] ? .holders ? .slice(0, en), K[57] = ex ? .[0] ? .holders, K[58] = en, K[59] = B) : B = K[59];
        let eC = ex ? .[0] ? .token,
            e_ = et ? .outcomes ? .[0],
            eT = ej ? "blue" : "green";
        K[60] !== eS || K[61] !== B || K[62] !== eC || K[63] !== e_ || K[64] !== eT ? (q = (0, t.jsx)(W, {
            isLeftColumn: !0,
            holders: B,
            token: eC,
            outcome: e_,
            color: eT,
            hasNoHolders: eS,
            numOptions: 10
        }), K[60] = eS, K[61] = B, K[62] = eC, K[63] = e_, K[64] = eT, K[65] = q) : q = K[65], K[66] !== ex ? .[1] ? .holders || K[67] !== en ? (V = ex ? .[1] ? .holders ? .slice(0, en), K[66] = ex ? .[1] ? .holders, K[67] = en, K[68] = V) : V = K[68];
        let eM = ex ? .[1] ? .token,
            eN = et ? .outcomes ? .[1],
            eI = ej ? "blue" : "red";
        return K[69] !== eS || K[70] !== V || K[71] !== eM || K[72] !== eN || K[73] !== eI ? (H = (0, t.jsx)(W, {
            isLeftColumn: !1,
            holders: V,
            token: eM,
            outcome: eN,
            color: eI,
            hasNoHolders: eS,
            numOptions: 10
        }), K[69] = eS, K[70] = V, K[71] = eM, K[72] = eN, K[73] = eI, K[74] = H) : H = K[74], K[75] !== q || K[76] !== H ? (U = (0, t.jsxs)("div", {
            className: "flex",
            children: [q, H]
        }), K[75] = q, K[76] = H, K[77] = U) : U = K[77], K[78] !== ey || K[79] !== eS || K[80] !== eu || K[81] !== eb ? (G = ey && !eS ? (0, t.jsx)("div", {
            ref: eb,
            className: "flex justify-center py-4",
            children: eu ? (0, t.jsx)("div", {
                className: "w-6 h-6 border-2 border-border border-t-text-primary rounded-full animate-spin"
            }) : null
        }) : null, K[78] = ey, K[79] = eS, K[80] = eu, K[81] = eb, K[82] = G) : G = K[82], K[83] !== F || K[84] !== U || K[85] !== G ? (Z = (0, t.jsxs)("div", {
            className: "flex w-full flex-col",
            children: [F, U, G]
        }), K[83] = F, K[84] = U, K[85] = G, K[86] = Z) : Z = K[86], Z
    }, "formatShares", 0, q, "getAddress", 0, V], 619305)
}, 56827, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(701447),
        i = e.i(413455),
        n = e.i(416340),
        s = e.i(870555);
    let o = {
        defaultProtocol: "https"
    };

    function l(e) {
        return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
    }
    e.s(["default", 0, e => {
        let c, d, u, m, p, h, f, x = (0, r.c)(26),
            {
                seeLessText: g,
                seeMoreText: v,
                text: y,
                maxLines: b,
                children: k
            } = e,
            w = void 0 === g ? "See less" : g,
            S = void 0 === v ? "See more" : v,
            j = void 0 === b ? 1 : b,
            [C, _] = (0, n.useState)(!1),
            T = (0, n.useRef)(null),
            [M, N] = (0, n.useState)(null),
            [I, P] = (0, n.useState)(!1);
        x[0] !== j || x[1] !== S || x[2] !== y ? (c = () => {
            let e = T.current;
            if (!e) return;
            N(null);
            let t = () => {
                    let t = e.getBoundingClientRect().width;
                    if (0 === t) return;
                    let r = getComputedStyle(e),
                        a = parseFloat(r.lineHeight) * j + .5,
                        i = document.createElement("div");
                    i.style.cssText = `
        position: absolute;
        visibility: hidden;
        width: ${t}px;
        font-family: ${r.fontFamily};
        font-size: ${r.fontSize};
        font-weight: ${r.fontWeight};
        line-height: ${r.lineHeight};
        letter-spacing: ${r.letterSpacing};
        word-break: break-word;
        white-space: pre-line;
      `, e.appendChild(i);
                    let n = `... <span style="font-weight:500">${l(S)}</span>`,
                        s = y.replace(/^\n+/, "");
                    if (i.innerHTML = l(s) + n, i.scrollHeight <= a) {
                        P(!1), N(s), e.removeChild(i);
                        return
                    }
                    P(!0);
                    let o = 0,
                        c = s.length,
                        d = "";
                    for (; o <= c;) {
                        let e = Math.floor((o + c) / 2);
                        i.innerHTML = l(s.slice(0, e)) + n, i.scrollHeight <= a ? (d = s.slice(0, e), o = e + 1) : c = e - 1
                    }
                    N(d.trimEnd()), e.removeChild(i)
                },
                r = !1;
            document.fonts ? .ready ? document.fonts.ready.then(() => {
                r || t()
            }) : t();
            let a = new ResizeObserver(() => {
                r || t()
            });
            return a.observe(e), () => {
                r = !0, a.disconnect()
            }
        }, d = [y, S, j], x[0] = j, x[1] = S, x[2] = y, x[3] = c, x[4] = d) : (c = x[3], d = x[4]), (0, n.useLayoutEffect)(c, d);
        let E = null === M,
            A = C ? "block" : "sr-only";
        return x[5] !== A ? (u = (0, s.cn)(A), x[5] = A, x[6] = u) : u = x[6], x[7] !== k || x[8] !== u ? (m = (0, t.jsx)("span", {
            className: u,
            children: k
        }), x[7] = k, x[8] = u, x[9] = m) : m = x[9], x[10] !== E || x[11] !== C || x[12] !== j || x[13] !== I || x[14] !== S || x[15] !== y || x[16] !== M ? (p = !C && (0, t.jsx)("span", {
            className: "whitespace-pre-line",
            children: E ? (0, t.jsx)("span", {
                style: {
                    display: "-webkit-box",
                    WebkitLineClamp: j,
                    WebkitBoxOrient: "vertical",
                    overflow: "hidden"
                },
                children: y
            }) : (0, t.jsxs)(t.Fragment, {
                children: [((e, r) => {
                    let i = (0, a.find)(e, o);
                    if (0 === i.length) return e.slice(0, r);
                    let n = [],
                        s = 0;
                    for (let a of i) {
                        if (a.start >= r) break;
                        a.start > s && n.push(e.slice(s, a.start));
                        let i = Math.min(a.end, r);
                        n.push((0, t.jsx)("a", {
                            href: a.href,
                            target: "_blank",
                            className: "hover:underline",
                            children: e.slice(a.start, i)
                        }, a.start)), s = i
                    }
                    return s < r && n.push(e.slice(s, r)), (0, t.jsx)(t.Fragment, {
                        children: n
                    })
                })(y.replace(/^\n+/, ""), M.length), I && (0, t.jsxs)(t.Fragment, {
                    children: ["... ", (0, t.jsx)("button", {
                        type: "button",
                        className: "font-medium text-text-secondary cursor-pointer hover:text-text-tertiary",
                        onClick: () => _(!0),
                        children: S
                    })]
                })]
            })
        }), x[10] = E, x[11] = C, x[12] = j, x[13] = I, x[14] = S, x[15] = y, x[16] = M, x[17] = p) : p = x[17], x[18] !== C || x[19] !== I || x[20] !== w ? (h = I && C && (0, t.jsx)("div", {
            className: "mt-2",
            children: (0, t.jsxs)("button", {
                type: "button",
                className: "inline-flex items-center gap-1 font-medium text-text-secondary cursor-pointer hover:text-text-tertiary",
                onClick: () => _(!1),
                children: [w, (0, t.jsx)(i.IconChevronUpOutline12, {})]
            })
        }), x[18] = C, x[19] = I, x[20] = w, x[21] = h) : h = x[21], x[22] !== h || x[23] !== m || x[24] !== p ? (f = (0, t.jsxs)("div", {
            ref: T,
            className: "relative w-full text-body-base wrap-break-word max-lg:w-[calc(100vw-2rem)] max-lg:max-w-[calc(100vw-2rem)] [&_a]:text-text-brand",
            children: [m, p, h]
        }), x[22] = h, x[23] = m, x[24] = p, x[25] = f) : f = x[25], f
    }])
}, 410342, 911984, 761854, 67735, e => {
    "use strict";
    var t = e.i(148031);
    e.s(["EventResolutionSection", () => t.default], 410342);
    var r = e.i(999061),
        a = e.i(122538),
        i = e.i(964974),
        n = e.i(177217),
        s = e.i(991092),
        o = e.i(416340),
        l = e.i(510954),
        c = e.i(57096),
        d = e.i(446789),
        u = e.i(864006),
        m = e.i(631222);
    let p = async e => (await n.default.get(`${m.GAMMA_API_URL}/market-clarifications?market_id=${e}`)).data;

    function h(e, t) {
        return (0, s.isValid)(new Date(t ? .queuedAt ? ? "")) ? e.push({
            content: t.content,
            date: t.queuedAt,
            id: t.id
        }) : (0, s.isValid)(new Date(t ? .scheduledFor ? ? "")) ? e.push({
            content: t.content,
            date: t.scheduledFor,
            id: t.id
        }) : (0, s.isValid)(new Date(t ? .createdAt ? ? "")) && e.push({
            content: t.content,
            date: t.createdAt,
            id: t.id
        }), e
    }

    function f(e, t) {
        return new Date(t.date).getTime() - new Date(e.date).getTime()
    }
    e.s(["useMarketClarifications", 0, e => {
        let t, n, s, o, m, x, g = (0, r.c)(20),
            v = (0, u.useLocale)();
        g[0] !== e.id ? (t = l.queryKeys[c.QueryKey.MarketClarifications].clarifications(e.id), g[0] = e.id, g[1] = t) : t = g[1], g[2] !== e.id ? (n = () => p(e.id), g[2] = e.id, g[3] = n) : n = g[3];
        let y = !!e.id;
        g[4] === Symbol.for("react.memo_cache_sentinel") ? (s = {
            persist: !0,
            errorContext: {
                tag: "[EventAboutSection > marketClarifications]"
            }
        }, g[4] = s) : s = g[4], g[5] !== t.queryKey || g[6] !== n || g[7] !== y ? (o = {
            queryKey: t.queryKey,
            queryFn: n,
            enabled: y,
            refetchOnMount: !0,
            refetchOnReconnect: !1,
            refetchOnWindowFocus: !0,
            placeholderData: a.keepPreviousData,
            staleTime: 6e4,
            gcTime: 6e4,
            meta: s
        }, g[5] = t.queryKey, g[6] = n, g[7] = y, g[8] = o) : o = g[8];
        let {
            data: b
        } = (0, i.useQuery)(o);
        e: {
            let e, t, r;
            if (!b || !Array.isArray(b) || 0 === b.length) {
                let e;
                g[9] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    sortedClarifications: [],
                    lastUpdatedAt: null
                }, g[9] = e) : e = g[9], m = e;
                break e
            }
            g[10] !== v || g[11] !== b ? (t = (e = b.reduce(h, []).sort(f)).length > 0 ? new Date(e[0].date).toLocaleDateString((0, d.getIntlLocale)(v), {
                month: "short",
                day: "numeric"
            }) : null, g[10] = v, g[11] = b, g[12] = e, g[13] = t) : (e = g[12], t = g[13]);
            let a = t;g[14] !== a || g[15] !== e ? (r = {
                sortedClarifications: e,
                lastUpdatedAt: a
            }, g[14] = a, g[15] = e, g[16] = r) : r = g[16],
            m = r
        }
        let {
            sortedClarifications: k,
            lastUpdatedAt: w
        } = m;
        return g[17] !== w || g[18] !== k ? (x = {
            sortedClarifications: k,
            lastUpdatedAt: w
        }, g[17] = w, g[18] = k, g[19] = x) : x = g[19], x
    }], 911984);
    var x = e.i(221628),
        g = e.i(253264),
        v = e.i(604777);

    function y(e) {
        return (0, x.jsx)("div", {
            className: "w-full px-4 py-3 inline-flex border-b last:border-b-0",
            children: (0, x.jsx)("p", {
                className: "font-normal text-[13px] text-text-secondary whitespace-pre-wrap break-words",
                children: e.content
            })
        }, `update-${e.id}`)
    }
    e.s(["default", 0, e => {
        let t, a, i, n, s, o, l, c, d, u = (0, r.c)(20),
            {
                marketClarifications: m,
                lastUpdatedAt: p
            } = e,
            h = (0, v.useTranslations)();
        return Array.isArray(m) && 0 !== m.length && p ? (u[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, x.jsx)(g.IconCircleInfoFill18, {
            size: 16,
            className: "text-text-brand"
        }), u[0] = t) : t = u[0], u[1] !== h ? (a = h("events.marketUpdates.additionalContext"), u[1] = h, u[2] = a) : a = u[2], u[3] !== a ? (i = (0, x.jsxs)("div", {
            className: "flex items-center gap-1.5",
            children: [t, (0, x.jsx)("p", {
                className: "font-medium text-sm",
                children: a
            })]
        }), u[3] = a, u[4] = i) : i = u[4], u[5] !== p || u[6] !== h ? (n = p && h("events.marketUpdates.updated", {
            date: p
        }), u[5] = p, u[6] = h, u[7] = n) : n = u[7], u[8] !== n ? (s = (0, x.jsx)("p", {
            className: "text-xs text-text-secondary",
            children: n
        }), u[8] = n, u[9] = s) : s = u[9], u[10] !== i || u[11] !== s ? (o = (0, x.jsxs)("div", {
            className: "w-full p-4 flex justify-between items-center border-b",
            children: [i, s]
        }), u[10] = i, u[11] = s, u[12] = o) : o = u[12], u[13] !== m ? (l = m.map(y), u[13] = m, u[14] = l) : l = u[14], u[15] !== l ? (c = (0, x.jsx)("div", {
            className: "flex flex-col",
            children: l
        }), u[15] = l, u[16] = c) : c = u[16], u[17] !== o || u[18] !== c ? (d = (0, x.jsxs)("div", {
            className: "flex flex-col mb-4 border rounded-xl overflow-hidden bg-surface-1",
            children: [o, c]
        }), u[17] = o, u[18] = c, u[19] = d) : d = u[19], d) : null
    }], 761854);
    var b = e.i(839593);
    let k = ({ ...e
    }) => o.default.createElement(b.Icon, {
        size: "24px",
        ...e
    }, o.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M17 8.58578L23.4142 15L22 16.4142L15.5858 10L17 8.58578Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), o.default.createElement("path", {
        d: "M7.80763 9.29292L13.4645 14.9498L21.9497 6.46449L16.2929 0.807648L7.80763 9.29292Z",
        fill: "currentColor"
    }), o.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M1 13H5V15H1V13Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), o.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M3.5 7.08578L6.41421 10L5 11.4142L2.08578 8.5L3.5 7.08578Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), o.default.createElement("path", {
        d: "M17 22H10H3V17H17V22Z",
        fill: "currentColor"
    }), o.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M1 21H19V23H1V21Z",
        fill: "currentColor"
    }));
    var w = e.i(69121),
        S = e.i(197994);
    let j = ({ ...e
    }) => o.default.createElement(S.Icon, {
        size: "18px",
        ...e
    }, o.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M9.03166 6.54197C9.22575 6.9079 9.08644 7.36188 8.72052 7.55597C8.47184 7.68787 8.24717 7.85851 8.04832 8.05733C6.96021 9.14544 6.96021 10.9086 8.04832 11.9967L10.2233 14.1717C11.3114 15.2598 13.0746 15.2598 14.1627 14.1717C15.2507 13.0836 15.2608 11.3104 14.1727 10.2223L13.4103 9.45993C13.1174 9.16703 13.1174 8.69216 13.4103 8.39927C13.7032 8.10638 14.178 8.10638 14.4709 8.39927L15.2333 9.16167C16.9072 10.8356 16.9072 13.5484 15.2333 15.2223C13.5594 16.8962 10.8365 16.9062 9.16266 15.2323L6.98766 13.0573C5.31377 11.3834 5.31377 8.67056 6.98766 6.99667C7.29576 6.68747 7.64975 6.42597 8.01766 6.23083C8.38359 6.03674 8.83757 6.17604 9.03166 6.54197Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), o.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M2.77868 2.76766C4.45257 1.09376 7.16544 1.09376 8.83934 2.76766L11.0143 4.94266C12.6882 6.61655 12.6882 9.32942 11.0143 11.0033C10.7101 11.3075 10.3647 11.5674 9.98433 11.7692C9.6184 11.9633 9.16442 11.824 8.97033 11.458C8.77624 11.0921 8.91554 10.6381 9.28147 10.444C9.53006 10.3122 9.7549 10.1414 9.95368 9.94267C11.0418 8.85455 11.0418 7.09142 9.95368 6.00332L7.77868 3.82832C6.69057 2.74021 4.92744 2.74021 3.83934 3.82832C2.76193 4.90573 2.74775 6.69607 3.82934 7.77766L4.59174 8.54006C4.88463 8.83295 4.88463 9.30782 4.59174 9.60072C4.29884 9.89361 3.82397 9.89361 3.53108 9.60072L2.76868 8.83832C1.10903 7.17867 1.1232 4.42314 2.77868 2.76766Z",
        fill: "currentColor"
    }));
    var C = e.i(621920),
        _ = e.i(870555),
        T = e.i(399336),
        M = e.i(891685);
    let N = e => {
            let t, a, i, n = (0, r.c)(7);
            n[0] !== e ? ({ ...t
            } = e, n[0] = e, n[1] = t) : t = n[1];
            let s = t.color || "currentColor";
            return n[2] !== s ? (a = (0, x.jsx)("path", {
                d: "M22 0L18 2.3L7.09998 8.6L3.09998 10.9V32.7L7.09998 35L18.1 41.3L22.1 43.6L26.1 41.3L36.9 35L40.9 32.7V10.9L36.9 8.6L26 2.3L22 0ZM11.1 28.1V15.5L22 9.2L32.9 15.5V28.1L22 34.4L11.1 28.1Z",
                fill: s
            }), n[2] = s, n[3] = a) : a = n[3], n[4] !== t || n[5] !== a ? (i = (0, x.jsx)("svg", {
                viewBox: "0 0 44 44",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                ...t,
                children: a
            }), n[4] = t, n[5] = a, n[6] = i) : i = n[6], i
        },
        I = e => {
            let t, a, i, n, s, o = (0, r.c)(7);
            return o[0] !== e ? ({ ...t
            } = e, o[0] = e, o[1] = t) : t = o[1], o[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, x.jsx)("circle", {
                cx: "256",
                cy: "256",
                r: "256",
                fill: "#E6DAFE"
            }), i = (0, x.jsx)("path", {
                d: "M303.4,228.5c0,20.7-16.7,37.5-37.4,37.5v37.5c41.3,0,74.7-33.5,74.7-74.9s-33.5-74.9-74.7-74.9c-13.6,0-26.4,3.6-37.4,10c-22.3,12.9-37.4,37.2-37.4,64.9v187.3l33.6,33.7l3.8,3.8V228.5c0-20.7,16.7-37.5,37.4-37.5S303.4,207.9,303.4,228.5z",
                fill: "#000000"
            }), n = (0, x.jsx)("path", {
                d: "M266,78.7c-27.2,0-52.7,7.3-74.7,20.1c-14.1,8.1-26.7,18.5-37.4,30.7c-23.2,26.4-37.4,61.1-37.4,99.1v112.4l37.4,37.5V228.5c0-33.3,14.4-63.2,37.4-83.8c10.8-9.7,23.4-17.3,37.4-22.2c11.7-4.2,24.3-6.4,37.4-6.4c61.9,0,112.1,50.3,112.1,112.4S327.9,340.9,266,340.9v37.5c82.5,0,149.4-67.1,149.4-149.8S348.5,78.7,266,78.7z",
                fill: "#000000"
            }), o[2] = a, o[3] = i, o[4] = n) : (a = o[2], i = o[3], n = o[4]), o[5] !== t ? (s = (0, x.jsxs)("svg", {
                viewBox: "0 0 512 512",
                xmlns: "http://www.w3.org/2000/svg",
                ...t,
                children: [a, i, n]
            }), o[5] = t, o[6] = s) : s = o[6], s
        },
        P = e => {
            let t, a, i, n, s, o, l = (0, r.c)(16);
            l[0] !== e ? ({ ...t
            } = e, l[0] = e, l[1] = t) : t = l[1];
            let c = t.color ? ? "#ff4a4a";
            l[2] !== c ? (a = (0, x.jsx)("path", {
                fill: c,
                d: "M40.635,34.02H34.841a1.968,1.968,0,0,1-1.971-1.965V16.786L22.7,23.145a2.634,2.634,0,0,1-2.792,0L9.736,16.785v15.27A1.968,1.968,0,0,1,7.765,34.02H1.971A1.968,1.968,0,0,1,0,32.055V2.625A2.628,2.628,0,0,1,4.112.464L20.19,11.445a1.974,1.974,0,0,0,2.228,0L38.493.464a2.627,2.627,0,0,1,4.113,2.16V32.055a1.968,1.968,0,0,1-1.971,1.965",
                transform: "translate(47.24 0.296)"
            }), l[2] = c, l[3] = a) : a = l[3];
            let d = t.color ? ? "#ff4a4a";
            l[4] !== d ? (i = (0, x.jsx)("path", {
                fill: d,
                d: "M38.511,34.054H2.615A2.612,2.612,0,0,1,0,31.444V1.957A1.959,1.959,0,0,1,1.961,0H7.728A1.959,1.959,0,0,1,9.689,1.957v22.43H31.437V1.957A1.958,1.958,0,0,1,33.4,0h5.767a1.959,1.959,0,0,1,1.961,1.957V31.445a2.612,2.612,0,0,1-2.615,2.609",
                transform: "translate(0 0)"
            }), l[4] = d, l[5] = i) : i = l[5];
            let u = t.color ? ? "#ff4a4a";
            l[6] !== u ? (n = (0, x.jsx)("path", {
                fill: u,
                d: "M2.615,0h35.9a2.612,2.612,0,0,1,2.615,2.609V32.1a1.959,1.959,0,0,1-1.961,1.957H33.4A1.959,1.959,0,0,1,31.437,32.1V10.971a1.306,1.306,0,0,0-1.308-1.3H11a1.306,1.306,0,0,0-1.308,1.3V32.1a1.959,1.959,0,0,1-1.961,1.957H1.961A1.959,1.959,0,0,1,0,32.1V2.609A2.612,2.612,0,0,1,2.615,0",
                transform: "translate(95.874 0)"
            }), l[6] = u, l[7] = n) : n = l[7];
            let m = t.color ? ? "#ff4a4a";
            return l[8] !== m ? (s = (0, x.jsx)("path", {
                fill: m,
                d: "M0,1.943V7.749A1.953,1.953,0,0,0,1.963,9.692H7.729A1.953,1.953,0,0,0,9.692,7.749V1.943A1.953,1.953,0,0,0,7.729,0H1.963A1.953,1.953,0,0,0,0,1.943",
                transform: "translate(111.591 15.979)"
            }), l[8] = m, l[9] = s) : s = l[9], l[10] !== t || l[11] !== a || l[12] !== i || l[13] !== n || l[14] !== s ? (o = (0, x.jsxs)("svg", {
                xmlns: "http://www.w3.org/2000/svg",
                id: "logo",
                viewBox: "0 0 137 34.316",
                ...t,
                children: [a, i, n, s]
            }), l[10] = t, l[11] = a, l[12] = i, l[13] = n, l[14] = s, l[15] = o) : o = l[15], o
        },
        E = (e, t) => `${m.MATIC_CONFIG.explorerUrl}/${t}/${e}`,
        A = e => (0, C.parseUsername)(e),
        O = () => {
            let e, t = (0, r.c)(1);
            return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, x.jsx)("div", {
                className: "flex shrink-0 justify-center items-center bg-neutral-200 rounded-full w-9 h-9",
                children: (0, x.jsx)(j, {
                    className: "w-5 h-5"
                })
            }), t[0] = e) : e = t[0], e
        },
        D = () => {
            let e, t = (0, r.c)(1);
            return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, x.jsx)("div", {
                className: "flex shrink-0 justify-center items-center bg-brand-50 dark:bg-brand-100 rounded-full w-9 h-9",
                children: (0, x.jsx)(N, {
                    className: "w-5 h-5 text-text-brand"
                })
            }), t[0] = e) : e = t[0], e
        },
        L = () => {
            let e, t = (0, r.c)(1);
            return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, x.jsx)("div", {
                className: "flex shrink-0 justify-center items-center w-9 h-9",
                children: (0, x.jsx)(I, {
                    className: "w-9 h-9"
                })
            }), t[0] = e) : e = t[0], e
        },
        z = () => {
            let e, t = (0, r.c)(1);
            return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, x.jsx)("div", {
                className: "flex shrink-0 justify-center items-center bg-neutral-200 rounded-full w-9 h-9",
                children: (0, x.jsx)(k, {
                    className: "w-5 h-5"
                })
            }), t[0] = e) : e = t[0], e
        },
        R = e => {
            let t, a, i, n, s, o, l, c, d, u, m, p = (0, r.c)(22);
            return p[0] !== e ? ({
                title: n,
                value: s,
                valueLink: o,
                children: t,
                className: a,
                ...i
            } = e, p[0] = e, p[1] = t, p[2] = a, p[3] = i, p[4] = n, p[5] = s, p[6] = o) : (t = p[1], a = p[2], i = p[3], n = p[4], s = p[5], o = p[6]), p[7] !== a ? (l = (0, _.cn)("flex gap-4 rounded-xl border pr-6 py-3 items-center justify-start max-w-full overflow-hidden bg-surface-1 flex-1 basis-0 min-w-0 min-h-16", a), p[7] = a, p[8] = l) : l = p[8], p[9] !== n ? (c = (0, x.jsx)("p", {
                className: "truncate text-text-secondary text-body-base",
                children: n
            }), p[9] = n, p[10] = c) : c = p[10], p[11] !== s || p[12] !== o ? (d = o ? (0, x.jsx)("a", {
                className: "block w-full truncate text-text-brand hover:text-text-brand-hover text-body-base",
                href: o,
                target: "_blank",
                rel: "noopener noreferrer",
                children: s
            }) : (0, x.jsx)("a", {
                className: "block w-full truncate text-text text-body-base",
                children: s
            }), p[11] = s, p[12] = o, p[13] = d) : d = p[13], p[14] !== c || p[15] !== d ? (u = (0, x.jsxs)("div", {
                className: "flex-grow flex flex-col justify-center w-full overflow-hidden min-w-0",
                children: [c, d]
            }), p[14] = c, p[15] = d, p[16] = u) : u = p[16], p[17] !== t || p[18] !== i || p[19] !== l || p[20] !== u ? (m = (0, x.jsxs)("div", {
                className: l,
                ...i,
                children: [t, u]
            }), p[17] = t, p[18] = i, p[19] = l, p[20] = u, p[21] = m) : m = p[21], m
        };
    e.s(["default", 0, e => {
        let t, a, i, n, s, o, l, c, d, u = (0, r.c)(24);
        u[0] !== e ? ({ ...t
        } = e, u[0] = e, u[1] = t) : t = u[1];
        let p = (0, v.useTranslations)();
        u[2] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], u[2] = a) : a = u[2];
        let {
            activeMarket: h
        } = (0, T.useEventActiveMarketContext)(a), {
            resolution_source: f,
            resolved_by: g
        } = h;
        u[3] === Symbol.for("react.memo_cache_sentinel") ? (i = ["hasHoldingRewards"], u[3] = i) : i = u[3];
        let {
            hasHoldingRewards: y
        } = (0, M.useEventContext)(i);
        u[4] !== f ? (n = f ? .includes("data.chain.link") ? ? !1, u[4] = f, u[5] = n) : n = u[5];
        let b = n;
        u[6] !== f ? (s = f ? .includes("pythdata.app") ? ? !1, u[6] = f, u[7] = s) : s = u[7];
        let k = s;
        u[8] !== g ? (o = g && (g.toLowerCase() === m.UMA_CTF_ADAPTER_V1_ADDRESS.toLowerCase() || g.toLowerCase() === m.UMA_CTF_ADAPTER_V2_ADDRESS.toLowerCase() || g.toLowerCase() === m.UMA_CTF_ADAPTER_V3_ADDRESS.toLowerCase() || g.toLowerCase() === m.UMA_CTF_ADAPTER_V4_ADDRESS.toLowerCase() || g.toLowerCase() === m.NEG_RISK_UMA_CTF_ADAPTER_ADDRESS.toLowerCase() || g.toLowerCase() === m.NEG_RISK_UMA_CTF_ADAPTER_V4_ADDRESS.toLowerCase()), u[8] = g, u[9] = o) : o = u[9];
        let S = !!o;
        return u[10] !== b || u[11] !== k || u[12] !== f || u[13] !== p ? (l = f && (0, x.jsxs)("div", {
            className: "flex flex-col w-full gap-4 flex-1 basis-0 min-w-0",
            children: [(0, x.jsx)(R, {
                title: p("events.aboutSection.resolutionSource"),
                value: f,
                valueLink: f,
                className: "pl-4",
                children: b ? (0, x.jsx)(D, {}) : k ? (0, x.jsx)(L, {}) : (0, x.jsx)(O, {})
            }), b && (0, x.jsxs)("div", {
                className: "w-full border rounded-xl mx-auto p-3 px-4 justify-start flex items-start gap-3",
                children: [(0, x.jsx)(w.IconCircleInfoFill12, {
                    className: "text-text-secondary my-auto shrink-0"
                }), (0, x.jsx)("p", {
                    className: "text-text text-xs",
                    children: p("events.aboutSection.liveDataDisclaimer")
                })]
            })]
        }), u[10] = b, u[11] = k, u[12] = f, u[13] = p, u[14] = l) : l = u[14], u[15] !== y || u[16] !== S || u[17] !== g || u[18] !== p ? (c = g && (S ? y ? (0, x.jsxs)("div", {
            className: "flex flex-col w-full gap-4 flex-1 basis-0 min-w-0",
            children: [(0, x.jsx)(R, {
                title: p("events.aboutSection.resolver"),
                value: A(g),
                valueLink: E(g, "address"),
                className: "pl-2 w-full",
                children: (0, x.jsx)("div", {
                    className: "ml-2",
                    children: (0, x.jsx)(P, {
                        width: "36px"
                    })
                })
            }), (0, x.jsxs)("div", {
                className: "w-full border rounded-xl mx-auto p-3 px-4 justify-start flex items-start gap-3",
                children: [(0, x.jsx)(w.IconCircleInfoFill12, {
                    className: "text-text-secondary my-auto shrink-0"
                }), (0, x.jsx)("p", {
                    className: "text-text text-xs",
                    children: "We anticipate rolling out a new rewards and oracle-resolution system later this year that will generate returns on your positions, at which point there will be a simple 1-click migration."
                })]
            })]
        }) : (0, x.jsx)(R, {
            title: "Resolver",
            value: A(g),
            valueLink: E(g, "address"),
            className: "pl-2",
            children: (0, x.jsx)("div", {
                className: "ml-2",
                children: (0, x.jsx)(P, {
                    width: "36px"
                })
            })
        }) : (0, x.jsx)(R, {
            title: "Resolver",
            value: A(g),
            valueLink: E(g, "address"),
            className: "pl-4",
            children: (0, x.jsx)(z, {})
        })), u[15] = y, u[16] = S, u[17] = g, u[18] = p, u[19] = c) : c = u[19], u[20] !== t || u[21] !== l || u[22] !== c ? (d = (0, x.jsxs)("div", { ...t,
            className: "flex max-w-full lg:flex-row lg:gap-4 max-lg:flex-col max-lg:gap-2",
            children: [l, c]
        }), u[20] = t, u[21] = l, u[22] = c, u[23] = d) : d = u[23], d
    }], 67735)
}, 396047, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(215777);
    e.s(["useEventLiveVolume", 0, () => {
        let e, a, i = (0, t.c)(6),
            {
                liveVolume: n,
                addTrade: s,
                resetVolume: o
            } = (0, r.useLiveVolume)();
        i[0] !== s ? (e = e => {
            s(e)
        }, i[0] = s, i[1] = e) : e = i[1];
        let l = e;
        return i[2] !== n || i[3] !== o || i[4] !== l ? (a = {
            liveVolume: n,
            tradeHandler: l,
            resetVolume: o
        }, i[2] = n, i[3] = o, i[4] = l, i[5] = a) : a = i[5], a
    }])
}, 48331, 855845, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(122538),
        i = e.i(964974),
        n = e.i(956998),
        s = e.i(56827),
        o = e.i(410342),
        l = e.i(604777),
        c = e.i(399336),
        d = e.i(74156),
        u = e.i(911984),
        m = e.i(761854),
        p = e.i(67735);
    e.i(304697);
    var h = e.i(179645),
        f = e.i(994883),
        x = e.i(491636),
        g = e.i(390960),
        v = e.i(995314),
        y = e.i(15756),
        b = e.i(416340),
        k = e.i(396047),
        w = e.i(864006),
        S = e.i(196593),
        j = e.i(870555),
        C = e.i(891685),
        _ = e.i(794823);

    function T(e) {
        let a, i, n, s, o = (0, r.c)(10),
            {
                title: l,
                value: c,
                children: d
            } = e;
        return o[0] !== l ? (a = (0, t.jsx)("span", {
            className: "text-sm font-bold overflow-hidden whitespace-nowrap text-ellipsis",
            children: l
        }), o[0] = l, o[1] = a) : a = o[1], o[2] !== d || o[3] !== a ? (i = (0, t.jsxs)("div", {
            className: "flex items-center gap-2",
            children: [d, a]
        }), o[2] = d, o[3] = a, o[4] = i) : i = o[4], o[5] !== c ? (n = (0, t.jsx)("span", {
            className: "text-sm overflow-hidden whitespace-nowrap text-ellipsis",
            children: c
        }), o[5] = c, o[6] = n) : n = o[6], o[7] !== i || o[8] !== n ? (s = (0, t.jsxs)("div", {
            className: "flex max-sm:justify-between max-sm:items-center",
            children: [i, n]
        }), o[7] = i, o[8] = n, o[9] = s) : s = o[9], s
    }
    let M = function(e) {
            let a, i, n, s, o, d, u, m, p, M, N, I, P, E, A, O, D, L = (0, r.c)(40);
            L[0] !== e ? ({
                coerceToMarketStatistics: i,
                hideEndDate: s,
                className: a,
                ...n
            } = e, L[0] = e, L[1] = a, L[2] = i, L[3] = n, L[4] = s) : (a = L[1], i = L[2], n = L[3], s = L[4]);
            let z = void 0 !== s && s,
                R = (0, l.useTranslations)(),
                F = (0, w.useLocale)();
            L[5] === Symbol.for("react.memo_cache_sentinel") ? (o = ["event"], L[5] = o) : o = L[5];
            let {
                event: $
            } = (0, C.useEventContext)(o), {
                volume: B,
                endDate: q
            } = $;
            L[6] === Symbol.for("react.memo_cache_sentinel") ? (d = ["activeMarket", "eventDeployedAt"], L[6] = d) : d = L[6];
            let {
                activeMarket: V,
                eventDeployedAt: H
            } = (0, c.useEventActiveMarketContext)(d), {
                volume_num: U,
                endDateIso: W
            } = V, {
                liveVolume: G,
                tradeHandler: Z
            } = (0, k.useEventLiveVolume)(), {
                registerTradeHandler: K,
                unregisterTradeHandler: Y
            } = (0, _.useEventTrade)();
            L[7] !== K || L[8] !== Z || L[9] !== Y ? (u = () => (K("event-statistics-volume", Z), () => {
                Y("event-statistics-volume")
            }), m = [Z, K, Y], L[7] = K, L[8] = Z, L[9] = Y, L[10] = u, L[11] = m) : (u = L[10], m = L[11]), b.default.useEffect(u, m);
            let Q = (i ? U : B) + G;
            L[12] !== Q ? (p = (0, S.formatCurrency)(Math.round(Q), {
                decimals: 0
            }), L[12] = Q, L[13] = p) : p = L[13];
            let X = p;
            L[14] !== i || L[15] !== q || L[16] !== F || L[17] !== W ? (M = ((e, t, r, a) => {
                let i = {
                    locale: (0, g.getDateFnsLocale)(a)
                };
                try {
                    if (e && t) return (0, x.format)((0, f.parse)(t, "yyyy-MM-dd", new Date), "PP", i);
                    if (!e && r) return (0, x.format)(new h.TZDate(new Date(r), "UTC"), "PP", i);
                    return
                } catch {
                    return
                }
            })(i, W, q, F), L[14] = i, L[15] = q, L[16] = F, L[17] = W, L[18] = M) : M = L[18];
            let J = M;
            return L[19] !== a ? (N = (0, j.cn)("flex", "lg:flex-row", "max-lg:flex-col max-lg:w-full max-lg:gap-4", a), L[19] = a, L[20] = N) : N = L[20], L[21] !== R ? (I = R("events.statistics.volume"), L[21] = R, L[22] = I) : I = L[22], L[23] === Symbol.for("react.memo_cache_sentinel") ? (P = (0, t.jsx)(v.IconChartColumnFill18, {
                className: "size-6 text-text-brand"
            }), L[23] = P) : P = L[23], L[24] !== X || L[25] !== I ? (E = (0, t.jsx)(T, {
                title: I,
                value: X,
                children: P
            }), L[24] = X, L[25] = I, L[26] = E) : E = L[26], L[27] !== z || L[28] !== J || L[29] !== R ? (A = J && !z && (0, t.jsx)(T, {
                title: R("events.statistics.endDate"),
                value: J,
                children: (0, t.jsx)(y.IconClockFill18, {
                    className: "size-6 text-text-brand"
                })
            }), L[27] = z, L[28] = J, L[29] = R, L[30] = A) : A = L[30], L[31] !== H || L[32] !== R ? (O = H && (0, t.jsx)(T, {
                title: R("events.statistics.createdAt"),
                value: H,
                children: (0, t.jsx)(y.IconClockFill18, {
                    className: "size-6 text-text-brand"
                })
            }), L[31] = H, L[32] = R, L[33] = O) : O = L[33], L[34] !== n || L[35] !== N || L[36] !== E || L[37] !== A || L[38] !== O ? (D = (0, t.jsxs)("div", {
                className: N,
                ...n,
                children: [E, A, O]
            }), L[34] = n, L[35] = N, L[36] = E, L[37] = A, L[38] = O, L[39] = D) : D = L[39], D
        },
        N = e => {
            let a, i, n, s = (0, r.c)(5),
                {
                    children: o,
                    className: l
                } = e,
                c = b.default.useRef(null),
                d = b.default.useRef(!1);
            return s[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => {
                let e = c.current;
                if (!e) return;
                let t = t => {
                        let r = window.getSelection();
                        if (r && r.toString().length > 0) {
                            let a = r.anchorNode;
                            a && e.contains(a) && (t.stopPropagation(), d.current = !0)
                        }
                    },
                    r = t => {
                        let r = window.getSelection();
                        if (r && r.toString().length > 0) {
                            let a = r.anchorNode;
                            a && e.contains(a) && t.stopPropagation()
                        }
                    },
                    a = () => {
                        let e = window.getSelection();
                        d.current = null !== e && e.toString().length > 0
                    };
                return e.addEventListener("pointerdown", r, {
                    capture: !0
                }), e.addEventListener("pointermove", t, {
                    capture: !0
                }), document.addEventListener("selectionchange", a), () => {
                    e.removeEventListener("pointerdown", r), e.removeEventListener("pointermove", t), document.removeEventListener("selectionchange", a)
                }
            }, i = [], s[0] = a, s[1] = i) : (a = s[0], i = s[1]), b.default.useEffect(a, i), s[2] !== o || s[3] !== l ? (n = (0, t.jsx)("div", {
                ref: c,
                className: l,
                children: o
            }), s[2] = o, s[3] = l, s[4] = n) : n = s[4], n
        };
    e.s(["TextSelectionWrapper", 0, N], 855845), e.s(["EventAboutSection", 0, function(e) {
        let h, f, x, g, v, y, b, k, w, S, j, C, _, T, I, P, E = (0, r.c)(43);
        if (E[0] !== e) {
            let {
                hideSources: t,
                showLinkInHeader: r,
                shouldHideStatistics: a,
                isMobileEventLevel: i,
                isSMP: n,
                hideHeader: s,
                ...o
            } = e;
            f = t, y = a, x = i, g = n, h = s, v = o, E[0] = e, E[1] = h, E[2] = f, E[3] = x, E[4] = g, E[5] = v, E[6] = y
        } else h = E[1], f = E[2], x = E[3], g = E[4], v = E[5], y = E[6];
        let A = (0, l.useTranslations)();
        E[7] === Symbol.for("react.memo_cache_sentinel") ? (b = ["activeMarket", "eventDeployedAt"], E[7] = b) : b = E[7];
        let {
            activeMarket: O,
            eventDeployedAt: D
        } = (0, c.useEventActiveMarketContext)(b), {
            description: L
        } = O;
        E[8] !== O.id ? (k = ["/api/market/resolutionData", O.id], E[8] = O.id, E[9] = k) : k = E[9], E[10] !== O ? (w = () => (0, d.getResolutionData)(O), E[10] = O, E[11] = w) : w = E[11], E[12] !== O.resolutionData ? (S = () => O.resolutionData, E[12] = O.resolutionData, E[13] = S) : S = E[13];
        let z = !!O.resolutionData && g;
        E[14] === Symbol.for("react.memo_cache_sentinel") ? (j = {
            errorContext: {
                tag: "[EventAboutSection > marketResolutionData]"
            }
        }, E[14] = j) : j = E[14], E[15] !== k || E[16] !== w || E[17] !== S || E[18] !== z ? (C = {
            queryKey: k,
            queryFn: w,
            initialData: S,
            enabled: z,
            refetchOnMount: !1,
            refetchOnReconnect: !1,
            refetchOnWindowFocus: !0,
            placeholderData: a.keepPreviousData,
            staleTime: 6e4,
            gcTime: 6e4,
            meta: j
        }, E[15] = k, E[16] = w, E[17] = S, E[18] = z, E[19] = C) : C = E[19];
        let R = (0, i.useQuery)(C),
            {
                sortedClarifications: F,
                lastUpdatedAt: $
            } = (0, u.useMarketClarifications)(O),
            {
                data: B
            } = R,
            q = B && "initialized" !== B.status && "posed" !== B.status;
        if (E[20] !== h || E[21] !== x || E[22] !== A ? (_ = !h && (0, t.jsx)("div", {
                className: "flex justify-between items-center mb-4",
                children: (0, t.jsx)("h2", {
                    className: "text-text font-medium",
                    children: A(x ? "events.aboutSection.about" : "events.aboutSection.rules")
                })
            }), E[20] = h, E[21] = x, E[22] = A, E[23] = _) : _ = E[23], E[24] !== $ || E[25] !== F ? (T = F.length > 0 && $ ? (0, t.jsx)(m.default, {
                marketClarifications: F,
                lastUpdatedAt: $
            }) : null, E[24] = $, E[25] = F, E[26] = T) : T = E[26], E[27] !== L || E[28] !== D || E[29] !== h || E[30] !== f || E[31] !== x || E[32] !== q || E[33] !== g || E[34] !== B || E[35] !== y || E[36] !== A) {
            let e;
            I = !x || g || h ? (0, t.jsxs)(N, {
                children: [(0, t.jsx)(n.default, {
                    options: {
                        nl2br: !0,
                        defaultProtocol: "https",
                        target: "_blank",
                        className: {
                            url: "hover:underline"
                        }
                    },
                    children: (e = (0, t.jsxs)(t.Fragment, {
                        children: [L, D && !x && (0, t.jsx)("div", {
                            className: "hidden lg:block mt-4",
                            children: (0, t.jsxs)("p", {
                                className: "text-text text-body-base",
                                children: [(0, t.jsx)("span", {
                                    className: "font-semibold",
                                    children: A("events.aboutSection.createdAt")
                                }), " ", D]
                            })
                        }), y ? null : (0, t.jsx)("div", {
                            className: "my-4 sm:hidden",
                            children: (0, t.jsx)(M, {
                                coerceToMarketStatistics: !!g
                            })
                        }), !f && (0, t.jsx)("div", {
                            className: "my-4",
                            children: (0, t.jsx)(p.default, {})
                        }), !!B && !q && !x && (0, t.jsx)("div", {
                            className: "my-4",
                            children: (0, t.jsx)(o.EventResolutionSection, {})
                        })]
                    }), h ? (0, t.jsx)(s.default, {
                        seeLessText: A("events.aboutSection.showLess"),
                        seeMoreText: A("events.aboutSection.showMore"),
                        text: L,
                        maxLines: 7,
                        children: e
                    }) : (0, t.jsx)(s.default, {
                        seeLessText: A("events.aboutSection.showLess"),
                        seeMoreText: A("events.aboutSection.showMore"),
                        text: L,
                        maxLines: 1,
                        children: e
                    }))
                }), q && (0, t.jsx)("div", {
                    className: "my-4 w-full",
                    children: (0, t.jsx)(o.EventResolutionSection, {})
                })]
            }) : (0, t.jsxs)(N, {
                children: [y ? null : (0, t.jsx)("div", {
                    className: "my-4 sm:hidden",
                    children: (0, t.jsx)(M, {
                        coerceToMarketStatistics: !!g
                    })
                }), !f && (0, t.jsx)("div", {
                    className: "my-4",
                    children: (0, t.jsx)(p.default, {})
                })]
            }), E[27] = L, E[28] = D, E[29] = h, E[30] = f, E[31] = x, E[32] = q, E[33] = g, E[34] = B, E[35] = y, E[36] = A, E[37] = I
        } else I = E[37];
        return E[38] !== v || E[39] !== I || E[40] !== _ || E[41] !== T ? (P = (0, t.jsxs)("div", { ...v,
            children: [_, T, I]
        }), E[38] = v, E[39] = I, E[40] = _, E[41] = T, E[42] = P) : P = E[42], P
    }], 48331)
}, 909838, 748960, 234097, e => {
    "use strict";
    var t, r = e.i(221628),
        a = e.i(740594),
        i = e.i(388343),
        n = e.i(940011),
        s = e.i(425010),
        o = e.i(416340),
        l = e.i(73903),
        c = e.i(870555),
        d = e.i(399336),
        u = e.i(891685),
        m = e.i(794823),
        p = e.i(196593);
    e.s(["LiveActivityIndicator", 0, ({
        conditionIds: e,
        chartMarkets: t,
        className: h
    }) => {
        let {
            event: f
        } = (0, u.useEventContext)(["event"]), {
            activeMarket: x
        } = (0, d.useEventActiveMarketContext)(["activeMarket"]), {
            colors: g
        } = (0, l.useChartTheme)(), {
            resolvedTheme: v
        } = (0, s.useTheme)(), y = f ? .slug, {
            indicators: b,
            push: k
        } = (0, n.useLiveActivityQueue)(), w = (0, o.useCallback)((e, r) => {
            if (t && t.length > 0 && r) {
                let e = t.find(e => e.conditionId ? .toLowerCase() === r.toLowerCase());
                if (e ? .color) return e.color
            }
            if (f ? .markets && r) {
                let t = f.markets.find(e => e.conditionId.toLowerCase() === r.toLowerCase());
                if (t ? .teams ? .length === 2) {
                    let r = t.teams[e] ? .color;
                    if (r) return r
                }
                if (t ? .seriesColor && g[t.seriesColor]) return g[t.seriesColor].color
            }
            if (x ? .teams ? .length === 2) {
                let t = x.teams[e] ? .color;
                if (t) return t
            }
            return 0 === e ? "var(--color-green-500)" : "var(--color-red-500)"
        }, [t, x, f, g]), S = (0, o.useRef)(w);
        S.current = w;
        let j = (0, o.useCallback)(t => {
                if (!t ? .conditionId || !e.includes(t.conditionId) || t.side !== a.Side.BUY) return;
                let r = t.price * t.size;
                r < 1 || k({
                    id: t.transactionHash,
                    amount: r,
                    color: S.current(t.outcomeIndex, t.conditionId)
                })
            }, [e, k]),
            {
                registerTradeHandler: C,
                unregisterTradeHandler: _
            } = (0, m.useEventTrade)();
        return ((0, o.useEffect)(() => {
            let t = `live-activity-indicator-${e.join("-")}`;
            return C(t, j), () => {
                _(t)
            }
        }, [j, C, _, e]), y && 0 !== e.length) ? (0, r.jsx)(i.LiveActivityOverlay, {
            indicators: b,
            isDark: "dark" === v,
            className: (0, c.cn)("bottom-20 left-1 md:left-2.5", h),
            formatAmount: e => (0, p.formatNumbers)(e, 0)
        }) : null
    }], 909838);
    var h = ((t = {}).Activity = "activity", t.Comments = "comments", t.Holders = "holders", t.Positions = "positions", t.Related = "related", t);
    e.s(["LowerState", () => h], 748960);
    var f = e.i(999061);

    function x(e) {
        return (e.sportsMarketType ? ? "moneyline") === "moneyline" && e.teams
    }
    e.s(["useSportsTeams", 0, function() {
        let e, t, r, a, i = (0, f.c)(14);
        i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], i[0] = e) : e = i[0];
        let {
            activeMarket: n
        } = (0, d.useEventActiveMarketContext)(e);
        i[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["event"], i[1] = t) : t = i[1];
        let {
            event: s
        } = (0, u.useEventContext)(t);
        e: {
            let e;
            if ("totals" === n.sportsMarketType || "team_totals" === n.sportsMarketType || "anytime_touchdowns" === n.sportsMarketType || "first_touchdowns" === n.sportsMarketType || "rushing_yards" === n.sportsMarketType || "receiving_yards" === n.sportsMarketType || "points" === n.sportsMarketType || "assists" === n.sportsMarketType || "rebounds" === n.sportsMarketType) {
                let e;
                i[2] !== s.markets ? (e = s.markets.find(x), i[2] = s.markets, i[3] = e) : e = i[3];
                let t = e;
                if (t ? .teams && 2 === t.teams.length) {
                    let e;
                    i[4] !== t.teams[0] || i[5] !== t.teams[1] ? (e = {
                        zeroIndexedTeam: t.teams[0],
                        oneIndexedTeam: t.teams[1]
                    }, i[4] = t.teams[0], i[5] = t.teams[1], i[6] = e) : e = i[6], r = e;
                    break e
                }
            }
            if (!n.teams || 2 !== n.teams.length) {
                let e;
                i[7] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroIndexedTeam: void 0,
                    oneIndexedTeam: void 0
                }, i[7] = e) : e = i[7], r = e;
                break e
            }
            let t = n.teams[+!!n.invertOutcomesVisually],
                a = n.teams[+!n.invertOutcomesVisually];i[8] !== t || i[9] !== a ? (e = {
                zeroIndexedTeam: t,
                oneIndexedTeam: a
            }, i[8] = t, i[9] = a, i[10] = e) : e = i[10],
            r = e
        }
        let {
            zeroIndexedTeam: o,
            oneIndexedTeam: l
        } = r;
        return i[11] !== l || i[12] !== o ? (a = {
            zeroIndexedTeam: o,
            oneIndexedTeam: l
        }, i[11] = l, i[12] = o, i[13] = a) : a = i[13], a
    }], 234097)
}, 721965, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(197994);
    e.s(["IconEarthFill18", 0, ({ ...e
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...e
    }, t.default.createElement("path", {
        d: "M12.955,3.741c.204,.033,.414-.022,.577-.149l.153-.119c-1.264-1.073-2.898-1.722-4.685-1.722C5.838,1.75,3.156,3.778,2.165,6.601c.682,1.534,1.562,2.732,2.649,3.526l.238,.169c.089,.062,.176,.123,.26,.185,.008,.006,.016,.012,.023,.018,.294,.22,.549,.461,.678,.819,.094,.262,.083,.47,.068,.733-.021,.393-.049,.881,.292,1.447,.313,.52,.718,.733,1.014,.889,.226,.119,.33,.178,.426,.323,.279,.418,.139,1.06,.066,1.316-.012,.043-.024,.082-.037,.125,.378,.061,.762,.101,1.157,.101,3.08,0,5.705-1.924,6.756-4.634-.483-1.093-1.095-1.707-1.865-1.853-.814-.154-1.425,.274-1.918,.618-.416,.289-.686,.468-.959,.413-.157-.029-.231-.102-.48-.401-.232-.278-.55-.66-1.092-.978-.881-.516-1.975-.648-3.259-.395-.127-.359-.222-.881,.022-1.376,.053-.107,.343-.65,.871-.796,.418-.116,.823,.082,1.249,.291,.477,.234,1.129,.554,1.759,.154,.706-.45,.629-1.294,.567-1.973-.045-.49-.096-1.046,.124-1.32,.271-.339,1.067-.434,2.181-.259Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), t.default.createElement("path", {
        d: "M9,17c-4.411,0-8-3.589-8-8S4.589,1,9,1s8,3.589,8,8-3.589,8-8,8Zm0-14.5c-3.584,0-6.5,2.916-6.5,6.5s2.916,6.5,6.5,6.5,6.5-2.916,6.5-6.5-2.916-6.5-6.5-6.5Z",
        fill: "currentColor"
    }))])
}, 186568, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340),
        a = e.i(221628),
        i = e.i(977781),
        n = e.i(721965),
        s = e.i(466352),
        o = e.i(104310);
    let l = (0, a.jsx)(e => {
            let r, l, c, d, u, m, p, h, f, x = (0, t.c)(19),
                {
                    title: g,
                    children: v
                } = e;
            return x[0] !== g ? (r = (0, a.jsxs)("span", {
                className: "font-bold",
                children: [g, ":"]
            }), x[0] = g, x[1] = r) : r = x[1], x[2] !== v || x[3] !== r ? (l = (0, a.jsx)("div", {
                className: "hidden lg:block p-4",
                children: (0, a.jsxs)("p", {
                    className: "text-sm leading-[21px]",
                    children: [r, " ", v]
                })
            }), x[2] = v, x[3] = r, x[4] = l) : l = x[4], x[5] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, a.jsx)(n.IconEarthFill18, {
                "aria-hidden": !0,
                className: "size-4 text-text"
            }), x[5] = c) : c = x[5], x[6] !== g ? (d = (0, a.jsxs)("div", {
                className: "flex items-center gap-2",
                children: [c, g]
            }), x[6] = g, x[7] = d) : d = x[7], x[8] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, a.jsxs)("div", {
                className: "relative size-4",
                children: [(0, a.jsx)(s.IconPlusFill18, {
                    size: 16,
                    className: "absolute inset-0 group-data-[state=open]:opacity-0 group-data-[state=open]:rotate-90 transition-all duration-200"
                }), (0, a.jsx)(o.IconMinusFill18, {
                    size: 16,
                    className: "absolute inset-0 group-data-[state=closed]:opacity-0 group-data-[state=closed]:-rotate-90 transition-all duration-200"
                })]
            }), x[8] = u) : u = x[8], x[9] !== d ? (m = (0, a.jsxs)(i.AccordionTrigger, {
                withCaret: !1,
                className: "px-4 py-4 h-auto font-semibold leading-[21px] bg-transparent hover:bg-transparent data-[state=open]:bg-transparent data-[state=open]:hover:bg-transparent group",
                children: [d, u]
            }), x[9] = d, x[10] = m) : m = x[10], x[11] !== v ? (p = (0, a.jsx)(i.AccordionContent, {
                className: "bg-transparent [&>div]:px-4 [&>div]:pb-4",
                children: (0, a.jsx)("p", {
                    className: "text-sm leading-[21px]",
                    children: v
                })
            }), x[11] = v, x[12] = p) : p = x[12], x[13] !== m || x[14] !== p ? (h = (0, a.jsx)("div", {
                className: "lg:hidden",
                children: (0, a.jsx)(i.Accordion, {
                    type: "single",
                    collapsible: !0,
                    children: (0, a.jsxs)(i.AccordionItem, {
                        value: "banner",
                        children: [m, p]
                    })
                })
            }), x[13] = m, x[14] = p, x[15] = h) : h = x[15], x[16] !== l || x[17] !== h ? (f = (0, a.jsxs)("div", {
                id: "tag-banner",
                className: "max-w-[938px] mb-6 rounded-lg text-text-primary bg-neutral-50",
                children: [l, h]
            }), x[16] = l, x[17] = h, x[18] = f) : f = x[18], f
        }, {
            title: "Note on Middle East Markets",
            children: "The promise of prediction markets is to harness the wisdom of the crowd to create accurate, unbiased forecasts for the most important events to society. That ability is particularly invaluable in gut-wrenching times like today. After discussing with those directly affected by the attacks, who had dozens of questions, we realized that prediction markets could give them the answers they needed in ways TV news and 𝕏 could not."
        }),
        c = {
            "middle east": l,
            gaza: l,
            "fact check": (0, a.jsxs)(e => {
                let r, i = (0, t.c)(2),
                    {
                        children: n
                    } = e;
                return i[0] !== n ? (r = (0, a.jsx)("div", {
                    id: "tag-banner",
                    className: "flex flex-col gap-3 max-w-[938px] p-4 mb-6 rounded-md text-text-primary bg-brand-50/60 dark:bg-neutral-50",
                    children: (0, a.jsx)("p", {
                        className: "text-sm leading-[21px]",
                        children: n
                    })
                }), i[0] = n, i[1] = r) : r = i[1], r
            }, {
                children: ['The promise of prediction markets is to harness the wisdom of the crowd to create unbiased forecasts and "fact checks" for the most important events shaping public discourse. The', " ", (0, a.jsx)("a", {
                    className: "font-medium text-text-brand underline",
                    href: "https://polymarket.com/accuracy",
                    target: "_blank",
                    rel: "noopener noreferrer",
                    children: "accuracy of our markets"
                }), " ", "is particularly invaluable in today's age of biased pundits, social media disinformation, and AI. We offer these breaking news markets as a public service to distill fact from fiction — we charge no fees & make no money on this market."]
            })
        };
    var d = e.i(897535),
        u = e.i(891685),
        m = e.i(748960),
        p = e.i(459225);
    let h = [m.LowerState.Comments, m.LowerState.Holders, m.LowerState.Positions, m.LowerState.Activity],
        f = [m.LowerState.Comments, m.LowerState.Holders, m.LowerState.Positions],
        x = [m.LowerState.Comments, m.LowerState.Holders, m.LowerState.Positions, m.LowerState.Activity];
    e.s(["getLowerStateLabel", 0, (e, t) => t(`events.lowerState.${e}`), "getLowerStateOptions", 0, (e, t) => e ? e ? t ? x : f : [] : h, "useEventDetail", 0, () => {
        let e, a, i, n, s = (0, t.c)(16),
            [o, l] = r.default.useState(!1),
            [f, x] = r.default.useState(void 0),
            [g, v] = r.default.useState(m.LowerState.Comments);
        s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], s[0] = e) : e = s[0];
        let {
            event: y
        } = (0, u.useEventContext)(e), {
            size: b
        } = (0, d.default)(y), {
            markets: k,
            resolvedMarkets: w,
            lowChanceMarkets: S
        } = (0, p.useSortedMarkets)(y);
        s[1] !== S || s[2] !== k ? (a = k.concat(S), s[1] = S, s[2] = k, s[3] = a) : a = s[3];
        let j = a;
        s[4] !== y ? (i = function(e) {
            if (!e.tags) return null;
            for (let t of e.tags) {
                let e = t.label.toLowerCase();
                if (c[e]) return c[e]
            }
            return null
        }(y), s[4] = y, s[5] = i) : i = s[5];
        let C = i;
        return s[6] !== S || s[7] !== g || s[8] !== k || s[9] !== j || s[10] !== b || s[11] !== f || s[12] !== o || s[13] !== w || s[14] !== C ? (n = {
            lowChanceMarkets: S,
            lowerState: g,
            lowerStateOptions: h,
            markets: k,
            marketsForSocial: j,
            negRiskOtherSize: b,
            resolutionDataToView: f,
            resolutionDialogOpen: o,
            resolvedMarkets: w,
            setLowerState: v,
            setResolutionDataToView: x,
            setResolutionDialogOpen: l,
            tagBanner: C
        }, s[6] = S, s[7] = g, s[8] = k, s[9] = j, s[10] = b, s[11] = f, s[12] = o, s[13] = w, s[14] = C, s[15] = n) : n = s[15], n
    }], 186568)
}, 317041, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061);
    e.s(["EmptyState", 0, e => {
        let a, i, n, s, o = (0, r.c)(10),
            {
                message: l,
                icon: c,
                action: d
            } = e;
        return o[0] !== c ? (a = c && (0, t.jsx)("div", {
            className: "text-text-tertiary",
            children: c
        }), o[0] = c, o[1] = a) : a = o[1], o[2] !== l ? (i = (0, t.jsx)("p", {
            className: "text-sm font-medium text-text-secondary",
            children: l
        }), o[2] = l, o[3] = i) : i = o[3], o[4] !== d ? (n = d && (0, t.jsx)("button", {
            type: "button",
            onClick: d.onClick,
            className: "text-sm font-medium text-button-link-text hover:underline",
            children: d.label
        }), o[4] = d, o[5] = n) : n = o[5], o[6] !== a || o[7] !== i || o[8] !== n ? (s = (0, t.jsxs)("div", {
            className: "flex flex-col items-center justify-center h-full w-full my-10 gap-4",
            children: [a, i, n]
        }), o[6] = a, o[7] = i, o[8] = n, o[9] = s) : s = o[9], s
    }])
}, 112503, 18365, 839156, 507670, 269324, 272436, 457831, 295038, 884446, 631827, 605797, 41016, 740849, 147931, 323481, 294377, 575865, 953144, 82489, e => {
    "use strict";
    e.s(["MobileSmpTabs", () => $], 112503);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(23128),
        i = e.i(148858),
        n = e.i(97271),
        s = e.i(416340),
        o = e.i(27235),
        l = e.i(394341),
        c = e.i(30704),
        d = e.i(784521),
        u = e.i(118818),
        m = e.i(422868),
        p = e.i(960334),
        h = e.i(740594),
        f = e.i(723823),
        x = e.i(635868),
        g = e.i(458164),
        v = e.i(317041),
        y = e.i(604777),
        b = e.i(879756),
        k = e.i(827525),
        w = e.i(140527),
        S = e.i(184612),
        j = e.i(839593);
    let C = ({ ...e
    }) => s.default.createElement(j.Icon, {
        size: "24px",
        ...e
    }, s.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M2 6L21 6L21 8L2 8L2 6Z",
        fill: "currentColor"
    }), s.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M21.9998 16.0962L3.00013 16.0961L2.99965 18.0961L4.12102 18.0964L21.9998 18.0962L21.9998 16.0962Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), s.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M15.5858 11L19.5858 7L15.5858 3L17 1.58579L22.4142 7.00001L17 12.4142L15.5858 11Z",
        fill: "currentColor"
    }), s.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M8.41421 21.0001L4.41424 17L8.41433 13L7.00013 11.5857L1.58583 17L6.99998 22.4143L8.41421 21.0001Z",
        fill: "currentColor",
        "data-color": "color-2"
    }));
    e.s(["IconArrowsOppositeDirectionX2Fill24", 0, C], 18365);
    var _ = e.i(543078),
        T = e.i(196593),
        M = e.i(891685),
        N = e.i(983707),
        I = e.i(86831),
        P = e.i(766181);
    let E = (0, P.cva)("flex h-5 w-fit items-center rounded-sm px-[5px] py-[3px]", {
        variants: {
            color: {
                blue: "bg-brand-500/10 text-brand-500",
                green: "bg-green-500/10 text-green-500 dark:bg-green-500/20",
                red: "bg-[#E648001A] text-red-600 dark:bg-[#E6480033]",
                "light-green": "bg-green-50 text-text dark:bg-green-500/20",
                "light-red": "bg-[#E648001A] text-text dark:bg-[#E6480033]"
            }
        }
    });

    function A(e) {
        let a, i, n, s, o, l = (0, r.c)(10);
        return l[0] !== e ? ({
            className: a,
            color: i,
            ...n
        } = e, l[0] = e, l[1] = a, l[2] = i, l[3] = n) : (a = l[1], i = l[2], n = l[3]), l[4] !== a || l[5] !== i ? (s = (0, I.cn)(E({
            color: i
        }), a), l[4] = a, l[5] = i, l[6] = s) : s = l[6], l[7] !== n || l[8] !== s ? (o = (0, t.jsx)("div", {
            className: s,
            ...n
        }), l[7] = n, l[8] = s, l[9] = o) : o = l[9], o
    }

    function O(e) {
        let a, i, n, s, o, l, c, d = (0, r.c)(10);
        return d[0] !== e ? ({
            className: a,
            ...i
        } = e, d[0] = e, d[1] = a, d[2] = i) : (a = d[1], i = d[2]), d[3] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)("path", {
            d: "M0 8V5.49951H20V7.74951L5.5 14.0005L0 8Z",
            fill: "#21832D"
        }), s = (0, t.jsx)("path", {
            d: "M12.5 -0.000488281L0 5.49951L5.5 11.6245L20 5.49951L12.5 -0.000488281Z",
            fill: "#3AB549"
        }), o = (0, t.jsx)("path", {
            d: "M3.5 5.49951C4.3 6.29951 3.5 6.66667 3 7L5 9C6.2 8.2 6.66667 8.83333 7 9.5L15.5 6C13.9 4.8 15 4.33284 15.5 3.99951L13.5 2.49951C12.3 2.89951 11.3333 2.33285 11 1.99951L3.5 5.49951Z",
            fill: "#92FF04"
        }), l = (0, t.jsx)("ellipse", {
            cx: "9.5",
            cy: "5.49951",
            rx: "2.5",
            ry: "1.5",
            fill: "#3AB549"
        }), d[3] = n, d[4] = s, d[5] = o, d[6] = l) : (n = d[3], s = d[4], o = d[5], l = d[6]), d[7] !== a || d[8] !== i ? (c = (0, t.jsxs)("svg", {
            xmlns: "http://www.w3.org/2000/svg",
            width: 20,
            height: 14,
            viewBox: "0 0 20 14",
            fill: "none",
            className: a,
            ...i,
            children: [n, s, o, l]
        }), d[7] = a, d[8] = i, d[9] = c) : c = d[9], c
    }
    e.s(["CashBalanceIcon", 0, O], 839156);
    var D = e.i(870555);
    let L = e => {
            let a, i, n, s, o, l, c = (0, r.c)(16),
                {
                    label: d,
                    value: u,
                    valueColor: m,
                    align: p,
                    children: h
                } = e,
                f = void 0 === m ? "var(--color-text-primary)" : m,
                x = void 0 === p ? "start" : p,
                g = "start" === x ? "items-start" : "center" === x ? "items-center" : "items-end";
            return c[0] !== g ? (a = (0, D.cn)("flex flex-col", g), c[0] = g, c[1] = a) : a = c[1], c[2] !== d ? (i = (0, t.jsx)("p", {
                className: "text-xs font-medium text-neutral-500 leading-[18px] tracking-[0.15px]",
                children: d
            }), c[2] = d, c[3] = i) : i = c[3], c[4] !== f ? (n = {
                color: f
            }, c[4] = f, c[5] = n) : n = c[5], c[6] !== n || c[7] !== u ? (s = (0, t.jsx)("p", {
                className: "text-sm font-semibold leading-[21px] tracking-[0.15px]",
                style: n,
                children: u
            }), c[6] = n, c[7] = u, c[8] = s) : s = c[8], c[9] !== h || c[10] !== s ? (o = (0, t.jsxs)("div", {
                className: "flex gap-2 h-[21px] overflow-visible items-center",
                children: [h, s]
            }), c[9] = h, c[10] = s, c[11] = o) : o = c[11], c[12] !== a || c[13] !== i || c[14] !== o ? (l = (0, t.jsxs)("div", {
                className: a,
                children: [i, o]
            }), c[12] = a, c[13] = i, c[14] = o, c[15] = l) : l = c[15], l
        },
        z = e => {
            let a, i, n, o, l, c, d, m, p, h, f, x, g, v, b, j, I, P, E, D, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q = (0, r.c)(85),
                {
                    position: X,
                    onClick: J
                } = e,
                ee = (0, y.useTranslations)();
            Q[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], Q[0] = a) : a = Q[0];
            let {
                event: et
            } = (0, M.useEventContext)(a), {
                market: er
            } = (0, u.useMobileMarketContext)(), [ea, ei] = s.default.useState(!1);
            Q[1] !== X.totalReturn ? (i = (e => {
                try {
                    return parseFloat(e.totalProfit.replace("$", "")) >= 0 ? "var(--green-500)" : "var(--red-600)"
                } catch {
                    return "var(--neutral-500)"
                }
            })(X.totalReturn), Q[1] = X.totalReturn, Q[2] = i) : i = Q[2];
            let en = i;
            e: {
                if (!(er.negRisk && !1 !== et.enableNegRisk) || 1 !== X.sell.outcomeIdx || X.sell.isClosed) {
                    n = !1;
                    break e
                }
                n = !0
            }
            let es = n,
                eo = `${X.sell.outcome} icon`;
            Q[3] === Symbol.for("react.memo_cache_sentinel") ? (o = {
                objectFit: "cover",
                borderRadius: "4px"
            }, Q[3] = o) : o = Q[3], Q[4] !== X.outcomeDetail.icon || Q[5] !== eo ? (l = (0, t.jsx)("div", {
                className: "size-[42px] relative overflow-hidden",
                children: (0, t.jsx)(S.default, {
                    src: X.outcomeDetail.icon,
                    alt: eo,
                    fill: !0,
                    style: o,
                    priority: !0
                })
            }), Q[4] = X.outcomeDetail.icon, Q[5] = eo, Q[6] = l) : l = Q[6];
            let el = X.outcomeDetail.color;
            Q[7] !== X.sell.outcome ? (c = (0, w.capitalize)(X.sell.outcome), Q[7] = X.sell.outcome, Q[8] = c) : c = Q[8];
            let ec = `${c}`;
            return Q[9] !== ec ? (d = (0, t.jsx)("p", {
                className: "text-xs font-medium text-inherit leading-[18px] tracking-[0.15px]",
                children: ec
            }), Q[9] = ec, Q[10] = d) : d = Q[10], Q[11] !== X.outcomeDetail.color || Q[12] !== d ? (m = (0, t.jsx)(A, {
                color: el,
                children: d
            }), Q[11] = X.outcomeDetail.color, Q[12] = d, Q[13] = m) : m = Q[13], Q[14] !== X.sell.qty ? (p = (0, T.formatNum)(X.sell.qty, {
                decimals: 2
            }), Q[14] = X.sell.qty, Q[15] = p) : p = Q[15], Q[16] !== ee ? (h = ee("trading.shares").toLowerCase(), Q[16] = ee, Q[17] = h) : h = Q[17], Q[18] !== p || Q[19] !== h ? (f = (0, t.jsxs)("p", {
                className: "text-xs font-medium text-neutral-500 leading-[18px] tracking-[0.15px]",
                children: [p, " ", h]
            }), Q[18] = p, Q[19] = h, Q[20] = f) : f = Q[20], Q[21] !== m || Q[22] !== f || Q[23] !== l ? (x = (0, t.jsxs)("div", {
                className: "flex w-full items-center gap-3",
                children: [l, m, f]
            }), Q[21] = m, Q[22] = f, Q[23] = l, Q[24] = x) : x = Q[24], Q[25] !== ee ? (g = ee("trading.avg"), Q[25] = ee, Q[26] = g) : g = Q[26], Q[27] !== X.avgPrice || Q[28] !== g ? (v = (0, t.jsx)(L, {
                label: g,
                value: X.avgPrice
            }), Q[27] = X.avgPrice, Q[28] = g, Q[29] = v) : v = Q[29], Q[30] !== ee ? (b = ee("trading.current"), Q[30] = ee, Q[31] = b) : b = Q[31], Q[32] !== X.value.currentMarketValue ? (j = (0, T.toUSCurrency)(X.value.currentMarketValue), Q[32] = X.value.currentMarketValue, Q[33] = j) : j = Q[33], Q[34] !== b || Q[35] !== j ? (I = (0, t.jsx)(L, {
                label: b,
                value: j
            }), Q[34] = b, Q[35] = j, Q[36] = I) : I = Q[36], Q[37] !== X.totalReturn.totalProfit || Q[38] !== X.totalReturn.totalProfitPercent || Q[39] !== ee || Q[40] !== en ? (P = !!X.totalReturn.totalProfit && !!X.totalReturn.totalProfitPercent && (0, t.jsx)(L, {
                label: ee("trading.return"),
                value: `${X.totalReturn.totalProfit} (${X.totalReturn.totalProfitPercent})`,
                valueColor: en
            }), Q[37] = X.totalReturn.totalProfit, Q[38] = X.totalReturn.totalProfitPercent, Q[39] = ee, Q[40] = en, Q[41] = P) : P = Q[41], Q[42] !== v || Q[43] !== I || Q[44] !== P ? (E = (0, t.jsxs)("div", {
                className: "flex gap-5 py-2",
                children: [v, I, P]
            }), Q[42] = v, Q[43] = I, Q[44] = P, Q[45] = E) : E = Q[45], Q[46] !== x || Q[47] !== E ? (D = (0, t.jsxs)("div", {
                className: "flex flex-col gap-2 px-3",
                children: [x, E]
            }), Q[46] = x, Q[47] = E, Q[48] = D) : D = Q[48], Q[49] !== J || Q[50] !== X ? (z = () => J(X), Q[49] = J, Q[50] = X, Q[51] = z) : z = Q[51], Q[52] !== ee ? (R = ee("trading.cashOut"), Q[52] = ee, Q[53] = R) : R = Q[53], Q[54] !== z || Q[55] !== R ? (F = (0, t.jsx)(N.TradingButton, {
                color: "green",
                onClick: z,
                className: "flex-1",
                children: R
            }), Q[54] = z, Q[55] = R, Q[56] = F) : F = Q[56], Q[57] !== ea || Q[58] !== es ? ($ = es && (0, t.jsxs)(k.Drawer.Root, {
                shouldScaleBackground: !1,
                open: ea,
                onOpenChange: ei,
                repositionInputs: !1,
                children: [(0, t.jsx)(k.Drawer.Trigger, {
                    asChild: !0,
                    children: (0, t.jsx)(N.TradingButton, {
                        color: "gray",
                        maxWidth: "48px",
                        children: (0, t.jsx)(C, {
                            className: "size-5 text-text"
                        })
                    })
                }), (0, t.jsxs)(k.Drawer.Portal, {
                    children: [(0, t.jsx)(k.Drawer.Overlay, {
                        onClick: () => ei(!1),
                        className: "fixed inset-0 bg-black/40 z-[calc(var(--z-drawer)+34)]"
                    }), (0, t.jsx)(k.Drawer.Content, {
                        className: "z-[calc(var(--z-drawer)+35)] fixed bottom-0 left-0 right-0 flex flex-col rounded-t-lg bg-background",
                        children: (0, t.jsx)(_.ConvertPositionsInternals, {})
                    })]
                })]
            }), Q[57] = ea, Q[58] = es, Q[59] = $) : $ = Q[59], Q[60] !== F || Q[61] !== $ ? (B = (0, t.jsxs)("div", {
                className: "flex flex-1 px-3 gap-2",
                children: [F, $]
            }), Q[60] = F, Q[61] = $, Q[62] = B) : B = Q[62], Q[63] !== ee ? (q = ee("trading.initialCost"), Q[63] = ee, Q[64] = q) : q = Q[64], Q[65] !== X.value.cost ? (V = "-" === X.value.cost ? "-" : (0, T.toUSCurrency)(X.value.cost), Q[65] = X.value.cost, Q[66] = V) : V = Q[66], Q[67] !== q || Q[68] !== V ? (H = (0, t.jsx)(L, {
                label: q,
                value: V
            }), Q[67] = q, Q[68] = V, Q[69] = H) : H = Q[69], Q[70] !== ee ? (U = ee("trading.payout"), Q[70] = ee, Q[71] = U) : U = Q[71], Q[72] !== X.sell.qty ? (W = (0, T.formatCurrency)(X.sell.qty, {
                decimals: 2
            }), Q[72] = X.sell.qty, Q[73] = W) : W = Q[73], Q[74] === Symbol.for("react.memo_cache_sentinel") ? (G = (0, t.jsx)(O, {}), Q[74] = G) : G = Q[74], Q[75] !== U || Q[76] !== W ? (Z = (0, t.jsx)(L, {
                label: U,
                value: W,
                valueColor: "var(--green-500)",
                align: "end",
                children: G
            }), Q[75] = U, Q[76] = W, Q[77] = Z) : Z = Q[77], Q[78] !== H || Q[79] !== Z ? (K = (0, t.jsxs)("div", {
                className: "flex w-full justify-between bg-border-secondary px-3 py-2 border-t border-border",
                children: [H, Z]
            }), Q[78] = H, Q[79] = Z, Q[80] = K) : K = Q[80], Q[81] !== D || Q[82] !== B || Q[83] !== K ? (Y = (0, t.jsxs)("div", {
                className: "flex flex-col w-full rounded-lg bg-background text-shade-black border border-border-secondary pt-3 gap-4 overflow-hidden",
                children: [D, B, K]
            }), Q[81] = D, Q[82] = B, Q[83] = K, Q[84] = Y) : Y = Q[84], Y
        };

    function R() {
        let e, a, i, n, s, o = (0, r.c)(16),
            l = (0, y.useTranslations)();
        o[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], o[0] = e) : e = o[0];
        let {
            authenticated: c
        } = (0, d.useAccountContext)(e), {
            setTradeState: u
        } = (0, b.useMobileTradeContext)(), {
            positions: p,
            subPositions: k,
            chainPositions: w
        } = (0, m.useMobileMarketPositionContext)();
        o[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["market"], o[1] = a) : a = o[1];
        let {
            market: S
        } = (0, x.useBookContext)(a), j = (0, f.useMarketBestPrices)(S);
        o[2] !== j || o[3] !== u ? (i = e => {
            u({
                type: "redeem",
                outcomeIdx: e.sell.outcomeIdx,
                open: !0,
                orderType: g.OrderType.Market,
                side: h.Side.SELL,
                ...j ? .[0 === e.sell.outcomeIdx ? "~zero" : "~one"] ? .sell && {
                    price: j[0 === e.sell.outcomeIdx ? "~zero" : "~one"].sell ? ? "0"
                },
                shares : e.sell.qty
            })
        }, o[2] = j, o[3] = u, o[4] = i) : i = o[4];
        let C = i,
            _ = p ? k : w;
        if (!c) return null;
        if (0 === _.length) {
            let e, r;
            return o[5] !== l ? (e = l("portfolio.messages.noPositionsFound"), o[5] = l, o[6] = e) : e = o[6], o[7] !== e ? (r = (0, t.jsx)(v.EmptyState, {
                message: e
            }), o[7] = e, o[8] = r) : r = o[8], r
        }
        if (o[9] !== _ || o[10] !== C) {
            let e;
            o[12] !== C ? (e = e => (0, t.jsx)(z, {
                position: e,
                onClick: C
            }, `position-${e.sell.outcome}`), o[12] = C, o[13] = e) : e = o[13], n = _.map(e), o[9] = _, o[10] = C, o[11] = n
        } else n = o[11];
        return o[14] !== n ? (s = (0, t.jsx)("div", {
            className: "flex w-full flex-col gap-4",
            children: n
        }), o[14] = n, o[15] = s) : s = o[15], s
    }
    let F = (0, n.default)(() => e.A(427769), {
            loadableGenerated: {
                modules: [276325]
            },
            ssr: !1
        }),
        $ = () => {
            let e, n, h, f, x, g, v, y, b, k, w, S, j, C, _ = (0, r.c)(42);
            _[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], _[0] = e) : e = _[0];
            let {
                authenticated: T
            } = (0, d.useAccountContext)(e), {
                hasSomeShares: M
            } = (0, m.useMobileMarketPositionContext)(), {
                market: N
            } = (0, u.useMobileMarketContext)(), I = (0, p.useSportsV2Enabled)(), {
                filledOrders: P,
                hasNextPage: E,
                fetchNextPage: A,
                isFetching: O
            } = (0, l.useFilledOrders)(), D = N ? .clobTokenIds, L = N ? .conditionId, z = N ? .orderPriceMinTickSize;
            _[1] !== D || _[2] !== L || _[3] !== z ? (n = {
                clobTokenIds: D,
                conditionId: L,
                orderPriceMinTickSize: z
            }, _[1] = D, _[2] = L, _[3] = z, _[4] = n) : n = _[4];
            let {
                userOpenOrders: $
            } = (0, c.default)(n), B = !M;
            _[5] !== B ? (h = {
                label: "Positions",
                value: "positions",
                disabled: B,
                order: 1
            }, _[5] = B, _[6] = h) : h = _[6];
            let q = !$.length;
            _[7] !== q ? (f = {
                label: "Orders",
                value: "orders",
                disabled: q,
                order: 2
            }, _[7] = q, _[8] = f) : f = _[8];
            let V = !P.length;
            _[9] !== V ? (x = {
                label: "History",
                value: "history",
                disabled: V,
                order: 3
            }, _[9] = V, _[10] = x) : x = _[10], _[11] !== x || _[12] !== h || _[13] !== f ? (g = [h, f, x], _[11] = x, _[12] = h, _[13] = f, _[14] = g) : g = _[14];
            let H = !M && !$.length && !P.length,
                U = M ? "positions" : $.length ? "orders" : P.length ? "history" : "positions";
            _[15] !== g || _[16] !== H || _[17] !== U ? (v = {
                tabs: g,
                allDisabled: H,
                initialTab: U
            }, _[15] = g, _[16] = H, _[17] = U, _[18] = v) : v = _[18];
            let {
                tabs: W,
                allDisabled: G,
                initialTab: Z
            } = v, [K, Y] = s.default.useState(Z);
            if (!T || G || I) return null;
            if (_[19] === Symbol.for("react.memo_cache_sentinel") ? (y = e => Y(e), _[19] = y) : y = _[19], _[20] !== K || _[21] !== W) {
                let e;
                _[23] !== K ? (e = e => (0, t.jsx)(a.Button, {
                    disabled: e.disabled,
                    variant: K === e.value ? "default" : "secondary",
                    size: "sm",
                    className: "flex-1 text-sm h-10",
                    onClick: () => Y(e.value),
                    children: e.label
                }, e.value), _[23] = K, _[24] = e) : e = _[24], b = W.map(e), _[20] = K, _[21] = W, _[22] = b
            } else b = _[22];
            return _[25] !== b ? (k = (0, t.jsx)(i.TabsList, {
                variant: "highlight",
                wrapperClassName: "my-4",
                className: "w-full h-10 gap-2 bg-transparent",
                children: b
            }), _[25] = b, _[26] = k) : k = _[26], _[27] === Symbol.for("react.memo_cache_sentinel") ? (w = (0, t.jsx)(i.TabsContent, {
                value: "positions",
                className: "w-full",
                children: (0, t.jsx)(R, {})
            }), _[27] = w) : w = _[27], _[28] !== N || _[29] !== $ ? (S = (0, t.jsx)(i.TabsContent, {
                value: "orders",
                className: "w-full",
                children: (0, t.jsx)(F, {
                    market: N,
                    openOrders: $,
                    bodyClassName: "px-0",
                    headerClassName: "p-0 h-8! items-end [&>h1]:h-8! [&>h1]:text-xl [&>h1]:font-semibold [&>h1]:leading-[1.75]!"
                })
            }), _[28] = N, _[29] = $, _[30] = S) : S = _[30], _[31] !== A || _[32] !== P || _[33] !== E || _[34] !== O || _[35] !== N ? (j = (0, t.jsx)(i.TabsContent, {
                value: "history",
                className: "w-full",
                children: (0, t.jsx)(o.default, {
                    filledOrders: P,
                    hasNextPage: E,
                    fetchNextPage: A,
                    isFetchingNextPage: O,
                    isAuthenticated: !0,
                    containerClassName: "mt-4 z-[999999]",
                    activeMarket: N
                })
            }), _[31] = A, _[32] = P, _[33] = E, _[34] = O, _[35] = N, _[36] = j) : j = _[36], _[37] !== K || _[38] !== k || _[39] !== S || _[40] !== j ? (C = (0, t.jsxs)(i.Tabs, {
                value: K,
                onValueChange: y,
                children: [k, w, S, j]
            }), _[37] = K, _[38] = k, _[39] = S, _[40] = j, _[41] = C) : C = _[41], C
        };
    e.s(["MobileSmpViewHeader", () => eK], 272436);
    var B = e.i(100825),
        q = e.i(399841),
        V = e.i(6204),
        H = e.i(488758),
        U = e.i(896414);
    let W = () => {
        let e, a = (0, r.c)(3),
            {
                market: i
            } = (0, u.useMobileMarketContext)(),
            n = i.groupItemTitle ? ? i.question;
        return a[0] !== i.image || a[1] !== n ? (e = (0, t.jsx)("div", {
            className: "flex w-full items-center bg-background pb-4",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 items-center",
                children: (0, t.jsx)(U.MarketImage, {
                    image: i.image,
                    marketName: n,
                    size: 40,
                    containerClassName: "rounded-sm overflow-hidden"
                })
            })
        }), a[0] = i.image, a[1] = n, a[2] = e) : e = a[2], e
    };
    e.s(["GameScoreCenter", () => ez, "GameScoreboardV2", () => eq, "NotStartedGameCenter", () => eL, "TeamDisplay", () => eF, "TennisGameHeader", () => eB, "getGameDate", () => eI, "getTeamDisplay", () => eD, "getTennisPlayerName", () => e$, "parseEventScore", () => eP, "resolveGameState", () => eE], 269324);
    var G = e.i(755330),
        Z = e.i(918007);

    function K(e) {
        let a, i, n, s = (0, r.c)(5),
            {
                volume: o
            } = e;
        return s[0] !== o ? (a = (0, t.jsx)("span", {
            className: "text-body-sm font-semibold text-text-secondary whitespace-nowrap",
            children: o
        }), s[0] = o, s[1] = a) : a = s[1], s[2] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(Z.PolymarketLogoFull, {
            className: "h-5 w-auto text-neutral-300"
        }), s[2] = i) : i = s[2], s[3] !== a ? (n = (0, t.jsxs)("div", {
            className: "flex items-center justify-between px-1",
            children: [a, i]
        }), s[3] = a, s[4] = n) : n = s[4], n
    }
    var Y = e.i(208956);

    function Q(e) {
        let a, i, n, s, o, l, c = (0, r.c)(21),
            {
                abbrev: d,
                logo: u,
                showTeamName: m,
                href: p
            } = e;
        c[0] !== d || c[1] !== u ? (a = (0, t.jsx)("div", {
            className: "relative size-12 rounded-md overflow-hidden flex items-center justify-center",
            children: u ? (0, t.jsx)(S.default, {
                src: u,
                alt: d,
                fill: !0,
                sizes: "48px",
                className: "object-contain"
            }) : (0, t.jsx)("div", {
                className: "size-12 rounded-md bg-neutral-200"
            })
        }), c[0] = d, c[1] = u, c[2] = a) : a = c[2];
        let h = m ? "text-sm sm:text-base" : "text-base",
            f = p && "group-hover/team:underline underline-offset-4 decoration-neutral-200";
        c[3] !== h || c[4] !== f ? (i = (0, I.cn)("block w-full text-center leading-tight text-neutral-800 font-medium break-normal", h, f), c[3] = h, c[4] = f, c[5] = i) : i = c[5], c[6] !== d || c[7] !== m ? (n = m ? d : d.toUpperCase(), c[6] = d, c[7] = m, c[8] = n) : n = c[8], c[9] !== i || c[10] !== n ? (s = (0, t.jsx)("span", {
            className: i,
            children: n
        }), c[9] = i, c[10] = n, c[11] = s) : s = c[11], c[12] !== a || c[13] !== s ? (o = (0, t.jsxs)(t.Fragment, {
            children: [a, s]
        }), c[12] = a, c[13] = s, c[14] = o) : o = c[14];
        let x = o;
        if (p) {
            let e, r;
            return c[15] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, I.cn)("flex flex-1 min-w-0 flex-col items-center gap-3", "group/team"), c[15] = e) : e = c[15], c[16] !== x || c[17] !== p ? (r = (0, t.jsx)(Y.default, {
                href: p,
                className: e,
                children: x
            }), c[16] = x, c[17] = p, c[18] = r) : r = c[18], r
        }
        return c[19] !== x ? (l = (0, t.jsx)("div", {
            className: "flex flex-1 min-w-0 flex-col items-center gap-3",
            children: x
        }), c[19] = x, c[20] = l) : l = c[20], l
    }

    function X(e) {
        let a, i, n, s = (0, r.c)(6),
            {
                timeLabel: o
            } = e;
        return s[0] !== o ? (a = "flex flex-col items-center gap-3", i = o.split("\n").map(J), s[0] = o, s[1] = a, s[2] = i) : (a = s[1], i = s[2]), s[3] !== a || s[4] !== i ? (n = (0, t.jsx)("div", {
            className: a,
            children: i
        }), s[3] = a, s[4] = i, s[5] = n) : n = s[5], n
    }

    function J(e, r) {
        return (0, t.jsx)("span", {
            className: (0, I.cn)("text-sm font-medium", 0 === r ? "text-text-primary" : "text-text-secondary"),
            children: e
        }, e)
    }

    function ee(e) {
        let a, i, n, s, o, l, c, d, u = (0, r.c)(20),
            {
                homeScore: m,
                awayScore: p,
                label: h,
                isFinished: f,
                isLive: x
            } = e,
            g = f && m < p,
            v = f && p < m,
            y = g && "text-neutral-300";
        u[0] !== y ? (a = (0, I.cn)("text-[2rem] font-medium tabular-nums", y), u[0] = y, u[1] = a) : a = u[1], u[2] !== m || u[3] !== a ? (i = (0, t.jsx)("div", {
            className: "flex flex-col items-end gap-1",
            children: (0, t.jsx)("span", {
                className: a,
                children: m
            })
        }), u[2] = m, u[3] = a, u[4] = i) : i = u[4], u[5] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)("span", {
            className: "w-3 h-1 rounded-full bg-neutral-200 mb-5"
        }), u[5] = n) : n = u[5];
        let b = v && "text-neutral-300";
        return u[6] !== b ? (s = (0, I.cn)("text-[2rem] font-medium tabular-nums", b), u[6] = b, u[7] = s) : s = u[7], u[8] !== p || u[9] !== s ? (o = (0, t.jsx)("div", {
            className: "flex flex-col items-start gap-1",
            children: (0, t.jsx)("span", {
                className: s,
                children: p
            })
        }), u[8] = p, u[9] = s, u[10] = o) : o = u[10], u[11] !== i || u[12] !== o ? (l = (0, t.jsxs)("div", {
            className: "grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-end gap-3",
            children: [i, n, o]
        }), u[11] = i, u[12] = o, u[13] = l) : l = u[13], u[14] !== x || u[15] !== h ? (c = x ? (0, t.jsxs)("div", {
            className: "flex items-center gap-2 text-sm font-semibold text-red-500 whitespace-nowrap mb-0.5",
            children: [(0, t.jsx)("span", {
                children: "LIVE"
            }), (0, t.jsxs)("div", {
                className: "relative flex items-center justify-center shrink-0",
                children: [(0, t.jsx)("div", {
                    className: "size-[5px] rounded-full bg-red-500 relative z-10"
                }), (0, t.jsx)("div", {
                    className: "absolute -inset-px size-[7px] rounded-full bg-red-500 opacity-75 animate-ping"
                })]
            }), (0, t.jsx)("span", {
                className: "font-medium",
                children: h
            })]
        }) : (0, t.jsx)("span", {
            className: "text-sm text-text-secondary",
            children: h
        }), u[14] = x, u[15] = h, u[16] = c) : c = u[16], u[17] !== l || u[18] !== c ? (d = (0, t.jsxs)("div", {
            className: "flex flex-col items-center gap-3",
            children: [l, c]
        }), u[17] = l, u[18] = c, u[19] = d) : d = u[19], d
    }

    function et(e) {
        let a, i, n, s, o, l, c, d, u, m, p, h, f = (0, r.c)(49),
            {
                homeTeam: x,
                awayTeam: g,
                homeScore: v,
                awayScore: y,
                status: b,
                timeLabel: k,
                showTeamName: w,
                hideScore: S,
                topSlot: j,
                className: C
            } = e,
            _ = void 0 !== w && w,
            T = void 0 !== S && S,
            M = "live" === b,
            N = "finished" === b,
            P = !T && (M || N);
        f[0] !== C ? (a = (0, I.cn)("flex flex-col items-center gap-6 mb-4", C), f[0] = C, f[1] = a) : a = f[1];
        let E = M && !T ? "gap-6 sm:gap-8 md:gap-16" : "gap-4 sm:gap-6 md:gap-8",
            A = P ? "items-start" : "items-center";
        f[2] !== E || f[3] !== A ? (i = (0, I.cn)("flex justify-center w-full", E, A), f[2] = E, f[3] = A, f[4] = i) : i = f[4];
        let O = x.fullName && _ ? x.fullName : x.abbreviation;
        f[5] !== x.href || f[6] !== x.logo || f[7] !== _ || f[8] !== O ? (n = (0, t.jsx)(Q, {
            abbrev: O,
            logo: x.logo,
            showTeamName: _,
            href: x.href
        }), f[5] = x.href, f[6] = x.logo, f[7] = _, f[8] = O, f[9] = n) : n = f[9];
        let D = P && "pt-2";
        f[10] !== D ? (s = (0, I.cn)("flex flex-col items-center gap-1 w-[140px] shrink-0", D), f[10] = D, f[11] = s) : s = f[11], f[12] !== b || f[13] !== k ? (o = "not_started" === b && (0, t.jsx)(X, {
            timeLabel: k
        }), f[12] = b, f[13] = k, f[14] = o) : o = f[14], f[15] !== b ? (l = "postponed" === b && (0, t.jsx)("span", {
            className: "text-text-secondary text-sm font-semibold",
            children: "Postponed"
        }), f[15] = b, f[16] = l) : l = f[16], f[17] !== y || f[18] !== T || f[19] !== v || f[20] !== M || f[21] !== k ? (c = M && (T ? (0, t.jsx)(er, {
            label: k
        }) : (0, t.jsx)(ee, {
            homeScore: v,
            awayScore: y,
            label: k,
            isLive: !0
        })), f[17] = y, f[18] = T, f[19] = v, f[20] = M, f[21] = k, f[22] = c) : c = f[22], f[23] !== y || f[24] !== T || f[25] !== v || f[26] !== N || f[27] !== k ? (d = N && (T ? (0, t.jsx)("span", {
            className: "text-sm text-text-secondary",
            children: k
        }) : (0, t.jsx)(ee, {
            homeScore: v,
            awayScore: y,
            label: k,
            isFinished: !0
        })), f[23] = y, f[24] = T, f[25] = v, f[26] = N, f[27] = k, f[28] = d) : d = f[28], f[29] !== s || f[30] !== o || f[31] !== l || f[32] !== c || f[33] !== d ? (u = (0, t.jsxs)("div", {
            className: s,
            children: [o, l, c, d]
        }), f[29] = s, f[30] = o, f[31] = l, f[32] = c, f[33] = d, f[34] = u) : u = f[34];
        let L = g.fullName && _ ? g.fullName : g.abbreviation;
        return f[35] !== g.href || f[36] !== g.logo || f[37] !== _ || f[38] !== L ? (m = (0, t.jsx)(Q, {
            abbrev: L,
            logo: g.logo,
            showTeamName: _,
            href: g.href
        }), f[35] = g.href, f[36] = g.logo, f[37] = _, f[38] = L, f[39] = m) : m = f[39], f[40] !== u || f[41] !== m || f[42] !== i || f[43] !== n ? (p = (0, t.jsx)("div", {
            className: "flex flex-col items-center gap-4",
            children: (0, t.jsxs)("div", {
                className: i,
                children: [n, u, m]
            })
        }), f[40] = u, f[41] = m, f[42] = i, f[43] = n, f[44] = p) : p = f[44], f[45] !== p || f[46] !== a || f[47] !== j ? (h = (0, t.jsxs)("div", {
            className: a,
            children: [j, p]
        }), f[45] = p, f[46] = a, f[47] = j, f[48] = h) : h = f[48], h
    }

    function er(e) {
        let a, i, n, s = (0, r.c)(4),
            {
                label: o
            } = e;
        return s[0] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)("span", {
            children: "LIVE"
        }), s[0] = a) : a = s[0], s[1] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 text-sm font-semibold text-red-500 whitespace-nowrap",
            children: [a, (0, t.jsxs)("div", {
                className: "relative flex items-center justify-center shrink-0",
                children: [(0, t.jsx)("div", {
                    className: "size-[7px] rounded-full bg-red-500 relative z-10"
                }), (0, t.jsx)("div", {
                    className: "absolute -inset-px size-[9px] rounded-full bg-red-500 opacity-75 animate-ping"
                })]
            })]
        }), s[1] = i) : i = s[1], s[2] !== o ? (n = (0, t.jsxs)("div", {
            className: "flex flex-col items-center gap-3",
            children: [i, (0, t.jsx)("span", {
                className: "text-sm text-text-secondary",
                children: o
            })]
        }), s[2] = o, s[3] = n) : n = s[3], n
    }

    function ea(e) {
        let a, i, n, s, o, l = (0, r.c)(7),
            {
                className: c
            } = e;
        return l[0] !== c ? (a = (0, I.cn)("flex items-center gap-3 w-full", c), l[0] = c, l[1] = a) : a = l[1], l[2] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)("div", {
            className: "flex-1 h-px bg-neutral-100"
        }), n = (0, t.jsx)(Z.PolymarketLogoFull, {
            className: "h-4 w-auto text-neutral-300"
        }), s = (0, t.jsx)("div", {
            className: "flex-1 h-px bg-neutral-100"
        }), l[2] = i, l[3] = n, l[4] = s) : (i = l[2], n = l[3], s = l[4]), l[5] !== a ? (o = (0, t.jsxs)("div", {
            className: a,
            children: [i, n, s]
        }), l[5] = a, l[6] = o) : o = l[6], o
    }
    var ei = e.i(434360),
        en = e.i(491636),
        es = e.i(390960),
        eo = e.i(662855),
        el = e.i(864006),
        ec = e.i(909838),
        ed = e.i(371124),
        eu = e.i(909420),
        em = e.i(593332),
        ep = e.i(476979),
        eh = e.i(333255),
        ef = e.i(411622),
        ex = e.i(554637);

    function eg(e, t) {
        let r = e ? (0, eu.getTeam)({
                market: e
            }) : void 0,
            a = t ? (0, eu.getTeam)({
                market: t
            }) : void 0,
            i = r ? .color,
            n = a ? .color,
            s = r ? .alias ? .toLowerCase() || r ? .abbreviation ? .toLowerCase() || r ? .name ? .toLowerCase() || "team-0",
            o = a ? .alias ? .toLowerCase() || a ? .abbreviation ? .toLowerCase() || a ? .name ? .toLowerCase() || "team-1",
            l = [i ? {
                id: s,
                color: i,
                index: 0
            } : null, n ? {
                id: o,
                color: n,
                index: 1
            } : null].filter(Boolean);
        if (0 !== l.length) return [...l, {
            id: "draw",
            color: "var(--color-neutral-500)",
            index: 2
        }]
    }

    function ev(e) {
        if (!e.teams || e.teams.length < 2) return;
        let t = e.teams.map((t, r) => {
            let a = (0, eu.getTeam)({
                market: e,
                outcomeIndex: r
            });
            if (!a) return null;
            let i = (0, ex.getSportsButtonColor)({
                team: a
            });
            return i.customColors ? .backgroundColor ? {
                id: a.alias ? .toLowerCase() || `team-${r}`,
                color: i.customColors.backgroundColor,
                index: r
            } : null
        }).filter(Boolean);
        if (0 !== t.length) return t
    }

    function ey(e) {
        return e.map(e => {
            if ("draw" === e.negRiskSportsMarketType) return { ...e,
                sortKey: 2,
                groupItemTitle: "Draw",
                showGmpSeries: !0,
                seriesColor: "draw"
            };
            let t = "home" === e.negRiskSportsMarketType,
                r = (0, eu.getTeam)({
                    market: e
                });
            return { ...e,
                sortKey: t ? 1 : 3,
                groupItemTitle: r ? .alias || e.groupItemTitle,
                showGmpSeries: !0,
                seriesColor: r ? .alias ? .toLowerCase() || r ? .abbreviation ? .toLowerCase() || r ? .name ? .toLowerCase() || (t ? "team-0" : "team-1")
            }
        }).sort((e, t) => e.sortKey - t.sortKey)
    }

    function eb(e, t) {
        let r = (0, eu.getTeam)({
                market: e,
                outcomeIndex: 0
            }),
            a = (0, eu.getTeam)({
                market: e,
                outcomeIndex: 1
            });
        return [{ ...e,
            sortKey: 1,
            index: 0,
            groupItemTitle: r ? .alias || e.outcomes[0],
            showGmpSeries: !0,
            seriesColor: t ? .find(e => 0 === e.index) ? .id
        }, { ...e,
            sortKey: 2,
            index: 1,
            groupItemTitle: a ? .alias || e.outcomes[1],
            outcomes: e.outcomes.toReversed(),
            outcomePrices: e.outcomePrices.toReversed(),
            ...Array.isArray(e.clobTokenIds) && {
                clobTokenIds: [e.clobTokenIds[1], e.clobTokenIds[0]]
            },
            showGmpSeries: !0,
            bestAsk: e.bestAsk ? 1 - e.bestAsk : null,
            bestBid: e.bestBid ? 1 - e.bestBid : null,
            lastTradePrice: e.lastTradePrice ? 1 - e.lastTradePrice : null,
            seriesColor: t ? .find(e => 1 === e.index) ? .id
        }]
    }
    e.s(["getBinaryChartMarkets", 0, eb, "getBinaryColors", 0, ev, "getNegRiskChartMarkets", 0, ey, "getNegRiskColors", 0, eg], 507670);
    var ek = e.i(982214),
        ew = e.i(12884),
        eS = e.i(944891),
        ej = e.i(631222),
        eC = e.i(289981);

    function e_(e) {
        return e === em.GameState.Live ? "live" : e === em.GameState.Finished ? "finished" : e === em.GameState.Postponed ? "postponed" : "not_started"
    }
    let eT = ["youtube.com", "www.youtube.com", "m.youtube.com"],
        eM = ["twitch.tv", "www.twitch.tv"],
        eN = ["kick.com", "www.kick.com"];

    function eI(e, t) {
        if (e) {
            let t = new Date(e);
            if (!Number.isNaN(t.getTime())) return t
        }
        if (t) {
            let e = new Date(t);
            if (!Number.isNaN(e.getTime())) return e
        }
        return new Date
    }

    function eP(e) {
        if (!e) return [0, 0];
        let t = e.split("-");
        if (t.length < 2) return [0, 0];
        let r = parseInt(t[0], 10),
            a = parseInt(t[1], 10);
        return [Number.isNaN(r) ? 0 : r, Number.isNaN(a) ? 0 : a]
    }

    function eE(e, t, r) {
        return t.closed || r && t.markets ? .some(e => e.closed) ? em.GameState.Finished : e || ("POST" === t.period ? em.GameState.Postponed : t.ended ? em.GameState.Finished : t.live ? em.GameState.Live : em.GameState.NotStarted)
    }
    let eA = Object.fromEntries(Object.values(eh.GAME_CONFIGS).map(e => [e.gammaLeague, e.gameSlug]));

    function eO(e) {
        if (!e ? .league) return;
        let t = eA[e.league];
        if (!t) return;
        let r = (0, ef.slugifyTeamName)(e.name ? ? "", e.abbreviation ? ? "");
        if (r) return `/teams/${t}/${r}`
    }

    function eD(e, t) {
        let r = e ? (0, eu.getTeam)({
            market: e
        }) : t;
        return {
            abbrev: r ? .alias ? ? (r ? .name || "TBD"),
            logo: r ? .logo || "",
            href: eO(r)
        }
    }
    let eL = e => {
            let a, i, n, s, o, l, c, d = (0, r.c)(15),
                {
                    gameDate: u
                } = e,
                m = (0, el.useLocale)();
            if (d[0] !== u || d[1] !== m) {
                let e = {
                    locale: (0, es.getDateFnsLocale)(m)
                };
                s = "flex flex-col items-center gap-3", o = (0, t.jsx)("span", {
                    className: "text-text-primary text-sm font-medium",
                    suppressHydrationWarning: !0,
                    children: (0, en.format)(u, "p", e)
                }), a = "text-text-secondary text-sm font-medium", i = !0, n = (0, en.format)(u, "MMMM d", e), d[0] = u, d[1] = m, d[2] = a, d[3] = i, d[4] = n, d[5] = s, d[6] = o
            } else a = d[2], i = d[3], n = d[4], s = d[5], o = d[6];
            return d[7] !== a || d[8] !== i || d[9] !== n ? (l = (0, t.jsx)("span", {
                className: a,
                suppressHydrationWarning: i,
                children: n
            }), d[7] = a, d[8] = i, d[9] = n, d[10] = l) : l = d[10], d[11] !== s || d[12] !== o || d[13] !== l ? (c = (0, t.jsxs)("div", {
                className: s,
                children: [o, l]
            }), d[11] = s, d[12] = o, d[13] = l, d[14] = c) : c = d[14], c
        },
        ez = e => {
            let a, i, n, s, o, l, c, d, u = (0, r.c)(21),
                {
                    homeScore: m,
                    awayScore: p,
                    label: h,
                    isFinished: f,
                    isLive: x
                } = e,
                g = (0, y.useTranslations)(),
                v = f && m < p,
                b = f && p < m,
                k = v && "text-neutral-300";
            u[0] !== k ? (a = (0, D.cn)("text-[2rem] font-medium tabular-nums", k), u[0] = k, u[1] = a) : a = u[1], u[2] !== m || u[3] !== a ? (i = (0, t.jsx)("div", {
                className: "flex flex-col items-end gap-1",
                children: (0, t.jsx)("span", {
                    className: a,
                    children: m
                })
            }), u[2] = m, u[3] = a, u[4] = i) : i = u[4], u[5] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)("span", {
                className: "w-3 h-1 rounded-full bg-neutral-200 mb-5"
            }), u[5] = n) : n = u[5];
            let w = b && "text-neutral-300";
            return u[6] !== w ? (s = (0, D.cn)("text-[2rem] font-medium tabular-nums", w), u[6] = w, u[7] = s) : s = u[7], u[8] !== p || u[9] !== s ? (o = (0, t.jsx)("div", {
                className: "flex flex-col items-start gap-1",
                children: (0, t.jsx)("span", {
                    className: s,
                    children: p
                })
            }), u[8] = p, u[9] = s, u[10] = o) : o = u[10], u[11] !== i || u[12] !== o ? (l = (0, t.jsxs)("div", {
                className: "grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-end gap-3",
                children: [i, n, o]
            }), u[11] = i, u[12] = o, u[13] = l) : l = u[13], u[14] !== x || u[15] !== h || u[16] !== g ? (c = x ? (0, t.jsxs)("div", {
                className: "flex items-center gap-2 text-sm font-semibold text-red-500 whitespace-nowrap mb-0.5",
                children: [(0, t.jsx)("span", {
                    className: "uppercase",
                    children: g("sports.live")
                }), (0, t.jsxs)("div", {
                    className: "relative flex items-center justify-center shrink-0",
                    children: [(0, t.jsx)("div", {
                        className: "size-[5px] rounded-full bg-red-500 relative z-10"
                    }), (0, t.jsx)("div", {
                        className: "absolute -inset-px size-[7px] rounded-full bg-red-500 opacity-75 animate-ping"
                    })]
                }), (0, t.jsx)("span", {
                    className: "font-medium",
                    children: h
                })]
            }) : (0, t.jsx)("span", {
                className: "text-sm text-text-secondary",
                children: h
            }), u[14] = x, u[15] = h, u[16] = g, u[17] = c) : c = u[17], u[18] !== l || u[19] !== c ? (d = (0, t.jsxs)("div", {
                className: "flex flex-col items-center gap-3",
                children: [l, c]
            }), u[18] = l, u[19] = c, u[20] = d) : d = u[20], d
        },
        eR = () => {
            let e, a, i, n, s, o, l, c = (0, r.c)(17),
                d = (0, y.useTranslations)();
            c[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], c[0] = e) : e = c[0];
            let {
                event: u
            } = (0, M.useEventContext)(e), {
                isEsports: m
            } = (0, H.useSportsItemContext)(), {
                startStreaming: p,
                isStreaming: h,
                stream: f
            } = (0, G.useLivestream)();
            c[1] !== u.resolutionSource ? (a = function(e) {
                let t;
                if (!e) return;
                try {
                    t = new URL(e)
                } catch {
                    return
                }
                if ("https:" !== t.protocol) return;
                let r = t.hostname.toLowerCase();
                if (eT.includes(r)) {
                    let e;
                    if (t.pathname.startsWith("/watch") ? e = t.searchParams.get("v") ? ? void 0 : t.pathname.startsWith("/embed/") ? e = t.pathname.split("/").filter(Boolean)[1] : t.pathname.startsWith("/live/") && (e = t.pathname.split("/").filter(Boolean)[1]), !e) return;
                    return {
                        id: e,
                        type: "iframe",
                        src: `https://www.youtube.com/embed/${e}?autoplay=1`,
                        site: "youtube"
                    }
                }
                if (eM.includes(r)) {
                    let e = t.pathname.split("/").filter(Boolean)[0];
                    if (!e) return;
                    let r = new URL(ej.CURRENT_ORIGIN).hostname;
                    return {
                        id: e,
                        type: "iframe",
                        src: `https://player.twitch.tv/?channel=${e}&parent=${r}`,
                        site: "twitch"
                    }
                }
                if (eN.includes(r)) {
                    let e = t.pathname.split("/").filter(Boolean)[0];
                    if (!e) return;
                    return {
                        id: e,
                        type: "iframe",
                        src: `https://player.kick.com/${e}`,
                        site: "kick"
                    }
                }
            }(u.resolutionSource), c[1] = u.resolutionSource, c[2] = a) : a = c[2];
            let x = a,
                g = h && f && f.id === x ? .id && f.site === x ? .site;
            if (m || !x) return null;
            c[3] !== p || c[4] !== x ? (i = e => {
                e.preventDefault(), e.stopPropagation(), p(x)
            }, c[3] = p, c[4] = x, c[5] = i) : i = c[5];
            let v = g ? "text-text-secondary" : "text-red-500";
            c[6] !== v ? (n = (0, D.cn)("shrink-0", v), c[6] = v, c[7] = n) : n = c[7];
            let b = !g;
            return c[8] !== n || c[9] !== b ? (s = (0, t.jsx)(eo.Radio, {
                size: 12,
                className: n,
                enabled: b
            }), c[8] = n, c[9] = b, c[10] = s) : s = c[10], c[11] !== d ? (o = d("events.videoEmbed.watchStream"), c[11] = d, c[12] = o) : o = c[12], c[13] !== i || c[14] !== s || c[15] !== o ? (l = (0, t.jsxs)("button", {
                type: "button",
                onClick: i,
                className: "px-2 py-1 text-xs font-medium text-text-secondary hover:text-text-tertiary rounded-lg cursor-pointer flex items-center gap-1 whitespace-nowrap border border-neutral-200 hover:bg-neutral-50 scale-95 active:scale-90 transition duration-300",
                children: [s, o]
            }), c[13] = i, c[14] = s, c[15] = o, c[16] = l) : l = c[16], l
        },
        eF = e => {
            let a, i, n, s, o, l = (0, r.c)(17),
                {
                    abbrev: c,
                    logo: d,
                    href: u
                } = e;
            l[0] !== c || l[1] !== d ? (a = (0, t.jsx)("div", {
                className: "relative size-12 rounded-md overflow-hidden flex items-center justify-center",
                children: (0, t.jsx)(S.default, {
                    src: d,
                    alt: c,
                    fill: !0,
                    sizes: "48px",
                    className: "object-contain"
                })
            }), l[0] = c, l[1] = d, l[2] = a) : a = l[2];
            let m = u && "group-hover/team:underline underline-offset-4 decoration-neutral-200";
            l[3] !== m ? (i = (0, D.cn)("block w-full text-center leading-tight text-neutral-800 font-medium break-normal text-sm sm:text-base", m), l[3] = m, l[4] = i) : i = l[4], l[5] !== c || l[6] !== i ? (n = (0, t.jsx)("span", {
                className: i,
                children: c
            }), l[5] = c, l[6] = i, l[7] = n) : n = l[7], l[8] !== a || l[9] !== n ? (s = (0, t.jsxs)(t.Fragment, {
                children: [a, n]
            }), l[8] = a, l[9] = n, l[10] = s) : s = l[10];
            let p = s;
            if (u) {
                let e, r;
                return l[11] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, D.cn)("flex flex-1 min-w-0 flex-col items-center gap-3", "group/team relative"), l[11] = e) : e = l[11], l[12] !== p || l[13] !== u ? (r = (0, t.jsx)(Y.default, {
                    href: u,
                    className: e,
                    onClick: eV,
                    children: p
                }), l[12] = p, l[13] = u, l[14] = r) : r = l[14], r
            }
            return l[15] !== p ? (o = (0, t.jsx)("div", {
                className: "flex flex-1 min-w-0 flex-col items-center gap-3",
                children: p
            }), l[15] = p, l[16] = o) : o = l[16], o
        };

    function e$(e) {
        return (0, ei.formatTennisPlayerName)({
            name: e ? .name,
            abbreviation: e ? .abbreviation
        })
    }
    let eB = e => {
            let a, i, n, s, o, l = (0, r.c)(22),
                {
                    homeTeam: c,
                    awayTeam: d,
                    gameState: u,
                    timeLabel: m,
                    gameDate: p,
                    event: h,
                    showHeader: f,
                    showCurrentGamePoints: x,
                    showLiveCurrentSetPlaceholder: g
                } = e,
                v = void 0 === f || f,
                b = void 0 !== x && x,
                k = void 0 !== g && g,
                w = (0, y.useTranslations)();
            l[0] !== u ? (a = e_(u), l[0] = u, l[1] = a) : a = l[1];
            let S = h.score,
                j = h.period,
                C = u === em.GameState.Live;
            return l[2] !== w ? (i = w("sports.live"), l[2] = w, l[3] = i) : i = l[3], l[4] !== w ? (n = w("sports.postponed"), l[4] = w, l[5] = n) : n = l[5], l[6] !== v ? (s = v ? (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsxs)("div", {
                    className: "flex items-center gap-3 w-full",
                    children: [(0, t.jsx)("div", {
                        className: "flex-1 h-px bg-neutral-100"
                    }), (0, t.jsx)(Z.PolymarketLogoFull, {
                        className: "h-4 w-auto text-neutral-300"
                    }), (0, t.jsx)("div", {
                        className: "flex-1 h-px bg-neutral-100"
                    })]
                }), (0, t.jsx)(eR, {})]
            }) : void 0, l[6] = v, l[7] = s) : s = l[7], l[8] !== d || l[9] !== h.period || l[10] !== h.score || l[11] !== p || l[12] !== c || l[13] !== b || l[14] !== k || l[15] !== s || l[16] !== a || l[17] !== C || l[18] !== i || l[19] !== n || l[20] !== m ? (o = (0, t.jsx)(ei.TennisScoreboard, {
                homeTeam: c,
                awayTeam: d,
                status: a,
                score: S,
                period: j,
                live: C,
                timeLabel: m,
                gameDate: p,
                liveLabel: i,
                postponedLabel: n,
                showCurrentGamePoints: b,
                showLiveCurrentSetPlaceholder: k,
                topSlot: s
            }), l[8] = d, l[9] = h.period, l[10] = h.score, l[11] = p, l[12] = c, l[13] = b, l[14] = k, l[15] = s, l[16] = a, l[17] = C, l[18] = i, l[19] = n, l[20] = m, l[21] = o) : o = l[21], o
        },
        eq = e => {
            let a, i, n, s, o, l, c, d, u, m = (0, r.c)(28);
            m[0] !== e ? (a = void 0 === e ? {} : e, m[0] = e, m[1] = a) : a = m[1];
            let {
                showTimeWindows: p,
                contentSlot: h,
                mobileControlsSlot: f
            } = a, x = void 0 !== p && p, g = (0, el.useLocale)(), v = {
                locale: (0, es.getDateFnsLocale)(g)
            };
            m[2] === Symbol.for("react.memo_cache_sentinel") ? (i = ["event"], m[2] = i) : i = m[2];
            let {
                event: y
            } = (0, M.useEventContext)(i);
            m[3] === Symbol.for("react.memo_cache_sentinel") ? (n = ["gameState", "time", "score"], m[3] = n) : n = m[3];
            let {
                gameState: b,
                time: k,
                score: w
            } = (0, B.useSportsGameSelector)(y.slug, n), {
                isTennis: S,
                isUFC: j,
                isEsports: C,
                sportId: _
            } = (0, H.useSportsItemContext)(), {
                time: N
            } = (0, ed.useElapsedTime)(y.slug), I = (0, B.useScores)(y.slug);
            if (m[4] !== y.markets || m[5] !== y.volume) {
                let e = (0, eC.getGameLinesVolume)(y.markets, y.volume);
                s = e ? `${(0,T.formatAbbreviated)(e,{decimals:2,currency:!0})} Vol.` : "$0.00 Vol.", m[4] = y.markets, m[5] = y.volume, m[6] = s
            } else s = m[6];
            let P = s,
                E = eI(y.startTime, k),
                A = y.markets.find(eH);
            if (!A ? .clobTokenIds ? .length) return null;
            let O = y.markets.filter(eU),
                D = !!y.negRisk && 3 === O.length,
                L = eE(b, y, D),
                z = L === em.GameState.Finished && (y.closed || y.ended || A.closed),
                R = 0 === I[0] && 0 === I[1] && z ? eP(y.score) : I,
                F = D ? O.find(eW) : void 0,
                $ = D ? O.find(eG) : void 0,
                q = D ? eg(F, $) : ev(A),
                V = D ? ey(O) : eb(A, q),
                U = w || y.score;
            m[7] !== j || m[8] !== U ? (o = j ? function(e) {
                let t;
                if (!e) return {
                    winner: void 0,
                    method: void 0
                };
                let [r, a] = e.split("|"), [i, n] = r ? .split("-").map(Number) ? ? [];
                Number.isFinite(i) && Number.isFinite(n) && (i > n ? t = "home" : n > i && (t = "away"));
                let s = a ? .replace(/\s+/g, " ").trim();
                if (s ? .includes("Decision")) {
                    let [e, r] = s.split("-");
                    return e && r ? {
                        winner: t,
                        method: `${r} ${e}`
                    } : {
                        winner: t,
                        method: void 0
                    }
                }
                return {
                    winner: t,
                    method: a ? .trim()
                }
            }(U ? ? void 0) ? .method : void 0, m[7] = j, m[8] = U, m[9] = o) : o = m[9];
            let W = o,
                G = "nfl-sea-ne-2026-02-08" === y.slug,
                Z = D ? F : void 0,
                Y = D ? $ : void 0,
                Q = (0, eu.getTeam)({
                    market: A,
                    outcomeIndex: 0
                }),
                X = (0, eu.getTeam)({
                    market: A,
                    outcomeIndex: 1
                }),
                J = G ? {
                    abbrev: "SEA",
                    logo: "/seattle.svg",
                    href: void 0
                } : eD(Z, Q),
                ee = G ? {
                    abbrev: "NE",
                    logo: "/patriots.svg",
                    href: void 0
                } : eD(Y, X),
                er = A.gameStartTime ? ? void 0,
                ei = er ? new Date(er).getTime() : NaN,
                eo = Number.isFinite(ei) && ei <= Date.now(),
                eh = eo ? er : void 0,
                ef = S ? (0, t.jsx)(eB, {
                    event: y,
                    homeTeam: {
                        name: e$(Z ? (0, eu.getTeam)({
                            market: Z
                        }) : Q),
                        logo: J.logo,
                        href: eO(Z ? (0, eu.getTeam)({
                            market: Z
                        }) : Q)
                    },
                    awayTeam: {
                        name: e$(Y ? (0, eu.getTeam)({
                            market: Y
                        }) : X),
                        logo: ee.logo,
                        href: eO(Y ? (0, eu.getTeam)({
                            market: Y
                        }) : X)
                    },
                    gameState: L,
                    timeLabel: N,
                    gameDate: E,
                    showCurrentGamePoints: !0,
                    showLiveCurrentSetPlaceholder: !0
                }) : (0, t.jsx)(et, {
                    homeTeam: {
                        abbreviation: J.abbrev,
                        logo: J.logo,
                        href: J.href
                    },
                    awayTeam: {
                        abbreviation: ee.abbrev,
                        logo: ee.logo,
                        href: ee.href
                    },
                    homeScore: R[0],
                    awayScore: R[1],
                    status: e_(L),
                    timeLabel: L === em.GameState.NotStarted ? `${(0,en.format)(E,"p",v)}
${(0,en.format)(E,"MMMM d",v)}` : W || N,
                    showTeamName: !0,
                    hideScore: !!_ && (0, ep.isScorelessSport)(_),
                    topSlot: C ? void 0 : (0, t.jsxs)(t.Fragment, {
                        children: [(0, t.jsx)(ea, {}), (0, t.jsx)(eR, {})]
                    })
                });
            return m[10] !== f ? (l = f ? (0, t.jsx)(eS.Media, {
                lessThan: "lg",
                children: (0, t.jsx)("div", {
                    className: "mb-4 flex w-full justify-center",
                    children: f
                })
            }) : void 0, m[10] = f, m[11] = l) : l = m[11], m[12] !== P ? (c = (0, t.jsx)(K, {
                volume: P
            }), m[12] = P, m[13] = c) : c = m[13], m[14] !== q || m[15] !== h || m[16] !== y || m[17] !== eh || m[18] !== eo || m[19] !== V || m[20] !== A || m[21] !== x ? (d = h ? ? (0, t.jsx)("div", {
                className: "w-full overflow-visible [&_div]:mt-0! pt-6 pb-2 px-1",
                style: {
                    "--chart-bg": "var(--color-surface-1)"
                },
                children: (0, t.jsxs)("div", {
                    className: "relative",
                    children: [(0, t.jsx)(ew.ChartContextProvider, {
                        markets: V,
                        lowChanceMarkets: [],
                        resolvedMarkets: [],
                        event: y,
                        customColors: q,
                        options: {
                            mode: "group",
                            outcomeMode: "default",
                            forceShowAllMarkets: !0,
                            showLegend: !0,
                            showSettings: !1,
                            showOptions: !0,
                            showAnnotationsDrawer: !1,
                            showTimeWindows: x,
                            showLogo: !1,
                            showSingleModeLegend: !1,
                            oddsDisplay: "side",
                            yAxisOrientation: "right",
                            yAxisEnabled: !0,
                            xAxisEnabled: !0,
                            backfillData: !1,
                            customLabels: {
                                enabled: !1
                            },
                            tooltipOptions: {
                                mode: "default"
                            },
                            marketType: "default",
                            gameStartTime: eh,
                            initialWindow: eo ? "game" : void 0
                        },
                        children: (0, t.jsx)(ek.GroupChartWithoutProvider, {
                            options: {
                                mode: "group",
                                forceShowAllMarkets: !0,
                                height: 200,
                                showLegend: !0,
                                showSettings: !1,
                                showOptions: !0,
                                showTimeWindows: x,
                                showLogo: !1,
                                oddsDisplay: "side",
                                yAxisOrientation: "right",
                                yAxisEnabled: !0,
                                xAxisEnabled: !0
                            }
                        })
                    }, y.slug), (0, t.jsx)(ec.LiveActivityIndicator, {
                        conditionIds: [A.conditionId].filter(Boolean),
                        className: "bottom-8"
                    })]
                })
            }), m[14] = q, m[15] = h, m[16] = y, m[17] = eh, m[18] = eo, m[19] = V, m[20] = A, m[21] = x, m[22] = d) : d = m[22], m[23] !== c || m[24] !== d || m[25] !== ef || m[26] !== l ? (u = (0, t.jsxs)("div", {
                className: "flex flex-col gap-0 mb-2 w-full min-w-0",
                children: [ef, l, c, d]
            }), m[23] = c, m[24] = d, m[25] = ef, m[26] = l, m[27] = u) : u = m[27], u
        };

    function eV(e) {
        return e.stopPropagation()
    }

    function eH(e) {
        return "moneyline" === e.sportsMarketType
    }

    function eU(e) {
        return (e.sportsMarketType ? ? "moneyline") === "moneyline"
    }

    function eW(e) {
        return "home" === e.negRiskSportsMarketType
    }

    function eG(e) {
        return "away" === e.negRiskSportsMarketType
    }

    function eZ() {
        let e, a, i, n, s = (0, r.c)(4),
            {
                event: o
            } = (0, H.useSportsItemContext)(),
            {
                slug: l
            } = o,
            c = (0, B.useMoneylineMarket)(l);
        e: {
            if (c.teams && 2 === c.teams.length) {
                e = {
                    teamZero: c.teams[0],
                    teamOne: c.teams[1]
                };
                break e
            }
            e = {
                teamZero: void 0,
                teamOne: void 0
            }
        }
        let {
            teamOne: d,
            teamZero: u
        } = e;
        return d && u && c ? (s[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
            book: "never",
            lastPrice: "never"
        }, s[0] = a) : a = s[0], s[1] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(eq, {}), s[1] = i) : i = s[1], s[2] !== c ? (n = (0, t.jsx)(x.BookContextProvider, {
            market: c,
            prefetch: a,
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: i
        }), s[2] = c, s[3] = n) : n = s[3], n) : null
    }
    let eK = () => {
        let e, a, i = (0, r.c)(3);
        i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["sportSlug"], i[0] = e) : e = i[0];
        let {
            sportSlug: n
        } = (0, V.useSportsContext)(e), s = (0, p.useSportsV2Enabled)(), o = (0, q.useFeatureFlag)("mobile_sports_overlay_v2");
        if (s && n) {
            let e;
            return o ? null : (i[1] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(eZ, {}), i[1] = e) : e = i[1], e)
        }
        return i[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(W, {}), i[2] = a) : a = i[2], a
    };
    var eY = e.i(810912);
    e.s(["SportsMarketLabel", 0, function(e) {
        let a, i, n, s, o = (0, r.c)(10),
            {
                label: l,
                volume: c,
                className: d
            } = e;
        return o[0] !== d ? (a = (0, I.cn)("flex flex-col justify-center gap-0.5", d), o[0] = d, o[1] = a) : a = o[1], o[2] !== l ? (i = (0, t.jsx)(eY.Accordion.Header, {
            className: "text-sm font-semibold whitespace-nowrap",
            children: l
        }), o[2] = l, o[3] = i) : i = o[3], o[4] !== c ? (n = c && (0, t.jsx)("p", {
            className: "text-xs text-text-secondary whitespace-nowrap",
            children: c
        }), o[4] = c, o[5] = n) : n = o[5], o[6] !== a || o[7] !== i || o[8] !== n ? (s = (0, t.jsxs)("div", {
            className: a,
            children: [i, n]
        }), o[6] = a, o[7] = i, o[8] = n, o[9] = s) : s = o[9], s
    }], 457831);
    var eQ = e.i(269101);
    let eX = s.default.createContext({}),
        eJ = e => {
            let a, i, n, o, l, d, u, m = (0, r.c)(26),
                {
                    children: p,
                    event: h
                } = e,
                f = (0, B.useSportsEventsSelector)();
            m[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["positions", "isPending", "isLoading"], m[0] = a) : a = m[0];
            let {
                positions: x,
                isPending: g,
                isLoading: v
            } = (0, eQ.useEventPositionsContext)(a), {
                userOpenOrders: y,
                areOpenOrdersPending: b,
                areOpenOrdersLoading: k
            } = (0, c.default)(), w = s.default.useMemo(() => {
                if (!x || !f) return {};
                let e = {};
                return f.forEach(t => {
                    t.markets.forEach(r => {
                        e[r.conditionId] = t.slug
                    })
                }), x.reduce((t, r) => {
                    let a = e[r.market.id];
                    return a && (t[a] || (t[a] = []), t[a].push(r)), t
                }, {})
            }, [x, f]);
            m[1] !== h.slug || m[2] !== w ? (i = w[h.slug] ? ? [], m[1] = h.slug, m[2] = w, m[3] = i) : i = m[3];
            let S = i;
            m[4] !== S ? (n = S.filter(e1), m[4] = S, m[5] = n) : n = m[5];
            let j = n;
            e: {
                let e;
                if (!f) {
                    let e;
                    m[6] === Symbol.for("react.memo_cache_sentinel") ? (e = {}, m[6] = e) : e = m[6], o = e;
                    break e
                }
                m[7] !== f ? (e = {}, f.forEach(t => {
                    t.markets.forEach(r => {
                        e[r.conditionId] = t.slug
                    })
                }), m[7] = f, m[8] = e) : e = m[8],
                o = e
            }
            let C = o;
            if (m[9] !== C || m[10] !== h.slug || m[11] !== y) {
                let e;
                m[13] !== C || m[14] !== h.slug ? (e = e => C[e.market] === h.slug, m[13] = C, m[14] = h.slug, m[15] = e) : e = m[15], l = y.filter(e), m[9] = C, m[10] = h.slug, m[11] = y, m[12] = l
            } else l = m[12];
            let _ = l;
            m[16] !== k || m[17] !== b || m[18] !== v || m[19] !== g || m[20] !== _ || m[21] !== j ? (d = {
                positions: j,
                openOrders: _,
                arePositionsPending: g,
                areOpenOrdersPending: b,
                areOpenOrdersLoading: k,
                arePositionsLoading: v
            }, m[16] = k, m[17] = b, m[18] = v, m[19] = g, m[20] = _, m[21] = j, m[22] = d) : d = m[22];
            let T = d;
            return m[23] !== p || m[24] !== T ? (u = (0, t.jsx)(eX.Provider, {
                value: T,
                children: p
            }), m[23] = p, m[24] = T, m[25] = u) : u = m[25], u
        },
        e0 = () => s.default.useContext(eX);

    function e1(e) {
        return !e.trackedPositionMetadata || e.trackedPositionMetadata.netValue.optimistic > .01
    }
    e.s(["SportsPositionContextProvider", 0, eJ, "useSportsPositionContext", 0, e0], 295038);
    let e2 = e => {
            switch (e.negRiskSportsMarketType) {
                case "home":
                default:
                    return 0;
                case "draw":
                    return 1;
                case "away":
                    return 2
            }
        },
        e3 = (e, t) => e2(e) < e2(t) ? -1 : 1,
        e4 = e => {
            let t, a = (0, r.c)(15),
                {
                    isNegRisk: i,
                    event: n
                } = (0, H.useSportsItemContext)();
            e: {
                let r, s;
                if (!e ? .length) {
                    let e;
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        orders: []
                    }, a[0] = e) : e = a[0], t = e;
                    break e
                }
                if (i) {
                    let r, i;
                    if (a[1] !== n.markets || a[2] !== e) {
                        let t;
                        a[4] !== n.markets ? (t = (e, t) => {
                            let r = n.markets.find(e => e.conditionId.toLowerCase() === t.market.toLowerCase());
                            if (r) {
                                let a = (({
                                    order: e,
                                    market: t
                                }) => "draw" === t.negRiskSportsMarketType ? {
                                    order: e,
                                    market: t,
                                    isNegRisk: !0,
                                    outcomeIndex: t.outcomes.map(e => e.toLowerCase()).indexOf(e.outcome.toLowerCase()),
                                    isNegRiskDraw: !0,
                                    negRiskSportsMarketType: t.negRiskSportsMarketType
                                } : {
                                    order: e,
                                    market: t,
                                    isNegRisk: !0,
                                    outcomeIndex: t.outcomes.map(e => e.toLowerCase()).indexOf(e.outcome.toLowerCase()),
                                    negRiskSportsMarketType: t.negRiskSportsMarketType
                                })({
                                    order: t,
                                    market: r
                                });
                                e.push(a)
                            }
                            return e
                        }, a[4] = n.markets, a[5] = t) : t = a[5], r = e.reduce(t, []).sort(e3), a[1] = n.markets, a[2] = e, a[3] = r
                    } else r = a[3];
                    a[6] !== r ? (i = {
                        orders: r
                    }, a[6] = r, a[7] = i) : i = a[7], t = i;
                    break e
                }
                if (a[8] !== n.markets || a[9] !== e) {
                    let t;
                    a[11] !== n.markets ? (t = (e, t) => {
                        let r = n.markets.find(e => e.conditionId.toLowerCase() === t.market.toLowerCase());
                        if (r) {
                            let a = (({
                                order: e,
                                market: t
                            }) => {
                                let r = t.outcomes.map(e => e.toLowerCase()).indexOf(e.outcome.toLowerCase());
                                return {
                                    order: e,
                                    market: t,
                                    outcomeIndex: r,
                                    isNegRisk: !1
                                }
                            })({
                                order: t,
                                market: r
                            });
                            e.push(a)
                        }
                        return e
                    }, a[11] = n.markets, a[12] = t) : t = a[12], r = e.reduce(t, []), a[8] = n.markets, a[9] = e, a[10] = r
                } else r = a[10];a[13] !== r ? (s = {
                    orders: r
                }, a[13] = r, a[14] = s) : s = a[14],
                t = s
            }
            return t
        };

    function e5(e) {
        return e.conditionId
    }
    e.s(["useSportsItemOrders", 0, e4], 884446), e.s(["useAccordionOrders", 0, e => {
        let t, a = (0, r.c)(23),
            {
                openOrders: i
            } = e0(),
            {
                orders: n
            } = e4(i),
            {
                event: s
            } = (0, H.useSportsItemContext)();
        e: {
            let r;
            if ("card" === e.type) {
                let e;
                if (a[0] !== s.markets || a[1] !== n) {
                    let t = s.markets.map(e5);
                    e = n.filter(e => t.includes(e.market.conditionId.toLowerCase())), a[0] = s.markets, a[1] = n, a[2] = e
                } else e = a[2];
                t = e;
                break e
            }
            if ("moneyline" === e.type || "first_half_moneyline" === e.type || "cricket_most_sixes" === e.type || "cricket_team_top_batter" === e.type || "tennis_first_set_winner" === e.type || "cricket_toss_winner" === e.type || "cricket_toss_match_double" === e.type || "cricket_completed_match" === e.type || "tennis_completed_match" === e.type || "cricket_match_to_go_till" === e.type || "ufc_go_the_distance" === e.type || "kill_most_2_way_match" === e.type || "tower_most_2_way_match" === e.type || "drake_most_2_way_match" === e.type || "nashor_most_2_way_match" === e.type || "inhibitor_most_2_way_match" === e.type || "barrack_most_2_way_match" === e.type || "anytime_touchdowns" === e.type || "first_touchdowns" === e.type || "two_plus_touchdowns" === e.type || "soccer_anytime_goalscorer" === e.type || "soccer_exact_score" === e.type || "soccer_halftime_result" === e.type) {
                let r, i;
                if (a[3] !== e.data ? (r = [], Array.isArray(e.data) || ("binary" === e.data.type ? r.push(e.data.market.conditionId) : e.data.markets.forEach(e => {
                        r.push(e.conditionId)
                    })), a[3] = e.data, a[4] = r) : r = a[4], a[5] !== r || a[6] !== n) {
                    let e;
                    a[8] !== r ? (e = e => r.includes(e.market.conditionId.toLowerCase()), a[8] = r, a[9] = e) : e = a[9], i = n.filter(e), a[5] = r, a[6] = n, a[7] = i
                } else i = a[7];
                t = i;
                break e
            }
            if ("ufc_method_of_victory" === e.type || "parlays" === e.type || "shooter_first_pistol_round" === e.type || "shooter_second_pistol_round" === e.type) {
                let r, i;
                if (a[10] !== e.data ? (r = [], Array.isArray(e.data) || "binary" !== e.data.type || r.push(e.data.market.slug), a[10] = e.data, a[11] = r) : r = a[11], a[12] !== r || a[13] !== n) {
                    let e;
                    a[15] !== r ? (e = e => r.includes(e.market.slug), a[15] = r, a[16] = e) : e = a[16], i = n.filter(e), a[12] = r, a[13] = n, a[14] = i
                } else i = a[14];
                t = i;
                break e
            }
            if (Array.isArray(e.data)) {
                let r;
                if (a[17] !== n || a[18] !== e.data) {
                    let t;
                    a[20] !== n ? (t = e => n.filter(t => t.market.conditionId.toLowerCase() === e.market.conditionId.toLowerCase()), a[20] = n, a[21] = t) : t = a[21], r = e.data.flatMap(t), a[17] = n, a[18] = e.data, a[19] = r
                } else r = a[19];
                t = r;
                break e
            }
            a[22] === Symbol.for("react.memo_cache_sentinel") ? (r = [], a[22] = r) : r = a[22],
            t = r
        }
        return t
    }], 631827);
    var e6 = e.i(880809),
        e9 = e.i(3740);
    let e8 = e => {
            switch (e.negRiskSportsMarketType) {
                case "home":
                default:
                    return 0;
                case "draw":
                    return 1;
                case "away":
                    return 2
            }
        },
        e7 = (e, t) => e8(e) < e8(t) ? -1 : 1,
        te = e => {
            let {
                isNegRisk: t,
                event: r
            } = (0, H.useSportsItemContext)(), {
                orderType: a
            } = (0, e6.useTradeContext)(["orderType"]), i = s.default.useMemo(() => r.markets.reduce((e, t) => (e[t.conditionId.toLowerCase()] = t, e), {}), [r.markets]);
            return s.default.useMemo(() => e ? .length ? t ? {
                positions: e.reduce((e, t) => {
                    let r = i[t.market.id.toLowerCase()];
                    if (r) {
                        let i = (({
                            position: e,
                            market: t,
                            orderType: r
                        }) => {
                            if ("draw" === t.negRiskSportsMarketType) {
                                let a = (0, e9.formatPosition)({
                                    position: e,
                                    market: t,
                                    orderType: r,
                                    filterThreshold: .01,
                                    isSports: !0
                                });
                                if (!a) return;
                                return {
                                    position: a,
                                    rawPosition: e,
                                    market: t,
                                    isNegRisk: !0,
                                    outcomeIndex: a.sell.outcomeIdx,
                                    isNegRiskDraw: !0,
                                    negRiskSportsMarketType: t.negRiskSportsMarketType
                                }
                            }
                            let a = (0, e9.formatPosition)({
                                position: e,
                                market: t,
                                orderType: r,
                                filterThreshold: .01,
                                isSports: !0
                            });
                            if (a) return {
                                position: a,
                                rawPosition: e,
                                market: t,
                                outcomeIndex: a.sell.outcomeIdx,
                                isNegRisk: !0,
                                negRiskSportsMarketType: t.negRiskSportsMarketType
                            }
                        })({
                            position: t,
                            market: r,
                            orderType: a
                        });
                        i && e.push(i)
                    }
                    return e
                }, []).sort(e7)
            } : {
                positions: e.reduce((e, t) => {
                    let r = i[t.market.id.toLowerCase()];
                    if (r) {
                        let i = (0, e9.formatPosition)({
                            position: t,
                            market: r,
                            orderType: a,
                            filterThreshold: .01,
                            isSports: !0
                        });
                        i && e.push({
                            position: i,
                            rawPosition: t,
                            market: r,
                            isNegRisk: !1,
                            outcomeIndex: i.sell.outcomeIdx,
                            sortKey: 1,
                            ..."spreads" === r.sportsMarketType && {
                                sortKey: 2
                            },
                            ..."totals" === r.sportsMarketType && {
                                sortKey: 3
                            }
                        })
                    }
                    return e
                }, []).sort((e, t) => (e.sortKey ? ? 0) - (t.sortKey ? ? 0))
            } : {
                positions: []
            }, [e, t, r.markets, a])
        };

    function tt(e) {
        return e.conditionId
    }
    e.s(["useSportsItemPositions", 0, te], 605797), e.s(["useAccordionPositions", 0, e => {
        let t, a = (0, r.c)(23),
            {
                positions: i
            } = e0(),
            {
                positions: n
            } = te(i),
            {
                event: s
            } = (0, H.useSportsItemContext)();
        if ("card" === e.type) {
            let e;
            if (a[0] !== s.markets || a[1] !== n) {
                let t = s.markets.map(tt);
                e = n.filter(e => t.includes(e.market.conditionId.toLowerCase())), a[0] = s.markets, a[1] = n, a[2] = e
            } else e = a[2];
            return e
        }
        if ("moneyline" === e.type || "first_half_moneyline" === e.type || "cricket_most_sixes" === e.type || "cricket_team_top_batter" === e.type || "tennis_first_set_winner" === e.type || "cricket_toss_winner" === e.type || "cricket_toss_match_double" === e.type || "cricket_completed_match" === e.type || "tennis_completed_match" === e.type || "cricket_match_to_go_till" === e.type || "ufc_go_the_distance" === e.type || "kill_most_2_way_match" === e.type || "tower_most_2_way_match" === e.type || "drake_most_2_way_match" === e.type || "nashor_most_2_way_match" === e.type || "inhibitor_most_2_way_match" === e.type || "barrack_most_2_way_match" === e.type || "anytime_touchdowns" === e.type || "first_touchdowns" === e.type || "two_plus_touchdowns" === e.type || "first_blood_game" === e.type || "soccer_anytime_goalscorer" === e.type || "soccer_exact_score" === e.type || "soccer_halftime_result" === e.type) {
            let t, r;
            if (a[3] !== e.data ? (t = [], Array.isArray(e.data) || ("binary" === e.data.type ? t.push(e.data.market.conditionId) : e.data.markets.forEach(e => {
                    t.push(e.conditionId)
                })), a[3] = e.data, a[4] = t) : t = a[4], a[5] !== t || a[6] !== n) {
                let e;
                a[8] !== t ? (e = e => t.includes(e.market.conditionId.toLowerCase()), a[8] = t, a[9] = e) : e = a[9], r = n.filter(e), a[5] = t, a[6] = n, a[7] = r
            } else r = a[7];
            return r
        }
        if ("ufc_method_of_victory" === e.type || "parlays" === e.type || "shooter_first_pistol_round" === e.type || "shooter_second_pistol_round" === e.type) {
            let t, r;
            if (a[10] !== e.data ? (t = [], Array.isArray(e.data) || "binary" !== e.data.type || t.push(e.data.market.slug), a[10] = e.data, a[11] = t) : t = a[11], a[12] !== t || a[13] !== n) {
                let e;
                a[15] !== t ? (e = e => t.includes(e.market.slug), a[15] = t, a[16] = e) : e = a[16], r = n.filter(e), a[12] = t, a[13] = n, a[14] = r
            } else r = a[14];
            return r
        }
        if (Array.isArray(e.data)) {
            let t;
            if (a[17] !== n || a[18] !== e.data) {
                let r;
                a[20] !== n ? (r = e => n.filter(t => t.market.conditionId.toLowerCase() === e.market.conditionId.toLowerCase()), a[20] = n, a[21] = r) : r = a[21], t = e.data.flatMap(r), a[17] = n, a[18] = e.data, a[19] = t
            } else t = a[19];
            return t
        }
        return a[22] === Symbol.for("react.memo_cache_sentinel") ? (t = [], a[22] = t) : t = a[22], t
    }], 41016), e.s(["useHasSportsPositions", 0, e => {
        let t, a = (0, r.c)(5),
            {
                positions: i
            } = e0(),
            {
                positions: n
            } = te(i);
        e: {
            if (e) {
                let r;
                if (a[0] !== n || a[1] !== e) {
                    let t;
                    a[3] !== e ? (t = t => (t.market.sportsMarketType ? ? "moneyline") === e, a[3] = e, a[4] = t) : t = a[4], r = n.some(t), a[0] = n, a[1] = e, a[2] = r
                } else r = a[2];
                t = r;
                break e
            }
            t = n.length > 0
        }
        return t
    }], 740849), e.s(["SportsAccordionItem", 0, function(e) {
        let a, i, n, s, o, l, c, d, u, m, p, h = (0, r.c)(21);
        h[0] !== e ? ({
            event: n,
            market: s,
            className: i,
            value: l,
            children: a,
            ...o
        } = e, h[0] = e, h[1] = a, h[2] = i, h[3] = n, h[4] = s, h[5] = o, h[6] = l) : (a = h[1], i = h[2], n = h[3], s = h[4], o = h[5], l = h[6]);
        let f = (0, B.useSportsEventSelector)(n);
        if (!f) return null;
        h[7] === Symbol.for("react.memo_cache_sentinel") ? (c = {
            book: "once-when-stale",
            lastPrice: "once-when-stale"
        }, h[7] = c) : c = h[7];
        let g = l ? ? n;
        return h[8] !== i ? (d = (0, D.cn)("w-full h-max overflow-visible", i), h[8] = i, h[9] = d) : d = h[9], h[10] !== a || h[11] !== o || h[12] !== g || h[13] !== d ? (u = (0, t.jsx)(eY.Accordion.Item, {
            value: g,
            className: d,
            ...o,
            children: a
        }), h[10] = a, h[11] = o, h[12] = g, h[13] = d, h[14] = u) : u = h[14], h[15] !== f || h[16] !== u ? (m = (0, t.jsx)(eJ, {
            event: f,
            children: u
        }), h[15] = f, h[16] = u, h[17] = m) : m = h[17], h[18] !== s || h[19] !== m ? (p = (0, t.jsx)(x.BookContextProvider, {
            market: s,
            prefetch: c,
            poll: "when-inactive",
            subscribe: "never",
            defer: "after-virtualized",
            children: m
        }), h[18] = s, h[19] = m, h[20] = p) : p = h[20], p
    }], 147931), e.s(["SportsAccordionItemContent", () => tG], 323481);
    var tr = e.i(992805),
        ta = e.i(233522),
        ti = e.i(981772),
        tn = e.i(853037),
        ts = e.i(19303),
        to = e.i(399336),
        tl = e.i(488224),
        tc = e.i(187261);
    let td = e => ({
        addTab: e.addTab,
        removeTab: e.removeTab
    });
    var tu = e.i(85510),
        tm = e.i(840216),
        tp = e.i(328951),
        th = e.i(455145),
        tf = e.i(469870);
    let tx = (e, t, a) => {
            let i, n, s, o, l, c, d = (0, r.c)(16),
                u = (0, th.useOnPriceLevelClick)(t),
                m = (0, tf.useOnSpreadClick)(),
                p = ((e, t, a) => {
                    let i, n, s, o = (0, r.c)(17);
                    o[0] === Symbol.for("react.memo_cache_sentinel") ? (i = ["selectedOutcomeIdx", "selectedOutcome"], o[0] = i) : i = o[0];
                    let {
                        selectedOutcomeIdx: l,
                        selectedOutcome: c
                    } = (0, e6.useTradeContext)(i), d = (0, tl.useSportsItemStore)(tb);
                    o[1] !== e ? (n = t => t.teams[e], o[1] = e, o[2] = n) : n = o[2];
                    let u = (0, tm.useSportsStore)(n);
                    e: {
                        let e = u ? .home,
                            r = u ? .away;
                        if (t ? .negRisk && t ? .negRiskSportsMarketType) {
                            if (t ? .negRiskSportsMarketType === "draw") {
                                s = "Trade Draw";
                                break e
                            }
                            if (t ? .negRiskSportsMarketType === "home" && e) {
                                let t;
                                o[3] !== e.abbreviation ? (t = (0, w.capitalize)(e.abbreviation), o[3] = e.abbreviation, o[4] = t) : t = o[4], s = `Trade ${t}`;
                                break e
                            }
                            if (t ? .negRiskSportsMarketType === "away" && r) {
                                let e;
                                o[5] !== r.abbreviation ? (e = (0, w.capitalize)(r.abbreviation), o[5] = r.abbreviation, o[6] = e) : e = o[6], s = `Trade ${e}`;
                                break e
                            }
                        } else {
                            if (t && e && r && ("moneyline" === d || "card" === d && "moneyline" === t.sportsMarketType)) {
                                let t, a = 0 === l ? e.abbreviation : r.abbreviation;
                                o[7] !== a ? (t = (0, w.capitalize)(a), o[7] = a, o[8] = t) : t = o[8], s = `Trade ${t}`;
                                break e
                            }
                            let a = t ? .line;
                            if (a && e && r && ("spreads" === d || "card" === d && "spreads" === t.sportsMarketType)) {
                                let a, i, n = t.invertOutcomesVisually ? (l + 1) % 2 : l;
                                o[9] !== t || o[10] !== l ? (a = (0, eu.getSpreadLineForOutcome)({
                                    outcomeIndex: l,
                                    market: t
                                }), o[9] = t, o[10] = l, o[11] = a) : a = o[11];
                                let c = a,
                                    d = c ? c < 0 ? `${c}` : `+${c}` : void 0,
                                    u = 0 === n ? e.abbreviation : r.abbreviation;
                                o[12] !== u ? (i = (0, w.capitalize)(u), o[12] = u, o[13] = i) : i = o[13], s = `Trade ${i} ${d}`;
                                break e
                            }
                            if (a && ("totals" === d || "card" === d && "totals" === t.sportsMarketType)) {
                                let e;
                                o[14] !== a || o[15] !== l ? (e = (0, eu.getFormattedOverUnder)({
                                    outcomeIndex: l,
                                    line: a
                                }), o[14] = a, o[15] = l, o[16] = e) : e = o[16];
                                let t = e;
                                s = `Trade ${t}`;
                                break e
                            }
                        }
                        if ("selected-outcome" === (void 0 === a ? "none" : a)) {
                            s = `Trade ${c}`;
                            break e
                        }
                        s = void 0
                    }
                    return s
                })(e, t, "none"),
                h = "desktop" === a;
            d[0] !== h ? (i = {
                enabled: h
            }, d[0] = h, d[1] = i) : i = d[1];
            let f = "desktop" === a;
            return d[2] !== f ? (n = {
                enabled: f
            }, d[2] = f, d[3] = n) : n = d[3], d[4] !== p || d[5] !== i || d[6] !== n ? (s = {
                label: p,
                recenter: i,
                sideToggle: n,
                className: "dark:bg-surface-1"
            }, d[4] = p, d[5] = i, d[6] = n, d[7] = s) : s = d[7], d[8] !== m ? (o = {
                recenter: !0,
                onClick: m,
                className: "dark:bg-surface-1 dark:hover:bg-button-ghost-accent-bg-hover"
            }, d[8] = m, d[9] = o) : o = d[9], d[10] !== u ? (l = {
                onClick: u
            }, d[10] = u, d[11] = l) : l = d[11], d[12] !== s || d[13] !== o || d[14] !== l ? (c = {
                headerOptions: s,
                spreadOptions: o,
                rowOptions: l
            }, d[12] = s, d[13] = o, d[14] = l, d[15] = c) : c = d[15], c
        },
        tg = () => {
            let e, a, i, n = (0, r.c)(5);
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], n[0] = e) : e = n[0];
            let {
                event: s
            } = (0, M.useEventContext)(e);
            n[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], n[1] = a) : a = n[1];
            let {
                activeMarket: o
            } = (0, to.useEventActiveMarketContext)(a), l = tx(s.slug, o, "mobile");
            return n[2] !== o || n[3] !== l ? (i = (0, t.jsx)(tp.OrderBook, {
                market: o,
                options: l,
                variant: "narrow",
                maxHeight: 349
            }), n[2] = o, n[3] = l, n[4] = i) : i = n[4], i
        },
        tv = () => {
            let e, a, i, n = (0, r.c)(5);
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], n[0] = e) : e = n[0];
            let {
                event: s
            } = (0, M.useEventContext)(e);
            n[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], n[1] = a) : a = n[1];
            let {
                activeMarket: o
            } = (0, to.useEventActiveMarketContext)(a), l = tx(s.slug, o, "desktop");
            return n[2] !== o || n[3] !== l ? (i = (0, t.jsx)(tp.OrderBook, {
                market: o,
                options: l,
                maxHeight: 357
            }), n[2] = o, n[3] = l, n[4] = i) : i = n[4], i
        },
        ty = () => {
            let e, a, i, n, s = (0, r.c)(6);
            return (0, tl.useSportsItemStore)(tk), !1 !== s[0] ? (e = (0, D.cn)("relative flex w-full h-full overflow-hidden transition-all duration-200 bg-transparent", !1), s[0] = !1, s[1] = e) : e = s[1], s[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(eS.Media, {
                lessThan: "lg",
                children: (0, t.jsx)(tg, {})
            }), s[2] = a) : a = s[2], s[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(eS.Media, {
                greaterThanOrEqual: "lg",
                children: (0, t.jsx)(tv, {})
            }), s[3] = i) : i = s[3], s[4] !== e ? (n = (0, t.jsxs)("div", {
                className: e,
                children: [a, i]
            }), s[4] = e, s[5] = n) : n = s[5], n
        };

    function tb(e) {
        return e.variant
    }

    function tk(e) {
        return e.variant
    }
    var tw = e.i(83638),
        tS = e.i(122538),
        tj = e.i(964974),
        tC = e.i(994883),
        t_ = e.i(761854),
        t_ = t_,
        tT = e.i(148031),
        tM = e.i(67735),
        tM = tM,
        tN = e.i(855845),
        tI = e.i(911984),
        tP = e.i(74156),
        tE = e.i(56827);
    let tA = () => {
        let e, a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v, b, k, w, S, j, C, _, T, M, N, I, P = (0, r.c)(75),
            E = (0, y.useTranslations)(),
            A = (0, el.useLocale)();
        P[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket", "eventDeployedAt"], P[0] = e) : e = P[0];
        let {
            activeMarket: O,
            eventDeployedAt: L
        } = (0, to.useEventActiveMarketContext)(e);
        (0, tl.useSportsItemStore)(tO);
        e: try {
            if (O.endDateIso) {
                let e;
                P[1] !== O.endDateIso || P[2] !== A ? (e = (0, en.format)((0, tC.parse)(O.endDateIso, "yyyy-MM-dd", new Date), "PP", {
                    locale: (0, es.getDateFnsLocale)(A)
                }), P[1] = O.endDateIso, P[2] = A, P[3] = e) : e = P[3], a = e;
                break e
            }
            a = void 0
        } catch {
            a = void 0
        }
        let z = a;
        P[4] !== O.id ? (i = ["/api/market/resolutionData", O.id], P[4] = O.id, P[5] = i) : i = P[5], P[6] !== O ? (n = () => (0, tP.getResolutionData)(O), P[6] = O, P[7] = n) : n = P[7], P[8] !== O.resolutionData ? (s = () => O.resolutionData, P[8] = O.resolutionData, P[9] = s) : s = P[9];
        let R = !O.resolutionData;
        P[10] !== i || P[11] !== n || P[12] !== s || P[13] !== R ? (o = {
            queryKey: i,
            queryFn: n,
            initialData: s,
            enabled: R,
            refetchOnMount: !1,
            refetchOnReconnect: !1,
            refetchOnWindowFocus: !1,
            placeholderData: tS.keepPreviousData
        }, P[10] = i, P[11] = n, P[12] = s, P[13] = R, P[14] = o) : o = P[14];
        let {
            data: F,
            isPending: $
        } = (0, tj.useQuery)(o), {
            sortedClarifications: B,
            lastUpdatedAt: q
        } = (0, tI.useMarketClarifications)(O);
        !1 !== P[15] ? (l = (0, D.cn)("relative flex flex-col gap-4 w-full h-max px-4 py-4", !1), P[15] = !1, P[16] = l) : l = P[16], P[17] !== q || P[18] !== B ? (c = B.length > 0 && q ? (0, t.jsx)(t_.default, {
            marketClarifications: B,
            lastUpdatedAt: q
        }) : null, P[17] = q, P[18] = B, P[19] = c) : c = P[19], P[20] !== E ? (d = E("events.aboutSection.rules"), P[20] = E, P[21] = d) : d = P[21], P[22] !== d ? (u = (0, t.jsx)("p", {
            className: "text-text font-medium",
            children: d
        }), P[22] = d, P[23] = u) : u = P[23], P[24] !== O.description ? (m = (0, t.jsx)("p", {
            className: "text-text text-sm",
            children: O.description
        }), P[24] = O.description, P[25] = m) : m = P[25], P[26] !== O.description || P[27] !== m ? (p = (0, t.jsx)(tN.TextSelectionWrapper, {
            className: "flex",
            children: (0, t.jsx)(tE.default, {
                text: O.description,
                maxLines: 7,
                children: m
            })
        }), P[26] = O.description, P[27] = m, P[28] = p) : p = P[28], P[29] !== z || P[30] !== E ? (h = z && (0, t.jsxs)("div", {
            className: "flex justify-between lg:justify-start items-center gap-2 mt-2 lg:mt-1",
            children: [(0, t.jsx)("div", {
                className: "flex items-center gap-1.5",
                children: (0, t.jsxs)("p", {
                    className: "inline-flex text-text text-sm font-semibold",
                    children: [E("events.statistics.endDate"), (0, t.jsx)("span", {
                        className: "hidden lg:block",
                        children: ":"
                    })]
                })
            }), (0, t.jsx)("div", {
                children: (0, t.jsx)("p", {
                    className: "text-text text-sm",
                    children: z
                })
            })]
        }), P[29] = z, P[30] = E, P[31] = h) : h = P[31], P[32] !== L || P[33] !== E ? (f = L && (0, t.jsxs)("div", {
            className: "flex justify-between lg:justify-start items-center gap-2 mt-2 lg:mt-1",
            children: [(0, t.jsx)("div", {
                className: "flex items-center gap-1.5",
                children: (0, t.jsxs)("p", {
                    className: "inline-flex text-text text-sm font-semibold",
                    children: [E("events.statistics.createdAt"), (0, t.jsx)("span", {
                        className: "hidden lg:block",
                        children: ":"
                    })]
                })
            }), (0, t.jsx)("div", {
                children: (0, t.jsx)("p", {
                    className: "text-text text-sm",
                    children: L
                })
            })]
        }), P[32] = L, P[33] = E, P[34] = f) : f = P[34], P[35] !== u || P[36] !== p || P[37] !== h || P[38] !== f ? (x = (0, t.jsxs)("div", {
            className: "flex flex-col gap-2",
            children: [u, p, h, f]
        }), P[35] = u, P[36] = p, P[37] = h, P[38] = f, P[39] = x) : x = P[39], P[40] !== E ? (g = E("events.aboutSection.sources"), P[40] = E, P[41] = g) : g = P[41], P[42] !== g ? (v = (0, t.jsx)("p", {
            className: "text-text font-medium",
            children: g
        }), P[42] = g, P[43] = v) : v = P[43], P[44] === Symbol.for("react.memo_cache_sentinel") ? (b = (0, t.jsx)(tM.default, {}), P[44] = b) : b = P[44], P[45] !== v ? (k = (0, t.jsxs)("div", {
            className: "flex flex-col gap-2",
            children: [v, b]
        }), P[45] = v, P[46] = k) : k = P[46], P[47] !== E ? (w = E("events.tabs.resolution"), P[47] = E, P[48] = w) : w = P[48], P[49] !== w ? (S = (0, t.jsx)("p", {
            className: "text-text font-medium",
            children: w
        }), P[49] = w, P[50] = S) : S = P[50], P[51] !== O || P[52] !== $ || P[53] !== F ? (j = !$ && (0, t.jsx)(tT.EventResolutionStepper, {
            market: O,
            resolutionData: F ? ? void 0
        }), P[51] = O, P[52] = $, P[53] = F, P[54] = j) : j = P[54], P[55] !== $ || P[56] !== F ? (C = !F && $ && (0, t.jsx)("div", {}), P[55] = $, P[56] = F, P[57] = C) : C = P[57], P[58] !== j || P[59] !== C ? (_ = (0, t.jsxs)("div", {
            className: "flex flex-col grow w-full",
            children: [j, C]
        }), P[58] = j, P[59] = C, P[60] = _) : _ = P[60];
        let V = F ? ? void 0;
        return P[61] !== V ? (T = (0, t.jsx)("div", {
            className: "flex flex-col justify-start self-stretch",
            children: (0, t.jsx)("div", {
                className: "flex items-center justify-end w-full",
                children: (0, t.jsx)(tT.UmaExternalLink, {
                    resolutionData: V
                })
            })
        }), P[61] = V, P[62] = T) : T = P[62], P[63] !== _ || P[64] !== T ? (M = (0, t.jsxs)("div", {
            className: "flex w-full h-full items-center",
            children: [_, T]
        }), P[63] = _, P[64] = T, P[65] = M) : M = P[65], P[66] !== S || P[67] !== M ? (N = (0, t.jsxs)("div", {
            className: "flex flex-col gap-2 w-full h-full",
            children: [S, M]
        }), P[66] = S, P[67] = M, P[68] = N) : N = P[68], P[69] !== x || P[70] !== k || P[71] !== N || P[72] !== l || P[73] !== c ? (I = (0, t.jsxs)("div", {
            className: l,
            children: [c, x, k, N]
        }), P[69] = x, P[70] = k, P[71] = N, P[72] = l, P[73] = c, P[74] = I) : I = P[74], I
    };

    function tO(e) {
        return e.variant
    }
    let tD = () => {
        let e, a, i, n, s, o, l, c, d, u, m, p, h, f = (0, r.c)(60);
        f[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], f[0] = e) : e = f[0];
        let {
            activeMarket: x
        } = (0, to.useEventActiveMarketContext)(e), {
            isNegRisk: g,
            event: v
        } = (0, H.useSportsItemContext)();
        f[1] !== x || f[2] !== g ? (a = ((e, t) => {
            try {
                if (!e.teams || e.teams.length < 2) return;
                let r = e.teams.map((t, r) => {
                    let a = (0, eu.getTeam)({
                        market: e,
                        outcomeIndex: r
                    });
                    if (!a) return null;
                    let i = (0, ex.getSportsButtonColor)({
                        team: a
                    });
                    return i.customColors ? .backgroundColor ? {
                        id: a.alias ? .toLowerCase() || `team-${r}`,
                        color: i.customColors.backgroundColor,
                        index: r
                    } : null
                }).filter(Boolean);
                if (0 === r.length) return;
                if (!t) return r;
                return [...r, {
                    id: "draw",
                    color: "var(--color-neutral-500)",
                    index: 2
                }]
            } catch {
                return
            }
        })(x, g), f[1] = x, f[2] = g, f[3] = a) : a = f[3];
        let y = a;
        f[4] !== x.sportsMarketType ? (i = (0, eC.isMoneylineMarket)(x.sportsMarketType), f[4] = x.sportsMarketType, f[5] = i) : i = f[5];
        let b = i;
        e: {
            let e, t, r, a, i, s;
            if (g && b && x.teams && 2 === x.teams.length) {
                let e, t;
                f[6] !== v.markets ? (e = v.markets.map(tL), f[6] = v.markets, f[7] = e) : e = f[7];
                let r = e;
                f[8] !== r[0] || f[9] !== r[1] || f[10] !== r[2] ? (t = [r[0], r[2], r[1]], f[8] = r[0], f[9] = r[1], f[10] = r[2], f[11] = t) : t = f[11], n = t;
                break e
            }
            let o = y ? .[0] ? .id;f[12] !== x || f[13] !== o ? (e = { ...x,
                sortKey: 1,
                index: 0,
                groupItemTitle: x.outcomes[0],
                showGmpSeries: !0,
                seriesColor: o
            }, f[12] = x, f[13] = o, f[14] = e) : e = f[14];
            let l = x.outcomes[1];f[15] !== x.outcomes ? (t = x.outcomes.toReversed(), f[15] = x.outcomes, f[16] = t) : t = f[16],
            f[17] !== x.outcomePrices ? (r = x.outcomePrices.toReversed(), f[17] = x.outcomePrices, f[18] = r) : r = f[18],
            f[19] !== x.clobTokenIds ? (a = Array.isArray(x.clobTokenIds) && {
                clobTokenIds: [x.clobTokenIds[1], x.clobTokenIds[0]]
            }, f[19] = x.clobTokenIds, f[20] = a) : a = f[20];
            let c = x.bestAsk ? 1 - x.bestAsk : null,
                d = x.bestBid ? 1 - x.bestBid : null,
                u = x.lastTradePrice ? 1 - x.lastTradePrice : null,
                m = y ? .[1] ? .id;f[21] !== x || f[22] !== c || f[23] !== d || f[24] !== u || f[25] !== m || f[26] !== t || f[27] !== r || f[28] !== a ? (i = { ...x,
                sortKey: 2,
                index: 1,
                groupItemTitle: l,
                outcomes: t,
                outcomePrices: r,
                ...a,
                showGmpSeries: !0,
                bestAsk: c,
                bestBid: d,
                lastTradePrice: u,
                seriesColor: m
            }, f[21] = x, f[22] = c, f[23] = d, f[24] = u, f[25] = m, f[26] = t, f[27] = r, f[28] = a, f[29] = i) : i = f[29],
            f[30] !== i || f[31] !== e ? (s = [e, i], f[30] = i, f[31] = e, f[32] = s) : s = f[32],
            n = s
        }
        let k = n;
        if (f[33] !== v.seriesSlug || f[34] !== v.tags || f[35] !== b || f[36] !== g || f[37] !== k.length) {
            let e = v.tags ? .some(tz);
            s = (!g || !b) && !!v.seriesSlug && 2 === k.length, o = {
                mode: "group",
                forceShowAllMarkets: !0,
                showLegend: !0,
                showLogo: !1,
                showSettings: !0,
                showOptions: !1,
                showTimeWindows: !0,
                height: 240,
                initialWindow: "1h",
                ...e && {
                    initialWindow: "1h"
                }
            }, f[33] = v.seriesSlug, f[34] = v.tags, f[35] = b, f[36] = g, f[37] = k.length, f[38] = s, f[39] = o
        } else s = f[38], o = f[39];
        f[40] !== s ? (l = s && {
            oddsDisplay: "side"
        }, f[40] = s, f[41] = l) : l = f[41], f[42] !== o || f[43] !== l ? (c = { ...o,
            ...l
        }, f[42] = o, f[43] = l, f[44] = c) : c = f[44];
        let w = c;
        return f[45] === Symbol.for("react.memo_cache_sentinel") ? (d = {
            "--chart-bg": "var(--color-surface-1)"
        }, f[45] = d) : d = f[45], f[46] !== w || f[47] !== y || f[48] !== v || f[49] !== k ? (u = (0, t.jsx)(ek.GroupChart, {
            event: v,
            markets: k,
            options: w,
            customColors: y
        }), f[46] = w, f[47] = y, f[48] = v, f[49] = k, f[50] = u) : u = f[50], f[51] !== x.conditionId || f[52] !== x.enableOrderBook ? (m = 137 === ej.MATIC_CONFIG.chainId && x.enableOrderBook && (0, t.jsx)(ec.LiveActivityIndicator, {
            conditionIds: [x.conditionId].filter(Boolean),
            className: "bottom-8"
        }), f[51] = x.conditionId, f[52] = x.enableOrderBook, f[53] = m) : m = f[53], f[54] !== u || f[55] !== m ? (p = (0, t.jsxs)("div", {
            className: "overflow-visible relative pr-4",
            style: d,
            children: [u, m]
        }), f[54] = u, f[55] = m, f[56] = p) : p = f[56], f[57] !== x.slug || f[58] !== p ? (h = (0, t.jsx)("div", {
            children: p
        }, x.slug), f[57] = x.slug, f[58] = p, f[59] = h) : h = f[59], h
    };

    function tL(e) {
        if ("draw" === e.negRiskSportsMarketType) return { ...e,
            sortKey: 3,
            groupItemTitle: "Draw",
            showGmpSeries: !0,
            seriesColor: "draw"
        };
        let t = (0, eu.getTeam)({
            market: e
        });
        return { ...e,
            sortKey: "home" === e.negRiskSportsMarketType ? 1 : 2,
            groupItemTitle: t ? .alias ? t.alias : e.groupItemTitle,
            showGmpSeries: !0,
            seriesColor: t ? .alias ? .toLowerCase()
        }
    }

    function tz(e) {
        return "1H" === e.slug
    }
    var tR = e.i(215959),
        tF = e.i(507909);
    let t$ = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1
            },
            exit: {
                opacity: 0
            }
        },
        tB = e => {
            let a, i, n, s, o, l, c, d, u = (0, r.c)(16);
            u[0] !== e ? ({
                ref: n,
                className: i,
                children: a,
                duration: o,
                ...s
            } = e, u[0] = e, u[1] = a, u[2] = i, u[3] = n, u[4] = s, u[5] = o) : (a = u[1], i = u[2], n = u[3], s = u[4], o = u[5]);
            let m = void 0 === o ? .15 : o;
            return u[6] !== i ? (l = (0, D.cn)("w-full", i), u[6] = i, u[7] = l) : l = u[7], u[8] !== m ? (c = {
                ease: tF.opacityTransition.ease,
                duration: m
            }, u[8] = m, u[9] = c) : c = u[9], u[10] !== a || u[11] !== n || u[12] !== s || u[13] !== l || u[14] !== c ? (d = (0, t.jsx)(tR.motion.div, {
                ref: n,
                className: l,
                variants: t$,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                transition: c,
                ...s,
                children: a
            }), u[10] = a, u[11] = n, u[12] = s, u[13] = l, u[14] = c, u[15] = d) : d = u[15], d
        };
    tB.displayName = "TabWrapper";
    let tq = () => {
        let e, a, i, n, s, c, u = (0, r.c)(18),
            m = (0, y.useTranslations)();
        u[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], u[0] = e) : e = u[0];
        let {
            activeMarket: p
        } = (0, to.useEventActiveMarketContext)(e), {
            filledOrders: h,
            hasNextPage: f,
            fetchNextPage: x,
            isFetching: g
        } = (0, l.useFilledOrders)();
        u[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["authenticated"], u[1] = a) : a = u[1];
        let {
            authenticated: v
        } = (0, d.useAccountContext)(a);
        return (0, tl.useSportsItemStore)(tV), !1 !== u[2] ? (i = (0, D.cn)("relative flex w-full h-max px-4", !1), u[2] = !1, u[3] = i) : i = u[3], u[4] !== p || u[5] !== v || u[6] !== x || u[7] !== h || u[8] !== f || u[9] !== g ? (n = !!h ? .length && (0, t.jsx)(o.default, {
            filledOrders: h,
            hasNextPage: f,
            fetchNextPage: x,
            isFetchingNextPage: g,
            isAuthenticated: !!v,
            omitHeader: !0,
            activeMarket: p,
            viewAll: !0,
            containerClassName: `overflow-x-hidden w-full ${h.length>=o.TRADES_TO_SHOW_COUNT?"pb-4":""}`
        }), u[4] = p, u[5] = v, u[6] = x, u[7] = h, u[8] = f, u[9] = g, u[10] = n) : n = u[10], u[11] !== h.length || u[12] !== m ? (s = !h.length && (0, t.jsx)("div", {
            className: "flex w-full justify-center py-4",
            children: (0, t.jsx)("p", {
                className: "text-text-secondary text-sm font-medium",
                children: m("activity.noHistory")
            })
        }), u[11] = h.length, u[12] = m, u[13] = s) : s = u[13], u[14] !== i || u[15] !== n || u[16] !== s ? (c = (0, t.jsxs)("div", {
            className: i,
            children: [n, s]
        }), u[14] = i, u[15] = n, u[16] = s, u[17] = c) : c = u[17], c
    };

    function tV(e) {
        return e.variant
    }
    let tH = e => ({
            tabs: e.tabs,
            tab: e.tab,
            setTab: e.setTab
        }),
        tU = s.default.memo(function(e) {
            let a, i, n, s = (0, r.c)(10),
                {
                    activeMarketFeesEnabled: o,
                    onValueChange: l,
                    tab: c,
                    tabItems: d
                } = e;
            return s[0] !== l || s[1] !== c || s[2] !== d ? (a = (0, t.jsx)(tr.TextTabs, {
                items: d,
                value: c,
                onValueChange: l,
                size: "sm",
                className: "flex-1 min-w-0 flex items-center h-full pl-4"
            }), s[0] = l, s[1] = c, s[2] = d, s[3] = a) : a = s[3], s[4] !== o || s[5] !== c ? (i = c === tc.SportsDetailTab.Book && (0, t.jsxs)("div", {
                className: "flex items-center pr-2",
                children: [o && (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)(eS.Media, {
                        lessThan: "lg",
                        children: (0, t.jsx)(ti.MakerRebateTooltip, {
                            asIcon: !0
                        })
                    }), (0, t.jsx)(eS.Media, {
                        greaterThanOrEqual: "lg",
                        children: (0, t.jsx)(ti.MakerRebateTooltip, {
                            asIcon: !1,
                            compact: !0
                        })
                    })]
                }), (0, t.jsx)(eS.Media, {
                    lessThan: "lg",
                    children: (0, t.jsx)(tn.default, {
                        asIcon: !0
                    })
                }), (0, t.jsx)(eS.Media, {
                    greaterThanOrEqual: "lg",
                    children: (0, t.jsx)(tn.default, {
                        asIcon: !1,
                        compact: !0
                    })
                }), (0, t.jsx)("div", {
                    className: "flex lg:hidden",
                    children: (0, t.jsx)(tw.SwitchButton, {})
                }), (0, t.jsx)(ts.ClobRefreshButtonWithTooltip, {})]
            }), s[4] = o, s[5] = c, s[6] = i) : i = s[6], s[7] !== a || s[8] !== i ? (n = (0, t.jsxs)("div", {
                className: "sticky top-0 z-[3] w-full bg-surface-1 border-b flex items-center justify-between h-11",
                children: [a, i]
            }), s[7] = a, s[8] = i, s[9] = n) : n = s[9], n
        }),
        tW = ({
            height: e
        }) => {
            let {
                tabs: a,
                tab: i,
                setTab: n
            } = (0, tl.useSportsItemStore)(tH, ta.shallow), {
                activeMarket: o
            } = (0, to.useEventActiveMarketContext)(["activeMarket"]);
            (() => {
                let e, t, a, i, n, o, c = (0, r.c)(16),
                    {
                        addTab: u,
                        removeTab: m
                    } = (0, tl.useSportsItemStore)(td);
                c[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], c[0] = e) : e = c[0];
                let {
                    authenticated: p
                } = (0, d.useAccountContext)(e);
                c[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["activeMarket"], c[1] = t) : t = c[1];
                let {
                    activeMarket: h
                } = (0, to.useEventActiveMarketContext)(t), {
                    filledOrders: f
                } = (0, l.useFilledOrders)();
                c[2] !== h.closed || c[3] !== u || c[4] !== m ? (a = () => {
                    h.closed ? m(tc.SportsDetailTab.Book) : u(tc.SportsDetailTab.Book)
                }, c[2] = h.closed, c[3] = u, c[4] = m, c[5] = a) : a = c[5], c[6] !== h.closed ? (i = [h.closed], c[6] = h.closed, c[7] = i) : i = c[7], s.default.useEffect(a, i), c[8] !== u || c[9] !== p || c[10] !== f.length || c[11] !== m ? (n = () => {
                    p && f.length ? u(tc.SportsDetailTab.History) : m(tc.SportsDetailTab.History)
                }, c[8] = u, c[9] = p, c[10] = f.length, c[11] = m, c[12] = n) : n = c[12], c[13] !== p || c[14] !== f.length ? (o = [f.length, p], c[13] = p, c[14] = f.length, c[15] = o) : o = c[15], s.default.useEffect(n, o)
            })();
            let c = s.default.useRef(0),
                u = s.default.useMemo(() => {
                    let t = e ? ? 0,
                        r = c.current;
                    return r ? Math.min(Math.max(Math.abs(t - r) / 500, .15), .27) : .15
                }, [e]);
            s.default.useEffect(() => {
                c.current = e ? ? 0
            }, [e]);
            let m = s.default.useCallback(e => {
                    n(e)
                }, [n]),
                p = s.default.useMemo(() => a.map(e => ({
                    value: e,
                    label: e
                })), [a]);
            return (0, t.jsx)(x.BookContextProvider, {
                market: o,
                prefetch: {
                    book: "never",
                    lastPrice: "once-when-stale"
                },
                poll: "never",
                subscribe: "never",
                defer: "after-virtualized",
                children: (0, t.jsxs)("div", {
                    className: "w-full h-full bg-surface-1",
                    children: [(0, t.jsx)(tU, {
                        activeMarketFeesEnabled: o.feesEnabled,
                        onValueChange: m,
                        tab: i,
                        tabItems: p
                    }), i === tc.SportsDetailTab.Book && (0, t.jsx)("div", {
                        className: "w-full h-fit",
                        children: (0, t.jsx)(tB, {
                            duration: u,
                            children: (0, t.jsx)(ty, {})
                        })
                    }), i === tc.SportsDetailTab.Chart && (0, t.jsx)("div", {
                        className: "w-full h-fit pt-[21px] px-4",
                        children: (0, t.jsx)(tB, {
                            className: "pb-2",
                            duration: u,
                            children: (0, t.jsx)(tD, {})
                        })
                    }), i === tc.SportsDetailTab.History && (0, t.jsx)("div", {
                        className: "w-full",
                        children: (0, t.jsx)(tB, {
                            duration: u,
                            children: (0, t.jsx)(tq, {})
                        })
                    }), i === tc.SportsDetailTab.About && (0, t.jsx)("div", {
                        className: "w-full",
                        children: (0, t.jsx)(tB, {
                            duration: u,
                            children: (0, t.jsx)(tA, {})
                        })
                    })]
                })
            })
        },
        tG = e => {
            let a, i, n, s, o, l, c, d, u = (0, r.c)(18);
            if (u[0] !== e) {
                let {
                    ref: t,
                    className: r,
                    tabsId: o,
                    accordionId: l,
                    ...c
                } = e;
                n = t, i = r, a = l, s = c, u[0] = e, u[1] = a, u[2] = i, u[3] = n, u[4] = s
            } else a = u[1], i = u[2], n = u[3], s = u[4];
            let [m, p] = (0, tu.useMeasure)();
            return u[5] !== i ? (o = (0, D.cn)("relative w-full h-fit bg-transparent shrink-0 overflow-hidden data-[state=closed]:animate-accordionSlideUp data-[state=open]:animate-accordionSlideDown", i), u[5] = i, u[6] = o) : o = u[6], u[7] !== p.height ? (l = (0, t.jsx)(tW, {
                height: p.height
            }), u[7] = p.height, u[8] = l) : l = u[8], u[9] !== m || u[10] !== l ? (c = (0, t.jsx)("div", {
                className: "w-full h-fit bg-transparent shrink-0 max-h-[393px] lg:max-h-[401px] overflow-y-auto",
                children: (0, t.jsx)("div", {
                    ref: m,
                    children: l
                })
            }), u[9] = m, u[10] = l, u[11] = c) : c = u[11], u[12] !== a || u[13] !== n || u[14] !== s || u[15] !== o || u[16] !== c ? (d = (0, t.jsx)(eY.Accordion.Content, {
                ref: n,
                id: a,
                className: o,
                ...s,
                children: c
            }), u[12] = a, u[13] = n, u[14] = s, u[15] = o, u[16] = c, u[17] = d) : d = u[17], d
        };
    tG.displayName = "SportsAccordionItemContent";
    var tZ = e.i(798631),
        tK = e.i(219469),
        tY = e.i(415142),
        tQ = e.i(193789),
        tX = e.i(204996),
        tJ = e.i(294472),
        t0 = e.i(156591),
        t1 = e.i(557033);
    let t2 = (e, t = "price", r = {}) => {
            let a = (0, t0.getPrecisionFromTickSize)(e.market.orderPriceMinTickSize ? ? .01),
                i = parseFloat(e.order.price),
                n = `${(100*i).toFixed(a-2)}\xa2`,
                s = parseFloat(e.order.originalSize),
                o = parseFloat(e.order.sizeMatched),
                l = i * s,
                c = `$${l.toFixed(2)}`,
                {
                    formatted: d
                } = (0, t1.convertPrice)({
                    price: i,
                    outputMode: t,
                    inputMode: "decimal",
                    precision: a
                });
            return {
                side: e.order.side === h.Side.BUY ? "Buy" : "Sell",
                price: n,
                convertedPrice: d,
                filled: `${o.toFixed()} / ${s.toFixed()}`,
                filledQuantityNumber: o,
                totalQuantityNumber: s,
                totalValueNumber: l,
                total: c,
                expiration: (0, tJ.fromPossibleUnixToRelativeTime)(e.order.expiration, !0, r) ? ? "Until cancelled"
            }
        },
        t3 = ({
            sportsMarketType: e,
            order: t,
            market: r,
            oddsFormat: a = "price",
            timeTranslations: i = {}
        }) => {
            let n, s, o = (0, eu.getTeam)({
                    market: r,
                    outcomeIndex: t.outcomeIndex
                }),
                l = o ? .abbreviation ? (0, tX.upperCase)(o.abbreviation) : r.outcomes[t.outcomeIndex],
                {
                    line: c
                } = r;
            if ((0, eC.isSpreadMarket)(e)) {
                let a = (0, eu.getSpreadLineForOutcome)({
                        market: r,
                        outcomeIndex: t.outcomeIndex
                    }),
                    i = void 0 !== a ? a : void 0 !== c ? 0 === t.outcomeIndex ? c : -c : void 0;
                if (void 0 !== i) {
                    let t = (0, eu.getFormattedSpread)(i);
                    l += ` ${t}`, "first_half_spreads" === e && (l = `1H ${l}`), o && (n = o.color, s = o.logo)
                }
            }
            if (("both_teams_to_score" === e || "nrfi" === e) && (l = 0 === t.outcomeIndex ? "Yes" : "No", n = 0 === t.outcomeIndex ? "green" : "red", s = void 0), (0, eC.isTotalMarket)(e) && c) {
                let a = (0, eu.getFormattedOverUnder)({
                    outcomeIndex: t.outcomeIndex,
                    line: c,
                    truncate: !0
                });
                l = "first_half_totals" === e ? `1H ${a}` : "first_innings_totals" === e ? `1st Inn ${a}` : "second_innings_totals" === e ? `2nd Inn ${a}` : a, n = 0 === t.outcomeIndex ? "green" : "red", ("tennis_first_set_totals" === e || "tennis_set_totals" === e || "tennis_match_totals" === e) && (r.team ? s = r.team.logo : r.teams && r.teams.length > 0 && (s = r.teams[0].logo))
            }
            return {
                key: `${r.conditionId}-${t.outcomeIndex}`,
                label: l,
                color: n,
                market: r,
                outcomeIndex: t.outcomeIndex,
                isNegRiskDraw: !1,
                logo: s,
                type: (0, eu.getSportsMarketType)(r).formatted,
                ...t2(t, a, i),
                sortKey: (({
                    order: e,
                    market: t
                }) => {
                    if (e.isNegRisk) {
                        if ("draw" === t.negRiskSportsMarketType) return 3 + e.outcomeIndex;
                        if ("home" === t.negRiskSportsMarketType) return 1 + e.outcomeIndex;
                        if ("away" === t.negRiskSportsMarketType) return 5 + e.outcomeIndex
                    }
                    return e.outcomeIndex + 1
                })({
                    order: t,
                    market: r
                })
            }
        },
        t4 = ({
            order: e,
            market: t,
            oddsFormat: r = "price",
            timeTranslations: a = {}
        }) => {
            let i, n, s = (0, eu.getTeam)({
                    market: t,
                    outcomeIndex: e.outcomeIndex
                }),
                o = s ? .abbreviation ? (0, tX.upperCase)(s.abbreviation) : t.outcomes[e.outcomeIndex],
                l = 1,
                c = e.isNegRisk && "draw" === t.negRiskSportsMarketType;
            if ("nrfi" === t.sportsMarketType && (o = "NRFI", i = 0 === e.outcomeIndex ? "green" : "red", n = void 0), "both_teams_to_score" === t.sportsMarketType && (o = "BTTS", i = 0 === e.outcomeIndex ? "green" : "red", n = void 0), "ufc_go_the_distance" === t.sportsMarketType && (o = 0 === e.outcomeIndex ? "Yes" : "No", i = 0 === e.outcomeIndex ? "green" : "red", n = void 0), ("anytime_touchdowns" === t.sportsMarketType || "first_touchdowns" === t.sportsMarketType || "two_plus_touchdowns" === t.sportsMarketType || "soccer_anytime_goalscorer" === t.sportsMarketType || "soccer_exact_score" === t.sportsMarketType || "tennis_completed_match" === t.sportsMarketType) && (o = 0 === e.outcomeIndex ? "Yes" : "No", i = 0 === e.outcomeIndex ? "green" : "red", n = t.image ? ? t.icon ? ? void 0), "ufc_method_of_victory" === t.sportsMarketType && (o = t.groupItemTitle ? `${t.groupItemTitle} ${t.outcomes[e.outcomeIndex]}` : t.outcomes[e.outcomeIndex], i = 0 === e.outcomeIndex ? "green" : "red", n = void 0), "cricket_most_sixes" === t.sportsMarketType || "cricket_team_top_batter" === t.sportsMarketType || "cricket_toss_match_double" === t.sportsMarketType || "soccer_halftime_result" === t.sportsMarketType)
                if (t.groupItemTitle ? .toUpperCase() === "DRAW") o = `Draw ${t.outcomes[e.outcomeIndex]}`, i = "gray", n = void 0;
                else {
                    let r = t.teams ? .find(e => e.abbreviation ? .toUpperCase() === t.groupItemTitle ? .toUpperCase() || e.name ? .toUpperCase() === t.groupItemTitle ? .toUpperCase() || e.alias ? .toUpperCase() === t.groupItemTitle ? .toUpperCase());
                    r ? (o = `${(0,tX.upperCase)(r.abbreviation)} ${t.outcomes[e.outcomeIndex]}`, i = r.color, n = r.logo) : (o = `${t.groupItemTitle} ${t.outcomes[e.outcomeIndex]}`, i = "blue")
                }
            if ("parlays" === t.sportsMarketType) {
                let r = (t.question || "").split(" - "),
                    a = r.length >= 1 ? r[0].trim() : "Parlay";
                o = `${a}`, i = 0 === e.outcomeIndex ? "green" : "red", n = void 0
            }
            return e.isNegRisk ? (c && (o = `Draw ${t.outcomes[e.outcomeIndex]}`, i = "gray", l = 3 + e.outcomeIndex, n = void 0), "home" === t.negRiskSportsMarketType && (s ? (o = `${(0,tX.upperCase)(s.abbreviation)} ${t.outcomes[e.outcomeIndex]}`, i = s.color ? ? "blue", n = s.logo) : (o = `${t.groupItemTitle} ${t.outcomes[e.outcomeIndex]}`, i = "blue"), l = 1 + e.outcomeIndex), "away" === t.negRiskSportsMarketType && (s ? (o = `${(0,tX.upperCase)(s.abbreviation)} ${t.outcomes[e.outcomeIndex]}`, i = s.color ? ? "blue", n = s.logo) : (o = `${t.groupItemTitle} ${t.outcomes[e.outcomeIndex]}`, i = "blue"), l = 5 + e.outcomeIndex)) : l = parseFloat(e.order.originalSize) * (100 * parseFloat(e.order.price)), !e.isNegRisk && s && "nrfi" !== t.sportsMarketType && "both_teams_to_score" !== t.sportsMarketType && "ufc_go_the_distance" !== t.sportsMarketType && "ufc_method_of_victory" !== t.sportsMarketType && "parlays" !== t.sportsMarketType && "cricket_most_sixes" !== t.sportsMarketType && "cricket_team_top_batter" !== t.sportsMarketType && "cricket_toss_match_double" !== t.sportsMarketType && "anytime_touchdowns" !== t.sportsMarketType && "first_touchdowns" !== t.sportsMarketType && "two_plus_touchdowns" !== t.sportsMarketType && "soccer_anytime_goalscorer" !== t.sportsMarketType && "soccer_exact_score" !== t.sportsMarketType && "soccer_halftime_result" !== t.sportsMarketType && "tennis_completed_match" !== t.sportsMarketType && (i = s.color, n = s.logo), "first_half_moneyline" === t.sportsMarketType && (o = `1H ${o}`), {
                key: `${t.conditionId}-${e.outcomeIndex}`,
                label: o,
                sortKey: l,
                color: i,
                market: t,
                outcomeIndex: e.outcomeIndex,
                logo: n,
                isNegRiskDraw: c,
                type: (0, eu.getSportsMarketType)(t).formatted,
                ...t2(e, r, a)
            }
        };
    var t5 = e.i(373898),
        t6 = e.i(525962),
        t9 = e.i(577103);
    let t8 = e => {
        let t, a, i, n, s = (0, r.c)(9);
        s[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["activeMarket"], s[0] = t) : t = s[0];
        let {
            activeMarket: o
        } = (0, to.useEventActiveMarketContext)(t), l = (0, tm.useBoundSportsStore)();
        s[1] !== e ? (a = e.map(t7), s[1] = e, s[2] = a) : a = s[2];
        let c = a,
            d = c.length ? c[0].associatedMarket : o;
        s[3] !== c || s[4] !== d ? (i = {
            openOrders: c,
            market: d
        }, s[3] = c, s[4] = d, s[5] = i) : i = s[5];
        let u = i,
            m = (0, t9.useCancelAllOpenOrders)(u);
        return s[6] !== m || s[7] !== l ? (n = async () => {
            await m(), l && (l.getState().setOverlayAccordionValue(""), l.getState().setGamesAccordionValue(""))
        }, s[6] = m, s[7] = l, s[8] = n) : n = s[8], n
    };

    function t7(e) {
        return { ...e.order,
            associatedMarket: e.market
        }
    }
    var re = e.i(918997);
    let rt = e => {
        let i, n, s, o, l, c, d, u, m, p, h, f, x, g, v = (0, r.c)(41),
            {
                open: b,
                setOpen: k,
                children: w,
                options: S,
                onConfirm: j
            } = e,
            C = (0, y.useTranslations)();
        v[0] !== b || v[1] !== k ? (i = {
            prop: b,
            defaultProp: !1,
            onChange: k
        }, v[0] = b, v[1] = k, v[2] = i) : i = v[2];
        let [_, T] = (0, re.useControllableState)(i), M = void 0 !== _ && _;
        e: {
            let e;
            if ("single" === S.variant) {
                let e;
                v[3] !== C ? (e = C("orders.cancelSingleOrder"), v[3] = C, v[4] = e) : e = v[4], n = e;
                break e
            }
            v[5] !== S.quantity || v[6] !== C ? (e = C("orders.cancelMultipleOrders").replace("{count}", S.quantity.toString()), v[5] = S.quantity, v[6] = C, v[7] = e) : e = v[7],
            n = e
        }
        let N = n;
        return v[8] !== C ? (s = C("orders.areYouSure"), v[8] = C, v[9] = s) : s = v[9], v[10] !== s ? (o = (0, t.jsx)(t6.ModalHeader, {
            children: (0, t.jsx)(t6.ModalTitle, {
                children: s
            })
        }), v[10] = s, v[11] = o) : o = v[11], v[12] !== N ? (l = (0, t.jsx)(t6.ModalDescription, {
            children: N
        }), v[12] = N, v[13] = l) : l = v[13], v[14] !== T ? (c = () => T(!1), v[14] = T, v[15] = c) : c = v[15], v[16] !== C ? (d = C("orders.neverMind"), v[16] = C, v[17] = d) : d = v[17], v[18] !== c || v[19] !== d ? (u = (0, t.jsx)(a.Button, {
            variant: "outline",
            onClick: c,
            children: d
        }), v[18] = c, v[19] = d, v[20] = u) : u = v[20], v[21] !== j || v[22] !== T ? (m = e => {
            e.preventDefault(), e.stopPropagation(), j(), T(!1)
        }, v[21] = j, v[22] = T, v[23] = m) : m = v[23], v[24] !== C ? (p = C("orders.confirm"), v[24] = C, v[25] = p) : p = v[25], v[26] !== m || v[27] !== p ? (h = (0, t.jsx)(a.Button, {
            variant: "destructive",
            onClick: m,
            children: p
        }), v[26] = m, v[27] = p, v[28] = h) : h = v[28], v[29] !== h || v[30] !== u ? (f = (0, t.jsxs)(t6.ModalFooter, {
            children: [u, h]
        }), v[29] = h, v[30] = u, v[31] = f) : f = v[31], v[32] !== f || v[33] !== o || v[34] !== l ? (x = (0, t.jsxs)(t6.ModalContent, {
            onClick: rr,
            children: [o, l, f]
        }), v[32] = f, v[33] = o, v[34] = l, v[35] = x) : x = v[35], v[36] !== w || v[37] !== M || v[38] !== T || v[39] !== x ? (g = (0, t.jsxs)(t6.Modal, {
            open: M,
            onOpenChange: T,
            children: [w, x]
        }), v[36] = w, v[37] = M, v[38] = T, v[39] = x, v[40] = g) : g = v[40], g
    };

    function rr(e) {
        e.preventDefault(), e.stopPropagation()
    }
    var ra = e.i(318594),
        ri = e.i(405473),
        rn = e.i(510954),
        rs = e.i(57096),
        ro = e.i(169010),
        rl = e.i(377960);
    let rc = (0, P.cva)("relative flex w-fit h-[26px] justify-center items-center pl-[7px] pr-[9px] rounded-[4px] whitespace-nowrap !text-[13px] leading-[18px] font-medium dark:mix-blend-plus-lighter select-none", {
            variants: {
                dim: {
                    true: ["bg-[var(--chip-color)]/10"],
                    false: ["bg-[var(--chip-color)]"]
                },
                hoverable: {
                    true: ["cursor-pointer", "transition-colors", "duration-100"],
                    false: ["cursor-default"]
                },
                variant: {
                    filled: [],
                    outlined: ["bg-transparent", "border-1", "border-[var(--chip-color)]/75", "border-dashed"]
                },
                uppercase: {
                    true: ["uppercase"],
                    false: []
                },
                reversed: {
                    true: ["flex-row-reverse"],
                    false: ["flex-row"]
                },
                closeOutOnIconOnly: {
                    true: ["cursor-default"],
                    false: []
                }
            },
            compoundVariants: [{
                dim: !0,
                variant: "filled",
                class: "bg-[var(--chip-color)]/10"
            }, {
                dim: !1,
                variant: "filled",
                class: "bg-[var(--chip-color)]"
            }, {
                dim: !0,
                hoverable: !0,
                variant: "filled",
                class: "hover:bg-[var(--chip-color)]/25"
            }, {
                hoverable: !1,
                variant: "filled",
                class: "hover:bg-background"
            }, {
                hoverable: !0,
                variant: "outlined",
                class: "hover:bg-[var(--chip-color)]/10"
            }, {
                closeOutOnIconOnly: !0,
                hoverable: !0,
                class: "cursor-pointer"
            }]
        }),
        rd = {
            ease: tF.transition.ease,
            duration: .15
        },
        ru = {
            show: {},
            hide: {}
        },
        rm = {
            show: {
                opacity: 1,
                width: "20px",
                transition: {
                    ease: tF.transition.ease,
                    duration: .15,
                    opacity: {
                        ease: tF.opacityTransition.ease,
                        duration: .175
                    }
                }
            },
            hide: {
                opacity: 0,
                width: 0,
                transition: {
                    ease: tF.transition.ease,
                    duration: .175,
                    opacity: {
                        ease: tF.opacityTransition.ease,
                        duration: .125
                    }
                }
            }
        },
        rp = e => {
            let a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E = (0, r.c)(75);
            E[0] !== e ? ({
                ref: p,
                shareQuantity: x,
                label: d,
                outcomeIndex: m,
                color: o,
                hoverable: c,
                uppercase: g,
                reversed: v,
                className: a,
                allowCloseOut: y,
                hoverVariableToSuppress: l,
                closeOutText: s,
                closeOutSecondaryText: n,
                variant: b,
                onClick: u,
                restingFillWidth: f,
                closeOutOnIconOnly: i,
                ...h
            } = e, E[0] = e, E[1] = a, E[2] = i, E[3] = n, E[4] = s, E[5] = o, E[6] = l, E[7] = c, E[8] = d, E[9] = u, E[10] = m, E[11] = p, E[12] = h, E[13] = f, E[14] = x, E[15] = g, E[16] = v, E[17] = y, E[18] = b) : (a = E[1], i = E[2], n = E[3], s = E[4], o = E[5], l = E[6], c = E[7], d = E[8], u = E[9], m = E[10], p = E[11], h = E[12], f = E[13], x = E[14], g = E[15], v = E[16], y = E[17], b = E[18]);
            let A = void 0 === g || g,
                O = void 0 !== v && v,
                L = void 0 !== y && y,
                z = void 0 === b ? "filled" : b,
                R = (0, tl.useBoundSportsItemStore)();
            e: {
                let e, t;
                if ("gray" === o) {
                    let e, t;
                    E[19] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        "--chip-color": "var(--neutral-50)",
                        "--chip-text-color": "var(--neutral-500)",
                        "--chip-divider-color": "var(--neutral-500)"
                    }, E[19] = e) : e = E[19], E[20] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                        styles: e,
                        dim: !1
                    }, E[20] = t) : t = E[20], k = t;
                    break e
                }
                if ("green" === o || !o && 0 === m) {
                    let e, t;
                    E[21] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        "--chip-color": "var(--green-500)",
                        "--chip-text-color": "var(--green-500)",
                        "--chip-divider-color": "var(--green-500)"
                    }, E[21] = e) : e = E[21], E[22] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                        styles: e,
                        dim: !0
                    }, E[22] = t) : t = E[22], k = t;
                    break e
                }
                if ("red" === o || !o && 1 === m) {
                    let e, t;
                    E[23] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        "--chip-color": "var(--red-600)",
                        "--chip-text-color": "var(--red-600)",
                        "--chip-divider-color": "var(--red-600)"
                    }, E[23] = e) : e = E[23], E[24] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                        styles: e,
                        dim: !0
                    }, E[24] = t) : t = E[24], k = t;
                    break e
                }
                let r = o && o.startsWith("#") ? o : "var(--green-500)";E[25] !== r ? (e = {
                    "--chip-color": r,
                    "--chip-text-color": r,
                    "--chip-divider-color": r
                }, E[25] = r, E[26] = e) : e = E[26];
                let a = e;E[27] !== a ? (t = {
                    styles: a,
                    dim: !0
                }, E[27] = a, E[28] = t) : t = E[28],
                k = t
            }
            let {
                styles: F,
                dim: $
            } = k;
            E[29] !== l || E[30] !== R ? (w = () => {
                "position-accordion" === l && R ? .getState() ? .setPreventPositionsAccordionHover(!0), "order-accordion" === l && R ? .getState() ? .setPreventOrdersAccordionHover(!0)
            }, E[29] = l, E[30] = R, E[31] = w) : w = E[31];
            let B = w;
            E[32] !== l || E[33] !== R ? (S = e => {
                "position-accordion" === l && R ? .getState() ? .setPreventPositionsAccordionHover(!1), "order-accordion" === l && R ? .getState() ? .setPreventOrdersAccordionHover(!1)
            }, E[32] = l, E[33] = R, E[34] = S) : S = E[34];
            let q = S;
            E[35] !== i || E[36] !== u ? (j = e => {
                e.preventDefault(), e.stopPropagation(), i || u ? .(e)
            }, E[35] = i, E[36] = u, E[37] = j) : j = E[37];
            let V = j;
            E[38] !== i || E[39] !== u ? (C = e => {
                i && (e.preventDefault(), e.stopPropagation(), u ? .(e))
            }, E[38] = i, E[39] = u, E[40] = C) : C = E[40];
            let H = C;
            return E[41] !== a || E[42] !== i || E[43] !== $ || E[44] !== c || E[45] !== O || E[46] !== A || E[47] !== z ? (_ = (0, D.cn)(rc({
                dim: $,
                hoverable: c,
                variant: z,
                uppercase: A,
                reversed: O,
                closeOutOnIconOnly: i
            }), a), E[41] = a, E[42] = i, E[43] = $, E[44] = c, E[45] = O, E[46] = A, E[47] = z, E[48] = _) : _ = E[48], E[49] !== f || E[50] !== z ? (T = "outlined" === z && void 0 !== f && (0, t.jsx)(tR.motion.div, {
                initial: {
                    width: "0%"
                },
                animate: {
                    width: `${100*f}%`
                },
                className: "absolute left-0 top-0 h-full bg-[var(--chip-color)]/15",
                transition: rd
            }), E[49] = f, E[50] = z, E[51] = T) : T = E[51], E[52] !== x ? (M = !!x && (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)("span", {
                    className: "text-[var(--chip-text-color)] dark:mix-blend-plus-lighter order-3",
                    children: x
                }), (0, t.jsx)("div", {
                    className: "w-[1px] h-[16px] bg-[var(--chip-divider-color)]/30 dark:mix-blend-plus-lighter order-4 mx-2"
                })]
            }), E[52] = x, E[53] = M) : M = E[53], E[54] !== d ? (N = (0, t.jsx)("span", {
                className: "text-[var(--chip-text-color)] dark:mix-blend-plus-lighter order-5",
                children: d
            }), E[54] = d, E[55] = N) : N = E[55], E[56] !== L || E[57] !== i || E[58] !== n || E[59] !== s || E[60] !== H || E[61] !== O ? (I = L && (0, t.jsx)(ro.Tooltip, {
                delayDuration: 0,
                triggerAsChild: !0,
                side: "top",
                align: "center",
                sideOffset: 7,
                content: (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)("p", {
                        className: "",
                        children: s
                    }), n && (0, t.jsx)("p", {
                        className: "text-xs text-text-secondary pt-1",
                        children: n
                    })]
                }),
                children: (0, t.jsx)(tR.motion.div, {
                    className: (0, D.cn)("relative flex justify-end items-center cursor-pointer [&_svg]:pointer-events-none max-h-[18px] min-h-[18px] h-[18px]", !O && "order-7", O && "order-1", i && "cursor-pointer"),
                    variants: rm,
                    onClick: H,
                    children: (0, t.jsx)(rl.IconXmarkOutline18, {
                        size: 14,
                        color: "var(--chip-text-color)"
                    })
                }, "close-icon")
            }), E[56] = L, E[57] = i, E[58] = n, E[59] = s, E[60] = H, E[61] = O, E[62] = I) : I = E[62], E[63] !== V || E[64] !== B || E[65] !== q || E[66] !== p || E[67] !== h || E[68] !== F || E[69] !== _ || E[70] !== T || E[71] !== M || E[72] !== N || E[73] !== I ? (P = (0, t.jsxs)(tR.motion.div, {
                ref: p,
                onMouseEnter: B,
                onMouseLeave: q,
                className: _,
                style: F,
                onClick: V,
                variants: ru,
                initial: "hide",
                animate: "hide",
                whileHover: "show",
                exit: "hide",
                ...h,
                children: [T, M, N, I]
            }), E[63] = V, E[64] = B, E[65] = q, E[66] = p, E[67] = h, E[68] = F, E[69] = _, E[70] = T, E[71] = M, E[72] = N, E[73] = I, E[74] = P) : P = E[74], P
        };
    rp.displayName = "SportsPositionOutcomeChip", e.s(["SportsPositionOutcomeChip", 0, rp], 294377);
    let rh = e => {
        let a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v = (0, r.c)(30);
        return v[0] !== e ? ({
            ref: s,
            label: i,
            value: c,
            valueSuffix: u,
            suffixClassname: l,
            labelClassname: n,
            valueClassname: d,
            className: a,
            ...o
        } = e, v[0] = e, v[1] = a, v[2] = i, v[3] = n, v[4] = s, v[5] = o, v[6] = l, v[7] = c, v[8] = d, v[9] = u) : (a = v[1], i = v[2], n = v[3], s = v[4], o = v[5], l = v[6], c = v[7], d = v[8], u = v[9]), v[10] !== a ? (m = (0, D.cn)("flex flex-col gap-1", a), v[10] = a, v[11] = m) : m = v[11], v[12] !== i || v[13] !== n ? (p = !!i && (0, t.jsx)("p", {
            className: (0, D.cn)("text-xs font-normal", n),
            children: i
        }), v[12] = i, v[13] = n, v[14] = p) : p = v[14], v[15] !== d ? (h = (0, D.cn)("text-sm font-normal", d), v[15] = d, v[16] = h) : h = v[16], v[17] !== l || v[18] !== u ? (f = !!u && (0, t.jsx)("span", {
            className: l,
            children: u
        }), v[17] = l, v[18] = u, v[19] = f) : f = v[19], v[20] !== h || v[21] !== f || v[22] !== c ? (x = (0, t.jsxs)("p", {
            className: h,
            children: [c, f]
        }), v[20] = h, v[21] = f, v[22] = c, v[23] = x) : x = v[23], v[24] !== s || v[25] !== o || v[26] !== m || v[27] !== p || v[28] !== x ? (g = (0, t.jsxs)("div", {
            ref: s,
            className: m,
            ...o,
            children: [p, x]
        }), v[24] = s, v[25] = o, v[26] = m, v[27] = p, v[28] = x, v[29] = g) : g = v[29], g
    };
    rh.displayName = "SportsItemPositionDataPoint", e.s(["SportsItemPositionDataPoint", 0, rh], 575865);
    let rf = ({
        ref: e,
        order: r,
        view: a,
        shrinkButton: i = !1,
        variant: n = "card",
        showMarketType: o = !0,
        ...l
    }) => {
        let c = (0, ra.useQueryClient)(),
            d = (0, t5.default)(),
            u = (0, tm.useSportsStore)(e => e.oddsFormat),
            m = (0, el.useMessages)().time,
            p = s.default.useCallback(async () => {
                try {
                    await d(r.order, r.market, !1)
                } finally {
                    c.invalidateQueries({
                        queryKey: rn.queryKeys[rs.QueryKey.OpenOrders]._def
                    })
                }
            }, [d, c, r]),
            {
                type: h,
                side: f,
                label: x,
                color: g,
                convertedPrice: v,
                filled: y,
                total: b,
                expiration: k
            } = s.default.useMemo(() => (0, eC.isSpreadMarket)(r.market.sportsMarketType) || (0, eC.isTotalMarket)(r.market.sportsMarketType) ? t3({
                sportsMarketType: r.market.sportsMarketType,
                order: r,
                market: r.market,
                oddsFormat: u,
                timeTranslations: m
            }) : t4({
                order: r,
                market: r.market,
                oddsFormat: u,
                timeTranslations: m
            }), [r, u, m]);
        return (0, t.jsxs)("div", {
            ref: e,
            className: "contents w-full overflow-hidden bg-background",
            ...l,
            children: [o && (0, t.jsx)(rh, {
                value: h,
                className: "col-1"
            }), (0, t.jsx)(rh, {
                value: f,
                className: (0, D.cn)("col-2", !o && "col-1")
            }), (0, t.jsx)("div", {
                className: (0, D.cn)("flex gap-3 items-center col-3 bg-inherit", !o && "col-2"),
                children: (0, t.jsx)(rp, {
                    label: x,
                    outcomeIndex: r.outcomeIndex,
                    color: g
                })
            }), (0, t.jsx)(rh, {
                value: v,
                className: (0, D.cn)("col-4", !o && "col-3")
            }), (0, t.jsx)(rh, {
                value: y,
                className: (0, D.cn)("col-5", !o && "col-4")
            }), (0, t.jsx)(rh, {
                value: b,
                className: (0, D.cn)("col-6", !o && "col-5")
            }), (0, t.jsx)(rh, {
                value: k,
                className: (0, D.cn)("col-7", !o && "col-6")
            }), (0, t.jsx)("div", {
                className: (0, D.cn)("flex flex-1 justify-end col-8 gap-2", !o && "col-7"),
                children: (0, t.jsx)(ri.default, {
                    mode: "single",
                    callback: () => {
                        p()
                    }
                })
            })]
        })
    };
    rf.displayName = "DesktopSportsItemOrder";
    let rx = ["type", "side", "outcome", "price", "filled", "total", "exp."],
        rg = {
            duration: .27,
            ease: [.26, .08, .25, 1]
        },
        rv = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: { ...rg,
                    delay: .2
                }
            },
            exit: {
                overflow: "visible",
                opacity: 0,
                height: 0,
                transition: { ...rg
                }
            }
        },
        ry = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: { ...rg,
                    delay: .2
                }
            },
            exit: {
                overflow: "visible",
                opacity: 0,
                height: 0,
                transition: { ...rg
                }
            }
        },
        rb = e => {
            let a, i, n, o, l, c, d, u, m, p, h, f, x, g, v, b = (0, r.c)(32);
            if (b[0] !== e) {
                let {
                    ref: t,
                    items: r,
                    orders: s,
                    view: d,
                    variant: u,
                    showMarketType: m,
                    ...p
                } = e;
                n = t, o = r, a = s, l = u, c = m, i = p, b[0] = e, b[1] = a, b[2] = i, b[3] = n, b[4] = o, b[5] = l, b[6] = c
            } else a = b[1], i = b[2], n = b[3], o = b[4], l = b[5], c = b[6];
            let k = void 0 === o ? rx : o,
                w = (0, y.useTranslations)(),
                S = t8(a),
                [j, C] = s.default.useState(!1);
            b[7] !== S ? (d = async () => {
                await S(), C(!1)
            }, b[7] = S, b[8] = d) : d = b[8];
            let _ = d;
            b[9] !== a.length ? (u = {
                variant: "multiple",
                quantity: a.length
            }, b[9] = a.length, b[10] = u) : u = b[10];
            let T = u;
            b[11] !== k ? (m = k.map(rw), b[11] = k, b[12] = m) : m = b[12];
            let M = k.length + 1;
            return b[13] !== M ? (p = {
                gridColumn: M
            }, b[13] = M, b[14] = p) : p = b[14], b[15] !== w ? (h = w("rewards.trading.cancelAll"), b[15] = w, b[16] = h) : h = b[16], b[17] !== p || b[18] !== h ? (f = (0, t.jsx)(t6.ModalTrigger, {
                asChild: !0,
                children: (0, t.jsx)("button", {
                    type: "button",
                    className: "font-medium text-red-600 text-[10px] uppercase tracking-widest cursor-pointer opacity-100 hover:opacity-80 transition-opacity",
                    style: p,
                    children: h
                })
            }), b[17] = p, b[18] = h, b[19] = f) : f = b[19], b[20] !== j || b[21] !== T || b[22] !== _ || b[23] !== f ? (x = (0, t.jsx)(rt, {
                open: j,
                setOpen: C,
                onConfirm: _,
                options: T,
                children: f
            }), b[20] = j, b[21] = T, b[22] = _, b[23] = f, b[24] = x) : x = b[24], b[25] !== x || b[26] !== m ? (g = (0, t.jsxs)("div", {
                className: "w-full contents overflow-hidden",
                children: [m, x]
            }), b[25] = x, b[26] = m, b[27] = g) : g = b[27], b[28] !== i || b[29] !== n || b[30] !== g ? (v = (0, t.jsx)(tR.motion.div, {
                ref: n,
                className: "grid !grid-cols-subgrid col-span-full w-full py-2 px-4 border-b not-supports-[grid-template-columns:subgrid]:grid-cols-[auto_auto_minmax(50px,auto)_minmax(50px,auto)_minmax(80px,auto)_minmax(50px,auto)_minmax(50px,auto)_minmax(50px,auto)] sticky top-[0px] bg-surface-1 z-10",
                variants: rv,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                ...i,
                children: g
            }), b[28] = i, b[29] = n, b[30] = g, b[31] = v) : v = b[31], v
        };
    rb.displayName = "OrderHeader";
    let rk = e => {
        let a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v = (0, r.c)(34);
        v[0] !== e ? ({
            ref: o,
            orders: s,
            view: u,
            className: i,
            children: a,
            expandMobile: n,
            variant: c,
            showMarketType: d,
            ...l
        } = e, v[0] = e, v[1] = a, v[2] = i, v[3] = n, v[4] = s, v[5] = o, v[6] = l, v[7] = c, v[8] = d, v[9] = u) : (a = v[1], i = v[2], n = v[3], s = v[4], o = v[5], l = v[6], c = v[7], d = v[8], u = v[9]);
        let y = void 0 === c ? "card" : c,
            b = void 0 === d || d;
        e: {
            if (!b) {
                let e;
                v[10] === Symbol.for("react.memo_cache_sentinel") ? (e = rx.slice(1), v[10] = e) : e = v[10], m = e;
                break e
            }
            m = rx
        }
        let k = m,
            w = n && "px-[12px]";
        return v[11] !== i || v[12] !== w ? (p = (0, D.cn)("grid relative min-w-max pb-2 w-full items-center gap-y-2 gap-x-5 grid-rows-[_1fr] grid-cols-[auto_auto_auto_auto_auto_auto_auto_auto] max-h-[300px] overflow-y-scroll", w, i), v[11] = i, v[12] = w, v[13] = p) : p = v[13], v[14] !== k || v[15] !== s || v[16] !== y || v[17] !== u ? (h = (0, t.jsx)(rb, {
            orders: s,
            view: u,
            variant: y,
            items: k
        }), v[14] = k, v[15] = s, v[16] = y, v[17] = u, v[18] = h) : h = v[18], v[19] !== n || v[20] !== s || v[21] !== b || v[22] !== y || v[23] !== u ? (f = s ? .map(e => (0, t.jsx)(tR.motion.div, {
            className: (0, D.cn)("grid col-span-full grid-cols-subgrid w-full px-4 items-center", n && "px-0"),
            variants: ry,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            children: (0, t.jsx)(rf, {
                order: e,
                view: u,
                variant: y,
                showMarketType: b,
                shrinkButton: !0
            })
        }, `order-wrapper-${e.order.orderID}`)), v[19] = n, v[20] = s, v[21] = b, v[22] = y, v[23] = u, v[24] = f) : f = v[24], v[25] !== h || v[26] !== f ? (x = (0, t.jsxs)(tK.AnimatePresence, {
            initial: !1,
            mode: "sync",
            children: [h, f]
        }), v[25] = h, v[26] = f, v[27] = x) : x = v[27], v[28] !== a || v[29] !== o || v[30] !== l || v[31] !== p || v[32] !== x ? (g = (0, t.jsx)("div", {
            className: "w-full h-max overflow-x-auto",
            children: (0, t.jsxs)("div", {
                ref: o,
                className: p,
                ...l,
                children: [a, x]
            })
        }), v[28] = a, v[29] = o, v[30] = l, v[31] = p, v[32] = x, v[33] = g) : g = v[33], g
    };

    function rw(e, r) {
        return (0, t.jsx)("p", {
            className: "font-medium text-text-secondary text-[10px] uppercase tracking-wider",
            style: {
                gridColumn: r + 1
            },
            children: e
        }, e)
    }
    rk.displayName = "DesktopSportsItemOrders", e.s(["DesktopSportsItemOrders", 0, rk], 953144);
    var rS = e.i(780641),
        rj = e.i(684686),
        rC = e.i(479399),
        r_ = e.i(474280);
    let rT = {
            duration: .2,
            ease: [.175, .885, .32, .98]
        },
        rM = {
            type: "tween",
            duration: .2,
            ease: (0, rC.cubicBezier)(.4, 0, .2, 1)
        },
        rN = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1
            },
            exit: {
                opacity: 0
            }
        },
        rI = {
            opacity: .9,
            scale: .9
        };

    function rP(e) {
        let a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k = (0, r.c)(45);
        if (k[0] !== e) {
            let {
                ref: t,
                order: r,
                market: l,
                colors: c,
                handleCancelOrder: d,
                className: u,
                ...m
            } = e;
            s = t, n = r, i = d, a = u, o = m, k[0] = e, k[1] = a, k[2] = i, k[3] = n, k[4] = s, k[5] = o
        } else a = k[1], i = k[2], n = k[3], s = k[4], o = k[5];
        let w = (0, el.useMessages)().time;
        e: {
            let e;
            if ("spreads" === n.market.sportsMarketType || "totals" === n.market.sportsMarketType || "first_half_spreads" === n.market.sportsMarketType || "first_half_totals" === n.market.sportsMarketType || "first_innings_totals" === n.market.sportsMarketType || "second_innings_totals" === n.market.sportsMarketType) {
                let e;
                k[6] !== n || k[7] !== w ? (e = t3({
                    sportsMarketType: n.market.sportsMarketType,
                    order: n,
                    market: n.market,
                    timeTranslations: w
                }), k[6] = n, k[7] = w, k[8] = e) : e = k[8], l = e;
                break e
            }
            k[9] !== n || k[10] !== w ? (e = t4({
                order: n,
                market: n.market,
                timeTranslations: w
            }), k[9] = n, k[10] = w, k[11] = e) : e = k[11],
            l = e
        }
        let {
            color: S,
            label: j,
            expiration: C,
            outcomeIndex: _,
            price: T,
            filled: M,
            side: N
        } = l;
        k[12] !== i || k[13] !== n ? (c = e => {
            e.preventDefault(), e.stopPropagation(), i(n)
        }, k[12] = i, k[13] = n, k[14] = c) : c = k[14];
        let I = c;
        k[15] !== a ? (d = (0, D.cn)("flex w-full justify-between bg-background not-last:border-b", a), k[15] = a, k[16] = d) : d = k[16], k[17] !== S || k[18] !== j || k[19] !== _ ? (u = (0, t.jsx)(rp, {
            label: j,
            outcomeIndex: _,
            color: S,
            className: "h-[20px] text-xs px-[6px]"
        }), k[17] = S, k[18] = j, k[19] = _, k[20] = u) : u = k[20], k[21] !== C ? (m = (0, t.jsx)("span", {
            className: "text-xs font-medium text-neutral-400",
            children: C
        }), k[21] = C, k[22] = m) : m = k[22], k[23] !== u || k[24] !== m ? (p = (0, t.jsxs)("div", {
            className: "flex flex-col items-start gap-2 bg-inherit",
            children: [u, m]
        }), k[23] = u, k[24] = m, k[25] = p) : p = k[25];
        let P = `${N} ${T}`;
        k[26] !== P ? (h = (0, t.jsx)("span", {
            className: "text-sm font-medium text-neutral-900",
            children: P
        }), k[26] = P, k[27] = h) : h = k[27];
        let E = `${M} filled`;
        return k[28] !== E ? (f = (0, t.jsx)("span", {
            className: "text-xs font-medium text-neutral-400",
            children: E
        }), k[28] = E, k[29] = f) : f = k[29], k[30] !== f || k[31] !== h ? (x = (0, t.jsxs)("div", {
            className: "flex flex-col items-end gap-1",
            children: [h, f]
        }), k[30] = f, k[31] = h, k[32] = x) : x = k[32], k[33] === Symbol.for("react.memo_cache_sentinel") ? (g = (0, t.jsx)(r_.IconXmarkFill18, {
            className: "text-xl text-text"
        }), k[33] = g) : g = k[33], k[34] !== I ? (v = (0, t.jsx)(tR.motion.button, {
            transition: rT,
            whileTap: rI,
            onClick: I,
            className: "flex size-8 justify-center items-center p-0 bg-neutral-100 hover:bg-neutral-200 focus:bg-neutral-200 active:bg-neutral-200",
            children: g
        }), k[34] = I, k[35] = v) : v = k[35], k[36] !== x || k[37] !== v ? (y = (0, t.jsxs)("div", {
            className: "flex justify-end items-center gap-4",
            children: [x, v]
        }), k[36] = x, k[37] = v, k[38] = y) : y = k[38], k[39] !== s || k[40] !== o || k[41] !== y || k[42] !== d || k[43] !== p ? (b = (0, t.jsxs)(tR.motion.div, {
            ref: s,
            variants: rN,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            transition: rM,
            className: d,
            ...o,
            children: [p, y]
        }), k[39] = s, k[40] = o, k[41] = y, k[42] = d, k[43] = p, k[44] = b) : b = k[44], b
    }
    let rE = {
            duration: .2,
            ease: [.175, .885, .32, .98],
            opacity: {
                duration: .2,
                ease: [.26, .08, .25, 1]
            }
        },
        rA = {
            initial: {
                width: 0,
                flex: 0,
                marginRight: "0px",
                opacity: 0
            },
            animate: {
                width: "100%",
                flex: 1,
                marginRight: "8px",
                opacity: 1,
                transition: { ...rE
                }
            },
            exit: {
                width: 0,
                flex: 0,
                marginRight: "0px",
                opacity: 0,
                transition: { ...rE
                }
            }
        },
        rO = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                width: "auto"
            },
            exit: {
                opacity: 0
            }
        },
        rD = {
            opacity: .9,
            scale: .96
        },
        rL = "text-base leading-[21px]! tracking-[0.15px] h-10! py-0 px-0 mb-2 w-full border-none! outline-none! transition-[background-color,color] duration-150 ease-[cubic-bezier(0.26,0.08,0.25,1)] focus:outline-none! active:outline-none!";

    function rz({
        ref: e,
        openOrders: r,
        canShowCancelAll: a,
        className: i,
        ...n
    }) {
        let o = (0, ra.useQueryClient)(),
            l = (0, y.useTranslations)(),
            {
                event: c
            } = (0, H.useSportsItemContext)(),
            d = (0, B.useSportsTeamsColorsSelector)(c.slug),
            u = (0, rj.useGeoStore)(e => e.hasFetchedLocation),
            m = (0, rS.usePermissions)(),
            p = (0, t5.default)(),
            [h, f] = s.default.useState("rest"),
            x = s.default.useCallback(async e => {
                if (!u || m ? .canCancelOrders) try {
                    await p(e.order, e.market, !1)
                } finally {
                    o.invalidateQueries({
                        queryKey: rn.queryKeys[rs.QueryKey.OpenOrders]._def
                    })
                }
            }, [p, o, u, m]),
            g = t8(r),
            v = s.default.useCallback(e => {
                e.preventDefault(), e.stopPropagation(), f("rest")
            }, [f]),
            b = s.default.useCallback(e => {
                e.preventDefault(), e.stopPropagation(), "confirm" === h ? (g(), f("rest")) : f("confirm")
            }, [h, f, g]);
        return r.length ? (0, t.jsxs)(tR.motion.div, {
            ref: e,
            className: (0, D.cn)("flex flex-col w-full px-4 pb-2", i),
            ...n,
            children: [(0, t.jsx)(tK.AnimatePresence, {
                initial: !1,
                mode: "popLayout",
                children: (0, t.jsx)("div", {
                    className: "flex flex-col w-full",
                    children: r.map(e => (0, t.jsx)(rP, {
                        order: e,
                        market: e.market,
                        colors: d,
                        handleCancelOrder: x,
                        className: (0, D.cn)("pt-2 pb-2 last:pb-0", r.length > 3 && "last:pb-1")
                    }, `mobile-order-${e.outcomeIndex}-${e.order.orderID}`))
                })
            }), (0, t.jsx)(tK.AnimatePresence, {
                initial: !1,
                mode: "popLayout",
                children: a && r.length > 1 && (0, t.jsxs)(tR.motion.div, {
                    className: "flex w-full overflow-hidden",
                    children: [(0, t.jsx)(tK.AnimatePresence, {
                        initial: !1,
                        mode: "sync",
                        children: "confirm" === h && (0, t.jsx)(tR.motion.div, {
                            className: "flex",
                            variants: rA,
                            initial: "initial",
                            animate: "animate",
                            exit: "exit",
                            transition: rE,
                            whileTap: rD,
                            children: (0, t.jsx)(tR.motion.button, {
                                onClick: v,
                                transition: rE,
                                className: (0, D.cn)(rL, "bg-neutral-50 text-text-primary"),
                                children: l("modals.cancel")
                            })
                        }, "cancel")
                    }), (0, t.jsx)(tR.motion.button, {
                        variants: rO,
                        initial: "initial",
                        animate: "animate",
                        exit: "exit",
                        transition: rE,
                        whileTap: rD,
                        onClick: b,
                        className: (0, D.cn)(rL, "flex-1", "confirm" === h ? "bg-red-600 text-white" : "bg-neutral-50 text-text-primary"),
                        children: l("confirm" === h ? "orders.confirm" : "rewards.trading.cancelAll")
                    })]
                })
            })]
        }) : null
    }
    let rR = e => {
        let a, i, n, s, o, l, c, d, u = (0, r.c)(16);
        u[0] !== e ? ({
            ref: n,
            openOrders: i,
            className: a,
            canShowCancelAll: o,
            ...s
        } = e, u[0] = e, u[1] = a, u[2] = i, u[3] = n, u[4] = s, u[5] = o) : (a = u[1], i = u[2], n = u[3], s = u[4], o = u[5]);
        let m = void 0 === o || o;
        return i.length ? (u[6] !== a ? (l = (0, D.cn)("w-full h-full", a), u[6] = a, u[7] = l) : l = u[7], u[8] !== m || u[9] !== i ? (c = (0, t.jsx)(rz, {
            openOrders: i,
            canShowCancelAll: m,
            className: "px-3"
        }), u[8] = m, u[9] = i, u[10] = c) : c = u[10], u[11] !== n || u[12] !== s || u[13] !== l || u[14] !== c ? (d = (0, t.jsx)("div", {
            ref: n,
            className: l,
            ...s,
            children: c
        }), u[11] = n, u[12] = s, u[13] = l, u[14] = c, u[15] = d) : d = u[15], d) : null
    };
    rR.displayName = "MobileSportsItemOrders";
    let rF = {
            initial: {
                opacity: 0,
                height: 0
            },
            animate: {
                opacity: 1,
                height: "auto",
                transition: { ...tF.transition,
                    opacity: tF.opacityTransition
                }
            },
            exit: {
                opacity: 0,
                height: 0,
                transition: { ...tF.transition,
                    opacity: tF.opacityTransition
                }
            }
        },
        r$ = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: { ...tF.transition,
                    opacity: { ...tF.opacityTransition,
                        delay: .2
                    }
                }
            },
            exit: {
                opacity: 0,
                transition: { ...tF.transition,
                    opacity: { ...tF.opacityTransition
                    }
                }
            }
        },
        rB = e => {
            let a, i, n, o, l, c, d, u, m, p, h = (0, r.c)(31),
                {
                    orders: f
                } = e,
                {
                    mode: x
                } = (0, H.useSportsItemContext)(),
                g = (0, y.useTranslations)(),
                v = (0, el.useMessages)().time,
                [b, S] = s.default.useState(!1),
                j = s.default.useRef(null),
                C = (0, tm.useSportsStore)(rH);
            if (h[0] !== C || h[1] !== f || h[2] !== v) {
                let e;
                h[4] !== C || h[5] !== v ? (e = e => {
                    if ("nrfi" === e.market.sportsMarketType || "both_teams_to_score" === e.market.sportsMarketType || (0, eC.isSpreadMarket)(e.market.sportsMarketType) || (0, eC.isTotalMarket)(e.market.sportsMarketType)) {
                        let {
                            label: t,
                            convertedPrice: r,
                            totalQuantityNumber: a,
                            filledQuantityNumber: i,
                            side: n,
                            ...s
                        } = t3({
                            sportsMarketType: e.market.sportsMarketType,
                            order: e,
                            market: e.market,
                            oddsFormat: C,
                            timeTranslations: v
                        });
                        return {
                            id: `order-chip-${e.market.conditionId}-${e.order.orderID}-${e.outcomeIndex}`,
                            label: `${(0,w.capitalize)(n)} ${t}`,
                            qty: `${(0,T.formatNum)(a,{decimals:2,trailingZeros:!1})} @ ${r}`,
                            ...s,
                            order: e,
                            filledPercentage: i / a
                        }
                    }
                    let {
                        label: t,
                        convertedPrice: r,
                        totalQuantityNumber: a,
                        filledQuantityNumber: i,
                        totalValueNumber: n,
                        side: s,
                        sortKey: o,
                        ...l
                    } = t4({
                        order: e,
                        market: e.market,
                        oddsFormat: C,
                        timeTranslations: v
                    });
                    return {
                        id: `order-chip-${e.market.conditionId}-${e.order.orderID}-${e.outcomeIndex}`,
                        label: `${(0,w.capitalize)(s)} ${t}`,
                        qty: `${(0,T.formatNum)(a,{decimals:2,trailingZeros:!1})} @ ${r}`,
                        sortKey: n,
                        ...l,
                        order: e,
                        filledPercentage: i / a
                    }
                }, h[4] = C, h[5] = v, h[6] = e) : e = h[6], a = f.map(e).sort(rU), h[0] = C, h[1] = f, h[2] = v, h[3] = a
            } else a = h[3];
            let _ = a;
            h[7] !== _ ? (i = {
                orderChips: _
            }, h[7] = _, h[8] = i) : i = h[8];
            let {
                orderChips: M
            } = i;
            h[9] === Symbol.for("react.memo_cache_sentinel") ? (n = {}, h[9] = n) : n = h[9];
            let N = s.default.useRef(n),
                I = s.default.useRef(null);
            h[10] === Symbol.for("react.memo_cache_sentinel") ? (o = [], h[10] = o) : o = h[10];
            let [P, E] = s.default.useState(o), [A, O] = s.default.useState(0);
            h[11] !== x || h[12] !== M ? (l = () => {
                let e;
                if (I.current) {
                    let t = new ResizeObserver(() => {
                        let e = I.current;
                        if (!e) return;
                        let t = e.getBoundingClientRect().width - ("mobile" === x ? 20 : 100),
                            {
                                chips: r
                            } = M.reduce((e, r) => {
                                if (e.reachedLimit) return e;
                                let a = N.current[r.id] ? ? (r.label.length + r.qty.length) * 6.5;
                                return M.length > 1 && e.totalWidth + a > t ? e.reachedLimit = !0 : (e.totalWidth = e.totalWidth + a, e.chips.push(M[e.chips.length])), e
                            }, {
                                chips: [],
                                totalWidth: 0,
                                reachedLimit: !1
                            }),
                            a = r.slice(0, 3);
                        E(a), O(M.length - a.length)
                    });
                    t.observe(I.current), e = () => t.disconnect()
                }
                return () => e ? .()
            }, c = [M, x], h[11] = x, h[12] = M, h[13] = l, h[14] = c) : (l = h[13], c = h[14]), s.default.useEffect(l, c);
            let D = (0, t5.default)();
            h[15] !== D ? (d = e => t => {
                t.preventDefault(), t.stopPropagation(), D(e.order, e.market, !1)
            }, h[15] = D, h[16] = d) : d = h[16];
            let L = d,
                z = tR.motion,
                R = P.map(e => (0, t.jsx)(tR.motion.span, {
                    ref: t => {
                        t && (N.current[e.id] = t.getBoundingClientRect().width)
                    },
                    variants: r$,
                    initial: "initial",
                    animate: "animate",
                    exit: "exit",
                    transition: tF.transition,
                    children: (0, t.jsx)(rp, {
                        shareQuantity: e.qty,
                        label: e.label,
                        outcomeIndex: e.outcomeIndex,
                        color: e.color,
                        reversed: !0,
                        uppercase: !1,
                        variant: "outlined",
                        hoverable: !0,
                        allowCloseOut: !0,
                        onClick: t => {
                            "mobile" === x ? (t.preventDefault(), t.stopPropagation(), j.current = e.order, S(!0)) : L(e.order)(t)
                        },
                        hoverVariableToSuppress: "order-accordion",
                        closeOutText: g("orders.cancelOneOrder"),
                        closeOutSecondaryText: `(${e.filled} filled)`,
                        closeOutOnIconOnly: "desktop" === x,
                        restingFillWidth: e.filledPercentage
                    })
                }, e.id));
            return h[17] !== A || h[18] !== x ? (u = A > 0 && (0, t.jsx)(tR.motion.span, {
                variants: r$,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                transition: tF.transition,
                className: "text-neutral-500 text-xs font-medium whitespace-nowrap line-height-[18px] self-center",
                children: `+${A}${"desktop"===x?" more":""}`
            }, "hidden-count"), h[17] = A, h[18] = x, h[19] = u) : u = h[19], h[20] !== D || h[21] !== b || h[22] !== x || h[23] !== j || h[24] !== g ? (m = "mobile" === x && (0, t.jsx)(k.Drawer.Root, {
                open: b,
                onOpenChange: S,
                children: (0, t.jsxs)(k.Drawer.Portal, {
                    children: [(0, t.jsx)(k.Drawer.Overlay, {
                        onClick: e => {
                            e.preventDefault(), e.stopPropagation(), S(!1)
                        },
                        onPointerDown: rW,
                        className: "fixed inset-0 bg-[rgba(0,0,0,0.4)] z-[1000]"
                    }), (0, t.jsxs)(k.Drawer.Content, {
                        className: "fixed bottom-0 left-0 right-0 z-[1001] flex flex-col rounded-tl-md rounded-tr-md bg-surface-1 p-4 gap-4",
                        children: [(0, t.jsxs)(tY.VisuallyHidden.Root, {
                            children: [(0, t.jsx)(k.Drawer.Title, {
                                children: g("orders.cancelOneOrder")
                            }), (0, t.jsx)(k.Drawer.Description, {
                                children: g("orders.cancelOneOrder")
                            })]
                        }), (0, t.jsx)(k.Drawer.Handle, {}), (0, t.jsxs)("div", {
                            className: "flex flex-col w-full justify-center items-center mt-4 gap-4",
                            children: [(0, t.jsx)("p", {
                                className: "text-text text-lg font-bold",
                                children: g("orders.cancelOneOrder")
                            }), (0, t.jsx)("p", {
                                className: "text-text-secondary text-sm font-normal tracking-wide",
                                children: g("orders.cancelSingleOrder")
                            })]
                        }), (0, t.jsxs)("div", {
                            className: "flex flex-col w-full justify-center items-center gap-2 mt-4",
                            children: [(0, t.jsx)("button", {
                                type: "button",
                                className: "flex w-full h-[44px] px-4 justify-center items-center bg-brand-500 rounded-lg text-sm font-medium text-white",
                                onClick: e => {
                                    e.preventDefault(), e.stopPropagation(), j.current && (D(j.current.order, j.current.market, !1), j.current = null, S(!1))
                                },
                                children: g("orders.confirm")
                            }), (0, t.jsx)("button", {
                                type: "button",
                                className: "flex w-full h-[44px] px-4 justify-center items-center bg-neutral-50 rounded-lg text-sm font-medium text-text",
                                onClick: e => {
                                    e.preventDefault(), e.stopPropagation(), S(!1)
                                },
                                children: g("orders.neverMind")
                            })]
                        })]
                    })]
                })
            }), h[20] = D, h[21] = b, h[22] = x, h[23] = j, h[24] = g, h[25] = m) : m = h[25], h[26] !== R || h[27] !== u || h[28] !== m || h[29] !== z.div ? (p = (0, t.jsxs)(z.div, {
                ref: I,
                className: "flex flex-1 flex-wrap overflow-hidden gap-2 justify-end",
                children: [R, u, m]
            }), h[26] = R, h[27] = u, h[28] = m, h[29] = z.div, h[30] = p) : p = h[30], p
        },
        rq = e => ({
            setPreventAccordionHover: e.setPreventAccordionHover,
            preventOrdersAccordionHover: e.preventOrdersAccordionHover,
            ordersAccordionState: e.ordersAccordionState,
            setOrdersAccordionState: e.setOrdersAccordionState,
            variant: e.variant
        }),
        rV = e => {
            let a, i, n, o, l, c, d = (0, r.c)(31),
                {
                    openOrders: u,
                    expandMobile: m
                } = e,
                {
                    setPreventAccordionHover: p,
                    preventOrdersAccordionHover: h,
                    ordersAccordionState: f,
                    setOrdersAccordionState: x,
                    variant: g
                } = (0, tl.useSportsItemStore)(rq, ta.shallow),
                {
                    openOrders: v
                } = e0(),
                b = (0, y.useTranslations)(),
                k = (0, tQ.useSetActiveSportsMarket)(),
                w = s.default.useDeferredValue(h),
                {
                    orders: S
                } = e4(u ? ? v),
                {
                    event: j,
                    mode: C
                } = (0, H.useSportsItemContext)();
            d[0] !== p ? (a = () => {
                p(!0)
            }, d[0] = p, d[1] = a) : a = d[1];
            let _ = a;
            d[2] !== p ? (i = () => {
                p(!1)
            }, d[2] = p, d[3] = i) : i = d[3];
            let T = i,
                M = S.length > 0;
            d[4] !== j.slug ? (n = e => e.gamesAccordionValue === j.slug, d[4] = j.slug, d[5] = n) : n = d[5];
            let N = (0, tm.useSportsStore)(n),
                I = (0, tm.useSportsStore)(rG),
                [P, E] = (0, B.useSportsAccordionState)();
            d[6] !== j.markets || d[7] !== j.slug || d[8] !== P || d[9] !== N || d[10] !== k || d[11] !== I || d[12] !== E || d[13] !== g ? (o = () => {
                let e = !1;
                if ("card" !== g || N || (I(""), e = !0), "card" !== g && P !== g && (E(""), e = !0), e) {
                    let e = j.markets.filter(rZ);
                    k(e.length ? e[0] : j.markets[0], {
                        eventSlug: j.slug,
                        openGamesAccordion: !1,
                        openOverlayAccordion: !1,
                        closeGamesAccordionIfOpen: !1,
                        closeOverlayAccordionIfOpen: !1
                    })
                }
            }, d[6] = j.markets, d[7] = j.slug, d[8] = P, d[9] = N, d[10] = k, d[11] = I, d[12] = E, d[13] = g, d[14] = o) : o = d[14];
            let A = o;
            return d[15] !== w || d[16] !== m || d[17] !== M || d[18] !== C || d[19] !== A || d[20] !== _ || d[21] !== T || d[22] !== S || d[23] !== f || d[24] !== x || d[25] !== b || d[26] !== g ? (l = M && (0, t.jsx)(tR.motion.div, {
                variants: rF,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                children: (0, t.jsx)(eY.Accordion.Root, {
                    type: "single",
                    value: f,
                    onValueChange: x,
                    onPointerEnter: _,
                    onPointerLeave: T,
                    className: "w-full h-fit p-0",
                    children: (0, t.jsxs)(eY.Accordion.AccordionItem, {
                        value: "orders",
                        className: (0, D.cn)("border-t", m && "!overflow-x-visible"),
                        children: [(0, t.jsxs)(eY.Accordion.Trigger, {
                            onClick: e => {
                                e.preventDefault(), e.stopPropagation(), A(), x("orders" === f ? "" : "orders")
                            },
                            className: (0, D.cn)("group/trigger flex justify-between items-center px-3 w-full h-[40px] bg-surface-1 hover:bg-surface-2 border-none pt-0 outline-none !font-semi !text-sm !text-text-primary cursor-pointer gap-5 relative", m && "px-0", w && "hover:bg-surface-1"),
                            children: [(0, t.jsxs)("span", {
                                className: "flex items-center gap-2 bg-transparent group-data-[state=open]/trigger:[&_svg]:-rotate-180 [&_svg]:transition-transform [&_svg]:duration-200 [&_svg]:ease-linear",
                                children: [(0, t.jsx)("span", {
                                    className: "text-sm font-medium",
                                    children: b("events.tabs.openOrders")
                                }), (0, t.jsx)(tZ.IconChevronDownOutline12, {
                                    size: 12
                                })]
                            }), (0, t.jsx)(rB, {
                                orders: S
                            })]
                        }), (0, t.jsx)(eY.Accordion.Content, {
                            className: (0, D.cn)("w-full bg-surface-1 data-[state=closed]:animate-accordionSlideUp data-[state=open]:animate-accordionSlideDown overflow-y-hidden", m && "w-[calc(100%+24px)] ml-[-12px]"),
                            children: "mobile" === C ? (0, t.jsx)(rR, {
                                openOrders: S,
                                canShowCancelAll: !0
                            }) : (0, t.jsx)(rk, {
                                orders: S,
                                expandMobile: m,
                                variant: g,
                                showMarketType: "card" === g
                            })
                        })]
                    })
                })
            }, `accordion-orders-${M}`), d[15] = w, d[16] = m, d[17] = M, d[18] = C, d[19] = A, d[20] = _, d[21] = T, d[22] = S, d[23] = f, d[24] = x, d[25] = b, d[26] = g, d[27] = l) : l = d[27], d[28] !== M || d[29] !== l ? (c = (0, t.jsx)(tK.AnimatePresence, {
                mode: "sync",
                initial: !1,
                custom: M,
                children: l
            }), d[28] = M, d[29] = l, d[30] = c) : c = d[30], c
        };

    function rH(e) {
        return e.oddsFormat
    }

    function rU(e, t) {
        return t.sortKey - e.sortKey
    }

    function rW(e) {
        e.preventDefault(), e.stopPropagation()
    }

    function rG(e) {
        return e.setGamesAccordionValue
    }

    function rZ(e) {
        return (e.sportsMarketType ? ? "moneyline") === "moneyline"
    }
    rV.displayName = "AccordionOrders", e.s(["AccordionOrders", 0, rV], 82489)
}, 449372, e => {
    "use strict";
    var t = e.i(204996),
        r = e.i(196593),
        a = e.i(156591),
        i = e.i(557033),
        n = e.i(909420),
        s = e.i(289981);
    let o = ({
        market: e,
        positions: t
    }) => {
        let r = e.conditionId.toLowerCase();
        return t.filter(e => e.market.id.toLowerCase() === r)
    };
    e.s(["getMergeableSharesForMarket", 0, ({
        positions: e,
        market: t
    }) => {
        let a = t ? o({
            market: t,
            positions: e
        }) : e;
        return 2 !== e.length ? {
            qty: 0,
            avgPrice: void 0
        } : {
            qty: Math.min(...a.map(e => e.trackedPositionMetadata ? e.trackedPositionMetadata.netQuantity.optimistic : parseFloat((0, r.formatUSDCUnits)(BigInt(e.netQuantity))))),
            avgPrice: void 0
        }
    }, "getMoneylinePosition", 0, ({
        position: e,
        market: s,
        oddsFormat: o = "price"
    }) => {
        let l, c, d = (0, n.getTeam)({
                market: s,
                outcomeIndex: e.outcomeIndex
            }),
            u = d ? .abbreviation ? (0, t.upperCase)(d.abbreviation) : s.outcomes[e.outcomeIndex],
            m = e.position.value.currentMarketValue,
            p = e.isNegRisk && "draw" === s.negRiskSportsMarketType;
        if (e.isNegRisk && (p && (u = `Draw ${s.outcomes[e.outcomeIndex]}`, l = "gray", m = 3 + e.outcomeIndex, c = void 0), "home" === s.negRiskSportsMarketType && (d ? (u = `${(0,t.upperCase)(d.abbreviation)} ${s.outcomes[e.outcomeIndex]}`, l = d.color ? ? "blue", c = d.logo) : (u = `${s.groupItemTitle} ${s.outcomes[e.outcomeIndex]}`, l = "blue"), m = 1 + e.outcomeIndex), "away" === s.negRiskSportsMarketType && (d ? (u = `${(0,t.upperCase)(d.abbreviation)} ${s.outcomes[e.outcomeIndex]}`, l = d.color ? ? "blue", c = d.logo) : (u = `${s.groupItemTitle} ${s.outcomes[e.outcomeIndex]}`, l = "blue"), m = 5 + e.outcomeIndex)), !e.isNegRisk && d && "ufc_go_the_distance" !== s.sportsMarketType && "ufc_method_of_victory" !== s.sportsMarketType && "parlays" !== s.sportsMarketType && "cricket_most_sixes" !== s.sportsMarketType && "cricket_team_top_batter" !== s.sportsMarketType && "cricket_toss_match_double" !== s.sportsMarketType && "soccer_halftime_result" !== s.sportsMarketType && "tennis_completed_match" !== s.sportsMarketType && (l = d.color, c = d.logo), "first_half_moneyline" === s.sportsMarketType && (u = `1H ${u}`), "ufc_go_the_distance" === s.sportsMarketType && (u = 0 === e.outcomeIndex ? "Yes" : "No", l = 0 === e.outcomeIndex ? "green" : "red", c = void 0), "ufc_method_of_victory" === s.sportsMarketType && (u = s.groupItemTitle ? `${s.groupItemTitle} ${s.outcomes[e.outcomeIndex]}` : s.outcomes[e.outcomeIndex], l = 0 === e.outcomeIndex ? "green" : "red", c = void 0), "cricket_most_sixes" === s.sportsMarketType || "cricket_team_top_batter" === s.sportsMarketType || "cricket_toss_match_double" === s.sportsMarketType || "soccer_halftime_result" === s.sportsMarketType)
            if (s.groupItemTitle ? .toUpperCase() === "DRAW") u = `Draw ${s.outcomes[e.outcomeIndex]}`, l = "gray", c = void 0;
            else {
                let r = s.teams ? .find(e => e.abbreviation ? .toUpperCase() === s.groupItemTitle ? .toUpperCase() || e.name ? .toUpperCase() === s.groupItemTitle ? .toUpperCase() || e.alias ? .toUpperCase() === s.groupItemTitle ? .toUpperCase());
                r ? (u = `${(0,t.upperCase)(r.abbreviation)} ${s.outcomes[e.outcomeIndex]}`, l = r.color, c = r.logo) : (u = `${s.groupItemTitle} ${s.outcomes[e.outcomeIndex]}`, l = "blue")
            }
        if ("parlays" === s.sportsMarketType) {
            let t = (s.question || "").split(" - "),
                r = t.length >= 1 ? t[0].trim() : "Parlay";
            u = `${r}`, l = 0 === e.outcomeIndex ? "green" : "red", c = void 0
        }
        let h = parseFloat(e.position.qty),
            {
                formatted: f
            } = (0, i.convertPrice)({
                price: parseFloat(e.position.avgPrice),
                outputMode: o,
                inputMode: "scaled",
                precision: (0, a.getPrecisionFromTickSize)(s.orderPriceMinTickSize ? ? .01)
            });
        return {
            key: `${s.conditionId}-${e.outcomeIndex}`,
            qty: (0, r.formatNum)(e.position.qty, {
                decimals: 2 * (h < 1)
            }),
            qtyNumber: h,
            value: (0, r.toUSCurrency)(e.position.value.currentMarketValue),
            label: u,
            sortKey: m,
            color: l,
            market: s,
            outcomeIndex: e.outcomeIndex,
            logo: c,
            isNegRiskDraw: p,
            type: (0, n.getSportsMarketType)(s).formatted,
            avgPrice: e.position.avgPrice,
            convertedAvgPrice: f
        }
    }, "getPositionForLine", 0, ({
        sportsMarketType: e,
        position: o,
        market: l,
        oddsFormat: c = "price"
    }) => {
        let d, u, m = (0, n.getTeam)({
                market: l,
                outcomeIndex: o.outcomeIndex
            }),
            p = m ? .abbreviation ? (0, t.upperCase)(m.abbreviation) : l.outcomes[o.outcomeIndex],
            {
                line: h
            } = l;
        if ((0, s.isSpreadMarket)(e)) {
            let t = (0, n.getSpreadLineForOutcome)({
                    market: l,
                    outcomeIndex: o.outcomeIndex
                }),
                r = void 0 !== t ? t : void 0 !== h ? 0 === o.outcomeIndex ? h : -h : void 0;
            if (void 0 !== r) {
                let t = (0, n.getFormattedSpread)(r);
                p += ` ${t}`, "first_half_spreads" === e && (p = `1H ${p}`), m && (d = m.color, u = m.logo)
            }
        }
        if ((0, s.isTotalMarket)(e) && h) {
            let t = (0, n.getFormattedOverUnder)({
                outcomeIndex: o.outcomeIndex,
                line: h,
                truncate: !0
            });
            p = "first_half_totals" === e ? `1H ${t}` : "first_innings_totals" === e ? `1st Inn ${t}` : "second_innings_totals" === e ? `2nd Inn ${t}` : t, d = 0 === o.outcomeIndex ? "green" : "red", ("tennis_first_set_totals" === e || "tennis_set_totals" === e || "tennis_match_totals" === e) && (l.team ? u = l.team.logo : l.teams && l.teams.length > 0 && (u = l.teams[0].logo))
        }
        "nrfi" === e && (p = 0 === o.outcomeIndex ? "Yes" : "No", d = 0 === o.outcomeIndex ? "green" : "red", u = void 0), "both_teams_to_score" === e && (p = 0 === o.outcomeIndex ? "Yes" : "No", d = 0 === o.outcomeIndex ? "green" : "red", u = void 0), ("anytime_touchdowns" === e || "first_touchdowns" === e || "two_plus_touchdowns" === e || "soccer_anytime_goalscorer" === e || "soccer_exact_score" === e || "tennis_completed_match" === e) && (p = 0 === o.outcomeIndex ? "Yes" : "No", d = 0 === o.outcomeIndex ? "green" : "red", u = l.image ? ? l.icon ? ? void 0);
        let f = parseFloat(o.position.qty),
            {
                formatted: x
            } = (0, i.convertPrice)({
                price: parseFloat(o.position.avgPrice),
                outputMode: c,
                inputMode: "scaled",
                precision: (0, a.getPrecisionFromTickSize)(l.orderPriceMinTickSize ? ? .01)
            });
        return {
            key: `${l.conditionId}-${o.outcomeIndex}`,
            qty: (0, r.formatNum)(o.position.qty, {
                decimals: 2 * (f < 1)
            }),
            qtyNumber: f,
            value: (0, r.toUSCurrency)(o.position.value.currentMarketValue),
            label: p,
            sortKey: o.position.value.currentMarketValue,
            color: d,
            market: l,
            outcomeIndex: o.outcomeIndex,
            isNegRiskDraw: !1,
            logo: u,
            type: (0, n.getSportsMarketType)(l).formatted,
            avgPrice: o.position.avgPrice,
            convertedAvgPrice: x
        }
    }, "getPositionsForMarket", 0, o, "getSharesForMarket", 0, ({
        positions: e,
        outcomeIndex: t,
        market: a,
        filterThreshold: i = .01
    }) => {
        let n = `${t}`,
            s = (a ? o({
                market: a,
                positions: e
            }) : e).find(e => e.outcomeIndex === n);
        if (!s) return;
        if (s.trackedPositionMetadata) {
            let e = s.trackedPositionMetadata.netQuantity.optimistic;
            return {
                qty: e < i ? 0 : e,
                avgPrice: s.trackedPositionMetadata.valueBought.optimistic / s.trackedPositionMetadata.quantityBought.optimistic
            }
        }
        let l = parseFloat((0, r.formatUSDCUnits)(BigInt(s.netQuantity)));
        return {
            qty: l < i ? 0 : l,
            avgPrice: parseFloat((0, r.formatUSDCUnits)(BigInt(s.valueBought))) / parseFloat((0, r.formatUSDCUnits)(BigInt(s.quantityBought)))
        }
    }])
}, 929581, 519322, 898777, e => {
    "use strict";
    e.s(["AccordionPositions", () => es], 929581);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(740594),
        i = e.i(798631),
        n = e.i(219469),
        s = e.i(215959),
        o = e.i(810912),
        l = e.i(416340),
        c = e.i(233522),
        d = e.i(196593),
        u = e.i(100825),
        m = e.i(840216),
        p = e.i(458164),
        h = e.i(909576),
        f = e.i(879756),
        x = e.i(488758),
        g = e.i(295038),
        v = e.i(193789),
        y = e.i(605797),
        b = e.i(507909),
        k = e.i(449372),
        w = e.i(289981),
        S = e.i(604777),
        j = e.i(870555),
        C = e.i(880809);
    e.s(["DesktopSportsItemPositions", () => U], 898777);
    var _ = e.i(635868),
        T = e.i(723823),
        M = e.i(23128),
        N = (e.i(184612), e.i(197994));
    e.s(["IconArrowsFilterFill18", 0, ({ ...e
    }) => l.default.createElement(N.Icon, {
        size: "18px",
        ...e
    }, l.default.createElement("path", {
        d: "m16.2803,5.7197l-3-3c-.293-.293-.7676-.293-1.0605,0l-3,3c-.293.293-.293.7676,0,1.0605s.7676.293,1.0605,0l1.7197-1.7197v9.6895c0,.4141.3359.75.75.75s.75-.3359.75-.75V5.0605l1.7197,1.7197c.1465.1465.3379.2197.5303.2197s.3838-.0732.5303-.2197c.293-.293.293-.7676,0-1.0605Z",
        fill: "currentColor",
        strokeWidth: "0",
        "data-color": "color-2"
    }), l.default.createElement("path", {
        d: "m7.7197,11.2197l-1.7197,1.7197V3.25c0-.4141-.3359-.75-.75-.75s-.75.3359-.75.75v9.6895l-1.7197-1.7197c-.293-.293-.7676-.293-1.0605,0s-.293.7676,0,1.0605l3,3c.1465.1465.3379.2197.5303.2197s.3838-.0732.5303-.2197l3-3c.293-.293.293-.7676,0-1.0605s-.7676-.293-1.0605,0Z",
        strokeWidth: "0",
        fill: "currentColor"
    }))], 519322);
    var I = e.i(543078),
        I = I,
        P = e.i(3740),
        E = e.i(429411),
        A = e.i(6204),
        O = e.i(156591),
        D = e.i(668122),
        L = e.i(305457),
        z = e.i(294377),
        R = e.i(575865);
    let F = e => {
        let i, n, s, o, l, c, u, g, y, b, N, F, B, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er, ea, ei, en, es, eo = (0, r.c)(133);
        eo[0] !== e ? ({
            ref: i,
            position: s,
            view: c,
            shrinkButton: o,
            hasNegRiskItemInGrid: l,
            ...n
        } = e, eo[0] = e, eo[1] = i, eo[2] = n, eo[3] = s, eo[4] = o, eo[5] = l, eo[6] = c) : (i = eo[1], n = eo[2], s = eo[3], o = eo[4], l = eo[5], c = eo[6]);
        let el = void 0 !== l && l,
            ec = (0, S.useTranslations)(),
            {
                event: ed,
                mode: eu
            } = (0, x.useSportsItemContext)(),
            {
                enableNegRisk: em,
                slug: ep
            } = ed,
            {
                setSportsCashOutState: eh
            } = (0, h.useCashOutTxContext)();
        eo[7] === Symbol.for("react.memo_cache_sentinel") ? (u = ["setOrderExpiration"], eo[7] = u) : u = eo[7];
        let {
            setOrderExpiration: ef
        } = (0, C.useTradeContext)(u), ex = (0, L.useAmplitudeAnalytics)(), eg = (0, v.useSetActiveSportsMarket)(), {
            setTradeState: ev
        } = (0, f.useMobileTradeContext)(), {
            onClick: ey
        } = (() => {
            let e, t, a, i, n, s, o, l, c = (0, r.c)(28),
                u = (0, v.useSetActiveSportsMarket)();
            c[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["setSelectedOutcomeIdx", "setOrderType", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side", "setSide", "setShares", "setAmountUpdateLocation"], c[0] = e) : e = c[0];
            let {
                setSelectedOutcomeIdx: m,
                setOrderType: h,
                setPrice: f,
                setPriceUpdateLocation: g,
                setCursorActive: y,
                side: b,
                setSide: k,
                setShares: w,
                setAmountUpdateLocation: S
            } = (0, C.useTradeContext)(e), {
                event: j,
                moneylineMarket: M
            } = (0, x.useSportsItemContext)();
            c[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["market"], c[1] = t) : t = c[1];
            let {
                market: N
            } = (0, _.useBookContext)(t), I = (0, T.useMarketBestPrices)(N);
            c[2] === Symbol.for("react.memo_cache_sentinel") ? (a = ["isSportsPage"], c[2] = a) : a = c[2];
            let {
                isSportsPage: P
            } = (0, A.useSportsContext)(a);
            M ? .orderPriceMinTickSize;
            let D = M ? .orderPriceMinTickSize;
            c[3] !== D ? (i = (0, O.getPrecisionFromTickSize)(D), c[3] = D, c[4] = i) : i = c[4];
            let L = i;
            c[5] !== I || c[6] !== b || c[7] !== L ? (n = e => {
                let t = I ? .[0 === e ? "~zero" : "~one"] ? .[b ? .toLowerCase()];
                if (t) return (0, d.showPaddedCentsOnly)(t, L)
            }, c[5] = I, c[6] = b, c[7] = L, c[8] = n) : n = c[8];
            let z = n,
                R = (0, E.useCallbackRef)(z);
            c[9] !== j || c[10] !== P || c[11] !== M ? (s = e => {
                if (P && e && j) {
                    let t = j.markets.find(t => t.id.toString() === e.toString());
                    if (t) return t
                }
                return M
            }, c[9] = j, c[10] = P, c[11] = M, c[12] = s) : s = c[12];
            let F = s;
            c[13] !== j.slug || c[14] !== R || c[15] !== F || c[16] !== u || c[17] !== S || c[18] !== y || c[19] !== h || c[20] !== f || c[21] !== g || c[22] !== m || c[23] !== w || c[24] !== k ? (o = e => {
                let {
                    outcomeIndex: t,
                    side: r,
                    orderType: a,
                    marketId: i,
                    shares: n,
                    shouldActivateCursor: s
                } = e, o = F(i), l = R(t);
                o.enableOrderBook || h(p.OrderType.AMM), u(o, {
                    eventSlug: j.slug,
                    closeGamesAccordionIfOpen: !1,
                    closeOverlayAccordionIfOpen: !1
                }), r && k(r), a && h(a), m(t), "string" == typeof l && (f(l), g("click")), n && (w(n), S("click")), void 0 !== s && s && y(!0)
            }, c[13] = j.slug, c[14] = R, c[15] = F, c[16] = u, c[17] = S, c[18] = y, c[19] = h, c[20] = f, c[21] = g, c[22] = m, c[23] = w, c[24] = k, c[25] = o) : o = c[25];
            let $ = o;
            return c[26] !== $ ? (l = {
                onClick: $
            }, c[26] = $, c[27] = l) : l = c[27], l
        })(), {
            enrichedPosition: eb
        } = (0, P.useEnrichedPosition)(s.rawPosition, void 0, s.market), ek = (0, T.useMarketBestPrices)(s.market), ew = eb ? .sell.outcomeIdx ? ? 0, eS = (0, m.useSportsStore)($);
        e: {
            let e;
            if ("nrfi" === s.market.sportsMarketType || "both_teams_to_score" === s.market.sportsMarketType || "anytime_touchdowns" === s.market.sportsMarketType || "first_touchdowns" === s.market.sportsMarketType || "soccer_anytime_goalscorer" === s.market.sportsMarketType || "soccer_exact_score" === s.market.sportsMarketType || "tennis_completed_match" === s.market.sportsMarketType || (0, w.isSpreadMarket)(s.market.sportsMarketType) || (0, w.isTotalMarket)(s.market.sportsMarketType)) {
                let e;
                eo[8] !== eS || eo[9] !== s ? (e = (0, k.getPositionForLine)({
                    sportsMarketType: s.market.sportsMarketType,
                    position: s,
                    market: s.market,
                    oddsFormat: eS
                }), eo[8] = eS, eo[9] = s, eo[10] = e) : e = eo[10], g = e;
                break e
            }
            eo[11] !== eS || eo[12] !== s ? (e = (0, k.getMoneylinePosition)({
                position: s,
                market: s.market,
                oddsFormat: eS
            }), eo[11] = eS, eo[12] = s, eo[13] = e) : e = eo[13],
            g = e
        }
        let {
            type: ej,
            logo: eC,
            qty: e_,
            label: eT,
            convertedAvgPrice: eM,
            isNegRiskDraw: eN,
            color: eI
        } = g;
        eo[14] !== ex || eo[15] !== ep || eo[16] !== eu || eo[17] !== ey || eo[18] !== eg || eo[19] !== ef || eo[20] !== eh || eo[21] !== ev || eo[22] !== s.market || eo[23] !== c ? (y = e => {
            "mobile" === eu ? s.market.closed ? ev ? .({
                type: "sports-redeem",
                sportsRedemptionConditionIds: [s.market.conditionId],
                market: s.market
            }) : ev ? .({
                type: "redeem",
                market: s.market,
                outcomeIdx: e.outcomeIdx,
                side: a.Side.SELL,
                orderType: p.OrderType.Market,
                shares: e.qty
            }) : s.market.closed ? (eg(s.market, {
                eventSlug: ep,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            }), eh({
                open: !0,
                mode: "injected",
                conditionIds: [s.market.conditionId]
            })) : (ey({
                outcomeIndex: e.outcomeIdx,
                side: a.Side.SELL,
                orderType: p.OrderType.Market,
                marketId: s.market.id,
                shares: e.qty
            }), ef(void 0), eh({
                open: !0,
                mode: "single"
            })), ex.trackEvent(D.Events.SportsPositionSellClick, {
                closed: e.isClosed,
                location: "detail-item" === c ? "card" : "in-game-view"
            })
        }, eo[14] = ex, eo[15] = ep, eo[16] = eu, eo[17] = ey, eo[18] = eg, eo[19] = ef, eo[20] = eh, eo[21] = ev, eo[22] = s.market, eo[23] = c, eo[24] = y) : y = eo[24];
        let eP = y;
        t: {
            if (!(s.market.negRisk && !1 !== em) || eb && (1 !== eb.sell.outcomeIdx || eb.sell.isClosed)) {
                b = !1;
                break t
            }
            b = !0
        }
        let eE = b;
        eo[25] !== ep || eo[26] !== eg || eo[27] !== s.market ? (N = e => {
            e.stopPropagation(), eg(s.market, {
                eventSlug: ep,
                openOverlayAccordion: !1,
                openGamesAccordion: !1,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })
        }, eo[25] = ep, eo[26] = eg, eo[27] = s.market, eo[28] = N) : N = eo[28];
        let eA = N;
        r: {
            let e, t;
            if (!s.market.closed) {
                let e;
                eo[29] !== ek || eo[30] !== s.position.sell ? (e = ek ? .[0 === s.position.sell.outcomeIdx ? "~zero" : "~one"] ? .[a.Side.SELL.toLowerCase()], eo[29] = ek, eo[30] = s.position.sell, eo[31] = e) : e = eo[31];
                let t = e;
                if (void 0 !== t) {
                    let e, r, a = parseFloat(t ? ? "0") * parseFloat(s.position.qty),
                        i = parseFloat(s.position.value.cost);
                    if (!Number.isNaN(i)) {
                        let e, t, r = a - i;
                        eo[32] !== a ? (e = (0, d.formatCurrency)(a, {
                            decimals: 2
                        }), eo[32] = a, eo[33] = e) : e = eo[33], eo[34] !== r || eo[35] !== e ? (t = {
                            value: e,
                            liveUnrealizedProfit: r
                        }, eo[34] = r, eo[35] = e, eo[36] = t) : t = eo[36], F = t;
                        break r
                    }
                    eo[37] !== a ? (e = (0, d.formatCurrency)(a, {
                        decimals: 2
                    }), eo[37] = a, eo[38] = e) : e = eo[38], eo[39] !== e ? (r = {
                        value: e,
                        liveUnrealizedProfit: void 0
                    }, eo[39] = e, eo[40] = r) : r = eo[40], F = r;
                    break r
                }
            }
            eo[41] !== s.position.value.currentMarketValue ? (e = (0, d.toUSCurrency)(s.position.value.currentMarketValue), eo[41] = s.position.value.currentMarketValue, eo[42] = e) : e = eo[42],
            eo[43] !== e ? (t = {
                value: e,
                liveUnrealizedProfit: void 0
            }, eo[43] = e, eo[44] = t) : t = eo[44],
            F = t
        }
        let {
            value: eO,
            liveUnrealizedProfit: eD
        } = F;
        a: {
            let e, t, r, a, i;
            if (!eb) {
                let e, t;
                eo[45] === Symbol.for("react.memo_cache_sentinel") ? (e = {}, eo[45] = e) : e = eo[45], eo[46] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                    returnStyles: e,
                    displayProfit: ""
                }, eo[46] = t) : t = eo[46], B = t;
                break a
            }
            let n = eb.totalReturn.unrealizedProfit ? parseFloat(eb.totalReturn.unrealizedProfit.replace(/[$,+]/g, "")) : 0,
                s = Number.isNaN(n) ? 0 : n,
                o = (eD ? ? s) < 0 ? "red" : "green";eo[47] !== o ? (e = "red" === o && {
                "--returnTextColor": "var(--red-400)"
            }, eo[47] = o, eo[48] = e) : e = eo[48],
            eo[49] !== o ? (t = "green" === o && {
                "--returnTextColor": "var(--green-500)"
            }, eo[49] = o, eo[50] = t) : t = eo[50],
            eo[51] !== e || eo[52] !== t ? (r = {
                "--returnTextColor": "var(--neutral-500)",
                ...e,
                ...t
            }, eo[51] = e, eo[52] = t, eo[53] = r) : r = eo[53];
            let l = r;eo[54] !== eD || eo[55] !== eb.totalReturn.unrealizedProfit ? (a = void 0 !== eD ? (0, d.toUSCurrency)(eD, {
                signDisplay: "always"
            }) : eb.totalReturn.unrealizedProfit ? ? "$0.00", eo[54] = eD, eo[55] = eb.totalReturn.unrealizedProfit, eo[56] = a) : a = eo[56],
            eo[57] !== l || eo[58] !== a ? (i = {
                returnStyles: l,
                displayProfit: a
            }, eo[57] = l, eo[58] = a, eo[59] = i) : i = eo[59],
            B = i
        }
        let {
            returnStyles: eL,
            displayProfit: ez
        } = B;
        if (!eb) return null;
        let eR = `${s.outcomeIndex}-position-type`;
        eo[60] !== eR || eo[61] !== ej ? (q = (0, t.jsx)(R.SportsItemPositionDataPoint, {
            value: ej,
            className: "col-1"
        }, eR), eo[60] = eR, eo[61] = ej, eo[62] = q) : q = eo[62];
        let eF = `${s.outcomeIndex}-position-outcome`;
        eo[63] !== eN || eo[64] !== eC || eo[65] !== eb.sell || eo[66] !== s.outcomeIndex ? (V = !1, eo[63] = eN, eo[64] = eC, eo[65] = eb.sell, eo[66] = s.outcomeIndex, eo[67] = V) : V = eo[67], eo[68] !== eN ? (H = !1, eo[68] = eN, eo[69] = H) : H = eo[69], eo[70] !== eI || eo[71] !== eT || eo[72] !== ew || eo[73] !== e_ ? (U = (0, t.jsx)(z.SportsPositionOutcomeChip, {
            shareQuantity: e_,
            label: eT,
            outcomeIndex: ew,
            color: eI,
            reversed: !0
        }), eo[70] = eI, eo[71] = eT, eo[72] = ew, eo[73] = e_, eo[74] = U) : U = eo[74], eo[75] !== eF || eo[76] !== V || eo[77] !== H || eo[78] !== U ? (W = (0, t.jsxs)("div", {
            className: "flex gap-3 items-center col-2 bg-inherit",
            children: [V, H, U]
        }, eF), eo[75] = eF, eo[76] = V, eo[77] = H, eo[78] = U, eo[79] = W) : W = eo[79];
        let e$ = `${s.outcomeIndex}-position-average-price`;
        eo[80] !== eM || eo[81] !== e$ ? (G = (0, t.jsx)(R.SportsItemPositionDataPoint, {
            value: eM,
            className: "col-3"
        }, e$), eo[80] = eM, eo[81] = e$, eo[82] = G) : G = eo[82];
        let eB = `${s.outcomeIndex}-position-cost`;
        eo[83] !== eb.value.cost ? (Z = "-" === eb.value.cost ? "-" : (0, d.toUSCurrency)(eb.value.cost), eo[83] = eb.value.cost, eo[84] = Z) : Z = eo[84], eo[85] !== eB || eo[86] !== Z ? (K = (0, t.jsx)(R.SportsItemPositionDataPoint, {
            value: Z,
            className: "col-4"
        }, eB), eo[85] = eB, eo[86] = Z, eo[87] = K) : K = eo[87];
        let eq = `${s.outcomeIndex}-position-to-win`;
        eo[88] !== eb.qty ? (Y = (0, d.formatCurrency)(eb.qty, {
            decimals: 2
        }), eo[88] = eb.qty, eo[89] = Y) : Y = eo[89], eo[90] !== eq || eo[91] !== Y ? (Q = (0, t.jsx)(R.SportsItemPositionDataPoint, {
            value: Y,
            className: "col-5"
        }, eq), eo[90] = eq, eo[91] = Y, eo[92] = Q) : Q = eo[92];
        let eV = `${s.outcomeIndex}-position-current`,
            eH = `(${ez})`;
        eo[93] !== eL || eo[94] !== eV || eo[95] !== eH || eo[96] !== eO ? (X = (0, t.jsx)(R.SportsItemPositionDataPoint, {
            value: eO,
            valueSuffix: eH,
            suffixClassname: "ml-[6px] font-medium text-[var(--returnTextColor)]",
            valueClassname: "font-medium text-[var(--returnTextColor)]",
            className: "col-6",
            style: eL
        }, eV), eo[93] = eL, eo[94] = eV, eo[95] = eH, eo[96] = eO, eo[97] = X) : X = eo[97], eo[98] !== eA || eo[99] !== eE || eo[100] !== s.market.slug || eo[101] !== s.outcomeIndex ? (J = eE && (0, t.jsx)("div", {
            className: "flex flex-1 justify-end col-7 gap-2",
            children: (0, t.jsx)(I.default, {
                onClick: eA
            })
        }, `${s.market.slug}-${s.outcomeIndex}-position-cash-out`), eo[98] = eA, eo[99] = eE, eo[100] = s.market.slug, eo[101] = s.outcomeIndex, eo[102] = J) : J = eo[102], eo[103] !== el || eo[104] !== eE ? (ee = el && !eE && (0, t.jsx)("div", {
            className: "col-7"
        }), eo[103] = el, eo[104] = eE, eo[105] = ee) : ee = eo[105];
        let eU = el && "col-8";
        eo[106] !== eU ? (et = (0, j.cn)("flex flex-1 justify-end col-7 gap-2 sticky right-3 z-1", eU), eo[106] = eU, eo[107] = et) : et = eo[107];
        let eW = `${s.outcomeIndex}-position-cash-out`;
        return eo[108] !== eP || eo[109] !== eb.sell ? (er = e => {
            e.preventDefault(), e.stopPropagation(), eP(eb.sell)
        }, eo[108] = eP, eo[109] = eb.sell, eo[110] = er) : er = eo[110], eo[111] !== s.market.closed || eo[112] !== ec ? (ea = ec(s.market.closed ? "trading.redeem" : "trading.sell"), eo[111] = s.market.closed, eo[112] = ec, eo[113] = ea) : ea = eo[113], eo[114] !== er || eo[115] !== ea ? (ei = (0, t.jsx)(M.Button, {
            variant: "outline",
            className: "bg-background",
            size: "sm",
            onClick: er,
            children: ea
        }), eo[114] = er, eo[115] = ea, eo[116] = ei) : ei = eo[116], eo[117] !== et || eo[118] !== eW || eo[119] !== ei ? (en = (0, t.jsx)("div", {
            className: et,
            children: ei
        }, eW), eo[117] = et, eo[118] = eW, eo[119] = ei, eo[120] = en) : en = eo[120], eo[121] !== i || eo[122] !== n || eo[123] !== q || eo[124] !== W || eo[125] !== G || eo[126] !== K || eo[127] !== Q || eo[128] !== X || eo[129] !== J || eo[130] !== ee || eo[131] !== en ? (es = (0, t.jsxs)("div", {
            ref: i,
            className: "contents w-full bg-background",
            ...n,
            children: [q, W, G, K, Q, X, J, ee, en]
        }), eo[121] = i, eo[122] = n, eo[123] = q, eo[124] = W, eo[125] = G, eo[126] = K, eo[127] = Q, eo[128] = X, eo[129] = J, eo[130] = ee, eo[131] = en, eo[132] = es) : es = eo[132], es
    };

    function $(e) {
        return e.oddsFormat
    }
    F.displayName = "DesktopSportsItemPosition";
    let B = {
            duration: .27,
            ease: [.26, .08, .25, 1]
        },
        q = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: { ...B,
                    delay: .2
                }
            },
            exit: {
                overflow: "visible",
                opacity: 0,
                height: 0,
                transition: { ...B
                }
            }
        },
        V = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: { ...B,
                    delay: .2
                }
            },
            exit: {
                overflow: "visible",
                opacity: 0,
                height: 0,
                transition: { ...B
                }
            }
        },
        H = e => {
            let a, i, n, o, l, c, d, u, m, p, h, f, x, g, v = (0, r.c)(34);
            if (v[0] !== e) {
                let {
                    ref: t,
                    view: r,
                    renderNegRisk: s,
                    className: l,
                    ...c
                } = e;
                n = t, o = s, a = l, i = c, v[0] = e, v[1] = a, v[2] = i, v[3] = n, v[4] = o
            } else a = v[1], i = v[2], n = v[3], o = v[4];
            let y = (0, S.useTranslations)();
            v[5] !== y ? (l = y("trading.type"), v[5] = y, v[6] = l) : l = v[6], v[7] !== y ? (c = y("trading.outcome"), v[7] = y, v[8] = c) : c = v[8], v[9] !== y ? (d = y("trading.avg"), v[9] = y, v[10] = d) : d = v[10], v[11] !== y ? (u = y("trading.cost"), v[11] = y, v[12] = u) : u = v[12], v[13] !== y ? (m = y("portfolio.positionsTable.toWin"), v[13] = y, v[14] = m) : m = v[14], v[15] !== y ? (p = y("trading.current"), v[15] = y, v[16] = p) : p = v[16], v[17] !== l || v[18] !== c || v[19] !== d || v[20] !== u || v[21] !== m || v[22] !== p ? (h = [l, c, d, u, m, p], v[17] = l, v[18] = c, v[19] = d, v[20] = u, v[21] = m, v[22] = p, v[23] = h) : h = v[23];
            let b = h,
                k = o && "not-supports-[grid-template-columns:subgrid]:grid-cols-[auto_auto_minmax(50px,auto)_minmax(50px,auto)_minmax(80px,auto)_minmax(50px,auto)_minmax(50px,auto)_minmax(50px,auto)_minmax(50px,auto)]";
            return v[24] !== a || v[25] !== k ? (f = (0, j.cn)("grid !grid-cols-subgrid col-span-full w-full pb-2 px-4 border-b not-supports-[grid-template-columns:subgrid]:grid-cols-[auto_auto_minmax(50px,auto)_minmax(50px,auto)_minmax(80px,auto)_minmax(50px,auto)_minmax(50px,auto)_minmax(50px,auto)] sticky top-[0px] bg-surface-1", k, a), v[24] = a, v[25] = k, v[26] = f) : f = v[26], v[27] !== b ? (x = (0, t.jsx)("div", {
                className: "w-full contents overflow-hidden",
                children: b.map(W)
            }), v[27] = b, v[28] = x) : x = v[28], v[29] !== i || v[30] !== n || v[31] !== x || v[32] !== f ? (g = (0, t.jsx)(s.motion.div, {
                ref: n,
                className: f,
                variants: q,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                ...i,
                children: x
            }), v[29] = i, v[30] = n, v[31] = x, v[32] = f, v[33] = g) : g = v[33], g
        };
    H.displayName = "PositionHeader";
    let U = e => {
        let a, i, o, l, c, d, u, m, p, h, f, g, v, y = (0, r.c)(34);
        y[0] !== e ? ({
            ref: c,
            positions: l,
            view: u,
            className: i,
            children: a,
            expandMobile: o,
            ...d
        } = e, y[0] = e, y[1] = a, y[2] = i, y[3] = o, y[4] = l, y[5] = c, y[6] = d, y[7] = u) : (a = y[1], i = y[2], o = y[3], l = y[4], c = y[5], d = y[6], u = y[7]);
        let b = void 0 === u ? "detail-item" : u,
            {
                isNegRisk: k
            } = (0, x.useSportsItemContext)();
        if (y[8] !== k || y[9] !== l) {
            let e;
            y[11] !== k ? (e = e => !!(e.market.negRisk && k) && (!e || 1 === e.position.sell.outcomeIdx && !e.position.sell.isClosed), y[11] = k, y[12] = e) : e = y[12], m = l.some(e), y[8] = k, y[9] = l, y[10] = m
        } else m = y[10];
        let w = m,
            S = w && "grid-cols-[auto_auto_minmax(30px,auto)_minmax(30px,auto)_minmax(30px,auto)_minmax(30px,auto)_minmax(30px,auto)_minmax(30px,auto)]",
            C = o && "px-[12px]";
        return y[13] !== i || y[14] !== S || y[15] !== C ? (p = (0, j.cn)("grid relative min-w-max min-h-max py-2 w-full items-center gap-y-2 gap-x-5 grid-rows-[_1fr] grid-cols-[auto_auto_minmax(30px,auto)_minmax(30px,auto)_minmax(30px,auto)_minmax(30px,auto)_minmax(30px,auto)]", S, C, i), y[13] = i, y[14] = S, y[15] = C, y[16] = p) : p = y[16], y[17] !== w || y[18] !== b ? (h = (0, t.jsx)(H, {
            view: b,
            renderNegRisk: w
        }, "position-header-wrapper"), y[17] = w, y[18] = b, y[19] = h) : h = y[19], y[20] !== o || y[21] !== l || y[22] !== w || y[23] !== b ? (f = l ? .map(e => (0, t.jsx)(s.motion.div, {
            className: (0, j.cn)("grid col-span-full grid-cols-subgrid w-full px-3 items-center", o && "px-0"),
            variants: V,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            children: e.isNegRisk ? (0, t.jsx)(_.BookContextProvider, {
                market: e.market,
                prefetch: {
                    book: "never",
                    lastPrice: "never"
                },
                poll: "never",
                subscribe: "never",
                defer: "never",
                children: (0, t.jsx)(F, {
                    position: e,
                    view: b,
                    shrinkButton: !0,
                    hasNegRiskItemInGrid: w
                }, `position-${e.outcomeIndex}`)
            }) : (0, t.jsx)(F, {
                position: e,
                view: b,
                shrinkButton: !0,
                hasNegRiskItemInGrid: w
            }, `position-${e.outcomeIndex}`)
        }, `position-wrapper-${e.outcomeIndex}-${e.isNegRisk&&e.isNegRiskDraw?"draw":""}-${e.market.sportsMarketType}-${e.market.line}`)), y[20] = o, y[21] = l, y[22] = w, y[23] = b, y[24] = f) : f = y[24], y[25] !== h || y[26] !== f ? (g = (0, t.jsxs)(n.AnimatePresence, {
            initial: !1,
            mode: "sync",
            children: [h, f]
        }), y[25] = h, y[26] = f, y[27] = g) : g = y[27], y[28] !== a || y[29] !== c || y[30] !== d || y[31] !== p || y[32] !== g ? (v = (0, t.jsx)("div", {
            className: "w-full h-max overflow-scroll max-h-[300px] relative",
            children: (0, t.jsxs)("div", {
                ref: c,
                className: p,
                ...d,
                children: [a, g]
            })
        }), y[28] = a, y[29] = c, y[30] = d, y[31] = p, y[32] = g, y[33] = v) : v = y[33], v
    };

    function W(e, r) {
        return (0, t.jsx)("p", {
            className: "font-medium text-text-secondary text-[10px] uppercase tracking-wider",
            style: {
                gridColumn: r + 1
            },
            children: e
        }, e)
    }
    U.displayName = "DesktopSportsItemPositions";
    var G = e.i(827525),
        Z = e.i(18365),
        K = e.i(211721),
        Y = I,
        Q = e.i(118818);
    let X = e => {
        let i, n, s, o, c, u, m, h, g, y, b, S, C, N, I, E, A, O, F, $, B, q, V, H, U, W, X, ee = (0, r.c)(95);
        ee[0] !== e ? ({
            ref: s,
            position: c,
            onSellClick: n,
            className: i,
            hideControls: u,
            openCashOutOnClick: m,
            ...o
        } = e, ee[0] = e, ee[1] = i, ee[2] = n, ee[3] = s, ee[4] = o, ee[5] = c, ee[6] = u, ee[7] = m) : (i = ee[1], n = ee[2], s = ee[3], o = ee[4], c = ee[5], u = ee[6], m = ee[7]);
        let et = void 0 !== u && u,
            er = void 0 !== m && m,
            {
                moneylineMarket: ea,
                event: ei
            } = (0, x.useSportsItemContext)(),
            {
                closed: en
            } = ea,
            {
                enableNegRisk: es,
                slug: eo
            } = ei,
            el = (0, L.useAmplitudeAnalytics)(),
            ec = (0, v.useSetActiveSportsMarket)(),
            {
                setTradeState: ed
            } = (0, f.useMobileTradeContext)();
        ee[8] === Symbol.for("react.memo_cache_sentinel") ? (h = ["market"], ee[8] = h) : h = ee[8];
        let {
            market: eu
        } = (0, _.useBookContext)(h), {
            view: em
        } = (0, Q.useMobileMarketContext)(), [ep, eh] = l.default.useState(!1), {
            enrichedPosition: ef
        } = (0, P.useEnrichedPosition)(c.rawPosition, void 0, c.market), ex = (0, T.useMarketBestPrices)(eu), eg = ef ? .sell.outcomeIdx ? ? 0;
        e: {
            let e, t;
            if ("nrfi" === c.market.sportsMarketType || "both_teams_to_score" === c.market.sportsMarketType || "anytime_touchdowns" === c.market.sportsMarketType || "first_touchdowns" === c.market.sportsMarketType || "soccer_anytime_goalscorer" === c.market.sportsMarketType || "soccer_exact_score" === c.market.sportsMarketType || "tennis_completed_match" === c.market.sportsMarketType || (0, w.isSpreadMarket)(c.market.sportsMarketType) || (0, w.isTotalMarket)(c.market.sportsMarketType)) {
                let e, t;
                ee[9] !== c ? (e = (0, k.getPositionForLine)({
                    sportsMarketType: c.market.sportsMarketType,
                    position: c,
                    market: c.market
                }), ee[9] = c, ee[10] = e) : e = ee[10];
                let {
                    label: r,
                    qty: a,
                    color: i,
                    avgPrice: n
                } = e, s = `${a} @ ${n}`;
                ee[11] !== i || ee[12] !== r || ee[13] !== s ? (t = {
                    label: r,
                    color: i,
                    qty: s
                }, ee[11] = i, ee[12] = r, ee[13] = s, ee[14] = t) : t = ee[14], g = t;
                break e
            }
            ee[15] !== c ? (e = (0, k.getMoneylinePosition)({
                position: c,
                market: c.market
            }), ee[15] = c, ee[16] = e) : e = ee[16];
            let {
                label: r,
                qty: a,
                color: i,
                avgPrice: n
            } = e,
            s = `${a} @ ${n}`;ee[17] !== i || ee[18] !== r || ee[19] !== s ? (t = {
                label: r,
                color: i,
                qty: s
            }, ee[17] = i, ee[18] = r, ee[19] = s, ee[20] = t) : t = ee[20],
            g = t
        }
        let {
            label: ev,
            qty: ey,
            color: eb
        } = g;
        ee[21] !== el || ee[22] !== ex || ee[23] !== en || ee[24] !== n || ee[25] !== ef || ee[26] !== ed || ee[27] !== c.market || ee[28] !== em ? (y = () => {
            n ? .(), ef && (ed({
                type: c.market.closed ? "sports-redeem" : "redeem",
                outcomeIdx: ef.sell.outcomeIdx,
                open: !0,
                orderType: p.OrderType.Market,
                side: a.Side.SELL,
                ...ex ? .[0 === ef.sell.outcomeIdx ? "~zero" : "~one"] ? .sell && {
                    price: ex[0 === ef.sell.outcomeIdx ? "~zero" : "~one"].sell ? ? "0"
                },
                shares : ef.sell.qty,
                ...c.market && {
                    market: c.market
                }
            }), el.trackEvent(D.Events.SportsPositionSellClick, {
                closed: en,
                location: "default" === em ? "card" : "in-game-view"
            }))
        }, ee[21] = el, ee[22] = ex, ee[23] = en, ee[24] = n, ee[25] = ef, ee[26] = ed, ee[27] = c.market, ee[28] = em, ee[29] = y) : y = ee[29];
        let ek = y;
        ee[30] !== er || ee[31] !== ed || ee[32] !== c.market || ee[33] !== c.outcomeIndex || ee[34] !== c.position.qty ? (b = () => {
            er && (c.market.closed ? ed({
                type: "sports-redeem",
                sportsRedemptionConditionIds: [c.market.conditionId],
                market: c.market
            }) : ed ? .({
                type: "redeem",
                market: c.market,
                outcomeIdx: c.outcomeIndex,
                side: a.Side.SELL,
                orderType: p.OrderType.Market,
                shares: c.position.qty
            }))
        }, ee[30] = er, ee[31] = ed, ee[32] = c.market, ee[33] = c.outcomeIndex, ee[34] = c.position.qty, ee[35] = b) : b = ee[35];
        let ew = b;
        t: {
            if (!(c.market.negRisk && !1 !== es) || ef && (1 !== ef.sell.outcomeIdx || ef.sell.isClosed)) {
                S = !1;
                break t
            }
            S = !0
        }
        let eS = S;
        ee[36] !== eo || ee[37] !== ec || ee[38] !== c.market ? (C = e => {
            e.stopPropagation(), ec(c.market, {
                eventSlug: eo,
                openOverlayAccordion: !1,
                openGamesAccordion: !1,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            }), eh(!0)
        }, ee[36] = eo, ee[37] = ec, ee[38] = c.market, ee[39] = C) : C = ee[39];
        let ej = C;
        r: {
            let e, t, r;
            if (!ef) {
                let e;
                ee[40] === Symbol.for("react.memo_cache_sentinel") ? (e = {}, ee[40] = e) : e = ee[40], N = e;
                break r
            }
            ee[41] !== ef.totalReturn.color ? (e = "red" === ef.totalReturn.color && {
                "--returnTextColor": "var(--red-400)"
            }, ee[41] = ef.totalReturn.color, ee[42] = e) : e = ee[42],
            ee[43] !== ef.totalReturn.color ? (t = "green" === ef.totalReturn.color && {
                "--returnTextColor": "var(--green-500)"
            }, ee[43] = ef.totalReturn.color, ee[44] = t) : t = ee[44],
            ee[45] !== e || ee[46] !== t ? (r = {
                "--returnTextColor": "var(--neutral-500)",
                ...e,
                ...t
            }, ee[45] = e, ee[46] = t, ee[47] = r) : r = ee[47],
            N = r
        }
        let eC = N;
        a: {
            let e;
            if (!c.market.closed) {
                let e;
                ee[48] !== ex || ee[49] !== c.position.sell ? (e = ex ? .[0 === c.position.sell.outcomeIdx ? "~zero" : "~one"] ? .[a.Side.SELL.toLowerCase()], ee[48] = ex, ee[49] = c.position.sell, ee[50] = e) : e = ee[50];
                let t = e;
                if (void 0 !== t) {
                    let e, r = parseFloat(t ? ? "0") * parseFloat(c.position.qty);
                    ee[51] !== r ? (e = (0, d.formatCurrency)(r, {
                        decimals: 2
                    }), ee[51] = r, ee[52] = e) : e = ee[52], I = e;
                    break a
                }
            }
            ee[53] !== c.position.value.currentMarketValue ? (e = (0, d.toUSCurrency)(c.position.value.currentMarketValue), ee[53] = c.position.value.currentMarketValue, ee[54] = e) : e = ee[54],
            I = e
        }
        let e_ = I;
        if (!ef) return null;
        ee[55] !== i ? (E = (0, j.cn)("flex w-full h-max justify-between items-center not-last:pb-2 not-last:border-b bg-background", i), ee[55] = i, ee[56] = E) : E = ee[56], ee[57] !== eb || ee[58] !== ev || ee[59] !== ew || ee[60] !== eg || ee[61] !== ey ? (A = (0, t.jsx)(z.SportsPositionOutcomeChip, {
            shareQuantity: ey,
            label: ev,
            outcomeIndex: eg,
            color: eb,
            onClick: ew,
            reversed: !0
        }), ee[57] = eb, ee[58] = ev, ee[59] = ew, ee[60] = eg, ee[61] = ey, ee[62] = A) : A = ee[62];
        let eT = `${c.outcomeIndex}-position-current`;
        ee[63] !== eT || ee[64] !== e_ ? (O = (0, t.jsx)(R.SportsItemPositionDataPoint, {
            value: e_
        }, eT), ee[63] = eT, ee[64] = e_, ee[65] = O) : O = ee[65];
        let eM = `${c.outcomeIndex}-position-gain`,
            eN = `${ef.totalReturn.totalProfit}`;
        ee[66] !== eC || ee[67] !== eM || ee[68] !== eN ? (F = (0, t.jsx)(R.SportsItemPositionDataPoint, {
            value: eN,
            valueClassname: "text-xs font-medium text-[var(--returnTextColor)]",
            style: eC
        }, eM), ee[66] = eC, ee[67] = eM, ee[68] = eN, ee[69] = F) : F = ee[69], ee[70] !== O || ee[71] !== F ? ($ = (0, t.jsxs)("div", {
            className: "flex flex-col items-end gap-0.5",
            children: [O, F]
        }), ee[70] = O, ee[71] = F, ee[72] = $) : $ = ee[72];
        let eI = et && "hidden";
        return ee[73] !== eI ? (B = (0, j.cn)("flex-none size-8 bg-neutral-50! border-none transition-none p-0 hover:bg-neutral-50! focus:bg-neutral-50! active:bg-neutral-50!", eI), ee[73] = eI, ee[74] = B) : B = ee[74], ee[75] !== ek ? (q = e => {
            e.preventDefault(), e.stopPropagation(), ek()
        }, ee[75] = ek, ee[76] = q) : q = ee[76], ee[77] === Symbol.for("react.memo_cache_sentinel") ? (V = (0, t.jsx)(K.IconXmarkOutline12, {
            className: "text-text"
        }), ee[77] = V) : V = ee[77], ee[78] !== B || ee[79] !== q ? (H = (0, t.jsx)(M.Button, {
            variant: "tertiary",
            className: B,
            onClick: q,
            children: V
        }), ee[78] = B, ee[79] = q, ee[80] = H) : H = ee[80], ee[81] !== ep || ee[82] !== ej || ee[83] !== eS ? (U = eS && (0, t.jsx)("div", {
            className: "flex items-center gap-2",
            children: eS && (0, t.jsxs)(G.Drawer.Root, {
                shouldScaleBackground: !1,
                open: ep,
                onOpenChange: eh,
                repositionInputs: !1,
                children: [(0, t.jsx)(G.Drawer.Trigger, {
                    asChild: !0,
                    children: (0, t.jsx)(M.Button, {
                        onClick: ej,
                        variant: "tertiary",
                        className: "flex-none px-2 py-1.5 border border-neutral-50 h-[30px]",
                        children: (0, t.jsx)(Z.IconArrowsOppositeDirectionX2Fill24, {
                            size: 20,
                            className: "fill-text"
                        })
                    })
                }), (0, t.jsxs)(G.Drawer.Portal, {
                    children: [(0, t.jsx)(G.Drawer.Overlay, {
                        onClick: e => {
                            e.stopPropagation(), eh(!1)
                        },
                        className: "fixed inset-0 bg-black/40 z-[calc(var(--z-drawer)+34)]"
                    }), (0, t.jsx)(G.Drawer.Content, {
                        onClick: J,
                        className: "z-[calc(var(--z-drawer)+35)] fixed bottom-0 left-0 right-0 flex flex-col rounded-t-lg bg-background",
                        children: (0, t.jsx)(Y.ConvertPositionsInternals, {})
                    })]
                })]
            })
        }), ee[81] = ep, ee[82] = ej, ee[83] = eS, ee[84] = U) : U = ee[84], ee[85] !== $ || ee[86] !== H || ee[87] !== U ? (W = (0, t.jsxs)("div", {
            className: "flex gap-3 items-center",
            children: [$, H, U]
        }), ee[85] = $, ee[86] = H, ee[87] = U, ee[88] = W) : W = ee[88], ee[89] !== s || ee[90] !== o || ee[91] !== E || ee[92] !== A || ee[93] !== W ? (X = (0, t.jsxs)("div", {
            ref: s,
            className: E,
            ...o,
            children: [A, W]
        }), ee[89] = s, ee[90] = o, ee[91] = E, ee[92] = A, ee[93] = W, ee[94] = X) : X = ee[94], X
    };

    function J(e) {
        return e.stopPropagation()
    }
    X.displayName = "MobileSportsItemPosition";
    let ee = e => {
        let a, i, n, o = (0, r.c)(10),
            {
                ref: l,
                positions: c,
                className: d
            } = e;
        if (o[0] !== d ? (a = (0, j.cn)("flex flex-col w-full px-3 py-2", d), o[0] = d, o[1] = a) : a = o[1], o[2] !== c) {
            let e;
            o[4] !== c.length ? (e = (e, r) => (0, t.jsx)(_.BookContextProvider, {
                market: e.market,
                prefetch: {
                    book: "never",
                    lastPrice: "never"
                },
                poll: "never",
                subscribe: "never",
                defer: "never",
                children: (0, t.jsx)(X, {
                    position: e,
                    className: (0, j.cn)(r === c.length - 1 ? "mb-0" : "mb-2"),
                    openCashOutOnClick: !0
                })
            }, `mobile-position-${e.outcomeIndex}-${e.isNegRisk&&e.isNegRiskDraw}-${e.market.sportsMarketType}-${e.market.line}`), o[4] = c.length, o[5] = e) : e = o[5], i = c.map(e), o[2] = c, o[3] = i
        } else i = o[3];
        return o[6] !== l || o[7] !== a || o[8] !== i ? (n = (0, t.jsx)(s.motion.div, {
            ref: l,
            className: a,
            children: i
        }), o[6] = l, o[7] = a, o[8] = i, o[9] = n) : n = o[9], n
    };
    ee.displayName = "MobileSportsItemPositions";
    var et = e.i(488224);
    let er = {
            initial: {
                opacity: 0,
                height: 0
            },
            animate: {
                opacity: 1,
                height: "auto",
                transition: { ...b.transition,
                    opacity: b.opacityTransition
                }
            },
            exit: {
                opacity: 0,
                height: 0,
                transition: { ...b.transition,
                    opacity: b.opacityTransition
                }
            }
        },
        ea = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: { ...b.transition,
                    opacity: { ...b.opacityTransition,
                        delay: .2
                    }
                }
            },
            exit: {
                opacity: 0,
                transition: { ...b.transition,
                    opacity: { ...b.opacityTransition
                    }
                }
            }
        },
        ei = e => {
            let i, n, o, c, u, g, y, j, _, T, M, N = (0, r.c)(35),
                {
                    positions: I
                } = e,
                {
                    mode: P,
                    event: E
                } = (0, x.useSportsItemContext)(),
                A = (0, S.useTranslations)(),
                {
                    setTradeState: O
                } = (0, f.useMobileTradeContext)(),
                {
                    setSportsCashOutState: D
                } = (0, h.useCashOutTxContext)();
            N[0] === Symbol.for("react.memo_cache_sentinel") ? (i = ["setOrderExpiration", "setShares", "setAmountUpdateLocation", "setSelectedOutcomeIdx", "setOrderType", "setSide"], N[0] = i) : i = N[0];
            let {
                setOrderExpiration: L,
                setShares: R,
                setAmountUpdateLocation: F,
                setSelectedOutcomeIdx: $,
                setOrderType: B,
                setSide: q
            } = (0, C.useTradeContext)(i), V = (0, v.useSetActiveSportsMarket)(), H = (0, m.useSportsStore)(eo);
            if (N[1] !== H || N[2] !== I) {
                let e;
                N[4] !== H ? (e = e => {
                    if ("nrfi" === e.market.sportsMarketType || "both_teams_to_score" === e.market.sportsMarketType || "anytime_touchdowns" === e.market.sportsMarketType || "first_touchdowns" === e.market.sportsMarketType || "two_plus_touchdowns" === e.market.sportsMarketType || "soccer_anytime_goalscorer" === e.market.sportsMarketType || "soccer_exact_score" === e.market.sportsMarketType || "tennis_completed_match" === e.market.sportsMarketType || (0, w.isSpreadMarket)(e.market.sportsMarketType) || (0, w.isTotalMarket)(e.market.sportsMarketType)) {
                        let {
                            qtyNumber: t,
                            qty: r,
                            avgPrice: a,
                            convertedAvgPrice: i,
                            sortKey: n,
                            ...s
                        } = (0, k.getPositionForLine)({
                            sportsMarketType: e.market.sportsMarketType,
                            position: e,
                            market: e.market,
                            oddsFormat: H
                        }), o = parseFloat(a) * t;
                        return {
                            id: `position-chip-${e.market.conditionId}-${e.outcomeIndex}`,
                            qty: `${(0,d.formatNum)(t,{decimals:2,trailingZeros:!1})} @ ${i}`,
                            sortKey: o,
                            ...s,
                            position: e
                        }
                    }
                    let {
                        qtyNumber: t,
                        qty: r,
                        avgPrice: a,
                        convertedAvgPrice: i,
                        sortKey: n,
                        ...s
                    } = (0, k.getMoneylinePosition)({
                        position: e,
                        market: e.market,
                        oddsFormat: H
                    }), o = parseFloat(a) * t;
                    return {
                        id: `position-chip-${e.market.conditionId}-${e.outcomeIndex}`,
                        qty: `${(0,d.formatNum)(t,{decimals:2,trailingZeros:!1})} @ ${i}`,
                        sortKey: o,
                        ...s,
                        position: e
                    }
                }, N[4] = H, N[5] = e) : e = N[5], n = I.map(e).sort(el), N[1] = H, N[2] = I, N[3] = n
            } else n = N[3];
            let U = n;
            N[6] !== U ? (o = {
                positionChips: U
            }, N[6] = U, N[7] = o) : o = N[7];
            let {
                positionChips: W
            } = o;
            N[8] === Symbol.for("react.memo_cache_sentinel") ? (c = {}, N[8] = c) : c = N[8];
            let G = l.default.useRef(c),
                Z = l.default.useRef(null);
            N[9] === Symbol.for("react.memo_cache_sentinel") ? (u = [], N[9] = u) : u = N[9];
            let [K, Y] = l.default.useState(u), [Q, X] = l.default.useState(0);
            N[10] !== P || N[11] !== W ? (g = () => {
                let e;
                if (Z.current) {
                    let t = new ResizeObserver(() => {
                        let e = Z.current;
                        if (!e) return;
                        let t = e.getBoundingClientRect().width - ("mobile" === P ? 20 : 100),
                            {
                                chips: r
                            } = W.reduce((e, r) => {
                                if (e.reachedLimit) return e;
                                let a = G.current[r.id] ? ? (r.label.length + r.qty.length) * 6.5;
                                return W.length > 1 && e.totalWidth + a > t ? e.reachedLimit = !0 : (e.totalWidth = e.totalWidth + a, e.chips.push(W[e.chips.length])), e
                            }, {
                                chips: [],
                                totalWidth: 0,
                                reachedLimit: !1
                            }),
                            a = r.slice(0, 3);
                        Y(a), X(W.length - a.length)
                    });
                    t.observe(Z.current), e = () => t.disconnect()
                }
                return () => e ? .()
            }, y = [W, P], N[10] = P, N[11] = W, N[12] = g, N[13] = y) : (g = N[12], y = N[13]), l.default.useEffect(g, y), N[14] !== E.slug || N[15] !== P || N[16] !== V || N[17] !== F || N[18] !== L || N[19] !== B || N[20] !== $ || N[21] !== R || N[22] !== q || N[23] !== D || N[24] !== O ? (j = e => t => {
                t.preventDefault(), t.stopPropagation(), "mobile" === P ? e.market.closed ? O ? .({
                    type: "sports-redeem",
                    sportsRedemptionConditionIds: [e.market.conditionId],
                    market: e.market
                }) : O ? .({
                    type: "redeem",
                    market: e.market,
                    outcomeIdx: e.position.sell.outcomeIdx,
                    side: a.Side.SELL,
                    orderType: p.OrderType.Market,
                    shares: e.position.sell.qty
                }) : (V(e.market, {
                    eventSlug: E.slug,
                    closeGamesAccordionIfOpen: !1,
                    closeOverlayAccordionIfOpen: !1
                }), $(e.outcomeIndex), R(e.position.qty), F("update-only"), B(p.OrderType.Market), q(a.Side.SELL), D({
                    open: !0,
                    mode: e.market.closed ? "injected" : "single",
                    conditionIds: [e.market.conditionId]
                })), L(void 0)
            }, N[14] = E.slug, N[15] = P, N[16] = V, N[17] = F, N[18] = L, N[19] = B, N[20] = $, N[21] = R, N[22] = q, N[23] = D, N[24] = O, N[25] = j) : j = N[25];
            let J = j;
            return N[26] !== J || N[27] !== A || N[28] !== K ? (_ = K.map(e => (0, t.jsx)(s.motion.span, {
                ref: t => {
                    t && (G.current[e.id] = t.getBoundingClientRect().width)
                },
                variants: ea,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                transition: b.transition,
                className: "dark:mix-blend-plus-lighter",
                children: (0, t.jsx)(z.SportsPositionOutcomeChip, {
                    shareQuantity: e.qty,
                    label: e.label,
                    outcomeIndex: e.outcomeIndex,
                    color: e.color,
                    reversed: !0,
                    hoverable: !0,
                    allowCloseOut: !0,
                    onClick: J(e.position),
                    hoverVariableToSuppress: "position-accordion",
                    closeOutText: e.position.market.closed ? A("trading.redeem") : A("trading.cashOut"),
                    uppercase: !1
                })
            }, e.id)), N[26] = J, N[27] = A, N[28] = K, N[29] = _) : _ = N[29], N[30] !== Q ? (T = Q > 0 && (0, t.jsx)(s.motion.span, {
                variants: ea,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                transition: b.transition,
                className: "text-text-secondary text-xs font-medium whitespace-nowrap line-height-[18px] self-center",
                children: `+${Q} more`
            }, "hidden-count"), N[30] = Q, N[31] = T) : T = N[31], N[32] !== T || N[33] !== _ ? (M = (0, t.jsxs)(s.motion.div, {
                ref: Z,
                className: "flex flex-1 flex-wrap overflow-hidden gap-2 justify-end",
                children: [_, T]
            }), N[32] = T, N[33] = _, N[34] = M) : M = N[34], M
        },
        en = e => ({
            setPreventAccordionHover: e.setPreventAccordionHover,
            preventPositionsAccordionHover: e.preventPositionsAccordionHover,
            positionsAccordionState: e.positionsAccordionState,
            setPositionsAccordionState: e.setPositionsAccordionState,
            variant: e.variant
        }),
        es = e => {
            let a, d, p, h, f, b, k = (0, r.c)(30),
                {
                    positions: w,
                    expandMobile: C
                } = e,
                {
                    setPreventAccordionHover: _,
                    preventPositionsAccordionHover: T,
                    positionsAccordionState: M,
                    setPositionsAccordionState: N,
                    variant: I
                } = (0, et.useSportsItemStore)(en, c.shallow),
                P = (0, S.useTranslations)(),
                {
                    positions: E
                } = (0, g.useSportsPositionContext)(),
                A = l.default.useDeferredValue(T),
                {
                    positions: O
                } = (0, y.useSportsItemPositions)(w ? ? E),
                {
                    event: D,
                    mode: L
                } = (0, x.useSportsItemContext)(),
                z = (0, v.useSetActiveSportsMarket)();
            k[0] !== _ ? (a = () => {
                _(!0)
            }, k[0] = _, k[1] = a) : a = k[1];
            let R = a;
            k[2] !== _ ? (d = () => {
                _(!1)
            }, k[2] = _, k[3] = d) : d = k[3];
            let F = d,
                $ = O.length > 0;
            k[4] !== D.slug ? (p = e => e.gamesAccordionValue === D.slug, k[4] = D.slug, k[5] = p) : p = k[5];
            let B = (0, m.useSportsStore)(p),
                q = (0, m.useSportsStore)(ec),
                [V, H] = (0, u.useSportsAccordionState)();
            k[6] !== D.markets || k[7] !== D.slug || k[8] !== V || k[9] !== B || k[10] !== z || k[11] !== q || k[12] !== H || k[13] !== I ? (h = () => {
                let e = !1;
                if ("card" !== I || B || (q(""), e = !0), "card" !== I && V !== I && (H(""), e = !0), e) {
                    let e = D.markets.filter(ed);
                    z(e.length ? e[0] : D.markets[0], {
                        eventSlug: D.slug,
                        openGamesAccordion: !1,
                        openOverlayAccordion: !1,
                        closeGamesAccordionIfOpen: !1,
                        closeOverlayAccordionIfOpen: !1
                    })
                }
            }, k[6] = D.markets, k[7] = D.slug, k[8] = V, k[9] = B, k[10] = z, k[11] = q, k[12] = H, k[13] = I, k[14] = h) : h = k[14];
            let W = h;
            return k[15] !== A || k[16] !== C || k[17] !== $ || k[18] !== L || k[19] !== W || k[20] !== R || k[21] !== F || k[22] !== M || k[23] !== N || k[24] !== O || k[25] !== P ? (f = $ && (0, t.jsx)(s.motion.div, {
                variants: er,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                children: (0, t.jsx)(o.Accordion.Root, {
                    type: "single",
                    value: M,
                    onValueChange: N,
                    onPointerEnter: R,
                    onPointerLeave: F,
                    className: "w-full h-fit p-0",
                    children: (0, t.jsxs)(o.Accordion.AccordionItem, {
                        value: "positions",
                        className: (0, j.cn)("border-t", C && "!overflow-x-visible"),
                        children: [(0, t.jsxs)(o.Accordion.Trigger, {
                            onClick: e => {
                                e.preventDefault(), e.stopPropagation(), W(), N("positions" === M ? "" : "positions")
                            },
                            className: (0, j.cn)("group/trigger flex justify-between items-center px-3 w-full h-[40px] bg-surface-1 hover:bg-surface-2 border-none pt-0 outline-none !font-semi !text-sm !text-text-primary cursor-pointer gap-5 relative", C && "px-0", A && "hover:bg-surface-1"),
                            children: [(0, t.jsxs)("span", {
                                className: "flex items-center gap-2 bg-transparent w-fit group-data-[state=open]/trigger:[&_svg]:-rotate-180 [&_svg]:transition-transform [&_svg]:duration-200 [&_svg]:ease-linear",
                                children: [(0, t.jsx)("span", {
                                    className: "text-sm font-medium",
                                    children: P("rewards.trading.positions")
                                }), (0, t.jsx)(i.IconChevronDownOutline12, {
                                    size: 12
                                })]
                            }), (0, t.jsx)(ei, {
                                positions: O
                            })]
                        }), (0, t.jsx)(o.Accordion.Content, {
                            className: (0, j.cn)("w-full bg-surface-1 data-[state=closed]:animate-accordionSlideUp data-[state=open]:animate-accordionSlideDown overflow-y-hidden", C && "w-[calc(100%+24px)] ml-[-12px]"),
                            children: "mobile" === L ? (0, t.jsx)(ee, {
                                positions: O
                            }) : (0, t.jsx)(U, {
                                positions: O,
                                expandMobile: C
                            })
                        })]
                    })
                })
            }, `accordion-positions-${$}`), k[15] = A, k[16] = C, k[17] = $, k[18] = L, k[19] = W, k[20] = R, k[21] = F, k[22] = M, k[23] = N, k[24] = O, k[25] = P, k[26] = f) : f = k[26], k[27] !== $ || k[28] !== f ? (b = (0, t.jsx)(n.AnimatePresence, {
                mode: "sync",
                initial: !1,
                custom: $,
                children: f
            }), k[27] = $, k[28] = f, k[29] = b) : b = k[29], b
        };

    function eo(e) {
        return e.oddsFormat
    }

    function el(e, t) {
        return t.sortKey - e.sortKey
    }

    function ec(e) {
        return e.setGamesAccordionValue
    }

    function ed(e) {
        return (e.sportsMarketType ? ? "moneyline") === "moneyline"
    }
    es.displayName = "AccordionPositions"
}, 987228, 500324, 123341, 893959, 779584, 413002, 67767, 693141, 228032, 255128, 294241, 364562, 344500, e => {
    "use strict";
    e.s(["SportsMarketsSection", () => tm], 987228);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(810912),
        i = e.i(416340),
        n = e.i(840216),
        s = e.i(100825),
        o = e.i(193789),
        l = e.i(909420),
        c = e.i(289981),
        d = e.i(399336),
        u = e.i(891685),
        m = e.i(457831),
        p = e.i(233522),
        h = e.i(196593),
        f = e.i(604777),
        x = e.i(635868),
        g = e.i(488758),
        v = e.i(631827),
        y = e.i(41016),
        b = e.i(740849),
        k = e.i(64802),
        w = e.i(944891),
        S = e.i(870555),
        j = e.i(147931),
        C = e.i(323481),
        _ = e.i(488224),
        T = e.i(82489),
        M = e.i(929581),
        N = e.i(23128),
        I = e.i(86831),
        P = e.i(936712),
        E = e.i(421569),
        A = e.i(481640),
        O = e.i(613135);
    let D = e => {
        let a, n, l, c, m, p, h, f, g, v, y, b, k, w, S, j, C, T, M, D, z, R, F, $, B, q, V, H, U, W, G, Z, K = (0, r.c)(90),
            {
                type: Y,
                eventSlug: Q,
                location: X,
                visible: J,
                externalLine: ee,
                externalLines: et,
                externalSetLine: er,
                variantOverride: ea
            } = e,
            ei = void 0 === J || J,
            en = (0, _.useBoundSportsItemStore)();
        K[0] !== en ? (a = en ? .getState().orientation ? ? "mobile", K[0] = en, K[1] = a) : a = K[1];
        let es = a;
        K[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["activeMarket"], K[2] = n) : n = K[2];
        let {
            activeMarket: eo
        } = (0, d.useEventActiveMarketContext)(n), el = (0, o.useSetActiveSportsMarket)();
        K[3] === Symbol.for("react.memo_cache_sentinel") ? (l = ["event"], K[3] = l) : l = K[3];
        let {
            event: ec
        } = (0, u.useEventContext)(l), ed = (0, s.useSportsMarketsLines)(Q ? ? ec.slug, Y), eu = ee ? ? ed.line;
        K[4] !== et || K[5] !== ed ? (c = et ? ? ed.lines ? ? [], K[4] = et, K[5] = ed, K[6] = c) : c = K[6];
        let em = c,
            ep = er ? ? ed.setLine;
        K[7] !== em ? (m = (em ? ? []).reduce(L, {}), K[7] = em, K[8] = m) : m = K[8];
        let eh = m;
        K[9] !== ec.slug || K[10] !== eo.line || K[11] !== eo.slug || K[12] !== eo.sportsMarketType || K[13] !== eu ? .value || K[14] !== em || K[15] !== ep || K[16] !== Y ? (p = () => {
            if (eo.sportsMarketType === Y && eo.line && em && eu ? .value && em.some(e => e.marketSlug === eo.slug)) {
                let e = em.find(e => e.marketSlug === eo.slug && `${e.value}` == `${eo.line}`);
                e && ep({
                    line: e.line,
                    value: e.value,
                    label: e.label,
                    market: e.marketSlug,
                    event: ec.slug,
                    teamId: e.teamId
                })
            }
        }, K[9] = ec.slug, K[10] = eo.line, K[11] = eo.slug, K[12] = eo.sportsMarketType, K[13] = eu ? .value, K[14] = em, K[15] = ep, K[16] = Y, K[17] = p) : p = K[17];
        let ef = eu ? .value;
        K[18] !== ec.slug || K[19] !== eo || K[20] !== em || K[21] !== ep || K[22] !== ef || K[23] !== Y ? (h = [eo, em, ef, ec.slug, ep, Y], K[18] = ec.slug, K[19] = eo, K[20] = em, K[21] = ep, K[22] = ef, K[23] = Y, K[24] = h) : h = K[24], i.default.useEffect(p, h), K[25] !== eo.sportsMarketType || K[26] !== eh || K[27] !== X || K[28] !== es || K[29] !== el || K[30] !== ep || K[31] !== Y || K[32] !== ea ? (f = e => {
            if (eh[e]) {
                let {
                    line: t,
                    value: r,
                    label: a,
                    eventSlug: i,
                    marketSlug: n,
                    market: s,
                    teamId: o
                } = eh[e];
                ep({
                    line: t,
                    value: r,
                    label: a,
                    market: n,
                    event: i,
                    teamId: o
                }), ("desktop" === es || "mobile" === es && ("trade-header" === X || eo.sportsMarketType === Y)) && el(s, {
                    eventSlug: i,
                    variant: ea ? ? ("team_totals" === Y && o ? `team_totals_${o}` : Y),
                    closeGamesAccordionIfOpen: !1,
                    closeOverlayAccordionIfOpen: !1
                })
            }
        }, K[25] = eo.sportsMarketType, K[26] = eh, K[27] = X, K[28] = es, K[29] = el, K[30] = ep, K[31] = Y, K[32] = ea, K[33] = f) : f = K[33];
        let ex = f;
        K[34] !== en ? (g = en ? .getState().setPreventAccordionHover, K[34] = en, K[35] = g) : g = K[35];
        let eg = g,
            [ev, ey] = i.default.useState(0),
            eb = i.default.useRef(null),
            [ek, ew] = i.default.useState(!1);
        if (K[36] !== eu || K[37] !== em || K[38] !== ek ? (v = () => {
                if (!eu || !em.length || !ek) return;
                let e = em.findIndex(e => e.value === eu.value);
                e >= 0 && (ey(e), eb.current ? .slideTo(e, 0))
            }, y = [eu, em, ek], K[36] = eu, K[37] = em, K[38] = ek, K[39] = v, K[40] = y) : (v = K[39], y = K[40]), i.default.useEffect(v, y), K[41] !== eu || K[42] !== em || K[43] !== ek || K[44] !== ei ? (b = () => {
                if (!ei || !ek || (eb.current ? .update(), !eu || !em.length)) return;
                let e = em.findIndex(e => e.value === eu.value);
                e >= 0 && (ey(e), eb.current ? .slideTo(e, 0))
            }, k = [ei, ek, eu, em], K[41] = eu, K[42] = em, K[43] = ek, K[44] = ei, K[45] = b, K[46] = k) : (b = K[45], k = K[46]), i.default.useEffect(b, k), !eu || !em || em.length <= 1) return null;
        let eS = "trade-header" !== X && "border-t bg-surface-1";
        K[47] !== eS ? (w = (0, I.cn)("w-full flex items-center justify-between relative h-12 cursor-default overflow-hidden", eS), K[47] = eS, K[48] = w) : w = K[48], K[49] !== eg ? (S = () => eg ? .(!0), j = () => eg ? .(!1), K[49] = eg, K[50] = S, K[51] = j) : (S = K[50], j = K[51]), K[52] === Symbol.for("react.memo_cache_sentinel") ? (C = (0, t.jsx)(P.IconCaretDownFill12, {
            className: "absolute left-1/2 -translate-x-1/2 -top-1 text-text-brand z-[1]"
        }), K[52] = C) : C = K[52], K[53] === Symbol.for("react.memo_cache_sentinel") ? (T = e => {
            eb.current = e, ew(!0)
        }, K[53] = T) : T = K[53], K[54] !== eu ? .value || K[55] !== em || K[56] !== ex ? (M = e => {
            ey(e.activeIndex);
            let t = em[e.activeIndex];
            t && t.value !== eu ? .value && ex(t.value)
        }, K[54] = eu ? .value, K[55] = em, K[56] = ex, K[57] = M) : M = K[57];
        let ej = "trade-header" === X ? "from-background via-background" : "from-surface-1 via-surface-1";
        K[58] !== ej ? (D = (0, I.cn)("absolute w-18 h-12 bg-gradient-to-r to-transparent left-0 top-0 bottom-0 z-[9] pointer-events-none", ej), K[58] = ej, K[59] = D) : D = K[59], K[60] !== D ? (z = (0, t.jsx)("div", {
            className: D
        }), K[60] = D, K[61] = z) : z = K[61];
        let eC = "trade-header" === X ? "from-background via-background" : "from-surface-1 via-surface-1";
        K[62] !== eC ? (R = (0, I.cn)("absolute w-18 h-12 bg-gradient-to-l to-transparent right-0 top-0 bottom-0 z-[9] pointer-events-none", eC), K[62] = eC, K[63] = R) : R = K[63], K[64] !== R ? (F = (0, t.jsx)("div", {
            className: R
        }), K[64] = R, K[65] = F) : F = K[65];
        let e_ = !ek || 0 === ev;
        K[66] === Symbol.for("react.memo_cache_sentinel") ? ($ = e => {
            e.stopPropagation(), eb.current ? .slidePrev()
        }, B = (0, t.jsx)(E.IconChevronLeftOutline12, {}), K[66] = $, K[67] = B) : ($ = K[66], B = K[67]), K[68] !== e_ ? (q = (0, t.jsx)(N.Button, {
            variant: "ghost-accent",
            size: "iconSm",
            disabled: e_,
            className: "text-text-secondary absolute left-2 top-1/2 -translate-y-1/2 z-10",
            onClick: $,
            children: B
        }), K[68] = e_, K[69] = q) : q = K[69], K[70] !== em || K[71] !== ex || K[72] !== ei ? (V = em.map((e, r) => (0, t.jsx)(O.SwiperSlide, {
            className: "!flex items-center justify-center !w-fit relative",
            children: a => {
                let {
                    isActive: i
                } = a;
                return (0, t.jsx)(x.BookContextProvider, {
                    market: e.market,
                    prefetch: {
                        book: "never",
                        lastPrice: "never"
                    },
                    poll: ei ? "when-inactive" : "never",
                    subscribe: "never",
                    defer: "always",
                    deferMs: 1e3,
                    children: (0, t.jsx)(N.Button, {
                        variant: "ghost",
                        size: "sm",
                        className: (0, I.cn)("text-text-secondary h-12 transition w-10 !text-[13px] !bg-transparent whitespace-nowrap relativ flex items-center justify-center", i && "!text-[16px] text-text-primary"),
                        onClick: t => {
                            t.stopPropagation(), ey(r), ex(e.value), eb.current ? .slideTo(r)
                        },
                        children: (0, t.jsx)("p", {
                            children: e.label
                        })
                    })
                })
            }
        }, e.value)), K[70] = em, K[71] = ex, K[72] = ei, K[73] = V) : V = K[73], K[74] === Symbol.for("react.memo_cache_sentinel") ? (H = e => {
            e.stopPropagation(), eb.current ? .slideNext()
        }, K[74] = H) : H = K[74];
        let eT = !ek || ev === em.length - 1;
        return K[75] === Symbol.for("react.memo_cache_sentinel") ? (U = (0, t.jsx)(A.IconChevronRightOutline12, {}), K[75] = U) : U = K[75], K[76] !== eT ? (W = (0, t.jsx)(N.Button, {
            variant: "ghost-accent",
            size: "iconSm",
            onClick: H,
            disabled: eT,
            className: "text-text-secondary absolute right-2 top-1/2 -translate-y-1/2 z-10",
            children: U
        }), K[76] = eT, K[77] = W) : W = K[77], K[78] !== M || K[79] !== z || K[80] !== F || K[81] !== q || K[82] !== V || K[83] !== W ? (G = (0, t.jsxs)(O.Swiper, {
            slidesPerView: "auto",
            spaceBetween: 10,
            className: "w-full h-12",
            onSwiper: T,
            onSlideChange: M,
            centeredSlides: !0,
            children: [z, F, q, V, W]
        }), K[78] = M, K[79] = z, K[80] = F, K[81] = q, K[82] = V, K[83] = W, K[84] = G) : G = K[84], K[85] !== w || K[86] !== S || K[87] !== j || K[88] !== G ? (Z = (0, t.jsxs)("div", {
            className: w,
            onMouseEnter: S,
            onMouseLeave: j,
            children: [C, G]
        }), K[85] = w, K[86] = S, K[87] = j, K[88] = G, K[89] = Z) : Z = K[89], Z
    };

    function L(e, t) {
        return e[t.value] = t, e
    }
    e.s(["LineSelector", 0, D], 500324), e.s(["BinaryButtonSection", () => eg], 67767);
    var z = e.i(983707),
        R = e.i(909576),
        F = e.i(879756);
    e.s(["useOutcomeButtons", () => K], 893959);
    var $ = e.i(723823),
        B = e.i(328113),
        q = e.i(458164),
        V = e.i(593332),
        H = e.i(6204),
        U = e.i(880809),
        W = e.i(156591);
    let G = ({
        team: e
    }) => {
        let t = e ? .color;
        if (t) {
            let e = t.trim().toLowerCase();
            return {
                color: "custom",
                customColors: {
                    backgroundColor: "#ffffff" === e || "#fff" === e || "rgb(255,255,255)" === e || "rgba(255,255,255,1)" === e ? "#3B82F6" : t,
                    color: "var(--color-white)"
                }
            }
        }
        return {
            color: "blue",
            customColors: void 0
        }
    };
    e.s(["getSportsButtonColors", 0, G], 123341);
    var Z = e.i(557033);
    let K = (e, t = "moneyline") => {
        let a, l, {
                activeMarket: c
            } = (0, d.useEventActiveMarketContext)(["activeMarket"]),
            u = (0, o.useSetActiveSportsMarket)(),
            {
                setSelectedOutcomeIdx: m,
                setPrice: p,
                setPriceUpdateLocation: f,
                setCursorActive: v,
                side: y,
                selectedOutcomeIdx: b
            } = (0, U.useTradeContext)(["setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side", "selectedOutcomeIdx"]),
            {
                moneylineMarket: k
            } = (0, g.useSportsItemContext)(),
            {
                market: w
            } = (0, x.useBookContext)(["market"]),
            S = (0, $.useMarketBestPrices)(w),
            {
                isSportsPage: j
            } = (0, H.useSportsContext)(["isSportsPage"]);
        (0, s.useSportsStoreSelector)("sportSlug");
        let {
            oddsFormat: C
        } = (0, s.useOddsFormat)(), _ = (() => {
            let e, t, a = (0, r.c)(7),
                {
                    mode: i,
                    event: n,
                    moneylineMarket: s
                } = (0, g.useSportsItemContext)();
            a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
            let {
                side: o,
                selectedOutcomeIdx: l
            } = (0, U.useTradeContext)(e);
            a[1] !== n || a[2] !== i || a[3] !== s || a[4] !== l || a[5] !== o ? (t = {
                mode: i,
                event: n,
                market: s,
                side: o,
                selectedOutcomeIdx: l
            }, a[1] = n, a[2] = i, a[3] = s, a[4] = l, a[5] = o, a[6] = t) : t = a[6];
            let c = t;
            return (0, B.useLatest)(c)
        })(), T = (0, $.useGetBestPrices)(), M = (0, n.useSportsStore)(e => !!e.evt), {
            setTradeState: N
        } = (0, F.useMobileTradeContext)();
        k.teams && 2 === k.teams.length && ([a, l] = k.teams);
        let I = G({
                team: a
            }),
            P = G({
                team: l
            });
        k.slug, c.slug;
        let E = (e, t) => {
            let r = e ? .["~zero"] ? .[t ? .toLowerCase()],
                a = e ? .["~one"] ? .[t ? .toLowerCase()],
                i = {
                    formattedPrice: "0¢",
                    paddedPrice: void 0,
                    price: "0"
                },
                n = {
                    formattedPrice: "0¢",
                    paddedPrice: void 0,
                    price: "0"
                };
            if (r) {
                let e = (0, W.getPrecisionFromTickSize)(w.orderPriceMinTickSize),
                    t = (0, h.showPaddedCentsOnly)(r, e),
                    {
                        formatted: a
                    } = (0, Z.convertPrice)({
                        price: parseFloat(r),
                        precision: e,
                        inputMode: "decimal",
                        outputMode: C
                    });
                i = {
                    formattedPrice: a,
                    paddedPrice: t,
                    price: r
                }
            }
            if (a) {
                let e = (0, W.getPrecisionFromTickSize)(w.orderPriceMinTickSize),
                    t = (0, h.showPaddedCentsOnly)(a, e),
                    {
                        formatted: r
                    } = (0, Z.convertPrice)({
                        price: parseFloat(a),
                        precision: e,
                        inputMode: "decimal",
                        outputMode: C
                    });
                n = {
                    formattedPrice: r,
                    paddedPrice: t,
                    price: a
                }
            }
            return [i, n]
        };
        return {
            colors: [I, P],
            prices: i.default.useMemo(() => E(S, e ? ? y), [S, e, y, C]),
            onOutcomeClick: (r, a) => {
                if (!_.current) return;
                let {
                    mode: i,
                    event: n,
                    market: s,
                    side: o,
                    selectedOutcomeIdx: l
                } = _.current, c = void 0 !== r ? r : l, d = (({
                    marketId: e,
                    event: t,
                    market: r,
                    isSportsPage: a
                }) => {
                    if (a && e && t) {
                        let r = t.markets.find(t => t.id.toString() === e.toString());
                        if (r) return r
                    }
                    return r
                })({
                    marketId: a,
                    event: n,
                    market: s,
                    isSportsPage: j
                });
                if ("desktop" === i) {
                    u(d, {
                        eventSlug: n.slug,
                        variant: t,
                        openGamesAccordion: !M,
                        openOverlayAccordion: !M,
                        closeGamesAccordionIfOpen: !1,
                        closeOverlayAccordionIfOpen: !1
                    });
                    let {
                        paddedPrice: r
                    } = E(T(s), e ? ? o)[c];
                    m(c), "string" == typeof r && (p(r), f("click")), v(!0)
                } else {
                    let {
                        paddedPrice: r
                    } = E(T(s), e ? ? o)[c];
                    N ? .({
                        type: "trade",
                        side: o,
                        outcomeIdx: c,
                        market: d,
                        open: !0,
                        orderType: q.OrderType.Market,
                        price: r,
                        updatePriceLocation: !1
                    }), u(d, {
                        eventSlug: n.slug,
                        variant: t,
                        skipSetActiveMarket: !0,
                        openOverlayAccordion: !M,
                        closeGamesAccordionIfOpen: !1,
                        closeOverlayAccordionIfOpen: !1
                    })
                }
            }
        }
    };
    e.i(686518);
    var Y = e.i(907855),
        Q = e.i(188474),
        X = e.i(937048),
        J = e.i(147658),
        ee = e.i(210308);

    function et(e) {
        let a, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k, w = (0, r.c)(34);
        if (w[0] !== e) {
            let {
                ref: t,
                dependency: r,
                defaultOpacity: i,
                mode: m,
                blinkColor: p,
                className: h,
                value: f,
                children: x,
                ...g
            } = e;
            o = t, s = r, c = i, d = m, u = p, n = h, a = x, l = g, w[0] = e, w[1] = a, w[2] = n, w[3] = s, w[4] = o, w[5] = l, w[6] = c, w[7] = d, w[8] = u
        } else a = w[1], n = w[2], s = w[3], o = w[4], l = w[5], c = w[6], d = w[7], u = w[8];
        let S = void 0 === c ? 1 : c,
            j = void 0 === d ? "opacity" : d,
            C = void 0 === u ? "$green2" : u,
            [_, T] = (0, J.useAnimate)(),
            M = (0, Q.useComposedRefs)(o, _),
            N = i.default.useRef(!1);
        w[9] !== s ? (m = () => s, p = [s], w[9] = s, w[10] = m, w[11] = p) : (m = w[10], p = w[11]);
        let I = (0, ee.useDeepCompareMemo)(m, p);
        w[12] !== T || w[13] !== _ || w[14] !== C || w[15] !== S || w[16] !== j ? (h = () => {
            T(_.current, { ..."opacity" === j && {
                    opacity: .25
                },
                ..."color" === j && C.startsWith("$") && {
                    color: `var(--colors-${C.replace("$","")})`
                },
                ..."color" === j && !C.startsWith("$") && {
                    color: C
                }
            }, {
                duration: .2,
                ease: "color" === j ? "easeOut" : "linear",
                onComplete: () => {
                    T(_.current, { ..."opacity" === j && {
                            opacity: S
                        },
                        ..."color" === j && {
                            color: "var(--color-text)"
                        }
                    }, {
                        duration: .5,
                        delay: .1 * ("color" === j),
                        ease: "color" === j ? "easeOut" : "linear"
                    })
                }
            })
        }, w[12] = T, w[13] = _, w[14] = C, w[15] = S, w[16] = j, w[17] = h) : h = w[17];
        let P = h;
        w[18] !== I || w[19] !== P ? (f = () => {
            I && N.current && P()
        }, w[18] = I, w[19] = P, w[20] = f) : f = w[20], w[21] !== I ? (x = [I], w[21] = I, w[22] = x) : x = w[22], i.default.useEffect(f, x), w[23] === Symbol.for("react.memo_cache_sentinel") ? (v = () => {
            let e = setTimeout(() => {
                N.current = !0
            }, 1e3);
            return () => clearTimeout(e)
        }, g = [], w[23] = g, w[24] = v) : (g = w[23], v = w[24]), i.default.useEffect(v, g), w[25] === Symbol.for("react.memo_cache_sentinel") ? (y = {
            wait: 200,
            trailing: !0
        }, w[25] = y) : y = w[25];
        let E = (0, X.useDebounce)(a, y);
        return w[26] !== S ? (b = {
            opacity: S
        }, w[26] = S, w[27] = b) : b = w[27], w[28] !== n || w[29] !== M || w[30] !== E || w[31] !== l || w[32] !== b ? (k = (0, t.jsx)("span", {
            ref: M,
            style: b,
            className: n,
            ...l,
            children: E
        }), w[28] = n, w[29] = M, w[30] = E, w[31] = l, w[32] = b, w[33] = k) : k = w[33], k
    }
    let er = {
            duration: 450,
            easing: "linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"
        },
        ea = {
            minimumFractionDigits: 2,
            maximumFractionDigits: 2
        },
        ei = {
            minimumFractionDigits: 2,
            maximumFractionDigits: 2
        },
        en = {
            signDisplay: "always",
            maximumFractionDigits: 0
        },
        es = {
            maximumFractionDigits: 0
        };

    function eo({
        value: e,
        format: r,
        formatted: a,
        dependency: n,
        className: s,
        defaultOpacity: o = 1,
        decimals: l
    }) {
        let c = i.default.useRef(n),
            d = void 0 === n || c.current !== n;
        if (i.default.useEffect(() => {
                c.current = n
            }, [n]), "fractional" === r) return (0, t.jsx)(et, {
            className: s,
            dependency: n,
            defaultOpacity: o,
            children: a
        });
        let {
            prefix: u,
            suffix: m,
            format: p
        } = function(e) {
            switch (e) {
                case "price":
                    return {
                        suffix: "¢",
                        format: es
                    };
                case "percentage":
                    return {
                        suffix: "%",
                        format: es
                    };
                case "american":
                    return {
                        format: en
                    };
                case "decimal":
                case "hongKong":
                default:
                    return {
                        format: ei
                    };
                case "indonesian":
                case "malaysian":
                    return {
                        format: ea
                    }
            }
        }(r), h = void 0 === l ? p : { ...p,
            minimumFractionDigits: l,
            maximumFractionDigits: l
        };
        return (0, t.jsx)(Y.default, {
            value: Number.isFinite(e) ? e : 0,
            prefix: u,
            suffix: m,
            format: h,
            trend: 0,
            willChange: !0,
            animated: d,
            transformTiming: er,
            className: (0, I.cn)("tabular-nums", s)
        })
    }
    e.s(["AnimatedPrice", 0, eo], 779584);
    let el = {
        type: "spring",
        stiffness: 2300,
        damping: 200,
        mass: 6
    };
    var ec = e.i(949447);
    let ed = e => {
        let a, i = (0, r.c)(2);
        return i[0] !== e ? (a = (0, t.jsx)(ec.IconChevronDownFill18, {
            className: "text-2xl fill-white motion-reduce:transition-none transition-none",
            ...e
        }), i[0] = e, i[1] = a) : a = i[1], a
    };

    function eu(e) {
        let a, i, n, s, o = (0, r.c)(8);
        o[0] !== e ? ({
            ref: n,
            className: a,
            ...i
        } = e, o[0] = e, o[1] = a, o[2] = i, o[3] = n) : (a = o[1], i = o[2], n = o[3]);
        let l = `relative max-lg:w-full max-lg:max-w-full ${a||""}`;
        return o[4] !== i || o[5] !== n || o[6] !== l ? (s = (0, t.jsx)(z.TradingButton, {
            ref: n,
            className: l,
            ...i
        }), o[4] = i, o[5] = n, o[6] = l, o[7] = s) : s = o[7], s
    }
    ed.displayName = "OutcomeButtonCaretIcon";
    let em = e => {
            let a, i = (0, r.c)(3),
                {
                    relative: n,
                    priceMode: s,
                    children: o,
                    className: l
                } = e,
                c = void 0 === s ? "default" : s,
                d = `flex w-full justify-between ${"spread"===c||"total"===c?"px-1":"px-4 max-lg:px-1"} ${n?"relative":""} ${l||""}`;
            return i[0] !== o || i[1] !== d ? (a = (0, t.jsx)("span", {
                className: d,
                children: o
            }), i[0] = o, i[1] = d, i[2] = a) : a = i[2], a
        },
        ep = e => {
            let a, i, n, s = (0, r.c)(9),
                {
                    priceMode: o,
                    children: l,
                    className: c,
                    fontSize: d,
                    fontWeight: u
                } = e,
                m = void 0 === d ? "text-sm" : d,
                p = void 0 === u ? "font-semibold" : u,
                h = "default" === (void 0 === o ? "default" : o) ? "text-center flex items-center justify-center min-w-0 overflow-hidden" : "text-left flex items-center px-2 whitespace-nowrap min-w-0 overflow-hidden";
            return s[0] !== h || s[1] !== c || s[2] !== m || s[3] !== p ? (a = (0, I.cn)("uppercase text-inherit !leading-[21px] tracking-[0.15px] flex-1 h-full", h, m, p, c), s[0] = h, s[1] = c, s[2] = m, s[3] = p, s[4] = a) : a = s[4], s[5] === Symbol.for("react.memo_cache_sentinel") ? (i = {
                color: "inherit",
                lineHeight: "21px",
                margin: 0
            }, s[5] = i) : i = s[5], s[6] !== l || s[7] !== a ? (n = (0, t.jsx)("p", {
                className: a,
                style: i,
                children: l
            }), s[6] = l, s[7] = a, s[8] = n) : n = s[8], n
        },
        eh = e => {
            let a, i = (0, r.c)(3),
                {
                    priceMode: n,
                    children: s,
                    className: o
                } = e,
                l = void 0 === n ? "default" : n,
                c = `opacity-70 ${"spread"===l||"total"===l?"flex-1 whitespace-nowrap min-w-0 flex items-center gap-1 @max-[490px]:whitespace-normal":"whitespace-nowrap min-w-0 overflow-hidden text-ellipsis"} ${o||""}`;
            return i[0] !== s || i[1] !== c ? (a = (0, t.jsx)("span", {
                className: c,
                children: s
            }), i[0] = s, i[1] = c, i[2] = a) : a = i[2], a
        },
        ef = e => {
            let a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E = (0, r.c)(93);
            if (E[0] !== e) {
                let {
                    team: t,
                    label: r,
                    outcomeIndex: b,
                    className: k,
                    style: w,
                    height: S,
                    shadowHeight: j,
                    hoverHeightOffset: C,
                    onClick: _,
                    onTap: T,
                    color: M,
                    customColors: N,
                    price: I,
                    showOdds: P,
                    maxWidth: A,
                    animationMode: O,
                    priceMode: D,
                    ...L
                } = e;
                y = t, s = r, a = k, p = w, h = S, f = j, x = C, l = _, c = T, i = M, n = N, d = I, g = P, o = A, v = O, u = D, m = L, E[0] = e, E[1] = a, E[2] = i, E[3] = n, E[4] = s, E[5] = o, E[6] = l, E[7] = c, E[8] = d, E[9] = u, E[10] = m, E[11] = p, E[12] = h, E[13] = f, E[14] = x, E[15] = g, E[16] = v, E[17] = y
            } else a = E[1], i = E[2], n = E[3], s = E[4], o = E[5], l = E[6], c = E[7], d = E[8], u = E[9], m = E[10], p = E[11], h = E[12], f = E[13], x = E[14], g = E[15], v = E[16], y = E[17];
            let A = void 0 === h ? 52 : h,
                O = void 0 === f ? 5 : f,
                D = void 0 === x ? 2 : x;
            e: {
                let e;
                if (!u) {
                    let e;
                    E[18] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        type: "default",
                        font: "default"
                    }, E[18] = e) : e = E[18], b = e;
                    break e
                }
                let t = u.font ? ? "default";E[19] !== t || E[20] !== u ? (e = { ...u,
                    font: t
                }, E[19] = t, E[20] = u, E[21] = e) : e = E[21],
                b = e
            }
            let L = b,
                z = d.formattedPrice;
            E[22] !== l ? (k = e => {
                e.preventDefault(), e.stopPropagation(), l ? .(e)
            }, E[22] = l, E[23] = k) : k = E[23];
            let R = k;
            E[24] !== c ? (w = (e, t) => {
                e.preventDefault(), e.stopPropagation(), c ? .(e, t)
            }, E[24] = c, E[25] = w) : w = E[25];
            let F = w,
                $ = s ? ? y ? .abbreviation ? ? "";
            if (E[26] !== $ || E[27] !== L.line || E[28] !== L.type || E[29] !== L.variant || E[30] !== y ? .abbreviation) {
                t: {
                    let e;
                    if ("spread" === L.type) {
                        let e;
                        if ($) {
                            let e = $.split(" ");
                            if (e.length >= 2) {
                                let t, r = e[e.length - 1],
                                    a = e.slice(0, -1).join(" ");
                                E[32] !== r || E[33] !== a ? (t = {
                                    truncatable: a,
                                    nonTruncatable: r
                                }, E[32] = r, E[33] = a, E[34] = t) : t = E[34], S = t;
                                break t
                            }
                        }
                        let t = L.line > 0 ? `+${L.line}` : `${L.line}`,
                            r = y ? .abbreviation ? ? $;
                        E[35] !== t || E[36] !== r ? (e = {
                            truncatable: r,
                            nonTruncatable: t
                        }, E[35] = t, E[36] = r, E[37] = e) : e = E[37], S = e;
                        break t
                    }
                    if ("total" === L.type) {
                        let e, t;
                        if ($) {
                            let e = $.split(" ");
                            if (e.length >= 2) {
                                let t, r = e[e.length - 1],
                                    a = e.slice(0, -1).join(" ");
                                E[38] !== r || E[39] !== a ? (t = {
                                    truncatable: a,
                                    nonTruncatable: r
                                }, E[38] = r, E[39] = a, E[40] = t) : t = E[40], S = t;
                                break t
                            }
                        }
                        let r = "over" === L.variant ? "O" : "U";
                        E[41] !== L.line ? (e = L.line.toString(), E[41] = L.line, E[42] = e) : e = E[42], E[43] !== r || E[44] !== e ? (t = {
                            truncatable: r,
                            nonTruncatable: e
                        }, E[43] = r, E[44] = e, E[45] = t) : t = E[45], S = t;
                        break t
                    }
                    let t = $ || y ? .abbreviation || "";E[46] !== t ? (e = {
                        truncatable: t,
                        nonTruncatable: ""
                    }, E[46] = t, E[47] = e) : e = E[47],
                    S = e
                }
                E[26] = $,
                E[27] = L.line,
                E[28] = L.type,
                E[29] = L.variant,
                E[30] = y ? .abbreviation,
                E[31] = S
            }
            else S = E[31];
            let B = S,
                q = o ? ? "150px",
                V = o ? ? "150px";
            E[48] !== p || E[49] !== q || E[50] !== V ? (j = {
                width: q,
                maxWidth: V,
                ...p
            }, E[48] = p, E[49] = q, E[50] = V, E[51] = j) : j = E[51];
            let H = L.type,
                U = "small" === L.font ? "text-xs" : "text-sm",
                W = L.type;
            E[52] !== B.truncatable ? (C = (0, t.jsx)("span", {
                className: "overflow-hidden text-ellipsis whitespace-nowrap min-w-0",
                children: B.truncatable
            }), E[52] = B.truncatable, E[53] = C) : C = E[53], E[54] !== B.nonTruncatable ? (_ = B.nonTruncatable && (0, t.jsx)("span", {
                className: "shrink-0",
                children: B.nonTruncatable
            }), E[54] = B.nonTruncatable, E[55] = _) : _ = E[55], E[56] !== L.type || E[57] !== C || E[58] !== _ ? (T = (0, t.jsxs)(eh, {
                priceMode: L.type,
                children: [C, _]
            }), E[56] = L.type, E[57] = C, E[58] = _, E[59] = T) : T = E[59];
            r: {
                let e, r, a = "small" === L.font ? "ml-1 text-sm" : "ml-1 text-base";E[60] !== d.formattedPrice ? (e = function(e) {
                    if ("string" != typeof e || 0 === e.length) return null;
                    if (e.endsWith("¢")) {
                        let t = e.slice(0, -1),
                            r = parseFloat(t);
                        if (!Number.isFinite(r)) return null;
                        let a = t.indexOf(".");
                        return {
                            value: r,
                            format: "price",
                            decimals: -1 === a ? 0 : t.length - a - 1
                        }
                    }
                    if (e.endsWith("%")) {
                        let t = e.slice(0, -1),
                            r = parseFloat(t);
                        if (!Number.isFinite(r)) return null;
                        let a = t.indexOf(".");
                        return {
                            value: r,
                            format: "percentage",
                            decimals: -1 === a ? 0 : t.length - a - 1
                        }
                    }
                    if (/^[+-]\d+(\.\d+)?$/.test(e)) {
                        let t = e.indexOf("."),
                            r = -1 === t ? 0 : e.length - t - 1;
                        return {
                            value: parseFloat(e),
                            format: 0 === r ? "american" : "indonesian",
                            decimals: r
                        }
                    }
                    if (/^\d+(\.\d+)?$/.test(e)) {
                        let t = e.indexOf("."),
                            r = -1 === t ? 0 : e.length - t - 1;
                        return {
                            value: parseFloat(e),
                            format: "decimal",
                            decimals: r
                        }
                    }
                    return null
                }(d.formattedPrice), E[60] = d.formattedPrice, E[61] = e) : e = E[61];
                let i = e;
                if (i) {
                    let e;
                    E[62] !== z || E[63] !== i.decimals || E[64] !== i.format || E[65] !== i.value || E[66] !== d.formattedPrice || E[67] !== a ? (e = (0, t.jsx)(eo, {
                        className: a,
                        value: i.value,
                        format: i.format,
                        formatted: d.formattedPrice,
                        decimals: i.decimals,
                        dependency: z
                    }), E[62] = z, E[63] = i.decimals, E[64] = i.format, E[65] = i.value, E[66] = d.formattedPrice, E[67] = a, E[68] = e) : e = E[68], M = e;
                    break r
                }
                E[69] !== z || E[70] !== d.formattedPrice || E[71] !== a ? (r = (0, t.jsx)(et, {
                    className: a,
                    dependency: z,
                    defaultOpacity: 1,
                    children: d.formattedPrice
                }), E[69] = z, E[70] = d.formattedPrice, E[71] = a, E[72] = r) : r = E[72],
                M = r
            }
            return E[73] !== L.type || E[74] !== U || E[75] !== T || E[76] !== M ? (N = (0, t.jsxs)(ep, {
                fontSize: U,
                fontWeight: "font-semibold",
                priceMode: W,
                children: [T, M]
            }), E[73] = L.type, E[74] = U, E[75] = T, E[76] = M, E[77] = N) : N = E[77], E[78] !== L.type || E[79] !== N ? (I = (0, t.jsx)(em, {
                priceMode: H,
                children: N
            }), E[78] = L.type, E[79] = N, E[80] = I) : I = E[80], E[81] !== a || E[82] !== i || E[83] !== n || E[84] !== A || E[85] !== D || E[86] !== R || E[87] !== F || E[88] !== m || E[89] !== O || E[90] !== j || E[91] !== I ? (P = (0, t.jsx)(eu, {
                className: a,
                style: j,
                height: A,
                shadowHeight: O,
                hoverHeightOffset: D,
                color: i,
                customColors: n,
                onClick: R,
                onTap: F,
                transition: el,
                ...m,
                children: I
            }), E[81] = a, E[82] = i, E[83] = n, E[84] = A, E[85] = D, E[86] = R, E[87] = F, E[88] = m, E[89] = O, E[90] = j, E[91] = I, E[92] = P) : P = E[92], P
        };
    ef.displayName = "SportsTeamOutcomeButton", e.s(["OutcomeButton", 0, eu, "OutcomeButtonAbbrText", 0, eh, "OutcomeButtonCaretIcon", 0, ed, "OutcomeButtonContentWrapper", 0, em, "OutcomeText", 0, ep, "SportsTeamOutcomeButton", 0, ef], 413002);
    let ex = {
            type: "default",
            font: "small"
        },
        eg = e => {
            let a, i, n, l, c, m, p, h, x, v, y, k, w, S, j, C, T = (0, r.c)(69),
                {
                    variant: M,
                    marketType: N
                } = e,
                I = void 0 === M ? "card" : M,
                P = void 0 === N ? "moneyline" : N,
                E = (0, f.useTranslations)(),
                {
                    event: A,
                    mode: O,
                    teams: D,
                    gameState: L,
                    moneylineMarket: $
                } = (0, g.useSportsItemContext)(),
                {
                    colors: B,
                    prices: q,
                    onOutcomeClick: H
                } = K(void 0, P),
                {
                    setTradeState: W
                } = (0, F.useMobileTradeContext)(),
                {
                    setSportsCashOutState: G,
                    canRedeem: Z
                } = (0, R.useCashOutTxContext)();
            T[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], T[0] = a) : a = T[0];
            let {
                activeMarket: Y
            } = (0, d.useEventActiveMarketContext)(a);
            T[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["event"], T[1] = i) : i = T[1];
            let {
                event: Q
            } = (0, u.useEventContext)(i), {
                slug: X
            } = Q, J = (0, o.useSetActiveSportsMarket)(), ee = (0, s.useSportsViewSetting)(), et = (0, _.useSportsItemStore)(ev);
            T[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["selectedOutcomeIdx"], T[2] = n) : n = T[2];
            let {
                selectedOutcomeIdx: er
            } = (0, U.useTradeContext)(n), ea = (0, b.useHasSportsPositions)(P);
            T[3] !== $.id || T[4] !== H ? (l = () => {
                H(0, $.id)
            }, T[3] = $.id, T[4] = H, T[5] = l) : l = T[5];
            let ei = l;
            T[6] !== $.id || T[7] !== H ? (c = () => {
                H(1, $.id)
            }, T[6] = $.id, T[7] = H, T[8] = c) : c = T[8];
            let en = c;
            T[9] !== et ? (m = () => {
                et(!0)
            }, T[9] = et, T[10] = m) : m = T[10];
            let es = m;
            T[11] !== et ? (p = () => {
                et(!1)
            }, T[11] = et, T[12] = p) : p = T[12];
            let eo = p,
                el = A.closed || $.closed,
                {
                    isClosed: ec
                } = {
                    isClosed: el,
                    isFinished: el || L === V.GameState.Finished
                };
            e: {
                let e, t, r, a, i = (Y.sportsMarketType ? ? "moneyline") === P,
                    n = X === A.slug,
                    s = A.markets.some(ey);T[13] !== B[0] || T[14] !== B[1] ? (e = {
                    zeroColors: B[0],
                    oneColors: B[1],
                    dimState: "none"
                }, T[13] = B[0], T[14] = B[1], T[15] = e) : e = T[15];
                let o = e;
                if ("mobile" === O) {
                    h = o;
                    break e
                }
                if ("card" === I) {
                    if (n && i) {
                        let e;
                        T[16] !== o ? (e = { ...o,
                            dimState: "inactive-outcome"
                        }, T[16] = o, T[17] = e) : e = T[17], h = e;
                        break e
                    }
                    h = o;
                    break e
                }
                if (!s) {
                    h = o;
                    break e
                }
                if (i) {
                    let e;
                    T[18] !== o ? (e = { ...o,
                        dimState: "inactive-outcome"
                    }, T[18] = o, T[19] = e) : e = T[19], h = e;
                    break e
                }
                T[20] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                    color: "gray",
                    customColors: void 0
                }, r = {
                    color: "gray",
                    customColors: void 0
                }, T[20] = t, T[21] = r) : (t = T[20], r = T[21]);
                let l = "in-game" === I ? "inactive-market" : "none";T[22] !== l ? (a = {
                    zeroColors: t,
                    oneColors: r,
                    dimState: l
                }, T[22] = l, T[23] = a) : a = T[23],
                h = a
            }
            let {
                zeroColors: ed,
                oneColors: eu,
                dimState: em
            } = h;
            T[24] !== A.slug || T[25] !== P || T[26] !== O || T[27] !== $ || T[28] !== J || T[29] !== G || T[30] !== W || T[31] !== I ? (x = e => {
                e.stopPropagation(), "mobile" === O ? (W ? .({
                    type: "sports-redeem",
                    market: $,
                    sportsRedemptionType: "card" === I ? "all" : P
                }), J($, {
                    variant: P,
                    eventSlug: A.slug,
                    skipSetActiveMarket: !0,
                    closeGamesAccordionIfOpen: !1,
                    closeOverlayAccordionIfOpen: !1
                })) : (G({
                    open: !0,
                    mode: "card" === I ? "all" : P
                }), J($, {
                    variant: P,
                    eventSlug: A.slug,
                    openGamesAccordion: !1,
                    openOverlayAccordion: !1,
                    closeGamesAccordionIfOpen: !1,
                    closeOverlayAccordionIfOpen: !1
                }))
            }, T[24] = A.slug, T[25] = P, T[26] = O, T[27] = $, T[28] = J, T[29] = G, T[30] = W, T[31] = I, T[32] = x) : x = T[32];
            let ep = x,
                eh = "moneyline" === ee || A.markets.some(eb),
                eg = eh ? 44 : 40,
                ek = eh ? 5 : 4;
            T[33] === Symbol.for("react.memo_cache_sentinel") ? (v = {
                width: "100%"
            }, T[33] = v) : v = T[33], T[34] !== eg || T[35] !== ek ? (y = {
                hoverHeightOffset: 2,
                height: eg,
                shadowHeight: ek,
                maxWidth: "auto",
                css: v
            }, T[34] = eg, T[35] = ek, T[36] = y) : y = T[36];
            let ew = y;
            if (!D) return null;
            if (ec && "moneyline" === ee && Z && ea) {
                let e, r, a;
                return T[37] !== E ? (e = E("trading.redeem"), T[37] = E, T[38] = e) : e = T[38], T[39] !== ep || T[40] !== e ? (r = (0, t.jsx)(z.TradingButton, {
                    color: "blue",
                    hoverHeightOffset: 2,
                    height: 44,
                    shadowHeight: 5,
                    maxWidth: "100%",
                    onClick: ep,
                    children: e
                }), T[39] = ep, T[40] = e, T[41] = r) : r = T[41], T[42] !== es || T[43] !== eo || T[44] !== r ? (a = (0, t.jsx)("div", {
                    className: "flex flex-1 @min-[490px]:justify-end items-center",
                    children: (0, t.jsx)("div", {
                        className: "flex w-full h-full items-center justify-end @min-[490px]:w-[125px]",
                        onPointerEnter: es,
                        onPointerLeave: eo,
                        children: r
                    })
                }), T[42] = es, T[43] = eo, T[44] = r, T[45] = a) : a = T[45], a
            }
            if (ec) return null;
            let eS = `transition-opacity duration-100 flex-1 ${"card"===I?"w-full":""} ${"in-game"===I?"@min-[490px]:max-w-[125px]":""} ${"inactive-market"===em?"lg:opacity-80":""} ${"inactive-outcome"===em&&0!==er?"lg:opacity-60":""}`;
            T[46] !== ew || T[47] !== q[0] || T[48] !== D[0] || T[49] !== ed || T[50] !== ei ? (k = (0, t.jsx)(ef, {
                team: D[0],
                onTap: ei,
                price: q[0],
                outcomeIndex: 0,
                animationMode: "arrows",
                priceMode: ex,
                ...ew,
                ...ed
            }), T[46] = ew, T[47] = q[0], T[48] = D[0], T[49] = ed, T[50] = ei, T[51] = k) : k = T[51], T[52] !== eS || T[53] !== k ? (w = (0, t.jsx)("span", {
                className: eS,
                children: k
            }), T[52] = eS, T[53] = k, T[54] = w) : w = T[54];
            let ej = `transition-opacity duration-100 flex-1 ${"card"===I?"w-full":""} ${"in-game"===I?"@min-[490px]:max-w-[125px]":""} ${"inactive-market"===em?"lg:opacity-80":""} ${"inactive-outcome"===em&&1!==er?"lg:opacity-60":""}`;
            return T[55] !== ew || T[56] !== eu || T[57] !== en || T[58] !== q[1] || T[59] !== D[1] ? (S = (0, t.jsx)(ef, {
                team: D[1],
                onTap: en,
                price: q[1],
                outcomeIndex: 1,
                animationMode: "arrows",
                priceMode: ex,
                ...ew,
                ...eu
            }), T[55] = ew, T[56] = eu, T[57] = en, T[58] = q[1], T[59] = D[1], T[60] = S) : S = T[60], T[61] !== ej || T[62] !== S ? (j = (0, t.jsx)("span", {
                className: ej,
                children: S
            }), T[61] = ej, T[62] = S, T[63] = j) : j = T[63], T[64] !== es || T[65] !== eo || T[66] !== w || T[67] !== j ? (C = (0, t.jsx)("div", {
                className: "flex flex-1 @min-[490px]:justify-end items-center",
                children: (0, t.jsxs)("div", {
                    className: "flex items-end gap-2 w-[258px] @max-[490px]:w-full",
                    onPointerEnter: es,
                    onPointerLeave: eo,
                    children: [w, j]
                })
            }), T[64] = es, T[65] = eo, T[66] = w, T[67] = j, T[68] = C) : C = T[68], C
        };

    function ev(e) {
        return e.setPreventAccordionHover
    }

    function ey(e) {
        return e.sportsMarketType && !(0, c.isMoneylineMarket)(e.sportsMarketType)
    }

    function eb(e) {
        return "spreads" === e.sportsMarketType || "totals" === e.sportsMarketType || "first_half_spreads" === e.sportsMarketType || "first_half_totals" === e.sportsMarketType || "first_innings_totals" === e.sportsMarketType || "second_innings_totals" === e.sportsMarketType
    }

    function ek(e) {
        let a, i, n = (0, r.c)(8),
            {
                children: s,
                width: o,
                dimLevel: l,
                className: c
            } = e,
            d = void 0 === o ? "w-[115px]" : o,
            u = void 0 === l ? "none" : l,
            m = "half" === u && "opacity-80",
            p = "full" === u && "opacity-60";
        return n[0] !== c || n[1] !== m || n[2] !== p || n[3] !== d ? (a = (0, I.cn)(d, "@max-[490px]:max-w-none @max-[490px]:w-full flex-1 min-w-0 transition-opacity duration-100", m, p, c), n[0] = c, n[1] = m, n[2] = p, n[3] = d, n[4] = a) : a = n[4], n[5] !== s || n[6] !== a ? (i = (0, t.jsx)("span", {
            className: a,
            children: s
        }), n[5] = s, n[6] = a, n[7] = i) : i = n[7], i
    }
    e.s(["NegRiskButtonSection", () => eE], 228032);
    var ew = e.i(204996),
        eS = e.i(507909),
        ej = e.i(213333);

    function eC(e) {
        let a, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k = (0, r.c)(34);
        k[0] !== e ? ({
            ref: o,
            dependency: s,
            mode: c,
            value: d,
            children: a,
            className: n,
            ...l
        } = e, k[0] = e, k[1] = a, k[2] = n, k[3] = s, k[4] = o, k[5] = l, k[6] = c, k[7] = d) : (a = k[1], n = k[2], s = k[3], o = k[4], l = k[5], c = k[6], d = k[7]);
        let w = void 0 === c ? "opacity-color" : c,
            [S, j] = (0, J.useAnimate)(),
            C = (0, Q.useComposedRefs)(o, S),
            _ = (0, ej.usePrevious)(d),
            T = i.default.useRef(!1);
        k[8] !== s ? (u = () => s, m = [s], k[8] = s, k[9] = u, k[10] = m) : (u = k[9], m = k[10]);
        let M = (0, ee.useDeepCompareMemo)(u, m);
        k[11] !== j || k[12] !== S || k[13] !== w || k[14] !== _ || k[15] !== d ? (p = () => {
            if (!_) return;
            let e = d - _ > 0 ? "up" : "down";
            j(S.current, { ...("opacity" === w || "opacity-color" === w) && {
                    opacity: 1
                },
                ...("color" === w || "opacity-color" === w) && {
                    color: `var(--colors-${"up"===e?"green2":"red"})`
                }
            }, {
                duration: .2,
                ease: "easeOut",
                onComplete: () => {
                    j(S.current, { ...("opacity" === w || "opacity-color" === w) && {
                            opacity: 0
                        },
                        ...("color" === w || "opacity-color" === w) && {
                            color: `var(--colors-${"up"===e?"green2":"red"})`
                        }
                    }, {
                        duration: .2,
                        delay: .2,
                        ease: "easeOut"
                    })
                }
            })
        }, k[11] = j, k[12] = S, k[13] = w, k[14] = _, k[15] = d, k[16] = p) : p = k[16];
        let N = p;
        k[17] !== M || k[18] !== N ? (h = () => {
            M && T.current && N()
        }, k[17] = M, k[18] = N, k[19] = h) : h = k[19], k[20] !== M ? (f = [M], k[20] = M, k[21] = f) : f = k[21], i.default.useEffect(h, f), k[22] === Symbol.for("react.memo_cache_sentinel") ? (x = () => {
            let e = setTimeout(() => {
                T.current = !0
            }, 1e3);
            return () => clearTimeout(e)
        }, g = [], k[22] = x, k[23] = g) : (x = k[22], g = k[23]), i.default.useEffect(x, g), k[24] === Symbol.for("react.memo_cache_sentinel") ? (v = {
            wait: 200,
            trailing: !0
        }, k[24] = v) : v = k[24];
        let P = (0, X.useDebounce)(a, v),
            E = void 0 !== _ && d > _ && "top-0 right-[3px] [&>svg]:-rotate-135",
            A = void 0 !== _ && d < _ && "bottom-0 right-[3px] [&>svg]:-rotate-45";
        return k[25] !== n || k[26] !== E || k[27] !== A ? (y = (0, I.cn)("absolute opacity-0", E, A, n), k[25] = n, k[26] = E, k[27] = A, k[28] = y) : y = k[28], k[29] !== C || k[30] !== P || k[31] !== l || k[32] !== y ? (b = (0, t.jsx)("span", {
            ref: C,
            className: y,
            ...l,
            children: P
        }), k[29] = C, k[30] = P, k[31] = l, k[32] = y, k[33] = b) : b = k[33], b
    }
    var e_ = e.i(9187);
    let eT = e => {
        let a, i, n = (0, r.c)(5),
            {
                price: s,
                dependency: o
            } = e;
        n[0] !== s ? (a = (0, e_.calculateAmericanOddsFromPrice)(s, 0) ? ? "", n[0] = s, n[1] = a) : a = n[1];
        let l = a;
        return n[2] !== o || n[3] !== l ? (i = (0, t.jsx)("div", {
            className: "flex h-5 py-0 px-1.5 items-center gap-2 rounded-full bg-black/20",
            children: (0, t.jsx)(et, {
                className: "text-xs leading-[18px] font-medium",
                dependency: o,
                defaultOpacity: .7,
                children: l
            })
        }), n[2] = o, n[3] = l, n[4] = i) : i = n[4], i
    };

    function eM(e) {
        let a, n, s, o, l, c, d, u, m, p, h, f, g, v, y, b, k, w, j, C, _, T, M, N, I, P, E, A, O = (0, r.c)(63);
        if (O[0] !== e) {
            let {
                ref: t,
                team: r,
                market: i,
                outcomeIndex: x,
                className: w,
                style: S,
                height: j,
                shadowHeight: C,
                hoverHeightOffset: _,
                onClick: T,
                onTap: M,
                color: N,
                customColors: I,
                price: P,
                showOdds: E,
                maxWidth: A,
                animationMode: D,
                label: L,
                ...z
            } = e;
            p = t, u = x, a = w, f = S, g = j, v = C, y = _, c = T, d = M, n = N, s = I, m = P, b = E, l = A, k = D, o = L, h = z, O[0] = e, O[1] = a, O[2] = n, O[3] = s, O[4] = o, O[5] = l, O[6] = c, O[7] = d, O[8] = u, O[9] = m, O[10] = p, O[11] = h, O[12] = f, O[13] = g, O[14] = v, O[15] = y, O[16] = b, O[17] = k
        } else a = O[1], n = O[2], s = O[3], o = O[4], l = O[5], c = O[6], d = O[7], u = O[8], m = O[9], p = O[10], h = O[11], f = O[12], g = O[13], v = O[14], y = O[15], b = O[16], k = O[17];
        let D = void 0 === g ? 52 : g,
            L = void 0 === v ? 5 : v,
            z = void 0 === y ? 2 : y,
            R = void 0 !== b && b,
            F = void 0 === k ? "blink" : k,
            $ = (e => {
                let t, a, n, s, o = (0, r.c)(9);
                o[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["side"], o[0] = t) : t = o[0];
                let {
                    side: l
                } = (0, U.useTradeContext)(t);
                o[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["isBookRefreshing"], o[1] = a) : a = o[1];
                let {
                    isBookRefreshing: c
                } = (0, x.useBookContext)(a), d = i.default.useRef(l), u = i.default.useRef(`${e}-${c}`);
                return o[2] !== e || o[3] !== c || o[4] !== l ? (n = () => (l !== d.current || (u.current = `${e}-${c}`, d.current = l), u.current), o[2] = e, o[3] = c, o[4] = l, o[5] = n) : n = o[5], o[6] !== e || o[7] !== c ? (s = [e, c], o[6] = e, o[7] = c, o[8] = s) : s = o[8], (0, ee.useDeepCompareMemo)(n, s)
            })(m.formattedPrice),
            B = parseFloat(m.price),
            q = l ? ? "150px",
            V = l ? ? "150px";
        O[18] !== f || O[19] !== q || O[20] !== V ? (w = {
            width: q,
            maxWidth: V,
            ...f
        }, O[18] = f, O[19] = q, O[20] = V, O[21] = w) : w = O[21];
        let H = w;
        O[22] !== c ? (j = e => {
            e.preventDefault(), e.stopPropagation(), c ? .(e)
        }, O[22] = c, O[23] = j) : j = O[23];
        let W = j;
        O[24] !== d ? (C = (e, t) => {
            e.preventDefault(), e.stopPropagation(), d ? .(e, t)
        }, O[24] = d, O[25] = C) : C = O[25];
        let G = C,
            Z = "arrows" === F,
            K = R ? "text-left flex-nowrap" : "text-center";
        O[26] !== K ? (_ = (0, S.cn)("uppercase text-inherit! leading-[21px]! tracking-[0.15px] flex-1 h-full text-xs font-semibold", K), O[26] = K, O[27] = _) : _ = O[27];
        let Y = o ? ? (0 === u ? "Yes" : "No");
        O[28] !== Y ? (T = (0, t.jsx)(eh, {
            children: Y
        }), O[28] = Y, O[29] = T) : T = O[29];
        let Q = "blink" === F ? $ : "";
        return O[30] !== m.formattedPrice || O[31] !== Q ? (M = (0, t.jsx)(et, {
            className: "ml-1 text-sm",
            dependency: Q,
            defaultOpacity: 1,
            children: m.formattedPrice
        }), O[30] = m.formattedPrice, O[31] = Q, O[32] = M) : M = O[32], O[33] !== _ || O[34] !== T || O[35] !== M ? (N = (0, t.jsxs)("span", {
            className: _,
            children: [T, M]
        }), O[33] = _, O[34] = T, O[35] = M, O[36] = N) : N = O[36], O[37] !== $ || O[38] !== m.price || O[39] !== R ? (I = R && (0, t.jsx)(eT, {
            price: m.price,
            dependency: $
        }), O[37] = $, O[38] = m.price, O[39] = R, O[40] = I) : I = O[40], O[41] !== Z || O[42] !== N || O[43] !== I ? (P = (0, t.jsxs)(em, {
            relative: Z,
            children: [N, I]
        }), O[41] = Z, O[42] = N, O[43] = I, O[44] = P) : P = O[44], O[45] !== F || O[46] !== $ || O[47] !== B ? (E = "arrows" === F && (0, t.jsx)(eC, {
            value: B,
            dependency: $,
            mode: "opacity",
            children: (0, t.jsx)(ed, {})
        }), O[45] = F, O[46] = $, O[47] = B, O[48] = E) : E = O[48], O[49] !== H || O[50] !== a || O[51] !== n || O[52] !== s || O[53] !== D || O[54] !== z || O[55] !== W || O[56] !== G || O[57] !== p || O[58] !== h || O[59] !== L || O[60] !== P || O[61] !== E ? (A = (0, t.jsxs)(eu, {
            ref: p,
            className: a,
            style: H,
            height: D,
            shadowHeight: L,
            hoverHeightOffset: z,
            color: n,
            customColors: s,
            onClick: W,
            onTap: G,
            transition: eS.layoutTransition,
            ...h,
            children: [P, E]
        }), O[49] = H, O[50] = a, O[51] = n, O[52] = s, O[53] = D, O[54] = z, O[55] = W, O[56] = G, O[57] = p, O[58] = h, O[59] = L, O[60] = P, O[61] = E, O[62] = A) : A = O[62], A
    }
    e.s(["NegRiskOutcomeButton", 0, eM], 693141);
    let eN = {
            hoverHeightOffset: 2,
            height: 44,
            shadowHeight: 5,
            maxWidth: "auto",
            css: {
                width: "100%"
            }
        },
        eI = ({
            market: e,
            team: t,
            fallback: r
        }) => t ? .abbreviation ? t.abbreviation.toUpperCase() : e.groupItemTitle ? (0, ew.upperCase)(e.groupItemTitle) : r,
        eP = ({
            market: e,
            label: r,
            team: a,
            dimLevel: n,
            color: l = "gray",
            customColors: c,
            eventSlug: u,
            orientation: m,
            setTradeState: p
        }) => {
            let {
                oddsFormat: f
            } = (0, s.useOddsFormat)(), {
                side: x,
                setSelectedOutcomeIdx: g,
                setPrice: v,
                setPriceUpdateLocation: y,
                setCursorActive: b
            } = (0, U.useTradeContext)(["side", "setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive"]), {
                setActiveMarket: k
            } = (0, d.useEventActiveMarketContext)(["setActiveMarket"]), w = (0, o.useSetActiveSportsMarket)(), S = (0, $.useMarketBestPrices)(e), j = i.default.useMemo(() => {
                let t = S ? .["~zero"] ? .[x ? .toLowerCase()];
                if (!t) return {
                    formattedPrice: "0¢",
                    paddedPrice: void 0,
                    price: "0"
                }; {
                    let r = (0, W.getPrecisionFromTickSize)(e.orderPriceMinTickSize),
                        a = (0, h.showPaddedCentsOnly)(t, r),
                        {
                            formatted: i
                        } = (0, Z.convertPrice)({
                            price: parseFloat(t),
                            precision: r,
                            inputMode: "decimal",
                            outputMode: f
                        });
                    return {
                        formattedPrice: i,
                        paddedPrice: a,
                        price: t
                    }
                }
            }, [S, f, x]), C = i.default.useCallback(() => {
                if ("mobile" === m) {
                    p ? .({
                        type: "trade",
                        side: x,
                        outcomeIdx: 0,
                        market: e,
                        open: !0,
                        orderType: q.OrderType.Market,
                        price: j.paddedPrice,
                        updatePriceLocation: !1
                    }), w(e, {
                        eventSlug: u,
                        variant: e.sportsMarketType,
                        skipSetActiveMarket: !0,
                        openOverlayAccordion: !1,
                        closeGamesAccordionIfOpen: !1,
                        closeOverlayAccordionIfOpen: !1
                    });
                    return
                }
                k(e), w(e, {
                    eventSlug: u,
                    variant: e.sportsMarketType,
                    openOverlayAccordion: !1,
                    closeGamesAccordionIfOpen: !1,
                    closeOverlayAccordionIfOpen: !1,
                    skipSetActiveMarket: !0
                }), g(0), "string" == typeof j.paddedPrice && (v(j.paddedPrice), y("click")), b(!0)
            }, [e, u, m, p, k, w, g, v, y, b, j, x, r]);
            return e.closed ? null : (0, t.jsx)(ek, {
                dimLevel: n,
                children: (0, t.jsx)(eM, {
                    market: e,
                    team: a,
                    onTap: C,
                    price: j,
                    outcomeIndex: 0,
                    animationMode: "arrows",
                    label: r,
                    color: l,
                    customColors: c,
                    ...eN
                })
            })
        },
        eE = e => {
            let a, i, n, l, c = (0, r.c)(51),
                {
                    marketType: m,
                    view: p
                } = e,
                h = void 0 === m ? "moneyline" : m,
                v = void 0 === p ? "card" : p,
                y = (0, f.useTranslations)(),
                {
                    event: k,
                    teams: w,
                    mode: S,
                    moneylineMarket: j
                } = (0, g.useSportsItemContext)(),
                C = (0, s.useNegRiskSportsMarkets)(k.slug, h);
            c[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], c[0] = a) : a = c[0];
            let {
                event: T
            } = (0, u.useEventContext)(a);
            c[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], c[1] = i) : i = c[1];
            let {
                activeMarket: M
            } = (0, d.useEventActiveMarketContext)(i), N = (0, o.useSetActiveSportsMarket)(), I = (0, _.useSportsItemStore)(eA), P = (0, s.useSportsViewSetting)(), {
                setSportsCashOutState: E,
                canRedeem: A
            } = (0, R.useCashOutTxContext)(), {
                setTradeState: O
            } = (0, F.useMobileTradeContext)(), D = (0, b.useHasSportsPositions)(h), L = T.slug === k.slug, $ = "moneyline" === P && "moneyline" === h, B = (M.sportsMarketType ? ? "moneyline") === h;
            if (0 === C.length) return null;
            if (c[2] !== M.slug || c[3] !== A || c[4] !== k.slug || c[5] !== D || c[6] !== L || c[7] !== B || c[8] !== $ || c[9] !== h || c[10] !== C || c[11] !== j || c[12] !== S || c[13] !== N || c[14] !== I || c[15] !== E || c[16] !== O || c[17] !== P || c[18] !== y || c[19] !== w ? .[0] || c[20] !== w ? .[1] || c[21] !== v) {
                l = Symbol.for("react.early_return_sentinel");
                e: {
                    let e, r, a, i, s = {
                            color: "gray",
                            customColors: void 0
                        },
                        o = C.map((e, t) => {
                            let r = M.slug === e.slug,
                                a = "card" === v || "mobile" === S || $ && L && B || r,
                                i = a ? "none" : "half";
                            if ("in-game" === v && "desktop" === S && "aggregate" === P && (L && B ? r || (i = "full") : i = "half"), 0 === t) {
                                let t = w ? .[0],
                                    r = G({
                                        team: t
                                    });
                                return {
                                    market: e,
                                    team: t,
                                    label: eI({
                                        market: e,
                                        team: t,
                                        fallback: "Home"
                                    }),
                                    ...a ? { ...r
                                    } : { ...s
                                    },
                                    dimLevel: i
                                }
                            }
                            if (2 === t) {
                                let t = w ? .[1],
                                    r = G({
                                        team: t
                                    });
                                return {
                                    market: e,
                                    team: t,
                                    label: eI({
                                        market: e,
                                        team: t,
                                        fallback: "Away"
                                    }),
                                    ...a ? { ...r
                                    } : { ...s
                                    },
                                    dimLevel: i
                                }
                            }
                            return {
                                market: e,
                                team: void 0,
                                label: "Draw",
                                color: "gray",
                                dimLevel: i
                            }
                        });c[24] !== k.slug || c[25] !== h || c[26] !== j || c[27] !== S || c[28] !== N || c[29] !== E || c[30] !== O ? (e = e => {
                        e.stopPropagation(), "mobile" === S ? O ? .({
                            type: "sports-redeem",
                            market: j,
                            sportsRedemptionType: h
                        }) : (E({
                            open: !0,
                            mode: h
                        }), N(j, {
                            variant: h,
                            eventSlug: k.slug,
                            openGamesAccordion: !1,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        }))
                    }, c[24] = k.slug, c[25] = h, c[26] = j, c[27] = S, c[28] = N, c[29] = E, c[30] = O, c[31] = e) : e = c[31];
                    let d = e,
                        u = C.some(eO),
                        m = C.some(eD);
                    if (u && D && A && !m) {
                        let e, r, a, i, n;
                        c[32] !== I ? (e = () => I(!0), r = () => I(!1), c[32] = I, c[33] = e, c[34] = r) : (e = c[33], r = c[34]), c[35] !== y ? (a = y("trading.redeem"), c[35] = y, c[36] = a) : a = c[36], c[37] !== d || c[38] !== a ? (i = (0, t.jsx)(z.TradingButton, {
                            color: "blue",
                            hoverHeightOffset: 2,
                            height: 44,
                            shadowHeight: 4,
                            maxWidth: "100%",
                            onClick: d,
                            children: a
                        }), c[37] = d, c[38] = a, c[39] = i) : i = c[39], c[40] !== i || c[41] !== e || c[42] !== r ? (n = (0, t.jsx)("div", {
                            className: "flex flex-1 items-center justify-end w-full",
                            children: (0, t.jsx)("div", {
                                className: "flex w-full @min-[490px]:w-[125px] h-full items-center",
                                onPointerEnter: e,
                                onPointerLeave: r,
                                children: i
                            })
                        }), c[40] = i, c[41] = e, c[42] = r, c[43] = n) : n = c[43], l = n;
                        break e
                    }
                    c[44] !== I ? (r = () => I(!0), a = () => I(!1), c[44] = I, c[45] = r, c[46] = a) : (r = c[45], a = c[46]),
                    c[47] !== k.slug || c[48] !== S || c[49] !== O ? (i = e => {
                        let {
                            market: r,
                            ...a
                        } = e;
                        return (0, t.jsx)(x.BookContextProvider, {
                            market: r,
                            prefetch: {
                                book: "never",
                                lastPrice: "once-when-stale"
                            },
                            poll: "when-inactive",
                            subscribe: "never",
                            defer: "after-virtualized",
                            children: (0, t.jsx)(eP, {
                                market: r,
                                eventSlug: k.slug,
                                orientation: S,
                                setTradeState: O,
                                ...a
                            })
                        }, r.slug)
                    }, c[47] = k.slug, c[48] = S, c[49] = O, c[50] = i) : i = c[50],
                    n = (0, t.jsx)("div", {
                        className: "flex items-center min-w-0 w-max @max-[490px]:w-full gap-2 justify-between",
                        onPointerEnter: r,
                        onPointerLeave: a,
                        children: o.map(i)
                    })
                }
                c[2] = M.slug, c[3] = A, c[4] = k.slug, c[5] = D, c[6] = L, c[7] = B, c[8] = $, c[9] = h, c[10] = C, c[11] = j, c[12] = S, c[13] = N, c[14] = I, c[15] = E, c[16] = O, c[17] = P, c[18] = y, c[19] = w ? .[0], c[20] = w ? .[1], c[21] = v, c[22] = n, c[23] = l
            } else n = c[22], l = c[23];
            return l !== Symbol.for("react.early_return_sentinel") ? l : n
        };

    function eA(e) {
        return e.setPreventAccordionHover
    }

    function eO(e) {
        return e.closed
    }

    function eD(e) {
        return !e.closed
    }
    var eL = e.i(567692),
        ez = e.i(488549),
        eR = e.i(668122),
        eF = e.i(305457);
    let e$ = e => {
        let a, i, n, l, c, m, p, x, v, y, b, k, w, S, j, C, T, M = (0, r.c)(59),
            {
                market: N,
                view: I,
                hasBTTSPositions: P
            } = e,
            E = void 0 === I ? "in-game" : I,
            A = (0, f.useTranslations)(),
            {
                event: O,
                mode: D,
                teams: L,
                gameState: H,
                moneylineMarket: K
            } = (0, g.useSportsItemContext)(),
            {
                prices: Y,
                onOutcomeClick: Q
            } = (e => {
                let t, a, i, n, l, c, u, m = (0, r.c)(50);
                m[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["activeMarket"], m[0] = t) : t = m[0];
                let {
                    activeMarket: p
                } = (0, d.useEventActiveMarketContext)(t), f = (0, o.useSetActiveSportsMarket)();
                m[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side", "selectedOutcomeIdx"], m[1] = a) : a = m[1];
                let {
                    setSelectedOutcomeIdx: x,
                    setPrice: v,
                    setPriceUpdateLocation: y,
                    setCursorActive: b,
                    side: k,
                    selectedOutcomeIdx: w
                } = (0, U.useTradeContext)(a), {
                    teams: S,
                    event: j
                } = (0, g.useSportsItemContext)(), C = (0, $.useMarketBestPrices)(e), _ = (0, s.useSportsStoreSelector)("sportSlug"), {
                    oddsFormat: T
                } = (0, s.useOddsFormat)(), M = (() => {
                    let e, t, a = (0, r.c)(5),
                        {
                            mode: i
                        } = (0, g.useSportsItemContext)();
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
                    let {
                        side: n,
                        selectedOutcomeIdx: s
                    } = (0, U.useTradeContext)(e);
                    a[1] !== i || a[2] !== s || a[3] !== n ? (t = {
                        mode: i,
                        side: n,
                        selectedOutcomeIdx: s
                    }, a[1] = i, a[2] = s, a[3] = n, a[4] = t) : t = a[4];
                    let o = t;
                    return (0, B.useLatest)(o)
                })(), N = (0, eL.useBoundBookStore)(), {
                    setTradeState: I
                } = (0, F.useMobileTradeContext)(), P = (0, eF.useAmplitudeAnalytics)();
                e: {
                    let t, r, a, n = S ? .[0];m[2] !== n ? (t = G({
                        team: n
                    }), m[2] = n, m[3] = t) : t = m[3];
                    let s = t,
                        o = S ? .[1];m[4] !== o ? (r = G({
                        team: o
                    }), m[4] = o, m[5] = r) : r = m[5];
                    let l = r;
                    if (_ === V.SportSlug.LIVE) {
                        let t, r, a, n, o, c = e.slug === p.slug,
                            d = c && 0 === w ? "blue" : "gray";
                        m[6] !== c || m[7] !== w || m[8] !== s ? (t = c && 0 === w && s ? .customColors && { ...s
                        }, m[6] = c, m[7] = w, m[8] = s, m[9] = t) : t = m[9], m[10] !== d || m[11] !== t ? (r = {
                            color: d,
                            customColors: void 0,
                            ...t
                        }, m[10] = d, m[11] = t, m[12] = r) : r = m[12];
                        let u = c && 1 === w ? "blue" : "gray";
                        m[13] !== c || m[14] !== l || m[15] !== w ? (a = c && 1 === w && l ? .customColors && { ...l
                        }, m[13] = c, m[14] = l, m[15] = w, m[16] = a) : a = m[16], m[17] !== u || m[18] !== a ? (n = {
                            color: u,
                            customColors: void 0,
                            ...a
                        }, m[17] = u, m[18] = a, m[19] = n) : n = m[19], m[20] !== n || m[21] !== r ? (o = [r, n], m[20] = n, m[21] = r, m[22] = o) : o = m[22], i = o;
                        break e
                    }
                    m[23] !== l || m[24] !== s ? (a = [s, l], m[23] = l, m[24] = s, m[25] = a) : a = m[25],
                    i = a
                }
                let E = i;
                m[26] !== e || m[27] !== T || m[28] !== k ? (n = t => {
                    let r = t ? .["~zero"] ? .[k ? .toLowerCase()],
                        a = t ? .["~one"] ? .[k ? .toLowerCase()];
                    if (!r || !a) return [{
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }, {
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }];
                    let i = (0, W.getPrecisionFromTickSize)(e.orderPriceMinTickSize),
                        n = (0, h.showPaddedCentsOnly)(r, i),
                        s = (0, h.showPaddedCentsOnly)(a, i),
                        {
                            formatted: o
                        } = (0, Z.convertPrice)({
                            price: parseFloat(r),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: T
                        }),
                        {
                            formatted: l
                        } = (0, Z.convertPrice)({
                            price: parseFloat(a),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: T
                        });
                    return [{
                        formattedPrice: o,
                        paddedPrice: n,
                        price: r
                    }, {
                        formattedPrice: l,
                        paddedPrice: s,
                        price: a
                    }]
                }, m[26] = e, m[27] = T, m[28] = k, m[29] = n) : n = m[29];
                let A = n;
                m[30] !== P || m[31] !== N || m[32] !== M || m[33] !== j.slug || m[34] !== A || m[35] !== e || m[36] !== f || m[37] !== b || m[38] !== v || m[39] !== y || m[40] !== x || m[41] !== I ? (l = t => {
                    if (!M.current) return;
                    let {
                        mode: r,
                        side: a,
                        selectedOutcomeIdx: i
                    } = M.current, n = void 0 !== t ? t : i;
                    if ("desktop" === r) {
                        f(e, {
                            eventSlug: j.slug,
                            variant: "both_teams_to_score",
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        });
                        let {
                            paddedPrice: t
                        } = A(N.getState().byAsset[(0, ez.getAssetId)(e)] ? .views[String(e.orderPriceMinTickSize)] ? .bestPrices)[n];
                        x(n), "string" == typeof t && (v(t), y("click")), b(!0)
                    } else {
                        let {
                            paddedPrice: t
                        } = A(N.getState().byAsset[(0, ez.getAssetId)(e)] ? .views[String(e.orderPriceMinTickSize)] ? .bestPrices)[n];
                        I ? .({
                            type: "trade",
                            side: a,
                            outcomeIdx: n,
                            market: e,
                            open: !0,
                            orderType: q.OrderType.Market,
                            price: t,
                            updatePriceLocation: !1
                        }), f(e, {
                            eventSlug: j.slug,
                            variant: "both_teams_to_score",
                            skipSetActiveMarket: !0,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        })
                    }
                    P.trackEvent(eR.Events.SportsTotalsClick, {
                        location: "smp",
                        market_type: "both_teams_to_score"
                    })
                }, m[30] = P, m[31] = N, m[32] = M, m[33] = j.slug, m[34] = A, m[35] = e, m[36] = f, m[37] = b, m[38] = v, m[39] = y, m[40] = x, m[41] = I, m[42] = l) : l = m[42];
                let O = l;
                return m[43] !== A || m[44] !== C ? (c = A(C), m[43] = A, m[44] = C, m[45] = c) : c = m[45], m[46] !== E || m[47] !== O || m[48] !== c ? (u = {
                    colors: E,
                    prices: c,
                    onOutcomeClick: O
                }, m[46] = E, m[47] = O, m[48] = c, m[49] = u) : u = m[49], u
            })(N),
            {
                setTradeState: X
            } = (0, F.useMobileTradeContext)(),
            {
                setSportsCashOutState: J,
                canRedeem: ee
            } = (0, R.useCashOutTxContext)(),
            et = (0, _.useSportsItemStore)(eB);
        M[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], M[0] = a) : a = M[0];
        let {
            event: er
        } = (0, u.useEventContext)(a), {
            slug: ea
        } = er;
        M[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], M[1] = i) : i = M[1];
        let {
            activeMarket: ei
        } = (0, d.useEventActiveMarketContext)(i), en = (0, o.useSetActiveSportsMarket)();
        M[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["selectedOutcomeIdx"], M[2] = n) : n = M[2];
        let {
            selectedOutcomeIdx: es
        } = (0, U.useTradeContext)(n);
        M[3] !== Q ? (l = () => {
            Q(0)
        }, M[3] = Q, M[4] = l) : l = M[4];
        let eo = l;
        M[5] !== Q ? (c = () => {
            Q(1)
        }, M[5] = Q, M[6] = c) : c = M[6];
        let el = c;
        M[7] !== et ? (m = () => {
            et(!0)
        }, M[7] = et, M[8] = m) : m = M[8];
        let ec = m;
        M[9] !== et ? (p = () => {
            et(!1)
        }, M[9] = et, M[10] = p) : p = M[10];
        let ed = p,
            eu = O.closed || N.closed,
            {
                isClosed: em
            } = {
                isClosed: eu,
                isFinished: eu || H === V.GameState.Finished
            },
            ep = "card" === E ? 40 : 44,
            eh = "card" === E ? 4 : 5;
        M[11] === Symbol.for("react.memo_cache_sentinel") ? (x = {
            width: "100%"
        }, M[11] = x) : x = M[11], M[12] !== ep || M[13] !== eh ? (v = {
            hoverHeightOffset: 2,
            height: ep,
            shadowHeight: eh,
            maxWidth: "auto",
            css: x
        }, M[12] = ep, M[13] = eh, M[14] = v) : v = M[14];
        let ex = v;
        e: {
            let e, t = ea === O.slug && "both_teams_to_score" === ei.sportsMarketType;
            if ("mobile" === D && "in-game" === E) {
                let e;
                M[15] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    oneColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    bttsActive: !0,
                    preventDim: !0
                }, M[15] = e) : e = M[15], y = e;
                break e
            }
            if (t) {
                let e;
                M[16] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "green",
                        customColors: void 0
                    },
                    oneColors: {
                        color: "red",
                        customColors: void 0
                    },
                    bttsActive: !0,
                    preventDim: !1
                }, M[16] = e) : e = M[16], y = e;
                break e
            }
            M[17] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                zeroColors: {
                    color: "gray",
                    customColors: void 0
                },
                oneColors: {
                    color: "gray",
                    customColors: void 0
                },
                bttsActive: !1,
                preventDim: !1
            }, M[17] = e) : e = M[17],
            y = e
        }
        let {
            zeroColors: eg,
            oneColors: ev,
            bttsActive: ey,
            preventDim: eb
        } = y;
        M[18] === Symbol.for("react.memo_cache_sentinel") ? (b = [{
            type: "default",
            font: "small"
        }, {
            type: "default",
            font: "small"
        }], M[18] = b) : b = M[18];
        let ek = b;
        M[19] !== O.slug || M[20] !== D || M[21] !== K || M[22] !== en || M[23] !== J || M[24] !== X ? (k = e => {
            e.stopPropagation(), "mobile" === D ? (X ? .({
                type: "sports-redeem",
                market: K,
                sportsRedemptionType: "both_teams_to_score"
            }), en(K, {
                variant: "both_teams_to_score",
                eventSlug: O.slug,
                skipSetActiveMarket: !0,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })) : (J({
                open: !0,
                mode: "both_teams_to_score"
            }), en(K, {
                variant: "both_teams_to_score",
                eventSlug: O.slug,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            }))
        }, M[19] = O.slug, M[20] = D, M[21] = K, M[22] = en, M[23] = J, M[24] = X, M[25] = k) : k = M[25];
        let ew = k;
        if (!L) return null;
        if (em && "in-game" === E && void 0 !== P && P && ee) {
            let e, r, a;
            return M[26] !== A ? (e = A("trading.redeem"), M[26] = A, M[27] = e) : e = M[27], M[28] !== ew || M[29] !== e ? (r = (0, t.jsx)(z.TradingButton, {
                color: "blue",
                hoverHeightOffset: 2,
                height: 44,
                shadowHeight: 4,
                maxWidth: "100%",
                onClick: ew,
                children: e
            }), M[28] = ew, M[29] = e, M[30] = r) : r = M[30], M[31] !== ec || M[32] !== ed || M[33] !== r ? (a = (0, t.jsx)("div", {
                className: "flex @min-[490px]:justify-end items-center w-full",
                children: (0, t.jsx)("div", {
                    className: "flex w-full h-full items-center justify-end @min-[490px]:w-[125px]",
                    onPointerEnter: ec,
                    onPointerLeave: ed,
                    children: r
                })
            }), M[31] = ec, M[32] = ed, M[33] = r, M[34] = a) : a = M[34], a
        }
        if (em && "in-game" === E) return null;
        let eS = `flex items-end gap-2 w-[258px] @max-[490px]:w-full ${"card"===E?"@min-[490px]:flex-col w-full":""}`,
            ej = `transition-opacity duration-100 flex-1 cursor-pointer ${"card"===E?"w-full":""} ${"in-game"===E?"@min-[490px]:max-w-[125px]":""} ${!eb&&!ey?"opacity-80":""} ${!eb&&ey&&0!==es?"opacity-60":""}`;
        M[35] !== ex || M[36] !== Y[0] || M[37] !== L[0] || M[38] !== eg || M[39] !== eo ? (w = (0, t.jsx)(ef, {
            team: L[0],
            onTap: eo,
            price: Y[0],
            outcomeIndex: 0,
            animationMode: "arrows",
            priceMode: ek[0],
            label: "Yes",
            ...eg,
            ...ex
        }), M[35] = ex, M[36] = Y[0], M[37] = L[0], M[38] = eg, M[39] = eo, M[40] = w) : w = M[40], M[41] !== ej || M[42] !== w ? (S = (0, t.jsx)("span", {
            className: ej,
            children: w
        }), M[41] = ej, M[42] = w, M[43] = S) : S = M[43];
        let eC = `transition-opacity duration-100 flex-1 cursor-pointer ${"card"===E?"w-full":""} ${"in-game"===E?"@min-[490px]:max-w-[125px]":""} ${!eb&&!ey?"opacity-80":""} ${!eb&&ey&&1!==es?"opacity-60":""}`;
        return M[44] !== ex || M[45] !== ev || M[46] !== el || M[47] !== Y[1] || M[48] !== L[1] ? (j = (0, t.jsx)(ef, {
            team: L[1],
            onTap: el,
            price: Y[1],
            outcomeIndex: 1,
            animationMode: "arrows",
            priceMode: ek[1],
            label: "No",
            ...ev,
            ...ex
        }), M[44] = ex, M[45] = ev, M[46] = el, M[47] = Y[1], M[48] = L[1], M[49] = j) : j = M[49], M[50] !== eC || M[51] !== j ? (C = (0, t.jsx)("span", {
            className: eC,
            children: j
        }), M[50] = eC, M[51] = j, M[52] = C) : C = M[52], M[53] !== ec || M[54] !== ed || M[55] !== eS || M[56] !== S || M[57] !== C ? (T = (0, t.jsx)("div", {
            className: "flex @min-[490px]:justify-end items-center w-full",
            children: (0, t.jsxs)("div", {
                className: eS,
                onPointerEnter: ec,
                onPointerLeave: ed,
                children: [S, C]
            })
        }), M[53] = ec, M[54] = ed, M[55] = eS, M[56] = S, M[57] = C, M[58] = T) : T = M[58], T
    };

    function eB(e) {
        return e.setPreventAccordionHover
    }
    let eq = e => {
        let a, i, l, c, m, p, x, v, y, b, k, w, S, j, C, T, M, N, I, P = (0, r.c)(73),
            {
                market: E,
                view: A,
                hasChildMoneylinePositions: O
            } = e,
            D = void 0 === A ? "in-game" : A,
            L = (0, f.useTranslations)(),
            {
                event: H,
                mode: K,
                teams: Y,
                gameState: Q,
                moneylineMarket: X
            } = (0, g.useSportsItemContext)(),
            {
                prices: J,
                onOutcomeClick: ee,
                colors: et
            } = (e => {
                let t, a, i, l, c, u, m, p = (0, r.c)(51);
                p[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["activeMarket"], p[0] = t) : t = p[0];
                let {
                    activeMarket: f
                } = (0, d.useEventActiveMarketContext)(t), x = (0, o.useSetActiveSportsMarket)();
                p[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side", "selectedOutcomeIdx"], p[1] = a) : a = p[1];
                let {
                    setSelectedOutcomeIdx: v,
                    setPrice: y,
                    setPriceUpdateLocation: b,
                    setCursorActive: k,
                    side: w,
                    selectedOutcomeIdx: S
                } = (0, U.useTradeContext)(a), {
                    teams: j,
                    event: C
                } = (0, g.useSportsItemContext)(), _ = (0, $.useMarketBestPrices)(e), T = (0, s.useSportsStoreSelector)("sportSlug"), {
                    oddsFormat: M
                } = (0, s.useOddsFormat)(), N = (() => {
                    let e, t, a = (0, r.c)(5),
                        {
                            mode: i
                        } = (0, g.useSportsItemContext)();
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
                    let {
                        side: n,
                        selectedOutcomeIdx: s
                    } = (0, U.useTradeContext)(e);
                    a[1] !== i || a[2] !== s || a[3] !== n ? (t = {
                        mode: i,
                        side: n,
                        selectedOutcomeIdx: s
                    }, a[1] = i, a[2] = s, a[3] = n, a[4] = t) : t = a[4];
                    let o = t;
                    return (0, B.useLatest)(o)
                })(), I = (0, eL.useBoundBookStore)(), P = (0, n.useBoundSportsStore)(), {
                    setTradeState: E
                } = (0, F.useMobileTradeContext)(), A = (0, eF.useAmplitudeAnalytics)();
                e: {
                    let t, r, a, n = j ? .[0];p[2] !== n ? (t = G({
                        team: n
                    }), p[2] = n, p[3] = t) : t = p[3];
                    let s = t,
                        o = j ? .[1];p[4] !== o ? (r = G({
                        team: o
                    }), p[4] = o, p[5] = r) : r = p[5];
                    let l = r;
                    if (T === V.SportSlug.LIVE) {
                        let t, r, a, n, o, c = e.slug === f.slug,
                            d = c && 0 === S ? "blue" : "gray";
                        p[6] !== c || p[7] !== S || p[8] !== s ? (t = c && 0 === S && s ? .customColors && { ...s
                        }, p[6] = c, p[7] = S, p[8] = s, p[9] = t) : t = p[9], p[10] !== d || p[11] !== t ? (r = {
                            color: d,
                            customColors: void 0,
                            ...t
                        }, p[10] = d, p[11] = t, p[12] = r) : r = p[12];
                        let u = c && 1 === S ? "blue" : "gray";
                        p[13] !== c || p[14] !== l || p[15] !== S ? (a = c && 1 === S && l ? .customColors && { ...l
                        }, p[13] = c, p[14] = l, p[15] = S, p[16] = a) : a = p[16], p[17] !== u || p[18] !== a ? (n = {
                            color: u,
                            customColors: void 0,
                            ...a
                        }, p[17] = u, p[18] = a, p[19] = n) : n = p[19], p[20] !== n || p[21] !== r ? (o = [r, n], p[20] = n, p[21] = r, p[22] = o) : o = p[22], i = o;
                        break e
                    }
                    p[23] !== l || p[24] !== s ? (a = [s, l], p[23] = l, p[24] = s, p[25] = a) : a = p[25],
                    i = a
                }
                let O = i;
                p[26] !== e || p[27] !== M || p[28] !== w ? (l = t => {
                    let r = t ? .["~zero"] ? .[w ? .toLowerCase()],
                        a = t ? .["~one"] ? .[w ? .toLowerCase()];
                    if (!r || !a) return [{
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }, {
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }];
                    let i = (0, W.getPrecisionFromTickSize)(e.orderPriceMinTickSize),
                        n = (0, h.showPaddedCentsOnly)(r, i),
                        s = (0, h.showPaddedCentsOnly)(a, i),
                        {
                            formatted: o
                        } = (0, Z.convertPrice)({
                            price: parseFloat(r),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: M
                        }),
                        {
                            formatted: l
                        } = (0, Z.convertPrice)({
                            price: parseFloat(a),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: M
                        });
                    return [{
                        formattedPrice: o,
                        paddedPrice: n,
                        price: r
                    }, {
                        formattedPrice: l,
                        paddedPrice: s,
                        price: a
                    }]
                }, p[26] = e, p[27] = M, p[28] = w, p[29] = l) : l = p[29];
                let D = l;
                p[30] !== A || p[31] !== I || p[32] !== N || p[33] !== C.slug || p[34] !== D || p[35] !== e || p[36] !== x || p[37] !== k || p[38] !== y || p[39] !== b || p[40] !== v || p[41] !== E || p[42] !== P ? (c = t => {
                    if (!N.current) return;
                    let {
                        mode: r,
                        side: a,
                        selectedOutcomeIdx: i
                    } = N.current, n = void 0 !== t ? t : i;
                    if (P ? .getState().setLine({
                            slug: C.slug,
                            type: "child_moneyline",
                            line: {
                                value: e.slug,
                                line: e.line ? ? 0,
                                label: e.groupItemTitle ? ? "",
                                event: C.slug,
                                market: e.slug
                            }
                        }), "desktop" === r) {
                        x(e, {
                            eventSlug: C.slug,
                            variant: "child_moneyline",
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        });
                        let t = e.clobTokenIds ? .[0] ? .toLowerCase ? .() ? ? "",
                            {
                                paddedPrice: r
                            } = D(I.getState().byAsset[t] ? .views[String(e.orderPriceMinTickSize)] ? .bestPrices)[n];
                        v(n), "string" == typeof r && (y(r), b("click")), k(!0)
                    } else {
                        let t = e.clobTokenIds ? .[0] ? .toLowerCase ? .() ? ? "",
                            {
                                paddedPrice: r
                            } = D(I.getState().byAsset[t] ? .views[String(e.orderPriceMinTickSize)] ? .bestPrices)[n];
                        E ? .({
                            type: "trade",
                            side: a,
                            outcomeIdx: n,
                            market: e,
                            open: !0,
                            orderType: q.OrderType.Market,
                            price: r,
                            updatePriceLocation: !1
                        }), x(e, {
                            eventSlug: C.slug,
                            variant: "child_moneyline",
                            skipSetActiveMarket: !0,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        })
                    }
                    A.trackEvent(eR.Events.SportsTotalsClick, {
                        location: "smp",
                        market_type: "child_moneyline"
                    })
                }, p[30] = A, p[31] = I, p[32] = N, p[33] = C.slug, p[34] = D, p[35] = e, p[36] = x, p[37] = k, p[38] = y, p[39] = b, p[40] = v, p[41] = E, p[42] = P, p[43] = c) : c = p[43];
                let L = c;
                return p[44] !== _ || p[45] !== D ? (u = D(_), p[44] = _, p[45] = D, p[46] = u) : u = p[46], p[47] !== O || p[48] !== L || p[49] !== u ? (m = {
                    colors: O,
                    prices: u,
                    onOutcomeClick: L
                }, p[47] = O, p[48] = L, p[49] = u, p[50] = m) : m = p[50], m
            })(E),
            {
                setTradeState: er
            } = (0, F.useMobileTradeContext)(),
            {
                setSportsCashOutState: ea,
                canRedeem: ei
            } = (0, R.useCashOutTxContext)(),
            en = (0, _.useSportsItemStore)(eV);
        P[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], P[0] = a) : a = P[0];
        let {
            event: es
        } = (0, u.useEventContext)(a), {
            slug: eo
        } = es;
        P[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], P[1] = i) : i = P[1];
        let {
            activeMarket: el
        } = (0, d.useEventActiveMarketContext)(i), ec = (0, o.useSetActiveSportsMarket)();
        P[2] === Symbol.for("react.memo_cache_sentinel") ? (l = ["selectedOutcomeIdx"], P[2] = l) : l = P[2];
        let {
            selectedOutcomeIdx: ed
        } = (0, U.useTradeContext)(l);
        P[3] !== ee ? (c = () => {
            ee(0)
        }, P[3] = ee, P[4] = c) : c = P[4];
        let eu = c;
        P[5] !== ee ? (m = () => {
            ee(1)
        }, P[5] = ee, P[6] = m) : m = P[6];
        let em = m;
        P[7] !== en ? (p = () => {
            en(!0)
        }, P[7] = en, P[8] = p) : p = P[8];
        let ep = p;
        P[9] !== en ? (x = () => {
            en(!1)
        }, P[9] = en, P[10] = x) : x = P[10];
        let eh = x,
            ex = H.closed || E.closed,
            {
                isClosed: eg
            } = {
                isClosed: ex,
                isFinished: ex || Q === V.GameState.Finished
            },
            ev = "card" === D ? 40 : 44,
            ey = "card" === D ? 4 : 5;
        P[11] === Symbol.for("react.memo_cache_sentinel") ? (v = {
            width: "100%"
        }, P[11] = v) : v = P[11], P[12] !== ev || P[13] !== ey ? (y = {
            hoverHeightOffset: 2,
            height: ev,
            shadowHeight: ey,
            maxWidth: "auto",
            css: v
        }, P[12] = ev, P[13] = ey, P[14] = y) : y = P[14];
        let eb = y;
        e: {
            let e, t = eo === H.slug && "child_moneyline" === el.sportsMarketType;
            if ("mobile" === K && "in-game" === D) {
                let e;
                P[15] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    oneColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    childMoneylineActive: !0,
                    preventDim: !0
                }, P[15] = e) : e = P[15], b = e;
                break e
            }
            if (t) {
                let e;
                P[16] !== et[0] || P[17] !== et[1] ? (e = {
                    zeroColors: et[0],
                    oneColors: et[1],
                    childMoneylineActive: !0,
                    preventDim: !1
                }, P[16] = et[0], P[17] = et[1], P[18] = e) : e = P[18], b = e;
                break e
            }
            P[19] !== et[0] || P[20] !== et[1] ? (e = {
                zeroColors: et[0],
                oneColors: et[1],
                childMoneylineActive: !1,
                preventDim: !1
            }, P[19] = et[0], P[20] = et[1], P[21] = e) : e = P[21],
            b = e
        }
        let {
            zeroColors: ek,
            oneColors: ew,
            childMoneylineActive: eS,
            preventDim: ej
        } = b;
        P[22] === Symbol.for("react.memo_cache_sentinel") ? (k = [{
            type: "default",
            font: "small"
        }, {
            type: "default",
            font: "small"
        }], P[22] = k) : k = P[22];
        let eC = k;
        P[23] !== H.slug || P[24] !== K || P[25] !== X || P[26] !== ec || P[27] !== ea || P[28] !== er ? (w = e => {
            e.stopPropagation(), "mobile" === K ? (er ? .({
                type: "sports-redeem",
                market: X,
                sportsRedemptionType: "child_moneyline"
            }), ec(X, {
                variant: "child_moneyline",
                eventSlug: H.slug,
                skipSetActiveMarket: !0,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })) : (ea({
                open: !0,
                mode: "child_moneyline"
            }), ec(X, {
                variant: "child_moneyline",
                eventSlug: H.slug,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            }))
        }, P[23] = H.slug, P[24] = K, P[25] = X, P[26] = ec, P[27] = ea, P[28] = er, P[29] = w) : w = P[29];
        let e_ = w;
        if (!Y) return null;
        if (eg && "in-game" === D && void 0 !== O && O && ei) {
            let e, r, a;
            return P[30] !== L ? (e = L("trading.redeem"), P[30] = L, P[31] = e) : e = P[31], P[32] !== e_ || P[33] !== e ? (r = (0, t.jsx)(z.TradingButton, {
                color: "blue",
                hoverHeightOffset: 2,
                height: 44,
                shadowHeight: 4,
                maxWidth: "100%",
                onClick: e_,
                children: e
            }), P[32] = e_, P[33] = e, P[34] = r) : r = P[34], P[35] !== ep || P[36] !== eh || P[37] !== r ? (a = (0, t.jsx)("div", {
                className: "flex @min-[490px]:justify-end items-center w-full",
                children: (0, t.jsx)("div", {
                    className: "flex w-full h-full items-center justify-end @min-[490px]:w-[125px]",
                    onPointerEnter: ep,
                    onPointerLeave: eh,
                    children: r
                })
            }), P[35] = ep, P[36] = eh, P[37] = r, P[38] = a) : a = P[38], a
        }
        if (eg && "in-game" === D) return null;
        let eT = `flex items-end gap-2 w-[258px] @max-[490px]:w-full ${"card"===D?"@min-[490px]:flex-col w-full":""}`,
            eM = `transition-opacity duration-100 flex-1 ${"card"===D?"w-full":""} ${"in-game"===D?"@min-[490px]:max-w-[125px]":""} ${!ej&&!eS?"opacity-80":""} ${!ej&&eS&&0!==ed?"opacity-60":""}`;
        P[39] !== E.groupItemTitle || P[40] !== Y[0] || P[41] !== D ? (S = "card" === D ? `${E.groupItemTitle||""} ${Y[0].abbreviation}`.trim() : void 0, P[39] = E.groupItemTitle, P[40] = Y[0], P[41] = D, P[42] = S) : S = P[42], P[43] !== eb || P[44] !== J[0] || P[45] !== S || P[46] !== Y[0] || P[47] !== ek || P[48] !== eu ? (j = (0, t.jsx)(ef, {
            team: Y[0],
            onTap: eu,
            price: J[0],
            outcomeIndex: 0,
            animationMode: "arrows",
            priceMode: eC[0],
            label: S,
            ...ek,
            ...eb
        }), P[43] = eb, P[44] = J[0], P[45] = S, P[46] = Y[0], P[47] = ek, P[48] = eu, P[49] = j) : j = P[49], P[50] !== eM || P[51] !== j ? (C = (0, t.jsx)("span", {
            className: eM,
            children: j
        }), P[50] = eM, P[51] = j, P[52] = C) : C = P[52];
        let eN = `transition-opacity duration-100 flex-1 ${"card"===D?"w-full":""} ${"in-game"===D?"@min-[490px]:max-w-[125px]":""} ${!ej&&!eS?"opacity-80":""} ${!ej&&eS&&1!==ed?"opacity-60":""}`;
        return P[53] !== E.groupItemTitle || P[54] !== Y[1] || P[55] !== D ? (T = "card" === D ? `${E.groupItemTitle||""} ${Y[1].abbreviation}`.trim() : void 0, P[53] = E.groupItemTitle, P[54] = Y[1], P[55] = D, P[56] = T) : T = P[56], P[57] !== eb || P[58] !== ew || P[59] !== em || P[60] !== J[1] || P[61] !== T || P[62] !== Y[1] ? (M = (0, t.jsx)(ef, {
            team: Y[1],
            onTap: em,
            price: J[1],
            outcomeIndex: 1,
            animationMode: "arrows",
            priceMode: eC[1],
            label: T,
            ...ew,
            ...eb
        }), P[57] = eb, P[58] = ew, P[59] = em, P[60] = J[1], P[61] = T, P[62] = Y[1], P[63] = M) : M = P[63], P[64] !== eN || P[65] !== M ? (N = (0, t.jsx)("span", {
            className: eN,
            children: M
        }), P[64] = eN, P[65] = M, P[66] = N) : N = P[66], P[67] !== ep || P[68] !== eh || P[69] !== eT || P[70] !== C || P[71] !== N ? (I = (0, t.jsx)("div", {
            className: "flex @min-[490px]:justify-end items-center w-full",
            children: (0, t.jsxs)("div", {
                className: eT,
                onPointerEnter: ep,
                onPointerLeave: eh,
                children: [C, N]
            })
        }), P[67] = ep, P[68] = eh, P[69] = eT, P[70] = C, P[71] = N, P[72] = I) : I = P[72], I
    };

    function eV(e) {
        return e.setPreventAccordionHover
    }
    let eH = e => {
        let a, i, n, l, m, p, x, v, y, b, k, w, S, j, C, T, M, N = (0, r.c)(68),
            {
                market: I,
                view: P,
                hasPositions: E,
                sportsMarketType: A,
                labelType: O
            } = e,
            D = void 0 === P ? "in-game" : P,
            L = (0, f.useTranslations)(),
            {
                event: H,
                mode: K,
                teams: Y,
                gameState: Q,
                moneylineMarket: X
            } = (0, g.useSportsItemContext)(),
            {
                prices: J,
                onOutcomeClick: ee,
                colors: et
            } = ((e, t) => {
                let a, i, n, l, u, m, p, f = (0, r.c)(65);
                f[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], f[0] = a) : a = f[0];
                let {
                    activeMarket: x
                } = (0, d.useEventActiveMarketContext)(a), v = (0, o.useSetActiveSportsMarket)();
                f[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side", "selectedOutcomeIdx"], f[1] = i) : i = f[1];
                let {
                    setSelectedOutcomeIdx: y,
                    setPrice: b,
                    setPriceUpdateLocation: k,
                    setCursorActive: w,
                    side: S,
                    selectedOutcomeIdx: j
                } = (0, U.useTradeContext)(i), {
                    teams: C,
                    event: _
                } = (0, g.useSportsItemContext)(), T = (0, $.useMarketBestPrices)(e), M = (0, s.useSportsStoreSelector)("sportSlug"), {
                    oddsFormat: N
                } = (0, s.useOddsFormat)(), I = (() => {
                    let e, t, a = (0, r.c)(5),
                        {
                            mode: i
                        } = (0, g.useSportsItemContext)();
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
                    let {
                        side: n,
                        selectedOutcomeIdx: s
                    } = (0, U.useTradeContext)(e);
                    a[1] !== i || a[2] !== s || a[3] !== n ? (t = {
                        mode: i,
                        side: n,
                        selectedOutcomeIdx: s
                    }, a[1] = i, a[2] = s, a[3] = n, a[4] = t) : t = a[4];
                    let o = t;
                    return (0, B.useLatest)(o)
                })(), P = (0, $.useGetBestPrices)(), {
                    setTradeState: E
                } = (0, F.useMobileTradeContext)(), A = (0, eF.useAmplitudeAnalytics)();
                e: {
                    let r, a, i, s, o, l = C ? .[0];f[2] !== l ? (r = G({
                        team: l
                    }), f[2] = l, f[3] = r) : r = f[3];
                    let c = r,
                        d = C ? .[1];f[4] !== d ? (a = G({
                        team: d
                    }), f[4] = d, f[5] = a) : a = f[5];
                    let u = a,
                        m = e.slug === x.slug;
                    if ("yes-no" === t || "odd-even" === t) {
                        let e, t, r, a = m && 0 === j ? "green" : "gray";
                        f[6] !== a ? (e = {
                            color: a,
                            customColors: void 0
                        }, f[6] = a, f[7] = e) : e = f[7];
                        let i = m && 1 === j ? "red" : "gray";
                        f[8] !== i ? (t = {
                            color: i,
                            customColors: void 0
                        }, f[8] = i, f[9] = t) : t = f[9], f[10] !== t || f[11] !== e ? (r = [e, t], f[10] = t, f[11] = e, f[12] = r) : r = f[12], n = r;
                        break e
                    }
                    if (M === V.SportSlug.LIVE) {
                        let e, t, r, a, i, s = m && 0 === j ? "blue" : "gray";
                        f[13] !== m || f[14] !== j || f[15] !== c ? (e = m && 0 === j && c ? .customColors && { ...c
                        }, f[13] = m, f[14] = j, f[15] = c, f[16] = e) : e = f[16], f[17] !== s || f[18] !== e ? (t = {
                            color: s,
                            customColors: void 0,
                            ...e
                        }, f[17] = s, f[18] = e, f[19] = t) : t = f[19];
                        let o = m && 1 === j ? "blue" : "gray";
                        f[20] !== m || f[21] !== u || f[22] !== j ? (r = m && 1 === j && u ? .customColors && { ...u
                        }, f[20] = m, f[21] = u, f[22] = j, f[23] = r) : r = f[23], f[24] !== o || f[25] !== r ? (a = {
                            color: o,
                            customColors: void 0,
                            ...r
                        }, f[24] = o, f[25] = r, f[26] = a) : a = f[26], f[27] !== a || f[28] !== t ? (i = [t, a], f[27] = a, f[28] = t, f[29] = i) : i = f[29], n = i;
                        break e
                    }
                    f[30] !== m || f[31] !== j || f[32] !== c ? (i = m && 0 === j ? c : {
                        color: "gray",
                        customColors: void 0
                    }, f[30] = m, f[31] = j, f[32] = c, f[33] = i) : i = f[33],
                    f[34] !== m || f[35] !== u || f[36] !== j ? (s = m && 1 === j ? u : {
                        color: "gray",
                        customColors: void 0
                    }, f[34] = m, f[35] = u, f[36] = j, f[37] = s) : s = f[37],
                    f[38] !== i || f[39] !== s ? (o = [i, s], f[38] = i, f[39] = s, f[40] = o) : o = f[40],
                    n = o
                }
                let O = n;
                f[41] !== e.orderPriceMinTickSize || f[42] !== N || f[43] !== S ? (l = t => {
                    let r = t ? .["~zero"] ? .[S ? .toLowerCase()],
                        a = t ? .["~one"] ? .[S ? .toLowerCase()];
                    if (!r || !a) return [{
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }, {
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }];
                    let i = (0, W.getPrecisionFromTickSize)(e.orderPriceMinTickSize),
                        n = (0, h.showPaddedCentsOnly)(r, i),
                        s = (0, h.showPaddedCentsOnly)(a, i),
                        {
                            formatted: o
                        } = (0, Z.convertPrice)({
                            price: parseFloat(r),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: N
                        }),
                        {
                            formatted: l
                        } = (0, Z.convertPrice)({
                            price: parseFloat(a),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: N
                        });
                    return [{
                        formattedPrice: o,
                        paddedPrice: n,
                        price: r
                    }, {
                        formattedPrice: l,
                        paddedPrice: s,
                        price: a
                    }]
                }, f[41] = e.orderPriceMinTickSize, f[42] = N, f[43] = S, f[44] = l) : l = f[44];
                let D = l;
                f[45] !== A || f[46] !== I || f[47] !== _.slug || f[48] !== P || f[49] !== D || f[50] !== e || f[51] !== v || f[52] !== w || f[53] !== b || f[54] !== k || f[55] !== y || f[56] !== E ? (u = t => {
                    if (!I.current) return;
                    let {
                        mode: r,
                        side: a,
                        selectedOutcomeIdx: i
                    } = I.current, n = void 0 !== t ? t : i;
                    if ("desktop" === r) {
                        let t = (0, c.isTypeSharedByMultipleSportsMarkets)(e.sportsMarketType) ? e.slug : e.sportsMarketType;
                        v(e, {
                            eventSlug: _.slug,
                            variant: t,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        });
                        let {
                            paddedPrice: r
                        } = D(P(e))[n];
                        y(n), "string" == typeof r && (b(r), k("click")), w(!0)
                    } else {
                        let {
                            paddedPrice: t
                        } = D(P(e))[n], r = (0, c.isTypeSharedByMultipleSportsMarkets)(e.sportsMarketType) ? e.slug : e.sportsMarketType;
                        E ? .({
                            type: "trade",
                            side: a,
                            outcomeIdx: n,
                            market: e,
                            open: !0,
                            orderType: q.OrderType.Market,
                            price: t,
                            updatePriceLocation: !1
                        }), v(e, {
                            eventSlug: _.slug,
                            variant: r,
                            skipSetActiveMarket: !0,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        })
                    }
                    A.trackEvent(eR.Events.SportsTotalsClick, {
                        location: "smp",
                        market_type: e.sportsMarketType
                    })
                }, f[45] = A, f[46] = I, f[47] = _.slug, f[48] = P, f[49] = D, f[50] = e, f[51] = v, f[52] = w, f[53] = b, f[54] = k, f[55] = y, f[56] = E, f[57] = u) : u = f[57];
                let L = u;
                return f[58] !== D || f[59] !== T ? (m = D(T), f[58] = D, f[59] = T, f[60] = m) : m = f[60], f[61] !== O || f[62] !== L || f[63] !== m ? (p = {
                    colors: O,
                    prices: m,
                    onOutcomeClick: L
                }, f[61] = O, f[62] = L, f[63] = m, f[64] = p) : p = f[64], p
            })(I, O),
            {
                setTradeState: er
            } = (0, F.useMobileTradeContext)(),
            {
                setSportsCashOutState: ea,
                canRedeem: ei
            } = (0, R.useCashOutTxContext)(),
            en = (0, _.useSportsItemStore)(eU);
        N[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], N[0] = a) : a = N[0];
        let {
            event: es
        } = (0, u.useEventContext)(a), {
            slug: eo
        } = es;
        N[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], N[1] = i) : i = N[1];
        let {
            activeMarket: el
        } = (0, d.useEventActiveMarketContext)(i), ec = (0, o.useSetActiveSportsMarket)();
        N[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["selectedOutcomeIdx"], N[2] = n) : n = N[2];
        let {
            selectedOutcomeIdx: ed
        } = (0, U.useTradeContext)(n);
        N[3] !== ee ? (l = () => {
            ee(0)
        }, N[3] = ee, N[4] = l) : l = N[4];
        let eu = l;
        N[5] !== ee ? (m = () => {
            ee(1)
        }, N[5] = ee, N[6] = m) : m = N[6];
        let em = m;
        N[7] !== en ? (p = () => {
            en(!0)
        }, N[7] = en, N[8] = p) : p = N[8];
        let ep = p;
        N[9] !== en ? (x = () => {
            en(!1)
        }, N[9] = en, N[10] = x) : x = N[10];
        let eh = x,
            ex = H.closed || I.closed,
            {
                isClosed: eg
            } = {
                isClosed: ex,
                isFinished: ex || Q === V.GameState.Finished
            },
            ev = "card" === D ? 40 : 44,
            ey = "card" === D ? 4 : 5;
        N[11] === Symbol.for("react.memo_cache_sentinel") ? (v = {
            width: "100%"
        }, N[11] = v) : v = N[11], N[12] !== ev || N[13] !== ey ? (y = {
            hoverHeightOffset: 2,
            height: ev,
            shadowHeight: ey,
            maxWidth: "auto",
            css: v
        }, N[12] = ev, N[13] = ey, N[14] = y) : y = N[14];
        let eb = y;
        e: {
            let e, t = (0, c.isTypeSharedByMultipleSportsMarkets)(A) ? eo === H.slug && el.slug === I.slug : eo === H.slug && el.sportsMarketType === A;
            if ("mobile" === K && "in-game" === D) {
                let e;
                N[15] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    oneColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    active: !0,
                    preventDim: !0
                }, N[15] = e) : e = N[15], b = e;
                break e
            }
            if ("yes-no" === O || "odd-even" === O) {
                let e;
                if (t) {
                    let e;
                    N[16] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        zeroColors: {
                            color: "green",
                            customColors: void 0
                        },
                        oneColors: {
                            color: "red",
                            customColors: void 0
                        },
                        active: !0,
                        preventDim: !1
                    }, N[16] = e) : e = N[16], b = e;
                    break e
                }
                N[17] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    oneColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    active: !1,
                    preventDim: !1
                }, N[17] = e) : e = N[17], b = e;
                break e
            }
            if (t) {
                let e;
                N[18] !== et[0] || N[19] !== et[1] ? (e = {
                    zeroColors: et[0],
                    oneColors: et[1],
                    active: !0,
                    preventDim: !1
                }, N[18] = et[0], N[19] = et[1], N[20] = e) : e = N[20], b = e;
                break e
            }
            N[21] !== et[0] || N[22] !== et[1] ? (e = {
                zeroColors: et[0],
                oneColors: et[1],
                active: !1,
                preventDim: !1
            }, N[21] = et[0], N[22] = et[1], N[23] = e) : e = N[23],
            b = e
        }
        let {
            zeroColors: ek,
            oneColors: ew,
            active: eS,
            preventDim: ej
        } = b;
        N[24] === Symbol.for("react.memo_cache_sentinel") ? (k = [{
            type: "default",
            font: "small"
        }, {
            type: "default",
            font: "small"
        }], N[24] = k) : k = N[24];
        let eC = k;
        N[25] !== H.slug || N[26] !== K || N[27] !== X || N[28] !== ec || N[29] !== ea || N[30] !== er || N[31] !== A ? (w = e => {
            e.stopPropagation(), "mobile" === K ? (er ? .({
                type: "sports-redeem",
                market: X,
                sportsRedemptionType: A
            }), ec(X, {
                variant: A,
                eventSlug: H.slug,
                skipSetActiveMarket: !0,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })) : (ea({
                open: !0,
                mode: A
            }), ec(X, {
                variant: A,
                eventSlug: H.slug,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            }))
        }, N[25] = H.slug, N[26] = K, N[27] = X, N[28] = ec, N[29] = ea, N[30] = er, N[31] = A, N[32] = w) : w = N[32];
        let e_ = w;
        if (!Y) return null;
        if (eg && "in-game" === D && void 0 !== E && E && ei) {
            let e, r, a;
            return N[33] !== L ? (e = L("trading.redeem"), N[33] = L, N[34] = e) : e = N[34], N[35] !== e_ || N[36] !== e ? (r = (0, t.jsx)(z.TradingButton, {
                color: "blue",
                hoverHeightOffset: 2,
                height: 44,
                shadowHeight: 4,
                maxWidth: "100%",
                onClick: e_,
                children: e
            }), N[35] = e_, N[36] = e, N[37] = r) : r = N[37], N[38] !== ep || N[39] !== eh || N[40] !== r ? (a = (0, t.jsx)("div", {
                className: "flex @min-[490px]:justify-end items-center w-full",
                children: (0, t.jsx)("div", {
                    className: "flex w-full h-full items-center justify-end @min-[490px]:w-[125px]",
                    onPointerEnter: ep,
                    onPointerLeave: eh,
                    children: r
                })
            }), N[38] = ep, N[39] = eh, N[40] = r, N[41] = a) : a = N[41], a
        }
        if (eg && "in-game" === D) return null;
        let eT = `flex items-end gap-2 w-[258px] @max-[490px]:w-full ${"card"===D?"@min-[490px]:flex-col w-full":""}`,
            eM = `transition-opacity duration-100 flex-1 ${"card"===D?"w-full":""} ${"in-game"===D?"@min-[490px]:max-w-[125px]":""} ${!ej&&!eS?"opacity-80":""} ${!ej&&eS&&0!==ed?"opacity-60":""}`,
            eN = "odd-even" === O ? I.outcomes[0] ? ? "Odd" : "yes-no" === O ? "Yes" : Y[0] ? .abbreviation;
        N[42] !== eb || N[43] !== J[0] || N[44] !== eN || N[45] !== Y[0] || N[46] !== ek || N[47] !== eu ? (S = (0, t.jsx)(ef, {
            team: Y[0],
            onTap: eu,
            price: J[0],
            outcomeIndex: 0,
            animationMode: "arrows",
            priceMode: eC[0],
            label: eN,
            ...ek,
            ...eb
        }), N[42] = eb, N[43] = J[0], N[44] = eN, N[45] = Y[0], N[46] = ek, N[47] = eu, N[48] = S) : S = N[48], N[49] !== eM || N[50] !== S ? (j = (0, t.jsx)("span", {
            className: eM,
            children: S
        }), N[49] = eM, N[50] = S, N[51] = j) : j = N[51];
        let eI = `transition-opacity duration-100 flex-1 ${"card"===D?"w-full":""} ${"in-game"===D?"@min-[490px]:max-w-[125px]":""} ${!ej&&!eS?"opacity-80":""} ${!ej&&eS&&1!==ed?"opacity-60":""}`,
            eP = "odd-even" === O ? I.outcomes[1] ? ? "Even" : "yes-no" === O ? "No" : Y[1] ? .abbreviation;
        return N[52] !== eb || N[53] !== ew || N[54] !== em || N[55] !== J[1] || N[56] !== eP || N[57] !== Y[1] ? (C = (0, t.jsx)(ef, {
            team: Y[1],
            onTap: em,
            price: J[1],
            outcomeIndex: 1,
            animationMode: "arrows",
            priceMode: eC[1],
            label: eP,
            ...ew,
            ...eb
        }), N[52] = eb, N[53] = ew, N[54] = em, N[55] = J[1], N[56] = eP, N[57] = Y[1], N[58] = C) : C = N[58], N[59] !== eI || N[60] !== C ? (T = (0, t.jsx)("span", {
            className: eI,
            children: C
        }), N[59] = eI, N[60] = C, N[61] = T) : T = N[61], N[62] !== ep || N[63] !== eh || N[64] !== eT || N[65] !== j || N[66] !== T ? (M = (0, t.jsx)("div", {
            className: "flex @min-[490px]:justify-end items-center w-full",
            children: (0, t.jsxs)("div", {
                className: eT,
                onPointerEnter: ep,
                onPointerLeave: eh,
                children: [j, T]
            })
        }), N[62] = ep, N[63] = eh, N[64] = eT, N[65] = j, N[66] = T, N[67] = M) : M = N[67], M
    };

    function eU(e) {
        return e.setPreventAccordionHover
    }
    let eW = e => {
        let a, n, l, c, m, p, x, v, y, b, k, w, S, j, C, T, M, N = (0, r.c)(59),
            {
                market: I,
                view: P,
                hasNRFIPositions: E
            } = e,
            A = void 0 === P ? "in-game" : P,
            O = (0, f.useTranslations)(),
            {
                event: D,
                isNegRisk: L,
                mode: H,
                teams: K,
                gameState: Y,
                moneylineMarket: Q
            } = (0, g.useSportsItemContext)(),
            {
                prices: X,
                onOutcomeClick: J
            } = (e => {
                let {
                    activeMarket: t
                } = (0, d.useEventActiveMarketContext)(["activeMarket"]), a = (0, o.useSetActiveSportsMarket)(), {
                    setSelectedOutcomeIdx: n,
                    setPrice: l,
                    setPriceUpdateLocation: c,
                    setCursorActive: u,
                    side: m,
                    selectedOutcomeIdx: p
                } = (0, U.useTradeContext)(["setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side", "selectedOutcomeIdx"]), {
                    teams: f,
                    event: x
                } = (0, g.useSportsItemContext)(), v = (0, $.useMarketBestPrices)(e), y = (0, s.useSportsStoreSelector)("sportSlug"), {
                    oddsFormat: b
                } = (0, s.useOddsFormat)(), k = (() => {
                    let e, t, a = (0, r.c)(5),
                        {
                            mode: i
                        } = (0, g.useSportsItemContext)();
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
                    let {
                        side: n,
                        selectedOutcomeIdx: s
                    } = (0, U.useTradeContext)(e);
                    a[1] !== i || a[2] !== s || a[3] !== n ? (t = {
                        mode: i,
                        side: n,
                        selectedOutcomeIdx: s
                    }, a[1] = i, a[2] = s, a[3] = n, a[4] = t) : t = a[4];
                    let o = t;
                    return (0, B.useLatest)(o)
                })(), w = (0, $.useGetBestPrices)(), {
                    setTradeState: S
                } = (0, F.useMobileTradeContext)(), j = (0, eF.useAmplitudeAnalytics)(), C = i.default.useMemo(() => {
                    let r = G({
                            team: f ? .[0]
                        }),
                        a = G({
                            team: f ? .[1]
                        });
                    if (y === V.SportSlug.LIVE) {
                        let i = e.slug === t.slug;
                        return [{
                            color: i && 0 === p ? "blue" : "gray",
                            customColors: void 0,
                            ...i && 0 === p && r ? .customColors && { ...r
                            }
                        }, {
                            color: i && 1 === p ? "blue" : "gray",
                            customColors: void 0,
                            ...i && 1 === p && a ? .customColors && { ...a
                            }
                        }]
                    }
                    return [r, a]
                }, [f, y, e, t, p]), _ = i.default.useCallback(t => {
                    let r = t ? .["~zero"] ? .[m ? .toLowerCase()],
                        a = t ? .["~one"] ? .[m ? .toLowerCase()];
                    if (!r || !a) return [{
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }, {
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }];
                    let i = (0, W.getPrecisionFromTickSize)(e.orderPriceMinTickSize),
                        n = (0, h.showPaddedCentsOnly)(r, i),
                        s = (0, h.showPaddedCentsOnly)(a, i),
                        {
                            formatted: o
                        } = (0, Z.convertPrice)({
                            price: parseFloat(r),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: b
                        }),
                        {
                            formatted: l
                        } = (0, Z.convertPrice)({
                            price: parseFloat(a),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: b
                        });
                    return [{
                        formattedPrice: o,
                        paddedPrice: n,
                        price: r
                    }, {
                        formattedPrice: l,
                        paddedPrice: s,
                        price: a
                    }]
                }, [e, b, m]), T = i.default.useCallback(t => {
                    if (!k.current) return;
                    let {
                        mode: r,
                        side: i,
                        selectedOutcomeIdx: s
                    } = k.current, o = void 0 !== t ? t : s;
                    if ("desktop" === r) {
                        a(e, {
                            eventSlug: x.slug,
                            variant: "nrfi",
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        });
                        let {
                            paddedPrice: t
                        } = _(w(e))[o];
                        n(o), "string" == typeof t && (l(t), c("click")), u(!0)
                    } else {
                        let {
                            paddedPrice: t
                        } = _(w(e))[o];
                        S ? .({
                            type: "trade",
                            side: i,
                            outcomeIdx: o,
                            market: e,
                            open: !0,
                            orderType: q.OrderType.Market,
                            price: t,
                            updatePriceLocation: !1
                        }), a(e, {
                            eventSlug: x.slug,
                            variant: "nrfi",
                            skipSetActiveMarket: !0,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        })
                    }
                    j.trackEvent(eR.Events.SportsTotalsClick, {
                        location: "smp",
                        market_type: "nrfi"
                    })
                }, [a, u, l, c, n, S, _, j, k, e, x]);
                return i.default.useMemo(() => ({
                    colors: C,
                    prices: _(v),
                    onOutcomeClick: T
                }), [C, v, T, _])
            })(I),
            {
                setTradeState: ee
            } = (0, F.useMobileTradeContext)(),
            {
                setSportsCashOutState: et,
                canRedeem: er
            } = (0, R.useCashOutTxContext)(),
            ea = (0, _.useSportsItemStore)(eG);
        N[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], N[0] = a) : a = N[0];
        let {
            event: ei
        } = (0, u.useEventContext)(a), {
            slug: en
        } = ei;
        N[1] === Symbol.for("react.memo_cache_sentinel") ? (n = ["activeMarket"], N[1] = n) : n = N[1];
        let {
            activeMarket: es
        } = (0, d.useEventActiveMarketContext)(n), eo = (0, o.useSetActiveSportsMarket)();
        N[2] === Symbol.for("react.memo_cache_sentinel") ? (l = ["selectedOutcomeIdx"], N[2] = l) : l = N[2];
        let {
            selectedOutcomeIdx: el
        } = (0, U.useTradeContext)(l);
        N[3] !== J ? (c = () => {
            J(0)
        }, N[3] = J, N[4] = c) : c = N[4];
        let ec = c;
        N[5] !== J ? (m = () => {
            J(1)
        }, N[5] = J, N[6] = m) : m = N[6];
        let ed = m;
        N[7] !== ea ? (p = () => {
            ea(!0)
        }, N[7] = ea, N[8] = p) : p = N[8];
        let eu = p;
        N[9] !== ea ? (x = () => {
            ea(!1)
        }, N[9] = ea, N[10] = x) : x = N[10];
        let em = x,
            ep = D.closed || I.closed || L && D.markets.some(eZ),
            {
                isClosed: eh
            } = {
                isClosed: ep,
                isFinished: ep || Y === V.GameState.Finished
            },
            ex = "card" === A ? 40 : 44,
            eg = "card" === A ? 4 : 5;
        N[11] === Symbol.for("react.memo_cache_sentinel") ? (v = {
            width: "100%"
        }, N[11] = v) : v = N[11], N[12] !== ex || N[13] !== eg ? (y = {
            hoverHeightOffset: 2,
            height: ex,
            shadowHeight: eg,
            maxWidth: "auto",
            css: v
        }, N[12] = ex, N[13] = eg, N[14] = y) : y = N[14];
        let ev = y;
        e: {
            let e, t = en === D.slug && "nrfi" === es.sportsMarketType;
            if ("mobile" === H && "in-game" === A) {
                let e;
                N[15] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    oneColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    nrfiActive: !0,
                    preventDim: !0
                }, N[15] = e) : e = N[15], b = e;
                break e
            }
            if (t) {
                let e;
                N[16] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "green",
                        customColors: void 0
                    },
                    oneColors: {
                        color: "red",
                        customColors: void 0
                    },
                    nrfiActive: !0,
                    preventDim: !1
                }, N[16] = e) : e = N[16], b = e;
                break e
            }
            N[17] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                zeroColors: {
                    color: "gray",
                    customColors: void 0
                },
                oneColors: {
                    color: "gray",
                    customColors: void 0
                },
                nrfiActive: !1,
                preventDim: !1
            }, N[17] = e) : e = N[17],
            b = e
        }
        let {
            zeroColors: ey,
            oneColors: eb,
            nrfiActive: ek,
            preventDim: ew
        } = b;
        N[18] === Symbol.for("react.memo_cache_sentinel") ? (k = [{
            type: "default",
            font: "small"
        }, {
            type: "default",
            font: "small"
        }], N[18] = k) : k = N[18];
        let eS = k;
        N[19] !== D.slug || N[20] !== H || N[21] !== Q || N[22] !== eo || N[23] !== et || N[24] !== ee ? (w = e => {
            e.stopPropagation(), "mobile" === H ? (ee ? .({
                type: "sports-redeem",
                market: Q,
                sportsRedemptionType: "nrfi"
            }), eo(Q, {
                variant: "nrfi",
                eventSlug: D.slug,
                skipSetActiveMarket: !0,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })) : (et({
                open: !0,
                mode: "nrfi"
            }), eo(Q, {
                variant: "nrfi",
                eventSlug: D.slug,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            }))
        }, N[19] = D.slug, N[20] = H, N[21] = Q, N[22] = eo, N[23] = et, N[24] = ee, N[25] = w) : w = N[25];
        let ej = w;
        if (!K) return null;
        if (eh && "in-game" === A && void 0 !== E && E && er) {
            let e, r, a;
            return N[26] !== O ? (e = O("trading.redeem"), N[26] = O, N[27] = e) : e = N[27], N[28] !== ej || N[29] !== e ? (r = (0, t.jsx)(z.TradingButton, {
                color: "blue",
                hoverHeightOffset: 2,
                height: 44,
                shadowHeight: 4,
                maxWidth: "100%",
                onClick: ej,
                children: e
            }), N[28] = ej, N[29] = e, N[30] = r) : r = N[30], N[31] !== eu || N[32] !== em || N[33] !== r ? (a = (0, t.jsx)("div", {
                className: "flex @min-[490px]:justify-end items-center w-full",
                children: (0, t.jsx)("div", {
                    className: "flex w-full h-full items-center justify-end @min-[490px]:w-[125px]",
                    onPointerEnter: eu,
                    onPointerLeave: em,
                    children: r
                })
            }), N[31] = eu, N[32] = em, N[33] = r, N[34] = a) : a = N[34], a
        }
        if (eh && "in-game" === A) return null;
        let eC = `flex items-end gap-2 w-[258px] @max-[490px]:w-full ${"card"===A?"@min-[490px]:flex-col w-full":""}`,
            e_ = `transition-opacity duration-100 flex-1 ${"card"===A?"w-full":""} ${"in-game"===A?"@min-[490px]:max-w-[125px]":""} ${!ew&&!ek?"opacity-80":""} ${!ew&&ek&&0!==el?"opacity-60":""}`;
        N[35] !== ev || N[36] !== X[0] || N[37] !== K[0] || N[38] !== ey || N[39] !== ec ? (S = (0, t.jsx)(ef, {
            team: K[0],
            onTap: ec,
            price: X[0],
            outcomeIndex: 0,
            animationMode: "arrows",
            priceMode: eS[0],
            label: "Yes",
            ...ey,
            ...ev
        }), N[35] = ev, N[36] = X[0], N[37] = K[0], N[38] = ey, N[39] = ec, N[40] = S) : S = N[40], N[41] !== e_ || N[42] !== S ? (j = (0, t.jsx)("span", {
            className: e_,
            children: S
        }), N[41] = e_, N[42] = S, N[43] = j) : j = N[43];
        let eT = `transition-opacity duration-100 flex-1 ${"card"===A?"w-full":""} ${"in-game"===A?"@min-[490px]:max-w-[125px]":""} ${!ew&&!ek?"opacity-80":""} ${!ew&&ek&&1!==el?"opacity-60":""}`;
        return N[44] !== ev || N[45] !== eb || N[46] !== ed || N[47] !== X[1] || N[48] !== K[1] ? (C = (0, t.jsx)(ef, {
            team: K[1],
            onTap: ed,
            price: X[1],
            outcomeIndex: 1,
            animationMode: "arrows",
            priceMode: eS[1],
            label: "No",
            ...eb,
            ...ev
        }), N[44] = ev, N[45] = eb, N[46] = ed, N[47] = X[1], N[48] = K[1], N[49] = C) : C = N[49], N[50] !== eT || N[51] !== C ? (T = (0, t.jsx)("span", {
            className: eT,
            children: C
        }), N[50] = eT, N[51] = C, N[52] = T) : T = N[52], N[53] !== eu || N[54] !== em || N[55] !== eC || N[56] !== j || N[57] !== T ? (M = (0, t.jsx)("div", {
            className: "flex @min-[490px]:justify-end items-center w-full",
            children: (0, t.jsxs)("div", {
                className: eC,
                onPointerEnter: eu,
                onPointerLeave: em,
                children: [j, T]
            })
        }), N[53] = eu, N[54] = em, N[55] = eC, N[56] = j, N[57] = T, N[58] = M) : M = N[58], M
    };

    function eG(e) {
        return e.setPreventAccordionHover
    }

    function eZ(e) {
        return e.closed
    }
    var eK = e.i(184612);

    function eY(e) {
        let a, n, l, c, m, p, x, v, y, b, k, w, j, C, T, M, N, I, P, E, A, O, D, L, H, G, K = (0, r.c)(107),
            {
                market: Y,
                view: Q,
                hasParlayPositions: X
            } = e,
            J = void 0 === Q ? "in-game" : Q,
            ee = (0, f.useTranslations)(),
            {
                event: et,
                isNegRisk: er,
                mode: ea,
                gameState: ei,
                moneylineMarket: en
            } = (0, g.useSportsItemContext)(),
            {
                price: es,
                onOutcomeClick: eo,
                colors: el
            } = (e => {
                let {
                    activeMarket: t
                } = (0, d.useEventActiveMarketContext)(["activeMarket"]), a = (0, o.useSetActiveSportsMarket)(), {
                    setSelectedOutcomeIdx: n,
                    setPrice: l,
                    setPriceUpdateLocation: c,
                    setCursorActive: u,
                    side: m,
                    selectedOutcomeIdx: p
                } = (0, U.useTradeContext)(["setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side", "selectedOutcomeIdx"]), {
                    event: f
                } = (0, g.useSportsItemContext)(), x = (0, $.useMarketBestPrices)(e), {
                    oddsFormat: v
                } = (0, s.useOddsFormat)(), y = (() => {
                    let e, t, a = (0, r.c)(5),
                        {
                            mode: i
                        } = (0, g.useSportsItemContext)();
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
                    let {
                        side: n,
                        selectedOutcomeIdx: s
                    } = (0, U.useTradeContext)(e);
                    a[1] !== i || a[2] !== s || a[3] !== n ? (t = {
                        mode: i,
                        side: n,
                        selectedOutcomeIdx: s
                    }, a[1] = i, a[2] = s, a[3] = n, a[4] = t) : t = a[4];
                    let o = t;
                    return (0, B.useLatest)(o)
                })(), b = (0, eL.useBoundBookStore)(), {
                    setTradeState: k
                } = (0, F.useMobileTradeContext)(), w = (0, eF.useAmplitudeAnalytics)(), S = i.default.useMemo(() => ({
                    color: e.slug === t.slug && 0 === p ? "green" : "gray",
                    customColors: void 0
                }), [e.slug, t.slug, p]), j = i.default.useCallback(t => {
                    let r = t ? .["~zero"] ? .[m ? .toLowerCase()];
                    if (!r) return {
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    };
                    let a = (0, W.getPrecisionFromTickSize)(e.orderPriceMinTickSize),
                        i = (0, h.showPaddedCentsOnly)(r, a),
                        {
                            formatted: n
                        } = (0, Z.convertPrice)({
                            price: parseFloat(r),
                            precision: a,
                            inputMode: "decimal",
                            outputMode: v
                        });
                    return {
                        formattedPrice: n,
                        paddedPrice: i,
                        price: r
                    }
                }, [v, m]), C = i.default.useCallback(() => {
                    if (!y.current) return;
                    let {
                        mode: t
                    } = y.current, r = e.slug;
                    if ("desktop" === t) {
                        a(e, {
                            eventSlug: f.slug,
                            variant: r,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        });
                        let t = e.clobTokenIds ? .[0] ? .toLowerCase ? .() ? ? "",
                            {
                                paddedPrice: i
                            } = j(b.getState().byAsset[t] ? .views[String(e.orderPriceMinTickSize)] ? .bestPrices);
                        n(0), "string" == typeof i && (l(i), c("click")), u(!0)
                    } else {
                        let t = e.clobTokenIds ? .[0] ? .toLowerCase ? .() ? ? "",
                            {
                                paddedPrice: i
                            } = j(b.getState().byAsset[t] ? .views[String(e.orderPriceMinTickSize)] ? .bestPrices);
                        k ? .({
                            type: "trade",
                            side: m,
                            outcomeIdx: 0,
                            market: e,
                            open: !0,
                            orderType: q.OrderType.Market,
                            price: i,
                            updatePriceLocation: !1
                        }), a(e, {
                            eventSlug: f.slug,
                            variant: r,
                            skipSetActiveMarket: !0,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        })
                    }
                    w.trackEvent(eR.Events.SportsTotalsClick, {
                        location: "smp",
                        market_type: e.sportsMarketType ? ? "parlays"
                    })
                }, [a, u, l, c, n, k, j, w, b, y, e, f.slug, m]);
                return i.default.useMemo(() => ({
                    colors: S,
                    price: j(x),
                    onOutcomeClick: C
                }), [S, x, C, j])
            })(Y),
            {
                setTradeState: ec
            } = (0, F.useMobileTradeContext)(),
            {
                setSportsCashOutState: ed,
                canRedeem: eu
            } = (0, R.useCashOutTxContext)(),
            em = (0, _.useSportsItemStore)(eX);
        K[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], K[0] = a) : a = K[0];
        let {
            event: ep
        } = (0, u.useEventContext)(a), {
            slug: eh
        } = ep;
        K[1] === Symbol.for("react.memo_cache_sentinel") ? (n = ["activeMarket"], K[1] = n) : n = K[1];
        let {
            activeMarket: ef
        } = (0, d.useEventActiveMarketContext)(n), ex = (0, o.useSetActiveSportsMarket)();
        K[2] !== eo ? (l = () => {
            eo()
        }, K[2] = eo, K[3] = l) : l = K[3];
        let eg = l;
        K[4] !== em ? (c = () => {
            em(!0)
        }, K[4] = em, K[5] = c) : c = K[5];
        let ev = c;
        K[6] !== em ? (m = () => {
            em(!1)
        }, K[6] = em, K[7] = m) : m = K[7];
        let ey = m,
            eb = et.closed || Y.closed || er && et.markets.some(eQ),
            {
                isClosed: ek
            } = {
                isClosed: eb,
                isFinished: eb || ei === V.GameState.Finished
            },
            ew = "card" === J ? 40 : 44,
            eS = "card" === J ? 4 : 5;
        K[8] === Symbol.for("react.memo_cache_sentinel") ? (p = {
            width: "100%"
        }, K[8] = p) : p = K[8], K[9] !== eS || K[10] !== ew ? (x = {
            hoverHeightOffset: 2,
            height: ew,
            shadowHeight: eS,
            maxWidth: "auto",
            css: p
        }, K[9] = eS, K[10] = ew, K[11] = x) : x = K[11];
        let ej = x;
        e: {
            let e, t = "parlays" === Y.sportsMarketType,
                r = eh === et.slug && t && ef.slug === Y.slug;
            if ("mobile" === ea && "in-game" === J) {
                let e;
                K[12] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    parlayActive: !0,
                    preventDim: !0
                }, K[12] = e) : e = K[12], v = e;
                break e
            }
            if (r) {
                let e;
                K[13] !== el ? (e = {
                    zeroColors: el,
                    parlayActive: !0,
                    preventDim: !1
                }, K[13] = el, K[14] = e) : e = K[14], v = e;
                break e
            }
            K[15] !== el ? (e = {
                zeroColors: el,
                parlayActive: !1,
                preventDim: !1
            }, K[15] = el, K[16] = e) : e = K[16],
            v = e
        }
        let {
            zeroColors: eC,
            parlayActive: e_,
            preventDim: eT
        } = v;
        K[17] !== et.slug || K[18] !== Y.slug || K[19] !== Y.sportsMarketType || K[20] !== ea || K[21] !== en || K[22] !== ex || K[23] !== ed || K[24] !== ec ? (y = e => {
            e.stopPropagation();
            let t = Y.slug,
                r = Y.sportsMarketType ? ? "parlays";
            "mobile" === ea ? (ec ? .({
                type: "sports-redeem",
                market: en,
                sportsRedemptionType: r
            }), ex(en, {
                variant: t,
                eventSlug: et.slug,
                skipSetActiveMarket: !0,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })) : (ed({
                open: !0,
                mode: r
            }), ex(en, {
                variant: t,
                eventSlug: et.slug,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            }))
        }, K[17] = et.slug, K[18] = Y.slug, K[19] = Y.sportsMarketType, K[20] = ea, K[21] = en, K[22] = ex, K[23] = ed, K[24] = ec, K[25] = y) : y = K[25];
        let eM = y;
        if (K[26] !== Y.outcomePrices ? .[0] || K[27] !== Y.question) {
            t: {
                let e, t, r = Y.question || "",
                    a = r.split(" - "),
                    i = parseFloat(Y.outcomePrices ? .[0] || "0");K[29] !== i ? (e = i > 0 ? Math.round(10 / i) : 0, K[29] = i, K[30] = e) : e = K[30];
                let n = e,
                    s = `$10 → $${n}`;
                if (a.length >= 2) {
                    b = {
                        titleLine1: a[0].trim(),
                        titleLine2: a.slice(1).join(" - ").trim(),
                        payoutText: s
                    };
                    break t
                }
                K[31] !== s || K[32] !== r ? (t = {
                    titleLine1: r,
                    titleLine2: "",
                    payoutText: s
                }, K[31] = s, K[32] = r, K[33] = t) : t = K[33],
                b = t
            }
            K[26] = Y.outcomePrices ? .[0],
            K[27] = Y.question,
            K[28] = b
        }
        else b = K[28];
        let {
            titleLine1: eN,
            titleLine2: eI,
            payoutText: eP
        } = b;
        if (ek && "in-game" === J && void 0 !== X && X && eu) {
            let e, r, a, i, n, s, o, l, c, d, u;
            return K[34] !== Y.icon ? (e = Y.icon && (0, t.jsx)("div", {
                className: "size-8 rounded-sm overflow-hidden relative flex-shrink-0",
                children: (0, t.jsx)(eK.default, {
                    src: Y.icon,
                    alt: "",
                    fill: !0,
                    style: {
                        objectFit: "contain"
                    }
                })
            }), K[34] = Y.icon, K[35] = e) : e = K[35], K[36] !== eN ? (r = (0, t.jsx)("p", {
                className: "text-sm font-semibold text-text-primary truncate",
                children: eN
            }), K[36] = eN, K[37] = r) : r = K[37], K[38] !== eP ? (a = (0, t.jsx)("p", {
                className: "text-xs font-medium text-text-secondary whitespace-nowrap",
                children: eP
            }), K[38] = eP, K[39] = a) : a = K[39], K[40] !== r || K[41] !== a ? (i = (0, t.jsxs)("div", {
                className: "flex items-center gap-2",
                children: [r, a]
            }), K[40] = r, K[41] = a, K[42] = i) : i = K[42], K[43] !== eI ? (n = eI && (0, t.jsx)("p", {
                className: "text-xs text-text-secondary break-words",
                children: eI
            }), K[43] = eI, K[44] = n) : n = K[44], K[45] !== i || K[46] !== n ? (s = (0, t.jsxs)("div", {
                className: "flex flex-col flex-1 min-w-0",
                children: [i, n]
            }), K[45] = i, K[46] = n, K[47] = s) : s = K[47], K[48] !== e || K[49] !== s ? (o = (0, t.jsxs)("div", {
                className: "flex items-center gap-2 flex-1",
                children: [e, s]
            }), K[48] = e, K[49] = s, K[50] = o) : o = K[50], K[51] !== ee ? (l = ee("trading.redeem"), K[51] = ee, K[52] = l) : l = K[52], K[53] !== eM || K[54] !== l ? (c = (0, t.jsx)(z.TradingButton, {
                color: "blue",
                hoverHeightOffset: 2,
                height: 44,
                shadowHeight: 4,
                maxWidth: "100%",
                onClick: eM,
                children: l
            }), K[53] = eM, K[54] = l, K[55] = c) : c = K[55], K[56] !== ev || K[57] !== ey || K[58] !== c ? (d = (0, t.jsx)("div", {
                className: "flex w-full h-full items-center justify-end @min-[490px]:w-[125px]",
                onPointerEnter: ev,
                onPointerLeave: ey,
                children: c
            }), K[56] = ev, K[57] = ey, K[58] = c, K[59] = d) : d = K[59], K[60] !== o || K[61] !== d ? (u = (0, t.jsxs)("div", {
                className: "flex items-center w-full gap-3",
                children: [o, d]
            }), K[60] = o, K[61] = d, K[62] = u) : u = K[62], u
        }
        if (ek && "in-game" === J) return null;
        K[63] !== Y.icon ? (k = Y.icon && (0, t.jsx)("div", {
            className: "size-8 rounded-sm overflow-hidden relative flex-shrink-0",
            children: (0, t.jsx)(eK.default, {
                src: Y.icon,
                alt: "",
                fill: !0,
                style: {
                    objectFit: "contain"
                }
            })
        }), K[63] = Y.icon, K[64] = k) : k = K[64], K[65] !== eN ? (w = (0, t.jsx)("p", {
            className: "text-sm font-semibold text-text-primary truncate",
            children: eN
        }), K[65] = eN, K[66] = w) : w = K[66], K[67] !== eP ? (j = (0, t.jsx)("p", {
            className: "text-xs font-medium text-text-secondary whitespace-nowrap",
            children: eP
        }), K[67] = eP, K[68] = j) : j = K[68], K[69] !== w || K[70] !== j ? (C = (0, t.jsxs)("div", {
            className: "flex items-center gap-2",
            children: [w, j]
        }), K[69] = w, K[70] = j, K[71] = C) : C = K[71], K[72] !== eI ? (T = eI && (0, t.jsx)("p", {
            className: "text-xs text-text-secondary break-words",
            children: eI
        }), K[72] = eI, K[73] = T) : T = K[73], K[74] !== C || K[75] !== T ? (M = (0, t.jsxs)("div", {
            className: "flex flex-col flex-1 gap-y-0.5 min-w-0",
            children: [C, T]
        }), K[74] = C, K[75] = T, K[76] = M) : M = K[76], K[77] !== k || K[78] !== M ? (N = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 flex-1",
            children: [k, M]
        }), K[77] = k, K[78] = M, K[79] = N) : N = K[79];
        let eE = "card" === J && "w-full";
        K[80] !== eE ? (I = (0, S.cn)("flex items-center w-[131px]", eE), K[80] = eE, K[81] = I) : I = K[81];
        let eA = !eT && !e_ && "opacity-80";
        return K[82] !== eA ? (P = (0, S.cn)("transition-opacity duration-100 w-full", eA), K[82] = eA, K[83] = P) : P = K[83], K[84] !== Y.outcomes[0] ? (E = (0, t.jsx)("span", {
            className: "font-semibold",
            children: Y.outcomes[0]
        }), K[84] = Y.outcomes[0], K[85] = E) : E = K[85], K[86] !== es.formattedPrice ? (A = (0, t.jsx)("span", {
            className: "font-semibold",
            children: es.formattedPrice
        }), K[86] = es.formattedPrice, K[87] = A) : A = K[87], K[88] !== E || K[89] !== A ? (O = (0, t.jsxs)("span", {
            className: "flex items-center justify-center gap-1",
            children: [E, A]
        }), K[88] = E, K[89] = A, K[90] = O) : O = K[90], K[91] !== ej || K[92] !== eg || K[93] !== O || K[94] !== eC ? (D = (0, t.jsx)(z.TradingButton, {
            onClick: eg,
            ...eC,
            ...ej,
            children: O
        }), K[91] = ej, K[92] = eg, K[93] = O, K[94] = eC, K[95] = D) : D = K[95], K[96] !== P || K[97] !== D ? (L = (0, t.jsx)("span", {
            className: P,
            children: D
        }), K[96] = P, K[97] = D, K[98] = L) : L = K[98], K[99] !== ev || K[100] !== ey || K[101] !== I || K[102] !== L ? (H = (0, t.jsx)("div", {
            className: I,
            onPointerEnter: ev,
            onPointerLeave: ey,
            children: L
        }), K[99] = ev, K[100] = ey, K[101] = I, K[102] = L, K[103] = H) : H = K[103], K[104] !== N || K[105] !== H ? (G = (0, t.jsxs)("div", {
            className: "flex items-center w-full gap-3",
            children: [N, H]
        }), K[104] = N, K[105] = H, K[106] = G) : G = K[106], G
    }

    function eQ(e) {
        return e.closed
    }

    function eX(e) {
        return e.setPreventAccordionHover
    }
    e.s(["MarketSpreadButtons", () => e3], 255128);
    var eJ = e.i(935786);
    let e0 = ({
            team: e,
            marketTypeActive: t,
            dimOnInactive: r,
            mode: a
        }) => "mobile" === a ? {
            colors: {
                color: "gray",
                customColors: void 0
            },
            preventDim: !0
        } : !t && r && "desktop" === a ? {
            colors: {
                color: "gray",
                customColors: void 0
            },
            preventDim: !1
        } : {
            colors: G({
                team: e
            }),
            preventDim: !1
        },
        e1 = (e, t, a, i, n) => {
            let s, o, c, m, p = (0, r.c)(24),
                h = void 0 === i ? "desktop" : i,
                f = void 0 === n || n;
            p[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["event"], p[0] = s) : s = p[0];
            let {
                event: x
            } = (0, u.useEventContext)(s), {
                slug: g
            } = x;
            p[1] === Symbol.for("react.memo_cache_sentinel") ? (o = ["selectedOutcomeIdx"], p[1] = o) : o = p[1];
            let {
                selectedOutcomeIdx: v
            } = (0, U.useTradeContext)(o);
            p[2] === Symbol.for("react.memo_cache_sentinel") ? (c = ["activeMarket"], p[2] = c) : c = p[2];
            let {
                activeMarket: y
            } = (0, d.useEventActiveMarketContext)(c);
            if (p[3] !== g || p[4] !== y.sportsMarketType || p[5] !== f || p[6] !== e.slug || p[7] !== t || p[8] !== h || p[9] !== a || p[10] !== v) {
                e: {
                    let r, i, n = e.slug === g && (y.sportsMarketType ? ? "moneyline") === (t.sportsMarketType ? ? "moneyline"),
                        s = (0, l.getTeam)({
                            market: t,
                            outcomeIndex: a
                        });
                    if (s) {
                        let e, r = t.invertOutcomesVisually;
                        p[12] !== t || p[13] !== a ? (e = (0, l.getTeamLabelWithLine)({
                            market: t,
                            outcomeIndex: a,
                            variant: "abbreviation"
                        }), p[12] = t, p[13] = a, p[14] = e) : e = p[14], m = {
                            team: s,
                            outcomeIndex: a,
                            order: t.invertOutcomesVisually ? (a + 1) % 2 + 1 : a + 1,
                            isInverted: r,
                            label: e,
                            marketTypeActive: n,
                            ...e0({
                                team: s,
                                marketTypeActive: n,
                                dimOnInactive: f,
                                mode: h
                            })
                        };
                        break e
                    }
                    let o = v === a;p[15] !== f || p[16] !== n || p[17] !== h ? (r = e0({
                        team: void 0,
                        marketTypeActive: n,
                        dimOnInactive: f,
                        mode: h
                    }), p[15] = f, p[16] = n, p[17] = h, p[18] = r) : r = p[18],
                    p[19] !== n || p[20] !== a || p[21] !== o || p[22] !== r ? (i = {
                        team: void 0,
                        outcomeIndex: a,
                        order: a,
                        isInverted: !1,
                        label: void 0,
                        marketTypeActive: n,
                        outcomeActive: o,
                        ...r
                    }, p[19] = n, p[20] = a, p[21] = o, p[22] = r, p[23] = i) : i = p[23],
                    m = i
                }
                p[3] = g,
                p[4] = y.sportsMarketType,
                p[5] = f,
                p[6] = e.slug,
                p[7] = t,
                p[8] = h,
                p[9] = a,
                p[10] = v,
                p[11] = m
            }
            else m = p[11];
            return m
        };

    function e2(e) {
        return (e || "").toUpperCase().replace(/[^A-Z0-9]/g, "")
    }
    let e3 = e => {
        let a, n, d, u, m, p, x, v, y, b, k, w, S, j, C, T, M = (0, r.c)(71),
            {
                market: N,
                view: I,
                hasSpreadPositions: P,
                variant: E
            } = e,
            A = void 0 === I ? "in-game" : I,
            O = void 0 === E ? "spreads" : E,
            D = (0, f.useTranslations)(),
            {
                event: L,
                isNegRisk: H,
                mode: G,
                gameState: K,
                moneylineMarket: Y,
                teams: Q
            } = (0, g.useSportsItemContext)(),
            X = ((e, t) => {
                let a, i, n, l, c, d, u, m, p, f = (0, r.c)(37),
                    x = void 0 === t ? "spreads" : t,
                    v = (0, o.useSetActiveSportsMarket)();
                f[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side"], f[0] = a) : a = f[0];
                let {
                    setSelectedOutcomeIdx: y,
                    setPrice: b,
                    setPriceUpdateLocation: k,
                    setCursorActive: w,
                    side: S
                } = (0, U.useTradeContext)(a), {
                    event: j,
                    mode: C
                } = (0, g.useSportsItemContext)(), _ = (0, $.useMarketBestPrices)(e), {
                    oddsFormat: T
                } = (0, s.useOddsFormat)(), M = e1(j, e, 0, C), N = e1(j, e, 1, C), I = (() => {
                    let e, t, a = (0, r.c)(5),
                        {
                            mode: i
                        } = (0, g.useSportsItemContext)();
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
                    let {
                        side: n,
                        selectedOutcomeIdx: s
                    } = (0, U.useTradeContext)(e);
                    a[1] !== i || a[2] !== s || a[3] !== n ? (t = {
                        mode: i,
                        side: n,
                        selectedOutcomeIdx: s
                    }, a[1] = i, a[2] = s, a[3] = n, a[4] = t) : t = a[4];
                    let o = t;
                    return (0, B.useLatest)(o)
                })(), P = (0, $.useGetBestPrices)(), {
                    setTradeState: E
                } = (0, F.useMobileTradeContext)(), A = (0, eF.useAmplitudeAnalytics)();
                f[1] !== e.orderPriceMinTickSize || f[2] !== T || f[3] !== S ? (i = t => {
                    let r = t ? .["~zero"] ? .[S ? .toLowerCase()],
                        a = t ? .["~one"] ? .[S ? .toLowerCase()];
                    if (!r || !a) return [{
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }, {
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }];
                    let i = (0, W.getPrecisionFromTickSize)(e.orderPriceMinTickSize),
                        n = (0, h.showPaddedCentsOnly)(r, i),
                        s = (0, h.showPaddedCentsOnly)(a, i),
                        {
                            formatted: o
                        } = (0, Z.convertPrice)({
                            price: parseFloat(r),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: T
                        }),
                        {
                            formatted: l
                        } = (0, Z.convertPrice)({
                            price: parseFloat(a),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: T
                        });
                    return [{
                        formattedPrice: o,
                        paddedPrice: n,
                        price: r
                    }, {
                        formattedPrice: l,
                        paddedPrice: s,
                        price: a
                    }]
                }, f[1] = e.orderPriceMinTickSize, f[2] = T, f[3] = S, f[4] = i) : i = f[4];
                let O = i;
                f[5] !== A || f[6] !== I || f[7] !== j.slug || f[8] !== P || f[9] !== O || f[10] !== e || f[11] !== v || f[12] !== w || f[13] !== b || f[14] !== k || f[15] !== y || f[16] !== E || f[17] !== x ? (n = t => {
                    if (!I.current) return;
                    let {
                        mode: r,
                        side: a,
                        selectedOutcomeIdx: i
                    } = I.current, n = void 0 !== t ? t : i;
                    if ("desktop" === r) {
                        v(e, {
                            variant: x,
                            eventSlug: j.slug,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        });
                        let {
                            paddedPrice: t
                        } = O(P(e))[n];
                        y(n), "string" == typeof t && (b(t), k("click")), w(!0)
                    } else {
                        let {
                            paddedPrice: t
                        } = O(P(e))[n];
                        E ? .({
                            type: "trade",
                            side: a,
                            outcomeIdx: n,
                            market: e,
                            open: !0,
                            orderType: q.OrderType.Market,
                            price: t,
                            updatePriceLocation: !1
                        }), v(e, {
                            eventSlug: j.slug,
                            variant: x,
                            skipSetActiveMarket: !0,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        })
                    }
                    A.trackEvent(eR.Events.SportsSpreadsClick, {
                        location: "smp"
                    })
                }, f[5] = A, f[6] = I, f[7] = j.slug, f[8] = P, f[9] = O, f[10] = e, f[11] = v, f[12] = w, f[13] = b, f[14] = k, f[15] = y, f[16] = E, f[17] = x, f[18] = n) : n = f[18];
                let D = n;
                f[19] !== O || f[20] !== _ ? (l = O(_), f[19] = O, f[20] = _, f[21] = l) : l = f[21];
                let L = l;
                f[22] !== D ? (c = () => D(0), f[22] = D, f[23] = c) : c = f[23];
                let z = L ? .[0];
                f[24] !== c || f[25] !== z || f[26] !== M ? (d = { ...M,
                    onClick: c,
                    price: z
                }, f[24] = c, f[25] = z, f[26] = M, f[27] = d) : d = f[27], f[28] !== D ? (u = () => D(1), f[28] = D, f[29] = u) : u = f[29];
                let R = L ? .[1];
                return f[30] !== N || f[31] !== u || f[32] !== R ? (m = { ...N,
                    onClick: u,
                    price: R
                }, f[30] = N, f[31] = u, f[32] = R, f[33] = m) : m = f[33], f[34] !== m || f[35] !== d ? (p = [d, m], f[34] = m, f[35] = d, f[36] = p) : p = f[36], p
            })(N, O),
            {
                setTradeState: J
            } = (0, F.useMobileTradeContext)(),
            {
                setSportsCashOutState: ee,
                canRedeem: et
            } = (0, R.useCashOutTxContext)(),
            er = (0, o.useSetActiveSportsMarket)(),
            ea = (0, _.useSportsItemStore)(e4);
        M[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["selectedOutcomeIdx"], M[0] = a) : a = M[0];
        let {
            selectedOutcomeIdx: ei
        } = (0, U.useTradeContext)(a);
        M[1] !== ea ? (n = () => {
            ea(!0)
        }, M[1] = ea, M[2] = n) : n = M[2];
        let en = n;
        M[3] !== ea ? (d = () => {
            ea(!1)
        }, M[3] = ea, M[4] = d) : d = M[4];
        let es = d,
            eo = L.closed || N.closed || H && L.markets.some(e5),
            {
                isClosed: el
            } = {
                isClosed: eo,
                isFinished: eo || K === V.GameState.Finished
            },
            ec = "card" === A,
            ed = ec ? H ? 58 : 40 : 44,
            eu = ec ? H ? 5 : 4 : 5;
        M[5] === Symbol.for("react.memo_cache_sentinel") ? (u = {
            minWidth: 0
        }, M[5] = u) : u = M[5], M[6] !== ed || M[7] !== eu ? (m = {
            hoverHeightOffset: 2,
            height: ed,
            shadowHeight: eu,
            maxWidth: "auto",
            className: "w-full",
            style: u
        }, M[6] = ed, M[7] = eu, M[8] = m) : m = M[8];
        let em = m;
        M[9] !== N ? (p = (0, l.getSpreadLineForOutcome)({
            market: N,
            outcomeIndex: 0
        }), M[9] = N, M[10] = p) : p = M[10];
        let ep = p;
        M[11] !== N ? (x = (0, l.getSpreadLineForOutcome)({
            market: N,
            outcomeIndex: 1
        }), M[11] = N, M[12] = x) : x = M[12];
        let eh = x,
            ex = N.line ? ? 0,
            eg = void 0 !== ep ? ep : ex;
        M[13] !== eg ? (v = {
            type: "spread",
            line: eg,
            font: "small"
        }, M[13] = eg, M[14] = v) : v = M[14];
        let ev = void 0 !== eh ? eh : -1 * ex;
        M[15] !== ev ? (y = {
            type: "spread",
            line: ev,
            font: "small"
        }, M[15] = ev, M[16] = y) : y = M[16], M[17] !== v || M[18] !== y ? (b = [v, y], M[17] = v, M[18] = y, M[19] = b) : b = M[19];
        let ey = b;
        M[20] !== L.slug || M[21] !== G || M[22] !== Y || M[23] !== er || M[24] !== ee || M[25] !== J || M[26] !== O ? (k = e => {
            e.stopPropagation(), (0, c.isSpreadMarket)(O) && ("mobile" === G ? (J ? .({
                type: "sports-redeem",
                market: Y,
                sportsRedemptionType: O
            }), er(Y, {
                variant: O,
                eventSlug: L.slug,
                skipSetActiveMarket: !0,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })) : (ee({
                open: !0,
                mode: O
            }), er(Y, {
                variant: O,
                eventSlug: L.slug,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })))
        }, M[20] = L.slug, M[21] = G, M[22] = Y, M[23] = er, M[24] = ee, M[25] = J, M[26] = O, M[27] = k) : k = M[27];
        let eb = k,
            {
                teams: ek
            } = N;
        M[28] !== X || M[29] !== L || M[30] !== Q || M[31] !== N.outcomes ? (w = e => {
            if (X[e] ? .team) return X[e].team;
            if (!Q) return;
            let t = (0, eJ.getTeamKey)(L, "home", "team"),
                r = (0, eJ.getTeamKey)(L, "away", "team");
            if (!t && !r) {
                let t = ((e, t, r) => {
                    try {
                        let a = (t ? .[e] || "").toUpperCase(),
                            i = e2(a),
                            n = r.find(e => !!e && [e2(e.alias), e2(e.name), e2(e.abbreviation)].some(e => e && e === i));
                        if (n) return n;
                        return r.find(e => !!e && [e2(e.alias), e2(e.name), e2(e.abbreviation)].some(e => e && (i.includes(e) || e.includes(i))))
                    } catch {
                        return
                    }
                })(e, N.outcomes, Q);
                return t || Q[e]
            }
            let a = e6,
                i = 0 === e ? a(t) : a(r);
            return Q.find(e => !!e && !!i && [a(e.alias), a(e.name), a(e.abbreviation)].some(e => e && e === i)) ? ? Q[e]
        }, M[28] = X, M[29] = L, M[30] = Q, M[31] = N.outcomes, M[32] = w) : w = M[32];
        let ew = w;
        M[33] !== X || M[34] !== ew || M[35] !== ek ? (S = {
            buttons: X,
            resolveTeamForOutcome: ew,
            teams: ek
        }, M[33] = X, M[34] = ew, M[35] = ek, M[36] = S) : S = M[36];
        let eS = function({
            buttons: e,
            resolveTeamForOutcome: t,
            teams: r
        }) {
            return i.default.useMemo(() => e.map(e => ({ ...e,
                resolvedTeam: t(e.outcomeIndex) ? ? r ? .[e.outcomeIndex]
            })), [e, t, r])
        }(S);
        e: {
            let e, t;
            if (!("card" === A && H && Q ? .length === 2)) {
                j = eS;
                break e
            }
            let r = e9;M[37] !== Q ? (e = e => {
                if (!e || !Q) return 99;
                let t = [r(e.alias), r(e.name), r(e.abbreviation)],
                    a = Q[0],
                    i = Q[1];
                if (a) {
                    let e = [r(a.alias), r(a.name), r(a.abbreviation)];
                    if (t.some(t => t && e.includes(t))) return 0
                }
                if (i) {
                    let e = [r(i.alias), r(i.name), r(i.abbreviation)];
                    if (t.some(t => t && e.includes(t))) return 2
                }
                return 99
            }, M[37] = Q, M[38] = e) : e = M[38];
            let a = e;
            if (M[39] !== eS || M[40] !== a) {
                let e;
                M[42] !== a ? (e = (e, t) => a(e.resolvedTeam) - a(t.resolvedTeam), M[42] = a, M[43] = e) : e = M[43], t = [...eS].sort(e), M[39] = eS, M[40] = a, M[41] = t
            } else t = M[41];j = t
        }
        let ej = j;
        if (!ek) return null;
        if (el && "in-game" === A && void 0 !== P && P && et) {
            let e, r, a;
            return M[44] !== D ? (e = D("trading.redeem"), M[44] = D, M[45] = e) : e = M[45], M[46] !== eb || M[47] !== e ? (r = (0, t.jsx)(z.TradingButton, {
                color: "blue",
                hoverHeightOffset: 2,
                height: 44,
                shadowHeight: 4,
                maxWidth: "100%",
                onClick: eb,
                children: e
            }), M[46] = eb, M[47] = e, M[48] = r) : r = M[48], M[49] !== en || M[50] !== es || M[51] !== r ? (a = (0, t.jsx)("div", {
                className: "flex @min-[490px]:justify-end items-center w-full",
                children: (0, t.jsx)("div", {
                    className: "flex w-full h-full items-center justify-end @min-[490px]:w-[125px]",
                    onPointerEnter: en,
                    onPointerLeave: es,
                    children: r
                })
            }), M[49] = en, M[50] = es, M[51] = r, M[52] = a) : a = M[52], a
        }
        if (el && "in-game" === A) return null;
        let eC = `flex items-end gap-2 ${"card"===A?H?"@min-[490px]:flex-col w-full":"flex-col w-full":"w-[258px] @max-[490px]:w-full"} ${N.invertOutcomesVisually&&"card"===A&&!H?"flex-col-reverse":""} ${N.invertOutcomesVisually&&"card"===A&&H?"@min-[490px]:flex-col-reverse":""} ${N.invertOutcomesVisually&&"card"!==A?"flex-row-reverse":""}`;
        if (M[53] !== em || M[54] !== H || M[55] !== ey || M[56] !== ej || M[57] !== ei || M[58] !== A) {
            let e;
            M[60] !== em || M[61] !== H || M[62] !== ey || M[63] !== ei || M[64] !== A ? (e = e => {
                let r = `transition-opacity duration-100 flex-1 ${"card"===A?"w-full":""} ${"in-game"===A?"@min-[490px]:max-w-[125px]":""} ${!e.preventDim&&!e.marketTypeActive?"opacity-80":""} ${!e.preventDim&&e.marketTypeActive&&ei!==e.outcomeIndex?"opacity-60":""}`;
                return "card" === A && H ? (0, t.jsxs)("span", {
                    className: r,
                    children: [(0, t.jsx)("div", {
                        className: "hidden @min-[490px]:block",
                        children: (0, t.jsx)(ef, {
                            team: e.resolvedTeam,
                            onTap: e.onClick,
                            price: e.price,
                            outcomeIndex: e.outcomeIndex,
                            animationMode: "arrows",
                            priceMode: ey[e.outcomeIndex],
                            label: void 0,
                            height: 58,
                            shadowHeight: 5,
                            hoverHeightOffset: 2,
                            maxWidth: "auto",
                            className: "w-full",
                            style: {
                                minWidth: 0
                            },
                            ...e.colors
                        })
                    }), (0, t.jsx)("div", {
                        className: "block @max-[490px]:block @min-[490px]:hidden",
                        children: (0, t.jsx)(ef, {
                            team: e.resolvedTeam,
                            onTap: e.onClick,
                            price: e.price,
                            outcomeIndex: e.outcomeIndex,
                            animationMode: "arrows",
                            priceMode: ey[e.outcomeIndex],
                            label: void 0,
                            height: 44,
                            shadowHeight: 4,
                            hoverHeightOffset: 2,
                            maxWidth: "auto",
                            className: "w-full",
                            style: {
                                minWidth: 0
                            },
                            ...e.colors
                        })
                    })]
                }, `${e.outcomeIndex}`) : (0, t.jsx)("span", {
                    className: r,
                    children: (0, t.jsx)(ef, {
                        team: e.resolvedTeam,
                        onTap: e.onClick,
                        price: e.price,
                        outcomeIndex: e.outcomeIndex,
                        animationMode: "arrows",
                        priceMode: ey[e.outcomeIndex],
                        label: "card" === A ? void 0 : e.label,
                        ...em,
                        ...e.colors
                    })
                }, `${e.outcomeIndex}`)
            }, M[60] = em, M[61] = H, M[62] = ey, M[63] = ei, M[64] = A, M[65] = e) : e = M[65], C = ej.map(e), M[53] = em, M[54] = H, M[55] = ey, M[56] = ej, M[57] = ei, M[58] = A, M[59] = C
        } else C = M[59];
        return M[66] !== en || M[67] !== es || M[68] !== eC || M[69] !== C ? (T = (0, t.jsx)("div", {
            className: "flex @min-[490px]:justify-end items-center w-full",
            children: (0, t.jsx)("div", {
                className: eC,
                onPointerEnter: en,
                onPointerLeave: es,
                children: C
            })
        }), M[66] = en, M[67] = es, M[68] = eC, M[69] = C, M[70] = T) : T = M[70], T
    };

    function e4(e) {
        return e.setPreventAccordionHover
    }

    function e5(e) {
        return e.closed
    }

    function e6(e) {
        return (e || "").toUpperCase().replace(/[^A-Z0-9]/g, "")
    }

    function e9(e) {
        return (e || "").toUpperCase().replace(/[^A-Z0-9]/g, "")
    }
    e.s(["MarketTotalButtons", () => e8], 294241);
    let e8 = e => {
        let a, i, n, l, m, p, x, v, y, b, k, w, S, j, C, T, M = (0, r.c)(64),
            {
                market: N,
                view: I,
                hasTotalsPositions: P,
                variant: E,
                accordionValue: A
            } = e,
            O = void 0 === I ? "in-game" : I,
            D = void 0 === E ? "totals" : E,
            L = (0, f.useTranslations)(),
            {
                event: H,
                isNegRisk: K,
                mode: Y,
                teams: Q,
                gameState: X,
                moneylineMarket: J
            } = (0, g.useSportsItemContext)(),
            {
                prices: ee,
                onOutcomeClick: et
            } = ((e, t, a) => {
                let i, n, l, u, m, p, f, x = (0, r.c)(52),
                    v = void 0 === t ? "totals" : t;
                x[0] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], x[0] = i) : i = x[0];
                let {
                    activeMarket: y
                } = (0, d.useEventActiveMarketContext)(i), b = (0, o.useSetActiveSportsMarket)();
                x[1] === Symbol.for("react.memo_cache_sentinel") ? (n = ["setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side", "selectedOutcomeIdx"], x[1] = n) : n = x[1];
                let {
                    setSelectedOutcomeIdx: k,
                    setPrice: w,
                    setPriceUpdateLocation: S,
                    setCursorActive: j,
                    side: C,
                    selectedOutcomeIdx: _
                } = (0, U.useTradeContext)(n), {
                    teams: T,
                    event: M
                } = (0, g.useSportsItemContext)(), N = (0, $.useMarketBestPrices)(e), I = (0, s.useSportsStoreSelector)("sportSlug"), {
                    oddsFormat: P
                } = (0, s.useOddsFormat)(), E = (() => {
                    let e, t, a = (0, r.c)(5),
                        {
                            mode: i
                        } = (0, g.useSportsItemContext)();
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
                    let {
                        side: n,
                        selectedOutcomeIdx: s
                    } = (0, U.useTradeContext)(e);
                    a[1] !== i || a[2] !== s || a[3] !== n ? (t = {
                        mode: i,
                        side: n,
                        selectedOutcomeIdx: s
                    }, a[1] = i, a[2] = s, a[3] = n, a[4] = t) : t = a[4];
                    let o = t;
                    return (0, B.useLatest)(o)
                })(), A = (0, $.useGetBestPrices)(), {
                    setTradeState: O
                } = (0, F.useMobileTradeContext)(), D = (0, eF.useAmplitudeAnalytics)();
                e: {
                    let t, r, a, i = T ? .[0];x[2] !== i ? (t = G({
                        team: i
                    }), x[2] = i, x[3] = t) : t = x[3];
                    let n = t,
                        s = T ? .[1];x[4] !== s ? (r = G({
                        team: s
                    }), x[4] = s, x[5] = r) : r = x[5];
                    let o = r,
                        c = e.slug === y.slug;
                    if (I === V.SportSlug.LIVE) {
                        let e, t, r, a, i, s = c && 0 === _ ? "blue" : "gray";
                        x[6] !== c || x[7] !== _ || x[8] !== n ? (e = c && 0 === _ && n ? .customColors && { ...n
                        }, x[6] = c, x[7] = _, x[8] = n, x[9] = e) : e = x[9], x[10] !== s || x[11] !== e ? (t = {
                            color: s,
                            customColors: void 0,
                            ...e
                        }, x[10] = s, x[11] = e, x[12] = t) : t = x[12];
                        let d = c && 1 === _ ? "blue" : "gray";
                        x[13] !== c || x[14] !== o || x[15] !== _ ? (r = c && 1 === _ && o ? .customColors && { ...o
                        }, x[13] = c, x[14] = o, x[15] = _, x[16] = r) : r = x[16], x[17] !== d || x[18] !== r ? (a = {
                            color: d,
                            customColors: void 0,
                            ...r
                        }, x[17] = d, x[18] = r, x[19] = a) : a = x[19], x[20] !== t || x[21] !== a ? (i = [t, a], x[20] = t, x[21] = a, x[22] = i) : i = x[22], l = i;
                        break e
                    }
                    x[23] !== c || x[24] !== _ ? (a = [c && 0 === _ ? {
                        color: "green",
                        customColors: void 0
                    } : {
                        color: "gray",
                        customColors: void 0
                    }, c && 1 === _ ? {
                        color: "red",
                        customColors: void 0
                    } : {
                        color: "gray",
                        customColors: void 0
                    }], x[23] = c, x[24] = _, x[25] = a) : a = x[25],
                    l = a
                }
                let L = l;
                x[26] !== e.orderPriceMinTickSize || x[27] !== P || x[28] !== C ? (u = t => {
                    let r = t ? .["~zero"] ? .[C ? .toLowerCase()],
                        a = t ? .["~one"] ? .[C ? .toLowerCase()];
                    if (!r || !a) return [{
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }, {
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }];
                    let i = (0, W.getPrecisionFromTickSize)(e.orderPriceMinTickSize),
                        n = (0, h.showPaddedCentsOnly)(r, i),
                        s = (0, h.showPaddedCentsOnly)(a, i),
                        {
                            formatted: o
                        } = (0, Z.convertPrice)({
                            price: parseFloat(r),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: P
                        }),
                        {
                            formatted: l
                        } = (0, Z.convertPrice)({
                            price: parseFloat(a),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: P
                        });
                    return [{
                        formattedPrice: o,
                        paddedPrice: n,
                        price: r
                    }, {
                        formattedPrice: l,
                        paddedPrice: s,
                        price: a
                    }]
                }, x[26] = e.orderPriceMinTickSize, x[27] = P, x[28] = C, x[29] = u) : u = x[29];
                let z = u;
                x[30] !== a || x[31] !== D || x[32] !== E || x[33] !== M.slug || x[34] !== A || x[35] !== z || x[36] !== e || x[37] !== b || x[38] !== j || x[39] !== w || x[40] !== S || x[41] !== k || x[42] !== O || x[43] !== v ? (m = t => {
                    if (!E.current) return;
                    let {
                        mode: r,
                        side: i,
                        selectedOutcomeIdx: n
                    } = E.current, s = void 0 !== t ? t : n, o = (0, c.isTypeSharedByMultipleSportsMarkets)(e.sportsMarketType), l = a ? ? (o ? e.slug : v);
                    if ("desktop" === r) {
                        b(e, {
                            eventSlug: M.slug,
                            variant: l,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        });
                        let {
                            paddedPrice: t
                        } = z(A(e))[s];
                        k(s), "string" == typeof t && (w(t), S("click")), j(!0)
                    } else {
                        let {
                            paddedPrice: t
                        } = z(A(e))[s];
                        O ? .({
                            type: "trade",
                            side: i,
                            outcomeIdx: s,
                            market: e,
                            open: !0,
                            orderType: q.OrderType.Market,
                            price: t,
                            updatePriceLocation: !1
                        }), b(e, {
                            eventSlug: M.slug,
                            variant: l,
                            skipSetActiveMarket: !0,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        })
                    }
                    D.trackEvent(eR.Events.SportsTotalsClick, {
                        location: "smp"
                    })
                }, x[30] = a, x[31] = D, x[32] = E, x[33] = M.slug, x[34] = A, x[35] = z, x[36] = e, x[37] = b, x[38] = j, x[39] = w, x[40] = S, x[41] = k, x[42] = O, x[43] = v, x[44] = m) : m = x[44];
                let R = m;
                return x[45] !== z || x[46] !== N ? (p = z(N), x[45] = z, x[46] = N, x[47] = p) : p = x[47], x[48] !== L || x[49] !== R || x[50] !== p ? (f = {
                    colors: L,
                    prices: p,
                    onOutcomeClick: R
                }, x[48] = L, x[49] = R, x[50] = p, x[51] = f) : f = x[51], f
            })(N, D, A),
            {
                setTradeState: er
            } = (0, F.useMobileTradeContext)(),
            {
                setSportsCashOutState: ea,
                canRedeem: ei
            } = (0, R.useCashOutTxContext)(),
            en = (0, _.useSportsItemStore)(e7);
        M[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], M[0] = a) : a = M[0];
        let {
            event: es
        } = (0, u.useEventContext)(a), {
            slug: eo
        } = es;
        M[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], M[1] = i) : i = M[1];
        let {
            activeMarket: el
        } = (0, d.useEventActiveMarketContext)(i), ec = (0, o.useSetActiveSportsMarket)();
        M[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["selectedOutcomeIdx"], M[2] = n) : n = M[2];
        let {
            selectedOutcomeIdx: ed
        } = (0, U.useTradeContext)(n);
        M[3] !== et ? (l = () => {
            et(0)
        }, M[3] = et, M[4] = l) : l = M[4];
        let eu = l;
        M[5] !== et ? (m = () => {
            et(1)
        }, M[5] = et, M[6] = m) : m = M[6];
        let em = m;
        M[7] !== en ? (p = () => {
            en(!0)
        }, M[7] = en, M[8] = p) : p = M[8];
        let ep = p;
        M[9] !== en ? (x = () => {
            en(!1)
        }, M[9] = en, M[10] = x) : x = M[10];
        let eh = x,
            ex = H.closed || N.closed || K && H.markets.some(te),
            {
                isClosed: eg
            } = {
                isClosed: ex,
                isFinished: ex || X === V.GameState.Finished
            },
            ev = "card" === O,
            ey = ev ? K ? 58 : 40 : 44,
            eb = ev ? K ? 5 : 4 : 5;
        M[11] === Symbol.for("react.memo_cache_sentinel") ? (v = {
            minWidth: 0
        }, M[11] = v) : v = M[11], M[12] !== ey || M[13] !== eb ? (y = {
            hoverHeightOffset: 2,
            height: ey,
            shadowHeight: eb,
            maxWidth: "auto",
            className: "w-full",
            style: v
        }, M[12] = ey, M[13] = eb, M[14] = y) : y = M[14];
        let ek = y;
        e: {
            let e, t = (0, c.isTotalMarket)(D) && (0, c.isTypeSharedByMultipleSportsMarkets)(D) ? eo === H.slug && el.slug === N.slug : eo === H.slug && el.sportsMarketType === D;
            if ("mobile" === Y && "in-game" === O) {
                let e;
                M[15] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    oneColors: {
                        color: "gray",
                        customColors: void 0
                    },
                    totalsActive: !0,
                    preventDim: !0
                }, M[15] = e) : e = M[15], b = e;
                break e
            }
            if (t) {
                let e;
                M[16] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    zeroColors: {
                        color: "green",
                        customColors: void 0
                    },
                    oneColors: {
                        color: "red",
                        customColors: void 0
                    },
                    totalsActive: !0,
                    preventDim: !1
                }, M[16] = e) : e = M[16], b = e;
                break e
            }
            M[17] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                zeroColors: {
                    color: "gray",
                    customColors: void 0
                },
                oneColors: {
                    color: "gray",
                    customColors: void 0
                },
                totalsActive: !1,
                preventDim: !1
            }, M[17] = e) : e = M[17],
            b = e
        }
        let {
            zeroColors: ew,
            oneColors: eS,
            totalsActive: ej,
            preventDim: eC
        } = b, e_ = N.line ? ? 0;
        M[18] !== e_ ? (k = {
            type: "total",
            line: e_,
            variant: "over",
            font: "small"
        }, M[18] = e_, M[19] = k) : k = M[19];
        let eT = N.line ? ? 0;
        M[20] !== eT ? (w = {
            type: "total",
            line: eT,
            variant: "under",
            font: "small"
        }, M[20] = eT, M[21] = w) : w = M[21], M[22] !== k || M[23] !== w ? (S = [k, w], M[22] = k, M[23] = w, M[24] = S) : S = M[24];
        let eM = S;
        M[25] !== H.slug || M[26] !== Y || M[27] !== J || M[28] !== ec || M[29] !== ea || M[30] !== er || M[31] !== D ? (j = e => {
            e.stopPropagation(), "mobile" === Y ? (er ? .({
                type: "sports-redeem",
                market: J,
                sportsRedemptionType: D
            }), ec(J, {
                variant: D,
                eventSlug: H.slug,
                skipSetActiveMarket: !0,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })) : (ea({
                open: !0,
                mode: D
            }), ec(J, {
                variant: D,
                eventSlug: H.slug,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            }))
        }, M[25] = H.slug, M[26] = Y, M[27] = J, M[28] = ec, M[29] = ea, M[30] = er, M[31] = D, M[32] = j) : j = M[32];
        let eN = j;
        if (!Q) return null;
        if (eg && "in-game" === O && void 0 !== P && P && ei) {
            let e, r, a;
            return M[33] !== L ? (e = L("trading.redeem"), M[33] = L, M[34] = e) : e = M[34], M[35] !== eN || M[36] !== e ? (r = (0, t.jsx)(z.TradingButton, {
                color: "blue",
                hoverHeightOffset: 2,
                height: 44,
                shadowHeight: 4,
                maxWidth: "100%",
                onClick: eN,
                children: e
            }), M[35] = eN, M[36] = e, M[37] = r) : r = M[37], M[38] !== ep || M[39] !== eh || M[40] !== r ? (a = (0, t.jsx)("div", {
                className: "flex @min-[490px]:justify-end items-center w-full",
                children: (0, t.jsx)("div", {
                    className: "flex w-full h-full items-center justify-end @min-[490px]:w-[125px]",
                    onPointerEnter: ep,
                    onPointerLeave: eh,
                    children: r
                })
            }), M[38] = ep, M[39] = eh, M[40] = r, M[41] = a) : a = M[41], a
        }
        if (eg && "in-game" === O) return null;
        let eI = `flex items-end gap-2 ${"card"===O?K?"@min-[490px]:flex-col w-full":"flex-col w-full":"w-[258px] @max-[490px]:w-full"}`;
        return M[42] !== ek || M[43] !== K || M[44] !== eS || M[45] !== em || M[46] !== eC || M[47] !== eM[0] || M[48] !== eM[1] || M[49] !== ee[0] || M[50] !== ee[1] || M[51] !== ed || M[52] !== Q ? .[0] || M[53] !== Q ? .[1] || M[54] !== ej || M[55] !== O || M[56] !== ew || M[57] !== eu ? (C = "card" === O && K ? (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsxs)("span", {
                className: `transition-opacity duration-100 flex-1 w-full ${!eC&&!ej?"opacity-80":""} ${!eC&&ej&&0!==ed?"opacity-60":""}`,
                children: [(0, t.jsx)("div", {
                    className: "hidden @min-[490px]:block",
                    children: (0, t.jsx)(ef, {
                        team: Q ? .[0],
                        onTap: eu,
                        price: ee[0],
                        outcomeIndex: 0,
                        animationMode: "arrows",
                        priceMode: eM[0],
                        label: void 0,
                        height: 58,
                        shadowHeight: 5,
                        hoverHeightOffset: 2,
                        maxWidth: "auto",
                        className: "w-full",
                        style: {
                            minWidth: 0
                        },
                        ...ew
                    })
                }), (0, t.jsx)("div", {
                    className: "block @max-[490px]:block @min-[490px]:hidden",
                    children: (0, t.jsx)(ef, {
                        team: Q ? .[0],
                        onTap: eu,
                        price: ee[0],
                        outcomeIndex: 0,
                        animationMode: "arrows",
                        priceMode: eM[0],
                        label: void 0,
                        height: 44,
                        shadowHeight: 4,
                        hoverHeightOffset: 2,
                        maxWidth: "auto",
                        className: "w-full",
                        style: {
                            minWidth: 0
                        },
                        ...ew
                    })
                })]
            }), (0, t.jsxs)("span", {
                className: `transition-opacity duration-100 flex-1 w-full ${!eC&&!ej?"opacity-80":""} ${!eC&&ej&&1!==ed?"opacity-60":""}`,
                children: [(0, t.jsx)("div", {
                    className: "hidden @min-[490px]:block",
                    children: (0, t.jsx)(ef, {
                        team: Q ? .[1],
                        onTap: em,
                        price: ee[1],
                        outcomeIndex: 1,
                        animationMode: "arrows",
                        priceMode: eM[1],
                        label: void 0,
                        height: 58,
                        shadowHeight: 5,
                        hoverHeightOffset: 2,
                        maxWidth: "auto",
                        className: "w-full",
                        style: {
                            minWidth: 0
                        },
                        ...eS
                    })
                }), (0, t.jsx)("div", {
                    className: "block @max-[490px]:block @min-[490px]:hidden",
                    children: (0, t.jsx)(ef, {
                        team: Q ? .[1],
                        onTap: em,
                        price: ee[1],
                        outcomeIndex: 1,
                        animationMode: "arrows",
                        priceMode: eM[1],
                        label: void 0,
                        height: 44,
                        shadowHeight: 4,
                        hoverHeightOffset: 2,
                        maxWidth: "auto",
                        className: "w-full",
                        style: {
                            minWidth: 0
                        },
                        ...eS
                    })
                })]
            })]
        }) : (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)("span", {
                className: `transition-opacity duration-100 flex-1 ${"card"===O?"w-full":""} ${"in-game"===O?"@min-[490px]:max-w-[125px]":""} ${!eC&&!ej?"opacity-80":""} ${!eC&&ej&&0!==ed?"opacity-60":""}`,
                children: (0, t.jsx)(ef, {
                    team: Q ? .[0],
                    onTap: eu,
                    price: ee[0],
                    outcomeIndex: 0,
                    animationMode: "arrows",
                    priceMode: eM[0],
                    label: void 0,
                    ...ew,
                    ...ek
                })
            }), (0, t.jsx)("span", {
                className: `transition-opacity duration-100 flex-1 ${"card"===O?"w-full":""} ${"in-game"===O?"@min-[490px]:max-w-[125px]":""} ${!eC&&!ej?"opacity-80":""} ${!eC&&ej&&1!==ed?"opacity-60":""}`,
                children: (0, t.jsx)(ef, {
                    team: Q ? .[1],
                    onTap: em,
                    price: ee[1],
                    outcomeIndex: 1,
                    animationMode: "arrows",
                    priceMode: eM[1],
                    label: void 0,
                    ...eS,
                    ...ek
                })
            })]
        }), M[42] = ek, M[43] = K, M[44] = eS, M[45] = em, M[46] = eC, M[47] = eM[0], M[48] = eM[1], M[49] = ee[0], M[50] = ee[1], M[51] = ed, M[52] = Q ? .[0], M[53] = Q ? .[1], M[54] = ej, M[55] = O, M[56] = ew, M[57] = eu, M[58] = C) : C = M[58], M[59] !== ep || M[60] !== eh || M[61] !== eI || M[62] !== C ? (T = (0, t.jsx)("div", {
            className: "flex @min-[490px]:justify-end items-center w-full",
            children: (0, t.jsx)("div", {
                className: eI,
                onPointerEnter: ep,
                onPointerLeave: eh,
                children: C
            })
        }), M[59] = ep, M[60] = eh, M[61] = eI, M[62] = C, M[63] = T) : T = M[63], T
    };

    function e7(e) {
        return e.setPreventAccordionHover
    }

    function te(e) {
        return e.closed
    }

    function tt(e) {
        let a, i, n, l, c, m, p, x, v, y, b, k, w, S, j, C, T, M = (0, r.c)(69),
            {
                market: N,
                view: I,
                hasUFCPositions: P
            } = e,
            E = void 0 === I ? "in-game" : I,
            A = (0, f.useTranslations)(),
            {
                event: O,
                isNegRisk: D,
                mode: L,
                gameState: H,
                moneylineMarket: K,
                teams: Y
            } = (0, g.useSportsItemContext)(),
            {
                prices: Q,
                onOutcomeClick: X,
                colors: J
            } = (e => {
                let t, a, i, n, l, c, d, u, m = (0, r.c)(31),
                    p = (0, o.useSetActiveSportsMarket)();
                m[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["setSelectedOutcomeIdx", "setPrice", "setPriceUpdateLocation", "setCursorActive", "side"], m[0] = t) : t = m[0];
                let {
                    setSelectedOutcomeIdx: f,
                    setPrice: x,
                    setPriceUpdateLocation: v,
                    setCursorActive: y,
                    side: b
                } = (0, U.useTradeContext)(t), {
                    event: k
                } = (0, g.useSportsItemContext)(), w = (0, $.useMarketBestPrices)(e), {
                    oddsFormat: S
                } = (0, s.useOddsFormat)(), j = (() => {
                    let e, t, a = (0, r.c)(5),
                        {
                            mode: i
                        } = (0, g.useSportsItemContext)();
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
                    let {
                        side: n,
                        selectedOutcomeIdx: s
                    } = (0, U.useTradeContext)(e);
                    a[1] !== i || a[2] !== s || a[3] !== n ? (t = {
                        mode: i,
                        side: n,
                        selectedOutcomeIdx: s
                    }, a[1] = i, a[2] = s, a[3] = n, a[4] = t) : t = a[4];
                    let o = t;
                    return (0, B.useLatest)(o)
                })(), C = (0, eL.useBoundBookStore)(), {
                    setTradeState: _
                } = (0, F.useMobileTradeContext)(), T = (0, eF.useAmplitudeAnalytics)();
                if (m[1] !== e.teams) {
                    let [t, r] = e.teams || [];
                    a = G({
                        team: t
                    }), i = G({
                        team: r
                    }), m[1] = e.teams, m[2] = a, m[3] = i
                } else a = m[2], i = m[3];
                m[4] !== a || m[5] !== i ? (n = [a, i], m[4] = a, m[5] = i, m[6] = n) : n = m[6];
                let M = n;
                m[7] !== e.orderPriceMinTickSize || m[8] !== S || m[9] !== b ? (l = t => {
                    let r = t ? .["~zero"] ? .[b ? .toLowerCase()],
                        a = t ? .["~one"] ? .[b ? .toLowerCase()];
                    if (!r || !a) return [{
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }, {
                        formattedPrice: "0¢",
                        paddedPrice: void 0,
                        price: "0"
                    }];
                    let i = (0, W.getPrecisionFromTickSize)(e.orderPriceMinTickSize),
                        n = (0, h.showPaddedCentsOnly)(r, i),
                        s = (0, h.showPaddedCentsOnly)(a, i),
                        {
                            formatted: o
                        } = (0, Z.convertPrice)({
                            price: parseFloat(r),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: S
                        }),
                        {
                            formatted: l
                        } = (0, Z.convertPrice)({
                            price: parseFloat(a),
                            precision: i,
                            inputMode: "decimal",
                            outputMode: S
                        });
                    return [{
                        formattedPrice: o,
                        paddedPrice: n,
                        price: r
                    }, {
                        formattedPrice: l,
                        paddedPrice: s,
                        price: a
                    }]
                }, m[7] = e.orderPriceMinTickSize, m[8] = S, m[9] = b, m[10] = l) : l = m[10];
                let N = l;
                m[11] !== T || m[12] !== C || m[13] !== j || m[14] !== k.slug || m[15] !== N || m[16] !== e || m[17] !== p || m[18] !== y || m[19] !== x || m[20] !== v || m[21] !== f || m[22] !== _ ? (c = t => {
                    if (!j.current) return;
                    let {
                        mode: r,
                        side: a,
                        selectedOutcomeIdx: i
                    } = j.current, n = void 0 !== t ? t : i, s = "ufc_method_of_victory" === e.sportsMarketType, o = "parlays" === e.sportsMarketType, l = s || o ? e.slug : e.sportsMarketType ? ? "moneyline";
                    if ("desktop" === r) {
                        p(e, {
                            eventSlug: k.slug,
                            variant: l,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        });
                        let t = e.clobTokenIds ? .[0] ? .toLowerCase ? .() ? ? "",
                            {
                                paddedPrice: r
                            } = N(C.getState().byAsset[t] ? .views[String(e.orderPriceMinTickSize)] ? .bestPrices)[n];
                        f(n), "string" == typeof r && (x(r), v("click")), y(!0)
                    } else {
                        let t = e.clobTokenIds ? .[0] ? .toLowerCase ? .() ? ? "",
                            {
                                paddedPrice: r
                            } = N(C.getState().byAsset[t] ? .views[String(e.orderPriceMinTickSize)] ? .bestPrices)[n];
                        _ ? .({
                            type: "trade",
                            side: a,
                            outcomeIdx: n,
                            market: e,
                            open: !0,
                            orderType: q.OrderType.Market,
                            price: r,
                            updatePriceLocation: !1
                        }), p(e, {
                            eventSlug: k.slug,
                            variant: l,
                            skipSetActiveMarket: !0,
                            openOverlayAccordion: !1,
                            closeGamesAccordionIfOpen: !1,
                            closeOverlayAccordionIfOpen: !1
                        })
                    }
                    T.trackEvent(eR.Events.SportsTotalsClick, {
                        location: "smp",
                        market_type: e.sportsMarketType ? ? "moneyline"
                    })
                }, m[11] = T, m[12] = C, m[13] = j, m[14] = k.slug, m[15] = N, m[16] = e, m[17] = p, m[18] = y, m[19] = x, m[20] = v, m[21] = f, m[22] = _, m[23] = c) : c = m[23];
                let I = c;
                return m[24] !== N || m[25] !== w ? (d = N(w), m[24] = N, m[25] = w, m[26] = d) : d = m[26], m[27] !== M || m[28] !== I || m[29] !== d ? (u = {
                    colors: M,
                    prices: d,
                    onOutcomeClick: I
                }, m[27] = M, m[28] = I, m[29] = d, m[30] = u) : u = m[30], u
            })(N),
            {
                setTradeState: ee
            } = (0, F.useMobileTradeContext)(),
            {
                setSportsCashOutState: et,
                canRedeem: er
            } = (0, R.useCashOutTxContext)(),
            ea = (0, _.useSportsItemStore)(ta);
        M[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], M[0] = a) : a = M[0];
        let {
            event: ei
        } = (0, u.useEventContext)(a), {
            slug: en
        } = ei;
        M[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], M[1] = i) : i = M[1];
        let {
            activeMarket: es
        } = (0, d.useEventActiveMarketContext)(i), eo = (0, o.useSetActiveSportsMarket)();
        M[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["selectedOutcomeIdx"], M[2] = n) : n = M[2];
        let {
            selectedOutcomeIdx: el
        } = (0, U.useTradeContext)(n);
        M[3] !== X ? (l = () => {
            X(0)
        }, M[3] = X, M[4] = l) : l = M[4];
        let ec = l;
        M[5] !== X ? (c = () => {
            X(1)
        }, M[5] = X, M[6] = c) : c = M[6];
        let ed = c;
        M[7] !== ea ? (m = () => {
            ea(!0)
        }, M[7] = ea, M[8] = m) : m = M[8];
        let eu = m;
        M[9] !== ea ? (p = () => {
            ea(!1)
        }, M[9] = ea, M[10] = p) : p = M[10];
        let em = p,
            ep = O.closed || N.closed || D && O.markets.some(tr),
            {
                isClosed: eh
            } = {
                isClosed: ep,
                isFinished: ep || H === V.GameState.Finished
            },
            ex = "card" === E ? 40 : 44,
            eg = "card" === E ? 4 : 5;
        M[11] === Symbol.for("react.memo_cache_sentinel") ? (x = {
            width: "100%"
        }, M[11] = x) : x = M[11], M[12] !== ex || M[13] !== eg ? (v = {
            hoverHeightOffset: 2,
            height: ex,
            shadowHeight: eg,
            maxWidth: "auto",
            css: x
        }, M[12] = ex, M[13] = eg, M[14] = v) : v = M[14];
        let ev = v;
        e: {
            let e, t = "ufc_go_the_distance" === N.sportsMarketType || "ufc_method_of_victory" === N.sportsMarketType || "parlays" === N.sportsMarketType,
                r = en === O.slug && t && es.slug === N.slug;
            if ("mobile" === L && "in-game" === E) {
                let e;
                M[15] !== J[0] || M[16] !== J[1] ? (e = {
                    zeroColors: J[0],
                    oneColors: J[1],
                    ufcActive: !0,
                    preventDim: !0
                }, M[15] = J[0], M[16] = J[1], M[17] = e) : e = M[17], y = e;
                break e
            }
            if (r) {
                let e;
                M[18] !== J[0] || M[19] !== J[1] ? (e = {
                    zeroColors: J[0],
                    oneColors: J[1],
                    ufcActive: !0,
                    preventDim: !1
                }, M[18] = J[0], M[19] = J[1], M[20] = e) : e = M[20], y = e;
                break e
            }
            M[21] !== J[0] || M[22] !== J[1] ? (e = {
                zeroColors: J[0],
                oneColors: J[1],
                ufcActive: !1,
                preventDim: !1
            }, M[21] = J[0], M[22] = J[1], M[23] = e) : e = M[23],
            y = e
        }
        let {
            zeroColors: ey,
            oneColors: eb,
            ufcActive: ek,
            preventDim: ew
        } = y;
        M[24] === Symbol.for("react.memo_cache_sentinel") ? (b = [{
            type: "default",
            font: "small"
        }, {
            type: "default",
            font: "small"
        }], M[24] = b) : b = M[24];
        let eS = b;
        M[25] !== O.slug || M[26] !== N.slug || M[27] !== N.sportsMarketType || M[28] !== L || M[29] !== K || M[30] !== eo || M[31] !== et || M[32] !== ee ? (k = e => {
            e.stopPropagation();
            let t = "ufc_method_of_victory" === N.sportsMarketType,
                r = "parlays" === N.sportsMarketType,
                a = t || r ? N.slug : N.sportsMarketType ? ? "ufc_go_the_distance",
                i = N.sportsMarketType ? ? "ufc_go_the_distance";
            "mobile" === L ? (ee ? .({
                type: "sports-redeem",
                market: K,
                sportsRedemptionType: i
            }), eo(K, {
                variant: a,
                eventSlug: O.slug,
                skipSetActiveMarket: !0,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            })) : (et({
                open: !0,
                mode: i
            }), eo(K, {
                variant: a,
                eventSlug: O.slug,
                closeGamesAccordionIfOpen: !1,
                closeOverlayAccordionIfOpen: !1
            }))
        }, M[25] = O.slug, M[26] = N.slug, M[27] = N.sportsMarketType, M[28] = L, M[29] = K, M[30] = eo, M[31] = et, M[32] = ee, M[33] = k) : k = M[33];
        let ej = k;
        if (!Y) return null;
        if (eh && "in-game" === E && void 0 !== P && P && er) {
            let e, r, a;
            return M[34] !== A ? (e = A("trading.redeem"), M[34] = A, M[35] = e) : e = M[35], M[36] !== ej || M[37] !== e ? (r = (0, t.jsx)(z.TradingButton, {
                color: "blue",
                hoverHeightOffset: 2,
                height: 44,
                shadowHeight: 4,
                maxWidth: "100%",
                onClick: ej,
                children: e
            }), M[36] = ej, M[37] = e, M[38] = r) : r = M[38], M[39] !== eu || M[40] !== em || M[41] !== r ? (a = (0, t.jsx)("div", {
                className: "flex @min-[490px]:justify-end items-center w-full",
                children: (0, t.jsx)("div", {
                    className: "flex w-full h-full items-center justify-end @min-[490px]:w-[125px]",
                    onPointerEnter: eu,
                    onPointerLeave: em,
                    children: r
                })
            }), M[39] = eu, M[40] = em, M[41] = r, M[42] = a) : a = M[42], a
        }
        if (eh && "in-game" === E) return null;
        let eC = `flex items-end gap-2 w-[258px] @max-[490px]:w-full ${"card"===E?"@min-[490px]:flex-col w-full":""}`,
            e_ = `transition-opacity duration-100 flex-1 ${"card"===E?"w-full":""} ${"in-game"===E?"@min-[490px]:max-w-[125px]":""} ${!ew&&!ek?"opacity-80":""} ${!ew&&ek&&0!==el?"opacity-60":""}`,
            eT = Y ? .[0];
        M[43] !== ev || M[44] !== N.outcomes[0] || M[45] !== Q[0] || M[46] !== eT || M[47] !== ey || M[48] !== ec ? (w = (0, t.jsx)(ef, {
            team: eT,
            onTap: ec,
            price: Q[0],
            outcomeIndex: 0,
            animationMode: "arrows",
            priceMode: eS[0],
            label: N.outcomes[0],
            ...ey,
            ...ev
        }), M[43] = ev, M[44] = N.outcomes[0], M[45] = Q[0], M[46] = eT, M[47] = ey, M[48] = ec, M[49] = w) : w = M[49], M[50] !== e_ || M[51] !== w ? (S = (0, t.jsx)("span", {
            className: e_,
            children: w
        }), M[50] = e_, M[51] = w, M[52] = S) : S = M[52];
        let eM = `transition-opacity duration-100 flex-1 ${"card"===E?"w-full":""} ${"in-game"===E?"@min-[490px]:max-w-[125px]":""} ${!ew&&!ek?"opacity-80":""} ${!ew&&ek&&1!==el?"opacity-60":""}`,
            eN = Y ? .[1];
        return M[53] !== ev || M[54] !== N.outcomes[1] || M[55] !== eb || M[56] !== ed || M[57] !== Q[1] || M[58] !== eN ? (j = (0, t.jsx)(ef, {
            team: eN,
            onTap: ed,
            price: Q[1],
            outcomeIndex: 1,
            animationMode: "arrows",
            priceMode: eS[1],
            label: N.outcomes[1],
            ...eb,
            ...ev
        }), M[53] = ev, M[54] = N.outcomes[1], M[55] = eb, M[56] = ed, M[57] = Q[1], M[58] = eN, M[59] = j) : j = M[59], M[60] !== eM || M[61] !== j ? (C = (0, t.jsx)("span", {
            className: eM,
            children: j
        }), M[60] = eM, M[61] = j, M[62] = C) : C = M[62], M[63] !== eu || M[64] !== em || M[65] !== eC || M[66] !== S || M[67] !== C ? (T = (0, t.jsx)("div", {
            className: "flex @min-[490px]:justify-end items-center w-full",
            children: (0, t.jsxs)("div", {
                className: eC,
                onPointerEnter: eu,
                onPointerLeave: em,
                children: [S, C]
            })
        }), M[63] = eu, M[64] = em, M[65] = eC, M[66] = S, M[67] = C, M[68] = T) : T = M[68], T
    }

    function tr(e) {
        return e.closed
    }

    function ta(e) {
        return e.setPreventAccordionHover
    }
    let ti = "moneyline-button-section";
    e.s(["MONEYLINE_SECTION_ID", 0, ti], 364562);
    let tn = e => {
        let a, i, n, u, p, v, y, w, j, C, T, M, N, I, P, E, A, O, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er, ea, ei, en, es, eo, el, ec, ed, eu, em, ep, eh, ef, ex, ev, ey, eb, ek, ew, eS, ej, eC, e_, eT, eM, eN, eI, eP, eA, eO, eD, eL, ez, eR, eF, eB, eV, eU = (0, r.c)(345),
            {
                value: eG,
                marketsState: eZ,
                className: eK,
                children: eQ,
                teamId: eX,
                teamName: eJ,
                ...e0
            } = e,
            e1 = (0, f.useTranslations)(),
            e2 = (0, _.useSportsItemStore)(tu),
            {
                event: e4,
                isEsports: e5
            } = (0, g.useSportsItemContext)(),
            e6 = (0, s.useSpread)(e4.slug),
            e9 = (0, s.useTotal)(e4.slug),
            e7 = (0, s.useNRFI)(e4.slug),
            te = (0, s.useBTTS)(e4.slug),
            tr = (0, s.useChildMoneyline)(e4.slug),
            ta = (0, s.useFirstHalfSpread)(e4.slug),
            tn = (0, s.useFirstHalfTotal)(e4.slug),
            ts = (0, s.useFirstInningsTotal)(e4.slug),
            to = (0, s.useSecondInningsTotal)(e4.slug),
            tl = (0, s.useSelectedTennisFirstSetTotal)(e4.slug),
            tc = (0, s.useTennisFirstSetWinner)(e4.slug),
            td = (0, s.useSelectedTennisSetTotal)(e4.slug),
            tm = (0, s.useSelectedTennisMatchTotal)(e4.slug),
            tp = (0, s.useSelectedTennisSetHandicap)(e4.slug),
            th = (0, s.useSelectedShooterRoundTotal)(e4.slug),
            tf = (0, s.useShooterFirstPistolRoundWinner)(e4.slug),
            tx = (0, s.useShooterSecondPistolRoundWinner)(e4.slug),
            tg = (0, s.useTeamTotal)(e4.slug, eX ? ? ""),
            tv = (0, s.useTeamTotalLines)(e4.slug, eX ? ? ""),
            ty = (0, s.useSelectedTotalCorner)(e4.slug),
            tb = (0, s.useSelectedMapHandicap)(e4.slug),
            tk = (0, s.useSelectedRoundHandicap)(e4.slug),
            tw = (0, s.useSelectedKillHandicap)(e4.slug),
            tS = (0, s.useSelectedTowerHandicap)(e4.slug),
            tj = (0, s.useSelectedDrakeHandicap)(e4.slug),
            tC = (0, s.useSelectedNashorHandicap)(e4.slug),
            t_ = (0, s.useSelectedInhibitorHandicap)(e4.slug),
            tT = (0, s.useSelectedBarrackHandicap)(e4.slug),
            tM = (0, s.useSelectedRoundTotal)(e4.slug),
            tN = (0, s.useKillMost)(e4.slug),
            tI = (0, s.useTowerMost)(e4.slug),
            tP = (0, s.useDrakeMost)(e4.slug),
            tE = (0, s.useNashorMost)(e4.slug),
            tA = (0, s.useInhibitorMost)(e4.slug),
            tO = (0, s.useBarrackMost)(e4.slug);
        eU[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], eU[0] = a) : a = eU[0];
        let {
            activeMarket: tD
        } = (0, d.useEventActiveMarketContext)(a), tL = (0, s.useUFCGoTheDistance)(e4.slug), tz = (0, s.useSelectedUFCMethodOfVictory)(e4.slug, eG), tR = (0, s.useSelectedParlay)(e4.slug, eG), tF = (0, b.useHasSportsPositions)("spreads"), t$ = (0, b.useHasSportsPositions)("totals"), tB = (0, b.useHasSportsPositions)("nrfi"), tq = (0, b.useHasSportsPositions)("both_teams_to_score"), tV = (0, b.useHasSportsPositions)("child_moneyline"), tH = (0, b.useHasSportsPositions)("ufc_go_the_distance"), tU = (0, b.useHasSportsPositions)("ufc_method_of_victory"), tW = (0, b.useHasSportsPositions)("parlays"), tG = (0, b.useHasSportsPositions)("cricket_toss_winner"), tZ = (0, b.useHasSportsPositions)("cricket_match_to_go_till"), tK = (0, b.useHasSportsPositions)("cricket_completed_match"), tY = (0, b.useHasSportsPositions)("tennis_completed_match"), tQ = (0, s.useCricketTossWinner)(e4.slug), tX = (0, s.useSelectedCricketMatchToGoTill)(e4.slug, eG), tJ = (0, s.useCricketCompletedMatch)(e4.slug), t0 = (0, s.useTennisCompletedMatch)(e4.slug), t1 = (0, b.useHasSportsPositions)("map_handicap"), t2 = (0, b.useHasSportsPositions)("round_handicap_match"), t3 = (0, b.useHasSportsPositions)("round_over_under_match"), t4 = (0, b.useHasSportsPositions)("kill_handicap_match"), t5 = (0, b.useHasSportsPositions)("tower_handicap_match"), t6 = (0, b.useHasSportsPositions)("drake_handicap_match"), t9 = (0, b.useHasSportsPositions)("nashor_handicap_match"), t8 = (0, b.useHasSportsPositions)("inhibitor_handicap_match"), t7 = (0, b.useHasSportsPositions)("barrack_handicap_match"), re = (0, b.useHasSportsPositions)("kill_most_2_way_match"), rt = (0, b.useHasSportsPositions)("tower_most_2_way_match"), rr = (0, b.useHasSportsPositions)("drake_most_2_way_match"), ra = (0, b.useHasSportsPositions)("nashor_most_2_way_match"), ri = (0, b.useHasSportsPositions)("inhibitor_most_2_way_match"), rn = (0, b.useHasSportsPositions)("barrack_most_2_way_match"), rs = (0, b.useHasSportsPositions)("first_blood_game"), ro = (0, b.useHasSportsPositions)("kill_over_under_game"), rl = (0, b.useHasSportsPositions)("anytime_touchdowns"), rc = (0, b.useHasSportsPositions)("first_touchdowns"), rd = (0, b.useHasSportsPositions)("team_totals"), ru = (0, b.useHasSportsPositions)("rushing_yards"), rm = (0, b.useHasSportsPositions)("receiving_yards"), rp = (0, b.useHasSportsPositions)("points"), rh = (0, b.useHasSportsPositions)("assists"), rf = (0, b.useHasSportsPositions)("rebounds"), rx = (0, b.useHasSportsPositions)("soccer_anytime_goalscorer"), rg = (0, b.useHasSportsPositions)("soccer_exact_score"), rv = (0, b.useHasSportsPositions)("total_corners"), ry = (0, o.useSetActiveSportsMarket)(), rb = (0, h.formatVolume)((Array.isArray(e0.data) ? e0.data.map(e => e.market) : "binary" === e0.data.type ? [e0.data.market] : e0.data.markets).reduce((e, t) => {
            let r = parseFloat(t.volume);
            return Number.isNaN(r) ? e : e + r
        }, 0));
        eU[1] !== e1 ? (i = e1("events.headerMeta.volume"), eU[1] = e1, eU[2] = i) : i = eU[2];
        let rk = `${rb} ${i}`,
            rw = () => !Array.isArray(e0.data) && "type" in e0.data && "binary" === e0.data.type ? e0.data.market : Array.isArray(e0.data) && e0.data[0] ? e0.data[0].market : void 0,
            rS = {
                child_moneyline: tr ? .market,
                ufc_method_of_victory: tz ? .market,
                parlays: tR ? .market,
                cricket_match_to_go_till: tX ? .market,
                shooter_rounds_total: th ? .market,
                shooter_first_pistol_round: tf ? .market,
                shooter_second_pistol_round: tx ? .market,
                team_totals: tg ? .market,
                anytime_touchdowns: rw(),
                first_touchdowns: rw(),
                rushing_yards: rw(),
                receiving_yards: rw(),
                points: rw(),
                assists: rw(),
                rebounds: rw(),
                soccer_anytime_goalscorer: rw(),
                soccer_exact_score: rw(),
                map_handicap: tb ? .market,
                totals: e9 ? .market,
                total_corners: ty ? .market
            }[e0.type],
            rj = (eV = e0.type, (0, k.getSportsMarketTitle)({
                sportsMarketType: eV,
                market: rS,
                teamName: eJ,
                isEsports: e5,
                t: e1
            })),
            rC = "kill_over_under_game" === e0.type && Array.isArray(e0.data) ? e0.data : void 0;
        e: {
            let e;
            if (!rC ? .length) {
                n = void 0;
                break e
            }
            eU[3] !== tD.slug || eU[4] !== rC ? (e = rC.find(e => e.market.slug === tD.slug) ? ? rC[0], eU[3] = tD.slug, eU[4] = rC, eU[5] = e) : e = eU[5],
            n = e
        }
        let r_ = n,
            rT = "first_blood_game" !== e0.type || Array.isArray(e0.data) ? void 0 : e0.data;
        eU[6] !== e4.markets || eU[7] !== r_ || eU[8] !== eZ || eU[9] !== e0.type || eU[10] !== tg || eU[11] !== ty || eU[12] !== ry || eU[13] !== eG ? (u = () => {
            if ("kill_over_under_game" === e0.type && r_) return void ry(r_.market, {
                variant: eG,
                openOverlayAccordion: !0,
                closeOverlayAccordionIfOpen: !0
            });
            if ("team_totals" === e0.type && tg) return void ry(tg.market, {
                variant: eG,
                openOverlayAccordion: !0,
                closeOverlayAccordionIfOpen: !0
            });
            if ("total_corners" === e0.type && ty) return void ry(ty.market, {
                variant: eG,
                openOverlayAccordion: !0,
                closeOverlayAccordionIfOpen: !0
            });
            let e = e4.markets.find(e => e.slug === eG);
            if (e) {
                let t = (0, c.isTypeSharedByMultipleSportsMarkets)(e.sportsMarketType) ? e.slug : e.sportsMarketType;
                ry(e, {
                    variant: t,
                    openOverlayAccordion: !0,
                    closeOverlayAccordionIfOpen: !0
                });
                return
            }
            let t = (0, l.findMarketFromSportsMarketType)({
                type: eG,
                marketsSectionsState: eZ,
                markets: e4.markets
            });
            t && ry(t, {
                variant: eG,
                openOverlayAccordion: !0,
                closeOverlayAccordionIfOpen: !0
            })
        }, eU[6] = e4.markets, eU[7] = r_, eU[8] = eZ, eU[9] = e0.type, eU[10] = tg, eU[11] = ty, eU[12] = ry, eU[13] = eG, eU[14] = u) : u = eU[14];
        let rM = u;
        eU[15] !== eK || eU[16] !== e2 || eU[17] !== e0.data || eU[18] !== e0.type || eU[19] !== tv || eU[20] !== rM ? (p = ((0, c.isSpreadMarket)(e0.type) || (0, c.isTotalMarket)(e0.type) && "team_totals" !== e0.type || "both_teams_to_score" === e0.type || "child_moneyline" === e0.type || "nrfi" === e0.type || "shooter_rounds_total" === e0.type) && Array.isArray(e0.data) && e0.data.length > 1, v = "team_totals" === e0.type && tv.lines && tv.lines.length > 1, y = rM, w = (0, S.cn)("flex flex-col gap-3 bg-surface-1 hover:bg-neutral-50 dark:hover:bg-neutral-100/50 cursor-pointer transition-colors", "scroll-mt-[calc(var(--navbar-height)+var(--expanded-scoreboard-height)+16px)]", e2 && "hover:bg-surface-1", p && "gap-0", eK), eU[15] = eK, eU[16] = e2, eU[17] = e0.data, eU[18] = e0.type, eU[19] = tv, eU[20] = rM, eU[21] = p, eU[22] = v, eU[23] = y, eU[24] = w) : (p = eU[21], v = eU[22], y = eU[23], w = eU[24]), eU[25] !== e0.type || eU[26] !== rj || eU[27] !== rk ? (j = "parlays" !== e0.type && (0, t.jsx)(m.SportsMarketLabel, {
            label: rj,
            volume: rk
        }), eU[25] = e0.type, eU[26] = rj, eU[27] = rk, eU[28] = j) : j = eU[28];
        let rN = "parlays" === e0.type && "flex-1";
        return eU[29] !== rN ? (C = (0, S.cn)("flex w-full justify-end items-center", rN), eU[29] = rN, eU[30] = C) : C = eU[30], eU[31] !== e0.data || eU[32] !== e0.type ? (T = "moneyline" === e0.type && "neg-risk" === e0.data.type && (0, t.jsx)("div", {
            id: ti,
            className: "flex flex-1 w-fit justify-end",
            children: (0, t.jsx)(eE, {
                view: "in-game"
            })
        }), eU[31] = e0.data, eU[32] = e0.type, eU[33] = T) : T = eU[33], eU[34] !== e0.data || eU[35] !== e0.type ? (M = "moneyline" === e0.type && "binary" === e0.data.type && (0, t.jsx)("div", {
            id: ti,
            className: "flex flex-1 w-fit justify-end",
            children: (0, t.jsx)(x.BookContextProvider, {
                market: e0.data.market,
                prefetch: {
                    book: "once-when-stale",
                    lastPrice: "once-when-stale"
                },
                poll: "never",
                subscribe: "never",
                defer: "never",
                children: (0, t.jsx)(eg, {
                    variant: "in-game"
                })
            })
        }), eU[34] = e0.data, eU[35] = e0.type, eU[36] = M) : M = eU[36], eU[37] !== e0.data || eU[38] !== e0.type ? (N = "first_half_moneyline" === e0.type && "binary" === e0.data.type && (0, t.jsx)("div", {
            className: "flex flex-1 w-fit justify-end",
            children: (0, t.jsx)(x.BookContextProvider, {
                market: e0.data.market,
                prefetch: {
                    book: "once-when-stale",
                    lastPrice: "once-when-stale"
                },
                poll: "never",
                subscribe: "never",
                defer: "never",
                children: (0, t.jsx)(eg, {
                    variant: "in-game",
                    marketType: "first_half_moneyline"
                })
            })
        }), eU[37] = e0.data, eU[38] = e0.type, eU[39] = N) : N = eU[39], eU[40] !== tr || eU[41] !== tV || eU[42] !== e0.type ? (I = !!tr && "child_moneyline" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tr.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eq, {
                    market: tr.market,
                    hasChildMoneylinePositions: tV
                })
            })
        }), eU[40] = tr, eU[41] = tV, eU[42] = e0.type, eU[43] = I) : I = eU[43], eU[44] !== tF || eU[45] !== e0.type || eU[46] !== e6 ? (P = !!e6 && "spreads" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: e6.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: e6.market,
                    hasSpreadPositions: tF
                })
            })
        }), eU[44] = tF, eU[45] = e0.type, eU[46] = e6, eU[47] = P) : P = eU[47], eU[48] !== ta || eU[49] !== tF || eU[50] !== e0.type ? (E = !!ta && "first_half_spreads" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: ta.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: ta.market,
                    hasSpreadPositions: tF,
                    variant: "first_half_spreads"
                })
            })
        }), eU[48] = ta, eU[49] = tF, eU[50] = e0.type, eU[51] = E) : E = eU[51], eU[52] !== t$ || eU[53] !== e0.type || eU[54] !== e9 ? (A = !!e9 && "totals" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: e9.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: e9.market,
                    hasTotalsPositions: t$
                })
            })
        }), eU[52] = t$, eU[53] = e0.type, eU[54] = e9, eU[55] = A) : A = eU[55], eU[56] !== tn || eU[57] !== t$ || eU[58] !== e0.type ? (O = !!tn && "first_half_totals" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tn.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: tn.market,
                    hasTotalsPositions: t$,
                    variant: "first_half_totals"
                })
            })
        }), eU[56] = tn, eU[57] = t$, eU[58] = e0.type, eU[59] = O) : O = eU[59], eU[60] !== ts || eU[61] !== t$ || eU[62] !== e0.type ? (L = !!ts && "first_innings_totals" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: ts.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: ts.market,
                    hasTotalsPositions: t$,
                    variant: "first_innings_totals"
                })
            })
        }), eU[60] = ts, eU[61] = t$, eU[62] = e0.type, eU[63] = L) : L = eU[63], eU[64] !== t$ || eU[65] !== e0.type || eU[66] !== to ? (z = !!to && "second_innings_totals" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: to.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: to.market,
                    hasTotalsPositions: t$,
                    variant: "second_innings_totals"
                })
            })
        }), eU[64] = t$, eU[65] = e0.type, eU[66] = to, eU[67] = z) : z = eU[67], eU[68] !== t$ || eU[69] !== e0.type || eU[70] !== tl ? (R = !!tl && "tennis_first_set_totals" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tl.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: tl.market,
                    hasTotalsPositions: t$,
                    variant: "tennis_first_set_totals"
                })
            })
        }), eU[68] = t$, eU[69] = e0.type, eU[70] = tl, eU[71] = R) : R = eU[71], eU[72] !== tV || eU[73] !== e0.type || eU[74] !== tc ? (F = !!tc && "tennis_first_set_winner" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tc.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eq, {
                    market: tc.market,
                    hasChildMoneylinePositions: tV
                })
            })
        }), eU[72] = tV, eU[73] = e0.type, eU[74] = tc, eU[75] = F) : F = eU[75], eU[76] !== tF || eU[77] !== e0.type || eU[78] !== tp ? ($ = !!tp && "tennis_set_handicap" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tp.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: tp.market,
                    hasSpreadPositions: tF,
                    variant: "tennis_set_handicap"
                })
            })
        }), eU[76] = tF, eU[77] = e0.type, eU[78] = tp, eU[79] = $) : $ = eU[79], eU[80] !== t$ || eU[81] !== e0.type || eU[82] !== td ? (B = !!td && "tennis_set_totals" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: td.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: td.market,
                    hasTotalsPositions: t$,
                    variant: "tennis_set_totals"
                })
            })
        }), eU[80] = t$, eU[81] = e0.type, eU[82] = td, eU[83] = B) : B = eU[83], eU[84] !== t$ || eU[85] !== e0.type || eU[86] !== tm ? (q = !!tm && "tennis_match_totals" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tm.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: tm.market,
                    hasTotalsPositions: t$,
                    variant: "tennis_match_totals"
                })
            })
        }), eU[84] = t$, eU[85] = e0.type, eU[86] = tm, eU[87] = q) : q = eU[87], eU[88] !== tB || eU[89] !== e7 || eU[90] !== e0.type ? (V = !!e7 && "nrfi" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: e7.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eW, {
                    market: e7.market,
                    hasNRFIPositions: tB
                })
            })
        }), eU[88] = tB, eU[89] = e7, eU[90] = e0.type, eU[91] = V) : V = eU[91], eU[92] !== te || eU[93] !== tq || eU[94] !== e0.type ? (H = !!te && "both_teams_to_score" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: te.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e$, {
                    market: te.market,
                    hasBTTSPositions: tq
                })
            })
        }), eU[92] = te, eU[93] = tq, eU[94] = e0.type, eU[95] = H) : H = eU[95], eU[96] !== t$ || eU[97] !== e0.type || eU[98] !== th ? (U = !!th && "shooter_rounds_total" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: th.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: th.market,
                    hasTotalsPositions: t$
                })
            })
        }), eU[96] = t$, eU[97] = e0.type, eU[98] = th, eU[99] = U) : U = eU[99], eU[100] !== tH || eU[101] !== e0.type || eU[102] !== tL ? (W = !!tL && "ufc_go_the_distance" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tL.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(tt, {
                    market: tL.market,
                    hasUFCPositions: tH
                })
            })
        }), eU[100] = tH, eU[101] = e0.type, eU[102] = tL, eU[103] = W) : W = eU[103], eU[104] !== tV || eU[105] !== e0.type || eU[106] !== tf ? (G = !!tf && "shooter_first_pistol_round" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tf.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eq, {
                    market: tf.market,
                    hasChildMoneylinePositions: tV
                })
            })
        }), eU[104] = tV, eU[105] = e0.type, eU[106] = tf, eU[107] = G) : G = eU[107], eU[108] !== tU || eU[109] !== e0.type || eU[110] !== tz ? (Z = !!tz && "ufc_method_of_victory" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tz.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(tt, {
                    market: tz.market,
                    hasUFCPositions: tU
                })
            })
        }), eU[108] = tU, eU[109] = e0.type, eU[110] = tz, eU[111] = Z) : Z = eU[111], eU[112] !== tV || eU[113] !== e0.type || eU[114] !== tx ? (K = !!tx && "shooter_second_pistol_round" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tx.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eq, {
                    market: tx.market,
                    hasChildMoneylinePositions: tV
                })
            })
        }), eU[112] = tV, eU[113] = e0.type, eU[114] = tx, eU[115] = K) : K = eU[115], eU[116] !== tW || eU[117] !== e0.type || eU[118] !== tR ? (Y = !!tR && "parlays" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tR.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)(eY, {
                market: tR.market,
                hasParlayPositions: tW
            })
        }), eU[116] = tW, eU[117] = e0.type, eU[118] = tR, eU[119] = Y) : Y = eU[119], eU[120] !== e0.data || eU[121] !== e0.type ? (Q = "cricket_most_sixes" === e0.type && !Array.isArray(e0.data) && "type" in e0.data && "neg-risk" === e0.data.type && (0, t.jsx)("div", {
            className: "flex flex-1 w-fit justify-end",
            children: (0, t.jsx)(eE, {
                marketType: "cricket_most_sixes",
                view: "in-game"
            })
        }), eU[120] = e0.data, eU[121] = e0.type, eU[122] = Q) : Q = eU[122], eU[123] !== e0.data || eU[124] !== e0.type ? (X = "cricket_team_top_batter" === e0.type && !Array.isArray(e0.data) && "type" in e0.data && "neg-risk" === e0.data.type && (0, t.jsx)("div", {
            className: "flex flex-1 w-fit justify-end",
            children: (0, t.jsx)(eE, {
                marketType: "cricket_team_top_batter",
                view: "in-game"
            })
        }), eU[123] = e0.data, eU[124] = e0.type, eU[125] = X) : X = eU[125], eU[126] !== e0.data || eU[127] !== e0.type ? (J = "cricket_toss_match_double" === e0.type && !Array.isArray(e0.data) && "type" in e0.data && "neg-risk" === e0.data.type && (0, t.jsx)("div", {
            className: "flex flex-1 w-fit justify-end",
            children: (0, t.jsx)(eE, {
                marketType: "cricket_toss_match_double",
                view: "in-game"
            })
        }), eU[126] = e0.data, eU[127] = e0.type, eU[128] = J) : J = eU[128], eU[129] !== rg || eU[130] !== e0.data || eU[131] !== e0.type ? (ee = "soccer_exact_score" === e0.type && !Array.isArray(e0.data) && "binary" === e0.data.type && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: e0.data.market,
                    hasPositions: rg,
                    sportsMarketType: "soccer_exact_score",
                    labelType: "yes-no"
                })
            })
        }), eU[129] = rg, eU[130] = e0.data, eU[131] = e0.type, eU[132] = ee) : ee = eU[132], eU[133] !== e0.data || eU[134] !== e0.type ? (et = "soccer_halftime_result" === e0.type && !Array.isArray(e0.data) && "type" in e0.data && "neg-risk" === e0.data.type && (0, t.jsx)("div", {
            className: "flex flex-1 w-fit justify-end",
            children: (0, t.jsx)(eE, {
                marketType: "soccer_halftime_result",
                view: "in-game"
            })
        }), eU[133] = e0.data, eU[134] = e0.type, eU[135] = et) : et = eU[135], eU[136] !== tQ || eU[137] !== tG || eU[138] !== e0.type ? (er = !!tQ && "cricket_toss_winner" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tQ.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)(eH, {
                market: tQ.market,
                hasPositions: tG,
                sportsMarketType: "cricket_toss_winner",
                labelType: "team-outcome"
            })
        }), eU[136] = tQ, eU[137] = tG, eU[138] = e0.type, eU[139] = er) : er = eU[139], eU[140] !== tZ || eU[141] !== e0.type || eU[142] !== tX ? (ea = !!tX && "cricket_match_to_go_till" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tX.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)(eH, {
                market: tX.market,
                hasPositions: tZ,
                sportsMarketType: "cricket_match_to_go_till",
                labelType: "yes-no"
            })
        }), eU[140] = tZ, eU[141] = e0.type, eU[142] = tX, eU[143] = ea) : ea = eU[143], eU[144] !== tJ || eU[145] !== tK || eU[146] !== e0.type ? (ei = !!tJ && "cricket_completed_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tJ.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)(eH, {
                market: tJ.market,
                hasPositions: tK,
                sportsMarketType: "cricket_completed_match",
                labelType: "yes-no"
            })
        }), eU[144] = tJ, eU[145] = tK, eU[146] = e0.type, eU[147] = ei) : ei = eU[147], eU[148] !== tY || eU[149] !== e0.type || eU[150] !== t0 ? (en = !!t0 && "tennis_completed_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: t0.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)(eH, {
                market: t0.market,
                hasPositions: tY,
                sportsMarketType: "tennis_completed_match",
                labelType: "yes-no"
            })
        }), eU[148] = tY, eU[149] = e0.type, eU[150] = t0, eU[151] = en) : en = eU[151], eU[152] !== rl || eU[153] !== e0.data || eU[154] !== e0.type ? (es = "anytime_touchdowns" === e0.type && !Array.isArray(e0.data) && "binary" === e0.data.type && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: e0.data.market,
                    hasPositions: rl,
                    sportsMarketType: "anytime_touchdowns",
                    labelType: "yes-no"
                })
            })
        }), eU[152] = rl, eU[153] = e0.data, eU[154] = e0.type, eU[155] = es) : es = eU[155], eU[156] !== rc || eU[157] !== e0.data || eU[158] !== e0.type ? (eo = "first_touchdowns" === e0.type && !Array.isArray(e0.data) && "binary" === e0.data.type && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: e0.data.market,
                    hasPositions: rc,
                    sportsMarketType: "first_touchdowns",
                    labelType: "yes-no"
                })
            })
        }), eU[156] = rc, eU[157] = e0.data, eU[158] = e0.type, eU[159] = eo) : eo = eU[159], eU[160] !== rx || eU[161] !== e0.data || eU[162] !== e0.type ? (el = "soccer_anytime_goalscorer" === e0.type && !Array.isArray(e0.data) && "binary" === e0.data.type && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: e0.data.market,
                    hasPositions: rx,
                    sportsMarketType: "soccer_anytime_goalscorer",
                    labelType: "yes-no"
                })
            })
        }), eU[160] = rx, eU[161] = e0.data, eU[162] = e0.type, eU[163] = el) : el = eU[163], eU[164] !== rd || eU[165] !== e0.type || eU[166] !== tg || eU[167] !== eG ? (ec = "team_totals" === e0.type && tg && (0, t.jsx)(x.BookContextProvider, {
            market: tg.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: tg.market,
                    hasTotalsPositions: rd,
                    variant: "team_totals",
                    accordionValue: eG
                })
            })
        }), eU[164] = rd, eU[165] = e0.type, eU[166] = tg, eU[167] = eG, eU[168] = ec) : ec = eU[168], eU[169] !== t1 || eU[170] !== tb || eU[171] !== e0.type ? (ed = !!tb && "map_handicap" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tb.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: tb.market,
                    hasSpreadPositions: t1,
                    variant: "map_handicap"
                })
            })
        }), eU[169] = t1, eU[170] = tb, eU[171] = e0.type, eU[172] = ed) : ed = eU[172], eU[173] !== t2 || eU[174] !== e0.type || eU[175] !== tk ? (eu = !!tk && "round_handicap_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tk.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: tk.market,
                    hasSpreadPositions: t2,
                    variant: "round_handicap_match"
                })
            })
        }), eU[173] = t2, eU[174] = e0.type, eU[175] = tk, eU[176] = eu) : eu = eU[176], eU[177] !== t4 || eU[178] !== tw || eU[179] !== e0.type ? (em = !!tw && "kill_handicap_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tw.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: tw.market,
                    hasSpreadPositions: t4,
                    variant: "kill_handicap_match"
                })
            })
        }), eU[177] = t4, eU[178] = tw, eU[179] = e0.type, eU[180] = em) : em = eU[180], eU[181] !== ru || eU[182] !== e0.data || eU[183] !== e0.type ? (ep = "rushing_yards" === e0.type && Array.isArray(e0.data) && e0.data[0] && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data[0].market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: e0.data[0].market,
                    hasTotalsPositions: ru,
                    variant: "rushing_yards"
                })
            })
        }), eU[181] = ru, eU[182] = e0.data, eU[183] = e0.type, eU[184] = ep) : ep = eU[184], eU[185] !== t5 || eU[186] !== e0.type || eU[187] !== tS ? (eh = !!tS && "tower_handicap_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tS.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: tS.market,
                    hasSpreadPositions: t5,
                    variant: "tower_handicap_match"
                })
            })
        }), eU[185] = t5, eU[186] = e0.type, eU[187] = tS, eU[188] = eh) : eh = eU[188], eU[189] !== rm || eU[190] !== e0.data || eU[191] !== e0.type ? (ef = "receiving_yards" === e0.type && Array.isArray(e0.data) && e0.data[0] && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data[0].market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: e0.data[0].market,
                    hasTotalsPositions: rm,
                    variant: "receiving_yards"
                })
            })
        }), eU[189] = rm, eU[190] = e0.data, eU[191] = e0.type, eU[192] = ef) : ef = eU[192], eU[193] !== tj || eU[194] !== t6 || eU[195] !== e0.type ? (ex = !!tj && "drake_handicap_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tj.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: tj.market,
                    hasSpreadPositions: t6,
                    variant: "drake_handicap_match"
                })
            })
        }), eU[193] = tj, eU[194] = t6, eU[195] = e0.type, eU[196] = ex) : ex = eU[196], eU[197] !== rp || eU[198] !== e0.data || eU[199] !== e0.type ? (ev = "points" === e0.type && Array.isArray(e0.data) && e0.data[0] && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data[0].market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: e0.data[0].market,
                    hasTotalsPositions: rp,
                    variant: "points"
                })
            })
        }), eU[197] = rp, eU[198] = e0.data, eU[199] = e0.type, eU[200] = ev) : ev = eU[200], eU[201] !== t9 || eU[202] !== tC || eU[203] !== e0.type ? (ey = !!tC && "nashor_handicap_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tC.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: tC.market,
                    hasSpreadPositions: t9,
                    variant: "nashor_handicap_match"
                })
            })
        }), eU[201] = t9, eU[202] = tC, eU[203] = e0.type, eU[204] = ey) : ey = eU[204], eU[205] !== rh || eU[206] !== e0.data || eU[207] !== e0.type ? (eb = "assists" === e0.type && Array.isArray(e0.data) && e0.data[0] && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data[0].market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: e0.data[0].market,
                    hasTotalsPositions: rh,
                    variant: "assists"
                })
            })
        }), eU[205] = rh, eU[206] = e0.data, eU[207] = e0.type, eU[208] = eb) : eb = eU[208], eU[209] !== t8 || eU[210] !== t_ || eU[211] !== e0.type ? (ek = !!t_ && "inhibitor_handicap_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: t_.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: t_.market,
                    hasSpreadPositions: t8,
                    variant: "inhibitor_handicap_match"
                })
            })
        }), eU[209] = t8, eU[210] = t_, eU[211] = e0.type, eU[212] = ek) : ek = eU[212], eU[213] !== rf || eU[214] !== e0.data || eU[215] !== e0.type ? (ew = "rebounds" === e0.type && Array.isArray(e0.data) && e0.data[0] && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data[0].market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: e0.data[0].market,
                    hasTotalsPositions: rf,
                    variant: "rebounds"
                })
            })
        }), eU[213] = rf, eU[214] = e0.data, eU[215] = e0.type, eU[216] = ew) : ew = eU[216], eU[217] !== rv || eU[218] !== e0.type || eU[219] !== ty ? (eS = "total_corners" === e0.type && ty && (0, t.jsx)(x.BookContextProvider, {
            market: ty.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: ty.market,
                    hasTotalsPositions: rv,
                    variant: "total_corners"
                })
            })
        }), eU[217] = rv, eU[218] = e0.type, eU[219] = ty, eU[220] = eS) : eS = eU[220], eU[221] !== tT || eU[222] !== t7 || eU[223] !== e0.type ? (ej = !!tT && "barrack_handicap_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tT.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e3, {
                    market: tT.market,
                    hasSpreadPositions: t7,
                    variant: "barrack_handicap_match"
                })
            })
        }), eU[221] = tT, eU[222] = t7, eU[223] = e0.type, eU[224] = ej) : ej = eU[224], eU[225] !== t3 || eU[226] !== e0.type || eU[227] !== tM ? (eC = !!tM && "round_over_under_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tM.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: tM.market,
                    hasTotalsPositions: t3,
                    variant: "round_over_under_match"
                })
            })
        }), eU[225] = t3, eU[226] = e0.type, eU[227] = tM, eU[228] = eC) : eC = eU[228], eU[229] !== re || eU[230] !== tN || eU[231] !== e0.type ? (e_ = !!tN && "kill_most_2_way_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tN.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: tN.market,
                    hasPositions: re,
                    sportsMarketType: "kill_most_2_way_match",
                    labelType: "team-outcome"
                })
            })
        }), eU[229] = re, eU[230] = tN, eU[231] = e0.type, eU[232] = e_) : e_ = eU[232], eU[233] !== rt || eU[234] !== e0.type || eU[235] !== tI ? (eT = !!tI && "tower_most_2_way_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tI.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: tI.market,
                    hasPositions: rt,
                    sportsMarketType: "tower_most_2_way_match",
                    labelType: "team-outcome"
                })
            })
        }), eU[233] = rt, eU[234] = e0.type, eU[235] = tI, eU[236] = eT) : eT = eU[236], eU[237] !== tP || eU[238] !== rr || eU[239] !== e0.type ? (eM = !!tP && "drake_most_2_way_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tP.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: tP.market,
                    hasPositions: rr,
                    sportsMarketType: "drake_most_2_way_match",
                    labelType: "team-outcome"
                })
            })
        }), eU[237] = tP, eU[238] = rr, eU[239] = e0.type, eU[240] = eM) : eM = eU[240], eU[241] !== ra || eU[242] !== tE || eU[243] !== e0.type ? (eN = !!tE && "nashor_most_2_way_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tE.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: tE.market,
                    hasPositions: ra,
                    sportsMarketType: "nashor_most_2_way_match",
                    labelType: "team-outcome"
                })
            })
        }), eU[241] = ra, eU[242] = tE, eU[243] = e0.type, eU[244] = eN) : eN = eU[244], eU[245] !== ri || eU[246] !== tA || eU[247] !== e0.type ? (eI = !!tA && "inhibitor_most_2_way_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tA.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: tA.market,
                    hasPositions: ri,
                    sportsMarketType: "inhibitor_most_2_way_match",
                    labelType: "team-outcome"
                })
            })
        }), eU[245] = ri, eU[246] = tA, eU[247] = e0.type, eU[248] = eI) : eI = eU[248], eU[249] !== tO || eU[250] !== rn || eU[251] !== e0.type ? (eP = !!tO && "barrack_most_2_way_match" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: tO.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: tO.market,
                    hasPositions: rn,
                    sportsMarketType: "barrack_most_2_way_match",
                    labelType: "team-outcome"
                })
            })
        }), eU[249] = tO, eU[250] = rn, eU[251] = e0.type, eU[252] = eP) : eP = eU[252], eU[253] !== rT || eU[254] !== rs || eU[255] !== e0.type ? (eA = !!rT && "first_blood_game" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: rT.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: rT.market,
                    hasPositions: rs,
                    sportsMarketType: "first_blood_game",
                    labelType: "team-outcome"
                })
            })
        }), eU[253] = rT, eU[254] = rs, eU[255] = e0.type, eU[256] = eA) : eA = eU[256], eU[257] !== ro || eU[258] !== r_ || eU[259] !== e0.type ? (eO = !!r_ && "kill_over_under_game" === e0.type && (0, t.jsx)(x.BookContextProvider, {
            market: r_.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(e8, {
                    market: r_.market,
                    hasTotalsPositions: ro,
                    variant: "kill_over_under_game"
                })
            })
        }), eU[257] = ro, eU[258] = r_, eU[259] = e0.type, eU[260] = eO) : eO = eU[260], eU[261] !== e0.data || eU[262] !== e0.type ? (eD = !Array.isArray(e0.data) && "binary" === e0.data.type && ("dota2_game_ends_daytime" === e0.type || "dota2_both_teams_roshan" === e0.type || "dota2_both_teams_barracks" === e0.type || "dota2_ultra_kill" === e0.type || "dota2_rampage" === e0.type || "cs2_odd_even_total_kills" === e0.type || "cs2_odd_even_total_rounds" === e0.type || "lol_both_teams_baron" === e0.type || "lol_both_teams_dragon" === e0.type || "lol_both_teams_inhibitors" === e0.type || "lol_quadra_kill" === e0.type || "lol_penta_kill" === e0.type || "lol_odd_even_total_kills" === e0.type) && (0, t.jsx)(x.BookContextProvider, {
            market: e0.data.market,
            prefetch: {
                book: "once-when-stale",
                lastPrice: "once-when-stale"
            },
            poll: "never",
            subscribe: "never",
            defer: "never",
            children: (0, t.jsx)("div", {
                className: "flex flex-1 w-fit justify-end",
                children: (0, t.jsx)(eH, {
                    market: e0.data.market,
                    hasPositions: !1,
                    sportsMarketType: e0.type,
                    labelType: "cs2_odd_even_total_kills" === e0.type || "cs2_odd_even_total_rounds" === e0.type || "lol_odd_even_total_kills" === e0.type ? "odd-even" : "yes-no"
                })
            })
        }), eU[261] = e0.data, eU[262] = e0.type, eU[263] = eD) : eD = eU[263], eU[264] !== C || eU[265] !== T || eU[266] !== M || eU[267] !== N || eU[268] !== I || eU[269] !== P || eU[270] !== E || eU[271] !== A || eU[272] !== O || eU[273] !== L || eU[274] !== z || eU[275] !== R || eU[276] !== F || eU[277] !== $ || eU[278] !== B || eU[279] !== q || eU[280] !== V || eU[281] !== H || eU[282] !== U || eU[283] !== W || eU[284] !== G || eU[285] !== Z || eU[286] !== K || eU[287] !== Y || eU[288] !== Q || eU[289] !== X || eU[290] !== J || eU[291] !== ee || eU[292] !== et || eU[293] !== er || eU[294] !== ea || eU[295] !== ei || eU[296] !== en || eU[297] !== es || eU[298] !== eo || eU[299] !== el || eU[300] !== ec || eU[301] !== ed || eU[302] !== eu || eU[303] !== em || eU[304] !== ep || eU[305] !== eh || eU[306] !== ef || eU[307] !== ex || eU[308] !== ev || eU[309] !== ey || eU[310] !== eb || eU[311] !== ek || eU[312] !== ew || eU[313] !== eS || eU[314] !== ej || eU[315] !== eC || eU[316] !== e_ || eU[317] !== eT || eU[318] !== eM || eU[319] !== eN || eU[320] !== eI || eU[321] !== eP || eU[322] !== eA || eU[323] !== eO || eU[324] !== eD ? (eL = (0, t.jsxs)("div", {
            className: C,
            children: [T, M, N, I, P, E, A, O, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er, ea, ei, en, es, eo, el, ec, ed, eu, em, ep, eh, ef, ex, ev, ey, eb, ek, ew, eS, ej, eC, e_, eT, eM, eN, eI, eP, eA, eO, eD]
        }), eU[264] = C, eU[265] = T, eU[266] = M, eU[267] = N, eU[268] = I, eU[269] = P, eU[270] = E, eU[271] = A, eU[272] = O, eU[273] = L, eU[274] = z, eU[275] = R, eU[276] = F, eU[277] = $, eU[278] = B, eU[279] = q, eU[280] = V, eU[281] = H, eU[282] = U, eU[283] = W, eU[284] = G, eU[285] = Z, eU[286] = K, eU[287] = Y, eU[288] = Q, eU[289] = X, eU[290] = J, eU[291] = ee, eU[292] = et, eU[293] = er, eU[294] = ea, eU[295] = ei, eU[296] = en, eU[297] = es, eU[298] = eo, eU[299] = el, eU[300] = ec, eU[301] = ed, eU[302] = eu, eU[303] = em, eU[304] = ep, eU[305] = eh, eU[306] = ef, eU[307] = ex, eU[308] = ev, eU[309] = ey, eU[310] = eb, eU[311] = ek, eU[312] = ew, eU[313] = eS, eU[314] = ej, eU[315] = eC, eU[316] = e_, eU[317] = eT, eU[318] = eM, eU[319] = eN, eU[320] = eI, eU[321] = eP, eU[322] = eA, eU[323] = eO, eU[324] = eD, eU[325] = eL) : eL = eU[325], eU[326] !== eL || eU[327] !== j ? (ez = (0, t.jsxs)("div", {
            className: "flex w-full gap-3 flex-row p-4 @max-[490px]:flex-col",
            children: [j, eL]
        }), eU[326] = eL, eU[327] = j, eU[328] = ez) : ez = eU[328], eU[329] !== r_ || eU[330] !== rC || eU[331] !== e0.type || eU[332] !== p || eU[333] !== eG ? (eR = p && (0, t.jsx)("div", {
            className: "flex w-full",
            children: "kill_over_under_game" === e0.type && rC ? (0, t.jsx)(D, {
                type: "kill_over_under_game",
                location: "in-game",
                externalLine: r_,
                externalLines: rC,
                variantOverride: eG
            }) : (0, t.jsx)(D, {
                type: e0.type,
                location: "in-game"
            })
        }), eU[329] = r_, eU[330] = rC, eU[331] = e0.type, eU[332] = p, eU[333] = eG, eU[334] = eR) : eR = eU[334], eU[335] !== v || eU[336] !== tv ? (eF = v && tv.lines && tv.line && (0, t.jsx)("div", {
            className: "flex w-full",
            children: (0, t.jsx)(D, {
                type: "team_totals",
                location: "in-game",
                externalLine: tv.line,
                externalLines: tv.lines,
                externalSetLine: tv.setLine
            })
        }), eU[335] = v, eU[336] = tv, eU[337] = eF) : eF = eU[337], eU[338] !== eQ || eU[339] !== y || eU[340] !== w || eU[341] !== ez || eU[342] !== eR || eU[343] !== eF ? (eB = (0, t.jsxs)("div", {
            onClick: y,
            className: w,
            children: [ez, eR, eF, eQ]
        }), eU[338] = eQ, eU[339] = y, eU[340] = w, eU[341] = ez, eU[342] = eR, eU[343] = eF, eU[344] = eB) : eB = eU[344], eB
    };

    function ts(e) {
        let a, i, n = (0, r.c)(4),
            s = (0, y.useAccordionPositions)(e);
        n[0] !== s ? (a = s.map(to), n[0] = s, n[1] = a) : a = n[1];
        let o = a;
        return n[2] !== o ? (i = (0, t.jsx)(M.AccordionPositions, {
            positions: o
        }), n[2] = o, n[3] = i) : i = n[3], i
    }

    function to(e) {
        return e.rawPosition
    }

    function tl(e) {
        let a, i, n = (0, r.c)(4),
            s = (0, v.useAccordionOrders)(e);
        n[0] !== s ? (a = s.map(tc), n[0] = s, n[1] = a) : a = n[1];
        let o = a;
        return n[2] !== o ? (i = (0, t.jsx)(T.AccordionOrders, {
            openOrders: o
        }), n[2] = o, n[3] = i) : i = n[3], i
    }

    function tc(e) {
        return e.order
    }

    function td(e) {
        let a, i, s, o, c, d, m, h, f, x, v, y, b, k, S, T, M, N, I = (0, r.c)(51);
        I[0] !== e ? ({
            value: o,
            teamId: i,
            teamName: s,
            ...a
        } = e, I[0] = e, I[1] = a, I[2] = i, I[3] = s, I[4] = o) : (a = I[1], i = I[2], s = I[3], o = I[4]), I[5] === Symbol.for("react.memo_cache_sentinel") ? (c = ["event"], I[5] = c) : c = I[5];
        let {
            event: P
        } = (0, u.useEventContext)(c), E = (0, n.useBoundSportsStore)();
        I[6] !== P.slug ? (d = e => e.marketsSectionsState[P.slug], I[6] = P.slug, I[7] = d) : d = I[7];
        let A = d,
            O = (0, n.useSportsStore)(A, p.shallow),
            D = P.markets.some(e => (e.sportsMarketType ? ? "moneyline") === o) ? o : a.type;
        I[8] !== P.markets || I[9] !== D || I[10] !== O ? (m = (0, l.findMarketFromSportsMarketType)({
            type: D,
            marketsSectionsState: O,
            markets: P.markets
        }), I[8] = P.markets, I[9] = D, I[10] = O, I[11] = m) : m = I[11];
        let L = m,
            z = L ? ? P.markets[0];
        I[12] !== O || I[13] !== a || I[14] !== i || I[15] !== s || I[16] !== o ? (h = (0, t.jsx)(tn, {
            value: o,
            marketsState: O,
            teamId: i,
            teamName: s,
            ...a
        }), I[12] = O, I[13] = a, I[14] = i, I[15] = s, I[16] = o, I[17] = h) : h = I[17];
        let R = `sports-accordion-item-${P.slug}-${a.type}`,
            F = `accordion-active-tab-${a.type}-${P.slug}`;
        I[18] !== R || I[19] !== F ? (f = (0, t.jsx)(C.SportsAccordionItemContent, {
            accordionId: R,
            tabsId: F
        }), I[18] = R, I[19] = F, I[20] = f) : f = I[20], I[21] !== a ? (v = (0, t.jsx)(ts, { ...a
        }), x = (0, t.jsx)(tl, { ...a
        }), I[21] = a, I[22] = x, I[23] = v) : (x = I[22], v = I[23]), I[24] !== P.slug || I[25] !== x || I[26] !== z || I[27] !== h || I[28] !== f || I[29] !== v || I[30] !== o ? (y = (0, t.jsx)(g.SportsItemContextProvider, {
            children: (0, t.jsxs)(j.SportsAccordionItem, {
                market: z,
                event: P.slug,
                value: o,
                className: "w-full border rounded-xl overflow-hidden",
                children: [h, f, v, x]
            })
        }), I[24] = P.slug, I[25] = x, I[26] = z, I[27] = h, I[28] = f, I[29] = v, I[30] = o, I[31] = y) : y = I[31];
        let $ = y;
        I[32] !== P || I[33] !== L || I[34] !== a.type ? (b = {
            event: P,
            market: L,
            variant: a.type
        }, I[32] = P, I[33] = L, I[34] = a.type, I[35] = b) : b = I[35];
        let B = b;
        return I[36] !== B ? (k = { ...B,
            orientation: "mobile"
        }, I[36] = B, I[37] = k) : k = I[37], I[38] !== $ || I[39] !== E || I[40] !== k ? (S = (0, t.jsx)(w.Media, {
            lessThan: "lg",
            children: (0, t.jsx)(_.SportsItemStoreProvider, {
                initialState: k,
                store: E,
                findInitialSpreadsAndTotals: !0,
                children: $
            })
        }), I[38] = $, I[39] = E, I[40] = k, I[41] = S) : S = I[41], I[42] !== B ? (T = { ...B,
            orientation: "desktop"
        }, I[42] = B, I[43] = T) : T = I[43], I[44] !== $ || I[45] !== E || I[46] !== T ? (M = (0, t.jsx)(w.Media, {
            greaterThanOrEqual: "lg",
            children: (0, t.jsx)(_.SportsItemStoreProvider, {
                initialState: T,
                store: E,
                findInitialSpreadsAndTotals: !0,
                children: $
            })
        }), I[44] = $, I[45] = E, I[46] = T, I[47] = M) : M = I[47], I[48] !== S || I[49] !== M ? (N = (0, t.jsxs)(t.Fragment, {
            children: [S, M]
        }), I[48] = S, I[49] = M, I[50] = N) : N = I[50], N
    }

    function tu(e) {
        return e.preventAccordionHover
    }
    tn.displayName = "SportsMarketSectionAccordionHeader";
    let tm = e => {
        let m, p, h, x, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q = (0, r.c)(199),
            {
                marketType: X,
                tab: J
            } = e;
        Q[0] === Symbol.for("react.memo_cache_sentinel") ? (m = ["event"], Q[0] = m) : m = Q[0];
        let {
            event: ee
        } = (0, u.useEventContext)(m), et = (0, f.useTranslations)(), {
            moneyline: er,
            spreads: ea,
            totals: ei,
            nrfi: en,
            btts: es,
            childMoneyline: eo,
            firstHalfMoneyline: el,
            firstHalfSpreads: ec,
            firstHalfTotals: ed,
            firstInningsTotals: eu,
            secondInningsTotals: em,
            tennisSetTotals: ep,
            tennisMatchTotals: eh,
            tennisSetHandicaps: ef,
            tennisFirstSetTotals: ex,
            tennisFirstSetWinner: eg,
            shooterRoundTotals: ev,
            shooterFirstPistolRoundWinner: ey,
            shooterSecondPistolRoundWinner: eb,
            ufcGoTheDistance: ek,
            ufcMethodOfVictory: ew,
            cricketTossWinner: eS,
            cricketTossMatchDouble: ej,
            cricketMatchToGoTill: eC,
            cricketCompletedMatch: e_,
            cricketTeamTopBatter: eT,
            tennisCompletedMatch: eM,
            cricketMostSixes: eN,
            parlays: eI,
            anytimeTouchdowns: eP,
            firstTouchdowns: eE,
            rushingYards: eA,
            receivingYards: eO,
            points: eD,
            assists: eL,
            rebounds: ez,
            soccerAnytimeGoalscorer: eR,
            soccerExactScore: eF,
            soccerHalftimeResult: e$,
            totalCorners: eB,
            mapHandicaps: eq,
            roundHandicaps: eV,
            killHandicaps: eH,
            towerHandicaps: eU,
            drakeHandicaps: eW,
            nashorHandicaps: eG,
            inhibitorHandicaps: eZ,
            barrackHandicaps: eK,
            roundTotals: eY,
            killMost: eQ,
            towerMost: eX,
            drakeMost: eJ,
            nashorMost: e0,
            inhibitorMost: e1,
            barrackMost: e2,
            firstBloods: e3,
            killOverUnders: e4,
            dota2GameEndsDaytime: e5,
            dota2BothTeamsRoshan: e6,
            dota2BothTeamsBarracks: e9,
            dota2UltraKill: e8,
            dota2Rampage: e7,
            cs2OddEvenTotalKills: te,
            cs2OddEvenTotalRounds: tt,
            lolBothTeamsBaron: tr,
            lolBothTeamsDragon: ta,
            lolBothTeamsInhibitors: ti,
            lolQuadraKill: tn,
            lolPentaKill: ts,
            lolOddEvenTotalKills: to
        } = (0, s.useSportsMarketsSections)(ee.slug), tl = (0, s.useTeamTotalsGrouped)(ee.slug);
        Q[1] === Symbol.for("react.memo_cache_sentinel") ? (p = ["activeMarket"], Q[1] = p) : p = Q[1];
        let {
            activeMarket: tc
        } = (0, d.useEventActiveMarketContext)(p), tu = (0, o.useSetActiveSportsMarket)(), tm = (0, n.useBoundSportsStore)(), [t$, tB] = (0, s.useSportsAccordionState)();
        Q[2] !== tB ? (h = () => {
            tB("")
        }, Q[2] = tB, Q[3] = h) : h = Q[3], Q[4] !== ee.slug ? (x = [ee.slug], Q[4] = ee.slug, Q[5] = x) : x = Q[5], i.default.useEffect(h, x), Q[6] !== tc || Q[7] !== ee.markets || Q[8] !== ee.slug || Q[9] !== tu || Q[10] !== tm ? (g = e => {
            if ("" === e) tu(tc, {
                forceCloseOverlayAccordion: !0,
                skipSetActiveMarket: !0
            });
            else if ("moneyline" !== e && "first_half_moneyline" !== e) {
                let t = (0, l.findMarketFromSportsMarketType)({
                    type: e,
                    marketsSectionsState: tm ? .getState().marketsSectionsState[ee.slug],
                    markets: ee.markets
                });
                t && tu(t, {
                    variant: e,
                    openOverlayAccordion: !0,
                    closeOverlayAccordionIfOpen: !0
                })
            } else {
                let t = "first_half_moneyline" === e ? "first_half_moneyline" : "moneyline",
                    r = ee.markets.filter(e => !(e.sportsMarketType && c.IGNORED_SPORTS_MARKET_TYPES.includes(e.sportsMarketType)) && (e.sportsMarketType ? ? "moneyline") === t);
                r.length && tu(r[0], {
                    variant: e,
                    openOverlayAccordion: !0,
                    closeOverlayAccordionIfOpen: !0
                })
            }
        }, Q[6] = tc, Q[7] = ee.markets, Q[8] = ee.slug, Q[9] = tu, Q[10] = tm, Q[11] = g) : g = Q[11];
        let tq = g;
        if (Q[12] !== es || Q[13] !== eo || Q[14] !== eu || Q[15] !== eq || Q[16] !== X || Q[17] !== er || Q[18] !== en || Q[19] !== em || Q[20] !== ea || Q[21] !== J || Q[22] !== eM || Q[23] !== eh || Q[24] !== ef || Q[25] !== ep || Q[26] !== ei ? (v = (!J || "game-lines" === J || "series-lines" === J) && (0, t.jsxs)(t.Fragment, {
                children: [!!er && (!X || "moneyline" === X) && (0, t.jsx)(td, {
                    type: "moneyline",
                    data: er,
                    value: "moneyline"
                }), !!ea ? .length && (!X || "spreads" === X) && (0, t.jsx)(td, {
                    type: "spreads",
                    data: ea,
                    value: "spreads"
                }), !!eo ? .length && (!X || "child_moneyline" === X) && (0, t.jsx)(td, {
                    type: "child_moneyline",
                    data: eo,
                    value: "child_moneyline"
                }), !!eq ? .length && (!X || "map_handicap" === X) && (0, t.jsx)(td, {
                    type: "map_handicap",
                    data: eq,
                    value: "map_handicap"
                }), !!ei ? .length && (!X || "totals" === X) && (0, t.jsx)(td, {
                    type: "totals",
                    data: ei,
                    value: "totals"
                }), !!eu ? .length && (!X || "first_innings_totals" === X) && (0, t.jsx)(td, {
                    type: "first_innings_totals",
                    data: eu,
                    value: "first_innings_totals"
                }), !!em ? .length && (!X || "second_innings_totals" === X) && (0, t.jsx)(td, {
                    type: "second_innings_totals",
                    data: em,
                    value: "second_innings_totals"
                }), !!es ? .length && (!X || "both_teams_to_score" === X) && (0, t.jsx)(td, {
                    type: "both_teams_to_score",
                    data: es,
                    value: "both_teams_to_score"
                }), !!en ? .length && (!X || "nrfi" === X) && (0, t.jsx)(td, {
                    type: "nrfi",
                    data: en,
                    value: "nrfi"
                }), !!ef ? .length && (!X || "tennis_set_handicap" === X) && (0, t.jsx)(td, {
                    type: "tennis_set_handicap",
                    data: ef,
                    value: "tennis_set_handicap"
                }), !!ep ? .length && (!X || "tennis_set_totals" === X) && (0, t.jsx)(td, {
                    type: "tennis_set_totals",
                    data: ep,
                    value: "tennis_set_totals"
                }), !!eh ? .length && (!X || "tennis_match_totals" === X) && (0, t.jsx)(td, {
                    type: "tennis_match_totals",
                    data: eh,
                    value: "tennis_match_totals"
                }), !!eM && (!X || "tennis_completed_match" === X) && (0, t.jsx)(td, {
                    type: "tennis_completed_match",
                    data: eM,
                    value: "tennis_completed_match"
                })]
            }), Q[12] = es, Q[13] = eo, Q[14] = eu, Q[15] = eq, Q[16] = X, Q[17] = er, Q[18] = en, Q[19] = em, Q[20] = ea, Q[21] = J, Q[22] = eM, Q[23] = eh, Q[24] = ef, Q[25] = ep, Q[26] = ei, Q[27] = v) : v = Q[27], Q[28] !== el || Q[29] !== ec || Q[30] !== ed || Q[31] !== X || Q[32] !== et || Q[33] !== J ? (y = (!J || "first-half" === J) && (0, t.jsxs)(t.Fragment, {
                children: [!J && (!!el || !!ec ? .length || !!ed ? .length) && (0, t.jsx)("div", {
                    className: "w-full mb-2",
                    children: (0, t.jsx)("h3", {
                        className: "text-base font-semibold text-gray-900 dark:text-white",
                        children: et("sports.firstHalf")
                    })
                }), !!el && (!X || "first_half_moneyline" === X) && (0, t.jsx)(td, {
                    type: "first_half_moneyline",
                    data: el,
                    value: "first_half_moneyline"
                }), !!ec ? .length && (!X || "first_half_spreads" === X) && (0, t.jsx)(td, {
                    type: "first_half_spreads",
                    data: ec,
                    value: "first_half_spreads"
                }), !!ed ? .length && (!X || "first_half_totals" === X) && (0, t.jsx)(td, {
                    type: "first_half_totals",
                    data: ed,
                    value: "first_half_totals"
                })]
            }), Q[28] = el, Q[29] = ec, Q[30] = ed, Q[31] = X, Q[32] = et, Q[33] = J, Q[34] = y) : y = Q[34], Q[35] !== J || Q[36] !== tl ? (b = "team-totals" === J && tl.map(tp), Q[35] = J, Q[36] = tl, Q[37] = b) : b = Q[37], Q[38] !== eP || Q[39] !== eE || Q[40] !== J ? (k = "touchdowns" === J && (0, t.jsxs)(t.Fragment, {
                children: [!!eP ? .length && (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)("div", {
                        className: "w-full mb-2",
                        children: (0, t.jsx)("h3", {
                            className: "text-base font-semibold text-gray-900 dark:text-white",
                            children: "Anytime Touchdowns"
                        })
                    }), eP.map(th)]
                }), !!eE ? .length && (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)("div", {
                        className: "w-full mb-2",
                        children: (0, t.jsx)("h3", {
                            className: "text-base font-semibold text-gray-900 dark:text-white",
                            children: "First Touchdowns"
                        })
                    }), eE.map(tf)]
                })]
            }), Q[38] = eP, Q[39] = eE, Q[40] = J, Q[41] = k) : k = Q[41], Q[42] !== eA || Q[43] !== J ? (w = "rushing" === J && !!eA ? .length && eA.map(tx), Q[42] = eA, Q[43] = J, Q[44] = w) : w = Q[44], Q[45] !== eO || Q[46] !== J ? (S = "receiving" === J && !!eO ? .length && eO.map(tg), Q[45] = eO, Q[46] = J, Q[47] = S) : S = Q[47], Q[48] !== eD || Q[49] !== J ? (j = "points" === J && !!eD ? .length && eD.map(tv), Q[48] = eD, Q[49] = J, Q[50] = j) : j = Q[50], Q[51] !== eL || Q[52] !== J ? (C = "assists" === J && !!eL ? .length && eL.map(ty), Q[51] = eL, Q[52] = J, Q[53] = C) : C = Q[53], Q[54] !== ez || Q[55] !== J ? (_ = "rebounds" === J && !!ez ? .length && ez.map(tb), Q[54] = ez, Q[55] = J, Q[56] = _) : _ = Q[56], Q[57] !== eR || Q[58] !== J ? (T = "goalscorers" === J && !!eR ? .length && eR.map(tk), Q[57] = eR, Q[58] = J, Q[59] = T) : T = Q[59], Q[60] !== eF || Q[61] !== J ? (M = "exact-score" === J && !!eF ? .length && eF.map(tw), Q[60] = eF, Q[61] = J, Q[62] = M) : M = Q[62], Q[63] !== e$ || Q[64] !== J ? (N = "halftime" === J && !!e$ && (0, t.jsx)(td, {
                type: "soccer_halftime_result",
                data: e$,
                value: "soccer_halftime_result"
            }), Q[63] = e$, Q[64] = J, Q[65] = N) : N = Q[65], Q[66] !== J || Q[67] !== eB ? (I = "corners" === J && !!eB ? .length && (0, t.jsx)(td, {
                type: "total_corners",
                data: eB,
                value: "total_corners"
            }), Q[66] = J, Q[67] = eB, Q[68] = I) : I = Q[68], Q[69] !== te || Q[70] !== tt || Q[71] !== e9 || Q[72] !== e6 || Q[73] !== e5 || Q[74] !== e7 || Q[75] !== e8 || Q[76] !== e3 || Q[77] !== e4 || Q[78] !== tr || Q[79] !== ta || Q[80] !== ti || Q[81] !== to || Q[82] !== ts || Q[83] !== tn || Q[84] !== J) {
            let e, r, a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y;
            P = J ? .startsWith("game") && (e = J.replace("game", ""), r = `-game${e}-`, a = e3 ? .find(e => e.marketSlug.includes(r)), i = e4 ? .filter(e => e.marketSlug.includes(r)), s = (n = e => e ? .filter(e => e.marketSlug.includes(r)))(e5), o = n(e6), l = n(e9), c = n(e8), d = n(e7), u = n(te), m = n(tt), p = n(tr), h = n(ta), f = n(ti), x = n(tn), g = n(ts), v = n(to), y = [...(s ? ? []).map(tS), ...(o ? ? []).map(tj), ...(l ? ? []).map(tC), ...(c ? ? []).map(t_), ...(d ? ? []).map(tT), ...(u ? ? []).map(tM), ...(m ? ? []).map(tN), ...(p ? ? []).map(tI), ...(h ? ? []).map(tP), ...(f ? ? []).map(tE), ...(x ? ? []).map(tA), ...(g ? ? []).map(tO), ...(v ? ? []).map(tD)], (0, t.jsxs)(t.Fragment, {
                children: [!!a && (0, t.jsx)(td, {
                    type: "first_blood_game",
                    data: a,
                    value: a.market.slug
                }), !!i ? .length && (0, t.jsx)(td, {
                    type: "kill_over_under_game",
                    data: i,
                    value: `kill_over_under_game_game${e}`
                }), y.map(tL)]
            })), Q[69] = te, Q[70] = tt, Q[71] = e9, Q[72] = e6, Q[73] = e5, Q[74] = e7, Q[75] = e8, Q[76] = e3, Q[77] = e4, Q[78] = tr, Q[79] = ta, Q[80] = ti, Q[81] = to, Q[82] = ts, Q[83] = tn, Q[84] = J, Q[85] = P
        } else P = Q[85];
        return Q[86] !== e_ || Q[87] !== eC || Q[88] !== eN || Q[89] !== eT || Q[90] !== ej || Q[91] !== eS || Q[92] !== X || Q[93] !== eI || Q[94] !== ey || Q[95] !== ev || Q[96] !== eb || Q[97] !== et || Q[98] !== J || Q[99] !== ex || Q[100] !== eg || Q[101] !== ek || Q[102] !== ew ? (E = !J && (0, t.jsxs)(t.Fragment, {
            children: [(!!ex ? .length || !!eg) && (0, t.jsx)("div", {
                className: "w-full mb-2",
                children: (0, t.jsx)("h3", {
                    className: "text-base font-semibold text-gray-900 dark:text-white",
                    children: "1st Set"
                })
            }), !!eg && (!X || "tennis_first_set_winner" === X) && (0, t.jsx)(td, {
                type: "tennis_first_set_winner",
                data: eg,
                value: "tennis_first_set_winner"
            }), !!ex ? .length && (!X || "tennis_first_set_totals" === X) && (0, t.jsx)(td, {
                type: "tennis_first_set_totals",
                data: ex,
                value: "tennis_first_set_totals"
            }), !!ev && (!X || "shooter_rounds_total" === X) && (0, t.jsx)(td, {
                type: "shooter_rounds_total",
                data: ev,
                value: "shooter_rounds_total"
            }), !!ey && (!X || "shooter_first_pistol_round" === X) && (0, t.jsx)(td, {
                type: "shooter_first_pistol_round",
                data: ey,
                value: "shooter_first_pistol_round"
            }), !!eb && (!X || "shooter_second_pistol_round" === X) && (0, t.jsx)(td, {
                type: "shooter_second_pistol_round",
                data: eb,
                value: "shooter_second_pistol_round"
            }), !!ek && (!X || "ufc_go_the_distance" === X) && (0, t.jsx)(td, {
                type: "ufc_go_the_distance",
                data: ek,
                value: "ufc_go_the_distance"
            }), !!ew && (!X || "ufc_method_of_victory" === X) && ew.map(tz), !!eT && (!X || "cricket_team_top_batter" === X) && (0, t.jsx)(td, {
                type: "cricket_team_top_batter",
                data: eT,
                value: "cricket_team_top_batter"
            }), !!eN && (!X || "cricket_most_sixes" === X) && (0, t.jsx)(td, {
                type: "cricket_most_sixes",
                data: eN,
                value: "cricket_most_sixes"
            }), !!ej && (!X || "cricket_toss_match_double" === X) && (0, t.jsx)(td, {
                type: "cricket_toss_match_double",
                data: ej,
                value: "cricket_toss_match_double"
            }), !!eS && (!X || "cricket_toss_winner" === X) && (0, t.jsx)(td, {
                type: "cricket_toss_winner",
                data: eS,
                value: "cricket_toss_winner"
            }), !!e_ && (!X || "cricket_completed_match" === X) && (0, t.jsx)(td, {
                type: "cricket_completed_match",
                data: e_,
                value: "cricket_completed_match"
            }), !!eC && (!X || "cricket_match_to_go_till" === X) && eC.map(tR), !!eI && (!X || "parlays" === X) && (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)("div", {
                    className: "w-full my-2",
                    children: (0, t.jsx)("h3", {
                        className: "text-base font-semibold text-gray-900 dark:text-white",
                        children: et("sports.parlays")
                    })
                }), eI.map(tF)]
            })]
        }), Q[86] = e_, Q[87] = eC, Q[88] = eN, Q[89] = eT, Q[90] = ej, Q[91] = eS, Q[92] = X, Q[93] = eI, Q[94] = ey, Q[95] = ev, Q[96] = eb, Q[97] = et, Q[98] = J, Q[99] = ex, Q[100] = eg, Q[101] = ek, Q[102] = ew, Q[103] = E) : E = Q[103], Q[104] !== eK ? .length || Q[105] !== eW ? .length || Q[106] !== eZ ? .length || Q[107] !== eH ? .length || Q[108] !== eG ? .length || Q[109] !== eV ? .length || Q[110] !== eU ? .length ? (A = (!!eV ? .length || !!eH ? .length || !!eU ? .length || !!eW ? .length || !!eG ? .length || !!eZ ? .length || !!eK ? .length) && (0, t.jsx)("div", {
            className: "w-full mt-3 mb-2",
            children: (0, t.jsx)("h3", {
                className: "text-base font-semibold text-gray-900 dark:text-white",
                children: "Series Objective Handicaps"
            })
        }), Q[104] = eK ? .length, Q[105] = eW ? .length, Q[106] = eZ ? .length, Q[107] = eH ? .length, Q[108] = eG ? .length, Q[109] = eV ? .length, Q[110] = eU ? .length, Q[111] = A) : A = Q[111], Q[112] !== X || Q[113] !== eV ? (O = !!eV ? .length && (!X || "round_handicap_match" === X) && (0, t.jsx)(td, {
            type: "round_handicap_match",
            data: eV,
            value: "round_handicap_match"
        }), Q[112] = X, Q[113] = eV, Q[114] = O) : O = Q[114], Q[115] !== eH || Q[116] !== X ? (D = !!eH ? .length && (!X || "kill_handicap_match" === X) && (0, t.jsx)(td, {
            type: "kill_handicap_match",
            data: eH,
            value: "kill_handicap_match"
        }), Q[115] = eH, Q[116] = X, Q[117] = D) : D = Q[117], Q[118] !== X || Q[119] !== eU ? (L = !!eU ? .length && (!X || "tower_handicap_match" === X) && (0, t.jsx)(td, {
            type: "tower_handicap_match",
            data: eU,
            value: "tower_handicap_match"
        }), Q[118] = X, Q[119] = eU, Q[120] = L) : L = Q[120], Q[121] !== eW || Q[122] !== X ? (z = !!eW ? .length && (!X || "drake_handicap_match" === X) && (0, t.jsx)(td, {
            type: "drake_handicap_match",
            data: eW,
            value: "drake_handicap_match"
        }), Q[121] = eW, Q[122] = X, Q[123] = z) : z = Q[123], Q[124] !== X || Q[125] !== eG ? (R = !!eG ? .length && (!X || "nashor_handicap_match" === X) && (0, t.jsx)(td, {
            type: "nashor_handicap_match",
            data: eG,
            value: "nashor_handicap_match"
        }), Q[124] = X, Q[125] = eG, Q[126] = R) : R = Q[126], Q[127] !== eZ || Q[128] !== X ? (F = !!eZ ? .length && (!X || "inhibitor_handicap_match" === X) && (0, t.jsx)(td, {
            type: "inhibitor_handicap_match",
            data: eZ,
            value: "inhibitor_handicap_match"
        }), Q[127] = eZ, Q[128] = X, Q[129] = F) : F = Q[129], Q[130] !== eK || Q[131] !== X ? ($ = !!eK ? .length && (!X || "barrack_handicap_match" === X) && (0, t.jsx)(td, {
            type: "barrack_handicap_match",
            data: eK,
            value: "barrack_handicap_match"
        }), Q[130] = eK, Q[131] = X, Q[132] = $) : $ = Q[132], Q[133] !== eY ? .length || Q[134] !== et ? (B = !!eY ? .length && (0, t.jsx)("div", {
            className: "w-full mt-3 mb-2",
            children: (0, t.jsx)("h3", {
                className: "text-base font-semibold text-gray-900 dark:text-white",
                children: et("sports.seriesTotals")
            })
        }), Q[133] = eY ? .length, Q[134] = et, Q[135] = B) : B = Q[135], Q[136] !== X || Q[137] !== eY ? (q = !!eY ? .length && (!X || "round_over_under_match" === X) && (0, t.jsx)(td, {
            type: "round_over_under_match",
            data: eY,
            value: "round_over_under_match"
        }), Q[136] = X, Q[137] = eY, Q[138] = q) : q = Q[138], Q[139] !== e2 || Q[140] !== eJ || Q[141] !== e1 || Q[142] !== eQ || Q[143] !== e0 || Q[144] !== eX ? (V = (!!eQ || !!eX || !!eJ || !!e0 || !!e1 || !!e2) && (0, t.jsx)("div", {
            className: "w-full mt-3 mb-2",
            children: (0, t.jsx)("h3", {
                className: "text-base font-semibold text-gray-900 dark:text-white",
                children: "Series Most Objectives"
            })
        }), Q[139] = e2, Q[140] = eJ, Q[141] = e1, Q[142] = eQ, Q[143] = e0, Q[144] = eX, Q[145] = V) : V = Q[145], Q[146] !== eQ || Q[147] !== X ? (H = !!eQ && (!X || "kill_most_2_way_match" === X) && (0, t.jsx)(td, {
            type: "kill_most_2_way_match",
            data: eQ,
            value: "kill_most_2_way_match"
        }), Q[146] = eQ, Q[147] = X, Q[148] = H) : H = Q[148], Q[149] !== X || Q[150] !== eX ? (U = !!eX && (!X || "tower_most_2_way_match" === X) && (0, t.jsx)(td, {
            type: "tower_most_2_way_match",
            data: eX,
            value: "tower_most_2_way_match"
        }), Q[149] = X, Q[150] = eX, Q[151] = U) : U = Q[151], Q[152] !== eJ || Q[153] !== X ? (W = !!eJ && (!X || "drake_most_2_way_match" === X) && (0, t.jsx)(td, {
            type: "drake_most_2_way_match",
            data: eJ,
            value: "drake_most_2_way_match"
        }), Q[152] = eJ, Q[153] = X, Q[154] = W) : W = Q[154], Q[155] !== X || Q[156] !== e0 ? (G = !!e0 && (!X || "nashor_most_2_way_match" === X) && (0, t.jsx)(td, {
            type: "nashor_most_2_way_match",
            data: e0,
            value: "nashor_most_2_way_match"
        }), Q[155] = X, Q[156] = e0, Q[157] = G) : G = Q[157], Q[158] !== e1 || Q[159] !== X ? (Z = !!e1 && (!X || "inhibitor_most_2_way_match" === X) && (0, t.jsx)(td, {
            type: "inhibitor_most_2_way_match",
            data: e1,
            value: "inhibitor_most_2_way_match"
        }), Q[158] = e1, Q[159] = X, Q[160] = Z) : Z = Q[160], Q[161] !== e2 || Q[162] !== X ? (K = !!e2 && (!X || "barrack_most_2_way_match" === X) && (0, t.jsx)(td, {
            type: "barrack_most_2_way_match",
            data: e2,
            value: "barrack_most_2_way_match"
        }), Q[161] = e2, Q[162] = X, Q[163] = K) : K = Q[163], Q[164] !== tq || Q[165] !== w || Q[166] !== S || Q[167] !== j || Q[168] !== C || Q[169] !== _ || Q[170] !== T || Q[171] !== M || Q[172] !== N || Q[173] !== I || Q[174] !== P || Q[175] !== E || Q[176] !== A || Q[177] !== O || Q[178] !== D || Q[179] !== L || Q[180] !== z || Q[181] !== R || Q[182] !== F || Q[183] !== $ || Q[184] !== B || Q[185] !== q || Q[186] !== V || Q[187] !== H || Q[188] !== U || Q[189] !== W || Q[190] !== G || Q[191] !== Z || Q[192] !== K || Q[193] !== v || Q[194] !== y || Q[195] !== b || Q[196] !== k || Q[197] !== t$ ? (Y = (0, t.jsxs)(a.Accordion.Root, {
            type: "single",
            collapsible: !0,
            className: "flex flex-col gap-4 w-full mt-4 mb-4 lg:mb-0 @container",
            value: t$,
            onValueChange: tq,
            children: [v, y, b, k, w, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K]
        }), Q[164] = tq, Q[165] = w, Q[166] = S, Q[167] = j, Q[168] = C, Q[169] = _, Q[170] = T, Q[171] = M, Q[172] = N, Q[173] = I, Q[174] = P, Q[175] = E, Q[176] = A, Q[177] = O, Q[178] = D, Q[179] = L, Q[180] = z, Q[181] = R, Q[182] = F, Q[183] = $, Q[184] = B, Q[185] = q, Q[186] = V, Q[187] = H, Q[188] = U, Q[189] = W, Q[190] = G, Q[191] = Z, Q[192] = K, Q[193] = v, Q[194] = y, Q[195] = b, Q[196] = k, Q[197] = t$, Q[198] = Y) : Y = Q[198], Y
    };

    function tp(e) {
        let {
            teamId: r,
            teamName: a,
            markets: i
        } = e;
        return (0, t.jsx)(td, {
            type: "team_totals",
            data: i,
            value: `team_totals_${r}`,
            teamId: r,
            teamName: a
        }, r)
    }

    function th(e) {
        return (0, t.jsx)(td, {
            type: "anytime_touchdowns",
            data: e,
            value: e.market.slug
        }, e.market.slug)
    }

    function tf(e) {
        return (0, t.jsx)(td, {
            type: "first_touchdowns",
            data: e,
            value: e.market.slug
        }, e.market.slug)
    }

    function tx(e) {
        return (0, t.jsx)(td, {
            type: "rushing_yards",
            data: [e],
            value: e.market.slug
        }, e.market.slug)
    }

    function tg(e) {
        return (0, t.jsx)(td, {
            type: "receiving_yards",
            data: [e],
            value: e.market.slug
        }, e.market.slug)
    }

    function tv(e) {
        return (0, t.jsx)(td, {
            type: "points",
            data: [e],
            value: e.market.slug
        }, e.market.slug)
    }

    function ty(e) {
        return (0, t.jsx)(td, {
            type: "assists",
            data: [e],
            value: e.market.slug
        }, e.market.slug)
    }

    function tb(e) {
        return (0, t.jsx)(td, {
            type: "rebounds",
            data: [e],
            value: e.market.slug
        }, e.market.slug)
    }

    function tk(e) {
        return (0, t.jsx)(td, {
            type: "soccer_anytime_goalscorer",
            data: e,
            value: e.market.slug
        }, e.market.slug)
    }

    function tw(e) {
        return (0, t.jsx)(td, {
            type: "soccer_exact_score",
            data: e,
            value: e.market.slug
        }, e.market.slug)
    }

    function tS(e) {
        return {
            sectionType: "dota2_game_ends_daytime",
            data: e
        }
    }

    function tj(e) {
        return {
            sectionType: "dota2_both_teams_roshan",
            data: e
        }
    }

    function tC(e) {
        return {
            sectionType: "dota2_both_teams_barracks",
            data: e
        }
    }

    function t_(e) {
        return {
            sectionType: "dota2_ultra_kill",
            data: e
        }
    }

    function tT(e) {
        return {
            sectionType: "dota2_rampage",
            data: e
        }
    }

    function tM(e) {
        return {
            sectionType: "cs2_odd_even_total_kills",
            data: e
        }
    }

    function tN(e) {
        return {
            sectionType: "cs2_odd_even_total_rounds",
            data: e
        }
    }

    function tI(e) {
        return {
            sectionType: "lol_both_teams_baron",
            data: e
        }
    }

    function tP(e) {
        return {
            sectionType: "lol_both_teams_dragon",
            data: e
        }
    }

    function tE(e) {
        return {
            sectionType: "lol_both_teams_inhibitors",
            data: e
        }
    }

    function tA(e) {
        return {
            sectionType: "lol_quadra_kill",
            data: e
        }
    }

    function tO(e) {
        return {
            sectionType: "lol_penta_kill",
            data: e
        }
    }

    function tD(e) {
        return {
            sectionType: "lol_odd_even_total_kills",
            data: e
        }
    }

    function tL(e) {
        return (0, t.jsx)(td, {
            type: e.sectionType,
            data: e.data,
            value: e.data.market.slug
        }, e.data.market.slug)
    }

    function tz(e) {
        return (0, t.jsx)(td, {
            type: "ufc_method_of_victory",
            data: e,
            value: e.market.slug
        }, e.market.slug)
    }

    function tR(e) {
        return (0, t.jsx)(td, {
            type: "cricket_match_to_go_till",
            data: e,
            value: e.market.slug
        }, e.market.slug)
    }

    function tF(e) {
        return (0, t.jsx)(td, {
            type: "parlays",
            data: e,
            value: e.market.slug
        }, e.market.slug)
    }
    e.s(["SportsFooterSection", () => rk], 344500);
    var t$ = e.i(992805),
        tB = e.i(566160),
        tq = e.i(944277),
        tV = e.i(215959),
        tH = e.i(591925);
    let tU = {
            hidden: {
                opacity: 0,
                transition: { ...eS.opacityTransition
                }
            },
            visible: {
                opacity: 1,
                transition: { ...eS.opacityTransition
                }
            }
        },
        tW = e => [...e].sort((e, t) => e.slug.localeCompare(t.slug)),
        tG = e => {
            let a, i, n, o, l, c = (0, r.c)(44),
                {
                    ref: d,
                    className: m
                } = e;
            c[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], c[0] = a) : a = c[0];
            let {
                event: p
            } = (0, u.useEventContext)(a), {
                moneyline: h,
                spreads: f,
                totals: x,
                nrfi: g,
                btts: v,
                childMoneyline: y,
                firstHalfMoneyline: b,
                firstHalfSpreads: k,
                firstHalfTotals: w,
                firstInningsTotals: j,
                secondInningsTotals: C
            } = (0, s.useSportsMarketsSections)(p.slug);
            if (c[1] !== v || c[2] !== y || c[3] !== b || c[4] !== k || c[5] !== w || c[6] !== j || c[7] !== h || c[8] !== g || c[9] !== C || c[10] !== f || c[11] !== x) {
                if (i = [], h ? .type === "neg-risk") {
                    let e;
                    c[13] !== h.markets ? (e = tW(h.markets), c[13] = h.markets, c[14] = e) : e = c[14], i.push(...e)
                } else h ? .type === "binary" && i.push(h.market);
                if (f ? .length) {
                    let e;
                    c[15] !== f ? (e = tW(f.map(tZ)), c[15] = f, c[16] = e) : e = c[16], i.push(...e)
                }
                if (x ? .length) {
                    let e;
                    c[17] !== x ? (e = tW(x.map(tK)), c[17] = x, c[18] = e) : e = c[18], i.push(...e)
                }
                if (g ? .length) {
                    let e;
                    c[19] !== g ? (e = tW(g.map(tY)), c[19] = g, c[20] = e) : e = c[20], i.push(...e)
                }
                if (v ? .length) {
                    let e;
                    c[21] !== v ? (e = tW(v.map(tQ)), c[21] = v, c[22] = e) : e = c[22], i.push(...e)
                }
                if (y ? .length) {
                    let e;
                    c[23] !== y ? (e = tW(y.map(tX)), c[23] = y, c[24] = e) : e = c[24], i.push(...e)
                }
                if (b ? .type === "neg-risk") {
                    let e;
                    c[25] !== b.markets ? (e = tW(b.markets), c[25] = b.markets, c[26] = e) : e = c[26], i.push(...e)
                } else b ? .type === "binary" && i.push(b.market);
                if (k ? .length) {
                    let e;
                    c[27] !== k ? (e = tW(k.map(tJ)), c[27] = k, c[28] = e) : e = c[28], i.push(...e)
                }
                if (w ? .length) {
                    let e;
                    c[29] !== w ? (e = tW(w.map(t0)), c[29] = w, c[30] = e) : e = c[30], i.push(...e)
                }
                if (j ? .length) {
                    let e;
                    c[31] !== j ? (e = tW(j.map(t1)), c[31] = j, c[32] = e) : e = c[32], i.push(...e)
                }
                if (C ? .length) {
                    let e;
                    c[33] !== C ? (e = tW(C.map(t2)), c[33] = C, c[34] = e) : e = c[34], i.push(...e)
                }
                c[1] = v, c[2] = y, c[3] = b, c[4] = k, c[5] = w, c[6] = j, c[7] = h, c[8] = g, c[9] = C, c[10] = f, c[11] = x, c[12] = i
            } else i = c[12];
            let _ = i;
            c[35] !== m ? (n = (0, S.cn)("relative w-full h-max", m), c[35] = m, c[36] = n) : n = c[36];
            let T = _.length > 1;
            return c[37] !== _ || c[38] !== T ? (o = (0, t.jsx)(tH.default, {
                sortedMarkets: _,
                shouldShowDropdown: T
            }), c[37] = _, c[38] = T, c[39] = o) : o = c[39], c[40] !== d || c[41] !== n || c[42] !== o ? (l = (0, t.jsx)(tV.motion.div, {
                ref: d,
                className: n,
                variants: tU,
                initial: "hidden",
                animate: "visible",
                exit: "hidden",
                children: o
            }), c[40] = d, c[41] = n, c[42] = o, c[43] = l) : l = c[43], l
        };

    function tZ(e) {
        return { ...e.market,
            groupItemTitle: e.market.groupItemTitle ? ? e.label
        }
    }

    function tK(e) {
        return { ...e.market,
            groupItemTitle: e.market.groupItemTitle ? ? e.label
        }
    }

    function tY(e) {
        return { ...e.market,
            groupItemTitle: e.market.groupItemTitle ? ? e.label
        }
    }

    function tQ(e) {
        return { ...e.market,
            groupItemTitle: e.market.groupItemTitle ? ? e.label
        }
    }

    function tX(e) {
        return { ...e.market,
            groupItemTitle: e.market.groupItemTitle ? ? e.label
        }
    }

    function tJ(e) {
        return { ...e.market,
            groupItemTitle: e.market.groupItemTitle ? ? e.label
        }
    }

    function t0(e) {
        return { ...e.market,
            groupItemTitle: e.market.groupItemTitle ? ? e.label
        }
    }

    function t1(e) {
        return { ...e.market,
            groupItemTitle: e.market.groupItemTitle ? ? e.label
        }
    }

    function t2(e) {
        return { ...e.market,
            groupItemTitle: e.market.groupItemTitle ? ? e.label
        }
    }
    tG.displayName = "AggregatedActivitySection";
    var t3 = e.i(664318),
        t4 = e.i(122538),
        t5 = e.i(635973),
        t6 = e.i(219469),
        t9 = e.i(81940),
        t8 = e.i(208956),
        t7 = e.i(16674),
        re = e.i(363966),
        rt = e.i(105418),
        rr = e.i(85510),
        ra = e.i(100175),
        ri = e.i(619264),
        rn = e.i(400635),
        rs = e.i(177412),
        ro = e.i(510954),
        rl = e.i(57096),
        rc = e.i(212017),
        rd = e.i(619305),
        ru = e.i(572902),
        rm = e.i(702502);
    ({ ...eS.layoutTransition,
        opacity: { ...eS.opacityTransition
        }
    });
    let rp = {
            hidden: {
                opacity: 0
            },
            visible: {
                opacity: 1
            }
        },
        rh = {
            ease: eS.transition.ease,
            duration: .15,
            opacity: {
                ease: eS.opacityTransition.ease,
                duration: .15
            }
        },
        rf = Array.from({
            length: 8
        }, (e, t) => `holder-skeleton-${t}`),
        rx = e => e.alias ? e.alias : e.name,
        rg = e => {
            let a, i, n, s, o, l, c, d, u, m, p, h, x, g, v, y, b, k, w, j, C, _, T, M, N, I, P, E, A, O, D, L = (0, r.c)(84),
                {
                    holder: z,
                    color: R,
                    place: F
                } = e,
                $ = (0, f.useTranslations)();
            if (L[0] !== z) {
                let e;
                a = (0, rd.getAddress)(z), i = (0, ri.formatUserName)(z, 100), L[5] !== z.amount ? (e = (0, rd.formatShares)(z.amount), L[5] = z.amount, L[6] = e) : e = L[6], n = e, s = (0, rm.createProfileUrl)({
                    proxyWallet: a,
                    name: i
                }), L[0] = z, L[1] = a, L[2] = i, L[3] = n, L[4] = s
            } else a = L[1], i = L[2], n = L[3], s = L[4];
            let B = s,
                q = z.loading && "flex w-[32px] h-[32px] rounded-full";
            L[7] !== q ? (o = (0, S.cn)("hidden", q), L[7] = q, L[8] = o) : o = L[8], L[9] !== o ? (l = (0, t.jsx)(t3.Skeleton, {
                className: o
            }), L[9] = o, L[10] = l) : l = L[10];
            let V = z.loading && "hidden";
            L[11] !== V ? (c = (0, S.cn)("relative", V), L[11] = V, L[12] = c) : c = L[12], L[13] !== F ? (d = (0, t.jsx)(rn.Badge, {
                children: F
            }), L[13] = F, L[14] = d) : d = L[14], L[15] !== z.profileImage || L[16] !== z.proxyWallet ? (u = (0, t.jsx)(re.default, {
                address: z.proxyWallet,
                alt: z.proxyWallet,
                height: 32,
                profileImage: z.profileImage,
                quality: 100,
                width: 32
            }), L[15] = z.profileImage, L[16] = z.proxyWallet, L[17] = u) : u = L[17], L[18] !== a || L[19] !== z || L[20] !== u ? (m = (0, t.jsx)(rs.ProfileHoverCard, {
                user: z,
                address: a,
                children: u
            }), L[18] = a, L[19] = z, L[20] = u, L[21] = m) : m = L[21], L[22] !== B || L[23] !== c || L[24] !== d || L[25] !== m ? (p = (0, t.jsxs)(t8.default, {
                href: B,
                prefetch: !1,
                className: c,
                children: [d, m]
            }), L[22] = B, L[23] = c, L[24] = d, L[25] = m, L[26] = p) : p = L[26];
            let H = z.loading && "overflow-visible";
            L[27] !== H ? (h = (0, S.cn)("flex flex-col lg:flex-row flex-1 min-w-0 overflow-hidden", H), L[27] = H, L[28] = h) : h = L[28];
            let U = z.loading && "flex w-3/4 h-[15px] translate-y-[-2px] lg:h-[21px] lg:translate-y-0";
            L[29] !== U ? (x = (0, S.cn)("hidden", U), L[29] = U, L[30] = x) : x = L[30], L[31] !== x ? (g = (0, t.jsx)(t3.Skeleton, {
                className: x
            }), L[31] = x, L[32] = g) : g = L[32];
            let W = z.loading && "hidden";
            L[33] !== W ? (v = (0, S.cn)("flex flex-col flex-1", W), L[33] = W, L[34] = v) : v = L[34], L[35] !== i ? (y = (0, t.jsx)("span", {
                className: "text-text text-sm font-medium truncate decoration-solid underline decoration-transparent hover:decoration-text transition-colors",
                children: i
            }), L[35] = i, L[36] = y) : y = L[36], L[37] !== a || L[38] !== z || L[39] !== y ? (b = (0, t.jsx)(rs.ProfileHoverCard, {
                user: z,
                address: a,
                children: y
            }), L[37] = a, L[38] = z, L[39] = y, L[40] = b) : b = L[40], L[41] !== z.verified ? (k = z ? .verified && (0, t.jsx)("div", {
                className: "shrink-0 flex items-center",
                children: (0, t.jsx)(ra.VerifiedBadge, {
                    size: "small"
                })
            }), L[41] = z.verified, L[42] = k) : k = L[42], L[43] !== b || L[44] !== k ? (w = (0, t.jsxs)("div", {
                className: "flex items-center gap-1",
                children: [b, k]
            }), L[43] = b, L[44] = k, L[45] = w) : w = L[45];
            let G = z.loading && "flex w-1/2 h-[12px] translate-y-[2px]";
            L[46] !== G ? (j = (0, S.cn)("hidden", G), L[46] = G, L[47] = j) : j = L[47], L[48] !== j ? (C = (0, t.jsx)(t3.Skeleton, {
                className: j
            }), L[48] = j, L[49] = C) : C = L[49], L[50] !== R || L[51] !== z.loading || L[52] !== n || L[53] !== $ ? (_ = !z.loading && (0, t.jsx)(rc.AnimatedShares, {
                value: `${n} ${$("topHolders.shares")}`,
                className: (0, S.cn)("text-xs font-medium truncate", "blue" === R && "text-text-brand", "green" === R && "text-green-600 dark:text-green-400", "red" === R && "text-red-500")
            }), L[50] = R, L[51] = z.loading, L[52] = n, L[53] = $, L[54] = _) : _ = L[54], L[55] !== C || L[56] !== _ ? (T = (0, t.jsxs)("div", {
                className: "flex lg:hidden",
                children: [C, _]
            }), L[55] = C, L[56] = _, L[57] = T) : T = L[57], L[58] !== v || L[59] !== w || L[60] !== T ? (M = (0, t.jsxs)("div", {
                className: v,
                children: [w, T]
            }), L[58] = v, L[59] = w, L[60] = T, L[61] = M) : M = L[61], L[62] !== h || L[63] !== g || L[64] !== M ? (N = (0, t.jsxs)("div", {
                className: h,
                children: [g, M]
            }), L[62] = h, L[63] = g, L[64] = M, L[65] = N) : N = L[65], L[66] !== p || L[67] !== N || L[68] !== l ? (I = (0, t.jsxs)("div", {
                className: "flex flex-1 items-center gap-3 min-w-0",
                children: [l, p, N]
            }), L[66] = p, L[67] = N, L[68] = l, L[69] = I) : I = L[69];
            let Z = z.loading && "flex w-[60px] h-[21px]";
            return L[70] !== Z ? (P = (0, S.cn)("hidden", Z), L[70] = Z, L[71] = P) : P = L[71], L[72] !== P ? (E = (0, t.jsx)(t3.Skeleton, {
                className: P
            }), L[72] = P, L[73] = E) : E = L[73], L[74] !== R || L[75] !== z.loading || L[76] !== n ? (A = !z.loading && (0, t.jsx)(rc.AnimatedShares, {
                value: n,
                className: (0, S.cn)("text-sm font-medium truncate", "blue" === R && "text-text-brand", "green" === R && "text-green-600 dark:text-green-400", "red" === R && "text-red-500")
            }), L[74] = R, L[75] = z.loading, L[76] = n, L[77] = A) : A = L[77], L[78] !== E || L[79] !== A ? (O = (0, t.jsxs)("div", {
                className: "justify-end hidden lg:flex",
                children: [E, A]
            }), L[78] = E, L[79] = A, L[80] = O) : O = L[80], L[81] !== I || L[82] !== O ? (D = (0, t.jsxs)("div", {
                className: "flex w-full justify-between items-center gap-2 border-b h-[60px] lg:h-[56px]",
                children: [I, O]
            }), L[81] = I, L[82] = O, L[83] = D) : D = L[83], D
        },
        rv = e => {
            let a, i, n = (0, r.c)(3),
                {
                    place: s
                } = e;
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                address: "",
                amount: 0,
                asset: "",
                outcomeIndex: 0,
                name: "",
                pseudonym: "",
                proxyWallet: "",
                loading: !0
            }, n[0] = a) : a = n[0];
            let o = a;
            return n[1] !== s ? (i = (0, t.jsx)(rg, {
                holder: o,
                color: "blue",
                place: s
            }), n[1] = s, n[2] = i) : i = n[2], i
        },
        ry = ({
            ref: e,
            className: r
        }) => {
            let a = (0, f.useTranslations)(),
                {
                    event: n,
                    isNegRiskSportsEvent: o
                } = (0, u.useEventContext)(["event", "isNegRiskSportsEvent"]),
                {
                    activeMarket: l
                } = (0, d.useEventActiveMarketContext)(["activeMarket"]),
                {
                    moneyline: m
                } = (0, s.useSportsMarketsSections)(n.slug),
                [p, h] = (0, rr.useMeasure)(),
                [x, g] = i.default.useState(10);
            i.default.useEffect(() => {
                g(10)
            }, [l.conditionId]);
            let {
                data: v,
                fetchNextPage: y,
                hasNextPage: b,
                isFetching: k,
                isFetchingNextPage: w
            } = (0, t5.useInfiniteQuery)({
                queryKey: ro.queryKeys[rl.QueryKey.Holders].infinite(l.conditionId).queryKey,
                queryFn: rt.getTopHoldersInfiniteFetcher,
                enabled: "string" == typeof l ? .conditionId,
                placeholderData: t4.keepPreviousData,
                gcTime: 6e5,
                staleTime: 6e4,
                refetchOnMount: !1,
                refetchOnWindowFocus: !1,
                initialPageParam: 0,
                getNextPageParam: rt.getHoldersNextPageParam
            }), j = i.default.useMemo(() => (0, rt.mergeHolderPages)(v ? .pages), [v ? .pages]), {
                data: C,
                isLive: _
            } = (0, ru.useTopHoldersLive)({
                baseData: j,
                conditionId: l.conditionId
            }), T = a("topHolders.holders"), {
                leftProperties: M,
                rightProperties: N
            } = i.default.useMemo(() => {
                if (o || (0, c.isNegRiskSportsMarketType)(l.sportsMarketType)) return {
                    leftProperties: {
                        name: `Yes ${T}`,
                        logo: void 0,
                        team: void 0,
                        color: "blue"
                    },
                    rightProperties: {
                        name: `No ${T}`,
                        logo: void 0,
                        team: void 0,
                        color: "blue"
                    }
                };
                if ("totals" === l.sportsMarketType && l.line) {
                    let e = Math.abs(l.line).toFixed(1);
                    return {
                        leftProperties: {
                            name: `O ${e} ${T}`,
                            logo: void 0,
                            team: void 0,
                            color: "green"
                        },
                        rightProperties: {
                            name: `U ${e} ${T}`,
                            logo: void 0,
                            team: void 0,
                            color: "red"
                        }
                    }
                }
                let e = [];
                if (l.teams && 2 === l.teams.length) e.push(...l.teams);
                else if (m ? .type === "binary" && m.market.teams && 2 === m.market.teams.length) e.push(...m.market.teams);
                else if (m ? .type === "neg-risk" && 3 === m.markets.length) {
                    let {
                        home: t,
                        away: r
                    } = m.markets.reduce((e, t) => (t.team && "home" === t.negRiskSportsMarketType && (e.home = t.team), t.team && "away" === t.negRiskSportsMarketType && (e.away = t.team), e), {
                        home: void 0,
                        away: void 0
                    });
                    t && r && (e.push(t), e.push(r))
                }
                if (e && 2 === e.length) {
                    let t, r;
                    return ("spreads" === l.sportsMarketType || "first_half_spreads" === l.sportsMarketType) && l.line && (t = ` -${Math.abs(l.line).toFixed(1)}`, r = ` +${Math.abs(l.line).toFixed(1)}`), {
                        leftProperties: {
                            name: `${rx(e[0])}${t??""} ${T}`,
                            logo: e[0].logo,
                            team: e[0],
                            color: "green"
                        },
                        rightProperties: {
                            name: `${rx(e[1])}${r??""} ${T}`,
                            logo: e[1].logo,
                            team: e[1],
                            color: "red"
                        }
                    }
                }
                return {
                    leftProperties: {
                        name: `${l.outcomes[0]} ${T}`,
                        logo: void 0,
                        team: void 0,
                        color: "green"
                    },
                    rightProperties: {
                        name: `${l.outcomes[1]} ${T}`,
                        logo: void 0,
                        team: void 0,
                        color: "red"
                    }
                }
            }, [T, o, l.outcomes, m, l.sportsMarketType, l.line, l.invertOutcomesVisually]), {
                leftHolders: I,
                rightHolders: P,
                totalHoldersAvailable: E
            } = i.default.useMemo(() => {
                let e, t, r = {
                    leftHolders: void 0,
                    rightHolders: void 0,
                    totalHoldersAvailable: 0
                };
                if (!Array.isArray(C)) return r;
                let a = l ? .clobTokenIds ? .[0] ? ? !1,
                    i = l ? .clobTokenIds ? .[1] ? ? !1;
                if (!a || !i || (C[0] ? .token === a && C[1] ? .token === i ? (e = C[0], t = C[1]) : (e = C.find(e => e.token === a), t = C.find(e => e.token === i)), !e || !t)) return r;
                let n = Math.max(e.holders ? .length ? ? 0, t.holders ? .length ? ? 0);
                return {
                    leftHolders: { ...e,
                        holders: e.holders ? .slice(0, x) ? ? []
                    },
                    rightHolders: { ...t,
                        holders: t.holders ? .slice(0, x) ? ? []
                    },
                    totalHoldersAvailable: n
                }
            }, [C, l, x]), A = i.default.useMemo(() => x < E || b, [x, E, b]), {
                ref: O,
                inView: D
            } = (0, t7.useInView)({
                threshold: 0
            });
            i.default.useEffect(() => {
                D && !w && (x < E ? g(Math.min(x + 10, rt.HOLDERS_MAX_PER_SIDE)) : b && x < rt.HOLDERS_MAX_PER_SIDE && y())
            }, [D, w, x, E, b, y]);
            let L = i.default.useRef(null),
                [z, R] = i.default.useState(null),
                F = (0, Q.useComposedRefs)(L, p),
                $ = i.default.useMemo(() => {
                    let e = h.height;
                    return z ? Math.min(Math.max(Math.abs(e - (z ? ? 0)) / 500, .15), .27) : .15
                }, [h.height, z]);
            return i.default.useEffect(() => {
                R(h.height)
            }, [h.height]), (0, t.jsx)(tV.motion.div, {
                ref: e,
                initial: {
                    height: "auto",
                    opacity: 0
                },
                animate: {
                    height: h.height > 1 ? h.height : "auto",
                    opacity: 1
                },
                exit: {
                    opacity: 0
                },
                transition: rh,
                className: "relative w-full lg:overflow-hidden",
                children: (0, t.jsx)("div", {
                    ref: F,
                    className: "relative h-max w-full",
                    children: (0, t.jsx)(t6.AnimatePresence, {
                        initial: !1,
                        mode: "popLayout",
                        custom: l.slug,
                        children: (0, t.jsxs)(tV.motion.div, {
                            className: (0, S.cn)("relative w-full h-max", r),
                            variants: rp,
                            initial: "hidden",
                            animate: "visible",
                            exit: "hidden",
                            transition: {
                                ease: eS.opacityTransition.ease,
                                duration: $
                            },
                            children: [(0, t.jsx)(t6.AnimatePresence, {
                                children: _ && !l ? .closed && (0, t.jsx)(tV.motion.div, {
                                    initial: {
                                        opacity: 0
                                    },
                                    animate: {
                                        opacity: 1
                                    },
                                    exit: {
                                        opacity: 0
                                    },
                                    transition: {
                                        duration: .3
                                    },
                                    className: "flex justify-end px-1 py-1",
                                    children: (0, t.jsxs)("div", {
                                        className: "flex items-center gap-2.5",
                                        children: [(0, t.jsxs)("span", {
                                            className: "relative flex h-2.5 w-2.5 items-center justify-center",
                                            children: [(0, t.jsx)("span", {
                                                className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-red-500 opacity-85 [animation-duration:1.2s]"
                                            }), (0, t.jsx)("span", {
                                                className: "relative inline-flex h-2 w-2 rounded-full bg-red-500"
                                            })]
                                        }), (0, t.jsx)("span", {
                                            className: "text-sm font-semibold text-red-500",
                                            children: a("topHolders.live")
                                        })]
                                    })
                                })
                            }), (0, t.jsxs)("div", {
                                className: "grid grid-cols-2 w-full pb-1",
                                children: [(0, t.jsxs)("div", {
                                    className: "flex-1 flex flex-col w-full",
                                    children: [(0, t.jsxs)("div", {
                                        className: "flex w-full justify-between items-center h-[42px] border-b bg-background pr-2.5",
                                        children: [(0, t.jsxs)("div", {
                                            className: "flex items-center gap-2",
                                            children: [!1, (0, t.jsx)("p", {
                                                className: "text-text text-sm font-medium",
                                                children: M.name
                                            })]
                                        }), (0, t.jsx)("p", {
                                            className: "text-[10px] tracking-wider text-text-secondary font-medium uppercase hidden lg:flex",
                                            children: a("topHolders.shares")
                                        })]
                                    }), (0, t.jsxs)("div", {
                                        className: "w-full relative z-[1] pr-2.5",
                                        children: [void 0 === I && k && (0, t.jsx)("div", {
                                            className: "flex flex-col w-full",
                                            children: rf.map((e, r) => (0, t.jsx)(rv, {
                                                place: r + 1
                                            }, e))
                                        }), (void 0 !== I && !I.holders.length || void 0 === I) && !k && (0, t.jsx)("div", {
                                            className: "flex h-[60px] lg:h-[56px] items-center",
                                            children: (0, t.jsx)("p", {
                                                className: "text-text-secondary text-xs",
                                                children: a("topHolders.noNameHolders").replace("{name}", M.name)
                                            })
                                        }), void 0 !== I && !!I.holders.length && (0, t.jsx)(t9.LayoutGroup, {
                                            id: `sports-left-${l.conditionId}`,
                                            children: (0, t.jsx)("div", {
                                                className: "flex flex-col w-full",
                                                children: I.holders.map((e, r) => (0, t.jsx)(tV.motion.div, {
                                                    layout: !0,
                                                    transition: {
                                                        layout: rc.holderRowLayoutTransition
                                                    },
                                                    children: (0, t.jsx)(rg, {
                                                        holder: e,
                                                        color: M.color,
                                                        place: r + 1
                                                    })
                                                }, e.address))
                                            })
                                        })]
                                    })]
                                }), (0, t.jsxs)("div", {
                                    className: "flex-1 flex flex-col w-full",
                                    children: [(0, t.jsxs)("div", {
                                        className: "flex w-full justify-between items-center h-[42px] border-b bg-background pl-2.5",
                                        children: [(0, t.jsxs)("div", {
                                            className: "flex items-center gap-2",
                                            children: [!1, (0, t.jsx)("p", {
                                                className: "text-text text-sm font-medium",
                                                children: N.name
                                            })]
                                        }), (0, t.jsx)("p", {
                                            className: "text-[10px] tracking-wider text-text-secondary font-medium uppercase hidden lg:flex",
                                            children: a("topHolders.shares")
                                        })]
                                    }), (0, t.jsxs)("div", {
                                        className: "w-full relative z-1 pl-2.5",
                                        children: [void 0 === P && k && (0, t.jsx)("div", {
                                            className: "flex flex-col w-full",
                                            children: rf.map((e, r) => (0, t.jsx)(rv, {
                                                place: r + 1
                                            }, e))
                                        }), (void 0 !== P && !P.holders.length || void 0 === P) && !k && (0, t.jsx)("div", {
                                            className: "flex h-[60px] lg:h-[56px] items-center",
                                            children: (0, t.jsx)("p", {
                                                className: "text-text-secondary text-xs",
                                                children: a("topHolders.noNameHolders").replace("{name}", N.name)
                                            })
                                        }), void 0 !== P && !!P.holders.length && (0, t.jsx)(t9.LayoutGroup, {
                                            id: `sports-right-${l.conditionId}`,
                                            children: (0, t.jsx)("div", {
                                                className: "flex flex-col w-full",
                                                children: P.holders.map((e, r) => (0, t.jsx)(tV.motion.div, {
                                                    layout: !0,
                                                    transition: {
                                                        layout: rc.holderRowLayoutTransition
                                                    },
                                                    children: (0, t.jsx)(rg, {
                                                        holder: e,
                                                        color: N.color,
                                                        place: r + 1
                                                    })
                                                }, e.address))
                                            })
                                        })]
                                    })]
                                })]
                            }), A && E > 0 ? (0, t.jsx)("div", {
                                ref: O,
                                className: "flex justify-center py-4",
                                children: w ? (0, t.jsx)("div", {
                                    className: "w-6 h-6 border-2 border-border border-t-text-primary rounded-full animate-spin"
                                }) : null
                            }) : null]
                        }, l.slug)
                    })
                })
            })
        };
    ry.displayName = "AggregatedHoldersSection";
    let rb = ["Comments", "Holders", "Positions", "Activity"],
        rk = () => {
            let e, a, n, s, o, l, c, d, m, p, h = (0, r.c)(25),
                x = (0, f.useTranslations)();
            h[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["events"], h[0] = e) : e = h[0];
            let {
                events: g
            } = (0, u.useEventContext)(e), [v, y] = i.default.useState(rb[0]);
            h[1] !== g ? (a = (0, eJ.getAllSportsMarkets)(g), h[1] = g, h[2] = a) : a = h[2];
            let b = a;
            h[3] !== x ? (n = rb.map(e => ({
                value: e,
                label: ({
                    Comments: x("events.lowerState.comments"),
                    Holders: x("events.lowerState.holders"),
                    Positions: x("events.lowerState.positions"),
                    Activity: x("events.lowerState.activity")
                })[e]
            })), h[3] = x, h[4] = n) : n = h[4];
            let k = n;
            return h[5] !== v || h[6] !== k ? (s = (0, t.jsx)(t$.TextTabs, {
                items: k,
                value: v,
                onValueChange: y,
                className: "mt-8 mb-1",
                headingLevel: "h2"
            }), h[5] = v, h[6] = k, h[7] = s) : s = h[7], h[8] !== v ? (o = "Comments" === v && (0, t.jsx)("div", {
                className: "w-full relative",
                children: (0, t.jsx)("div", {
                    className: "w-full pt-4",
                    children: (0, t.jsx)(tB.SportsComments, {})
                })
            }), h[8] = v, h[9] = o) : o = h[9], h[10] !== v ? (l = "Activity" === v && (0, t.jsx)("div", {
                className: "w-full pt-4",
                children: (0, t.jsx)(tG, {})
            }), h[10] = v, h[11] = l) : l = h[11], h[12] !== v ? (c = "Holders" === v && (0, t.jsx)("div", {
                className: "w-full pt-4",
                children: (0, t.jsx)(ry, {})
            }), h[12] = v, h[13] = c) : c = h[13], h[14] !== b || h[15] !== v ? (d = "Positions" === v && (0, t.jsx)("div", {
                className: "w-full pt-4",
                children: (0, t.jsx)(tq.default, {
                    sortedMarkets: b
                })
            }), h[14] = b, h[15] = v, h[16] = d) : d = h[16], h[17] !== o || h[18] !== l || h[19] !== c || h[20] !== d ? (m = (0, t.jsxs)("div", {
                className: "scroll-mt-[45px] lg:scroll-mt-[calc(var(--navbar-height)+var(--expanded-scoreboard-height)+16px)]",
                children: [o, l, c, d]
            }), h[17] = o, h[18] = l, h[19] = c, h[20] = d, h[21] = m) : m = h[21], h[22] !== s || h[23] !== m ? (p = (0, t.jsxs)("div", {
                className: "w-full lg:mt-2",
                children: [s, m]
            }), h[22] = s, h[23] = m, h[24] = p) : p = h[24], p
        }
}, 467126, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340),
        a = e.i(987222),
        i = e.i(891685);
    let n = "pm_one_click_enabled",
        s = "pm-one-click-enabled-change";
    e.s(["useOneClickEligible", 0, function() {
        let e, r, n = (0, t.c)(3);
        n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], n[0] = e) : e = n[0];
        let {
            event: s
        } = (0, i.useEventContext)(e), o = s ? .slug;
        return n[1] !== o ? (r = (0, a.matchesShortDurationUpDown)(o) || (0, a.matchesHourlyUpDown)(o) || (0, a.matchesFourHourUpDown)(o), n[1] = o, n[2] = r) : r = n[2], r
    }, "useOneClickEnabled", 0, function() {
        let e, a, i, o, l = (0, t.c)(6),
            [c, d] = r.default.useState(!0),
            [u, m] = r.default.useState(!1);
        l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = () => {
            let e = () => d(function() {
                try {
                    let e = window.localStorage.getItem(n);
                    if (null === e) return !0;
                    let t = JSON.parse(e);
                    if ("boolean" == typeof t) return t;
                    return !0
                } catch {
                    return !0
                }
            }());
            return e(), m(!0), window.addEventListener("storage", e), window.addEventListener(s, e), () => {
                window.removeEventListener("storage", e), window.removeEventListener(s, e)
            }
        }, a = [], l[0] = e, l[1] = a) : (e = l[0], a = l[1]), r.default.useEffect(e, a), l[2] === Symbol.for("react.memo_cache_sentinel") ? (i = e => {
            d(e);
            try {
                window.localStorage.setItem(n, JSON.stringify(e)), window.dispatchEvent(new Event(s))
            } catch {}
        }, l[2] = i) : i = l[2];
        let p = i;
        return l[3] !== c || l[4] !== u ? (o = [c, p, u], l[3] = c, l[4] = u, l[5] = o) : o = l[5], o
    }])
}, 85457, 893849, 561992, 502941, e => {
    "use strict";
    e.s(["default", () => q], 85457);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(992805),
        i = e.i(140527),
        n = e.i(416340),
        s = e.i(327673),
        o = e.i(566160),
        l = e.i(66674),
        c = e.i(91070),
        d = e.i(193789),
        u = e.i(467772),
        m = e.i(982214),
        p = e.i(715877),
        h = e.i(925437),
        f = e.i(661879),
        x = e.i(591925),
        g = e.i(222691),
        v = e.i(560127),
        y = e.i(944277),
        b = e.i(619305),
        k = e.i(604777),
        w = e.i(870555),
        S = e.i(399336),
        j = e.i(891685),
        C = e.i(6204),
        _ = e.i(631222),
        T = e.i(48331),
        M = e.i(909838),
        N = e.i(748960),
        I = e.i(234097),
        P = e.i(186568),
        E = e.i(112503),
        A = e.i(272436),
        O = e.i(987228),
        D = e.i(344500),
        L = e.i(118818),
        z = e.i(740594),
        R = e.i(880809),
        F = e.i(467126);

    function $() {
        let e, t, a = (0, r.c)(2),
            i = (0, F.useOneClickEligible)(),
            [n, , s] = (0, F.useOneClickEnabled)();
        a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side"], a[0] = e) : e = a[0];
        let {
            side: o
        } = (0, R.useTradeContext)(e);
        a[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["activeMarket"], a[1] = t) : t = a[1];
        let {
            activeMarket: l
        } = (0, S.useEventActiveMarketContext)(t);
        return i && s && n && o === z.Side.BUY && !l.closed
    }
    e.s(["useShowOneTapDock", 0, $], 893849);
    let B = e => {
            let i, s, o, l, m, p, h, f = (0, r.c)(20),
                {
                    tabs: x,
                    eventSlug: g
                } = e,
                v = (0, k.useTranslations)(),
                y = (0, d.useSportsSlugInit)(),
                [b, w] = n.default.useState(y ? ? u.DEFAULT_TAB),
                S = (0, c.useFilteredTabs)(x, g);
            f[0] !== S || f[1] !== v ? (i = S ? .map(e => ({
                value: e.value,
                label: v(e.labelKey)
            })) ? ? [], f[0] = S, f[1] = v, f[2] = i) : i = f[2];
            let j = i;
            if (f[3] !== b || f[4] !== S ? (s = () => {
                    S && !S.some(e => e.value === b) && w(S[0] ? .value ? ? u.DEFAULT_TAB)
                }, o = [S, b], f[3] = b, f[4] = S, f[5] = s, f[6] = o) : (s = f[5], o = f[6]), n.default.useEffect(s, o), !S || 0 === S.length) {
                let e;
                return f[7] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(O.SportsMarketsSection, {}), f[7] = e) : e = f[7], e
            }
            if (f[8] === Symbol.for("react.memo_cache_sentinel") ? (l = e => w(e), f[8] = l) : l = f[8], f[9] !== b || f[10] !== j ? (m = (0, t.jsx)(a.TextTabs, {
                    items: j,
                    value: b,
                    onValueChange: l,
                    className: "mb-1"
                }), f[9] = b, f[10] = j, f[11] = m) : m = f[11], f[12] !== b || f[13] !== S) {
                let e;
                f[15] !== b ? (e = e => b === e.value ? (0, t.jsx)(O.SportsMarketsSection, {
                    tab: e.value
                }, e.value) : null, f[15] = b, f[16] = e) : e = f[16], p = S.map(e), f[12] = b, f[13] = S, f[14] = p
            } else p = f[14];
            return f[17] !== m || f[18] !== p ? (h = (0, t.jsxs)("div", {
                className: "relative w-full",
                children: [m, p]
            }), f[17] = m, f[18] = p, f[19] = h) : h = f[19], h
        },
        q = e => {
            let i, c, d, k, O, z, R, F, q, W, G, Z, K, Y, Q, X, J, ee, et, er, ea, ei, en, es, eo, el = (0, r.c)(93),
                {
                    mode: ec
                } = e,
                ed = void 0 === ec ? "single" : ec;
            el[0] === Symbol.for("react.memo_cache_sentinel") ? (i = ["event", "eventSettings", "hitMarketChartData"], el[0] = i) : i = el[0];
            let {
                event: eu,
                eventSettings: em,
                hitMarketChartData: ep
            } = (0, j.useEventContext)(i), eh = !!ep;
            el[1] === Symbol.for("react.memo_cache_sentinel") ? (c = ["activeMarket"], el[1] = c) : c = el[1];
            let {
                activeMarket: ef
            } = (0, S.useEventActiveMarketContext)(c), {
                lowerState: ex,
                lowerStateOptions: eg,
                setLowerState: ev
            } = (0, P.useEventDetail)(), ey = (0, f.useAnnotations)(eu ? .slug);
            el[2] === Symbol.for("react.memo_cache_sentinel") ? (d = ["isSportsPage"], el[2] = d) : d = el[2];
            let {
                isSportsPage: eb
            } = (0, C.useSportsContext)(d), {
                smpContentRef: ek
            } = (0, L.useMobileMarketContext)(), ew = $();
            el[3] !== eu.seriesSlug || el[4] !== eu.slug ? (k = (0, u.getLeagueFromSlug)(eu.seriesSlug) || (0, u.getLeagueFromSlug)(eu.slug), el[3] = eu.seriesSlug, el[4] = eu.slug, el[5] = k) : k = el[5];
            let eS = k;
            el[6] !== eS ? (O = (0, u.getTabsForLeague)(eS), el[6] = eS, el[7] = O) : O = el[7];
            let ej = O;
            el[8] !== ef ? (z = [ef], el[8] = ef, el[9] = z) : z = el[9];
            let eC = z,
                e_ = !eb;
            if (el[10] !== e_ || el[11] !== eg) {
                let e;
                el[13] !== e_ ? (e = e => e === N.LowerState.Comments ? e_ : e !== N.LowerState.Related, el[13] = e_, el[14] = e) : e = el[14], R = eg.filter(e).map(V), el[10] = e_, el[11] = eg, el[12] = R
            } else R = el[12];
            let eT = R;
            el[15] !== ex || el[16] !== eT || el[17] !== ev ? (F = () => {
                eT.find(e => e.value === ex) || ev(eT[0].value)
            }, el[15] = ex, el[16] = eT, el[17] = ev, el[18] = F) : F = el[18], el[19] !== ex || el[20] !== eT ? (q = [eT, ex], el[19] = ex, el[20] = eT, el[21] = q) : q = el[21], n.default.useEffect(F, q), el[22] !== eu.tags ? (W = eu.tags ? .some(H), el[22] = eu.tags, el[23] = W) : W = el[23];
            let eM = W;
            el[24] !== ef.closed ? (G = ef.closed && {
                chartWindow: h.CHART_WINDOWS[h.CHART_WINDOWS.length - 1]
            }, el[24] = ef.closed, el[25] = G) : G = el[25], el[26] !== eM ? (Z = eM && {
                initialWindow: "1h"
            }, el[26] = eM, el[27] = Z) : Z = el[27], el[28] !== G || el[29] !== Z ? (K = {
                annotationMode: "bottom-bar",
                mode: "single",
                outcomeMode: "single",
                height: 320,
                showOptions: !1,
                showAnnotationsDrawer: !0,
                ...G,
                ...Z
            }, el[28] = G, el[29] = Z, el[30] = K) : K = el[30];
            let eN = K,
                eI = (0, p.useConvertBinaryMarketToChartMarkets)(ef),
                {
                    priceMarketSettings: eP
                } = em,
                {
                    zeroIndexedTeam: eE,
                    oneIndexedTeam: eA
                } = (0, I.useSportsTeams)();
            e: {
                if (!eE || !eA) {
                    Y = "";
                    break e
                }
                let e = eE.name ? ? eE.alias,
                    t = eA.name ? ? eA.alias;Y = `${e} vs ${t}`
            }
            let eO = Y,
                eD = "group" === ed && "overflow-y-auto overflow-x-hidden w-screen px-4 relative overflow-auto overscroll-none [-webkit-overflow-scrolling:touch] scrollbar-none [&::-webkit-scrollbar]:hidden",
                eL = "group" === ed && (ew ? "pb-[180px]" : "pb-[100px]"),
                ez = "group" === ed && (eb ? "w-full" : "pt-2 w-screen px-4");
            return el[31] !== eD || el[32] !== eL || el[33] !== ez ? (Q = (0, w.cn)("flex w-full h-full flex-col", eD, eL, ez), el[31] = eD, el[32] = eL, el[33] = ez, el[34] = Q) : Q = el[34], el[35] !== eu || el[36] !== eb || el[37] !== ed ? (X = "group" === ed && eb && (0, t.jsx)(l.default, {
                event: eu
            }), el[35] = eu, el[36] = eb, el[37] = ed, el[38] = X) : X = el[38], el[39] !== ef.closed || el[40] !== eO || el[41] !== eb || el[42] !== ed ? (J = "group" === ed && (0, t.jsx)("div", {
                className: (0, w.cn)("flex w-full h-full", eb && "h-fit"),
                children: (0, t.jsxs)("div", {
                    className: "flex flex-col w-full justify-between",
                    children: [eb && (0, t.jsx)("h1", {
                        className: "mb-4 mt-1 text-lg font-medium text-center",
                        children: eO
                    }), (0, t.jsx)(A.MobileSmpViewHeader, {
                        resolved: !!ef.closed
                    })]
                })
            }), el[39] = ef.closed, el[40] = eO, el[41] = eb, el[42] = ed, el[43] = J) : J = el[43], el[44] !== eu.slug || el[45] !== eb || el[46] !== ed || el[47] !== ej ? (ee = "group" === ed && eb && (0, t.jsx)(B, {
                tabs: ej,
                eventSlug: eu.slug
            }), el[44] = eu.slug, el[45] = eb, el[46] = ed, el[47] = ej, el[48] = ee) : ee = el[48], el[49] !== eb || el[50] !== ed ? (et = "group" === ed && eb && (0, t.jsx)(D.SportsFooterSection, {}), el[49] = eb, el[50] = ed, el[51] = et) : et = el[51], el[52] !== ef.conditionId || el[53] !== ef.enableOrderBook || el[54] !== ey || el[55] !== eI || el[56] !== eN || el[57] !== eu || el[58] !== ep || el[59] !== eh || el[60] !== eb || el[61] !== ed || el[62] !== eP ? (er = 137 === _.MATIC_CONFIG.chainId && ef.enableOrderBook && (0, t.jsx)("div", {
                className: "block",
                children: ("single" === ed || !eb) && (0, t.jsxs)("div", {
                    className: (0, w.cn)("relative", eP.priceMarketsUiEnabled && ("hourly" === eP.variant || "fiveminute" === eP.variant || "fifteen" === eP.variant) && "overflow-visible"),
                    children: [!!eP.priceMarketsUiEnabled && ("hourly" === eP.variant || "daily" === eP.variant || "fiveminute" === eP.variant || "fifteen" === eP.variant) && (0, t.jsx)(g.PriceChart, {
                        event: eu,
                        height: 320,
                        timestamp: eP.timestamp,
                        etDate: eP.etDate,
                        utcDate: eP.utcDate,
                        name: eP.name,
                        abbreviation: eP.abbreviation,
                        assetType: eP.assetType
                    }), !eP.priceMarketsUiEnabled && eh && ep.symbol && ep.data.length > 0 && (0, t.jsx)(v.HitMarketChart, {
                        data: ep.data,
                        strikePrice: ep.strikePrice,
                        symbol: ep.symbol,
                        startDate: ep.startDate,
                        endDate: ep.endDate
                    }), (!eP.priceMarketsUiEnabled || "hourly" !== eP.variant && "daily" !== eP.variant && "fiveminute" !== eP.variant && "fifteen" !== eP.variant) && !(eh && ep ? .symbol && ep.data.length > 0) && (0, t.jsx)(m.GroupChart, {
                        markets: eI,
                        lowChanceMarkets: [],
                        resolvedMarkets: [],
                        event: eu,
                        options: eN,
                        annotations: ey
                    }), (0, t.jsx)(M.LiveActivityIndicator, {
                        conditionIds: [ef.conditionId].filter(Boolean),
                        className: (0, w.cn)(eP.priceMarketsUiEnabled && "hourly" === eP.variant && "bottom-[132px] lg:bottom-12")
                    })]
                })
            }), el[52] = ef.conditionId, el[53] = ef.enableOrderBook, el[54] = ey, el[55] = eI, el[56] = eN, el[57] = eu, el[58] = ep, el[59] = eh, el[60] = eb, el[61] = ed, el[62] = eP, el[63] = er) : er = el[63], el[64] !== ef.closed || el[65] !== ef.enableOrderBook || el[66] !== eb || el[67] !== eP ? (ea = ef.enableOrderBook && !ef.closed && !eb && (0, t.jsx)("div", {
                className: "block",
                children: (0, t.jsx)(s.OrderBookAccordion, {
                    className: "mt-4",
                    withVolume: eP.priceMarketsUiEnabled && ("hourly" === eP.variant || "daily" === eP.variant || "fiveminute" === eP.variant || "fifteen" === eP.variant),
                    variant: "narrow"
                })
            }), el[64] = ef.closed, el[65] = ef.enableOrderBook, el[66] = eb, el[67] = eP, el[68] = ea) : ea = el[68], el[69] !== eb ? (ei = !eb && (0, t.jsx)(E.MobileSmpTabs, {}), el[69] = eb, el[70] = ei) : ei = el[70], el[71] !== eb || el[72] !== ed ? (en = !eb && "group" === ed && (0, t.jsx)("div", {
                className: "block mt-4",
                children: (0, t.jsx)(T.EventAboutSection, {})
            }), el[71] = eb, el[72] = ed, el[73] = en) : en = el[73], el[74] !== eb || el[75] !== ex || el[76] !== eT || el[77] !== eC || el[78] !== ed || el[79] !== ev ? (es = !eb && "group" === ed && (0, t.jsxs)("div", {
                children: [(0, t.jsx)(a.TextTabs, {
                    items: eT,
                    value: ex,
                    onValueChange: e => ev(e),
                    className: "mt-10 mb-1",
                    id: "comments",
                    headingLevel: "h2"
                }), (0, t.jsxs)("div", {
                    className: "min-h-[400px]",
                    children: [ex === N.LowerState.Activity && (0, t.jsx)("div", {
                        className: "w-full",
                        children: (0, t.jsx)(x.default, {
                            sortedMarkets: eC
                        })
                    }), ex === N.LowerState.Comments && (0, t.jsx)("div", {
                        className: "w-full pt-6",
                        children: eb ? (0, t.jsx)(o.SportsComments, {}) : (0, t.jsx)(o.Comments, {})
                    }), ex === N.LowerState.Holders && (0, t.jsx)("div", {
                        className: "w-full pt-6",
                        children: (0, t.jsx)(b.default, {
                            sortedMarkets: eC
                        })
                    }), ex === N.LowerState.Positions && (0, t.jsx)("div", {
                        className: "w-full pt-6",
                        children: (0, t.jsx)(y.default, {
                            sortedMarkets: eC
                        })
                    })]
                })]
            }), el[74] = eb, el[75] = ex, el[76] = eT, el[77] = eC, el[78] = ed, el[79] = ev, el[80] = es) : es = el[80], el[81] !== ek || el[82] !== Q || el[83] !== X || el[84] !== J || el[85] !== ee || el[86] !== et || el[87] !== er || el[88] !== ea || el[89] !== ei || el[90] !== en || el[91] !== es ? (eo = (0, t.jsxs)("div", {
                id: "mobile-single-market-detail",
                ref: ek,
                className: Q,
                onClick: U,
                children: [X, J, ee, et, er, ea, ei, en, es]
            }), el[81] = ek, el[82] = Q, el[83] = X, el[84] = J, el[85] = ee, el[86] = et, el[87] = er, el[88] = ea, el[89] = ei, el[90] = en, el[91] = es, el[92] = eo) : eo = el[92], eo
        };

    function V(e) {
        return {
            label: e === N.LowerState.Holders ? "Top Holders" : e === N.LowerState.Positions ? "Positions" : (0, i.capitalize)(e),
            value: e
        }
    }

    function H(e) {
        return "1H" === e.slug
    }

    function U(e) {
        return e.stopPropagation()
    }
    var W = e.i(214901);
    let G = n.default.createContext({});

    function Z(e, t) {
        return e[t] = !0, e
    }

    function K(e) {
        return e ? .disconnect()
    }
    e.s(["MobileEventContextProvider", 0, e => {
        let a, i, s, o, l = (0, r.c)(9),
            {
                children: c
            } = e,
            [d, u] = n.default.useState("default");
        l[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], l[0] = a) : a = l[0];
        let {
            event: m
        } = (0, j.useEventContext)(a), p = 1 === m.markets.length;
        l[1] !== p || l[2] !== d ? (i = {
            view: d,
            setView: u,
            isSingleMarket: p
        }, l[1] = p, l[2] = d, l[3] = i) : i = l[3];
        let h = i;
        return l[4] !== c ? (s = (0, t.jsx)(W.EventPositionContextProvider, {
            children: c
        }), l[4] = c, l[5] = s) : s = l[5], l[6] !== s || l[7] !== h ? (o = (0, t.jsx)(G.Provider, {
            value: h,
            children: s
        }), l[6] = s, l[7] = h, l[8] = o) : o = l[8], o
    }, "useMobileEventContext", 0, () => n.default.useContext(G)], 561992), e.s(["default", 0, e => {
        let t, a, i, s = (0, r.c)(5);
        s[0] !== e ? (t = e.reduce(Z, {}), s[0] = e, s[1] = t) : t = s[1];
        let o = t,
            [l, c] = (0, n.useState)(o);
        return s[2] !== e ? (a = () => {
            let t = e.map(e => {
                let t = document.getElementById(e);
                if (!t) return null;
                let r = new IntersectionObserver(t => {
                    t.forEach(t => {
                        c(r => ({ ...r,
                            [e]: t.isIntersecting
                        }))
                    })
                });
                return r.observe(t), r
            });
            return () => {
                t.forEach(K)
            }
        }, i = [e], s[2] = e, s[3] = a, s[4] = i) : (a = s[3], i = s[4]), (0, n.useEffect)(a, i), l
    }], 502941)
}, 562549, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(839593);
    e.s(["IconCircleCheckFill24", 0, ({ ...e
    }) => t.default.createElement(r.Icon, {
        size: "24px",
        ...e
    }, t.default.createElement("path", {
        d: "m12,1C5.935,1,1,5.935,1,12s4.935,11,11,11,11-4.935,11-11S18.065,1,12,1Zm-1.951,16.463l-4.463-4.463,1.414-1.414,2.951,2.951,6.955-7.948,1.505,1.317-8.362,9.557Z",
        strokeWidth: "0",
        fill: "currentColor"
    }))])
}, 454266, 215885, e => {
    "use strict";
    e.s(["MobileDrawerControls", () => Z], 454266);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(740594),
        i = e.i(723823),
        n = e.i(219469),
        s = e.i(215959),
        o = e.i(416340),
        l = e.i(635868),
        c = e.i(23128),
        d = e.i(562549),
        u = e.i(131262),
        m = e.i(870555);
    let p = function(e) {
        let a, i, n, s = (0, r.c)(9),
            {
                market: o,
                callback: l,
                justifyContent: p,
                className: h
            } = e,
            f = void 0 === p ? "flex-start" : p,
            {
                payoutsString: x
            } = (0, u.useHandlePayouts)(o);
        return s[0] !== h ? (a = (0, m.cn)("flex gap-2", "lg:flex-row lg:justify-end lg:items-center lg:w-[calc(300px+0.5rem)] lg:py-4", "max-lg:w-full max-lg:flex-col max-lg:items-center max-lg:justify-center", h), s[0] = h, s[1] = a) : a = s[1], s[2] !== l || s[3] !== f || s[4] !== x ? (i = l ? (0, t.jsx)(c.Button, {
            size: "lg",
            className: "w-full",
            onClick: e => {
                e.stopPropagation(), l()
            },
            children: "Redeem"
        }) : (0, t.jsxs)("div", {
            className: "flex lg:justify-end max-lg:items-center max-lg:w-full max-lg:gap-1",
            style: {
                justifyContent: f
            },
            children: [(0, t.jsx)(d.IconCircleCheckFill24, {
                className: "size-6 text-brand"
            }), (0, t.jsxs)("span", {
                className: "font-medium text-brand",
                children: ["Outcome: ", x]
            })]
        }), s[2] = l, s[3] = f, s[4] = x, s[5] = i) : i = s[5], s[6] !== a || s[7] !== i ? (n = (0, t.jsx)("div", {
            className: a,
            children: i
        }), s[6] = a, s[7] = i, s[8] = n) : n = s[8], n
    };
    var h = e.i(488758),
        f = e.i(193789),
        x = e.i(909420),
        g = e.i(604777),
        v = e.i(784521),
        y = e.i(399336),
        b = e.i(891685),
        k = e.i(6204),
        w = e.i(156591),
        S = e.i(196593),
        j = e.i(879756),
        C = e.i(688608),
        _ = e.i(422868),
        T = e.i(960334),
        M = e.i(779584),
        N = e.i(983707),
        I = e.i(295038),
        P = e.i(605797);
    let E = () => {
            let e, a, i, n, s = (0, r.c)(13),
                o = (0, g.useTranslations)(),
                {
                    event: l,
                    moneylineMarket: c
                } = (0, h.useSportsItemContext)();
            if (s[0] !== l.markets || s[1] !== l.negRisk || s[2] !== c) {
                e: {
                    if (l.negRisk) {
                        let t = l.markets.filter(O).find(D);
                        if (t) {
                            if ("draw" === t.negRiskSportsMarketType) {
                                e = "Draw";
                                break e
                            }
                            if (t.team) {
                                e = (0, x.getTeamLabelWithLine)({
                                    market: t,
                                    outcomeIndex: 0,
                                    variant: "alias"
                                });
                                break e
                            }
                            e = t.groupItemTitle;
                            break e
                        }
                    }
                    if (!l.negRisk && c.teams && 2 === c.teams.length) {
                        let t, r = +("1" !== c.outcomePrices[0]);
                        s[4] !== c || s[5] !== r ? (t = (0, x.getTeamLabelWithLine)({
                            market: c,
                            outcomeIndex: r,
                            variant: "alias"
                        }), s[4] = c, s[5] = r, s[6] = t) : t = s[6], e = t;
                        break e
                    }
                    e = c.groupItemTitle ? ? c.outcomes[+("1" !== c.outcomePrices[0])]
                }
                s[0] = l.markets,
                s[1] = l.negRisk,
                s[2] = c,
                s[3] = e
            }
            else e = s[3];
            let u = e;
            return s[7] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(d.IconCircleCheckFill24, {
                className: "fill-brand-500 size-[24px]"
            }), s[7] = a) : a = s[7], s[8] !== o ? (i = o("trading.outcome"), s[8] = o, s[9] = i) : i = s[9], s[10] !== u || s[11] !== i ? (n = (0, t.jsxs)("div", {
                className: "flex items-center justify-center w-full gap-1",
                children: [a, (0, t.jsxs)("p", {
                    className: "text-sm font-medium text-brand-500",
                    children: [i, ": ", u]
                })]
            }), s[10] = u, s[11] = i, s[12] = n) : n = s[12], n
        },
        A = e => {
            let a, i, n, s, o, l, c, d = (0, r.c)(22),
                {
                    variant: u,
                    includeValue: m,
                    color: p,
                    label: f
                } = e,
                x = void 0 !== m && m,
                v = void 0 === p ? "green" : p,
                y = (0, g.useTranslations)();
            d[0] !== f || d[1] !== y ? (a = f ? ? y("trading.cashOut"), d[0] = f, d[1] = y, d[2] = a) : a = d[2];
            let b = a,
                {
                    setTradeState: k
                } = (0, j.useMobileTradeContext)(),
                {
                    moneylineMarket: w
                } = (0, h.useSportsItemContext)(),
                {
                    redeemableValue: C,
                    hasPositions: _
                } = (e => {
                    let t, a, i, n = (0, r.c)(8),
                        {
                            positions: s
                        } = (0, I.useSportsPositionContext)(),
                        {
                            positions: o
                        } = (0, P.useSportsItemPositions)(s);
                    n[0] !== o || n[1] !== e ? (t = "all" === e ? o : o.filter(t => (t.market.sportsMarketType ? ? "moneyline") === e), n[0] = o, n[1] = e, n[2] = t) : t = n[2];
                    let l = t;
                    n[3] !== l ? (a = l.reduce((e, t) => "1" === t.market.outcomePrices[t.outcomeIndex] ? e + parseFloat(t.position.qty) : e, 0), n[3] = l, n[4] = a) : a = n[4];
                    let c = l.length > 0;
                    return n[5] !== a || n[6] !== c ? (i = {
                        redeemableValue: a,
                        hasPositions: c
                    }, n[5] = a, n[6] = c, n[7] = i) : i = n[7], i
                })(u);
            d[3] !== w || d[4] !== k || d[5] !== u ? (i = e => {
                e.stopPropagation(), k ? .({
                    type: "sports-redeem",
                    market: w,
                    sportsRedemptionType: u
                })
            }, d[3] = w, d[4] = k, d[5] = u, d[6] = i) : i = d[6];
            let T = i;
            e: {
                if (x) {
                    let e;
                    d[7] !== C ? (e = (0, S.formatCurrency)(C, {
                        decimals: 2
                    }), d[7] = C, d[8] = e) : e = d[8], n = e;
                    break e
                }
                n = void 0
            }
            let M = n;
            if (!_) {
                let e;
                return d[9] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(E, {}), d[9] = e) : e = d[9], e
            }
            return d[10] !== b ? (s = (0, t.jsx)("span", {
                children: b
            }), d[10] = b, d[11] = s) : s = d[11], d[12] !== x || d[13] !== M ? (o = x && !!M && (0, t.jsx)("span", {
                className: "font-bold ml-1.5",
                children: M
            }), d[12] = x, d[13] = M, d[14] = o) : o = d[14], d[15] !== s || d[16] !== o ? (l = (0, t.jsxs)("span", {
                children: [s, o]
            }), d[15] = s, d[16] = o, d[17] = l) : l = d[17], d[18] !== v || d[19] !== T || d[20] !== l ? (c = (0, t.jsx)(N.TradingButton, {
                color: v,
                className: "flex-1",
                hoverHeightOffset: 2,
                height: 48,
                shadowHeight: 4,
                maxWidth: "auto",
                onClick: T,
                children: l
            }), d[18] = v, d[19] = T, d[20] = l, d[21] = c) : c = d[21], c
        };

    function O(e) {
        return (e.sportsMarketType ? ? "moneyline") === "moneyline"
    }

    function D(e) {
        return "1" === e.outcomePrices[0]
    }
    var L = e.i(413002),
        z = e.i(158789),
        R = e.i(468540),
        F = e.i(118818),
        $ = e.i(467126),
        B = e.i(818064);
    let q = e => {
            let a, i, n = (0, r.c)(4),
                {
                    className: s
                } = e;
            return n[0] !== s ? (a = (0, m.cn)("size-6 text-text", s), n[0] = s, n[1] = a) : a = n[1], n[2] !== a ? (i = (0, t.jsx)(B.IconDotsFill18, {
                className: a
            }), n[2] = a, n[3] = i) : i = n[3], i
        },
        V = "one-tap";

    function H(e) {
        let i, n, s, l, c, d, u, p, h, f, x, v, y, b, k, w, S, C, T = (0, r.c)(49),
            {
                className: M
            } = e,
            I = (0, g.useTranslations)(),
            {
                tradeType: P,
                setTradeState: E
            } = (0, j.useMobileTradeContext)(),
            {
                view: A
            } = (0, F.useMobileMarketContext)(),
            {
                hasSharesForOutcome: O,
                hasAllShares: D
            } = (0, _.useMobileMarketPositionContext)(),
            L = (0, $.useOneClickEligible)(),
            [B, H, W] = (0, $.useOneClickEnabled)(),
            G = L && W && !B,
            {
                reset: Z
            } = (0, R.useResetPointerEvents)(),
            [K, Y] = o.default.useState(!1);
        T[0] !== G ? (i = G ? [{
            label: "1-Tap",
            value: V,
            disabled: !1
        }] : [], T[0] = G, T[1] = i) : i = T[1], T[2] !== I ? (n = I("trading.buyShares"), T[2] = I, T[3] = n) : n = T[3], T[4] !== n ? (s = {
            label: n,
            value: a.Side.BUY,
            disabled: !1
        }, T[4] = n, T[5] = s) : s = T[5], T[6] !== O || T[7] !== I ? (l = O ? [{
            label: I("trading.sellShares"),
            value: a.Side.SELL,
            disabled: !1
        }] : [], T[6] = O, T[7] = I, T[8] = l) : l = T[8], T[9] !== D || T[10] !== I ? (c = D ? [{
            label: I("trading.mergeShares.title"),
            value: "merge",
            disabled: !1
        }] : [], T[9] = D, T[10] = I, T[11] = c) : c = T[11], T[12] !== I ? (d = I("trading.splitShares.title"), T[12] = I, T[13] = d) : d = T[13], T[14] !== d ? (u = {
            label: d,
            value: "split",
            disabled: !1
        }, T[14] = d, T[15] = u) : u = T[15], T[16] !== i || T[17] !== s || T[18] !== l || T[19] !== c || T[20] !== u ? (p = [...i, s, ...l, ...c, u], T[16] = i, T[17] = s, T[18] = l, T[19] = c, T[20] = u, T[21] = p) : p = T[21];
        let Q = p;
        T[22] !== Z || T[23] !== A ? (h = e => {
            Y(e), e || "default" !== A || Z()
        }, T[22] = Z, T[23] = A, T[24] = h) : h = T[24];
        let X = h;
        T[25] !== X || T[26] !== H || T[27] !== E ? (f = e => {
            e === V ? (H(!0), X(!1)) : e === a.Side.BUY || e === a.Side.SELL ? E({
                type: "trade",
                side: e
            }) : E({
                type: e
            })
        }, T[25] = X, T[26] = H, T[27] = E, T[28] = f) : f = T[28];
        let J = f;
        return T[29] !== X || T[30] !== K ? (x = () => {
            let e, t = e => {
                e.stopPropagation(), e.preventDefault(), X(!1)
            };
            return K && (document.addEventListener("pointerdown", t), e = () => {
                document.removeEventListener("pointerdown", t)
            }), () => e ? .()
        }, v = [K, X], T[29] = X, T[30] = K, T[31] = x, T[32] = v) : (x = T[31], v = T[32]), o.default.useEffect(x, v), T[33] !== M ? (y = (0, m.cn)("min-w-12 w-12 max-w-12", M), T[33] = M, T[34] = y) : y = T[34], T[35] === Symbol.for("react.memo_cache_sentinel") ? (b = (0, t.jsx)(q, {}), T[35] = b) : b = T[35], T[36] !== y ? (k = (0, t.jsx)(z.DropdownMenuTrigger, {
            asChild: !0,
            children: (0, t.jsx)(N.TradingButton, {
                shrink: !0,
                color: "gray",
                "aria-label": "side selection",
                className: y,
                children: b
            }, "order-type-button")
        }), T[36] = y, T[37] = k) : k = T[37], T[38] !== Q ? (w = Q.map(U), T[38] = Q, T[39] = w) : w = T[39], T[40] !== J || T[41] !== w || T[42] !== P ? (S = (0, t.jsx)(z.DropdownMenuContent, {
            align: "end",
            side: "top",
            alignOffset: 0,
            sideOffset: 12,
            className: "z-999",
            children: (0, t.jsx)(z.DropdownMenuRadioGroup, {
                value: P,
                onValueChange: J,
                children: w
            })
        }), T[40] = J, T[41] = w, T[42] = P, T[43] = S) : S = T[43], T[44] !== X || T[45] !== K || T[46] !== k || T[47] !== S ? (C = (0, t.jsxs)(z.DropdownMenu, {
            open: K,
            onOpenChange: X,
            modal: !0,
            children: [k, S]
        }), T[44] = X, T[45] = K, T[46] = k, T[47] = S, T[48] = C) : C = T[48], C
    }

    function U(e) {
        return (0, t.jsx)(z.DropdownMenuRadioItem, {
            value: e.value,
            disabled: e.disabled,
            className: "h-10 w-[140px] text-sm text-text-secondary",
            hideIndicator: !0,
            children: e.label
        }, e.value)
    }
    let W = e => {
            let n, s, o, l, c, d, u, m = (0, r.c)(31),
                {
                    item: p,
                    onClick: h
                } = e,
                f = (0, i.useMarketBestPrices)(p.market);
            m[0] !== f ? (n = f ? .["~zero"] ? .[a.Side.BUY.toLowerCase()] ? ? "0", m[0] = f, m[1] = n) : n = m[1];
            let x = n,
                g = (0, w.getPrecisionFromTickSize)(p.market.orderPriceMinTickSize);
            e: {
                let e, t, r = parseFloat(x),
                    a = Math.max(0, g - 2);
                if (Number.isNaN(r)) {
                    let e;
                    m[2] !== a || m[3] !== x ? (e = {
                        value: 0,
                        formatted: x,
                        decimals: a
                    }, m[2] = a, m[3] = x, m[4] = e) : e = m[4], s = e;
                    break e
                }
                let i = 100 * r;m[5] !== a || m[6] !== i ? (e = i.toFixed(a), m[5] = a, m[6] = i, m[7] = e) : e = m[7];
                let n = `${e}\xa2`;m[8] !== a || m[9] !== n || m[10] !== i ? (t = {
                    value: i,
                    formatted: n,
                    decimals: a
                }, m[8] = a, m[9] = n, m[10] = i, m[11] = t) : t = m[11],
                s = t
            }
            let v = s;
            return m[12] !== p.market || m[13] !== p.outcomeIndex || m[14] !== h || m[15] !== x ? (o = () => {
                h({
                    idx: p.outcomeIndex,
                    price: x,
                    market: p.market
                })
            }, m[12] = p.market, m[13] = p.outcomeIndex, m[14] = h, m[15] = x, m[16] = o) : o = m[16], m[17] !== p.abbreviatedOutcome ? (l = (0, t.jsx)(L.OutcomeButtonAbbrText, {
                priceMode: "default",
                children: p.abbreviatedOutcome
            }), m[17] = p.abbreviatedOutcome, m[18] = l) : l = m[18], m[19] !== v.decimals || m[20] !== v.formatted || m[21] !== v.value ? (c = (0, t.jsx)(M.AnimatedPrice, {
                className: "text-sm ml-1",
                value: v.value,
                format: "price",
                formatted: v.formatted,
                decimals: v.decimals
            }), m[19] = v.decimals, m[20] = v.formatted, m[21] = v.value, m[22] = c) : c = m[22], m[23] !== l || m[24] !== c ? (d = (0, t.jsx)(L.OutcomeButtonContentWrapper, {
                priceMode: "default",
                children: (0, t.jsxs)(L.OutcomeText, {
                    fontSize: "text-sm",
                    fontWeight: "font-semibold",
                    priceMode: "default",
                    children: [l, c]
                })
            }), m[23] = l, m[24] = c, m[25] = d) : d = m[25], m[26] !== p.buttonColorVariant || m[27] !== p.buttonCustomColor || m[28] !== o || m[29] !== d ? (u = (0, t.jsx)(N.TradingButton, {
                color: p.buttonColorVariant,
                customColors: p.buttonCustomColor,
                onTap: o,
                children: d
            }), m[26] = p.buttonColorVariant, m[27] = p.buttonCustomColor, m[28] = o, m[29] = d, m[30] = u) : u = m[30], u
        },
        G = e => {
            let a, i, n, s, o, l, c = (0, r.c)(29),
                {
                    price: d,
                    item: u,
                    market: m,
                    onClick: p
                } = e;
            e: {
                let e, t, r = parseFloat(d),
                    i = Math.max(0, (0, w.getPrecisionFromTickSize)(m.orderPriceMinTickSize ? ? .01) - 2);
                if (Number.isNaN(r)) {
                    let e;
                    c[0] !== i || c[1] !== d ? (e = {
                        value: 0,
                        formatted: d,
                        decimals: i
                    }, c[0] = i, c[1] = d, c[2] = e) : e = c[2], a = e;
                    break e
                }
                let n = 100 * r;c[3] !== i || c[4] !== n ? (e = n.toFixed(i), c[3] = i, c[4] = n, c[5] = e) : e = c[5];
                let s = `${e}\xa2`;c[6] !== i || c[7] !== s || c[8] !== n ? (t = {
                    value: n,
                    formatted: s,
                    decimals: i
                }, c[6] = i, c[7] = s, c[8] = n, c[9] = t) : t = c[9],
                a = t
            }
            let h = a;
            return c[10] !== u.outcomeIndex || c[11] !== m || c[12] !== p || c[13] !== d ? (i = () => {
                p({
                    idx: u.outcomeIndex,
                    price: d,
                    market: m
                })
            }, c[10] = u.outcomeIndex, c[11] = m, c[12] = p, c[13] = d, c[14] = i) : i = c[14], c[15] !== u.abbreviatedOutcome ? (n = (0, t.jsx)(L.OutcomeButtonAbbrText, {
                priceMode: "default",
                children: u.abbreviatedOutcome
            }), c[15] = u.abbreviatedOutcome, c[16] = n) : n = c[16], c[17] !== h.decimals || c[18] !== h.formatted || c[19] !== h.value ? (s = (0, t.jsx)(M.AnimatedPrice, {
                className: "text-base ml-1",
                value: h.value,
                format: "price",
                formatted: h.formatted,
                decimals: h.decimals
            }), c[17] = h.decimals, c[18] = h.formatted, c[19] = h.value, c[20] = s) : s = c[20], c[21] !== n || c[22] !== s ? (o = (0, t.jsx)(L.OutcomeButtonContentWrapper, {
                priceMode: "default",
                children: (0, t.jsxs)(L.OutcomeText, {
                    fontSize: "text-sm",
                    fontWeight: "font-semibold",
                    priceMode: "default",
                    children: [n, s]
                })
            }), c[21] = n, c[22] = s, c[23] = o) : o = c[23], c[24] !== u.buttonColorVariant || c[25] !== u.buttonCustomColor || c[26] !== i || c[27] !== o ? (l = (0, t.jsx)(N.TradingButton, {
                color: u.buttonColorVariant,
                customColors: u.buttonCustomColor,
                onTap: i,
                children: o
            }), c[24] = u.buttonColorVariant, c[25] = u.buttonCustomColor, c[26] = i, c[27] = o, c[28] = l) : l = c[28], l
        },
        Z = () => {
            let e, o, c, d, u, m, M, I, P, E, O, D, L, z, R = (0, r.c)(52),
                F = (0, g.useTranslations)(),
                {
                    setTradeState: $
                } = (0, j.useMobileTradeContext)(),
                {
                    hasSomeShares: B,
                    redemptionValueFormatted: q
                } = (0, _.useMobileMarketPositionContext)();
            R[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], R[0] = e) : e = R[0];
            let {
                activeMarket: V
            } = (0, y.useEventActiveMarketContext)(e);
            R[1] === Symbol.for("react.memo_cache_sentinel") ? (o = ["authenticated"], R[1] = o) : o = R[1];
            let {
                authenticated: U
            } = (0, v.useAccountContext)(o), Z = (0, i.useMarketBestPrices)(V);
            R[2] === Symbol.for("react.memo_cache_sentinel") ? (c = ["isSportsPage"], R[2] = c) : c = R[2];
            let {
                isSportsPage: J
            } = (0, k.useSportsContext)(c), ee = (0, f.useSetActiveSportsMarket)(), {
                moneylineMarket: et
            } = (0, h.useSportsItemContext)();
            R[3] !== V.orderPriceMinTickSize ? (d = (0, w.getPrecisionFromTickSize)(V.orderPriceMinTickSize), R[3] = V.orderPriceMinTickSize, R[4] = d) : d = R[4];
            let er = d,
                ea = (() => {
                    let e, t, a, i, n = (0, r.c)(9);
                    n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event", "isNegRiskSportsEvent"], n[0] = e) : e = n[0];
                    let {
                        event: s,
                        isNegRiskSportsEvent: o
                    } = (0, b.useEventContext)(e), l = (0, T.useSportsV2Enabled)();
                    n[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["isSportsPage"], n[1] = t) : t = n[1];
                    let {
                        isSportsPage: c
                    } = (0, k.useSportsContext)(t);
                    n[2] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], n[2] = a) : a = n[2];
                    let {
                        activeMarket: d
                    } = (0, y.useEventActiveMarketContext)(a), {
                        moneylineMarket: u
                    } = (0, h.useSportsItemContext)();
                    e: {
                        let e, t = c ? u : d;
                        if (l && o) {
                            let e;
                            n[3] !== s.markets ? (e = s.markets.filter(K).map(Y), n[3] = s.markets, n[4] = e) : e = n[4], i = e;
                            break e
                        }
                        n[5] !== t || n[6] !== c || n[7] !== l ? (e = t.outcomes.map((e, r) => {
                            let a = (0, x.getTeam)({
                                market: t,
                                outcomeIndex: r
                            });
                            return {
                                outcome: e,
                                market: t,
                                abbreviatedOutcome: C.ENABLE_ABBREVIATED_SPORTS_OUTCOMES && c && a ? a.abbreviation.toUpperCase() : e,
                                buttonColorVariant: c ? "light-blue" : 0 === r ? "green" : "red",
                                buttonCustomColor: void 0,
                                isNegRisk: !1,
                                isNegRiskDraw: !1,
                                teamIndex: r,
                                outcomeIndex: r,
                                ...C.ENABLE_SPORTS_COLORS && l && a ? .color && {
                                    buttonColorVariant: "custom",
                                    buttonCustomColor: {
                                        backgroundColor: a.color,
                                        color: "var(--color-white)"
                                    }
                                }
                            }
                        }), n[5] = t, n[6] = c, n[7] = l, n[8] = e) : e = n[8],
                        i = e
                    }
                    return i
                })();
            R[5] !== J || R[6] !== ee || R[7] !== $ ? (u = e => {
                let {
                    idx: t,
                    price: r,
                    side: i,
                    market: n
                } = e;
                $({
                    outcomeIdx: t,
                    price: r,
                    side: void 0 === i ? a.Side.BUY : i,
                    market: n
                }), J && n && ee(n, {
                    variant: "moneyline",
                    skipSetActiveMarket: !0,
                    openGamesAccordion: !1,
                    openOverlayAccordion: !1,
                    closeGamesAccordionIfOpen: !1,
                    closeOverlayAccordionIfOpen: !1
                })
            }, R[5] = J, R[6] = ee, R[7] = $, R[8] = u) : u = R[8];
            let ei = u;
            R[9] !== J || R[10] !== et || R[11] !== ee || R[12] !== $ ? (m = () => {
                J ? $({
                    type: "sports-redeem",
                    sportsRedemptionType: "all"
                }) : $({
                    type: "redeem"
                }), J && et && ee(et, {
                    variant: "moneyline",
                    skipSetActiveMarket: !0,
                    openGamesAccordion: !1,
                    openOverlayAccordion: !1,
                    closeGamesAccordionIfOpen: !1,
                    closeOverlayAccordionIfOpen: !1
                })
            }, R[9] = J, R[10] = et, R[11] = ee, R[12] = $, R[13] = m) : m = R[13];
            let en = m;
            e: {
                let e;
                if (J) {
                    let e;
                    if (et.closed) {
                        let e;
                        R[14] !== et ? (e = {
                            renderVariant: "sports-redeem-buttons",
                            market: et
                        }, R[14] = et, R[15] = e) : e = R[15], M = e;
                        break e
                    }
                    R[16] !== et ? (e = {
                        renderVariant: "buttons",
                        market: et
                    }, R[16] = et, R[17] = e) : e = R[17], M = e;
                    break e
                }
                if (V.closed) {
                    let e, t = B ? "redeem-buttons" : "redeemable-content";
                    R[18] !== V || R[19] !== t ? (e = {
                        renderVariant: t,
                        market: V
                    }, R[18] = V, R[19] = t, R[20] = e) : e = R[20], M = e;
                    break e
                }
                R[21] !== V ? (e = {
                    renderVariant: "buttons",
                    market: V
                }, R[21] = V, R[22] = e) : e = R[22],
                M = e
            }
            let {
                renderVariant: es
            } = M;
            return R[23] !== en || R[24] !== q || R[25] !== es || R[26] !== F ? (I = "redeem-buttons" === es && (0, t.jsx)(N.TradingButton, {
                color: "green",
                onTap: en,
                children: `${F("trading.cashOut")}${q?` ${q}`:""}`
            }), R[23] = en, R[24] = q, R[25] = es, R[26] = F, R[27] = I) : I = R[27], R[28] !== V || R[29] !== es ? (P = "redeemable-content" === es && (0, t.jsx)(p, {
                market: V,
                justifyContent: "center"
            }), R[28] = V, R[29] = es, R[30] = P) : P = R[30], R[31] !== es ? (E = "sports-redeem-buttons" === es && (0, t.jsx)(A, {
                variant: "all",
                includeValue: !0,
                color: "green"
            }), R[31] = es, R[32] = E) : E = R[32], R[33] !== Z || R[34] !== ei || R[35] !== J || R[36] !== ea || R[37] !== et || R[38] !== er || R[39] !== es ? (O = "buttons" === es && (0, t.jsx)(s.motion.div, {
                className: "flex gap-3 flex-1",
                layout: !0,
                style: {
                    width: "auto"
                },
                transition: {
                    type: "spring",
                    duration: .2,
                    bounce: 0
                },
                children: ea.map((e, r) => {
                    if (e.isNegRisk) return (0, t.jsx)(l.BookContextProvider, {
                        market: e.market,
                        prefetch: {
                            book: "never",
                            lastPrice: "never"
                        },
                        poll: "never",
                        subscribe: "never",
                        defer: "never",
                        children: (0, t.jsx)(W, {
                            item: e,
                            onClick: ei
                        })
                    }, `neg-risk-button-${e.market.slug}`);
                    let i = Z ? .[0 === e.outcomeIndex ? "~zero" : "~one"] ? .[a.Side.BUY.toLowerCase()] ? ? "0";
                    return J ? (0, t.jsx)(G, {
                        item: e,
                        price: i,
                        onClick: ei,
                        market: et
                    }, e.outcome) : (0, t.jsx)(N.TradingButton, {
                        color: e.buttonColorVariant,
                        customColors: e.buttonCustomColor,
                        onTap: () => {
                            ei({
                                idx: r,
                                price: i,
                                market: e.market
                            })
                        },
                        children: (0, t.jsxs)("span", {
                            className: "flex items-baseline justify-center gap-1 w-full",
                            children: [(0, t.jsx)("span", {
                                className: "text-sm font-semibold opacity-70",
                                children: e.abbreviatedOutcome
                            }), (0, t.jsxs)("span", {
                                className: "text-base font-semibold",
                                children: [(0, S.showCentsOnly)(i, er), "¢"]
                            })]
                        })
                    }, e.outcome)
                })
            }), R[33] = Z, R[34] = ei, R[35] = J, R[36] = ea, R[37] = et, R[38] = er, R[39] = es, R[40] = O) : O = R[40], R[41] !== V.closed || R[42] !== U ? (D = !V.closed && U && (0, t.jsx)(H, {}), R[41] = V.closed, R[42] = U, R[43] = D) : D = R[43], R[44] !== D ? (L = (0, t.jsx)(n.AnimatePresence, {
                initial: !1,
                mode: "popLayout",
                children: D
            }), R[44] = D, R[45] = L) : L = R[45], R[46] !== O || R[47] !== L || R[48] !== I || R[49] !== P || R[50] !== E ? (z = (0, t.jsxs)("div", {
                className: "flex w-screen h-full gap-3 p-4 lg:hidden",
                onPointerDown: Q,
                onClick: X,
                children: [I, P, E, O, L]
            }), R[46] = O, R[47] = L, R[48] = I, R[49] = P, R[50] = E, R[51] = z) : z = R[51], z
        };

    function K(e) {
        return (e.sportsMarketType ? ? "moneyline") === "moneyline"
    }

    function Y(e) {
        if ("draw" === e.negRiskSportsMarketType) return {
            isNegRisk: !0,
            isNegRiskDraw: !0,
            market: e,
            outcome: "Draw",
            abbreviatedOutcome: "Draw",
            buttonColorVariant: "gray",
            buttonCustomColor: void 0,
            outcomeIndex: 0
        };
        let t = (0, x.getTeam)({
            market: e
        });
        return {
            isNegRisk: !0,
            isNegRiskDraw: !0,
            market: e,
            outcome: e.groupItemTitle ? ? e.outcomes[0],
            abbreviatedOutcome: e.groupItemTitle ? ? e.outcomes[0],
            buttonColorVariant: "home" === e.negRiskSportsMarketType ? "green" : "red",
            buttonCustomColor: void 0,
            outcomeIndex: 0,
            ...t && {
                outcome: t.alias,
                abbreviatedOutcome: t.abbreviation.toUpperCase(),
                ...t.color && {
                    buttonColorVariant: "custom",
                    buttonCustomColor: {
                        backgroundColor: t.color,
                        color: "var(--color-white)"
                    }
                }
            }
        }
    }

    function Q(e) {
        return e.stopPropagation()
    }

    function X(e) {
        return e.stopPropagation()
    }
    var J = e.i(588264),
        ee = e.i(86831);
    e.s(["OutcomeButtonGroup", 0, function(e) {
        let a, i, n, s, o = (0, r.c)(28),
            {
                value: l,
                onValueChange: c,
                options: d,
                isThreeDee: u,
                layout: m,
                invertVisually: p,
                uppercase: h,
                disabled: f,
                renderPrice: x,
                children: g,
                className: v
            } = e,
            y = void 0 === u || u,
            b = void 0 === m ? "center" : m,
            k = void 0 !== h && h,
            w = void 0 !== f && f,
            S = void 0 !== p && p && "flex-row-reverse";
        if (o[0] !== v || o[1] !== S ? (a = (0, ee.cn)("flex w-full gap-3", S, v), o[0] = v, o[1] = S, o[2] = a) : a = o[2], o[3] !== w || o[4] !== y || o[5] !== b || o[6] !== c || o[7] !== d || o[8] !== x || o[9] !== k || o[10] !== l) {
            let e;
            o[12] !== w || o[13] !== y || o[14] !== b || o[15] !== c || o[16] !== x || o[17] !== k || o[18] !== l ? (e = e => {
                let r = l === e.value;
                return (0, t.jsx)(J.RadioGroup.Item, {
                    value: e.value,
                    asChild: !0,
                    disabled: w,
                    children: (0, t.jsx)(N.TradingButton, {
                        color: r ? e.color ? ? "green" : "gray",
                        customColors: r ? e.customColors : void 0,
                        isThreeDee: y,
                        selected: r,
                        height: 48,
                        shadowHeight: 5,
                        hoverHeightOffset: 1.5,
                        clickDampingOffset: 2,
                        disabled: w,
                        onTap: () => c(e.value),
                        children: (0, t.jsxs)("span", {
                            className: (0, ee.cn)("flex flex-1 items-baseline px-3", "between" === b ? "justify-between" : "justify-center"),
                            children: [(0, t.jsx)("span", {
                                className: (0, ee.cn)("text-[15px] font-semibold text-inherit transition-none leading-tight", r && "opacity-70", k && "uppercase"),
                                children: e.label
                            }), (e.price || x) && (0, t.jsx)("span", {
                                className: (0, ee.cn)("text-base font-semibold text-inherit transition-none", !x && "ml-1"),
                                children: x ? x(e, r) : e.price
                            })]
                        })
                    })
                }, e.value)
            }, o[12] = w, o[13] = y, o[14] = b, o[15] = c, o[16] = x, o[17] = k, o[18] = l, o[19] = e) : e = o[19], i = d.map(e), o[3] = w, o[4] = y, o[5] = b, o[6] = c, o[7] = d, o[8] = x, o[9] = k, o[10] = l, o[11] = i
        } else i = o[11];
        return o[20] !== c || o[21] !== a || o[22] !== i || o[23] !== l ? (n = (0, t.jsx)(J.RadioGroup.Root, {
            value: l,
            onValueChange: c,
            className: a,
            id: "outcome-buttons",
            children: i
        }), o[20] = c, o[21] = a, o[22] = i, o[23] = l, o[24] = n) : n = o[24], o[25] !== g || o[26] !== n ? (s = (0, t.jsxs)("div", {
            className: "flex flex-col w-full",
            children: [n, g]
        }), o[25] = g, o[26] = n, o[27] = s) : s = o[27], s
    }], 215885)
}, 484275, 476603, e => {
    "use strict";
    let t = "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
        r = "252, 215, 50",
        a = "254, 232, 105",
        i = `${t}, inset 0 0 0 100px rgba(${a}, 0), 0 0 0 0 rgba(${r}, 0), 0 0 0 0 rgba(${a}, 0)`;
    e.s(["DEFAULT_PRESETS", 0, [5, 25, 100], "MAX_PRESET", 0, 25e3, "MIN_PRESET", 0, 1, "PRESETS_LS_KEY", 0, "pm_one_click_presets", "PRESET_FLASH_BASE_SHADOW", 0, t, "PRESET_FLASH_GOLD", 0, r, "PRESET_FLASH_GOLD_LIGHT", 0, a, "PRESET_FLASH_RESTING_BOX_SHADOW", 0, i, "WIN_NUMBER_FLOW_TIMING", 0, {
        duration: 450,
        easing: "linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"
    }], 484275);
    var n = e.i(740594),
        s = e.i(723823),
        o = e.i(416340),
        l = e.i(112014),
        c = e.i(101008),
        d = e.i(458164),
        u = e.i(780641),
        m = e.i(5146),
        p = e.i(668122),
        h = e.i(88240),
        f = e.i(827681),
        x = e.i(863828),
        g = e.i(79075),
        v = e.i(684686),
        y = e.i(784521),
        b = e.i(305457),
        k = e.i(400819),
        w = e.i(399336),
        S = e.i(767074),
        j = e.i(880809);
    e.s(["useOneTapPresetTap", 0, function({
        onApprovalRequired: e,
        source: t = "buy-sell-widget"
    }) {
        let {
            activeMarket: r
        } = (0, w.useEventActiveMarketContext)(["activeMarket"]), {
            selectedOutcomeIdx: a
        } = (0, j.useTradeContext)(["selectedOutcomeIdx"]), {
            authenticated: i,
            authenticationType: C,
            walletMode: _
        } = (0, y.useAccountContext)(["authenticated", "authenticationType", "walletMode"]), {
            setOpen: T,
            setConnectorRoute: M
        } = (0, x.useSiwx)(), N = (0, v.useGeoStore)(e => e.hasFetchedLocation), I = (0, u.usePermissions)(), {
            onBeginCheckout: P
        } = (0, S.useFunkitContext)(), {
            clob: E
        } = (0, k.useClobCredentialContext)(), {
            areAllAllowancesApproved: A,
            isUpdatingAllowances: O
        } = (0, l.useAllowanceContext)(), {
            trackedProxyUsdcBalance: D
        } = (0, m.default)(), L = (0, b.useAmplitudeAnalytics)(), z = (0, s.useBestPrice)(r, a, "ask"), R = (0, h.useCreateOrder)(), F = "magic" !== C && (0, c.mustGenerateApiKeys)(E, _), $ = "magic" !== C && (0, c.mustApproveAllowances)({
            walletMode: _,
            areAllAllowancesApproved: A,
            isUpdatingAllowances: O
        }), B = N && !I.canBuy, q = N && !I.canSell, V = !z.valid || z.value <= 0, H = F || $;
        return {
            handlePresetTap: (0, o.useCallback)(async s => {
                if (L.trackEvent(p.Events.OneClickTradePresetClicked, {
                        amount: s,
                        market_slug: r.slug,
                        outcome_index: a
                    }), !i) {
                    let e = Date.now();
                    (0, g.markSignupPromptOpened)("trade", {
                        now: e,
                        route: "login"
                    }), L.trackEvent(p.Events.SignupPromptOpened, (0, g.getSignupPromptOpenedEventProperties)({
                        source: "trade",
                        route: "login"
                    })), M(f.ConnectorRoute.LOGIN), T(!0);
                    return
                }
                if (B || V) return;
                if (H) return void e();
                let o = D.current ? ? 0;
                if (0 === o || o < s) {
                    L.trackEvent(p.Events.DepositBuySellButtonClicked);
                    try {
                        if ("function" != typeof P) return;
                        let e = Math.max(s - o, 0);
                        P(e > 0 ? e.toString() : void 0)
                    } catch {}
                    return
                }
                L.trackEvent(p.Events.OneClickTradeClicked, {
                    type: "buy",
                    amount: s,
                    market_slug: r.slug,
                    outcome_index: a
                }), await R({
                    values: {
                        orderType: d.OrderType.Market,
                        shares: String(s),
                        side: n.Side.BUY,
                        selectedOutcomeIdx: a
                    },
                    options: {
                        successToast: !0,
                        errorToast: !0
                    },
                    tracking: {
                        page: "events",
                        source: t
                    }
                })
            }, [L, r.slug, a, i, B, V, H, D, P, M, T, e, R, t]),
            geoblocked: B,
            cashOutGeoblocked: q,
            noAsks: V,
            needsApproval: H,
            bestAsk: z
        }
    }], 476603)
}, 91817, e => {
    "use strict";
    var t = e.i(723823),
        r = e.i(416340),
        a = e.i(557033),
        i = e.i(909420),
        n = e.i(289981),
        s = e.i(593332),
        o = e.i(399336),
        l = e.i(891685),
        c = e.i(6204),
        d = e.i(880809),
        u = e.i(196593),
        m = e.i(156591);
    e.s(["useOutcomeButtonData", 0, function(e, p, h, f = "price", x) {
        let {
            isNegRiskSportsEvent: g,
            event: v
        } = (0, l.useEventContext)(["isNegRiskSportsEvent", "event"]), {
            activeMarket: y
        } = (0, o.useEventActiveMarketContext)(["activeMarket"]), {
            selectedOutcomeIdx: b,
            side: k,
            setPrice: w,
            setPriceUpdateLocation: S
        } = (0, d.useTradeContext)(["selectedOutcomeIdx", "side", "setPrice", "setPriceUpdateLocation"]), {
            isSportsPage: j
        } = (0, c.useSportsContext)(["isSportsPage"]), C = (0, t.useMarketBestPrices)(y), {
            paddedPrice: _,
            price: T
        } = r.default.useMemo(() => {
            let t = C ? .[0 === e ? "~zero" : "~one"] ? .[k ? .toLowerCase()];
            if (!t) return {
                paddedPrice: void 0,
                price: 0
            };
            let r = (0, m.getPrecisionFromTickSize)(y.orderPriceMinTickSize);
            return {
                paddedPrice: (0, u.showPaddedCentsOnly)(t, r),
                price: parseFloat(t)
            }
        }, [C, y ? .outcomes, y.orderPriceMinTickSize, e, k]), M = (0, m.getPrecisionFromTickSize)(y.orderPriceMinTickSize), {
            value: N,
            formatted: I
        } = (0, a.useConvertPrice)({
            price: T,
            precision: M,
            inputMode: "decimal",
            outputMode: f
        }), P = r.default.useMemo(() => {
            if (p ? .abbreviation) return p;
            let t = v.teams && v.teams.length >= 2 ? v.teams[e] : void 0;
            if (t ? .abbreviation) return t
        }, [p, v.teams, e]), {
            label: E,
            buttonSpacing: A
        } = r.default.useMemo(() => {
            if (j) {
                if ((0, n.isNegRiskSportsMarketType)(y.sportsMarketType)) return {
                    label: 0 === e ? "Yes" : "No",
                    buttonSpacing: "center"
                };
                if (P && "spreads" === y.sportsMarketType) {
                    let t = (0, i.getSpreadLineForOutcome)({
                        market: y,
                        outcomeIndex: e
                    });
                    return void 0 !== t ? {
                        label: `${P.abbreviation.toUpperCase()} ${(0,i.getFormattedSpread)(t)}`,
                        buttonSpacing: "between"
                    } : void 0 !== y.line ? {
                        label: `${P.abbreviation.toUpperCase()} ${(0,i.getFormattedSpread)(0===e?-Math.abs(y.line):Math.abs(y.line))}`,
                        buttonSpacing: "between"
                    } : {
                        label: P.abbreviation.toUpperCase(),
                        buttonSpacing: "between"
                    }
                }
                if ((0, n.isTotalMarket)(y.sportsMarketType) && void 0 !== y.line) return {
                    label: `${0===e?"O":"U"} ${y.line}`,
                    buttonSpacing: "between"
                }
            }
            if (j && !g) {
                if ("nrfi" === y.sportsMarketType || "both_teams_to_score" === y.sportsMarketType || "ufc_go_the_distance" === y.sportsMarketType || "ufc_method_of_victory" === y.sportsMarketType || "parlays" === y.sportsMarketType || "anytime_touchdowns" === y.sportsMarketType || "first_touchdowns" === y.sportsMarketType || "soccer_anytime_goalscorer" === y.sportsMarketType || "soccer_exact_score" === y.sportsMarketType || "tennis_completed_match" === y.sportsMarketType) return {
                    label: 0 === e ? "Yes" : "No",
                    buttonSpacing: "center"
                };
                if (P) return {
                    label: P.abbreviation,
                    buttonSpacing: "center"
                }
            }
            return {
                label: y.outcomes[e],
                buttonSpacing: "center"
            }
        }, [g, j, y.outcomes, y.sportsMarketType, y.line, P, e]), O = r.default.useMemo(() => {
            let t = b === e;
            if (j) return "nrfi" === y.sportsMarketType || "both_teams_to_score" === y.sportsMarketType || "cricket_team_top_batter" === y.sportsMarketType || "cricket_most_sixes" === y.sportsMarketType || "cricket_toss_match_double" === y.sportsMarketType || "anytime_touchdowns" === y.sportsMarketType || "first_touchdowns" === y.sportsMarketType || "soccer_anytime_goalscorer" === y.sportsMarketType || "soccer_exact_score" === y.sportsMarketType || "tennis_completed_match" === y.sportsMarketType || g && "spreads" !== y.sportsMarketType ? t && 0 === e ? {
                color: "green",
                customColors: void 0
            } : t && 1 === e ? {
                color: "red",
                customColors: void 0
            } : {
                color: "gray",
                customColors: void 0
            } : t && h.color ? h : x === s.SportSlug.LIVE && t ? {
                color: "blue",
                customColors: void 0
            } : {
                color: "gray",
                customColors: void 0
            };
            return t ? {
                color: 0 === e ? "green" : "red",
                customColors: void 0
            } : {
                color: "gray",
                customColors: void 0
            }
        }, [b, e, h, g, x, j, y.sportsMarketType]), D = r.default.useCallback(() => {
            "string" == typeof _ && w(_), S("click")
        }, [_, w, S]);
        return r.default.useMemo(() => ({
            label: E,
            formattedPrice: I,
            priceValue: N,
            priceFormat: f,
            priceDecimals: "price" === f || "percentage" === f ? Math.max(0, M - 2) : 3 === M ? 3 : void 0,
            buttonSpacing: A,
            buttonColor: O,
            onSelect: D,
            isThreeDee: j,
            uppercase: j && !g
        }), [E, I, N, f, M, A, O, D, j, g])
    }])
}, 36561, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061);
    e.i(686518);
    var a = e.i(907855),
        i = e.i(215959),
        n = e.i(267905),
        s = e.i(416340),
        o = e.i(249792),
        l = e.i(606572),
        c = e.i(870555),
        d = e.i(484275);

    function u(e) {
        return e.target.select()
    }
    e.s(["PresetCard", 0, function(e) {
        let s, o, l, u, m, p, h, f = (0, r.c)(23),
            {
                amount: x,
                win: g,
                disabled: v,
                onClick: y,
                className: b
            } = e,
            k = 2 * (g > 0 && g < 10);
        f[0] !== g || f[1] !== k ? (s = Number.isFinite(g) ? parseFloat(g.toFixed(k)) : 0, f[0] = g, f[1] = k, f[2] = s) : s = f[2];
        let w = s,
            S = (0, n.useAnimationControls)();
        f[3] !== S || f[4] !== y ? (o = () => {
            S.start({
                scale: [1, 1.05, 1],
                boxShadow: [d.PRESET_FLASH_RESTING_BOX_SHADOW, `${d.PRESET_FLASH_BASE_SHADOW}, inset 0 0 0 100px rgba(${d.PRESET_FLASH_GOLD_LIGHT}, 0.13), 0 0 12px 0 rgba(${d.PRESET_FLASH_GOLD}, 0.7), 0 0 26px 6px rgba(${d.PRESET_FLASH_GOLD_LIGHT}, 0.4)`, `${d.PRESET_FLASH_BASE_SHADOW}, inset 0 0 0 100px rgba(${d.PRESET_FLASH_GOLD_LIGHT}, 0), 0 0 20px 2px rgba(${d.PRESET_FLASH_GOLD}, 0), 0 0 36px 12px rgba(${d.PRESET_FLASH_GOLD_LIGHT}, 0)`],
                transition: {
                    duration: .32,
                    ease: [.25, 1, .5, 1]
                }
            }), requestAnimationFrame(() => y())
        }, f[3] = S, f[4] = y, f[5] = o) : o = f[5];
        let j = o,
            C = v && "opacity-50 cursor-not-allowed hover:border-border";
        return f[6] !== b || f[7] !== C ? (l = (0, c.cn)("flex flex-col items-center justify-center gap-0.5 rounded-xl border border-border bg-surface-1 px-3 py-4 h-[78px] w-full cursor-pointer shadow-sm", "hover:border-text-tertiary/50 transition-colors", C, b), f[6] = b, f[7] = C, f[8] = l) : l = f[8], f[9] !== x ? (u = (0, t.jsxs)("span", {
            className: "text-heading-xl font-bold text-text-primary",
            children: ["$", x]
        }), f[9] = x, f[10] = u) : u = f[10], f[11] !== k ? (m = {
            minimumFractionDigits: k,
            maximumFractionDigits: k
        }, f[11] = k, f[12] = m) : m = f[12], f[13] !== w || f[14] !== m ? (p = (0, t.jsxs)("span", {
            className: "text-body-xs text-text-secondary flex items-baseline gap-1",
            children: ["win", " ", (0, t.jsx)(a.default, {
                prefix: "$",
                value: w,
                className: "text-green-600 font-semibold normal-nums!",
                trend: 0,
                format: m,
                transformTiming: d.WIN_NUMBER_FLOW_TIMING
            })]
        }), f[13] = w, f[14] = m, f[15] = p) : p = f[15], f[16] !== S || f[17] !== v || f[18] !== j || f[19] !== l || f[20] !== u || f[21] !== p ? (h = (0, t.jsxs)(i.motion.button, {
            type: "button",
            disabled: v,
            onClick: j,
            animate: S,
            className: l,
            children: [u, p]
        }), f[16] = S, f[17] = v, f[18] = j, f[19] = l, f[20] = u, f[21] = p, f[22] = h) : h = f[22], h
    }, "PresetEditCard", 0, function(e) {
        let a, i, n, m, p, h, f, x, g, v = (0, r.c)(19),
            {
                value: y,
                autoFocus: b,
                onChange: k,
                onSubmit: w,
                className: S
            } = e,
            j = s.default.useRef(null),
            C = (0, o.useToast)();
        return v[0] !== b ? (a = () => {
            b && j.current && (j.current.focus(), j.current.select())
        }, i = [b], v[0] = b, v[1] = a, v[2] = i) : (a = v[1], i = v[2]), s.default.useEffect(a, i), v[3] !== S ? (n = (0, c.cn)("group relative flex items-center justify-center gap-0.5 rounded-xl border-2 border-dashed border-border bg-surface-1 px-3 h-[78px] cursor-text", "focus-within:border-text-tertiary focus-within:border-solid transition-colors", S), v[3] = S, v[4] = n) : n = v[4], v[5] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, t.jsx)("span", {
            className: "absolute top-2 left-3 text-[10px] font-semibold uppercase tracking-wide text-text-tertiary",
            children: "Edit"
        }), p = (0, t.jsx)("span", {
            className: "text-heading-xl font-bold text-text-primary",
            children: "$"
        }), v[5] = m, v[6] = p) : (m = v[5], p = v[6]), v[7] !== k || v[8] !== C ? (h = e => {
            let t = e.target.value.replace(/[^0-9]/g, "");
            if ("" === t) return void k("");
            let r = Number.parseInt(t, 10);
            if (Number.isFinite(r) && r > d.MAX_PRESET) {
                C.error(new l.ToastBuilder().title("Maximum preset is $25,000").description("One-tap buy presets cannot exceed $25,000.")), k(String(d.MAX_PRESET));
                return
            }
            k(t)
        }, v[7] = k, v[8] = C, v[9] = h) : h = v[9], v[10] !== w ? (f = e => {
            "Enter" === e.key && (e.preventDefault(), w())
        }, v[10] = w, v[11] = f) : f = v[11], v[12] !== h || v[13] !== f || v[14] !== y ? (x = (0, t.jsx)("input", {
            ref: j,
            type: "text",
            inputMode: "numeric",
            value: y,
            onChange: h,
            onFocus: u,
            onKeyDown: f,
            className: "w-full min-w-0 bg-transparent text-heading-xl font-bold text-text-primary outline-none"
        }), v[12] = h, v[13] = f, v[14] = y, v[15] = x) : x = v[15], v[16] !== n || v[17] !== x ? (g = (0, t.jsxs)("label", {
            className: n,
            children: [m, p, x]
        }), v[16] = n, v[17] = x, v[18] = g) : g = v[18], g
    }])
}, 309256, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(215959);
    e.i(416340);
    var i = e.i(643244),
        n = e.i(604777),
        s = e.i(870555),
        o = e.i(569442),
        l = e.i(784521),
        c = e.i(399336),
        d = e.i(269101),
        u = e.i(880809),
        m = e.i(449372);
    let p = ({
        shares: e,
        mode: t,
        averagePrice: r,
        sharesLabel: a,
        mergeableLabel: i
    }) => {
        let n = e.toLocaleString("en-US", {
            minimumFractionDigits: 0,
            maximumFractionDigits: 2
        });
        if ("merge" === t) return `${n} ${i}`;
        if (r) {
            let e = `${(100*r).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:1})}\xa2`;
            return `${n} ${a} @ ${e}`
        }
        return `${n} ${a}`
    };

    function h(e) {
        let h, x, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E = (0, r.c)(37);
        E[0] !== e ? ({
            mode: b,
            market: x,
            outcomeIndex: v,
            formatter: k,
            onMaxClick: g,
            className: h,
            ...y
        } = e, E[0] = e, E[1] = h, E[2] = x, E[3] = g, E[4] = v, E[5] = y, E[6] = b, E[7] = k) : (h = E[1], x = E[2], g = E[3], v = E[4], y = E[5], b = E[6], k = E[7]);
        let A = void 0 === b ? "trade" : b,
            O = void 0 === k ? p : k,
            D = (0, n.useTranslations)();
        E[8] === Symbol.for("react.memo_cache_sentinel") ? (w = ["authenticated"], E[8] = w) : w = E[8];
        let {
            authenticated: L
        } = (0, l.useAccountContext)(w);
        E[9] === Symbol.for("react.memo_cache_sentinel") ? (S = ["activeMarket"], E[9] = S) : S = E[9];
        let {
            activeMarket: z
        } = (0, c.useEventActiveMarketContext)(S);
        E[10] === Symbol.for("react.memo_cache_sentinel") ? (j = ["positions"], E[10] = j) : j = E[10];
        let {
            positions: R
        } = (0, d.useEventPositionsContext)(j);
        E[11] === Symbol.for("react.memo_cache_sentinel") ? (C = ["selectedOutcomeIdx"], E[11] = C) : C = E[11];
        let {
            selectedOutcomeIdx: F
        } = (0, u.useTradeContext)(C), $ = (0, o.useBalanceVisibilityStore)(f), B = x ? ? z, q = v || F;
        if (E[12] !== L || E[13] !== O || E[14] !== B || E[15] !== A || E[16] !== q || E[17] !== R || E[18] !== D) {
            e: {
                let e = (0, m.getPositionsForMarket)({
                        market: B,
                        positions: R ? ? []
                    }),
                    t = "merge" === A ? (0, m.getMergeableSharesForMarket)({
                        positions: e
                    }) : (0, m.getSharesForMarket)({
                        positions: e,
                        outcomeIndex: q
                    });
                if (!L || !t || "trade" === A && !t ? .qty || "merge" === A && !t ? .qty) {
                    let e;
                    E[20] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        show: !1,
                        label: ""
                    }, E[20] = e) : e = E[20], _ = e;
                    break e
                }
                _ = {
                    show: !0,
                    label: O({
                        shares: t.qty,
                        averagePrice: t.avgPrice,
                        mode: A,
                        sharesLabel: D("topHolders.shares"),
                        mergeableLabel: D("trading.mergeShares.availableShares")
                    })
                }
            }
            E[12] = L,
            E[13] = O,
            E[14] = B,
            E[15] = A,
            E[16] = q,
            E[17] = R,
            E[18] = D,
            E[19] = _
        }
        else _ = E[19];
        let {
            show: V,
            label: H
        } = _;
        return V ? (E[21] !== h ? (T = (0, s.cn)("flex pr-[1px] items-end gap-1", h), E[21] = h, E[22] = T) : T = E[22], E[23] !== H || E[24] !== $ || E[25] !== D ? (M = $ ? (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(i.HiddenDots, {}), " ", D("topHolders.shares")]
        }) : H, E[23] = H, E[24] = $, E[25] = D, E[26] = M) : M = E[26], E[27] !== M ? (N = (0, t.jsx)("p", {
            className: "text-body-xs font-medium truncate text-text-secondary leading-[18px]",
            children: M
        }), E[27] = M, E[28] = N) : N = E[28], E[29] !== g || E[30] !== D ? (I = !!g && (0, t.jsx)("span", {
            onClick: g,
            className: "text-xs font-semibold text-background cursor-pointer rounded-xl px-[7px] py-[3px] bg-shade-black leading-[18px] ml-1 hover:opacity-80",
            children: D("trading.max")
        }), E[29] = g, E[30] = D, E[31] = I) : I = E[31], E[32] !== y || E[33] !== N || E[34] !== I || E[35] !== T ? (P = (0, t.jsxs)(a.motion.div, {
            className: T,
            ...y,
            children: [N, I]
        }), E[32] = y, E[33] = N, E[34] = I, E[35] = T, E[36] = P) : P = E[36], P) : null
    }

    function f(e) {
        return e.portfolioHidden
    }
    var x = e.i(900519),
        g = e.i(5146);

    function v(e) {
        let c, d, u, m, p, h, f, v, b, k, w, S, j = (0, r.c)(28);
        j[0] !== e ? ({
            formatter: d,
            onMaxClick: u,
            className: c,
            ...m
        } = e, j[0] = e, j[1] = c, j[2] = d, j[3] = u, j[4] = m) : (c = j[1], d = j[2], u = j[3], m = j[4]);
        let C = (0, n.useTranslations)();
        j[5] === Symbol.for("react.memo_cache_sentinel") ? (p = ["authenticated"], j[5] = p) : p = j[5];
        let {
            authenticated: _
        } = (0, l.useAccountContext)(p), {
            hasPendingProxyUsdcBalance: T,
            trackedProxyUsdcBalance: M
        } = (0, g.default)(), N = (0, o.useBalanceVisibilityStore)(y);
        e: {
            let e;
            if (d) {
                h = d;
                break e
            }
            j[6] !== C ? (e = e => {
                let {
                    balance: t
                } = e;
                return (0, x.cashBalanceFormatter)({
                    balance: t,
                    cashLabel: C("trading.cash")
                })
            }, j[6] = C, j[7] = e) : e = j[7],
            h = e
        }
        let I = h;
        if (!_) return null;
        j[8] !== c ? (f = (0, s.cn)("flex pr-px items-end gap-1", c), j[8] = c, j[9] = f) : f = j[9];
        let P = T && "animate-pulse";
        return j[10] !== P ? (v = (0, s.cn)("text-body-xs font-medium leading-[18px] text-text-secondary truncate", P), j[10] = P, j[11] = v) : v = j[11], j[12] !== I || j[13] !== N || j[14] !== C || j[15] !== M ? (b = N ? (0, t.jsxs)(t.Fragment, {
            children: ["$", (0, t.jsx)(i.HiddenDots, {}), " ", C("trading.cash")]
        }) : I({
            balance: M.current
        }), j[12] = I, j[13] = N, j[14] = C, j[15] = M, j[16] = b) : b = j[16], j[17] !== v || j[18] !== b ? (k = (0, t.jsx)("p", {
            className: v,
            children: b
        }), j[17] = v, j[18] = b, j[19] = k) : k = j[19], j[20] !== u || j[21] !== C ? (w = !!u && (0, t.jsx)("span", {
            onClick: u,
            className: "text-xs font-semibold text-background cursor-pointer rounded-xl px-[7px] py-[3px] bg-shade-black leading-[18px] ml-1 hover:opacity-80",
            children: C("trading.max")
        }), j[20] = u, j[21] = C, j[22] = w) : w = j[22], j[23] !== m || j[24] !== f || j[25] !== k || j[26] !== w ? (S = (0, t.jsxs)(a.motion.div, {
            className: f,
            ...m,
            children: [k, w]
        }), j[23] = m, j[24] = f, j[25] = k, j[26] = w, j[27] = S) : S = j[27], S
    }

    function y(e) {
        return e.portfolioHidden
    }
    e.s(["BalanceSection", 0, function(e) {
        let a, i, n, s, o = (0, r.c)(9);
        if (o[0] !== e ? ({
                variant: n,
                mode: a,
                ...i
            } = e, o[0] = e, o[1] = a, o[2] = i, o[3] = n) : (a = o[1], i = o[2], n = o[3]), "usdc" === n) {
            let e, r = i;
            return o[4] !== r ? (e = (0, t.jsx)(v, { ...r
            }), o[4] = r, o[5] = e) : e = o[5], e
        }
        let l = i;
        return o[6] !== a || o[7] !== l ? (s = (0, t.jsx)(h, {
            mode: a,
            ...l
        }), o[6] = a, o[7] = l, o[8] = s) : s = o[8], s
    }], 309256)
}, 627433, e => {
    "use strict";
    e.s(["MobileMarketControls", () => P, "SmpViewDrawerControls", () => E], 627433);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(339393),
        i = e.i(416340),
        n = e.i(502941),
        s = e.i(893849),
        o = e.i(6204),
        l = e.i(870555),
        c = e.i(118818),
        d = e.i(364562),
        u = e.i(454266),
        m = e.i(66199),
        p = e.i(525962),
        h = e.i(215885),
        f = e.i(779584),
        x = e.i(514687),
        g = e.i(484275),
        v = e.i(476603),
        y = e.i(880809),
        b = e.i(91817),
        k = e.i(36561),
        w = e.i(879756),
        S = e.i(784521),
        j = e.i(309256);
    let C = {
            color: "green",
            customColors: void 0
        },
        _ = {
            color: "red",
            customColors: void 0
        };

    function T() {
        let e, a, i, n, s, o, l, c = (0, r.c)(24);
        c[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["selectedOutcomeIdx", "setSelectedOutcomeIdx"], c[0] = e) : e = c[0];
        let {
            selectedOutcomeIdx: d,
            setSelectedOutcomeIdx: u
        } = (0, y.useTradeContext)(e), m = (0, b.useOutcomeButtonData)(0, void 0, C), p = (0, b.useOutcomeButtonData)(1, void 0, _), x = m.buttonColor.color;
        c[1] !== x || c[2] !== m.buttonColor.customColors || c[3] !== m.formattedPrice || c[4] !== m.label ? (a = {
            value: "0",
            label: m.label,
            price: m.formattedPrice,
            color: x,
            customColors: m.buttonColor.customColors
        }, c[1] = x, c[2] = m.buttonColor.customColors, c[3] = m.formattedPrice, c[4] = m.label, c[5] = a) : a = c[5];
        let g = p.buttonColor.color;
        c[6] !== p.buttonColor.customColors || c[7] !== p.formattedPrice || c[8] !== p.label || c[9] !== g ? (i = {
            value: "1",
            label: p.label,
            price: p.formattedPrice,
            color: g,
            customColors: p.buttonColor.customColors
        }, c[6] = p.buttonColor.customColors, c[7] = p.formattedPrice, c[8] = p.label, c[9] = g, c[10] = i) : i = c[10], c[11] !== a || c[12] !== i ? (n = [a, i], c[11] = a, c[12] = i, c[13] = n) : n = c[13];
        let v = n;
        c[14] !== u ? (s = e => {
            u(parseInt(e, 10))
        }, c[14] = u, c[15] = s) : s = c[15];
        let k = s;
        c[16] !== p || c[17] !== m ? (o = e => {
            let r = "0" === e.value ? m : p;
            return (0, t.jsx)(f.AnimatedPrice, {
                className: "ml-1 text-base",
                value: r.priceValue,
                format: r.priceFormat,
                formatted: r.formattedPrice,
                decimals: r.priceDecimals,
                dependency: r.formattedPrice
            })
        }, c[16] = p, c[17] = m, c[18] = o) : o = c[18];
        let w = o,
            S = `${d}`;
        return c[19] !== k || c[20] !== v || c[21] !== w || c[22] !== S ? (l = (0, t.jsx)(h.OutcomeButtonGroup, {
            value: S,
            onValueChange: k,
            options: v,
            isThreeDee: !1,
            layout: "center",
            renderPrice: w
        }), c[19] = k, c[20] = v, c[21] = w, c[22] = S, c[23] = l) : l = c[23], l
    }

    function M() {
        let e, a, n, s, o, c, d, u, h, f, y, b, C, _ = (0, r.c)(32);
        _[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], _[0] = e) : e = _[0];
        let {
            authenticated: M
        } = (0, S.useAccountContext)(e), {
            setTradeState: P
        } = (0, w.useMobileTradeContext)(), [E, A] = (0, i.useState)(!1);
        _[1] === Symbol.for("react.memo_cache_sentinel") ? (a = () => {
            A(!0)
        }, _[1] = a) : a = _[1];
        let O = a;
        _[2] === Symbol.for("react.memo_cache_sentinel") ? (n = {
            onApprovalRequired: O
        }, _[2] = n) : n = _[2];
        let {
            handlePresetTap: D,
            geoblocked: L,
            noAsks: z,
            bestAsk: R
        } = (0, v.useOneTapPresetTap)(n), F = M && L, $ = M && z;
        _[3] === Symbol.for("react.memo_cache_sentinel") ? (s = {
            defaultValue: g.DEFAULT_PRESETS,
            listenStorageChange: !0
        }, _[3] = s) : s = _[3];
        let [B] = (0, m.useLocalStorageState)(g.PRESETS_LS_KEY, s), q = B ? ? g.DEFAULT_PRESETS;
        _[4] !== D ? (o = e => {
            if ("u" > typeof navigator && "function" == typeof navigator.vibrate) try {
                navigator.vibrate(8)
            } catch {}
            D(e)
        }, _[4] = D, _[5] = o) : o = _[5];
        let V = o;
        _[6] !== P ? (c = () => {
            P({
                type: "one-tap",
                open: !0
            })
        }, _[6] = P, _[7] = c) : c = _[7];
        let H = c;
        if (_[8] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)(T, {}), _[8] = d) : d = _[8], _[9] !== M || _[10] !== H ? (u = M && (0, t.jsxs)("div", {
                className: "flex items-center justify-between gap-2",
                children: [(0, t.jsx)(j.BalanceSection, {
                    variant: "usdc"
                }), (0, t.jsx)("button", {
                    type: "button",
                    onClick: H,
                    "aria-label": "Edit one-tap",
                    className: "rounded-full px-3 py-1.5 text-sm font-semibold text-text-secondary hover:text-text-primary hover:bg-surface-2 transition-colors cursor-pointer",
                    children: "Edit"
                })]
            }), _[9] = M, _[10] = H, _[11] = u) : u = _[11], _[12] !== R || _[13] !== V || _[14] !== q || _[15] !== F || _[16] !== $) {
            let e;
            _[18] !== R || _[19] !== V || _[20] !== F || _[21] !== $ ? (e = (e, r) => {
                let a = R.valid && R.value > 0 ? Math.max(e / R.value, 0) : 0,
                    i = F || $;
                return (0, t.jsx)(k.PresetCard, {
                    amount: e,
                    win: a,
                    disabled: i,
                    onClick: () => V(e),
                    className: (0, l.cn)(i && "pointer-events-none")
                }, `${r}-${e}`)
            }, _[18] = R, _[19] = V, _[20] = F, _[21] = $, _[22] = e) : e = _[22], h = q.map(e), _[12] = R, _[13] = V, _[14] = q, _[15] = F, _[16] = $, _[17] = h
        } else h = _[17];
        return _[23] !== h ? (f = (0, t.jsx)("div", {
            className: "grid grid-cols-3 gap-2",
            children: h
        }), _[23] = h, _[24] = f) : f = _[24], _[25] === Symbol.for("react.memo_cache_sentinel") ? (y = (0, t.jsx)(x.default, {}), _[25] = y) : y = _[25], _[26] !== E ? (b = (0, t.jsx)(p.Modal, {
            open: E,
            onOpenChange: A,
            children: y
        }), _[26] = E, _[27] = b) : b = _[27], _[28] !== b || _[29] !== u || _[30] !== f ? (C = (0, t.jsxs)("div", {
            className: "flex w-screen flex-col gap-2 p-4 lg:hidden",
            onPointerDown: I,
            onClick: N,
            children: [d, u, f, b]
        }), _[28] = b, _[29] = u, _[30] = f, _[31] = C) : C = _[31], C
    }

    function N(e) {
        return e.stopPropagation()
    }

    function I(e) {
        return e.stopPropagation()
    }

    function P(e) {
        let a, i, n, o = (0, r.c)(8),
            {
                className: c
            } = e,
            d = (0, s.useShowOneTapDock)(),
            m = d ? "flex-col" : "h-20 justify-between items-center";
        return o[0] !== c || o[1] !== m ? (a = (0, l.cn)("flex w-full bg-background border-t border-border-secondary overflow-hidden lg:hidden", m, c), o[0] = c, o[1] = m, o[2] = a) : a = o[2], o[3] !== d ? (i = d ? (0, t.jsx)(M, {}) : (0, t.jsx)(u.MobileDrawerControls, {}), o[3] = d, o[4] = i) : i = o[4], o[5] !== a || o[6] !== i ? (n = (0, t.jsx)("div", {
            className: a,
            children: i
        }), o[5] = a, o[6] = i, o[7] = n) : n = o[7], n
    }
    M.displayName = "MobileOneTapDock";
    let E = () => {
        let e, i, s, u, m, p = (0, r.c)(8),
            {
                view: h
            } = (0, c.useMobileMarketContext)();
        p[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["isSportsPage"], p[0] = e) : e = p[0];
        let {
            isSportsPage: f
        } = (0, o.useSportsContext)(e);
        e: {
            let e;
            if (f) {
                let e;
                p[1] === Symbol.for("react.memo_cache_sentinel") ? (e = [d.MONEYLINE_SECTION_ID], p[1] = e) : e = p[1], i = e;
                break e
            }
            p[2] === Symbol.for("react.memo_cache_sentinel") ? (e = [], p[2] = e) : e = p[2],
            i = e
        }
        let x = i,
            g = (0, n.default)(x),
            v = x.some(e => g[e]);
        p[3] === Symbol.for("react.memo_cache_sentinel") ? (s = {
            wait: 200
        }, p[3] = s) : s = p[3];
        let y = (0, a.useDeferredMounted)(s),
            b = "default" === h || !y;
        if (b) return null;
        let k = f && (b || v) && "!translate-y-full";
        return p[4] !== k ? (u = (0, l.cn)("absolute left-0 right-0 bottom-0 z-[99999999] transition-transform !translate-y-0", k), p[4] = k, p[5] = u) : u = p[5], p[6] !== u ? (m = (0, t.jsx)(P, {
            className: u
        }, "mobile-single-market-detail-drawer-controls"), p[6] = u, p[7] = m) : m = p[7], m
    }
}, 122186, 435656, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(23128),
        i = e.i(169010),
        n = e.i(416340),
        s = e.i(149534);
    let o = ({
        strokeWidth: e = 1.5,
        ...t
    }) => n.default.createElement(s.Icon, {
        size: "18px",
        ...t
    }, n.default.createElement("polyline", {
        points: "5.25 12.5 1.75 9 5.25 5.5",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), n.default.createElement("polyline", {
        points: "12.75 12.5 16.25 9 12.75 5.5",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), n.default.createElement("line", {
        x1: "7.5",
        y1: "15.25",
        x2: "10.5",
        y2: "2.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }));
    e.s(["IconCode2Outline18", 0, o], 435656);
    var l = e.i(604777);
    e.s(["default", 0, e => {
        let n, s, c, d, u = (0, r.c)(8),
            {
                onClick: m
            } = e,
            p = (0, l.useTranslations)();
        return u[0] !== p ? (n = p("chart.settings.embed"), u[0] = p, u[1] = n) : n = u[1], u[2] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)(o, {}), u[2] = s) : s = u[2], u[3] !== m ? (c = (0, t.jsx)(a.Button, {
            variant: "ghost",
            size: "icon",
            className: "rounded-full",
            onClick: m,
            children: s
        }), u[3] = m, u[4] = c) : c = u[4], u[5] !== n || u[6] !== c ? (d = (0, t.jsx)(i.Tooltip, {
            content: n,
            showArrow: !1,
            side: "top",
            delayDuration: 50,
            sideOffset: 4,
            triggerAsChild: !0,
            children: c
        }), u[5] = n, u[6] = c, u[7] = d) : d = u[7], d
    }], 122186)
}, 913909, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(525962),
        i = e.i(169010),
        n = e.i(213567),
        s = e.i(416340),
        o = e.i(122186),
        l = e.i(927249);

    function c(e) {
        let a, i, n, s = (0, r.c)(8),
            {
                label: o,
                checked: c,
                onCheckedChange: d
            } = e;
        return s[0] !== o ? (a = (0, t.jsx)("span", {
            className: "text-body-sm text-text-primary",
            children: o
        }), s[0] = o, s[1] = a) : a = s[1], s[2] !== c || s[3] !== d ? (i = (0, t.jsx)(l.Switch, {
            checked: c,
            onCheckedChange: d
        }), s[2] = c, s[3] = d, s[4] = i) : i = s[4], s[5] !== a || s[6] !== i ? (n = (0, t.jsxs)("div", {
            className: "flex items-center justify-between",
            children: [a, i]
        }), s[5] = a, s[6] = i, s[7] = n) : n = s[7], n
    }

    function d(e) {
        let a, i, n, s, o, l, d, u, m, p, h = (0, r.c)(41),
            {
                embedType: f,
                showVolume: x,
                showChart: g,
                showLiveActivity: v,
                showYAxis: y,
                showGrid: b,
                showButtons: k,
                showBorder: w,
                theme: S,
                onShowVolumeChange: j,
                onShowChartChange: C,
                onShowLiveActivityChange: _,
                onShowYAxisChange: T,
                onShowGridChange: M,
                onShowButtonsChange: N,
                onShowBorderChange: I,
                onThemeChange: P
            } = e;
        h[0] !== C || h[1] !== g ? (a = (0, t.jsx)(c, {
            label: "Chart",
            checked: g,
            onCheckedChange: C
        }), h[0] = C, h[1] = g, h[2] = a) : a = h[2], h[3] !== f || h[4] !== N || h[5] !== k ? (i = "market" === f && (0, t.jsx)(c, {
            label: "Buy buttons",
            checked: k,
            onCheckedChange: N
        }), h[3] = f, h[4] = N, h[5] = k, h[6] = i) : i = h[6], h[7] !== f || h[8] !== j || h[9] !== x ? (n = "market" === f && (0, t.jsx)(c, {
            label: "Volume",
            checked: x,
            onCheckedChange: j
        }), h[7] = f, h[8] = j, h[9] = x, h[10] = n) : n = h[10], h[11] !== _ || h[12] !== v ? (s = (0, t.jsx)(c, {
            label: "Live activity",
            checked: v,
            onCheckedChange: _
        }), h[11] = _, h[12] = v, h[13] = s) : s = h[13], h[14] !== f || h[15] !== M || h[16] !== T || h[17] !== b || h[18] !== y ? (o = "market" === f && (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(c, {
                label: "Y Axis",
                checked: y,
                onCheckedChange: T
            }), (0, t.jsx)(c, {
                label: "Grid rows",
                checked: b,
                onCheckedChange: M
            })]
        }), h[14] = f, h[15] = M, h[16] = T, h[17] = b, h[18] = y, h[19] = o) : o = h[19], h[20] !== f || h[21] !== N || h[22] !== k ? (l = "sports" === f && (0, t.jsx)(c, {
            label: "Buy buttons",
            checked: k,
            onCheckedChange: N
        }), h[20] = f, h[21] = N, h[22] = k, h[23] = l) : l = h[23], h[24] !== I || h[25] !== w ? (d = (0, t.jsx)(c, {
            label: "Border",
            checked: w,
            onCheckedChange: I
        }), h[24] = I, h[25] = w, h[26] = d) : d = h[26];
        let E = "dark" === S;
        return h[27] !== P ? (u = e => P(e ? "dark" : "light"), h[27] = P, h[28] = u) : u = h[28], h[29] !== E || h[30] !== u ? (m = (0, t.jsx)(c, {
            label: "Dark mode",
            checked: E,
            onCheckedChange: u
        }), h[29] = E, h[30] = u, h[31] = m) : m = h[31], h[32] !== a || h[33] !== m || h[34] !== i || h[35] !== n || h[36] !== s || h[37] !== o || h[38] !== l || h[39] !== d ? (p = (0, t.jsxs)("div", {
            className: "flex flex-col gap-2",
            children: [a, i, n, s, o, l, d, m]
        }), h[32] = a, h[33] = m, h[34] = i, h[35] = n, h[36] = s, h[37] = o, h[38] = l, h[39] = d, h[40] = p) : p = h[40], p
    }
    var u = e.i(219469),
        m = e.i(215959),
        p = e.i(86831);

    function h(e) {
        let a, i, n, s = (0, r.c)(8),
            {
                label: o,
                onStep: l,
                className: c
            } = e;
        return s[0] !== l ? (a = e => {
            e.preventDefault(), l()
        }, s[0] = l, s[1] = a) : a = s[1], s[2] !== c ? (i = (0, p.cn)('absolute size-4 flex items-center justify-center bg-background rounded text-text-tertiary text-body-xs p-0 cursor-pointer opacity-0 pointer-events-none group-hover/dim:opacity-100 group-hover/dim:pointer-events-auto group-focus-within/dim:opacity-100 group-focus-within/dim:pointer-events-auto transition-opacity duration-150 before:absolute before:inset-[-6px] before:content-[""]', c), s[2] = c, s[3] = i) : i = s[3], s[4] !== o || s[5] !== a || s[6] !== i ? (n = (0, t.jsx)("button", {
            type: "button",
            onMouseDown: a,
            className: i,
            children: o
        }), s[4] = o, s[5] = a, s[6] = i, s[7] = n) : n = s[7], n
    }

    function f(e) {
        let a, i, n, o, l, c, d, u, m, f, x = (0, r.c)(22),
            {
                value: g,
                onChange: v,
                className: y,
                direction: b
            } = e,
            k = void 0 === b ? "horizontal" : b,
            [w, S] = s.default.useState(g),
            j = s.default.useRef(null);
        x[0] !== g ? (a = () => {
            S(g)
        }, i = [g], x[0] = g, x[1] = a, x[2] = i) : (a = x[1], i = x[2]), s.default.useEffect(a, i), x[3] !== v ? (n = e => {
            let t = e.target.value;
            S(t), j.current && clearTimeout(j.current), j.current = setTimeout(() => v ? .(t), 300)
        }, x[3] = v, x[4] = n) : n = x[4];
        let C = n;
        x[5] !== w || x[6] !== v ? (o = e => {
            j.current && clearTimeout(j.current);
            let t = String(Math.max(200, Math.min(800, (Number(w) || 0) + e)));
            S(t), v ? .(t)
        }, x[5] = w, x[6] = v, x[7] = o) : o = x[7];
        let _ = o;
        return x[8] === Symbol.for("react.memo_cache_sentinel") ? (l = () => () => {
            j.current && clearTimeout(j.current)
        }, c = [], x[8] = l, x[9] = c) : (l = x[8], c = x[9]), s.default.useEffect(l, c), x[10] !== k || x[11] !== _ ? (d = "horizontal" === k ? (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(h, {
                label: "−",
                onStep: () => _(-10),
                className: "top-1/2 -translate-y-1/2 right-full mr-1"
            }), (0, t.jsx)(h, {
                label: "+",
                onStep: () => _(10),
                className: "top-1/2 -translate-y-1/2 left-full ml-1"
            })]
        }) : (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(h, {
                label: "+",
                onStep: () => _(10),
                className: "left-1/2 -translate-x-1/2 bottom-full mb-1"
            }), (0, t.jsx)(h, {
                label: "−",
                onStep: () => _(-10),
                className: "left-1/2 -translate-x-1/2 top-full mt-1"
            })]
        }), x[10] = k, x[11] = _, x[12] = d) : d = x[12], x[13] !== y ? (u = (0, p.cn)("rounded-md border border-border bg-transparent relative px-2 py-1.5 text-center text-body-xs text-text-secondary focus:outline-none focus:border-border-active focus:text-text-primary shrink-0", y), x[13] = y, x[14] = u) : u = x[14], x[15] !== C || x[16] !== w || x[17] !== u ? (m = (0, t.jsx)("input", {
            type: "number",
            min: 200,
            max: 800,
            step: 10,
            value: w,
            onChange: C,
            className: u
        }), x[15] = C, x[16] = w, x[17] = u, x[18] = m) : m = x[18], x[19] !== m || x[20] !== d ? (f = (0, t.jsxs)("div", {
            className: "group/dim relative before:absolute before:inset-[-12px] before:content-['']",
            children: [d, m]
        }), x[19] = m, x[20] = d, x[21] = f) : f = x[21], f
    }

    function x(e) {
        let a, i, n, o, l, c, d, p, h, x, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z = (0, r.c)(80),
            {
                marketSlug: R,
                eventSlug: F,
                rotate: $,
                embedBase: B,
                showVolume: q,
                showChart: V,
                showLiveActivity: H,
                showYAxis: U,
                showGrid: W,
                showButtons: G,
                showBorder: Z,
                fit: K,
                theme: Y,
                creator: Q,
                via: X,
                width: J,
                height: ee,
                onWidthChange: et,
                onHeightChange: er,
                embedRoute: ea,
                hideDimensions: ei
            } = e,
            en = void 0 !== $ && $,
            es = void 0 === B ? "https://embed.polymarket.com" : B,
            eo = void 0 === q || q,
            el = void 0 === V || V,
            ec = void 0 !== H && H,
            ed = void 0 === U || U,
            eu = void 0 === W || W,
            em = void 0 === G || G,
            ep = void 0 !== Z && Z,
            eh = void 0 !== K && K,
            ef = void 0 === Y ? "light" : Y,
            ex = void 0 === J ? "400" : J,
            eg = void 0 === ee ? "300" : ee,
            ev = void 0 === ea ? "market" : ea,
            ey = void 0 !== ei && ei,
            eb = Number(ex) || 400,
            ek = Number(eg) || 300,
            [ew, eS] = s.default.useState(0),
            ej = s.default.useRef(null);
        z[0] !== ey ? (a = () => {
            if (!ey || !ej.current) return;
            let e = new ResizeObserver(e => {
                let [t] = e;
                t && eS(t.contentRect.width)
            });
            return e.observe(ej.current), () => e.disconnect()
        }, i = [ey], z[0] = ey, z[1] = a, z[2] = i) : (a = z[1], i = z[2]), s.default.useEffect(a, i);
        let eC = ey && ew > 0 ? Math.min(1, ew / eb) : Math.min(1, 380 / eb, 320 / ek);
        if (z[3] !== Q || z[4] !== es || z[5] !== ev || z[6] !== F || z[7] !== eh || z[8] !== eg || z[9] !== R || z[10] !== en || z[11] !== ep || z[12] !== em || z[13] !== el || z[14] !== eu || z[15] !== ec || z[16] !== eo || z[17] !== ed || z[18] !== ef || z[19] !== ek || z[20] !== eb || z[21] !== X) {
            let e = new URLSearchParams;
            en && F ? (e.set("event", F), e.set("rotate", "true")) : e.set("market", R), "dark" === ef && e.set("theme", "dark"), eo || e.set("volume", "false"), el || e.set("chart", "false"), ec && e.set("liveactivity", "true"), ed || e.set("yaxis", "false"), eu || e.set("grid", "false"), em || e.set("buttons", "false"), ep && e.set("border", "true"), eh && e.set("fit", "true"), Q && e.set("creator", Q), X && e.set("via", X), 400 !== eb && e.set("width", String(eb)), eg && e.set("height", String(ek)), n = es, o = ev, l = e.toString(), z[3] = Q, z[4] = es, z[5] = ev, z[6] = F, z[7] = eh, z[8] = eg, z[9] = R, z[10] = en, z[11] = ep, z[12] = em, z[13] = el, z[14] = eu, z[15] = ec, z[16] = eo, z[17] = ed, z[18] = ef, z[19] = ek, z[20] = eb, z[21] = X, z[22] = n, z[23] = o, z[24] = l
        } else n = z[22], o = z[23], l = z[24];
        let e_ = `${n}/${o}?${l}`;
        z[25] !== eC || z[26] !== eb ? (c = Math.round(eb * eC), z[25] = eC, z[26] = eb, z[27] = c) : c = z[27];
        let eT = c;
        z[28] !== eC || z[29] !== ek ? (d = Math.round(ek * eC), z[28] = eC, z[29] = ek, z[30] = d) : d = z[30];
        let eM = d;
        z[31] === Symbol.for("react.memo_cache_sentinel") ? (p = {
            opacity: 0
        }, z[31] = p) : p = z[31], z[32] === Symbol.for("react.memo_cache_sentinel") ? (h = {
            opacity: 1,
            transition: {
                type: "tween",
                duration: .3,
                delay: .2,
                ease: "easeInOut"
            }
        }, z[32] = h) : h = z[32], z[33] === Symbol.for("react.memo_cache_sentinel") ? (x = {
            initial: p,
            animate: h,
            exit: {
                opacity: 0,
                transition: {
                    type: "tween",
                    duration: .25,
                    ease: "easeInOut"
                }
            }
        }, z[33] = x) : x = z[33], z[34] !== eM || z[35] !== eT ? (g = {
            width: eT,
            height: eM
        }, z[34] = eM, z[35] = eT, z[36] = g) : g = z[36];
        let eN = `scale(${eC})`;
        z[37] !== eN ? (v = {
            border: "none",
            display: "block",
            borderRadius: 16,
            overflow: "hidden",
            transform: eN,
            transformOrigin: "top left"
        }, z[37] = eN, z[38] = v) : v = z[38], z[39] !== e_ || z[40] !== v || z[41] !== ek || z[42] !== eb ? (y = (0, t.jsx)("iframe", {
            title: "polymarket-embed-preview",
            src: e_,
            width: eb,
            height: ek,
            frameBorder: "0",
            scrolling: "no",
            style: v
        }), z[39] = e_, z[40] = v, z[41] = ek, z[42] = eb, z[43] = y) : y = z[43], z[44] !== e_ || z[45] !== g || z[46] !== y ? (b = (0, t.jsx)(u.AnimatePresence, {
            mode: "wait",
            children: (0, t.jsx)(m.motion.div, {
                variants: x,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                style: g,
                children: y
            }, e_)
        }), z[44] = e_, z[45] = g, z[46] = y, z[47] = b) : b = z[47];
        let eI = b;
        if (ey) {
            let e;
            return z[48] !== eI ? (e = (0, t.jsx)("div", {
                ref: ej,
                className: "flex items-center justify-center w-full",
                children: eI
            }), z[48] = eI, z[49] = e) : e = z[49], e
        }
        return z[50] !== eM ? (k = {
            height: eM
        }, z[50] = eM, z[51] = k) : k = z[51], z[52] === Symbol.for("react.memo_cache_sentinel") ? (w = (0, t.jsx)("span", {
            className: "flex-1 w-px bg-text-tertiary/20"
        }), z[52] = w) : w = z[52], z[53] === Symbol.for("react.memo_cache_sentinel") ? (S = (0, t.jsx)("span", {
            className: "text-body-xs text-text-tertiary font-semibold leading-none absolute -left-4 top-1/2 -translate-y-1/2",
            children: "H"
        }), z[53] = S) : S = z[53], z[54] !== eg || z[55] !== er ? (j = (0, t.jsxs)("div", {
            className: "relative",
            children: [S, (0, t.jsx)(f, {
                value: eg,
                onChange: er,
                direction: "vertical"
            })]
        }), z[54] = eg, z[55] = er, z[56] = j) : j = z[56], z[57] === Symbol.for("react.memo_cache_sentinel") ? (C = (0, t.jsx)("span", {
            className: "flex-1 w-px bg-text-tertiary/20"
        }), z[57] = C) : C = z[57], z[58] !== k || z[59] !== j ? (_ = (0, t.jsx)("div", {
            className: "flex flex-col items-center gap-2 w-12 justify-center",
            children: (0, t.jsxs)("div", {
                className: "flex flex-col items-center gap-2 transition-[height] duration-150",
                style: k,
                children: [w, j, C]
            })
        }), z[58] = k, z[59] = j, z[60] = _) : _ = z[60], z[61] === Symbol.for("react.memo_cache_sentinel") ? (T = {
            width: 380,
            height: 320
        }, z[61] = T) : T = z[61], z[62] !== eI ? (M = (0, t.jsx)("div", {
            className: "flex items-center justify-center",
            style: T,
            children: eI
        }), z[62] = eI, z[63] = M) : M = z[63], z[64] === Symbol.for("react.memo_cache_sentinel") ? (N = (0, t.jsx)("div", {}), z[64] = N) : N = z[64], z[65] !== eT ? (I = {
            width: eT
        }, z[65] = eT, z[66] = I) : I = z[66], z[67] === Symbol.for("react.memo_cache_sentinel") ? (P = (0, t.jsx)("span", {
            className: "flex-1 h-px bg-text-tertiary/20"
        }), z[67] = P) : P = z[67], z[68] === Symbol.for("react.memo_cache_sentinel") ? (E = (0, t.jsx)("span", {
            className: "text-body-xs text-text-tertiary font-semibold leading-none absolute -bottom-4 left-1/2 -translate-x-1/2",
            children: "W"
        }), z[68] = E) : E = z[68], z[69] !== et || z[70] !== ex ? (A = (0, t.jsxs)("div", {
            className: "relative",
            children: [E, (0, t.jsx)(f, {
                value: ex,
                onChange: et
            })]
        }), z[69] = et, z[70] = ex, z[71] = A) : A = z[71], z[72] === Symbol.for("react.memo_cache_sentinel") ? (O = (0, t.jsx)("span", {
            className: "flex-1 h-px bg-text-tertiary/20"
        }), z[72] = O) : O = z[72], z[73] !== I || z[74] !== A ? (D = (0, t.jsx)("div", {
            className: "flex items-center justify-center h-8",
            children: (0, t.jsxs)("div", {
                className: "flex items-center gap-2 transition-[width] duration-150",
                style: I,
                children: [P, A, O]
            })
        }), z[73] = I, z[74] = A, z[75] = D) : D = z[75], z[76] !== _ || z[77] !== M || z[78] !== D ? (L = (0, t.jsxs)("div", {
            className: "grid grid-cols-[auto_1fr] grid-rows-[1fr_auto] w-fit h-fit",
            children: [_, M, N, D]
        }), z[76] = _, z[77] = M, z[78] = D, z[79] = L) : L = z[79], L
    }
    let g = "https://polymarket.com",
        v = "position:absolute;top:16px;right:20px;width:120px;height:24px;z-index:10",
        y = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";

    function b(e) {
        return e.replace(/<\//g, "<\\/")
    }

    function k(e) {
        return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
    }

    function w(e) {
        return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "")
    }
    var S = e.i(138567),
        j = e.i(421569),
        C = e.i(435656),
        _ = e.i(598440),
        T = e.i(97271),
        M = e.i(721747),
        N = e.i(23128),
        I = e.i(158789),
        P = e.i(798631);
    let E = {
        default: "Default",
        minimal: "Minimal"
    };

    function A(e) {
        let a, i, n, s, o, l, c, d, u = (0, r.c)(15),
            {
                value: m,
                onChange: p
            } = e,
            h = E[m];
        return u[0] !== h ? (a = (0, t.jsx)("span", {
            className: "truncate",
            children: h
        }), u[0] = h, u[1] = a) : a = u[1], u[2] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(P.IconChevronDownOutline12, {
            className: "shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180"
        }), u[2] = i) : i = u[2], u[3] !== a ? (n = (0, t.jsx)(I.DropdownMenuTrigger, {
            asChild: !0,
            children: (0, t.jsxs)(N.Button, {
                variant: "outline",
                className: "group justify-between gap-2 focus-visible:ring-0",
                children: [a, i]
            })
        }), u[3] = a, u[4] = n) : n = u[4], u[5] !== p ? (s = e => p(e), u[5] = p, u[6] = s) : s = u[6], u[7] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)(I.DropdownMenuRadioItem, {
            value: "default",
            children: "Default"
        }), l = (0, t.jsx)(I.DropdownMenuRadioItem, {
            value: "minimal",
            children: "Minimal"
        }), u[7] = o, u[8] = l) : (o = u[7], l = u[8]), u[9] !== s || u[10] !== m ? (c = (0, t.jsx)(I.DropdownMenuContent, {
            align: "start",
            className: "z-[251]",
            children: (0, t.jsxs)(I.DropdownMenuRadioGroup, {
                value: m,
                onValueChange: s,
                children: [o, l]
            })
        }), u[9] = s, u[10] = m, u[11] = c) : c = u[11], u[12] !== n || u[13] !== c ? (d = (0, t.jsxs)(I.DropdownMenu, {
            children: [n, c]
        }), u[12] = n, u[13] = c, u[14] = d) : d = u[14], d
    }
    let O = "#9B51E0",
        D = "#BB6BD9",
        L = {
            direction: "ltr",
            textAlign: "left",
            whiteSpace: "pre",
            wordSpacing: "normal",
            wordBreak: "normal",
            fontSize: ".9em",
            lineHeight: "1.6em",
            tabSize: 4,
            hyphens: "none"
        },
        z = {
            fontFamily: "inherit"
        },
        R = {
            light: {
                'code[class*="language-"]': { ...L,
                    color: "#000"
                },
                'pre[class*="language-"]': { ...L,
                    color: "#000",
                    padding: "0px",
                    margin: "0",
                    overflow: "auto",
                    border: "none",
                    backgroundColor: "var(--neutral-50)"
                },
                comment: {
                    color: "var(--neutral-400)",
                    fontStyle: "italic",
                    ...z
                },
                prolog: {
                    color: "var(--neutral-400)",
                    fontStyle: "italic",
                    ...z
                },
                doctype: {
                    color: "var(--neutral-400)",
                    fontStyle: "italic",
                    ...z
                },
                cdata: {
                    color: "var(--neutral-400)",
                    fontStyle: "italic",
                    ...z
                },
                namespace: {
                    opacity: .7,
                    ...z
                },
                string: {
                    color: "var(--neutral-400)",
                    ...z
                },
                punctuation: {
                    color: "var(--neutral-400)",
                    ...z
                },
                operator: {
                    color: "var(--neutral-400)",
                    ...z
                },
                url: {
                    color: "var(--neutral-400)",
                    ...z
                },
                symbol: {
                    color: "var(--neutral-400)",
                    ...z
                },
                number: {
                    color: "var(--neutral-400)",
                    ...z
                },
                boolean: {
                    color: "var(--neutral-400)",
                    ...z
                },
                variable: {
                    color: "var(--neutral-400)",
                    ...z
                },
                constant: {
                    color: "var(--neutral-400)",
                    ...z
                },
                inserted: {
                    color: "var(--neutral-400)",
                    ...z
                },
                atrule: {
                    color: O,
                    ...z
                },
                keyword: {
                    color: O,
                    ...z
                },
                "attr-value": {
                    color: O,
                    ...z
                },
                function: {
                    color: "#393A34",
                    ...z
                },
                deleted: {
                    color: "#333333",
                    ...z
                },
                selector: {
                    color: "#333333",
                    ...z
                },
                important: {
                    color: O,
                    fontWeight: "bold",
                    ...z
                },
                bold: {
                    fontWeight: "bold",
                    ...z
                },
                italic: {
                    fontStyle: "italic",
                    ...z
                },
                "class-name": {
                    color: "var(--neutral-400)",
                    ...z
                },
                tag: {
                    color: "var(--neutral-400)",
                    ...z
                },
                "attr-name": {
                    color: "#e04569",
                    ...z
                },
                property: {
                    color: O,
                    ...z
                },
                regex: {
                    color: O,
                    ...z
                },
                entity: {
                    color: O,
                    ...z
                }
            },
            dark: {
                'code[class*="language-"]': { ...L,
                    color: "var(--neutral-400)"
                },
                'pre[class*="language-"]': { ...L,
                    color: "var(--neutral-400)",
                    padding: "0px",
                    margin: "0",
                    overflow: "auto",
                    border: "none",
                    backgroundColor: "var(--neutral-50)"
                },
                comment: {
                    color: "var(--neutral-400)",
                    fontStyle: "italic",
                    ...z
                },
                prolog: {
                    color: "var(--neutral-400)",
                    fontStyle: "italic",
                    ...z
                },
                doctype: {
                    color: "var(--neutral-400)",
                    fontStyle: "italic",
                    ...z
                },
                cdata: {
                    color: "var(--neutral-400)",
                    fontStyle: "italic",
                    ...z
                },
                namespace: {
                    opacity: .7,
                    ...z
                },
                string: {
                    color: "var(--neutral-400)",
                    ...z
                },
                punctuation: {
                    color: "var(--neutral-400)",
                    ...z
                },
                operator: {
                    color: "var(--neutral-400)",
                    ...z
                },
                url: {
                    color: "var(--neutral-400)",
                    ...z
                },
                symbol: {
                    color: "var(--neutral-400)",
                    ...z
                },
                number: {
                    color: "var(--neutral-400)",
                    ...z
                },
                boolean: {
                    color: "var(--neutral-400)",
                    ...z
                },
                variable: {
                    color: "var(--neutral-400)",
                    ...z
                },
                constant: {
                    color: "var(--neutral-400)",
                    ...z
                },
                inserted: {
                    color: "var(--neutral-400)",
                    ...z
                },
                atrule: {
                    color: D,
                    ...z
                },
                keyword: {
                    color: D,
                    ...z
                },
                "attr-value": {
                    color: D,
                    ...z
                },
                function: {
                    color: "#393A34",
                    ...z
                },
                deleted: {
                    color: "var(--neutral-400)",
                    ...z
                },
                selector: {
                    color: "var(--neutral-400)",
                    ...z
                },
                important: {
                    color: D,
                    fontWeight: "bold",
                    ...z
                },
                bold: {
                    fontWeight: "bold",
                    ...z
                },
                italic: {
                    fontStyle: "italic",
                    ...z
                },
                "class-name": {
                    color: "var(--neutral-400)",
                    ...z
                },
                tag: {
                    color: "var(--neutral-400)",
                    ...z
                },
                "attr-name": {
                    color: "#e04569",
                    ...z
                },
                property: {
                    color: D,
                    ...z
                },
                regex: {
                    color: D,
                    ...z
                },
                entity: {
                    color: D,
                    ...z
                }
            }
        },
        F = (0, T.default)(async () => {
            let t = (await e.A(805406)).default,
                r = (await e.A(926361)).default;
            return t.registerLanguage("markup", r), t
        }, {
            loadableGenerated: {
                modules: [82888]
            },
            ssr: !1
        });

    function $(e) {
        let a, i, n, o, l, c, d, h, f, x, g, v, y, b, k, w, T, I, P, E, O, D, L, z, $, B, q, V, H, U, W, G = (0, r.c)(65),
            {
                preview: Z,
                configControls: K,
                sidebarHeader: Y,
                htmlCodeString: Q,
                isDark: X,
                embedMode: J,
                onEmbedModeChange: ee
            } = e,
            [et, er] = s.default.useState("config"),
            [ea, ei] = s.default.useState(!1),
            [, en] = (0, M.useCopyToClipboard)();
        G[0] !== ea ? (a = () => {
            if (ea) {
                let e = setTimeout(() => ei(!1), 2e3);
                return () => clearTimeout(e)
            }
        }, i = [ea], G[0] = ea, G[1] = a, G[2] = i) : (a = G[1], i = G[2]), s.default.useEffect(a, i), G[3] !== en || G[4] !== Q ? (n = async () => {
            await en(Q) && ei(!0)
        }, G[3] = en, G[4] = Q, G[5] = n) : n = G[5];
        let es = n,
            eo = X ? R.dark : R.light;
        G[6] === Symbol.for("react.memo_cache_sentinel") ? (o = {
            borderRadius: 0,
            fontSize: "0.7rem",
            padding: "28px 12px 12px",
            margin: 0
        }, l = {
            style: {
                fontFamily: 'monospace, Consolas, "Bitstream Vera Sans Mono", "Courier New", Courier'
            }
        }, G[6] = o, G[7] = l) : (o = G[6], l = G[7]), G[8] !== Q || G[9] !== eo ? (c = (0, t.jsx)(F, {
            language: "markup",
            style: eo,
            showLineNumbers: !1,
            customStyle: o,
            codeTagProps: l,
            children: Q
        }), G[8] = Q, G[9] = eo, G[10] = c) : c = G[10], G[11] !== ea ? (d = ea ? (0, t.jsx)(S.IconCheckOutline18, {
            size: 16
        }) : (0, t.jsx)(_.IconCopyOutline18, {
            size: 16
        }), G[11] = ea, G[12] = d) : d = G[12], G[13] !== es || G[14] !== d ? (h = (0, t.jsx)("button", {
            type: "button",
            onClick: es,
            className: "absolute top-1 right-1 p-1.5 cursor-pointer text-text-secondary hover:text-text-tertiary",
            children: d
        }), G[13] = es, G[14] = d, G[15] = h) : h = G[15], G[16] !== c || G[17] !== h ? (f = (0, t.jsxs)("div", {
            className: "group relative min-w-0 flex-1 overflow-auto rounded-lg bg-neutral-50",
            children: [c, h]
        }), G[16] = c, G[17] = h, G[18] = f) : f = G[18];
        let el = f;
        G[19] === Symbol.for("react.memo_cache_sentinel") ? (x = {
            opacity: 0,
            scale: .95
        }, g = {
            opacity: 1,
            scale: 1
        }, v = {
            opacity: 0,
            scale: .95
        }, y = {
            duration: .12
        }, G[19] = x, G[20] = g, G[21] = v, G[22] = y) : (x = G[19], g = G[20], v = G[21], y = G[22]);
        let ec = "config" === et && "pb-2 pl-6";
        return G[23] !== ec ? (b = (0, p.cn)("w-[500px] h-[400px] flex flex-col", ec), G[23] = ec, G[24] = b) : b = G[24], G[25] !== el || G[26] !== Z || G[27] !== et ? (k = "config" === et ? Z : (0, t.jsxs)("div", {
            className: "flex flex-col gap-2 h-full min-h-0",
            children: [(0, t.jsx)("p", {
                className: "text-body-sm text-text-secondary shrink-0",
                children: "Copy and paste this code into your website"
            }), el]
        }), G[25] = el, G[26] = Z, G[27] = et, G[28] = k) : k = G[28], G[29] !== et || G[30] !== b || G[31] !== k ? (w = (0, t.jsx)("div", {
            className: "w-fit lg:w-fit lg:order-last lg:h-fit",
            children: (0, t.jsx)(u.AnimatePresence, {
                mode: "popLayout",
                initial: !1,
                children: (0, t.jsx)(m.motion.div, {
                    initial: x,
                    animate: g,
                    exit: v,
                    transition: y,
                    className: b,
                    children: k
                }, et)
            })
        }), G[29] = et, G[30] = b, G[31] = k, G[32] = w) : w = G[32], G[33] === Symbol.for("react.memo_cache_sentinel") ? (T = {
            opacity: 0
        }, I = {
            opacity: 1
        }, P = {
            opacity: 0
        }, E = {
            duration: .12
        }, G[33] = T, G[34] = I, G[35] = P, G[36] = E) : (T = G[33], I = G[34], P = G[35], E = G[36]), G[37] !== K || G[38] !== J || G[39] !== ee || G[40] !== Y || G[41] !== et ? (O = "config" === et ? (0, t.jsxs)(t.Fragment, {
            children: [Y && (0, t.jsx)("div", {
                className: "border-t border-border"
            }), K]
        }) : (0, t.jsxs)("div", {
            className: "flex items-center justify-between gap-2",
            children: [(0, t.jsx)("span", {
                className: "text-body-sm text-text-primary shrink-0",
                children: "Code style"
            }), (0, t.jsx)(A, {
                value: J,
                onChange: ee
            })]
        }), G[37] = K, G[38] = J, G[39] = ee, G[40] = Y, G[41] = et, G[42] = O) : O = G[42], G[43] !== et || G[44] !== O ? (D = (0, t.jsx)(u.AnimatePresence, {
            mode: "popLayout",
            initial: !1,
            children: (0, t.jsx)(m.motion.div, {
                initial: T,
                animate: I,
                exit: P,
                transition: E,
                className: "flex flex-col gap-4",
                children: O
            }, et)
        }), G[43] = et, G[44] = O, G[45] = D) : D = G[45], G[46] === Symbol.for("react.memo_cache_sentinel") ? (L = (0, t.jsx)("div", {
            className: "flex-1"
        }), G[46] = L) : L = G[46], G[47] === Symbol.for("react.memo_cache_sentinel") ? (z = {
            opacity: 0
        }, $ = {
            opacity: 1
        }, B = {
            opacity: 0
        }, q = {
            duration: .12
        }, G[47] = z, G[48] = $, G[49] = B, G[50] = q) : (z = G[47], $ = G[48], B = G[49], q = G[50]), G[51] !== ea || G[52] !== es || G[53] !== et ? (V = "config" === et ? (0, t.jsxs)(N.Button, {
            className: "w-full bg-primary text-primary-foreground hover:bg-primary/90",
            onClick: () => er("code"),
            children: [(0, t.jsx)(C.IconCode2Outline18, {
                size: 16
            }), "View Code"]
        }) : (0, t.jsxs)("div", {
            className: "flex items-center gap-2",
            children: [(0, t.jsxs)(N.Button, {
                variant: "outline",
                onClick: () => er("config"),
                children: [(0, t.jsx)(j.IconChevronLeftOutline12, {
                    className: "size-3"
                }), "Back"]
            }), (0, t.jsxs)(N.Button, {
                className: "flex-1 bg-primary text-primary-foreground hover:bg-primary/90",
                onClick: es,
                children: [ea ? (0, t.jsx)(S.IconCheckOutline18, {
                    size: 14
                }) : (0, t.jsx)(_.IconCopyOutline18, {
                    size: 14
                }), ea ? "Copied" : "Copy"]
            })]
        }), G[51] = ea, G[52] = es, G[53] = et, G[54] = V) : V = G[54], G[55] !== et || G[56] !== V ? (H = (0, t.jsx)(u.AnimatePresence, {
            mode: "popLayout",
            initial: !1,
            children: (0, t.jsx)(m.motion.div, {
                initial: z,
                animate: $,
                exit: B,
                transition: q,
                children: V
            }, et)
        }), G[55] = et, G[56] = V, G[57] = H) : H = G[57], G[58] !== Y || G[59] !== D || G[60] !== H ? (U = (0, t.jsxs)("div", {
            className: "flex flex-col gap-4 w-full lg:w-64 shrink-0 lg:overflow-y-auto min-h-0 h-[400px] lg:max-h-[500px]",
            children: [Y, D, L, H]
        }), G[58] = Y, G[59] = D, G[60] = H, G[61] = U) : U = G[61], G[62] !== w || G[63] !== U ? (W = (0, t.jsxs)("div", {
            className: "flex flex-col lg:flex-row gap-4 lg:gap-12 min-w-fit min-h-0 w-fit",
            children: [w, U]
        }), G[62] = w, G[63] = U, G[64] = W) : W = G[64], W
    }
    var B = e.i(918997);
    let q = "__rotate__";

    function V(e) {
        let a, i, n, s, o, l, c, d, u, m = (0, r.c)(23),
            {
                event: p,
                market: h,
                rotate: f,
                onMarketChange: x,
                onRotateChange: g
            } = e,
            v = void 0 !== f && f;
        m[0] !== p.markets[0] || m[1] !== h || m[2] !== x ? (a = {
            prop: h,
            defaultProp: p.markets[0],
            onChange: x
        }, m[0] = p.markets[0], m[1] = h, m[2] = x, m[3] = a) : a = m[3];
        let [y, b] = (0, B.useControllableState)(a), k = void 0 === y ? h : y, w = v ? q : k ? .slug, S = v ? "Rotate All" : k ? .groupItemTitle ? ? k ? .question;
        return m[4] !== S ? (i = (0, t.jsx)("span", {
            className: "truncate",
            children: S
        }), m[4] = S, m[5] = i) : i = m[5], m[6] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)(P.IconChevronDownOutline12, {
            className: "shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-180"
        }), m[6] = n) : n = m[6], m[7] !== i ? (s = (0, t.jsx)(I.DropdownMenuTrigger, {
            asChild: !0,
            children: (0, t.jsxs)(N.Button, {
                variant: "outline",
                className: "group max-w-full overflow-hidden justify-between gap-2 focus-visible:ring-0",
                children: [i, n]
            })
        }), m[7] = i, m[8] = s) : s = m[8], m[9] !== p.markets || m[10] !== g || m[11] !== b ? (o = e => {
            e === q ? g ? .(!0) : (g ? .(!1), b(p.markets.find(t => t.slug ? .toLowerCase() === e)))
        }, m[9] = p.markets, m[10] = g, m[11] = b, m[12] = o) : o = m[12], m[13] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, t.jsx)(I.DropdownMenuRadioItem, {
            value: q,
            children: "Rotate All"
        }), m[13] = l) : l = m[13], m[14] !== p.markets ? (c = p.markets.map(H), m[14] = p.markets, m[15] = c) : c = m[15], m[16] !== w || m[17] !== c || m[18] !== o ? (d = (0, t.jsx)(I.DropdownMenuContent, {
            align: "start",
            className: "z-[251] max-h-[250px]",
            children: (0, t.jsxs)(I.DropdownMenuRadioGroup, {
                value: w,
                onValueChange: o,
                children: [l, c]
            })
        }), m[16] = w, m[17] = c, m[18] = o, m[19] = d) : d = m[19], m[20] !== d || m[21] !== s ? (u = (0, t.jsxs)(I.DropdownMenu, {
            children: [s, d]
        }), m[20] = d, m[21] = s, m[22] = u) : u = m[22], u
    }

    function H(e) {
        return (0, t.jsx)(I.DropdownMenuRadioItem, {
            value: e.slug,
            children: e.groupItemTitle ? ? e.question
        }, e.id)
    }
    var U = e.i(425010),
        W = e.i(333223),
        G = e.i(784521);
    e.i(284553);
    let Z = "https://embed.polymarket.com",
        K = null;

    function Y() {
        return K ? ? Z
    }

    function Q() {
        let e, t, a, i = (0, r.c)(11);
        i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], i[0] = e) : e = i[0];
        let {
            authenticated: n
        } = (0, G.useAccountContext)(e);
        i[1] !== n ? (t = {
            enabled: n
        }, i[1] = n, i[2] = t) : t = i[2];
        let {
            accountProfile: o
        } = (0, W.default)(void 0, t), {
            resolvedTheme: l
        } = (0, U.useTheme)(), c = "dark" === l, [d, u] = s.default.useState("400"), [m, p] = s.default.useState("300"), [h, f] = s.default.useState("default"), [x, g] = s.default.useState(""), v = function() {
            let e, t, a = (0, r.c)(2),
                [i, n] = (0, s.useState)(Y);
            return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = () => {
                (K ? Promise.resolve(K) : (K = Z, Promise.resolve(Z))).then(n)
            }, t = [], a[0] = e, a[1] = t) : (e = a[0], t = a[1]), (0, s.useEffect)(e, t), i
        }(), y = o ? .displayUsernamePublic ? o ? .username : o ? .pseudonym;
        return i[3] !== x || i[4] !== v || i[5] !== m || i[6] !== h || i[7] !== d || i[8] !== c || i[9] !== y ? (a = {
            isDark: c,
            embedWidth: d,
            setEmbedWidth: u,
            embedHeight: m,
            setEmbedHeight: p,
            embedMode: h,
            setEmbedMode: f,
            affiliateCode: x,
            setAffiliateCode: g,
            embedBase: v,
            username: y
        }, i[3] = x, i[4] = v, i[5] = m, i[6] = h, i[7] = d, i[8] = c, i[9] = y, i[10] = a) : a = i[10], a
    }
    let X = e => {
        let a, i, n, o, l, c, u = (0, r.c)(66),
            {
                event: m,
                market: p
            } = e,
            {
                isDark: h,
                embedWidth: f,
                setEmbedWidth: S,
                embedHeight: j,
                setEmbedHeight: C,
                embedMode: _,
                setEmbedMode: T,
                affiliateCode: M,
                embedBase: N,
                username: I
            } = Q(),
            [P, E] = s.default.useState(!0),
            [A, O] = s.default.useState(!0),
            [D, L] = s.default.useState(!1),
            [z, R] = s.default.useState(!0),
            [F, B] = s.default.useState(!0),
            [q, H] = s.default.useState(!0),
            [U, W] = s.default.useState(!1),
            [G, K] = s.default.useState(h ? "dark" : "light"),
            [Y, X] = s.default.useState(p ? ? m.markets[0]),
            [J, ee] = s.default.useState(!1),
            et = J ? void 0 : Y.slug,
            er = J ? m.slug ? ? void 0 : void 0,
            ea = M || void 0;
        if (u[0] !== j || u[1] !== f || u[2] !== J || u[3] !== U || u[4] !== q || u[5] !== A || u[6] !== F || u[7] !== D || u[8] !== P || u[9] !== z || u[10] !== et || u[11] !== er || u[12] !== ea || u[13] !== G || u[14] !== I) {
            var ei;
            let e, t;
            ei = {
                marketSlug: et,
                eventSlug: er,
                rotate: J,
                showVolume: P,
                showChart: A,
                showLiveActivity: D,
                showYAxis: z,
                showGrid: F,
                showButtons: q,
                showBorder: U,
                theme: G,
                width: f,
                height: j,
                creator: I,
                via: ea
            }, e = new URLSearchParams, ei.marketSlug && e.set("market", ei.marketSlug), ei.eventSlug && e.set("event", ei.eventSlug), ei.rotate && e.set("rotate", "true"), "dark" === ei.theme && e.set("theme", "dark"), !1 === ei.showVolume && e.set("volume", "false"), !1 === ei.showChart && e.set("chart", "false"), ei.showLiveActivity && e.set("liveactivity", "true"), !1 === ei.showYAxis && e.set("yaxis", "false"), !1 === ei.showGrid && e.set("grid", "false"), !1 === ei.showButtons && e.set("buttons", "false"), ei.showBorder && e.set("border", "true"), ei.creator && e.set("creator", ei.creator), ei.via && e.set("via", ei.via), "400" !== (t = ei.width ? ? "400") && e.set("width", t), ei.height && e.set("height", ei.height), a = `${Z}/market?${e.toString()}`, u[0] = j, u[1] = f, u[2] = J, u[3] = U, u[4] = q, u[5] = A, u[6] = F, u[7] = D, u[8] = P, u[9] = z, u[10] = et, u[11] = er, u[12] = ea, u[13] = G, u[14] = I, u[15] = a
        } else a = u[15];
        let en = a,
            es = m.slug ? ? "";
        u[16] !== j || u[17] !== _ || u[18] !== f || u[19] !== en || u[20] !== Y.outcomePrices || u[21] !== Y.outcomes || u[22] !== Y.question || u[23] !== Y.slug || u[24] !== es ? (i = function(e) {
            let t = e.height || "400",
                r = e.question && e.outcomes.length >= 2 && e.outcomePrices.length >= 2;
            if ("minimal" === e.mode || !r) return `<iframe
	title="polymarket-market-iframe"
	src="${e.iframeSrc}"
	width="${e.width}"
	height="${t}"
	frameBorder="0"
/>`;
            let a = e.outcomePrices.map(e => Math.round(100 * parseFloat(e))),
                i = e.eventSlug ? `${g}/event/${e.eventSlug}` : g,
                n = e.outcomes.map((e, t) => `${e} ${a[t]??0}%`).join(" · "),
                s = `Prediction market: ${n} on Polymarket.`,
                o = b(JSON.stringify({
                    "@context": "https://schema.org",
                    "@type": "WebPage",
                    name: e.question,
                    description: s,
                    url: i,
                    publisher: {
                        "@type": "Organization",
                        name: "Polymarket",
                        url: g
                    }
                }, null, 2)),
                l = `polymarket-${w(e.marketSlug)}`,
                c = k(`${e.question} — Polymarket Prediction Market`),
                d = k(`Polymarket prediction market: ${e.question}`),
                u = k(e.question),
                m = k(n);
            return ['<script type="application/ld+json">', o, '</script>\n<figure\n	class="polymarket-embed"', `	id="${l}"`, `	aria-label="${d}"`, '	itemscope\n	itemtype="https://schema.org/WebPage"', `	style="position:relative;${e.fit?"display:block;width:100%;height:100%":"display:inline-block"};margin:0">`, "	<iframe", `		title="${c}"`, `		src="${e.iframeSrc}"`, `		width="${e.width}"`, `		height="${t}"`, '		frameborder="0"\n		allowtransparency="true">\n	</iframe>', `	<a href="${i}"`, '		aria-label="View on Polymarket"\n		target="_blank"\n		rel="noopener"', `		style="${v}">`, "	</a>", `	<figcaption style="${y}">`, `		<strong>${u}</strong><br>`, `		${m}<br>`, `		<a href="${i}">`, "			View full market &amp; trade on Polymarket\n		</a>\n	</figcaption>\n</figure>"].join("\n")
        }({
            iframeSrc: en,
            width: f,
            height: j,
            question: Y.question,
            outcomes: Y.outcomes,
            outcomePrices: Y.outcomePrices,
            eventSlug: es,
            marketSlug: Y.slug,
            mode: _
        }), u[16] = j, u[17] = _, u[18] = f, u[19] = en, u[20] = Y.outcomePrices, u[21] = Y.outcomes, u[22] = Y.question, u[23] = Y.slug, u[24] = es, u[25] = i) : i = u[25];
        let eo = i;
        u[26] !== m || u[27] !== Y || u[28] !== J ? (n = m.markets.length > 1 && (0, t.jsxs)("div", {
            className: "flex items-center justify-between gap-2 min-w-0",
            children: [(0, t.jsx)("span", {
                className: "text-body-sm text-text-primary shrink-0",
                children: "Market"
            }), (0, t.jsx)("div", {
                className: "min-w-0",
                children: (0, t.jsx)(V, {
                    event: m,
                    market: Y,
                    rotate: J,
                    onMarketChange: X,
                    onRotateChange: ee
                })
            })]
        }), u[26] = m, u[27] = Y, u[28] = J, u[29] = n) : n = u[29];
        let el = n,
            ec = M || void 0;
        return u[30] !== N || u[31] !== j || u[32] !== f || u[33] !== m.slug || u[34] !== Y.slug || u[35] !== J || u[36] !== C || u[37] !== S || u[38] !== U || u[39] !== q || u[40] !== A || u[41] !== F || u[42] !== D || u[43] !== P || u[44] !== z || u[45] !== ec || u[46] !== G || u[47] !== I ? (o = (0, t.jsx)(x, {
            marketSlug: Y.slug,
            eventSlug: m.slug,
            rotate: J,
            embedBase: N,
            showVolume: P,
            showChart: A,
            showLiveActivity: D,
            showYAxis: z,
            showGrid: F,
            showButtons: q,
            showBorder: U,
            theme: G,
            width: f,
            height: j,
            onWidthChange: S,
            onHeightChange: C,
            creator: I,
            via: ec
        }), u[30] = N, u[31] = j, u[32] = f, u[33] = m.slug, u[34] = Y.slug, u[35] = J, u[36] = C, u[37] = S, u[38] = U, u[39] = q, u[40] = A, u[41] = F, u[42] = D, u[43] = P, u[44] = z, u[45] = ec, u[46] = G, u[47] = I, u[48] = o) : o = u[48], u[49] !== U || u[50] !== q || u[51] !== A || u[52] !== F || u[53] !== D || u[54] !== P || u[55] !== z || u[56] !== G ? (l = (0, t.jsx)(d, {
            embedType: "market",
            showVolume: P,
            showChart: A,
            showLiveActivity: D,
            showYAxis: z,
            showGrid: F,
            showButtons: q,
            showBorder: U,
            theme: G,
            onShowVolumeChange: E,
            onShowChartChange: O,
            onShowLiveActivityChange: L,
            onShowYAxisChange: R,
            onShowGridChange: B,
            onShowButtonsChange: H,
            onShowBorderChange: W,
            onThemeChange: K
        }), u[49] = U, u[50] = q, u[51] = A, u[52] = F, u[53] = D, u[54] = P, u[55] = z, u[56] = G, u[57] = l) : l = u[57], u[58] !== _ || u[59] !== eo || u[60] !== h || u[61] !== el || u[62] !== T || u[63] !== l || u[64] !== o ? (c = (0, t.jsx)($, {
            sidebarHeader: el,
            htmlCodeString: eo,
            isDark: h,
            embedMode: _,
            onEmbedModeChange: T,
            preview: o,
            configControls: l
        }), u[58] = _, u[59] = eo, u[60] = h, u[61] = el, u[62] = T, u[63] = l, u[64] = o, u[65] = c) : c = u[65], c
    };
    var J = e.i(476979);
    let ee = e => {
        let a, i, n, o, l, c, u, m, p, h, f, S, j, C, _, T, M = (0, r.c)(78),
            {
                event: N
            } = e,
            {
                isDark: I,
                embedWidth: P,
                setEmbedWidth: E,
                embedHeight: A,
                setEmbedHeight: O,
                embedMode: D,
                setEmbedMode: L,
                affiliateCode: z,
                embedBase: R,
                username: F
            } = Q(),
            [B, q] = s.default.useState(!1),
            [V, H] = s.default.useState(!0),
            [U, W] = s.default.useState(!0),
            [G, K] = s.default.useState(!1),
            [Y, X] = s.default.useState(I ? "dark" : "light"),
            ee = N.slug ? ? "";
        if (M[0] !== N.markets) {
            let e = N.markets.filter(et),
                t = e[0] ? ? N.markets[0];
            i = t ? .outcomes ? ? [], n = t ? .outcomePrices ? ? [], a = er, o = e.filter(ea), M[0] = N.markets, M[1] = a, M[2] = i, M[3] = n, M[4] = o
        } else a = M[1], i = M[2], n = M[3], o = M[4];
        let eo = o,
            el = eo.length >= 2 && "Yes" === i[0] && "No" === i[1],
            ec = el ? eo[0].groupItemTitle ? ? "Team 1" : i[0] ? ? "Team 1",
            ed = el ? eo[1].groupItemTitle ? ? "Team 2" : i[1] ? ? "Team 2",
            eu = el ? eo[0].outcomePrices ? .[0] ? ? "0" : n[0] ? ? "0",
            em = el ? eo[1].outcomePrices ? .[0] ? ? "0" : n[1] ? ? "0";
        M[5] !== a || M[6] !== ec ? (l = a(ec), M[5] = a, M[6] = ec, M[7] = l) : l = M[7], M[8] !== a || M[9] !== ed ? (c = a(ed), M[8] = a, M[9] = ed, M[10] = c) : c = M[10], M[11] !== eu ? (u = Math.round(100 * parseFloat(eu)), M[11] = eu, M[12] = u) : u = M[12], M[13] !== em ? (m = Math.round(100 * parseFloat(em)), M[13] = em, M[14] = m) : m = M[14], M[15] !== ec || M[16] !== ed || M[17] !== l || M[18] !== c || M[19] !== u || M[20] !== m ? (p = {
            teamName0: ec,
            teamName1: ed,
            teamAbbr0: l,
            teamAbbr1: c,
            odds0: u,
            odds1: m
        }, M[15] = ec, M[16] = ed, M[17] = l, M[18] = c, M[19] = u, M[20] = m, M[21] = p) : p = M[21];
        let {
            teamName0: ep,
            teamName1: eh,
            teamAbbr0: ef,
            teamAbbr1: ex,
            odds0: eg,
            odds1: ev
        } = p;
        M[22] !== N.seriesSlug ? (h = N.seriesSlug ? (0, J.getSportDisplayHeader)(N.seriesSlug) : "", M[22] = N.seriesSlug, M[23] = h) : h = M[23];
        let ey = h;
        if (M[24] !== z || M[25] !== A || M[26] !== P || M[27] !== ee || M[28] !== G || M[29] !== U || M[30] !== V || M[31] !== B || M[32] !== Y || M[33] !== F) {
            let e = new URLSearchParams({
                market: ee
            });
            "dark" === Y && e.set("theme", "dark"), !1 === V && e.set("chart", "false"), !1 === U && e.set("buttons", "false"), G && e.set("border", "true"), B && e.set("liveactivity", "true"), F && e.set("creator", F), z && e.set("via", z);
            let t = P ? ? "400";
            "400" !== t && e.set("width", t), A && e.set("height", A), f = Z, S = e.toString(), M[24] = z, M[25] = A, M[26] = P, M[27] = ee, M[28] = G, M[29] = U, M[30] = V, M[31] = B, M[32] = Y, M[33] = F, M[34] = f, M[35] = S
        } else f = M[34], S = M[35];
        let eb = `${f}/sports?${S}`;
        M[36] !== A || M[37] !== D || M[38] !== P || M[39] !== N.seriesSlug || M[40] !== N.startDate || M[41] !== N.startTime || M[42] !== ee || M[43] !== eb || M[44] !== eg || M[45] !== ev || M[46] !== ey || M[47] !== ef || M[48] !== ex || M[49] !== ep || M[50] !== eh ? (j = function(e) {
            let t = e.height || "480";
            if ("minimal" === e.mode) return `<iframe
	title="polymarket-sports-iframe"
	src="${e.iframeSrc}"
	width="${e.width}"
	height="${t}"
	frameBorder="0"
/>`;
            let {
                team0: r,
                team1: a
            } = e, i = `${g}/sports/${e.seriesSlug}/${e.eventSlug}`, n = r.odds >= a.odds ? r.name : a.name, s = Math.max(r.odds, a.odds), o = b(JSON.stringify({
                "@context": "https://schema.org",
                "@type": "SportsEvent",
                name: `${r.name} vs ${a.name}`,
                sport: e.sportDisplayName,
                startDate: e.startDate,
                homeTeam: {
                    "@type": "SportsTeam",
                    name: r.name
                },
                awayTeam: {
                    "@type": "SportsTeam",
                    name: a.name
                },
                description: `Live prediction market odds for ${r.name} vs ${a.name}. ${n} favored at ${s}% on Polymarket.`,
                url: i,
                organizer: {
                    "@type": "Organization",
                    name: "Polymarket",
                    url: g
                }
            }, null, 2)), l = `polymarket-${w(r.abbr)}-${w(a.abbr)}-odds`, c = k(`${r.name} vs ${a.name} Win Probability — Polymarket Live Odds`), d = k(`Polymarket prediction market: ${r.name} vs ${a.name} live odds`), u = k(r.name), m = k(a.name), p = k(r.abbr), h = k(a.abbr), f = k(e.sportDisplayName);
            return ['<script type="application/ld+json">', o, '</script>\n<figure\n	class="polymarket-embed"', `	id="${l}"`, `	aria-label="${d}"`, '	itemscope\n	itemtype="https://schema.org/SportsEvent"', `	style="position:relative;${e.fit?"display:block;width:100%;height:100%":"display:inline-block"};margin:0">`, "	<iframe", `		title="${c}"`, `		src="${e.iframeSrc}"`, `		width="${e.width}"`, `		height="${t}"`, '		frameborder="0"\n		allowtransparency="true">\n	</iframe>', `	<a href="${i}"`, '		aria-label="View on Polymarket"\n		target="_blank"\n		rel="noopener"', `		style="${v}">`, "	</a>", `	<figcaption style="${y}">`, `		<strong>${u} vs ${m} — Live Prediction Market</strong><br>`, `		Current odds: ${p} ${r.odds}% \xb7 ${h} ${a.odds}% \xb7 ${f}<br>`, `		<a href="${i}">`, "			View full market &amp; place a trade on Polymarket\n		</a>\n	</figcaption>\n</figure>"].join("\n")
        }({
            iframeSrc: eb,
            width: P,
            height: A,
            team0: {
                name: ep,
                abbr: ef,
                odds: eg
            },
            team1: {
                name: eh,
                abbr: ex,
                odds: ev
            },
            sportDisplayName: ey,
            seriesSlug: N.seriesSlug ? ? "",
            eventSlug: ee,
            startDate: N.startDate ? ? N.startTime ? ? "",
            mode: D
        }), M[36] = A, M[37] = D, M[38] = P, M[39] = N.seriesSlug, M[40] = N.startDate, M[41] = N.startTime, M[42] = ee, M[43] = eb, M[44] = eg, M[45] = ev, M[46] = ey, M[47] = ef, M[48] = ex, M[49] = ep, M[50] = eh, M[51] = j) : j = M[51];
        let ek = j,
            ew = z || void 0;
        return M[52] !== R || M[53] !== A || M[54] !== P || M[55] !== ee || M[56] !== O || M[57] !== E || M[58] !== G || M[59] !== U || M[60] !== V || M[61] !== B || M[62] !== ew || M[63] !== Y ? (C = (0, t.jsx)(x, {
            marketSlug: ee,
            embedBase: R,
            showChart: V,
            showLiveActivity: B,
            showButtons: U,
            showBorder: G,
            theme: Y,
            width: P,
            height: A,
            onWidthChange: E,
            onHeightChange: O,
            embedRoute: "sports",
            via: ew
        }), M[52] = R, M[53] = A, M[54] = P, M[55] = ee, M[56] = O, M[57] = E, M[58] = G, M[59] = U, M[60] = V, M[61] = B, M[62] = ew, M[63] = Y, M[64] = C) : C = M[64], M[65] !== G || M[66] !== U || M[67] !== V || M[68] !== B || M[69] !== Y ? (_ = (0, t.jsx)(d, {
            embedType: "sports",
            showVolume: !1,
            showChart: V,
            showLiveActivity: B,
            showYAxis: !0,
            showGrid: !0,
            showButtons: U,
            showBorder: G,
            theme: Y,
            onShowVolumeChange: ei,
            onShowChartChange: H,
            onShowLiveActivityChange: q,
            onShowYAxisChange: en,
            onShowGridChange: es,
            onShowButtonsChange: W,
            onShowBorderChange: K,
            onThemeChange: X
        }), M[65] = G, M[66] = U, M[67] = V, M[68] = B, M[69] = Y, M[70] = _) : _ = M[70], M[71] !== D || M[72] !== ek || M[73] !== I || M[74] !== L || M[75] !== C || M[76] !== _ ? (T = (0, t.jsx)($, {
            htmlCodeString: ek,
            isDark: I,
            embedMode: D,
            onEmbedModeChange: L,
            preview: C,
            configControls: _
        }), M[71] = D, M[72] = ek, M[73] = I, M[74] = L, M[75] = C, M[76] = _, M[77] = T) : T = M[77], T
    };

    function et(e) {
        return (e.sportsMarketType ? ? "moneyline") === "moneyline"
    }

    function er(e) {
        return e.replace(/\s+/g, "").slice(0, 3).toUpperCase()
    }

    function ea(e) {
        return !(e.groupItemTitle ? ? "").toLowerCase().startsWith("draw")
    }

    function ei() {}

    function en() {}

    function es() {}
    e.s(["EmbedMarketResponsiveDialog", 0, e => {
        let l, c, d, u, m, p, h = (0, r.c)(18),
            {
                event: f,
                market: x,
                open: g,
                onOpenChange: v,
                trigger: y
            } = e,
            [b, k] = s.default.useState(!1),
            w = void 0 !== g,
            S = w ? g : b;
        h[0] !== w || h[1] !== v ? (l = w ? e => v ? .(e) : k, h[0] = w, h[1] = v, h[2] = l) : l = h[2];
        let j = l;
        h[3] !== f.seriesSlug ? (c = f.seriesSlug && (0, J.isSportSupported)(f.seriesSlug), h[3] = f.seriesSlug, h[4] = c) : c = h[4];
        let C = !!c;
        return h[5] !== j || h[6] !== y ? (d = y ? (0, t.jsx)(a.ModalTrigger, {
            asChild: !0,
            children: y
        }) : (0, t.jsx)(a.ModalTrigger, {
            asChild: !0,
            children: (0, t.jsx)(o.default, {
                onClick: () => j(!0)
            })
        }), h[5] = j, h[6] = y, h[7] = d) : d = h[7], h[8] === Symbol.for("react.memo_cache_sentinel") ? (u = (0, t.jsx)(a.ModalHeader, {
            children: (0, t.jsx)(a.ModalTitle, {
                children: (0, t.jsxs)("span", {
                    className: "flex items-center gap-1.5",
                    children: ["Embed", (0, t.jsx)(i.Tooltip, {
                        content: "Embed a live, interactive Polymarket widget on your website. Customize the appearance, then copy the code to add it to your site.",
                        side: "bottom",
                        className: "z-[300] max-w-56 text-left",
                        children: (0, t.jsx)("span", {
                            className: "text-text-tertiary cursor-help",
                            children: (0, t.jsx)(n.IconCircleInfoOutline12, {})
                        })
                    })]
                })
            })
        }), h[8] = u) : u = h[8], h[9] !== f || h[10] !== C || h[11] !== x ? (m = (0, t.jsxs)(a.ModalContent, {
            className: "w-fit! max-w-fit!",
            children: [u, C ? (0, t.jsx)(ee, {
                event: f
            }) : (0, t.jsx)(X, {
                event: f,
                market: x
            })]
        }), h[9] = f, h[10] = C, h[11] = x, h[12] = m) : m = h[12], h[13] !== S || h[14] !== j || h[15] !== d || h[16] !== m ? (p = (0, t.jsxs)(a.Modal, {
            open: S,
            onOpenChange: j,
            children: [d, m]
        }), h[13] = S, h[14] = j, h[15] = d, h[16] = m, h[17] = p) : p = h[17], p
    }], 913909)
}, 21311, e => {
    "use strict";
    var t = e.i(841252),
        r = e.i(804167);

    function a(e, t) {
        let r = e.getFullYear() - t.getFullYear() || e.getMonth() - t.getMonth() || e.getDate() - t.getDate() || e.getHours() - t.getHours() || e.getMinutes() - t.getMinutes() || e.getSeconds() - t.getSeconds() || e.getMilliseconds() - t.getMilliseconds();
        return r < 0 ? -1 : r > 0 ? 1 : r
    }
    e.s(["differenceInDays", 0, function(e, i, n) {
        let [s, o] = (0, t.normalizeDates)(n ? .in, e, i), l = a(s, o), c = Math.abs((0, r.differenceInCalendarDays)(s, o));
        s.setDate(s.getDate() - l * c);
        let d = Number(a(s, o) === -l),
            u = l * (c - d);
        return 0 === u ? 0 : u
    }])
}, 402972, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(180715);
    e.s(["IconClockOutline12", 0, ({
        strokeWidth: e = 1.5,
        ...a
    }) => t.default.createElement(r.Icon, {
        size: "12px",
        ...a
    }, t.default.createElement("circle", {
        cx: "6",
        cy: "6",
        r: "5.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), t.default.createElement("path", {
        d: "m6,3.25v2.75l2,1.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }))])
}, 412879, 680625, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(891685),
        n = e.i(399336),
        s = e.i(6204),
        o = e.i(169010);
    e.i(304697);
    var l = e.i(179645),
        c = e.i(21311),
        d = e.i(208520),
        u = e.i(491636),
        m = e.i(801477),
        p = e.i(994883),
        h = e.i(390960),
        f = e.i(402972),
        x = e.i(162923),
        g = e.i(864006),
        v = e.i(604777),
        y = e.i(294472);

    function b(e) {
        let i, n, s = (0, r.c)(6),
            {
                endDate: o
            } = e,
            l = (0, v.useTranslations)(),
            c = (0, g.useMessages)().time.short,
            u = (e => {
                let t, i, n, s = (0, r.c)(5);
                s[0] !== e ? (t = () => Math.max(0, (0, d.differenceInSeconds)(e, new Date)), s[0] = e, s[1] = t) : t = s[1];
                let [o, l] = (0, a.useState)(t);
                return s[2] !== e ? (i = () => {
                    let t = () => Math.max(0, (0, d.differenceInSeconds)(e, new Date));
                    l(t());
                    let r = setInterval(() => {
                        let e = t();
                        l(e), e <= 0 && clearInterval(r)
                    }, 1e3);
                    return () => clearInterval(r)
                }, n = [e], s[2] = e, s[3] = i, s[4] = n) : (i = s[3], n = s[4]), (0, a.useEffect)(i, n), o
            })(o);
        return s[0] !== u || s[1] !== l || s[2] !== c ? (i = l("events.dateDisplay.estimatedTimeRemaining", {
            countdown: (0, y.formatShortCountdown)(u, c)
        }), s[0] = u, s[1] = l, s[2] = c, s[3] = i) : i = s[3], s[4] !== i ? (n = (0, t.jsx)(t.Fragment, {
            children: i
        }), s[4] = i, s[5] = n) : n = s[5], n
    }

    function k(e) {
        let a, i, n, s, d, y, k, w, S, j = (0, r.c)(33),
            {
                eventEndDate: C,
                eventSlug: _,
                eventClosed: T,
                activeMarketEndDateIso: M,
                activeMarketClosed: N,
                className: I
            } = e,
            P = (0, v.useTranslations)(),
            E = (0, g.useLocale)();
        if (j[0] !== M || j[1] !== C || j[2] !== E) {
            e: try {
                let e, t;
                if (M ? e = (0, p.parse)(M, "yyyy-MM-dd", new Date) : C && (e = new l.TZDate(new Date(C), "UTC")), e) {
                    a = [e, (0, u.format)(e, "PP", {
                        locale: (0, h.getDateFnsLocale)(E)
                    })];
                    break e
                }
                j[4] === Symbol.for("react.memo_cache_sentinel") ? (t = [void 0, void 0], j[4] = t) : t = j[4], a = t
            } catch {
                let e;
                j[5] === Symbol.for("react.memo_cache_sentinel") ? (e = [void 0, void 0], j[5] = e) : e = j[5], a = e
            }
            j[0] = M,
            j[1] = C,
            j[2] = E,
            j[3] = a
        }
        else a = j[3];
        let [A, O] = a;
        t: {
            let e, t;
            if (!A) {
                i = !1;
                break t
            }
            let {
                shouldShowDetailedTime: r
            } = (0, x.getSeriesSettings)(_);
            if (r) {
                i = !1;
                break t
            }
            j[6] !== A ? (e = (0, c.differenceInDays)(A, new Date), j[6] = A, j[7] = e) : e = j[7];
            let a = e;j[8] !== A ? (t = (0, m.isPast)(A), j[8] = A, j[9] = t) : t = j[9];
            let n = t;i = a <= 7 && !n && !(void 0 !== T && T || void 0 !== N && N)
        }
        let D = i;
        r: {
            let e, t, r;
            if (!A) {
                n = "";
                break r
            }
            if (j[10] !== A || j[11] !== P) {
                let r, a, i;
                r = e = Math.abs((0, c.differenceInDays)(A, new Date)), a = P("time.day"), i = P("time.days"), t = 1 === r ? a : i, j[10] = A, j[11] = P, j[12] = e, j[13] = t
            } else e = j[12],
            t = j[13];
            let a = t,
                i = `${e} ${a}`;j[14] !== i || j[15] !== A || j[16] !== P ? (r = P((0, m.isPast)(A) ? "events.dateDisplay.resolvedAgo" : "events.dateDisplay.inDays", {
                days: i
            }), j[14] = i, j[15] = A, j[16] = P, j[17] = r) : r = j[17],
            n = r
        }
        let L = n;
        if (!A || !O) return null;
        j[18] !== L || j[19] !== A || j[20] !== D || j[21] !== P ? (s = D ? (0, t.jsxs)("div", {
            className: "text-start",
            children: [(0, t.jsx)("div", {
                className: "font-bold text-text-primary",
                children: (0, t.jsx)(b, {
                    endDate: A
                })
            }), (0, t.jsx)("div", {
                children: P("events.dateDisplay.seeRulesBelow")
            })]
        }) : (0, t.jsxs)("div", {
            className: "text-start",
            children: [(0, t.jsx)("div", {
                className: "font-bold text-text-primary",
                children: L
            }), (0, t.jsx)("div", {
                children: P("events.dateDisplay.estimatedEndDate")
            })]
        }), j[18] = L, j[19] = A, j[20] = D, j[21] = P, j[22] = s) : s = j[22];
        let z = s;
        j[23] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)("div", {
            className: "w-[1.5px] h-[10px] bg-neutral-100 rounded-full shrink-0"
        }), j[23] = d) : d = j[23];
        let R = I ? ? "text-[13px] tracking-[-0.09px] font-medium text-text-secondary gap-1.5 whitespace-nowrap flex items-center md:mr-1";
        return j[24] === Symbol.for("react.memo_cache_sentinel") ? (y = (0, t.jsx)(f.IconClockOutline12, {}), j[24] = y) : y = j[24], j[25] !== O ? (k = (0, t.jsx)("span", {
            children: O
        }), j[25] = O, j[26] = k) : k = j[26], j[27] !== k || j[28] !== R ? (w = (0, t.jsxs)("div", {
            className: R,
            children: [y, k]
        }), j[27] = k, j[28] = R, j[29] = w) : w = j[29], j[30] !== w || j[31] !== z ? (S = (0, t.jsxs)(t.Fragment, {
            children: [d, (0, t.jsx)(o.Tooltip, {
                side: "bottom",
                sideOffset: 4,
                showArrow: !1,
                className: "py-2 max-w-[300px] text-body-sm leading-5",
                content: z,
                children: w
            })]
        }), j[30] = w, j[31] = z, j[32] = S) : S = j[32], S
    }
    var w = e.i(180715);
    let S = ({
        strokeWidth: e = 1.5,
        ...t
    }) => a.default.createElement(w.Icon, {
        size: "12px",
        ...t
    }, a.default.createElement("path", {
        d: "m8.5,8.051c1.597-.525,2.75-2.028,2.75-3.801v-.5h-1.75c-1.933,0-3.5,1.567-3.5,3.5v1",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), a.default.createElement("line", {
        x1: "6",
        y1: "11.25",
        x2: "6",
        y2: "6.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), a.default.createElement("path", {
        d: "m.75,1.75h1.75c1.932,0,3.5,1.568,3.5,3.5v1h-1.25c-2.208,0-4-1.792-4-4v-.5h0Z",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));
    var j = e.i(631222);
    let C = () => {
            let e, a, i, n, s, l, c, d, u = (0, r.c)(17),
                m = (0, v.useTranslations)();
            return u[0] !== m ? (e = m("events.headerMeta.holdingRewardsTooltip"), u[0] = m, u[1] = e) : e = u[1], u[2] !== m ? (a = m("rewards.learnMore"), u[2] = m, u[3] = a) : a = u[3], u[4] !== a ? (i = (0, t.jsx)("a", {
                href: `${j.POLYMARKET_HELP_CENTER_LINK}/articles/13364459-holding-rewards`,
                target: "_blank",
                rel: "noreferrer noopener",
                className: "text-blue-300 inline-flex dark:text-text-brand text-xs font-medium text-left hover:brightness-105",
                children: a
            }), u[4] = a, u[5] = i) : i = u[5], u[6] !== e || u[7] !== i ? (n = (0, t.jsxs)("p", {
                className: "text-white text-xs text-center font-medium leading-5",
                children: [e, " ", i]
            }), u[6] = e, u[7] = i, u[8] = n) : n = u[8], u[9] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)(S, {
                size: 12
            }), u[9] = s) : s = u[9], u[10] !== m ? (l = m("rewards.earn4Percent"), u[10] = m, u[11] = l) : l = u[11], u[12] !== l ? (c = (0, t.jsxs)("div", {
                className: "flex items-center gap-1.5 text-[13px] font-medium whitespace-nowrap text-yellow-700",
                children: [s, (0, t.jsx)("span", {
                    children: l
                })]
            }), u[12] = l, u[13] = c) : c = u[13], u[14] !== n || u[15] !== c ? (d = (0, t.jsx)(o.Tooltip, {
                className: "bg-neutral-900 dark:bg-neutral-0 border-neutral-800 dark:border-neutral-100 py-2 max-w-96",
                showArrow: !1,
                sideOffset: 4,
                mobileSupport: !0,
                side: "bottom",
                content: n,
                children: c
            }), u[14] = n, u[15] = c, u[16] = d) : d = u[16], d
        },
        _ = () => {
            let e, a = (0, r.c)(1);
            return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)("div", {
                className: "w-[1.5px] h-[10px] bg-neutral-100 rounded-full shrink-0"
            }), a[0] = e) : e = a[0], e
        };
    var T = e.i(621409),
        M = e.i(870555),
        N = e.i(222163),
        I = e.i(213567),
        P = e.i(138567),
        E = e.i(500110),
        A = e.i(296831);
    let O = e => {
            let a, i, n, s, o, l, c, d = (0, r.c)(16),
                u = e.size || 18,
                m = e.color || "currentColor";
            return d[0] !== m ? (a = (0, t.jsx)("path", {
                d: "M8.5 12.25C8.5 12.25 8.5 15.188 4.75 16.25H9.77799",
                stroke: m,
                strokeWidth: "1.5",
                strokeLinecap: "round",
                strokeLinejoin: "round"
            }), i = (0, t.jsx)("path", {
                d: "M5.28623 9C1.46923 9 1.75023 3.75 1.75023 3.75H3.98723",
                stroke: m,
                strokeWidth: "1.5",
                strokeLinecap: "round",
                strokeLinejoin: "round"
            }), n = (0, t.jsx)("path", {
                d: "M12.7144 9C16.5324 9 16.2504 3.75 16.2504 3.75H14.0134",
                stroke: m,
                strokeWidth: "1.5",
                strokeLinecap: "round",
                strokeLinejoin: "round"
            }), s = (0, t.jsx)("path", {
                d: "M14 1.75C13.375 8.281 11.719 11.969 9.25 12.25H9H8.75C6.281 11.969 4.625 8.281 4 1.75H14Z",
                stroke: m,
                strokeWidth: "1.5",
                strokeLinecap: "round",
                strokeLinejoin: "round"
            }), o = (0, t.jsx)("path", {
                d: "M14.2134 12.25V17.25",
                stroke: m,
                strokeWidth: "1.5",
                strokeLinecap: "round",
                strokeLinejoin: "round"
            }), l = (0, t.jsx)("path", {
                d: "M16.7134 14.75H11.7134",
                stroke: m,
                strokeWidth: "1.5",
                strokeLinecap: "round",
                strokeLinejoin: "round"
            }), d[0] = m, d[1] = a, d[2] = i, d[3] = n, d[4] = s, d[5] = o, d[6] = l) : (a = d[1], i = d[2], n = d[3], s = d[4], o = d[5], l = d[6]), d[7] !== e || d[8] !== u || d[9] !== a || d[10] !== i || d[11] !== n || d[12] !== s || d[13] !== o || d[14] !== l ? (c = (0, t.jsxs)("svg", {
                width: u,
                height: u,
                viewBox: "0 0 18 18",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                ...e,
                children: [a, i, n, s, o, l]
            }), d[7] = e, d[8] = u, d[9] = a, d[10] = i, d[11] = n, d[12] = s, d[13] = o, d[14] = l, d[15] = c) : c = d[15], c
        },
        D = e => {
            let i, n, s, o, l, c, d, u, m, p, h, f, x, g, y, b, k, w, S, C, _, T, D = (0, r.c)(45),
                {
                    event: L,
                    color: z
                } = e,
                R = (0, v.useTranslations)(),
                [F, $] = (0, a.useState)(!1),
                B = "brand" === (void 0 === z ? "primary" : z) ? "text-text-brand" : "text-text-primary";
            return D[0] !== B ? (i = (0, M.cn)("flex items-center", B), D[0] = B, D[1] = i) : i = D[1], D[2] === Symbol.for("react.memo_cache_sentinel") ? (n = () => $(!0), s = () => $(!1), D[2] = n, D[3] = s) : (n = D[2], s = D[3]), D[4] !== L.negRiskAugmented ? (o = L.negRiskAugmented ? (0, t.jsx)(O, {
                size: 14
            }) : (0, t.jsx)(A.IconTrophyOutline18, {
                size: 14
            }), D[4] = L.negRiskAugmented, D[5] = o) : o = D[5], D[6] !== i || D[7] !== o ? (l = (0, t.jsx)(N.PopoverTrigger, {
                asChild: !0,
                children: (0, t.jsx)("button", {
                    type: "button",
                    className: i,
                    onMouseEnter: n,
                    onMouseLeave: s,
                    children: o
                })
            }), D[6] = i, D[7] = o, D[8] = l) : l = D[8], D[9] === Symbol.for("react.memo_cache_sentinel") ? (c = () => $(!0), d = () => $(!1), D[9] = c, D[10] = d) : (c = D[9], d = D[10]), D[11] !== R ? (u = R("events.negRiskBadge.title"), D[11] = R, D[12] = u) : u = D[12], D[13] !== u ? (m = (0, t.jsx)("p", {
                className: "text-sm font-bold mb-3",
                children: u
            }), D[13] = u, D[14] = m) : m = D[14], D[15] === Symbol.for("react.memo_cache_sentinel") ? (p = (0, t.jsx)(P.IconCheckOutline18, {
                className: "text-text-brand shrink-0 mt-px"
            }), D[15] = p) : p = D[15], D[16] !== R ? (h = R("events.negRiskBadge.onlyOneWinner"), D[16] = R, D[17] = h) : h = D[17], D[18] !== h ? (f = (0, t.jsxs)("li", {
                className: "flex gap-2 items-start",
                children: [p, (0, t.jsx)("p", {
                    className: "text-sm",
                    children: h
                })]
            }), D[18] = h, D[19] = f) : f = D[19], D[20] === Symbol.for("react.memo_cache_sentinel") ? (x = (0, t.jsx)(P.IconCheckOutline18, {
                className: "text-text-brand shrink-0 mt-px"
            }), D[20] = x) : x = D[20], D[21] !== R ? (g = R("events.negRiskBadge.supportsNegativeRisk"), D[21] = R, D[22] = g) : g = D[22], D[23] !== g ? (y = (0, t.jsxs)("li", {
                className: "flex gap-2 items-start",
                children: [x, (0, t.jsx)("p", {
                    className: "text-sm",
                    children: g
                })]
            }), D[23] = g, D[24] = y) : y = D[24], D[25] !== L.negRiskAugmented || D[26] !== R ? (b = L.negRiskAugmented ? (0, t.jsxs)("li", {
                className: "flex gap-2 items-start",
                children: [(0, t.jsx)(E.IconPlusOutline18, {
                    className: "text-text-brand shrink-0 mt-px"
                }), (0, t.jsxs)("p", {
                    className: "text-sm",
                    children: [(0, t.jsx)("span", {
                        className: "font-bold",
                        children: R("events.negRiskBadge.completeNegativeRisk")
                    }), " ", "(", R("events.negRiskBadge.completeNegativeRiskDescription"), ")"]
                })]
            }) : null, D[25] = L.negRiskAugmented, D[26] = R, D[27] = b) : b = D[27], D[28] !== f || D[29] !== y || D[30] !== b ? (k = (0, t.jsxs)("ul", {
                className: "list-none gap-2 flex flex-col",
                children: [f, y, b]
            }), D[28] = f, D[29] = y, D[30] = b, D[31] = k) : k = D[31], D[32] === Symbol.for("react.memo_cache_sentinel") ? (w = (0, t.jsx)(I.IconCircleInfoOutline12, {
                size: 12
            }), D[32] = w) : w = D[32], D[33] !== R ? (S = R("rewards.learnMore"), D[33] = R, D[34] = S) : S = D[34], D[35] !== S ? (C = (0, t.jsxs)("a", {
                href: `${j.POLYMARKET_DOCS_LINK}/advanced/neg-risk`,
                target: "_blank",
                rel: "noreferrer noopener",
                className: "text-text-brand text-sm font-medium mt-3 flex items-center gap-1 hover:brightness-105",
                children: [w, S]
            }), D[35] = S, D[36] = C) : C = D[36], D[37] !== m || D[38] !== k || D[39] !== C ? (_ = (0, t.jsx)(N.PopoverContent, {
                side: "bottom",
                collisionPadding: 8,
                className: "w-auto max-w-[280px]",
                onMouseEnter: c,
                onMouseLeave: d,
                children: (0, t.jsxs)("div", {
                    className: "flex flex-col items-start text-left",
                    children: [m, k, C]
                })
            }), D[37] = m, D[38] = k, D[39] = C, D[40] = _) : _ = D[40], D[41] !== F || D[42] !== _ || D[43] !== l ? (T = (0, t.jsxs)(N.Popover, {
                open: F,
                onOpenChange: $,
                children: [l, _]
            }), D[41] = F, D[42] = _, D[43] = l, D[44] = T) : T = D[44], T
        },
        L = e => {
            let a, i, n, s, o, l = (0, r.c)(13),
                {
                    size: c,
                    isNegRisk: d,
                    event: u
                } = e,
                m = void 0 !== d && d,
                p = (0, v.useTranslations)(),
                h = "compact" === (void 0 === c ? "default" : c) ? "text-body-sm" : "text-[13px] tracking-[-0.09px] font-semibold";
            return l[0] !== h ? (a = (0, M.cn)("flex items-center gap-1 py-1 text-text-brand whitespace-nowrap", h), l[0] = h, l[1] = a) : a = l[1], l[2] !== u || l[3] !== m ? (i = m && u ? (0, t.jsx)(D, {
                event: u,
                color: "brand"
            }) : (0, t.jsx)(T.IconSparkle4Fill12, {
                size: 10
            }), l[2] = u, l[3] = m, l[4] = i) : i = l[4], l[5] !== p ? (n = p("cards.new"), l[5] = p, l[6] = n) : n = l[6], l[7] !== n ? (s = (0, t.jsx)("span", {
                className: "uppercase",
                children: n
            }), l[7] = n, l[8] = s) : s = l[8], l[9] !== a || l[10] !== i || l[11] !== s ? (o = (0, t.jsxs)("div", {
                className: a,
                children: [i, s]
            }), l[9] = a, l[10] = i, l[11] = s, l[12] = o) : o = l[12], o
        };
    var z = e.i(190033),
        R = e.i(396047),
        F = e.i(794823),
        $ = e.i(196593);
    let B = {
            default: "text-text-primary text-[13px] tracking-[-0.09px] font-medium whitespace-nowrap",
            compact: "text-body-sm font-normal text-neutral-500 whitespace-nowrap leading-[21px]"
        },
        q = e => {
            let i, n, s, o, l, c = (0, r.c)(14),
                {
                    baseVolume: d,
                    className: u,
                    size: m
                } = e,
                p = (0, v.useTranslations)(),
                h = (0, a.useId)(),
                {
                    liveVolume: f,
                    tradeHandler: x
                } = (0, R.useEventLiveVolume)(),
                {
                    registerTradeHandler: g,
                    unregisterTradeHandler: y
                } = (0, F.useEventTrade)();
            c[0] !== h || c[1] !== g || c[2] !== x || c[3] !== y ? (i = () => (g(h, x), () => {
                y(h)
            }), n = [h, x, g, y], c[0] = h, c[1] = g, c[2] = x, c[3] = y, c[4] = i, c[5] = n) : (i = c[4], n = c[5]), (0, a.useEffect)(i, n);
            let b = d + f;
            c[6] !== b ? (s = (0, $.formatToDollar)(b, {
                minimumFractionDigits: 0,
                maximumFractionDigits: 0
            }), c[6] = b, c[7] = s) : s = c[7];
            let k = s,
                w = u ? ? B[void 0 === m ? "default" : m];
            return c[8] !== p ? (o = p("events.headerMeta.volume"), c[8] = p, c[9] = o) : o = c[9], c[10] !== k || c[11] !== w || c[12] !== o ? (l = (0, t.jsxs)("p", {
                className: w,
                children: [k, " ", o]
            }), c[10] = k, c[11] = w, c[12] = o, c[13] = l) : l = c[13], l
        };
    e.s(["VolumeDisplay", 0, q], 680625);
    let V = (0, a.memo)(function(e) {
            let a, i, s = (0, r.c)(7),
                {
                    event: o
                } = e;
            s[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], s[0] = a) : a = s[0];
            let {
                activeMarket: l
            } = (0, n.useEventActiveMarketContext)(a), c = !!o.closed, d = !!l.closed;
            return s[1] !== l.endDateIso || s[2] !== o.endDate || s[3] !== o.slug || s[4] !== c || s[5] !== d ? (i = (0, t.jsx)(k, {
                eventEndDate: o.endDate,
                eventSlug: o.slug,
                eventClosed: c,
                activeMarketEndDateIso: l.endDateIso,
                activeMarketClosed: d
            }), s[1] = l.endDateIso, s[2] = o.endDate, s[3] = o.slug, s[4] = c, s[5] = d, s[6] = i) : i = s[6], i
        }),
        H = (0, a.memo)(function(e) {
            let a, i, n, s, o, l, c = (0, r.c)(35),
                {
                    showVolume: d,
                    showDate: u,
                    showHoldingRewards: m,
                    showNew: p,
                    showWinnerTakeAll: h,
                    className: f,
                    size: x,
                    volume: g,
                    event: v,
                    hasHoldingRewards: y,
                    isSportsPage: b
                } = e,
                k = void 0 === d || d,
                w = void 0 === u || u,
                S = void 0 === m || m,
                j = void 0 === p || p,
                T = void 0 === h || h,
                M = void 0 === x ? "default" : x,
                N = g ? ? v.volume;
            c[0] !== v || c[1] !== b || c[2] !== k || c[3] !== T || c[4] !== g ? (a = {
                event: v,
                volume: g,
                isSportsPage: b,
                showVolume: k,
                showWinnerTakeAll: T
            }, c[0] = v, c[1] = b, c[2] = k, c[3] = T, c[4] = g, c[5] = a) : a = c[5];
            let {
                showNewTag: I,
                showVolTag: P,
                showNegRiskInNew: E
            } = (0, z.useMetadataVisibility)(a), A = f ? ? "flex gap-x-2.5 items-center";
            return c[6] !== v || c[7] !== b || c[8] !== E || c[9] !== j || c[10] !== I || c[11] !== P || c[12] !== k || c[13] !== M ? (i = j && I && (0, t.jsxs)("div", {
                className: "flex items-center gap-2.5",
                children: [(0, t.jsx)(L, {
                    size: M,
                    isNegRisk: E,
                    event: v
                }), k && !b && P && (0, t.jsx)(_, {})]
            }), c[6] = v, c[7] = b, c[8] = E, c[9] = j, c[10] = I, c[11] = P, c[12] = k, c[13] = M, c[14] = i) : i = c[14], c[15] !== N || c[16] !== v || c[17] !== b || c[18] !== P || c[19] !== k || c[20] !== T || c[21] !== M ? (n = k && !b && P && (0, t.jsxs)("div", {
                className: "flex items-center gap-1.5",
                children: [T && v.negRisk && (0, t.jsx)(D, {
                    event: v
                }), (0, t.jsx)(q, {
                    baseVolume: N,
                    size: M
                })]
            }), c[15] = N, c[16] = v, c[17] = b, c[18] = P, c[19] = k, c[20] = T, c[21] = M, c[22] = n) : n = c[22], c[23] !== v || c[24] !== w ? (s = w && (0, t.jsx)(V, {
                event: v
            }), c[23] = v, c[24] = w, c[25] = s) : s = c[25], c[26] !== y || c[27] !== S ? (o = S && y && (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)(_, {}), (0, t.jsx)(C, {})]
            }), c[26] = y, c[27] = S, c[28] = o) : o = c[28], c[29] !== n || c[30] !== s || c[31] !== o || c[32] !== A || c[33] !== i ? (l = (0, t.jsxs)("div", {
                className: A,
                children: [i, n, s, o]
            }), c[29] = n, c[30] = s, c[31] = o, c[32] = A, c[33] = i, c[34] = l) : l = c[34], l
        }),
        U = (0, a.memo)(function(e) {
            let a, n, o, l = (0, r.c)(7);
            l[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event", "hasHoldingRewards"], l[0] = a) : a = l[0];
            let {
                event: c,
                hasHoldingRewards: d
            } = (0, i.useEventContext)(a);
            l[1] === Symbol.for("react.memo_cache_sentinel") ? (n = ["isSportsPage"], l[1] = n) : n = l[1];
            let {
                isSportsPage: u
            } = (0, s.useSportsContext)(n);
            return l[2] !== c || l[3] !== d || l[4] !== u || l[5] !== e ? (o = (0, t.jsx)(H, { ...e,
                event: c,
                hasHoldingRewards: d,
                isSportsPage: u
            }), l[2] = c, l[3] = d, l[4] = u, l[5] = e, l[6] = o) : o = l[6], o
        });
    e.s(["EventMetadata", 0, U], 412879)
}, 201607, e => {
    "use strict";
    e.s(["MobileSingleMarketView", () => V], 201607);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(827525),
        i = e.i(415142),
        n = e.i(416340),
        s = e.i(85457),
        o = e.i(561992),
        l = e.i(118818),
        c = e.i(627433),
        d = e.i(134709),
        u = e.i(891685),
        m = e.i(6204),
        p = e.i(475753),
        h = e.i(215959),
        f = e.i(178918),
        x = e.i(401527),
        g = e.i(452090),
        v = e.i(308579),
        y = e.i(949447),
        b = e.i(122186),
        k = e.i(695787),
        w = e.i(799275),
        S = e.i(913909),
        j = e.i(412879),
        C = e.i(476979),
        _ = e.i(399336),
        T = e.i(631222),
        M = e.i(870555);

    function N(e) {
        let a, i, n, s, o = (0, r.c)(8);
        return o[0] !== e ? ({
            className: a,
            ...i
        } = e, o[0] = e, o[1] = a, o[2] = i) : (a = o[1], i = o[2]), o[3] !== a ? (n = (0, M.cn)("border-none p-0 size-7 flex justify-center items-center cursor-pointer rounded-full transition-colors duration-80 bg-neutral-50", "hover:bg-neutral-100 active:bg-neutral-100", a), o[3] = a, o[4] = n) : n = o[4], o[5] !== i || o[6] !== n ? (s = (0, t.jsx)("button", {
            type: "button",
            className: n,
            ...i
        }), o[5] = i, o[6] = n, o[7] = s) : s = o[7], s
    }

    function I(e) {
        let a, i, n, s, o, l, c = (0, r.c)(12);
        c[0] !== e ? ({
            className: i,
            children: a,
            scrolled: s,
            ...n
        } = e, c[0] = e, c[1] = a, c[2] = i, c[3] = n, c[4] = s) : (a = c[1], i = c[2], n = c[3], s = c[4]);
        let d = s && "border-b-neutral-50";
        return c[5] !== i || c[6] !== d ? (o = (0, M.cn)("flex transition-[border-color] duration-150 ease-out border-b border-transparent", d, i), c[5] = i, c[6] = d, c[7] = o) : o = c[7], c[8] !== a || c[9] !== n || c[10] !== o ? (l = (0, t.jsx)("div", {
            className: o,
            ...n,
            children: a
        }), c[8] = a, c[9] = n, c[10] = o, c[11] = l) : l = c[11], l
    }
    let P = () => {
        let e, a, i, s, o, c, d, m, M, P, E, A, O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q, X = (0, r.c)(62);
        X[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], X[0] = e) : e = X[0];
        let {
            event: J
        } = (0, u.useEventContext)(e), {
            setView: ee,
            market: et,
            smpContentRef: er,
            closeSmpClickRef: ea
        } = (0, l.useMobileMarketContext)();
        X[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], X[1] = a) : a = X[1];
        let {
            activeMarket: ei
        } = (0, _.useEventActiveMarketContext)(a), [en, es] = n.default.useState(!1), eo = `/event/${J.slug}/${et.slug}`, el = `${T.CURRENT_ORIGIN}${eo}`;
        X[2] !== et.question || X[3] !== el ? (i = {
            title: et.question,
            url: el
        }, X[2] = et.question, X[3] = el, X[4] = i) : i = X[4];
        let ec = i;
        X[5] !== ee ? (s = e => ee(e ? "smp" : "default"), X[5] = ee, X[6] = s) : s = X[6];
        let ed = s;
        X[7] !== er ? (o = {
            container: er
        }, X[7] = er, X[8] = o) : o = X[8];
        let {
            scrollY: eu
        } = (0, g.useScroll)(o), [em, ep] = n.default.useState(!1), eh = (0, f.useMotionValue)(300), ef = n.default.useRef(!1), ex = n.default.useRef(0);
        X[9] !== eh ? (c = e => {
            if (e > 28 && !ef.current) {
                ef.current = !0, ep(!0), (0, p.animate)(eh, 184, {
                    type: "tween",
                    duration: .2,
                    ease: "easeInOut"
                });
                return
            }
            e <= 28 && ef.current && (ef.current = !1, (0, p.animate)(eh, ex.current - 96, {
                type: "tween",
                duration: .2,
                ease: "easeInOut"
            }), ep(!1))
        }, X[9] = eh, X[10] = c) : c = X[10], (0, x.useMotionValueEvent)(eu, "change", c), X[11] === Symbol.for("react.memo_cache_sentinel") ? (d = [0, 53], m = [0, 1], M = {
            clamp: !0
        }, X[11] = d, X[12] = m, X[13] = M) : (d = X[11], m = X[12], M = X[13]);
        let eg = (0, v.useTransform)(eu, d, m, M),
            ev = (0, f.useMotionValue)("translate(46px, 50px) scale(1)");
        X[14] !== ev ? (P = e => {
            ev.set(`translate(${46+-34*e}px, ${50+-50*e}px) scale(${1+-.25*e})`)
        }, X[14] = ev, X[15] = P) : P = X[15], (0, x.useMotionValueEvent)(eg, "change", P), X[16] === Symbol.for("react.memo_cache_sentinel") ? (E = () => {
            ex.current = document.documentElement.clientWidth
        }, A = [], X[16] = E, X[17] = A) : (E = X[16], A = X[17]), n.default.useEffect(E, A), X[18] !== ea || X[19] !== ed ? (O = () => {
            ea.current = !0, ed(!1)
        }, X[18] = ea, X[19] = ed, X[20] = O) : O = X[20], X[21] === Symbol.for("react.memo_cache_sentinel") ? (D = (0, t.jsx)(y.IconChevronDownFill18, {
            className: "text-2xl text-text rotate-90 transition-transform duration-250 ease"
        }), X[21] = D) : D = X[21], X[22] !== O ? (L = (0, t.jsx)(N, {
            onClick: O,
            children: D
        }), X[22] = O, X[23] = L) : L = X[23], X[24] !== ev ? (z = {
            transform: ev
        }, X[24] = ev, X[25] = z) : z = X[25], X[26] !== eh ? (R = {
            width: eh,
            scale: .9999
        }, X[26] = eh, X[27] = R) : R = X[27], X[28] === Symbol.for("react.memo_cache_sentinel") ? (F = {
            width: {
                type: "tween",
                duration: .3,
                ease: "easeInOut"
            }
        }, X[28] = F) : F = X[28], X[29] !== et.groupItemTitle || X[30] !== R ? ($ = (0, t.jsx)(h.motion.p, {
            className: "text-lg leading-xl font-bold text-text truncate transition-none",
            style: R,
            transition: F,
            children: et.groupItemTitle
        }, "smp-nav-title"), X[29] = et.groupItemTitle, X[30] = R, X[31] = $) : $ = X[31], X[32] !== z || X[33] !== $ ? (B = (0, t.jsx)(h.motion.div, {
            className: "z-10 absolute",
            style: z,
            children: $
        }, "smp-nav-title-container"), X[32] = z, X[33] = $, X[34] = B) : B = X[34], X[35] !== L || X[36] !== B ? (q = (0, t.jsxs)("div", {
            className: "flex justify-between items-center",
            children: [L, B]
        }), X[35] = L, X[36] = B, X[37] = q) : q = X[37], X[38] === Symbol.for("react.memo_cache_sentinel") ? (V = (0, t.jsx)(j.EventMetadata, {
            showVolume: !1,
            showDate: !1,
            showCreator: !1,
            showHoldingRewards: !1,
            showWinnerTakeAll: !1,
            size: "compact"
        }), X[38] = V) : V = X[38], X[39] === Symbol.for("react.memo_cache_sentinel") ? (H = (0, t.jsx)(b.default, {
            onClick: () => es(!0)
        }), X[39] = H) : H = X[39], X[40] !== ei || X[41] !== en || X[42] !== J ? (U = (0, t.jsx)(S.EmbedMarketResponsiveDialog, {
            event: J,
            market: ei,
            open: en,
            onOpenChange: es,
            trigger: H
        }), X[40] = ei, X[41] = en, X[42] = J, X[43] = U) : U = X[43], X[44] !== J.id ? (W = J.id.toString(), X[44] = J.id, X[45] = W) : W = X[45];
        let ey = J.slug;
        X[46] !== J.seriesSlug ? (G = J.seriesSlug && (0, C.isSportSupported)(J.seriesSlug), X[46] = J.seriesSlug, X[47] = G) : G = X[47];
        let eb = !!G;
        return X[48] !== J.slug || X[49] !== W || X[50] !== eb ? (Z = (0, t.jsx)(k.default, {
            eventId: W,
            eventSlug: ey,
            isSportsEvent: eb
        }), X[48] = J.slug, X[49] = W, X[50] = eb, X[51] = Z) : Z = X[51], X[52] !== ec ? (K = (0, t.jsx)(w.default, {
            params: ec
        }), X[52] = ec, X[53] = K) : K = X[53], X[54] !== U || X[55] !== Z || X[56] !== K ? (Y = (0, t.jsxs)("div", {
            className: "flex items-center",
            children: [V, U, Z, K]
        }), X[54] = U, X[55] = Z, X[56] = K, X[57] = Y) : Y = X[57], X[58] !== em || X[59] !== q || X[60] !== Y ? (Q = (0, t.jsxs)(I, {
            scrolled: em,
            className: "w-full justify-between items-center px-4 pt-4 pb-2 box-border h-[53px] relative",
            children: [q, Y]
        }), X[58] = em, X[59] = q, X[60] = Y, X[61] = Q) : Q = X[61], Q
    };
    var E = e.i(604777),
        A = e.i(827681),
        O = e.i(863828),
        D = e.i(100825),
        L = e.i(846396),
        z = e.i(668122),
        R = e.i(79075),
        F = e.i(305457);

    function $() {
        let e, a, i, s, o, c, d, m, p, h, f, v, b, S, j, M, P, $, B = (0, r.c)(49);
        B[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], B[0] = e) : e = B[0];
        let {
            event: q
        } = (0, u.useEventContext)(e), {
            setView: V,
            smpContentRef: H,
            closeSmpClickRef: U
        } = (0, l.useMobileMarketContext)();
        B[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["activeMarket"], B[1] = a) : a = B[1];
        let {
            activeMarket: W
        } = (0, _.useEventActiveMarketContext)(a), G = (() => {
            let e, t = (0, r.c)(6),
                a = (0, F.useAmplitudeAnalytics)(),
                {
                    setOpen: i,
                    setConnectorRoute: n
                } = (0, O.useSiwx)(),
                {
                    setOpen: s,
                    setView: o
                } = (0, l.useMobileMarketContext)();
            return t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== s || t[4] !== o ? (e = () => {
                let e = Date.now();
                (0, R.markSignupPromptOpened)("trade", {
                    now: e,
                    route: "login"
                }), a.trackEvent(z.Events.SignupPromptOpened, (0, R.getSignupPromptOpenedEventProperties)({
                    source: "trade",
                    route: "login"
                })), o("default"), s(!1), setTimeout(() => {
                    n(A.ConnectorRoute.LOGIN), i(!0)
                })
            }, t[0] = a, t[1] = i, t[2] = n, t[3] = s, t[4] = o, t[5] = e) : e = t[5], e
        })(), Z = `/event/${q.slug}/${W.slug}`, K = `${T.CURRENT_ORIGIN}${Z}`;
        B[2] !== W.question || B[3] !== K ? (i = {
            title: W.question,
            url: K
        }, B[2] = W.question, B[3] = K, B[4] = i) : i = B[4];
        let Y = i,
            Q = (0, D.useSportSlug)(),
            X = (0, E.useTranslations)();
        B[5] !== V ? (s = e => V(e ? "smp" : "default"), B[5] = V, B[6] = s) : s = B[6];
        let J = s,
            [ee, et] = n.default.useState(!1);
        B[7] === Symbol.for("react.memo_cache_sentinel") ? (o = () => et(!0), c = [], B[7] = o, B[8] = c) : (o = B[7], c = B[8]), n.default.useEffect(o, c);
        let er = ee ? H : void 0;
        B[9] !== er ? (d = {
            container: er
        }, B[9] = er, B[10] = d) : d = B[10];
        let {
            scrollY: ea
        } = (0, g.useScroll)(d), [ei, en] = n.default.useState(!1);
        B[11] !== ee ? (m = e => {
            ee && en(e > 10)
        }, B[11] = ee, B[12] = m) : m = B[12], (0, x.useMotionValueEvent)(ea, "change", m);
        e: {
            let e, t, r, a;
            if (!Q) {
                let e;
                B[13] === Symbol.for("react.memo_cache_sentinel") ? (e = [], B[13] = e) : e = B[13], p = e;
                break e
            }
            let i = C.sportMap[Q];
            if (!i) {
                let e;
                B[14] === Symbol.for("react.memo_cache_sentinel") ? (e = [], B[14] = e) : e = B[14], p = e;
                break e
            }
            B[15] !== X ? (e = X("dashboards.sports"), B[15] = X, B[16] = e) : e = B[16],
            B[17] !== e ? (t = {
                label: e,
                href: "/sports/live"
            }, B[17] = e, B[18] = t) : t = B[18],
            B[19] !== i.displayNav || B[20] !== i.href ? (r = {
                label: i.displayNav,
                href: i.href
            }, B[19] = i.displayNav, B[20] = i.href, B[21] = r) : r = B[21],
            B[22] !== t || B[23] !== r ? (a = [t, r], B[22] = t, B[23] = r, B[24] = a) : a = B[24],
            p = a
        }
        let es = p;
        return B[25] !== U || B[26] !== J ? (h = () => {
            U.current = !0, J(!1)
        }, B[25] = U, B[26] = J, B[27] = h) : h = B[27], B[28] === Symbol.for("react.memo_cache_sentinel") ? (f = (0, t.jsx)(y.IconChevronDownFill18, {
            className: "text-2xl text-text rotate-90 transition-transform duration-250 ease"
        }), B[28] = f) : f = B[28], B[29] !== h ? (v = (0, t.jsx)(N, {
            className: "col-span-1",
            onClick: h,
            children: f
        }), B[29] = h, B[30] = v) : v = B[30], B[31] !== es ? (b = (0, t.jsx)(L.Breadcrumbs, {
            items: es,
            className: "!justify-center"
        }), B[31] = es, B[32] = b) : b = B[32], B[33] !== q.id ? (S = q.id.toString(), B[33] = q.id, B[34] = S) : S = B[34], B[35] !== q.slug || B[36] !== G || B[37] !== S ? (j = (0, t.jsx)(k.default, {
            eventId: S,
            eventSlug: q.slug,
            isSportsEvent: !0,
            injectedOnUnauthenticatedClick: G
        }), B[35] = q.slug, B[36] = G, B[37] = S, B[38] = j) : j = B[38], B[39] !== Y ? (M = (0, t.jsx)(w.default, {
            params: Y
        }), B[39] = Y, B[40] = M) : M = B[40], B[41] !== j || B[42] !== M ? (P = (0, t.jsxs)("div", {
            className: "col-span-1 flex items-center justify-end gap-1",
            children: [j, M]
        }), B[41] = j, B[42] = M, B[43] = P) : P = B[43], B[44] !== ei || B[45] !== v || B[46] !== b || B[47] !== P ? ($ = (0, t.jsxs)(I, {
            scrolled: ei,
            className: "grid grid-cols-3 w-screen justify-between items-center gap-2 bg-transparent min-h-[59px] h-[59px] px-4 border-b border-transparent",
            children: [v, b, P]
        }), B[44] = ei, B[45] = v, B[46] = b, B[47] = P, B[48] = $) : $ = B[48], $
    }

    function B() {
        let e, a, i, n = (0, r.c)(4),
            s = (0, d.default)();
        n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["isNegRiskSportsEvent"], n[0] = e) : e = n[0];
        let {
            isNegRiskSportsEvent: o
        } = (0, u.useEventContext)(e);
        n[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["isSportsPage"], n[1] = a) : a = n[1];
        let {
            isSportsPage: l
        } = (0, m.useSportsContext)(a), c = l || o;
        return s ? (n[2] !== c ? (i = c ? (0, t.jsx)($, {}) : (0, t.jsx)(P, {}), n[2] = c, n[3] = i) : i = n[3], i) : null
    }
    let q = n.default.memo(s.default),
        V = () => {
            let e, n, s, d, u, m, p, h, f = (0, r.c)(15),
                {
                    setView: x
                } = (0, o.useMobileEventContext)(),
                {
                    view: g,
                    setView: v
                } = (0, l.useMobileMarketContext)(),
                y = "smp" === g;
            f[0] !== x || f[1] !== v ? (e = e => {
                let t = e ? "smp" : "default";
                v(t), x(t)
            }, f[0] = x, f[1] = v, f[2] = e) : e = f[2];
            let b = e;
            return f[3] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)(a.Drawer.Overlay, {
                className: "fixed inset-0 bg-black/40 z-(--z-drawer)"
            }), f[3] = n) : n = f[3], f[4] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsxs)(i.VisuallyHidden.Root, {
                children: [(0, t.jsx)(a.Drawer.Title, {
                    children: "Market drawer"
                }), (0, t.jsx)(a.Drawer.Description, {
                    children: "Trade drawer"
                })]
            }), d = (0, t.jsx)(B, {}), f[4] = s, f[5] = d) : (s = f[4], d = f[5]), f[6] !== b ? (u = (0, t.jsx)(q, {
                onClose: () => b(!1),
                mode: "group"
            }), f[6] = b, f[7] = u) : u = f[7], f[8] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, t.jsx)(c.SmpViewDrawerControls, {}), f[8] = m) : m = f[8], f[9] !== u ? (p = (0, t.jsxs)(a.Drawer.Portal, {
                children: [n, (0, t.jsxs)(a.Drawer.Content, {
                    className: "flex flex-col fixed inset-0 bg-background rounded-none z-[calc(var(--z-drawer)+1)] overflow-y-scroll overflow-x-hidden pr-[44px] mr-[-44px]",
                    children: [s, d, u, m]
                })]
            }), f[9] = u, f[10] = p) : p = f[10], f[11] !== b || f[12] !== y || f[13] !== p ? (h = (0, t.jsx)(a.Drawer.Root, {
                shouldScaleBackground: !1,
                open: y,
                onOpenChange: b,
                direction: "right",
                children: p
            }), f[11] = b, f[12] = y, f[13] = p, f[14] = h) : h = f[14], h
        }
}, 928810, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(219469),
        n = e.i(215959),
        s = e.i(983707),
        o = e.i(81940),
        l = e.i(86831);

    function c(e) {
        let s, c, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P = (0, r.c)(53);
        P[0] !== e ? ({
            ref: m,
            children: s,
            duration: p,
            opacityDuration: h,
            className: c,
            reverseKeyIndexing: f,
            ...u
        } = e, P[0] = e, P[1] = s, P[2] = c, P[3] = u, P[4] = m, P[5] = p, P[6] = h, P[7] = f) : (s = P[1], c = P[2], u = P[3], m = P[4], p = P[5], h = P[6], f = P[7]);
        let E = void 0 === p ? .25 : p,
            A = void 0 === h ? .35 : h,
            O = void 0 !== f && f,
            [D] = a.default.useState(d);
        if (P[8] !== s || P[9] !== c || P[10] !== E || P[11] !== D || P[12] !== A || P[13] !== u || P[14] !== m || P[15] !== O) {
            let e, r = function(e, t, r = "") {
                    let a = {},
                        i = (t ? e.split("").toReversed() : e.split("")).map(e => {
                            a[e] || (a[e] = 0);
                            let t = `${r}${e}-${a[e]}`;
                            return a[e]++, {
                                char: e,
                                key: t
                            }
                        });
                    return t ? i.toReversed() : i
                }(s, O),
                a = s;
            v = o.LayoutGroup, k = D, g = n.motion.span, C = m, P[28] !== c ? (_ = (0, l.cn)("whitespace-nowrap", c), P[28] = c, P[29] = _) : _ = P[29], P[30] === Symbol.for("react.memo_cache_sentinel") ? (T = {
                width: "fit-content"
            }, y = {
                width: "fit-content"
            }, P[30] = y, P[31] = T) : (y = P[30], T = P[31]), b = u, x = i.AnimatePresence, w = "popLayout", S = !1, P[32] !== E || P[33] !== a || P[34] !== A ? (e = e => {
                let {
                    char: r,
                    key: i
                } = e;
                return (0, t.jsx)(n.motion.span, {
                    layoutId: i,
                    layoutDependency: a,
                    initial: {
                        opacity: 0
                    },
                    animate: {
                        opacity: 1
                    },
                    exit: {
                        opacity: 0,
                        transition: {
                            duration: .3 * E
                        }
                    },
                    transition: {
                        duration: E,
                        type: "spring",
                        bounce: 0,
                        opacity: {
                            duration: A,
                            type: "spring",
                            bounce: 0
                        }
                    },
                    className: "inline-block text-inherit",
                    children: " " === r ? " " : r
                }, i)
            }, P[32] = E, P[33] = a, P[34] = A, P[35] = e) : e = P[35], j = r.map(e), P[8] = s, P[9] = c, P[10] = E, P[11] = D, P[12] = A, P[13] = u, P[14] = m, P[15] = O, P[16] = x, P[17] = g, P[18] = v, P[19] = y, P[20] = b, P[21] = k, P[22] = w, P[23] = S, P[24] = j, P[25] = C, P[26] = _, P[27] = T
        } else x = P[16], g = P[17], v = P[18], y = P[19], b = P[20], k = P[21], w = P[22], S = P[23], j = P[24], C = P[25], _ = P[26], T = P[27];
        return P[36] !== x || P[37] !== w || P[38] !== S || P[39] !== j ? (M = (0, t.jsx)(x, {
            mode: w,
            initial: S,
            children: j
        }), P[36] = x, P[37] = w, P[38] = S, P[39] = j, P[40] = M) : M = P[40], P[41] !== g || P[42] !== y || P[43] !== b || P[44] !== M || P[45] !== C || P[46] !== _ || P[47] !== T ? (N = (0, t.jsx)(g, {
            ref: C,
            className: _,
            initial: T,
            animate: y,
            ...b,
            children: M
        }), P[41] = g, P[42] = y, P[43] = b, P[44] = M, P[45] = C, P[46] = _, P[47] = T, P[48] = N) : N = P[48], P[49] !== v || P[50] !== k || P[51] !== N ? (I = (0, t.jsx)(v, {
            id: k,
            children: N
        }), P[49] = v, P[50] = k, P[51] = N, P[52] = I) : I = P[52], I
    }

    function d() {
        return crypto.randomUUID()
    }
    let u = {
            duration: .4,
            ease: [.175, .885, .32, .98]
        },
        m = { ...u,
            delay: .1
        },
        p = {
            initial: {
                opacity: 0,
                rotate: 180
            },
            animate: {
                opacity: 1,
                rotate: 0
            },
            exit: {
                position: "absolute",
                opacity: 0,
                rotate: -180,
                transition: u
            }
        };

    function h(e) {
        let a, s, o, l, c, d = (0, r.c)(10);
        d[0] !== e ? ({
            size: s,
            enabled: o,
            ...a
        } = e, d[0] = e, d[1] = a, d[2] = s, d[3] = o) : (a = d[1], s = d[2], o = d[3]);
        let u = void 0 === s ? 24 : s,
            h = void 0 === o || o;
        return d[4] !== h || d[5] !== a || d[6] !== u ? (l = h && (0, t.jsx)(n.motion.div, {
            className: "flex items-center justify-center animate-spin [&>svg]:block [&>svg]:relative [&>svg]:animate-[spin_1s_ease-in-out_infinite]",
            variants: p,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            transition: m,
            ...a,
            children: (0, t.jsxs)("svg", {
                width: u,
                height: u,
                viewBox: "0 0 18 18",
                fill: "none",
                xmlns: "http://www.w3.org/2000/svg",
                children: [(0, t.jsx)("circle", {
                    cx: "9",
                    cy: "9",
                    r: "7",
                    stroke: "currentColor",
                    strokeOpacity: "0.1",
                    strokeWidth: "2.5"
                }), (0, t.jsx)("path", {
                    d: "M16 9C16 5.13401 12.866 2 9 2",
                    stroke: "currentColor",
                    strokeWidth: "2.5",
                    strokeLinecap: "round"
                })]
            })
        }), d[4] = h, d[5] = a, d[6] = u, d[7] = l) : l = d[7], d[8] !== l ? (c = (0, t.jsx)(i.AnimatePresence, {
            initial: !1,
            mode: "popLayout",
            children: l
        }), d[8] = l, d[9] = c) : c = d[9], c
    }
    let f = {
            duration: .4,
            ease: [.175, .885, .32, .98]
        },
        x = { ...f,
            delay: .1
        },
        g = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1
            },
            exit: {
                position: "absolute",
                opacity: 0,
                transition: f
            }
        },
        v = {
            initial: {
                pathLength: 0
            },
            animate: {
                pathLength: 1,
                transition: { ...f,
                    delay: .3
                }
            },
            exit: {
                pathLength: 0
            }
        };

    function y(e) {
        let a, s, o, l, c, d = (0, r.c)(10);
        d[0] !== e ? ({
            size: s,
            enabled: o,
            ...a
        } = e, d[0] = e, d[1] = a, d[2] = s, d[3] = o) : (a = d[1], s = d[2], o = d[3]);
        let u = void 0 === s ? 24 : s,
            m = void 0 === o || o;
        return d[4] !== m || d[5] !== a || d[6] !== u ? (l = m && (0, t.jsx)(n.motion.div, {
            className: "flex items-center justify-center [&>svg]:block [&>svg]:relative",
            variants: g,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            transition: x,
            ...a,
            children: (0, t.jsx)("svg", {
                xmlns: "http://www.w3.org/2000/svg",
                fill: "none",
                viewBox: "0 0 24 24",
                width: u,
                height: u,
                children: (0, t.jsx)(n.motion.path, {
                    variants: v,
                    initial: "initial",
                    animate: "animate",
                    exit: "exit",
                    transition: f,
                    strokeWidth: "2.5",
                    stroke: "currentColor",
                    strokeLinecap: "round",
                    strokeLinejoin: "round",
                    d: "M4.5 12.5l6 5.5 9-10.5"
                })
            })
        }), d[4] = m, d[5] = a, d[6] = u, d[7] = l) : l = d[7], d[8] !== l ? (c = (0, t.jsx)(i.AnimatePresence, {
            initial: !1,
            mode: "popLayout",
            children: l
        }), d[8] = l, d[9] = c) : c = d[9], c
    }
    let b = {
        initial: {
            opacity: 0,
            width: "0px"
        },
        animate: {
            opacity: 1,
            width: "20px",
            transition: {
                duration: .25,
                type: "spring",
                bounce: 0
            }
        },
        exit: {
            opacity: 0,
            width: 0,
            transition: {
                duration: .25,
                type: "spring",
                bounce: 0
            }
        }
    };

    function k(e) {
        let o, l, d, u, m, p, f, x, g, v, k, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, R = (0, r.c)(54);
        R[0] !== e ? ({
            label: u,
            sublabel: x,
            disabled: d,
            orderCreationState: p,
            successColor: g,
            color: o,
            customColors: l,
            orderCreationDelay: m,
            textKey: v,
            enableShimmer: k,
            ...f
        } = e, R[0] = e, R[1] = o, R[2] = l, R[3] = d, R[4] = u, R[5] = m, R[6] = p, R[7] = f, R[8] = x, R[9] = g, R[10] = v, R[11] = k) : (o = R[1], l = R[2], d = R[3], u = R[4], m = R[5], p = R[6], f = R[7], x = R[8], g = R[9], v = R[10], k = R[11]);
        let F = void 0 === v ? "animated-text" : v,
            $ = void 0 === k || k,
            [B, q] = a.default.useState(m);
        e: {
            let e;
            if (!$ || "rest" !== p) {
                S = void 0;
                break e
            }
            R[12] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                type: "shimmer",
                repeat: "infinite",
                width: "20%",
                duration: "8s"
            }, R[12] = e) : e = R[12],
            S = e
        }
        let V = S;
        t: {
            let e;
            if ("success" === p && g) {
                let e;
                R[13] !== g ? (e = {
                    color: g,
                    customColors: void 0
                }, R[13] = g, R[14] = e) : e = R[14], j = e;
                break t
            }
            R[15] !== o || R[16] !== l ? (e = {
                color: o,
                customColors: l
            }, R[15] = o, R[16] = l, R[17] = e) : e = R[17],
            j = e
        }
        let {
            color: H,
            customColors: U
        } = j;
        R[18] !== m || R[19] !== p ? (C = () => {
            let e;
            return "in-game-delay" === p && m && (q(m), e = setInterval(() => {
                q(w)
            }, 1e3)), () => {
                e && clearInterval(e)
            }
        }, _ = [p, m], R[18] = m, R[19] = p, R[20] = C, R[21] = _) : (C = R[20], _ = R[21]), a.default.useEffect(C, _);
        let W = d || "submitting" === p || "in-game-delay" === p || "switching-networks" === p,
            G = "rest" !== p && "success" !== p;
        R[22] !== G ? (T = (0, t.jsx)(h, {
            size: 20,
            enabled: G
        }), R[22] = G, R[23] = T) : T = R[23];
        let Z = "success" === p;
        return R[24] !== Z ? (M = (0, t.jsx)(y, {
            size: 20,
            enabled: Z
        }), R[24] = Z, R[25] = M) : M = R[25], R[26] === Symbol.for("react.memo_cache_sentinel") ? (N = {
            duration: 0
        }, R[26] = N) : N = R[26], R[27] !== u || R[28] !== F ? (I = (0, t.jsx)(c, {
            className: "text-sm font-semibold text-inherit!",
            duration: .125,
            opacityDuration: .15,
            children: u
        }, F), R[27] = u, R[28] = F, R[29] = I) : I = R[29], R[30] !== B || R[31] !== p ? (P = "in-game-delay" === p && !!B && (0, t.jsx)(n.motion.span, {
            variants: b,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            className: "flex justify-end h-full",
            children: (0, t.jsx)(c, {
                className: "text-sm font-semibold text-inherit!",
                children: `${B}s`
            })
        }), R[30] = B, R[31] = p, R[32] = P) : P = R[32], R[33] !== P ? (E = (0, t.jsx)(i.AnimatePresence, {
            mode: "sync",
            children: P
        }), R[33] = P, R[34] = E) : E = R[34], R[35] !== I || R[36] !== E ? (A = (0, t.jsxs)("span", {
            className: "flex items-center",
            children: [I, E]
        }), R[35] = I, R[36] = E, R[37] = A) : A = R[37], R[38] !== x ? (O = !!x && (0, t.jsx)(c, {
            className: "text-sm font-medium text-inherit! opacity-80",
            children: x
        }), R[38] = x, R[39] = O) : O = R[39], R[40] !== A || R[41] !== O ? (D = (0, t.jsxs)(n.motion.span, {
            className: "flex flex-col items-center gap-0.5 relative",
            transition: N,
            children: [A, O]
        }, "in-game-bet-button"), R[40] = A, R[41] = O, R[42] = D) : D = R[42], R[43] !== M || R[44] !== D || R[45] !== T ? (L = (0, t.jsxs)("span", {
            className: "flex items-center gap-3",
            children: [T, M, D]
        }, "in-game-bet-button-container"), R[43] = M, R[44] = D, R[45] = T, R[46] = L) : L = R[46], R[47] !== V || R[48] !== H || R[49] !== U || R[50] !== f || R[51] !== L || R[52] !== W ? (z = (0, t.jsx)(s.TradingButton, {
            selected: !0,
            disabled: W,
            animationOptions: V,
            color: H,
            customColors: U,
            ...f,
            children: L
        }), R[47] = V, R[48] = H, R[49] = U, R[50] = f, R[51] = L, R[52] = W, R[53] = z) : z = R[53], z
    }

    function w(e) {
        return e && e > 0 ? e - 1 : 0
    }
    k.displayName = "AnimatedButton";
    var S = e.i(458164),
        j = e.i(604777),
        C = e.i(784521);
    let _ = (e, t, r, a) => {
        let i;
        return r === S.OrderType.Limit ? (i = e.toLowerCase().includes("buy"), a("loading" === t ? i ? "trading.placingBuyOrder" : "trading.placingSellOrder" : i ? "trading.placedBuyOrder" : "trading.placedSellOrder")) : e.includes("Buy") ? a("loading" === t ? "trading.buying" : "trading.bought") : e.includes("Sell") ? a("loading" === t ? "trading.selling" : "trading.sold") : e.includes("Merge") ? a("loading" === t ? "trading.merging" : "trading.merged") : e.includes("Split") ? "loading" === t ? a("trading.splitting") : "success" === t ? a("trading.splitPast") : e : e.includes("Redeem") ? a("loading" === t ? "trading.redeeming" : "trading.redeemed") : e.includes("Cash") ? a("loading" === t ? "trading.cashing" : "trading.cashed") : e
    };
    e.s(["AnimatedButton", 0, function(e) {
        let a, i, n, s, o, l, c, d, u, m, p, h, f, x, g = (0, r.c)(30);
        g[0] !== e ? ({
            label: s,
            sublabel: u,
            disabled: n,
            orderCreationState: l,
            orderType: c,
            successColor: m,
            color: a,
            customColors: i,
            orderCreationDelay: o,
            textKey: p,
            ...d
        } = e, g[0] = e, g[1] = a, g[2] = i, g[3] = n, g[4] = s, g[5] = o, g[6] = l, g[7] = c, g[8] = d, g[9] = u, g[10] = m, g[11] = p) : (a = g[1], i = g[2], n = g[3], s = g[4], o = g[5], l = g[6], c = g[7], d = g[8], u = g[9], m = g[10], p = g[11]);
        let v = void 0 === p ? "animated-text" : p,
            y = (0, j.useTranslations)();
        g[12] === Symbol.for("react.memo_cache_sentinel") ? (h = ["authenticated"], g[12] = h) : h = g[12];
        let {
            authenticated: b
        } = (0, C.useAccountContext)(h);
        g[13] !== s || g[14] !== l || g[15] !== c || g[16] !== y ? (f = (({
            label: e,
            orderCreationState: t,
            orderType: r,
            t: a
        }) => {
            switch (t) {
                case "submitting":
                case "in-game-delay":
                    return _(e, "loading", r, a);
                case "success":
                    return _(e, "success", r, a);
                case "switching-networks":
                    return "Switching Networks";
                case "deploy-safe":
                    return "Generating Wallet";
                case "generate-api-key":
                    return "Generating API Key";
                case "sign-approvals":
                    return "Submitting Approvals";
                default:
                    return e
            }
        })({
            label: s,
            orderCreationState: l,
            orderType: c,
            t: y
        }), g[13] = s, g[14] = l, g[15] = c, g[16] = y, g[17] = f) : f = g[17];
        let w = f,
            S = b ? w : s,
            T = b ? l : "rest";
        return g[18] !== b || g[19] !== a || g[20] !== i || g[21] !== n || g[22] !== o || g[23] !== d || g[24] !== u || g[25] !== m || g[26] !== S || g[27] !== T || g[28] !== v ? (x = (0, t.jsx)(k, {
            label: S,
            sublabel: u,
            orderCreationState: T,
            enableShimmer: b,
            successColor: m,
            color: a,
            customColors: i,
            orderCreationDelay: o,
            textKey: v,
            disabled: n,
            ...d
        }), g[18] = b, g[19] = a, g[20] = i, g[21] = n, g[22] = o, g[23] = d, g[24] = u, g[25] = m, g[26] = S, g[27] = T, g[28] = v, g[29] = x) : x = g[29], x
    }], 928810)
}, 145429, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconTriangleWarningOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...a
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...a
    }, t.default.createElement("path", {
        d: "M7.63796 3.48996L2.21295 12.89C1.60795 13.9399 2.36395 15.25 3.57495 15.25H14.425C15.636 15.25 16.392 13.9399 15.787 12.89L10.362 3.48996C9.75696 2.44996 8.24296 2.44996 7.63796 3.48996Z",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }), t.default.createElement("path", {
        d: "M9 6.75V9.75",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }), t.default.createElement("path", {
        d: "M9 13.5C8.448 13.5 8 13.05 8 12.5C8 11.95 8.448 11.5 9 11.5C9.552 11.5 10 11.9501 10 12.5C10 13.0499 9.552 13.5 9 13.5Z",
        fill: "currentColor",
        "data-color": "color-2",
        "data-stroke": "none"
    }))])
}, 484864, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(740594),
        i = e.i(723823),
        n = e.i(23128),
        s = e.i(215959),
        o = e.i(145429),
        l = e.i(416340),
        c = e.i(604777),
        d = e.i(399336),
        u = e.i(880809),
        m = e.i(196593),
        p = e.i(458164),
        h = e.i(261391),
        f = e.i(97594);
    let x = (0, s.motion)(n.Button);
    e.s(["default", 0, e => {
        let s, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q = (0, r.c)(91),
            {
                onConfirm: X,
                hideWarning: J
            } = e,
            ee = (0, c.useTranslations)();
        Q[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["side", "price", "setShares", "setHasTouchedPrice", "setHasTouchedShares", "handleResetPriceState", "selectedOutcomeIdx"], Q[0] = s) : s = Q[0];
        let {
            side: et,
            price: er,
            setShares: ea,
            setHasTouchedPrice: ei,
            setHasTouchedShares: en,
            handleResetPriceState: es,
            selectedOutcomeIdx: eo
        } = (0, u.useTradeContext)(s), {
            numShares: el,
            cost: ec,
            averagePrice: ed
        } = function() {
            let {
                orderType: e
            } = (0, u.useTradeContext)(["orderType"]), {
                shares: t,
                side: r,
                sharesUsdc: i,
                priceUsdc: n
            } = (0, u.useTradeContext)(["shares", "side", "sharesUsdc", "priceUsdc"]), {
                averagePrice: s,
                sharesReceived: o,
                usdcReceived: l
            } = (0, h.useMarketOrderDetail)();
            return e === p.OrderType.Limit ? {
                numShares: Number(i) / 1e6,
                cost: (0, m.formatNumbers)((0, m.formatUSDCUnits)(i * n / 10 n ** 6 n)),
                averagePrice: n ? (Number(n) / 1e6).toString() : "0"
            } : {
                numShares: r === a.Side.BUY ? o : t,
                cost: r === a.Side.BUY ? t : l,
                averagePrice: s
            }
        }(), {
            isOrderInvalid: eu,
            setHasClicked: em
        } = (0, f.useOrderValidation)();
        Q[1] === Symbol.for("react.memo_cache_sentinel") ? (g = ["activeMarket"], Q[1] = g) : g = Q[1];
        let {
            activeMarket: ep
        } = (0, d.useEventActiveMarketContext)(g), eh = (0, i.useBestPrice)(ep, eo, "ask");
        (0, i.useBestPrice)(ep, eo, "bid");
        let [ef, ex] = (0, l.useState)(!1);
        e: {
            let e;
            if ("" !== er && parseFloat(er) > 0) {
                v = er;
                break e
            }
            if (et === a.Side.BUY) {
                let e;
                Q[2] !== eh.value ? (e = (0, m.showPaddedCentsOnly)(eh.value.toString()), Q[2] = eh.value, Q[3] = e) : e = Q[3], v = e;
                break e
            }
            Q[4] !== eh.value ? (e = (0, m.showPaddedCentsOnly)(eh.value.toString()), Q[4] = eh.value, Q[5] = e) : e = Q[5],
            v = e
        }
        let eg = v;
        Q[6] !== es || Q[7] !== eg || Q[8] !== em || Q[9] !== ei || Q[10] !== en || Q[11] !== ea ? (y = () => {
            ea(""), ei(!1), en(!1), em(!1), es(eg)
        }, Q[6] = es, Q[7] = eg, Q[8] = em, Q[9] = ei, Q[10] = en, Q[11] = ea, Q[12] = y) : y = Q[12];
        let ev = y;
        Q[13] !== J || Q[14] !== X || Q[15] !== ev ? (b = (e, t) => {
            ex(!0), X(e, t).then(() => {
                ev(), J(), ex(!1)
            }).catch(() => {
                J(), ex(!1)
            })
        }, Q[13] = J, Q[14] = X, Q[15] = ev, Q[16] = b) : b = Q[16];
        let ey = b,
            eb = ef || eu;
        Q[17] !== ee ? (k = ee("trading.slippage.title"), Q[17] = ee, Q[18] = k) : k = Q[18], Q[19] !== k ? (w = (0, t.jsx)("span", {
            className: "font-bold text-base text-text",
            children: k
        }), Q[19] = k, Q[20] = w) : w = Q[20], Q[21] === Symbol.for("react.memo_cache_sentinel") ? (S = (0, t.jsx)(o.IconTriangleWarningOutline18, {
            size: 32,
            className: "text-amber-500"
        }), Q[21] = S) : S = Q[21], Q[22] !== ee ? (j = ee("trading.slippage.description"), Q[22] = ee, Q[23] = j) : j = Q[23], Q[24] !== j ? (C = (0, t.jsxs)("div", {
            className: "flex flex-col items-center gap-2",
            children: [S, (0, t.jsx)("span", {
                className: "font-normal text-sm text-text-secondary",
                children: j
            })]
        }), Q[24] = j, Q[25] = C) : C = Q[25], Q[26] !== C || Q[27] !== w ? (_ = (0, t.jsxs)("div", {
            className: "w-full flex flex-col gap-3 items-center",
            children: [w, C]
        }), Q[26] = C, Q[27] = w, Q[28] = _) : _ = Q[28], Q[29] !== ee ? (T = ee("trading.avg"), Q[29] = ee, Q[30] = T) : T = Q[30], Q[31] !== T ? (M = (0, t.jsx)("span", {
            className: "font-normal text-sm text-neutral-500",
            children: T
        }), Q[31] = T, Q[32] = M) : M = Q[32], Q[33] !== ed ? (N = (0, m.showCentsOnly)(ed.toString()), Q[33] = ed, Q[34] = N) : N = Q[34], Q[35] !== N ? (I = (0, t.jsxs)("span", {
            className: "font-semibold text-sm text-text",
            children: [N, "¢"]
        }), Q[35] = N, Q[36] = I) : I = Q[36], Q[37] !== M || Q[38] !== I ? (P = (0, t.jsxs)("div", {
            className: "flex flex-row items-center justify-between h-10 border-b border-neutral-100",
            children: [M, I]
        }), Q[37] = M, Q[38] = I, Q[39] = P) : P = Q[39], Q[40] !== ee ? (E = ee("trading.shares"), Q[40] = ee, Q[41] = E) : E = Q[41], Q[42] !== E ? (A = (0, t.jsx)("span", {
            className: "font-normal text-sm text-neutral-500",
            children: E
        }), Q[42] = E, Q[43] = A) : A = Q[43], Q[44] !== el ? (O = (0, m.formatNum)(el, {
            decimals: 2
        }), Q[44] = el, Q[45] = O) : O = Q[45], Q[46] !== O ? (D = (0, t.jsx)("span", {
            className: "font-semibold text-sm text-text",
            children: O
        }), Q[46] = O, Q[47] = D) : D = Q[47], Q[48] !== A || Q[49] !== D ? (L = (0, t.jsxs)("div", {
            className: "flex flex-row items-center justify-between h-10 border-b border-neutral-100",
            children: [A, D]
        }), Q[48] = A, Q[49] = D, Q[50] = L) : L = Q[50], Q[51] !== et || Q[52] !== ee ? (z = ee(et === a.Side.BUY ? "trading.cost" : "portfolio.redeemAmount.receive"), Q[51] = et, Q[52] = ee, Q[53] = z) : z = Q[53], Q[54] !== z ? (R = (0, t.jsx)("span", {
            className: "font-normal text-sm text-neutral-500",
            children: z
        }), Q[54] = z, Q[55] = R) : R = Q[55], Q[56] !== ec ? (F = (0, m.formatToDollar)(ec), Q[56] = ec, Q[57] = F) : F = Q[57], Q[58] !== F ? ($ = (0, t.jsx)("span", {
            className: "font-semibold text-sm text-text",
            children: F
        }), Q[58] = F, Q[59] = $) : $ = Q[59], Q[60] !== R || Q[61] !== $ ? (B = (0, t.jsxs)("div", {
            className: "flex flex-row items-center justify-between h-10 border-b border-neutral-100",
            children: [R, $]
        }), Q[60] = R, Q[61] = $, Q[62] = B) : B = Q[62], Q[63] !== P || Q[64] !== L || Q[65] !== B ? (q = (0, t.jsxs)("div", {
            className: "w-full flex flex-col",
            children: [P, L, B]
        }), Q[63] = P, Q[64] = L, Q[65] = B, Q[66] = q) : q = Q[66];
        let ek = eb ? void 0 : ey;
        return Q[67] !== ee ? (V = ee("orders.confirm"), Q[67] = ee, Q[68] = V) : V = Q[68], Q[69] !== et || Q[70] !== ee ? (H = ee(et === a.Side.BUY ? "trading.buy" : "trading.sell"), Q[69] = et, Q[70] = ee, Q[71] = H) : H = Q[71], Q[72] !== eb || Q[73] !== ek || Q[74] !== V || Q[75] !== H ? (U = (0, t.jsxs)(x, {
            size: "lg",
            disabled: eb,
            onTap: ek,
            children: [V, " ", H]
        }), Q[72] = eb, Q[73] = ek, Q[74] = V, Q[75] = H, Q[76] = U) : U = Q[76], Q[77] !== ee ? (W = ee("trading.editOrder"), Q[77] = ee, Q[78] = W) : W = Q[78], Q[79] !== J || Q[80] !== W ? (G = (0, t.jsx)(n.Button, {
            variant: "secondary",
            size: "lg",
            onClick: J,
            children: W
        }), Q[79] = J, Q[80] = W, Q[81] = G) : G = Q[81], Q[82] !== U || Q[83] !== G ? (Z = (0, t.jsxs)("div", {
            className: "w-full flex flex-col gap-2",
            children: [U, G]
        }), Q[82] = U, Q[83] = G, Q[84] = Z) : Z = Q[84], Q[85] !== q || Q[86] !== Z ? (K = (0, t.jsxs)("div", {
            className: "w-full flex flex-col gap-5",
            children: [q, Z]
        }), Q[85] = q, Q[86] = Z, Q[87] = K) : K = Q[87], Q[88] !== _ || Q[89] !== K ? (Y = (0, t.jsxs)("div", {
            className: "w-full flex flex-col gap-5 items-center p-5",
            children: [_, K]
        }), Q[88] = _, Q[89] = K, Q[90] = Y) : Y = Q[90], Y
    }])
}, 114659, 567476, 51743, 505300, e => {
    "use strict";
    e.s(["RedeemDrawer", () => eN], 114659);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(317681),
        n = e.i(468540),
        s = e.i(118818),
        o = e.i(879756),
        l = e.i(740594),
        c = e.i(23128),
        d = e.i(525962),
        u = e.i(928810),
        m = e.i(213333),
        p = e.i(140527),
        h = e.i(261391),
        f = e.i(484864),
        x = e.i(458164),
        g = e.i(909420),
        v = e.i(604777),
        y = e.i(784521),
        b = e.i(399336),
        k = e.i(6204),
        w = e.i(880809),
        S = e.i(196593),
        j = e.i(422868),
        C = e.i(709638),
        _ = e.i(488758),
        T = e.i(73836),
        M = e.i(827681),
        N = e.i(246290),
        I = e.i(863828),
        P = e.i(112014),
        E = e.i(249792),
        A = e.i(606572),
        O = e.i(51800),
        D = e.i(116003),
        L = e.i(430849),
        z = e.i(460649),
        R = e.i(600326),
        F = e.i(99417),
        $ = e.i(502980),
        B = e.i(668122),
        q = e.i(79075),
        V = e.i(305457),
        H = e.i(400819),
        U = e.i(684686),
        W = e.i(885092),
        G = e.i(921807),
        Z = e.i(660006),
        K = e.i(324277),
        Y = e.i(53950),
        Q = e.i(450091),
        X = e.i(631222),
        J = e.i(504404);
    e.s(["MobileExpirationContextProvider", () => ej, "useMobileExpirationContext", () => eC], 51743);
    var ee = e.i(618832),
        et = e.i(90783),
        er = e.i(455466),
        ea = e.i(94609),
        ei = e.i(891685),
        en = e.i(294472),
        es = e.i(66199);
    let eo = "saved:",
        el = "pm_expiration_mode",
        ec = () => {
            try {
                let e = localStorage.getItem(el);
                if (!e) return;
                return JSON.parse(e)
            } catch {
                return
            }
        },
        ed = e => {
            try {
                localStorage.setItem(el, JSON.stringify(e))
            } catch {}
        },
        eu = /(\d+(?:\.\d+)?)\s*(days?|day|d|hours?|hour|hrs?|hr|h|minutes?|minute|mins?|min|m|seconds?|second|secs?|sec|s)/gi,
        em = () => `${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,
        ep = e => {
            if (!Number.isFinite(e)) return;
            let t = Math.round(e);
            if (!(t < 1) && !(t > 31536e3)) return t
        },
        eh = e => {
            let t = Math.max(1, Math.round(e)),
                r = Math.floor(t / 86400),
                a = Math.floor(t % 86400 / 3600),
                i = Math.floor(t % 3600 / 60),
                n = t % 60,
                s = [];
            return r && s.push(`${r}d`), a && s.push(`${a}h`), i && s.push(`${i}m`), n && s.length < 2 && s.push(`${n}s`), s.slice(0, 2).join(" ") || `${t}s`
        },
        ef = e => {
            let t = e.toLowerCase();
            return "d" === t || "day" === t || "days" === t ? 86400 : "h" === t || "hr" === t || "hrs" === t || "hour" === t || "hours" === t ? 3600 : "m" === t || "min" === t || "mins" === t || "minute" === t || "minutes" === t ? 60 : 1
        },
        ex = e => {
            let t = e.trim().toLowerCase().replaceAll(",", " ");
            if (!t.length) return;
            if (/^\d+(?:\.\d+)?$/.test(t)) return ep(60 * Number(t));
            let r = 0,
                a = !1;
            for (let e of t.matchAll(eu)) {
                let t = Number(e[1]);
                if (!Number.isFinite(t)) return;
                r += t * ef(e[2]), a = !0
            }
            if (a && !(t.replace(eu, "").replace(/\s+/g, "").length > 0)) return ep(r)
        },
        eg = e => Math.floor(Date.now() / 1e3) + Math.max(1, Math.round(e)),
        ev = e => `${eo}${e}`,
        ey = e => {
            if (e.startsWith(eo)) return e.slice(eo.length) || void 0
        },
        eb = e => {
            if (!Array.isArray(e)) return [];
            let t = new Map;
            return e.forEach(e => {
                if (!e || "object" != typeof e) return;
                let r = ep(Number(e.seconds));
                if (!r) return;
                let a = Number.isFinite(Number(e.createdAt)) && Number(e.createdAt) > 0 ? Number(e.createdAt) : Date.now(),
                    i = "string" == typeof e.label && e.label.trim().length > 0 ? e.label : eh(r),
                    n = {
                        id: "string" == typeof e.id && e.id.trim().length > 0 ? e.id : em(),
                        seconds: r,
                        label: i,
                        createdAt: a
                    },
                    s = t.get(r);
                (!s || n.createdAt > s.createdAt) && t.set(r, n)
            }), Array.from(t.values()).sort((e, t) => t.createdAt - e.createdAt).slice(0, 8)
        },
        ek = () => {
            let e, t, a, i, n, s, o, l = (0, r.c)(17);
            l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                defaultValue: []
            }, l[0] = e) : e = l[0];
            let [c, d] = (0, es.useLocalStorageState)("pm_limit_order_expiration_presets_v1", e);
            l[1] !== c ? (t = eb(c), l[1] = c, l[2] = t) : t = l[2];
            let u = t;
            l[3] !== d ? (a = e => {
                d(t => {
                    let r = eb(t);
                    return eb("function" == typeof e ? e(r) : e)
                })
            }, l[3] = d, l[4] = a) : a = l[4];
            let m = a;
            l[5] !== u || l[6] !== m ? (i = e => {
                let t = ep(e);
                if (!t) return;
                let r = u.find(e => e.seconds === t),
                    a = r ? { ...r,
                        label: eh(t),
                        createdAt: Date.now()
                    } : {
                        id: em(),
                        seconds: t,
                        label: eh(t),
                        createdAt: Date.now()
                    };
                return m(e => [a, ...e.filter(e => e.id !== a.id)].slice(0, 8)), a
            }, l[5] = u, l[6] = m, l[7] = i) : i = l[7];
            let p = i;
            l[8] !== m ? (n = e => {
                m(t => t.filter(t => t.id !== e))
            }, l[8] = m, l[9] = n) : n = l[9];
            let h = n;
            l[10] !== u ? (s = e => {
                let t = ey(e);
                if (t) return u.find(e => e.id === t)
            }, l[10] = u, l[11] = s) : s = l[11];
            let f = s;
            return l[12] !== p || l[13] !== f || l[14] !== h || l[15] !== u ? (o = {
                savedExpirationPresets: u,
                addSavedExpirationPreset: p,
                removeSavedExpirationPreset: h,
                getSavedExpirationPresetFromMode: f
            }, l[12] = p, l[13] = f, l[14] = h, l[15] = u, l[16] = o) : o = l[16], o
        },
        ew = {
            "5m": 300,
            "1h": 3600,
            "12h": 43200,
            "24h": 86400
        };
    e.s(["RELATIVE_DURATION_SECONDS", 0, ew, "fromSavedExpirationMode", 0, ey, "getPersistedExpirationMode", 0, ec, "getRelativeExpirationTimestamp", 0, eg, "parseRelativeExpirationSeconds", 0, ex, "persistExpirationMode", 0, ed, "toSavedExpirationMode", 0, ev, "useExpirationPresets", 0, ek], 567476);
    let eS = a.default.createContext({}),
        ej = e => {
            let i, n, o = (0, r.c)(26),
                {
                    children: l
                } = e,
                {
                    expirationEnabled: c,
                    setExpirationEnabled: d,
                    expirationMode: u,
                    setExpirationMode: p,
                    customExpirationDate: h,
                    setCustomExpirationDate: f,
                    customExpirationTime: g,
                    setCustomExpirationTime: v,
                    customRelativeExpirationInput: y,
                    setCustomRelativeExpirationInput: b,
                    customRelativeExpirationSeconds: S,
                    hasCustomRelativeExpirationError: j,
                    saveCustomExpirationPreset: C,
                    setSaveCustomExpirationPreset: _,
                    startOfToday: T,
                    onExpirationModeChange: M,
                    onSubmitCustomExpiration: N,
                    onCancelCustomExpiration: I,
                    isLiveSportsMarket: P,
                    isSportsPage: E,
                    savedExpirationPresets: A,
                    removeSavedExpirationPreset: O
                } = (() => {
                    let e, t, i, n, o, l, c, d, u, p, h, f, g, v, y, b, S, j, C, _, T, M, N, I = (0, r.c)(66);
                    I[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["setOrderExpiration", "orderExpiration", "orderType"], I[0] = e) : e = I[0];
                    let {
                        setOrderExpiration: P,
                        orderExpiration: E,
                        orderType: A
                    } = (0, w.useTradeContext)(e), {
                        setLimitOrderPage: O
                    } = (0, s.useMobileMarketContext)();
                    I[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["event"], I[1] = t) : t = I[1];
                    let {
                        event: D
                    } = (0, ei.useEventContext)(t);
                    I[2] === Symbol.for("react.memo_cache_sentinel") ? (i = ["isSportsPage"], I[2] = i) : i = I[2];
                    let {
                        isSportsPage: L
                    } = (0, k.useSportsContext)(i), {
                        savedExpirationPresets: z,
                        addSavedExpirationPreset: R,
                        removeSavedExpirationPreset: F,
                        getSavedExpirationPresetFromMode: $
                    } = ek(), B = L && (D ? .live || D ? .isLive), [q, V] = a.default.useState(void 0 !== E);
                    I[3] !== E ? (n = () => {
                        if (void 0 === E) return "until-cancelled";
                        if (-1 === E) return "in-30-seconds";
                        let e = ec();
                        return e || "custom"
                    }, I[3] = E, I[4] = n) : n = I[4];
                    let [H, U] = a.default.useState(n);
                    I[5] === Symbol.for("react.memo_cache_sentinel") ? (o = e => {
                        U(e), ed(e)
                    }, I[5] = o) : o = I[5];
                    let W = o,
                        G = (0, m.usePrevious)(H),
                        Z = a.default.useRef(q);
                    I[6] !== E ? (l = () => {
                        if (void 0 === E) return;
                        let e = ec();
                        if (!e || !(e in ew) && "end-of-day" !== e && "in-30-seconds" !== e) {
                            if (e && ey(e)) return;
                            return E
                        }
                    }, I[6] = E, I[7] = l) : l = I[7];
                    let [K, Y] = a.default.useState(l);
                    if (I[8] === Symbol.for("react.memo_cache_sentinel")) {
                        var Q;
                        let e = new Date,
                            t = String(23 === (Q = e.getHours()) ? 0 : Q + 1).padStart(2, "0"),
                            r = String(e.getMinutes()).padStart(2, "0"),
                            a = String(e.getSeconds()).padStart(2, "0");
                        c = {
                            initialDate: e,
                            nowTime: `${t}:${r}:${a}`,
                            startOfToday: (0, ea.startOfDay)(e)
                        }, I[8] = c
                    } else c = I[8];
                    let {
                        initialDate: X,
                        nowTime: J,
                        startOfToday: es
                    } = c, [eo, el] = a.default.useState(X), [eu, em] = a.default.useState(J), [ep, eh] = a.default.useState(""), [ef, eb] = a.default.useState(!1);
                    I[9] !== ep ? (d = ex(ep), I[9] = ep, I[10] = d) : d = I[10];
                    let eS = d;
                    I[11] !== ep ? (u = ep.trim(), I[11] = ep, I[12] = u) : u = I[12];
                    let ej = u.length > 0 && void 0 === eS;
                    I[13] !== P || I[14] !== $ || I[15] !== O ? (p = e => {
                        if ("until-cancelled" === e) {
                            P(void 0), Y(void 0), eb(!1), W("until-cancelled"), O("resting");
                            return
                        }
                        if ("end-of-day" === e) {
                            P((0, en.fromDateToUnix)((0, ee.endOfDay)(new Date))), Y(void 0), eb(!1), W("end-of-day"), O("resting");
                            return
                        }
                        if ("in-30-seconds" === e) {
                            P(-1), Y(void 0), eb(!1), W("in-30-seconds"), O("resting");
                            return
                        }
                        if ("custom" === e) {
                            W("custom"), O("expiration");
                            return
                        }
                        if (e in ew) {
                            P(eg(ew[e])), Y(void 0), eb(!1), W(e), O("resting");
                            return
                        }
                        let t = $(e);
                        t && (P(eg(t.seconds)), Y(void 0), eb(!1), W(e), O("resting"))
                    }, I[13] = P, I[14] = $, I[15] = O, I[16] = p) : p = I[16];
                    let eC = p;
                    I[17] !== P || I[18] !== R || I[19] !== eo || I[20] !== eu || I[21] !== eS || I[22] !== ej || I[23] !== ef ? (h = () => {
                        let e, t;
                        if (ej) return !1;
                        if (void 0 !== eS) e = eg(t = eS);
                        else {
                            let r = ((e, t) => {
                                let [r = "0", a = "0", i = "0"] = e.split(":");
                                return (0, er.set)(new Date(t), {
                                    hours: Number(r),
                                    minutes: Number(a),
                                    seconds: Number(i)
                                })
                            })(eu, eo);
                            if ((0, et.isBefore)(r, new Date) || (e = (0, en.fromDateToUnix)(r), (t = Math.round((r.getTime() - Date.now()) / 1e3)) < 60)) return !1
                        }
                        if (P(e), ef) {
                            let r = R(t);
                            r ? (W(ev(r.id)), Y(void 0)) : (W("custom"), Y(e))
                        } else W("custom"), Y(e);
                        return eb(!1), eh(""), !0
                    }, I[17] = P, I[18] = R, I[19] = eo, I[20] = eu, I[21] = eS, I[22] = ej, I[23] = ef, I[24] = h) : h = I[24];
                    let e_ = h;
                    I[25] !== eC || I[26] !== G ? (f = () => {
                        eC(G ? ? "until-cancelled")
                    }, I[25] = eC, I[26] = G, I[27] = f) : f = I[27];
                    let eT = f,
                        eM = a.default.useRef(!1);
                    return I[28] !== E || I[29] !== P || I[30] !== H || I[31] !== z ? (g = () => {
                        if (eM.current || (eM.current = !0, void 0 === E)) return;
                        if (H in ew) return void P(eg(ew[H]));
                        if ("end-of-day" === H) return void P((0, en.fromDateToUnix)((0, ee.endOfDay)(new Date)));
                        if ("in-30-seconds" === H) return void P(-1);
                        let e = ey(H);
                        if (e) {
                            let t = z.find(t => t.id === e);
                            t && P(eg(t.seconds))
                        }
                    }, v = [E, P, H, z], I[28] = E, I[29] = P, I[30] = H, I[31] = z, I[32] = g, I[33] = v) : (g = I[32], v = I[33]), a.default.useEffect(g, v), I[34] !== K ? (y = () => {
                        K && (K === (0, en.fromDateToUnix)((0, ee.endOfDay)(new Date)) ? W("end-of-day") : -1 === K ? W("in-30-seconds") : W("custom"))
                    }, b = [K, W], I[34] = K, I[35] = y, I[36] = b) : (y = I[35], b = I[36]), a.default.useEffect(y, b), I[37] !== H || I[38] !== z ? (S = () => {
                        let e = ey(H);
                        !e || z.some(t => t.id === e) || W("custom")
                    }, j = [H, z, W], I[37] = H, I[38] = z, I[39] = S, I[40] = j) : (S = I[39], j = I[40]), a.default.useEffect(S, j), I[41] !== K || I[42] !== q || I[43] !== B || I[44] !== eC ? (C = () => {
                        Z.current !== q && (Z.current = q, q ? K || eC(B ? "until-cancelled" : "5m") : eC("until-cancelled"))
                    }, _ = [K, q, B, eC], I[41] = K, I[42] = q, I[43] = B, I[44] = eC, I[45] = C, I[46] = _) : (C = I[45], _ = I[46]), a.default.useEffect(C, _), I[47] !== A ? (T = () => {
                        A !== x.OrderType.Limit && V(!1)
                    }, M = [A], I[47] = A, I[48] = T, I[49] = M) : (T = I[48], M = I[49]), a.default.useEffect(T, M), I[50] !== eo || I[51] !== eu || I[52] !== ep || I[53] !== eS || I[54] !== q || I[55] !== H || I[56] !== ej || I[57] !== B || I[58] !== L || I[59] !== eT || I[60] !== eC || I[61] !== e_ || I[62] !== F || I[63] !== ef || I[64] !== z ? (N = {
                        expirationEnabled: q,
                        setExpirationEnabled: V,
                        expirationMode: H,
                        setExpirationMode: W,
                        customExpirationDate: eo,
                        setCustomExpirationDate: el,
                        customExpirationTime: eu,
                        setCustomExpirationTime: em,
                        customRelativeExpirationInput: ep,
                        setCustomRelativeExpirationInput: eh,
                        customRelativeExpirationSeconds: eS,
                        hasCustomRelativeExpirationError: ej,
                        saveCustomExpirationPreset: ef,
                        setSaveCustomExpirationPreset: eb,
                        startOfToday: es,
                        onExpirationModeChange: eC,
                        onSubmitCustomExpiration: e_,
                        onCancelCustomExpiration: eT,
                        isLiveSportsMarket: B,
                        isSportsPage: L,
                        savedExpirationPresets: z,
                        removeSavedExpirationPreset: F
                    }, I[50] = eo, I[51] = eu, I[52] = ep, I[53] = eS, I[54] = q, I[55] = H, I[56] = ej, I[57] = B, I[58] = L, I[59] = eT, I[60] = eC, I[61] = e_, I[62] = F, I[63] = ef, I[64] = z, I[65] = N) : N = I[65], N
                })();
            o[0] !== h || o[1] !== g || o[2] !== y || o[3] !== S || o[4] !== c || o[5] !== u || o[6] !== j || o[7] !== P || o[8] !== E || o[9] !== I || o[10] !== M || o[11] !== N || o[12] !== O || o[13] !== C || o[14] !== A || o[15] !== f || o[16] !== v || o[17] !== b || o[18] !== d || o[19] !== p || o[20] !== _ || o[21] !== T ? (i = {
                expirationEnabled: c,
                setExpirationEnabled: d,
                expirationMode: u,
                setExpirationMode: p,
                customExpirationDate: h,
                setCustomExpirationDate: f,
                customExpirationTime: g,
                setCustomExpirationTime: v,
                customRelativeExpirationInput: y,
                setCustomRelativeExpirationInput: b,
                customRelativeExpirationSeconds: S,
                hasCustomRelativeExpirationError: j,
                saveCustomExpirationPreset: C,
                setSaveCustomExpirationPreset: _,
                startOfToday: T,
                onExpirationModeChange: M,
                onSubmitCustomExpiration: N,
                onCancelCustomExpiration: I,
                isLiveSportsMarket: P,
                isSportsPage: E,
                savedExpirationPresets: A,
                removeSavedExpirationPreset: O
            }, o[0] = h, o[1] = g, o[2] = y, o[3] = S, o[4] = c, o[5] = u, o[6] = j, o[7] = P, o[8] = E, o[9] = I, o[10] = M, o[11] = N, o[12] = O, o[13] = C, o[14] = A, o[15] = f, o[16] = v, o[17] = b, o[18] = d, o[19] = p, o[20] = _, o[21] = T, o[22] = i) : i = o[22];
            let D = i;
            return o[23] !== l || o[24] !== D ? (n = (0, t.jsx)(eS.Provider, {
                value: D,
                children: l
            }), o[23] = l, o[24] = D, o[25] = n) : n = o[25], n
        },
        eC = () => a.default.useContext(eS);

    function e_(e) {
        let a, i, n, s, o, l, c = (0, r.c)(16),
            {
                amount: d,
                shares: u,
                avgPrice: m
            } = e,
            p = (0, v.useTranslations)();
        return c[0] !== p ? (a = p("portfolio.redeemAmount.receive"), c[0] = p, c[1] = a) : a = c[1], c[2] !== a ? (i = (0, t.jsx)("span", {
            className: "text-base font-medium text-primary",
            children: a
        }), c[2] = a, c[3] = i) : i = c[3], c[4] !== d ? (n = (0, t.jsx)("span", {
            className: "text-xl font-medium text-green-500",
            children: d
        }), c[4] = d, c[5] = n) : n = c[5], c[6] !== i || c[7] !== n ? (s = (0, t.jsxs)("div", {
            className: "flex items-baseline gap-2",
            children: [i, n]
        }), c[6] = i, c[7] = n, c[8] = s) : s = c[8], c[9] !== m || c[10] !== u || c[11] !== p ? (o = !!u && !!m && (0, t.jsx)("span", {
            className: "text-sm font-medium text-text-secondary",
            children: p("portfolio.redeemAmount.sellingShares", {
                shares: u,
                avgPrice: m
            })
        }), c[9] = m, c[10] = u, c[11] = p, c[12] = o) : o = c[12], c[13] !== s || c[14] !== o ? (l = (0, t.jsxs)("div", {
            className: "flex flex-col gap-1 pb-4",
            children: [s, o]
        }), c[13] = s, c[14] = o, c[15] = l) : l = c[15], l
    }
    e.s(["RedeemAmount", 0, e_], 505300);
    let eT = () => {
        let e, i, n, ee, et, er, ea, ei, en, es, eo, el, ec, ed, eu, em, ep, eh, ef, ex = (0, r.c)(83),
            eg = (0, v.useTranslations)();
        ex[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], ex[0] = e) : e = ex[0];
        let {
            authenticated: ev
        } = (0, y.useAccountContext)(e);
        ex[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], ex[1] = i) : i = ex[1];
        let {
            activeMarket: ey
        } = (0, b.useEventActiveMarketContext)(i);
        ex[2] === Symbol.for("react.memo_cache_sentinel") ? (n = ["selectedOutcomeIdx", "side", "shouldShowSlippageWarning", "setShouldShowSlippageWarning"], ex[2] = n) : n = ex[2];
        let {
            selectedOutcomeIdx: eb,
            side: ek,
            shouldShowSlippageWarning: ew,
            setShouldShowSlippageWarning: eS
        } = (0, w.useTradeContext)(n);
        ex[3] === Symbol.for("react.memo_cache_sentinel") ? (ee = ["isSportsPage"], ex[3] = ee) : ee = ex[3];
        let {
            isSportsPage: ej
        } = (0, k.useSportsContext)(ee), {
            setTradeState: eT
        } = (0, o.useMobileTradeContext)(), {
            subPositions: eN,
            redemptionValueFormatted: eI
        } = (0, j.useMobileMarketPositionContext)(), {
            isNegRisk: eP
        } = (0, _.useSportsItemContext)(), {
            redeem: eE,
            orderCreationState: eA
        } = (() => {
            let e = (0, v.useTranslations)(),
                t = (0, V.useAmplitudeAnalytics)(),
                r = (0, E.useToast)(),
                i = a.default.useRef(null),
                n = a.default.useRef(null),
                {
                    authenticated: l,
                    authenticationType: c
                } = (0, y.useAccountContext)(["authenticated", "authenticationType"]),
                {
                    accountWalletPreferences: d
                } = (0, O.default)(),
                {
                    setHasClicked: u
                } = (0, o.useMobileTradeContext)(),
                {
                    market: m,
                    limitOrderPage: p,
                    setLimitOrderPage: h,
                    setOpen: f
                } = (0, s.useMobileMarketContext)(),
                {
                    onSubmitCustomExpiration: x
                } = eC(),
                {
                    chainId: g,
                    proxyAddress: b
                } = (0, N.useAccount)(),
                {
                    switchChainAsync: k
                } = (0, T.useSwitchChain)(),
                {
                    setOpen: j,
                    setConnectorRoute: C
                } = (0, I.useSiwx)(),
                {
                    setDisableErrorComponent: _
                } = (0, w.useTradeContext)(["setDisableErrorComponent"]),
                ee = (0, U.useGeoStore)(e => e.hasFetchedLocation),
                {
                    enqueueTransaction: et
                } = (0, W.useTransactionContext)(),
                er = (0, z.default)(),
                ea = (0, G.useTransactionStore)(),
                ei = (0, F.useInvalidatePositions)(),
                {
                    clob: en
                } = (0, H.useClobCredentialContext)(),
                {
                    areAllAllowancesApproved: es,
                    hasLoadedAllowances: eo,
                    isUpdatingAllowances: el
                } = (0, P.useAllowanceContext)(),
                [ec, ed] = a.default.useState("rest"),
                eu = a.default.useMemo(() => m.conditionId, [m.conditionId]),
                {
                    positions: em
                } = (0, D.default)({
                    conditionIds: [eu],
                    proxyAddress: b
                }),
                ep = (0, L.default)(eu),
                eh = a.default.useMemo(() => (em ? ? []).map(e => {
                    let t;
                    return t = ep.map(e => (0, S.parseUSDCUnits)(e.toFixed(6))), { ...e,
                        netQuantity: t ? .[Number(e ? .outcomeIndex)] ? .toString() ? ? e.netQuantity
                    }
                }), [em, ep]),
                ef = eh.reduce((e, t) => e + (0, Q.getCurrentValueOfPosition)(t), 0 n),
                ex = "magic" === c,
                eg = a.default.useCallback(async (...a) => {
                    let [s, o, v] = a;
                    if ("expiration" === p) {
                        x() && h("resting");
                        return
                    }
                    if (Y.logger.debug("[RedeemButton > onTap]", {
                            areAllAllowancesApproved: es,
                            authenticated: l,
                            authenticationType: c,
                            clob: en,
                            hasFetchedLocation: ee,
                            hasLoadedAllowances: eo,
                            isUpdatingAllowances: el,
                            proxyAddress: b
                        }), !l) {
                        let e = Date.now();
                        (0, q.markSignupPromptOpened)("trade", {
                            now: e,
                            route: "login"
                        }), t.trackEvent(B.Events.SignupPromptOpened, (0, q.getSignupPromptOpenedEventProperties)({
                            source: "trade",
                            route: "login"
                        })), f(!1), C(M.ConnectorRoute.LOGIN), j(!0)
                    }
                    u(!0), X.MATIC_CONFIG.chainId !== g && (ed("switching-networks"), await k({
                        chainId: X.MATIC_CONFIG.chainId
                    }));
                    try {
                        _(!0);
                        let t = [0 n, 0 n];
                        eh.length && eh.forEach(e => {
                            t[parseInt(e.outcomeIndex, 10)] = BigInt(e.netQuantity)
                        });
                        let a = (0, J.getRedeemPositionsTransaction)({
                                chainId: X.MATIC_CONFIG.chainId,
                                chainConfig: X.chainConfig,
                                conditionId: m.conditionId,
                                negRisk: !!m ? .negRisk,
                                outcomeCount: m.outcomes.length,
                                amounts: t
                            }),
                            l = (0, $.computeRedeemImpact)(ef);
                        if (ex && b) {
                            let t = (0, J.formatSyntheticRedeemTransaction)({
                                conditionId: m.conditionId,
                                amount: ef,
                                proxyAddress: b
                            });
                            n.current = t, await er(t, m), ei(b), r.success(new A.ToastBuilder().position({
                                side: "top"
                            }).title(e("portfolio.modals.redeem.claimProceeds")).description(m.question)), l.shareValue.some(e => e > .01) && v ? .(s, o), f(!1), _(!1), ed("rest"), (0, K.executeOptimisticCTFTransaction)({
                                syntheticTxn: t,
                                syntheticTxnRef: n,
                                transaction: a,
                                market: m,
                                txnType: R.CTFTxnType.Redeem,
                                outcome: "NA",
                                quantity: ef,
                                usdc: ef,
                                impact: l,
                                errorTag: "Redeem Shares (background)",
                                proxyAddress: b,
                                transactionStore: ea,
                                enqueueTransaction: et,
                                gasPreference: d ? .advancedMode ? d.gasPreference : null,
                                customGasPrice: d ? .advancedMode ? d.customGasPrice : null,
                                onFailure: () => r.error(new A.ToastBuilder().position({
                                    side: "top"
                                }).title(e("portfolio.messages.failedToRedeem")).description(e("comments.pleaseTryAgain")))
                            });
                            return
                        }
                        ed("submitting"), await et(a, X.Network.Matic, R.CTFTxnType.Redeem, "NA", ef, ef, m, l, d ? .advancedMode ? d.gasPreference : null, d ? .advancedMode ? d.customGasPrice : null, null, null, null, !1), ed("success"), l.shareValue.some(e => e > .01) && v ? .(s, o), i.current = setTimeout(() => {
                            f(!1), _(!1)
                        }, 2e3)
                    } catch (e) {
                        ed("rest"), _(!1), (0, Z.handleError)(e, "[BuySellWidget > BuySellButton > handleClick]", b)
                    }
                }, [p, t, es, l, c, en, ee, eo, el, b, u, g, x, h, f, C, j, k, eh, m, et, ef, d ? .advancedMode, d ? .gasPreference, d ? .customGasPrice, _, ex, er, ea, ei]);
            return a.default.useEffect(() => () => {
                i.current && clearTimeout(i.current)
            }, []), a.default.useMemo(() => ({
                redeem: eg,
                orderCreationState: ec,
                total: (0, S.formatToDollar)(parseFloat((0, S.formatUSDCUnits)(ef)))
            }), [eg, ec, ef])
        })(), {
            onTap: eO,
            disabled: eD,
            orderCreationState: eL
        } = (0, C.useMobileTransactionContext)(), ez = ey.closed ? eA : eL;
        if (ex[4] !== eb || ex[5] !== eN) {
            let e;
            ex[7] !== eb ? (e = e => e.sell.outcomeIdx === eb, ex[7] = eb, ex[8] = e) : e = ex[8], et = eN.find(e), ex[4] = eb, ex[5] = eN, ex[6] = et
        } else et = ex[6];
        let eR = et,
            eF = (0, m.usePrevious)(eR),
            e$ = eR ? ? eF,
            {
                usdcReceived: eB,
                averagePrice: eq
            } = (0, h.useMarketOrderDetail)();
        e: {
            let e, t = e$;
            if (ey.closed && eN) {
                let e, r;
                ex[9] !== ey.outcomePrices ? (e = ey.outcomePrices.findIndex(eM), ex[9] = ey.outcomePrices, ex[10] = e) : e = ex[10];
                let a = e;
                if (ex[11] !== eN || ex[12] !== a) {
                    let e;
                    ex[14] !== a ? (e = e => e.sell.outcomeIdx === a, ex[14] = a, ex[15] = e) : e = ex[15], r = eN.find(e), ex[11] = eN, ex[12] = a, ex[13] = r
                } else r = ex[13];
                let i = r;
                i && (t = i)
            }
            if (t) {
                let e, r, a, i = t ? .qty ? ? "0",
                    n = 100 * eq;
                ex[16] !== n ? (e = (0, S.formatNum)(n, {
                    decimals: 1,
                    optionalDecimals: !0,
                    commas: !1
                }), ex[16] = n, ex[17] = e) : e = ex[17];
                let s = `${e}\xa2`;
                ex[18] !== ey.closed || ex[19] !== eI || ex[20] !== eB ? (r = ey.closed && eI ? eI : (0, S.formatCurrency)(eB, {
                    decimals: 2
                }) ? ? "$0.00", ex[18] = ey.closed, ex[19] = eI, ex[20] = eB, ex[21] = r) : r = ex[21];
                let o = `${r}`;
                ex[22] !== o || ex[23] !== i || ex[24] !== s ? (a = {
                    shareQuantity: i,
                    averagePrice: s,
                    amountToReceive: o
                }, ex[22] = o, ex[23] = i, ex[24] = s, ex[25] = a) : a = ex[25], er = a;
                break e
            }
            ex[26] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                shareQuantity: "--",
                averagePrice: "--",
                amountToReceive: "--"
            }, ex[26] = e) : e = ex[26],
            er = e
        }
        let {
            shareQuantity: eV,
            averagePrice: eH,
            amountToReceive: eU
        } = er, eW = e$ ? .sell.outcome ? ? ("number" == typeof eb ? ey.outcomes[eb] : void 0) ? ? "", eG = e$ ? .outcomeDetail.icon ? ? ey.image;
        ex[27] !== eW ? (ea = (0, p.capitalize)(eW), ex[27] = eW, ex[28] = ea) : ea = ex[28];
        let eZ = `${ey.closed?"Redeem":"Sell"} ${ea}`,
            eK = ey.groupItemTitle ? ? void 0;
        if (ej) {
            if (eP) ey.negRiskSportsMarketType && "draw" !== ey.negRiskSportsMarketType && ey.team && (eG = ey.team.logo ? ? ey.icon);
            else if (ey.teams && ey.teams.length >= 2) {
                let e;
                ex[29] !== ey || ex[30] !== eb ? (e = (0, g.getTeam)({
                    market: ey,
                    outcomeIndex: eb
                }), ex[29] = ey, ex[30] = eb, ex[31] = e) : e = ex[31];
                let t = e;
                if (t) {
                    let e, r;
                    ex[32] !== ey || ex[33] !== eb ? (e = (0, g.getTeamLabelWithLine)({
                        market: ey,
                        outcomeIndex: eb,
                        variant: "alias"
                    }), ex[32] = ey, ex[33] = eb, ex[34] = e) : e = ex[34];
                    let a = e;
                    eG = t ? .logo ? ? ey.icon, ex[35] !== ek ? (r = (0, p.capitalize)(ek), ex[35] = ek, ex[36] = r) : r = ex[36], eZ = `${r} ${a}`;
                    let i = "";
                    "spreads" === ey.sportsMarketType && (i = "Spread: "), "totals" === ey.sportsMarketType && (i = "Total: "), eK = `${i}${ey.teams[0].alias??ey.teams[0].name} vs ${ey.teams[1].alias??ey.teams[1].name}`
                }
            }
        }
        ex[37] !== eZ || ex[38] !== eG || ex[39] !== eK ? (ei = {
            image: eG,
            heading: eZ,
            subheading: eK
        }, ex[37] = eZ, ex[38] = eG, ex[39] = eK, ex[40] = ei) : ei = ex[40];
        let {
            heading: eY,
            subheading: eQ
        } = ei;
        ex[41] !== eO ? (en = async (e, t) => {
            await eO(e, t)
        }, ex[41] = eO, ex[42] = en) : en = ex[42];
        let eX = en;
        ex[43] !== eO ? (es = async (e, t) => {
            await eO(e, t, void 0, !0)
        }, ex[43] = eO, ex[44] = es) : es = ex[44];
        let eJ = es;
        ex[45] !== eE ? (eo = async (e, t) => {
            await eE(e, t)
        }, ex[45] = eE, ex[46] = eo) : eo = ex[46];
        let e0 = eo;
        ex[47] !== eU || ex[48] !== ey.closed || ex[49] !== eg ? (el = ey.closed ? `${eg("trading.redeem")} ${eU}` : `${eg("trading.cashOut")} ${eU}`, ex[47] = eU, ex[48] = ey.closed, ex[49] = eg, ex[50] = el) : el = ex[50];
        let e1 = el,
            e2 = "rest" !== ez && "success" !== ez,
            e3 = ey.closed ? !ev || e2 : !!eD || e2;
        if (!e$) return null;
        if (ew && !ey.closed) {
            let e, r;
            return ex[51] !== eS ? (e = () => eS(!1), ex[51] = eS, ex[52] = e) : e = ex[52], ex[53] !== eJ || ex[54] !== e ? (r = (0, t.jsx)(f.default, {
                onConfirm: eJ,
                hideWarning: e
            }), ex[53] = eJ, ex[54] = e, ex[55] = r) : r = ex[55], r
        }
        ex[56] !== eY ? (ec = (0, t.jsx)(d.ModalHeader, {
            showClose: !1,
            children: (0, t.jsx)(d.ModalTitle, {
                children: eY
            })
        }), ex[56] = eY, ex[57] = ec) : ec = ex[57], ex[58] !== eQ ? (ed = eQ && (0, t.jsx)(d.ModalDescription, {
            children: eQ
        }), ex[58] = eQ, ex[59] = ed) : ed = ex[59];
        let e4 = ey.closed ? void 0 : eV,
            e5 = ey.closed ? void 0 : eH;
        ex[60] !== eU || ex[61] !== e4 || ex[62] !== e5 ? (eu = (0, t.jsx)(e_, {
            amount: eU,
            shares: e4,
            avgPrice: e5
        }), ex[60] = eU, ex[61] = e4, ex[62] = e5, ex[63] = eu) : eu = ex[63], ex[64] !== ey.closed || ex[65] !== ez || ex[66] !== eT || ex[67] !== eg ? (em = !ey.closed && (0, t.jsx)(c.Button, {
            variant: "outline",
            disabled: "rest" !== ez,
            onClick: () => {
                eT({
                    type: "trade",
                    side: l.Side.SELL,
                    orderType: x.OrderType.Market
                })
            },
            children: eg("trading.editOrder")
        }), ex[64] = ey.closed, ex[65] = ez, ex[66] = eT, ex[67] = eg, ex[68] = em) : em = ex[68];
        let e6 = "success" === ez,
            e9 = ey.closed ? e0 : eX;
        return ex[69] !== e1 || ex[70] !== e3 || ex[71] !== ez || ex[72] !== e6 || ex[73] !== e9 ? (ep = (0, t.jsx)("div", {
            className: "flex w-full overflow-hidden",
            children: (0, t.jsx)(u.AnimatedButton, {
                color: "blue",
                label: e1,
                orderCreationState: ez,
                disabled: e3,
                softDisable: e6,
                type: "button",
                onTap: e9,
                height: 44,
                shadowHeight: 0,
                hoverHeightOffset: 0,
                clickDampingOffset: 0,
                isThreeDee: !1
            })
        }), ex[69] = e1, ex[70] = e3, ex[71] = ez, ex[72] = e6, ex[73] = e9, ex[74] = ep) : ep = ex[74], ex[75] !== em || ex[76] !== ep ? (eh = (0, t.jsxs)(d.ModalFooter, {
            children: [em, ep]
        }), ex[75] = em, ex[76] = ep, ex[77] = eh) : eh = ex[77], ex[78] !== ec || ex[79] !== ed || ex[80] !== eu || ex[81] !== eh ? (ef = (0, t.jsxs)(t.Fragment, {
            children: [ec, ed, eu, eh]
        }), ex[78] = ec, ex[79] = ed, ex[80] = eu, ex[81] = eh, ex[82] = ef) : ef = ex[82], ef
    };

    function eM(e) {
        return parseFloat(e) > 0
    }

    function eN() {
        let e, a, l, c, d, u = (0, r.c)(9),
            {
                open: m,
                setOpen: p
            } = (0, s.useMobileMarketContext)(),
            {
                tradeType: h
            } = (0, o.useMobileTradeContext)(),
            {
                reset: f
            } = (0, n.useResetPointerEvents)();
        u[0] !== f || u[1] !== p ? (e = e => {
            p(e), e || f()
        }, u[0] = f, u[1] = p, u[2] = e) : e = u[2];
        let x = e,
            g = m && "redeem" === h;
        return u[3] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(i.Drawer.Overlay, {
            className: "fixed inset-0 z-[250] bg-black/40"
        }), u[3] = a) : a = u[3], u[4] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, t.jsx)("div", {
            className: "bg-muted mx-auto mt-4 h-1.5 w-12 shrink-0 rounded-full"
        }), u[4] = l) : l = u[4], u[5] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, t.jsxs)(i.Drawer.Portal, {
            children: [a, (0, t.jsxs)(i.Drawer.Content, {
                className: "bg-background fixed inset-x-0 bottom-0 z-[250] mt-24 flex max-h-[85vh] flex-col rounded-t-3xl border-t",
                children: [l, (0, t.jsx)("div", {
                    className: "flex flex-col gap-4 overflow-y-auto p-6",
                    children: (0, t.jsx)(eT, {})
                })]
            })]
        }), u[5] = c) : c = u[5], u[6] !== x || u[7] !== g ? (d = (0, t.jsx)(i.Drawer.Root, {
            shouldScaleBackground: !1,
            open: g,
            onOpenChange: x,
            repositionInputs: !1,
            children: c
        }), u[6] = x, u[7] = g, u[8] = d) : d = u[8], d
    }
    eT.displayName = "RedeemContent"
}, 336846, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(219469),
        a = e.i(215959),
        i = e.i(416340),
        n = e.i(85510);
    let s = [.26, .08, .25, 1],
        o = [.25, 1, .5, 1];
    e.s(["OrderContentAnimator", 0, function({
        contentKey: e,
        children: l,
        disableHeightAnimation: c = !1
    }) {
        let [d, u] = (0, n.useMeasure)(), m = i.default.useRef(0), p = i.default.useRef(e), [h, f] = i.default.useState(!1), x = i.default.useMemo(() => {
            let e = u.height,
                t = m.current;
            return t ? Math.min(Math.max(Math.abs(e - t) / 500, .22) + .1 * (e > t), .34) : .22
        }, [u.height]);
        i.default.useLayoutEffect(() => {
            p.current !== e && (m.current = u.height || m.current, f(!0)), p.current = e
        }, [e, u.height]);
        let g = i.default.useCallback(() => {
                f(!1), m.current = u.height
            }, [u.height]),
            v = c ? "auto" : h && (u.height || m.current) || "auto";
        return (0, t.jsx)(a.motion.div, {
            className: `w-full${h?" overflow-hidden":""}`,
            initial: {
                height: "auto"
            },
            animate: {
                height: v,
                transition: {
                    ease: o,
                    duration: c ? 0 : h && h ? .2025 : 0
                }
            },
            onAnimationComplete: g,
            children: (0, t.jsx)("div", {
                ref: d,
                children: (0, t.jsx)(r.AnimatePresence, {
                    initial: !1,
                    mode: "popLayout",
                    custom: e,
                    children: (0, t.jsx)(a.motion.div, {
                        className: "w-full",
                        initial: {
                            opacity: 0
                        },
                        animate: {
                            opacity: 1,
                            y: 0,
                            transition: {
                                duration: x,
                                ease: s,
                                delay: .1
                            }
                        },
                        exit: {
                            opacity: 0,
                            transition: {
                                duration: .1,
                                ease: s
                            }
                        },
                        children: l
                    }, e)
                })
            })
        })
    }])
}, 288576, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340);
    let i = a.default.createContext({});
    e.s(["TradeAnimationContextProvider", 0, e => {
        let n, s, o = (0, r.c)(6),
            {
                children: l
            } = e,
            [c, d] = a.default.useState(!1),
            [u, m] = a.default.useState(!1),
            p = a.default.useRef(null);
        o[0] !== u || o[1] !== c ? (n = {
            shakePrice: c,
            setShakePrice: d,
            shakeAmount: u,
            setShakeAmount: m,
            priceInputRef: p
        }, o[0] = u, o[1] = c, o[2] = n) : n = o[2];
        let h = n;
        return o[3] !== l || o[4] !== h ? (s = (0, t.jsx)(i.Provider, {
            value: h,
            children: l
        }), o[3] = l, o[4] = h, o[5] = s) : s = o[5], s
    }, "useTradeAnimationContext", 0, () => a.default.useContext(i)])
}, 754738, 389497, 373230, e => {
    "use strict";
    e.s(["SportsRedeemContent", () => ef], 754738);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(23128),
        i = e.i(417493),
        n = e.i(335032),
        s = e.i(416340),
        o = e.i(670118),
        l = e.i(86831),
        c = e.i(136273);
    let d = o.FormProvider,
        u = s.createContext({}),
        m = e => {
            let a, i, n, s, l = (0, r.c)(9);
            return l[0] !== e ? ({ ...a
            } = e, l[0] = e, l[1] = a) : a = l[1], l[2] !== a.name ? (i = {
                name: a.name
            }, l[2] = a.name, l[3] = i) : i = l[3], l[4] !== a ? (n = (0, t.jsx)(o.Controller, { ...a
            }), l[4] = a, l[5] = n) : n = l[5], l[6] !== i || l[7] !== n ? (s = (0, t.jsx)(u.Provider, {
                value: i,
                children: n
            }), l[6] = i, l[7] = n, l[8] = s) : s = l[8], s
        },
        p = () => {
            let e, t, a = (0, r.c)(11),
                i = s.useContext(u),
                n = s.useContext(h),
                {
                    getFieldState: l,
                    formState: c
                } = (0, o.useFormContext)();
            a[0] !== i.name || a[1] !== c || a[2] !== l ? (e = l(i.name, c), a[0] = i.name, a[1] = c, a[2] = l, a[3] = e) : e = a[3];
            let d = e;
            if (!i) throw Error("useFormField should be used within <FormField>");
            let {
                id: m
            } = n, p = `${m}-form-item`, f = `${m}-form-item-description`, x = `${m}-form-item-message`;
            return a[4] !== i.name || a[5] !== d || a[6] !== m || a[7] !== p || a[8] !== f || a[9] !== x ? (t = {
                id: m,
                name: i.name,
                formItemId: p,
                formDescriptionId: f,
                formMessageId: x,
                ...d
            }, a[4] = i.name, a[5] = d, a[6] = m, a[7] = p, a[8] = f, a[9] = x, a[10] = t) : t = a[10], t
        },
        h = s.createContext({});

    function f(e) {
        let a, i, n, o, c, d, u = (0, r.c)(13);
        u[0] !== e ? ({
            className: a,
            ...i
        } = e, u[0] = e, u[1] = a, u[2] = i) : (a = u[1], i = u[2]);
        let m = s.useId();
        return u[3] !== m ? (n = {
            id: m
        }, u[3] = m, u[4] = n) : n = u[4], u[5] !== a ? (o = (0, l.cn)("space-y-2", a), u[5] = a, u[6] = o) : o = u[6], u[7] !== i || u[8] !== o ? (c = (0, t.jsx)("div", {
            className: o,
            ...i
        }), u[7] = i, u[8] = o, u[9] = c) : c = u[9], u[10] !== n || u[11] !== c ? (d = (0, t.jsx)(h.Provider, {
            value: n,
            children: c
        }), u[10] = n, u[11] = c, u[12] = d) : d = u[12], d
    }

    function x(e) {
        let a, i, n, s, o = (0, r.c)(9);
        o[0] !== e ? ({
            className: a,
            ...i
        } = e, o[0] = e, o[1] = a, o[2] = i) : (a = o[1], i = o[2]);
        let {
            formItemId: d
        } = p();
        return o[3] !== a ? (n = (0, l.cn)(a), o[3] = a, o[4] = n) : n = o[4], o[5] !== d || o[6] !== i || o[7] !== n ? (s = (0, t.jsx)(c.Label, {
            className: n,
            htmlFor: d,
            ...i
        }), o[5] = d, o[6] = i, o[7] = n, o[8] = s) : s = o[8], s
    }

    function g(e) {
        let a, i, s = (0, r.c)(7);
        s[0] !== e ? ({ ...a
        } = e, s[0] = e, s[1] = a) : a = s[1];
        let {
            error: o,
            formItemId: l,
            formDescriptionId: c,
            formMessageId: d
        } = p(), u = o ? `${c} ${d}` : `${c}`, m = !!o;
        return s[2] !== l || s[3] !== a || s[4] !== u || s[5] !== m ? (i = (0, t.jsx)(n.Slot.Slot, {
            id: l,
            "aria-describedby": u,
            "aria-invalid": m,
            ...a
        }), s[2] = l, s[3] = a, s[4] = u, s[5] = m, s[6] = i) : i = s[6], i
    }
    var v = e.i(525962),
        y = e.i(254380),
        b = e.i(798631),
        k = e.i(810912),
        w = e.i(295038),
        S = e.i(605797),
        j = e.i(604777),
        C = e.i(870555),
        _ = e.i(294377),
        T = e.i(889029),
        M = e.i(140527),
        N = e.i(196593),
        I = e.i(573337),
        P = e.i(118818),
        E = e.i(909420),
        A = e.i(195453),
        O = e.i(450091);
    let D = ({
        markets: e,
        positions: t
    }) => {
        let r = e.reduce((e, t) => (e[t.conditionId] = t, e), {}),
            a = t.reduce((e, a) => {
                let i = r[a.market.id];
                if (i) {
                    let r = (0, O.getCurrentValueOfPosition)(a),
                        n = BigInt(a.netQuantity),
                        s = t.find(e => e.market.id === a.market.id && e.outcomeIndex !== a.outcomeIndex),
                        o = s ? BigInt(s ? .netQuantity) : 0 n,
                        l = 0 === parseInt(a.outcomeIndex, 10) ? [n, o] : [o, n];
                    e.push({ ...i,
                        value: r ? ? 0 n,
                        amounts: l
                    })
                }
                return e
            }, []).sort((e, t) => {
                let r = e.value,
                    a = t.value;
                return a === r ? 0 : a < r ? -1 : 1
            });
        return (0, A.uniqBy)(a, e => e.conditionId)
    };
    e.s(["formatMarketAndValue", 0, D], 389497);
    var L = e.i(269101),
        z = e.i(318594),
        R = e.i(93641),
        F = e.i(415013),
        $ = e.i(186897),
        B = e.i(134850),
        q = e.i(628684),
        V = e.i(635103),
        H = e.i(249792),
        U = e.i(606572),
        W = e.i(909576),
        G = e.i(67670),
        Z = e.i(460649),
        K = e.i(631503),
        Y = e.i(600326),
        Q = e.i(588110),
        X = e.i(510954),
        J = e.i(57096),
        ee = e.i(502980),
        et = e.i(343999),
        er = e.i(784521),
        ea = e.i(305457),
        ei = e.i(921807),
        en = e.i(113788),
        es = e.i(660006),
        eo = e.i(631222),
        el = e.i(423582),
        ec = e.i(504404);
    let ed = I.z.object({
        items: I.z.array(I.z.string()).min(1).refine(e => e.some(e => e), {
            message: "You have to select at least one item."
        })
    });
    var eu = e.i(204996),
        em = e.i(891685);

    function ep(e) {
        return (e.sportsMarketType ? ? "moneyline") === "moneyline"
    }
    let eh = e => {
            let a, i, n = (0, r.c)(7),
                {
                    marketSection: s
                } = e;
            if (n[0] !== s.market || n[1] !== s.positions) {
                let e;
                n[3] !== s.market ? (e = e => (0, t.jsxs)("div", {
                    className: (0, C.cn)("flex flex-row gap-2 items-center justify-between first:pt-1 not-first:mt-2", !e.isWinningOutcome && "opacity-50"),
                    children: [(0, t.jsx)(_.SportsPositionOutcomeChip, {
                        shareQuantity: e.quantity,
                        label: e.label,
                        outcomeIndex: e.outcomeIndex,
                        color: e.color,
                        uppercase: !1
                    }), (0, t.jsx)("p", {
                        className: "text-text text-sm font-medium",
                        children: e.value
                    })]
                }, `${s.market.conditionId}-${e.outcomeIndex}`), n[3] = s.market, n[4] = e) : e = n[4], a = s.positions.map(e), n[0] = s.market, n[1] = s.positions, n[2] = a
            } else a = n[2];
            return n[5] !== a ? (i = (0, t.jsx)("div", {
                className: "flex flex-col w-full h-fit",
                children: a
            }), n[5] = a, n[6] = i) : i = n[6], i
        },
        ef = ({
            variant: e,
            conditionIds: n
        }) => {
            let l = (0, j.useTranslations)(),
                {
                    positions: c
                } = (0, w.useSportsPositionContext)(),
                {
                    positions: u
                } = (0, S.useSportsItemPositions)(c),
                {
                    form: p,
                    sections: h,
                    onSubmit: C,
                    totalSelectedValue: _,
                    orderCreationState: I
                } = ((e, t, r) => {
                    let a = s.default.useRef([]),
                        {
                            updatePositions: i
                        } = (0, L.useEventPositionsContext)(["updatePositions"]),
                        {
                            setOpen: n
                        } = (0, P.useMobileMarketContext)(),
                        {
                            orderCreationState: l,
                            redeemMany: c
                        } = ((e, t) => {
                            let r = (0, j.useTranslations)(),
                                a = (0, H.useToast)(),
                                i = (0, z.useQueryClient)(),
                                n = (0, ea.useGoogleAnalytics)(),
                                {
                                    authenticated: o,
                                    authenticationType: l,
                                    proxyAddress: c,
                                    walletMode: d
                                } = (0, er.useAccountContext)(["authenticated", "authenticationType", "proxyAddress", "walletMode"]),
                                {
                                    refreshNonce: u
                                } = (0, q.useSafe)(),
                                {
                                    nonce: m,
                                    incrementNonce: p,
                                    refreshNonce: h
                                } = (0, V.useDepositWallet)(),
                                {
                                    sendTransaction: f
                                } = (0, K.default)(),
                                x = (0, Z.default)(),
                                g = (0, ei.useTransactionStore)(),
                                {
                                    setCashOutDialogOpen: v
                                } = (0, W.useCashOutTxContext)(),
                                [y, b] = s.default.useState("rest"),
                                k = s.default.useRef(null),
                                w = s.default.useRef(null),
                                S = s.default.useRef(null),
                                C = s.default.useRef(new Map),
                                {
                                    refetchMarketPositionsValue: _
                                } = (0, G.useMarketPositionsValue)(c),
                                T = s.default.useCallback(() => {
                                    i.invalidateQueries({
                                        queryKey: X.queryKeys[J.QueryKey.TokenBalance]._def
                                    }), i.invalidateQueries({
                                        queryKey: X.queryKeys[J.QueryKey.Positions].market._def
                                    }), i.invalidateQueries({
                                        queryKey: X.queryKeys[J.QueryKey.Positions].byIds._def
                                    }), _()
                                }, [_, i]),
                                [M, N] = s.default.useState(0),
                                [I, P] = s.default.useState(0),
                                E = s.default.useCallback(async i => {
                                    if (S.current && clearTimeout(S.current), w.current && clearTimeout(w.current), k.current && clearTimeout(k.current), !o) return (0, es.handleError)("[RedeemAll > Magiclink is null]", en.PolyError.MagicLinkMissing, c), {
                                        success: !1,
                                        errorCode: en.PolyError.MagicLinkMissing,
                                        errorMessage: "Could not access MagicLink wallet"
                                    };
                                    let {
                                        chainId: s
                                    } = eo.MATIC_CONFIG, y = "magic" === l, j = (i || []).map(e => ({
                                        txns: (0, ec.getRedeemPositionsTransaction)({
                                            chainId: s,
                                            chainConfig: eo.chainConfig,
                                            conditionId: e.conditionId,
                                            negRisk: e.negRisk,
                                            outcomeCount: e.outcomes ? .length ? ? 0,
                                            amounts: e.amounts
                                        }),
                                        market: e,
                                        metadata: {
                                            quantity: BigInt(e.value ? ? 0),
                                            positionChangeData: (0, ee.computeRedeemImpact)(BigInt(e.value ? ? 0))
                                        }
                                    }));
                                    if (P(j.length), y && c) {
                                        for (let {
                                                market: e
                                            } of (C.current.clear(), j)) {
                                            let t = (0, ec.formatSyntheticRedeemTransaction)({
                                                conditionId: e.conditionId,
                                                amount: BigInt(e.value ? ? 0),
                                                proxyAddress: c
                                            });
                                            C.current.set(e.conditionId, t), await x(t, e)
                                        }
                                        a.success(new U.ToastBuilder().position({
                                            side: "top"
                                        }).title(r("portfolio.modals.redeem.claimProceeds")));
                                        let i = {
                                            success: !0
                                        };
                                        v(!1), e ? .(i), t ? .(i), b("rest");
                                        let s = (0, R.chunk)(j, Q.numberOfTxnsPerBundle);
                                        return (async () => {
                                            for (let [e, t] of s.entries()) {
                                                let i = null;
                                                for (let r = 0; r < 2; r++) try {
                                                    let r = Date.now(),
                                                        a = (0, K.getTransactionType)(d),
                                                        o = await f(a, t.flatMap(e => e.txns), 0, eo.Network.Matic, e, void 0, a === K.TransactionType.DepositWallet ? m : void 0, void 0, a === K.TransactionType.DepositWallet ? c : void 0);
                                                    if (a === K.TransactionType.DepositWallet && await p(), !o) throw Error("Transaction response is null.");
                                                    let l = !o.hash;
                                                    l && await (0, el.waitTillMined)(o);
                                                    let {
                                                        chainId: u
                                                    } = eo.MATIC_CONFIG;
                                                    for (let {
                                                            txns: e,
                                                            market: a,
                                                            metadata: i
                                                        } of t) {
                                                        let t = (0, F.keccak256)((0, $.toHex)(c + a.conditionId + r)),
                                                            n = new et.CTFTxnBuilder(t, l ? Y.TxnStatus.MINED : Y.TxnStatus.PENDING).metadata({
                                                                txns: e,
                                                                chainId: u,
                                                                outcome: "NA",
                                                                outcomeIndex: -1,
                                                                usdc: i.quantity,
                                                                enqueuedAt: r,
                                                                lastUpdatedAt: r,
                                                                ctfTxnType: Y.CTFTxnType.Redeem,
                                                                hash: o.hash,
                                                                ...i
                                                            }).conditionId(a.conditionId).build();
                                                        await x(n, a);
                                                        let s = C.current.get(a.conditionId);
                                                        if (s) {
                                                            try {
                                                                g.removeTransaction(c, eo.MATIC_CONFIG.chainId, s.txId, !0)
                                                            } catch {}
                                                            C.current.delete(a.conditionId)
                                                        }
                                                    }
                                                    n.trackEvent(B.GAEventAction.TRANSACTION, {
                                                        trade_type: "redeem_all",
                                                        trade_status: `${e+1}_${s.length}`,
                                                        event_status: "success"
                                                    }), i = null;
                                                    break
                                                } catch (e) {
                                                    i = e
                                                }
                                                if (i) {
                                                    let t = i;
                                                    for (let r of ((0, es.handleError)(t, "Redeem All Shares", c, es.BUG_CATEGORIES.MISSION_CRITICAL), s.slice(e)))
                                                        for (let {
                                                                market: e
                                                            } of r) {
                                                            let t = C.current.get(e.conditionId);
                                                            t && (g.handleFailedTransaction(c, eo.MATIC_CONFIG.chainId, t, e), C.current.delete(e.conditionId))
                                                        }
                                                    a.error(new U.ToastBuilder().position({
                                                        side: "top"
                                                    }).title(r("portfolio.messages.failedToRedeem")).description(r("comments.pleaseTryAgain"))), n.trackEvent(B.GAEventAction.TRANSACTION, {
                                                        trade_type: "redeem_all",
                                                        trade_status: `${e+1}_${s.length}`,
                                                        event_status: "error",
                                                        event_error_msg: t.message || JSON.stringify(t)
                                                    });
                                                    break
                                                }
                                            }
                                            C.current.clear(), (0, K.getTransactionType)(d) === K.TransactionType.DepositWallet ? h() : u(), T()
                                        })(), i
                                    }
                                    b("submitting");
                                    let _ = (0, R.chunk)(j, Q.numberOfTxnsPerBundle),
                                        M = [];
                                    for await (let [e, t] of _.entries()) try {
                                        N(e => e + t.length);
                                        let r = (0, K.getTransactionType)(d),
                                            a = await f(r, t.flatMap(e => e.txns), 0, eo.Network.Matic, e, void 0, r === K.TransactionType.DepositWallet ? m : void 0, K.TransactionMetadata.Redeem.valueOf(), r === K.TransactionType.DepositWallet ? c : void 0);
                                        r === K.TransactionType.DepositWallet && await p(), M.push((0, el.waitTillMined)(a)), n.trackEvent(B.GAEventAction.TRANSACTION, {
                                            trade_type: "redeem_all",
                                            trade_status: `${e+1}_${_.length}`,
                                            event_status: "success"
                                        })
                                    } catch (t) {
                                        return (0, K.getTransactionType)(d) === K.TransactionType.DepositWallet && h(), (0, es.handleError)(t, "Redeem All Shares", c, es.BUG_CATEGORIES.MISSION_CRITICAL), n.trackEvent(B.GAEventAction.TRANSACTION, {
                                            trade_type: "redeem_all",
                                            trade_status: `${e+1}_${_.length}`,
                                            event_status: "error",
                                            event_error_msg: t.message || t.error || JSON.stringify(t)
                                        }), b("rest"), {
                                            success: !1,
                                            errorMessage: t.message || t.error || JSON.stringify(t)
                                        }
                                    }
                                    await Promise.all(M), (0, K.getTransactionType)(d) === K.TransactionType.DepositWallet ? h() : u(), T(), b("success");
                                    let I = {
                                        success: !0
                                    };
                                    return w.current = setTimeout(() => {
                                        v(!1), e ? .(I)
                                    }, 1e3), S.current = setTimeout(() => {
                                        t ? .(I)
                                    }, 1400), k.current = setTimeout(() => {
                                        b("rest")
                                    }, 2e3), I
                                }, [o, l, d, c, u, h, m, p, f, x, g, v, b, T, t, e, r, a]);
                            return s.default.useMemo(() => ({
                                redeemMany: E,
                                orderCreationState: y
                            }), [E, y])
                        })(s.default.useCallback(e => {
                            n ? .(!1)
                        }, [n]), s.default.useCallback(e => {
                            let t = a.current;
                            e.success && t ? .length && i(t.map(e => ({ ...e,
                                netQuantity: "0",
                                netValue: "0",
                                ...e.trackedPositionMetadata && {
                                    trackedPositionMetadata: { ...e.trackedPositionMetadata,
                                        netQuantity: {
                                            current: 0,
                                            optimistic: 0,
                                            pending: 0
                                        }
                                    }
                                }
                            })))
                        }, [a, i])),
                        d = s.default.useMemo(() => e.filter(e => !!e.market.closed), [e]),
                        {
                            defaultValues: u
                        } = s.default.useMemo(() => "injected" === t && r ? .length ? {
                            defaultValues: {
                                items: [...new Set(d.map(e => e.rawPosition.market.id.toLowerCase()).filter(e => r.includes(e)))]
                            }
                        } : "all" === t ? {
                            defaultValues: {
                                items: [...new Set(d.map(e => e.rawPosition.market.id.toLowerCase()))]
                            }
                        } : {
                            defaultValues: {
                                items: [...new Set(d.filter(e => (e.market.sportsMarketType ? ? "moneyline") === t).map(e => e.rawPosition.market.id.toLowerCase()))]
                            }
                        }, [d, t, r]),
                        m = (0, o.useForm)({
                            resolver: (0, T.zodResolver)(ed),
                            defaultValues: u
                        }),
                        p = m.watch(),
                        {
                            sections: h,
                            positionMap: f,
                            totalValue: x
                        } = s.default.useMemo(() => {
                            let e;
                            return {
                                sections: Object.values((e = d.reduce((e, t) => {
                                    let r, a, i, n, s, o, {
                                            sportsMarketType: l = "moneyline"
                                        } = t.market,
                                        {
                                            label: c,
                                            quantity: d,
                                            value: u,
                                            valueNumber: m,
                                            color: p,
                                            isWinningOutcome: h
                                        } = (r = (({
                                            market: e
                                        }) => +("1" !== e.outcomePrices[0]))({
                                            market: t.market
                                        }) === t.outcomeIndex, i = (a = parseFloat(t.position.qty)) > 10 ? (0, N.formatToShares)(a) : (0, N.formatToDecimal)(a, 2), n = r ? (0, N.formatToDollar)(a, {
                                            minimumFractionDigits: 0,
                                            maximumFractionDigits: 0
                                        }) : "$0", s = r ? parseFloat(t.position.qty) : 0, o = (0, E.getTeamLabelWithLine)({
                                            market: t.market,
                                            outcomeIndex: t.outcomeIndex,
                                            variant: "abbreviation"
                                        }), t.isNegRisk && (o = ("draw" === t.market.negRiskSportsMarketType ? "Draw" : t.market.team ? t.market.team.alias ? ? t.market.team.name : t.market.groupItemTitle ? ? t.market.question) + ` - ${0===t.outcomeIndex?"Yes":"No"}`), {
                                            label: o,
                                            quantity: i,
                                            value: n,
                                            valueNumber: s,
                                            color: (({
                                                position: e
                                            }) => e.market.negRisk || "totals" === e.market.sportsMarketType || "nrfi" === e.market.sportsMarketType || "both_teams_to_score" === e.market.sportsMarketType ? 0 === e.outcomeIndex ? "green" : "red" : e.market.teams && 2 === e.market.teams.length ? e.market.teams[e.outcomeIndex].color : void 0)({
                                                position: t
                                            }),
                                            isWinningOutcome: r
                                        });
                                    if (e.positionMap[t.market.conditionId] ? h ? e.positionMap[t.market.conditionId].unshift(t) : e.positionMap[t.market.conditionId].push(t) : e.positionMap[t.market.conditionId] = [t], !e.sections[l]) {
                                        let t = "both_teams_to_score" === l ? "Both Teams to Score" : "nrfi" === l ? "NRFI" : (0, M.capitalize)(l);
                                        e.sections[l] = {
                                            marketType: t,
                                            markets: {}
                                        }
                                    }
                                    if (e.sections[l]) {
                                        if (h && (e.total += m), !e.sections[l] ? .markets ? .[t.market.slug]) return e.sections[l].markets[t.market.slug] = {
                                            market: t.market,
                                            label: (({
                                                market: e
                                            }) => {
                                                if (e.negRisk) return "draw" === e.negRiskSportsMarketType ? "Draw" : e.team ? e.team.alias ? ? e.team.name : e.groupItemTitle ? ? e.question;
                                                let {
                                                    sportsMarketType: t = "moneyline"
                                                } = e;
                                                return ("spreads" === t || "first_half_spreads" === t) && e.line ? `\xb1${e.line}` : ("totals" === t || "first_half_totals" === t || "first_innings_totals" === t || "second_innings_totals" === t) && e.line ? `${e.line}` : "nrfi" === t ? "Will there be a run in the first inning?" : "both_teams_to_score" === t ? "Both Teams to Score?" : "Moneyline"
                                            })({
                                                market: t.market
                                            }),
                                            valueNumber: m,
                                            value: (0, N.formatToDollar)(m),
                                            positions: [{
                                                quantity: d,
                                                value: u,
                                                valueNumber: m,
                                                isWinningOutcome: h,
                                                label: c,
                                                color: p,
                                                outcomeIndex: t.outcomeIndex
                                            }]
                                        }, e;
                                        let r = {
                                            quantity: d,
                                            value: u,
                                            valueNumber: m,
                                            isWinningOutcome: h,
                                            label: c,
                                            color: p,
                                            outcomeIndex: t.outcomeIndex
                                        };
                                        h ? e.sections[l].markets[t.market.slug].positions.unshift(r) : e.sections[l].markets[t.market.slug].positions.push(r);
                                        let a = e.sections[l].markets[t.market.slug].positions.reduce((e, t) => t.isWinningOutcome ? e + t.valueNumber : e, 0);
                                        e.sections[l].markets[t.market.slug].value = (0, N.formatToDollar)(a), e.sections[l].markets[t.market.slug].valueNumber = a
                                    }
                                    return e
                                }, {
                                    sections: {},
                                    positionMap: {},
                                    total: 0
                                })).sections).map(e => {
                                    let {
                                        markets: t,
                                        ...r
                                    } = e;
                                    return { ...r,
                                        markets: Object.values(t)
                                    }
                                }),
                                positionMap: e.positionMap,
                                totalValue: (0, N.formatToDollar)(e.total)
                            }
                        }, [d]),
                        g = s.default.useMemo(() => (({
                            formValues: e,
                            positionMap: t
                        }) => parseFloat(e.items.reduce((e, r) => {
                            let a = t[r];
                            return Array.isArray(a) && a.length ? e + a.reduce((e, t) => "1" !== t.market.outcomePrices[t.outcomeIndex] ? e : e + parseFloat(t.position.qty), 0) : e
                        }, 0).toFixed(2)))({
                            formValues: p,
                            positionMap: f
                        }), [p, f]),
                        v = s.default.useCallback(async e => {
                            let t = (({
                                positions: e,
                                conditionIds: t
                            }) => {
                                let {
                                    markets: r,
                                    positions: a
                                } = e.reduce((e, r) => (e.markets[r.market.conditionId] || (e.markets[r.market.conditionId] = r.market), t.includes(r.market.conditionId) && e.positions.push(r.rawPosition), e), {
                                    markets: {},
                                    positions: []
                                });
                                return D({
                                    markets: Object.values(r),
                                    positions: a
                                })
                            })({
                                positions: d,
                                conditionIds: e.items
                            });
                            a.current = d.filter(t => e.items.includes(t.market.conditionId)).map(e => e.rawPosition), await c(t)
                        }, [d, c]);
                    return s.default.useMemo(() => ({
                        form: m,
                        sections: h,
                        onSubmit: v,
                        totalSelectedValue: g,
                        totalValue: x,
                        orderCreationState: l
                    }), [m, h, v, g, x, l])
                })(u, e, n),
                {
                    title: A,
                    subtitle: O
                } = (() => {
                    let e, t, a = (0, r.c)(21),
                        i = (0, j.useTranslations)();
                    a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], a[0] = e) : e = a[0];
                    let {
                        event: n
                    } = (0, em.useEventContext)(e);
                    if (a[1] !== n.markets || a[2] !== n.negRisk || a[3] !== n.title || a[4] !== i) {
                        e: {
                            let e, r, s = n.title,
                                o = n.markets.filter(ep);
                            if (n.negRisk && 3 === o.length) {
                                let e, r, [n, , l] = o,
                                    c = n.team,
                                    d = l.team;
                                c && d && (s = `${(0,eu.upperCase)(c.abbreviation)}`, c.alias && (s += ` ${c.alias}`), s += ` vs. ${(0,eu.upperCase)(d.abbreviation)}`, d.alias && (s += ` ${d.alias}`)), a[6] !== i ? (e = i("trading.cashOut"), a[6] = i, a[7] = e) : e = a[7], a[8] !== s || a[9] !== e ? (r = {
                                    title: e,
                                    subtitle: s
                                }, a[8] = s, a[9] = e, a[10] = r) : r = a[10], t = r;
                                break e
                            }
                            if (!n.negRisk && 1 === o.length) {
                                let e, r, n, l;
                                o[0].teams && 2 === o[0].teams.length && ([e, r] = o[0].teams, s = `${(0,eu.upperCase)(e.abbreviation)}`, e.alias && (s += ` ${e.alias}`), s += ` vs. ${(0,eu.upperCase)(r.abbreviation)}`, r.alias && (s += ` ${r.alias}`)), a[11] !== i ? (n = i("trading.cashOut"), a[11] = i, a[12] = n) : n = a[12], a[13] !== s || a[14] !== n ? (l = {
                                    title: n,
                                    subtitle: s
                                }, a[13] = s, a[14] = n, a[15] = l) : l = a[15], t = l;
                                break e
                            }
                            a[16] !== i ? (e = i("trading.cashOut"), a[16] = i, a[17] = e) : e = a[17],
                            a[18] !== s || a[19] !== e ? (r = {
                                title: e,
                                subtitle: s
                            }, a[18] = s, a[19] = e, a[20] = r) : r = a[20],
                            t = r
                        }
                        a[1] = n.markets,
                        a[2] = n.negRisk,
                        a[3] = n.title,
                        a[4] = i,
                        a[5] = t
                    }
                    else t = a[5];
                    return t
                })(),
                {
                    isValid: ef
                } = p.formState,
                ex = s.default.useMemo(() => "success" === I ? l("trading.cashedOut") : "submitting" === I ? l("trading.cashingOut") : l("trading.cashOut"), [I]),
                eg = s.default.useRef(null);
            return (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)(v.ModalHeader, {
                    children: (0, t.jsx)(v.ModalTitle, {
                        children: A
                    })
                }), (0, t.jsx)(v.ModalDescription, {
                    children: O
                }), (0, t.jsx)(d, { ...p,
                    children: (0, t.jsxs)("form", {
                        onSubmit: p.handleSubmit(C),
                        className: "flex flex-col gap-4",
                        children: [(0, t.jsx)(y.ScrollContainer, {
                            orientation: "vertical",
                            containerRef: eg,
                            className: "overflow-y-auto max-h-[45vh] px-6",
                            wrapperClassName: "-mx-6",
                            children: (0, t.jsx)(m, {
                                control: p.control,
                                name: "items",
                                render: () => (0, t.jsx)(f, {
                                    className: "w-full",
                                    children: h.map(e => (0, t.jsxs)("div", {
                                        className: "flex flex-col gap-2 w-full",
                                        children: [(0, t.jsx)("div", {
                                            className: "flex w-full h-[40px] bg-neutral-50 items-center px-3 rounded-md",
                                            children: (0, t.jsx)("p", {
                                                className: "text-text text-sm font-medium",
                                                children: e.marketType
                                            })
                                        }), (0, t.jsx)(k.Accordion.Root, {
                                            type: "single",
                                            collapsible: !0,
                                            className: "flex flex-col gap-2",
                                            children: e.markets.map(e => (0, t.jsx)(m, {
                                                control: p.control,
                                                name: "items",
                                                render: ({
                                                    field: r
                                                }) => (0, t.jsx)(f, {
                                                    className: "flex w-full flex-row gap-2 justify-between items-center",
                                                    children: (0, t.jsxs)(k.Accordion.Item, {
                                                        value: e.market.conditionId,
                                                        className: "w-full",
                                                        children: [(0, t.jsxs)("div", {
                                                            className: "h-[26px] flex flex-row gap-2 items-center w-full",
                                                            children: [(0, t.jsx)(g, {
                                                                children: (0, t.jsx)(i.Checkbox, {
                                                                    checked: r.value ? .includes(e.market.conditionId),
                                                                    onCheckedChange: t => t ? r.onChange([...r.value, e.market.conditionId]) : r.onChange(r.value ? .filter(t => t !== e.market.conditionId)),
                                                                    className: "cursor-pointer"
                                                                })
                                                            }), (0, t.jsx)(x, {
                                                                className: "flex flex-1 cursor-pointer",
                                                                children: (0, t.jsxs)("span", {
                                                                    className: "flex w-full justify-between items-center",
                                                                    children: [(0, t.jsx)("span", {
                                                                        children: e.label
                                                                    }), (0, t.jsx)("div", {
                                                                        className: "flex flex-row gap-2 items-center",
                                                                        children: (0, t.jsx)("p", {
                                                                            className: "text-text text-sm font-medium",
                                                                            children: e.value
                                                                        })
                                                                    })]
                                                                })
                                                            }), (0, t.jsx)(k.Accordion.Trigger, {
                                                                className: "flex outline-none w-[26px] h-[26px] items-center justify-center bg-neutral-50 rounded-md [&_polyline]:stroke-[2.6px] [&_polyline]:!important data-[state=open]:[&_svg]:rotate-180 [&_svg]:transition-[transform_0.2s_ease-in-out] cursor-pointer hover:bg-neutral-100 dark:hover:bg-neutral-200 transition-colors",
                                                                children: (0, t.jsx)(b.IconChevronDownOutline12, {})
                                                            })]
                                                        }), (0, t.jsx)(k.Accordion.Content, {
                                                            className: "data-[state=closed]:animate-accordionSlideUp data-[state=open]:animate-accordionSlideDown overflow-hidden",
                                                            children: (0, t.jsx)(eh, {
                                                                marketSection: e
                                                            })
                                                        })]
                                                    })
                                                }, e.market.conditionId)
                                            }, e.market.conditionId))
                                        })]
                                    }, e.marketType))
                                })
                            })
                        }), (0, t.jsx)(v.ModalFooter, {
                            children: (0, t.jsxs)(a.Button, {
                                type: "submit",
                                disabled: !ef || "rest" !== I && "success" !== I,
                                children: [ex, " $", _.toFixed(2)]
                            })
                        })]
                    })
                })]
            })
        };
    ef.displayName = "SportsRedeemContent", e.s(["TradeError", () => eT], 373230);
    var ex = e.i(219469),
        eg = e.i(215959),
        ev = e.i(197994);
    let ey = ({ ...e
    }) => s.default.createElement(ev.Icon, {
        size: "18px",
        ...e
    }, s.default.createElement("path", {
        d: "M16.4364 12.5151L11.0101 3.11316C10.5902 2.39096 9.83872 1.96045 8.99982 1.96045C8.16092 1.96045 7.40952 2.39106 6.98952 3.11316C6.98902 3.11366 6.98902 3.11473 6.98852 3.11523L1.56272 12.5156C1.14332 13.2436 1.14332 14.1128 1.56372 14.8398C1.98362 15.5664 2.73562 16 3.57492 16H14.4245C15.2639 16 16.0158 15.5664 16.4357 14.8398C16.8561 14.1127 16.8563 13.2436 16.4364 12.5151ZM8.24992 6.75C8.24992 6.3359 8.58582 6 8.99992 6C9.41402 6 9.74992 6.3359 9.74992 6.75V9.75C9.74992 10.1641 9.41402 10.5 8.99992 10.5C8.58582 10.5 8.24992 10.1641 8.24992 9.75V6.75ZM8.99992 13.5C8.44792 13.5 7.99992 13.0498 7.99992 12.5C7.99992 11.9502 8.44792 11.5 8.99992 11.5C9.55192 11.5 9.99992 11.9502 9.99992 12.5C9.99992 13.0498 9.55192 13.5 8.99992 13.5Z",
        fill: "currentColor"
    }));
    var eb = e.i(97594),
        ek = e.i(458164),
        ew = e.i(879756),
        eS = e.i(288576),
        ej = e.i(507909),
        eC = e.i(880809);
    let e_ = {
        hidden: {
            height: 0,
            overflow: "hidden",
            opacity: 0,
            transition: { ...ej.transition,
                opacity: { ...ej.opacityTransition
                }
            }
        },
        visible: {
            height: "auto",
            overflow: "visible",
            opacity: 1,
            transition: { ...ej.transition,
                opacity: {
                    ease: ej.opacityTransition.ease,
                    duration: .25
                }
            }
        }
    };

    function eT(e) {
        let a, i, n, o, l, c, d, u = (0, r.c)(19);
        u[0] !== e ? ({
            variant: n,
            className: a,
            ...i
        } = e, u[0] = e, u[1] = a, u[2] = i, u[3] = n) : (a = u[1], i = u[2], n = u[3]);
        let m = void 0 === n ? "desktop" : n,
            p = (e => {
                let t, a, i = (0, r.c)(6);
                i[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["hasClicked", "disableErrorComponent"], i[0] = t) : t = i[0];
                let {
                    hasClicked: n,
                    disableErrorComponent: s
                } = (0, eC.useTradeContext)(t), {
                    hasClicked: o
                } = (0, ew.useMobileTradeContext)(), {
                    orderError: l
                } = (0, eb.useOrderValidation)(), c = "desktop" === e ? !!n : !!o;
                return i[1] !== s || i[2] !== c || i[3] !== l || i[4] !== e ? (a = (({
                    variant: e,
                    hasClicked: t,
                    orderError: r,
                    disableErrorComponent: a
                }) => !a && t && r && ("mobile" === e && r.message || "desktop" === e && r.invalid) ? {
                    canRender: !0,
                    error: r.message,
                    field: r.field
                } : {
                    canRender: !1
                })({
                    variant: e,
                    hasClicked: c,
                    orderError: l,
                    disableErrorComponent: s
                }), i[1] = s, i[2] = c, i[3] = l, i[4] = e, i[5] = a) : a = i[5], a
            })(m),
            {
                setShakeAmount: h,
                setShakePrice: f
            } = (0, eS.useTradeAnimationContext)();
        return u[4] !== p.canRender || u[5] !== p.field || u[6] !== h || u[7] !== f ? (o = () => {
            p.canRender && p.field === ek.OrderErrorField.PRICE && f(!0), p.canRender && p.field === ek.OrderErrorField.SHARES && h(!0)
        }, u[4] = p.canRender, u[5] = p.field, u[6] = h, u[7] = f, u[8] = o) : o = u[8], u[9] !== p.canRender ? (l = [p.canRender], u[9] = p.canRender, u[10] = l) : l = u[10], s.default.useEffect(o, l), u[11] !== a || u[12] !== p.canRender || u[13] !== p.error || u[14] !== i || u[15] !== m ? (c = p.canRender && (0, t.jsx)(eg.motion.div, {
            className: (0, C.cn)("size-full", a),
            variants: e_,
            initial: "hidden",
            animate: "visible",
            exit: "hidden",
            ...i,
            children: (0, t.jsx)("div", {
                className: (0, C.cn)("flex w-full justify-center", "desktop" === m && "pt-5", "mobile" === m && "py-5 px-4"),
                children: (0, t.jsxs)("div", {
                    className: "grid grid-cols-[auto_1fr] items-center gap-1.5",
                    children: [(0, t.jsx)(ey, {
                        className: "text-amber-500",
                        size: 16
                    }), (0, t.jsx)("p", {
                        className: "text-xs font-medium text-amber-500 leading-4 line-clamp-3",
                        children: p.error
                    })]
                })
            })
        }), u[11] = a, u[12] = p.canRender, u[13] = p.error, u[14] = i, u[15] = m, u[16] = c) : c = u[16], u[17] !== c ? (d = (0, t.jsx)("div", {
            children: (0, t.jsx)(ex.AnimatePresence, {
                initial: !1,
                mode: "sync",
                children: c
            })
        }), u[17] = c, u[18] = d) : d = u[18], d
    }
}, 797159, 605325, e => {
    "use strict";
    e.s(["useOnBlur", () => i], 797159);
    var t = e.i(999061),
        r = e.i(416340),
        a = e.i(118818);
    let i = () => {
        let e, i, n, s = (0, t.c)(4),
            o = r.default.useRef(null),
            l = r.default.useRef(null),
            {
                tradeDrawerRef: c
            } = (0, a.useMobileMarketContext)();
        return s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = () => () => {
            o.current && clearTimeout(o.current), l.current && clearTimeout(l.current)
        }, i = [], s[0] = e, s[1] = i) : (e = s[0], i = s[1]), r.default.useEffect(e, i), s[2] !== c ? (n = e => {
            let t = () => {
                c ? .current ? .style.height && c.current.style.setProperty("height", null)
            };
            o.current && clearTimeout(o.current), l.current && clearTimeout(l.current), o.current = setTimeout(t, 300), l.current = setTimeout(t, 1e3)
        }, s[2] = c, s[3] = n) : n = s[3], n
    };
    e.s(["usePriceMask", () => f], 605325);
    var n = e.i(328113),
        s = e.i(399336),
        o = e.i(880809),
        l = e.i(156591);
    e.i(311091);
    var c = e.i(926387);
    let d = {
            mask: Number,
            min: .1,
            max: 99.9,
            scale: 1,
            radix: ".",
            mapToRadix: ["."],
            lazy: !0,
            prepare: (e, t) => "" === t._value && ("0" === e || "." === e) ? "0." : "0" === e && "0" === t._value ? "" : e && "." !== e && !t._value.includes(".") && 2 === t._value.length ? `.${e}` : e
        },
        u = {
            mask: Number,
            min: 0,
            max: 99,
            scale: 0,
            lazy: !0,
            prepare: (e, t) => "" === t._value && "0" === e ? "" : e
        };

    function m({
        curr: e,
        prev: t,
        direction: r,
        precision: a
    }) {
        if (e === t) {
            if ("increment" === r && (2 === a && void 0 !== t && t >= 99 || 3 === a && void 0 !== t && t >= 99.9)) return "error";
            if ("decrement" === r && (2 === a && void 0 !== t && t <= 1 || 3 === a && void 0 !== t && t <= .1)) return "noop"
        } else if ("decrement" === r && 0 === e) return "clear";
        return "success"
    }
    var p = e.i(879756),
        h = e.i(900519);

    function f() {
        let e, a, i, f, x, g, v, y, b, k = (0, t.c)(32);
        k[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], k[0] = e) : e = k[0];
        let {
            activeMarket: w
        } = (0, s.useEventActiveMarketContext)(e), {
            orderPriceMinTickSize: S
        } = w;
        k[1] === Symbol.for("react.memo_cache_sentinel") ? (a = ["price", "setPrice", "setPriceUpdateLocation", "priceUpdateLocation", "setHasClicked"], k[1] = a) : a = k[1];
        let {
            price: j,
            setPrice: C,
            setPriceUpdateLocation: _,
            priceUpdateLocation: T,
            setHasClicked: M
        } = (0, o.useTradeContext)(a), {
            setHasClicked: N
        } = (0, p.useMobileTradeContext)(), I = S ? ? .01;
        k[2] !== I ? (i = (0, l.getPrecisionFromTickSize)(I), k[2] = I, k[3] = i) : i = k[3];
        let P = i,
            E = r.default.useRef(!1),
            A = (0, n.useLatest)(P);
        k[4] !== A || k[5] !== M || k[6] !== N || k[7] !== C ? (f = e => {
            if (E.current) {
                E.current = !1;
                return
            }
            if (M(!1), N ? .(!1), !e) return void C("");
            let t = parseFloat(e.replace(/[^\d.]/g, "")) || 0;
            C((0, h.padValue)({
                value: `${t}`,
                precision: A.current ? ? 2
            }))
        }, k[4] = A, k[5] = M, k[6] = N, k[7] = C, k[8] = f) : f = k[8];
        let O = f;
        k[9] !== P || k[10] !== j ? (x = () => j ? (0, h.unpadValue)({
            value: j,
            precision: P
        }).toString() : void 0, k[9] = P, k[10] = j, k[11] = x) : x = k[11];
        let [D] = r.default.useState(x);
        k[12] !== D || k[13] !== O ? (g = {
            onAccept: O,
            defaultValue: D
        }, k[12] = D, k[13] = O, k[14] = g) : g = k[14];
        let {
            ref: L,
            value: z,
            unmaskedValue: R,
            setValue: F,
            updateValue: $,
            maskRef: B
        } = function(e, t) {
            let a = r.default.useRef(null),
                i = e >= .01 ? 2 : e >= .001 ? 3 : 4,
                n = r.default.useRef(t ? .onAccept);
            n.current = t ? .onAccept;
            let s = r.default.useMemo(() => i >= 3 ? d : u, [i]),
                [o] = r.default.useState(() => (function(e) {
                    if (!e || "" === e) return;
                    let t = Number.parseFloat(e);
                    if (!Number.isNaN(t) && 0 !== t) return {
                        defaultTypedValue: t,
                        defaultUnmaskedValue: `${t}`,
                        defaultValue: `${t}`
                    }
                })(t ? .defaultValue)),
                l = r.default.useCallback(() => {
                    if (a.current) {
                        let e = new Event("input", {
                            bubbles: !0
                        });
                        a.current.dispatchEvent(e)
                    }
                }, []),
                {
                    setValue: p,
                    unmaskedValue: h,
                    value: f,
                    ref: x,
                    maskRef: g
                } = (0, c.useIMask)(s, {
                    ref: a,
                    onAccept: (e, t, r) => {
                        n.current ? .(e), !r && x.current && l()
                    },
                    ...o
                }),
                v = r.default.useCallback(e => g.current ? (g.current.value = e, g.current.updateValue(), l(), {
                    success: !0,
                    value: g.current.value
                }) : {
                    success: !1
                }, [g, l]),
                y = r.default.useCallback(({
                    amount: e = 1,
                    direction: t,
                    validate: r = m
                }) => {
                    let a = Number.parseFloat(f),
                        n = Number.isNaN(a) ? 0 : a,
                        s = function({
                            amount: e = 1,
                            value: t,
                            direction: r,
                            precision: a
                        }) {
                            let i = 0,
                                n = 99;
                            return 3 === a && (i = t < 1 ? 0 : .1, n = 99.9), Number.parseFloat(Math.max(i, Math.min(n, t + ("increment" === r ? e : -1 * e))).toFixed(a - 2))
                        }({
                            amount: e,
                            value: n,
                            direction: t,
                            precision: i
                        });
                    switch (r({
                        curr: s,
                        prev: n,
                        direction: t,
                        precision: i
                    })) {
                        case "clear":
                            return v(""), {
                                success: !0,
                                shake: !1
                            };
                        case "error":
                            return {
                                success: !1,
                                shake: !0
                            };
                        case "success":
                            return v(`${s}`), {
                                success: !0,
                                shake: !1
                            };
                        default:
                            return {
                                success: !0,
                                shake: !1
                            }
                    }
                }, [f, v, i]);
            return r.default.useMemo(() => ({
                ref: x,
                value: f,
                unmaskedValue: h,
                setValue: v,
                updateValue: y,
                maskRef: g
            }), [x, f, h, v, y, g])
        }(S ? ? .01, g);
        return k[15] !== P || k[16] !== j || k[17] !== T || k[18] !== _ || k[19] !== F || k[20] !== z ? (v = () => {
            if ("click" === T || "update-only" === T) {
                let e = (0, h.unpadValue)({
                    value: j,
                    precision: P
                }).toString();
                _("type"), e !== z && (E.current = !0), F(e)
            }
        }, k[15] = P, k[16] = j, k[17] = T, k[18] = _, k[19] = F, k[20] = z, k[21] = v) : v = k[21], k[22] !== j || k[23] !== T ? (y = [T, j], k[22] = j, k[23] = T, k[24] = y) : y = k[24], r.default.useEffect(v, y), k[25] !== B || k[26] !== L || k[27] !== F || k[28] !== R || k[29] !== $ || k[30] !== z ? (b = {
            ref: L,
            setValue: F,
            unmaskedValue: R,
            value: z,
            updateValue: $,
            maskRef: B
        }, k[25] = B, k[26] = L, k[27] = F, k[28] = R, k[29] = $, k[30] = z, k[31] = b) : b = k[31], b
    }
}, 63782, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(328113),
        a = e.i(147658),
        i = e.i(416340);
    e.s(["useShake", 0, e => {
        let n, s, o, l = (0, t.c)(9),
            {
                enabled: c,
                animationOptions: d
            } = e,
            [u, m] = (0, a.useAnimate)(),
            p = (0, r.useLatest)(d);
        return l[0] !== m || l[1] !== c || l[2] !== p || l[3] !== u ? (n = () => {
            c && requestAnimationFrame(() => {
                m(u.current, {
                    transform: ["translateX(0)", "translateX(-8px)", "translateX(8px)", "translateX(-8px)", "translateX(8px)", "translateX(-8px)", "translateX(0)"]
                }, {
                    duration: .5,
                    ...p.current
                })
            })
        }, l[0] = m, l[1] = c, l[2] = p, l[3] = u, l[4] = n) : n = l[4], l[5] !== c ? (s = [c], l[5] = c, l[6] = s) : s = l[6], i.default.useEffect(n, s), l[7] !== u ? (o = {
            ref: u
        }, l[7] = u, l[8] = o) : o = l[8], o
    }])
}, 652333, e => {
    "use strict";
    e.s(["validateAmountKeyPress", 0, (e, t) => {
        if (!e || !/^\d$/.test(t.key)) return !0;
        let r = e.selectionStart,
            a = e.selectionEnd;
        if (null === a || null === r) return !0;
        let i = e.value,
            n = t.key,
            s = parseFloat(`${i.slice(0,r)+n+i.slice(a)}`.replace(/[^0-9.]/g, ""));
        return Number.isNaN(s) || s < 1e9
    }, "validatePriceKeyPress", 0, (e, t, r) => {
        if (!e) return !0;
        if (2 === r && "." === t.key) return !1;
        if (!/^\d$/.test(t.key)) return !0;
        let a = e.selectionStart,
            i = e.selectionEnd;
        if (null === i || null === a) return !0;
        let n = e.value,
            s = t.key,
            o = parseFloat(`${n.slice(0,a)+s+n.slice(i)}`.replace(/[^0-9]/g, ""));
        return (!(r > 2) || !(o > 999)) && (2 !== r || !(o > 99))
    }])
}, 820203, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(416340),
        a = e.i(188474),
        i = e.i(999061),
        n = e.i(180715);
    let s = ({
        strokeWidth: e = 1.5,
        ...t
    }) => r.default.createElement(n.Icon, {
        size: "12px",
        ...t
    }, r.default.createElement("line", {
        x1: "10.75",
        y1: "6",
        x2: "1.25",
        y2: "6",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));
    var o = e.i(153698),
        l = e.i(766181),
        c = e.i(215959),
        d = e.i(86831);
    let u = (0, l.cva)(["bg-transparent text-[100%]! outline-none box-border origin-right [text-indent:var(--text-indent,0)]", "[font-variant-numeric:tabular-nums] tracking-tight disabled:cursor-not-allowed", "placeholder:text-text-tertiary", "placeholder:[transform:translateX(calc(var(--text-indent,0)/-2))]"], {
        variants: {
            align: {
                left: "text-left",
                right: "text-right",
                center: "text-center"
            },
            adornments: {
                straddle: "text-center",
                left: "text-left",
                right: "text-right",
                none: ""
            },
            autosize: {
                false: "",
                fit: "",
                stretch: "w-full",
                fill: "w-full"
            }
        },
        defaultVariants: {
            adornments: "straddle"
        }
    });

    function m(e) {
        let r, a, n, s, o, l, c, m, p, h, f, x, g, v = (0, i.c)(24);
        if (v[0] !== e) {
            let {
                className: t,
                align: i,
                adornments: d,
                autosize: u,
                prefix: h,
                suffix: f,
                isEmpty: x,
                scaled: g,
                style: y,
                ...b
            } = e;
            s = t, a = i, r = d, n = u, o = h, p = f, c = g, m = y, l = b, v[0] = e, v[1] = r, v[2] = a, v[3] = n, v[4] = s, v[5] = o, v[6] = l, v[7] = c, v[8] = m, v[9] = p
        } else r = v[1], a = v[2], n = v[3], s = v[4], o = v[5], l = v[6], c = v[7], m = v[8], p = v[9];
        let y = c && "straddle" === r && "center" === a && o && p;
        return v[10] !== r || v[11] !== a || v[12] !== n || v[13] !== s ? (h = (0, d.cn)(u({
            align: a,
            adornments: r,
            autosize: n
        }), s), v[10] = r, v[11] = a, v[12] = n, v[13] = s, v[14] = h) : h = v[14], v[15] !== y ? (f = y && {
            maxWidth: "calc(100% - 2ch)"
        }, v[15] = y, v[16] = f) : f = v[16], v[17] !== m || v[18] !== f ? (x = { ...m,
            ...f
        }, v[17] = m, v[18] = f, v[19] = x) : x = v[19], v[20] !== l || v[21] !== h || v[22] !== x ? (g = (0, t.jsx)("input", {
            className: h,
            style: x,
            ...l
        }), v[20] = l, v[21] = h, v[22] = x, v[23] = g) : g = v[23], g
    }
    let p = (0, l.cva)("relative flex items-center", {
        variants: {
            autosize: {
                false: "",
                fit: "",
                stretch: "flex-1 min-w-px",
                fill: "flex-1 min-w-px"
            },
            adornments: {
                straddle: "text-center",
                left: "text-left",
                right: "text-right",
                none: ""
            },
            autoscaleFont: {
                true: "",
                false: ""
            },
            variant: {
                ghost: "",
                outlined: ["border border-border rounded-md overflow-hidden", "outline outline-1 outline-transparent transition-[outline-color] duration-75 ease-out", "data-[focused]:outline-neutral-200 dark:data-[focused]:outline-neutral-200"]
            }
        }
    });

    function h(e) {
        let r, a, n, s, o, l, c, u, m, h = (0, i.c)(18);
        return h[0] !== e ? ({
            className: s,
            autosize: n,
            adornments: r,
            autoscaleFont: a,
            variant: c,
            style: l,
            ...o
        } = e, h[0] = e, h[1] = r, h[2] = a, h[3] = n, h[4] = s, h[5] = o, h[6] = l, h[7] = c) : (r = h[1], a = h[2], n = h[3], s = h[4], o = h[5], l = h[6], c = h[7]), h[8] !== r || h[9] !== a || h[10] !== n || h[11] !== s || h[12] !== c ? (u = (0, d.cn)(p({
            autosize: n,
            adornments: r,
            autoscaleFont: a,
            variant: c
        }), "stretch" === n && a && "pl-[1ch] max-w-full", s), h[8] = r, h[9] = a, h[10] = n, h[11] = s, h[12] = c, h[13] = u) : u = h[13], h[14] !== o || h[15] !== l || h[16] !== u ? (m = (0, t.jsx)("div", {
            className: u,
            style: l,
            ...o
        }), h[14] = o, h[15] = l, h[16] = u, h[17] = m) : m = h[17], m
    }
    let f = (0, l.cva)(["absolute top-0 bottom-0 z-1 items-center flex pointer-events-none", "text-[inherit] font-[inherit] text-inherit opacity-[var(--affix-opacity)]"], {
        variants: {
            variant: {
                prefix: "",
                suffix: ""
            },
            containerAlignment: {
                left: "",
                center: "",
                right: ""
            },
            enabled: {
                true: "",
                false: "opacity-0"
            }
        }
    });

    function x(e) {
        let r, a, n, s, o, l, c, u, m, p, h, x = (0, i.c)(24);
        x[0] !== e ? ({
            className: r,
            variant: l,
            containerAlignment: a,
            enabled: n,
            style: o,
            ...s
        } = e, x[0] = e, x[1] = r, x[2] = a, x[3] = n, x[4] = s, x[5] = o, x[6] = l) : (r = x[1], a = x[2], n = x[3], s = x[4], o = x[5], l = x[6]), x[7] !== a || x[8] !== l ? (c = () => "prefix" === l && "center" === a ? {
            left: "50%",
            transform: "translateX(calc(var(--text-width) / -2))"
        } : "prefix" === l && "right" === a ? {
            right: "var(--text-width)",
            transform: "translateX(100%)"
        } : "suffix" === l && "center" === a ? {
            left: "50%",
            transform: "translateX(calc((var(--text-width) + var(--text-indent, 0)) / 2))"
        } : "suffix" === l && "right" === a ? {
            right: "var(--text-width)",
            transform: "translateX(100%)"
        } : {}, x[7] = a, x[8] = l, x[9] = c) : c = x[9];
        let g = c;
        return x[10] !== r || x[11] !== a || x[12] !== n || x[13] !== l ? (u = (0, d.cn)(f({
            variant: l,
            containerAlignment: a,
            enabled: n
        }), r), x[10] = r, x[11] = a, x[12] = n, x[13] = l, x[14] = u) : u = x[14], x[15] !== g ? (m = g(), x[15] = g, x[16] = m) : m = x[16], x[17] !== o || x[18] !== m ? (p = { ...m,
            ...o
        }, x[17] = o, x[18] = m, x[19] = p) : p = x[19], x[20] !== s || x[21] !== u || x[22] !== p ? (h = (0, t.jsx)("div", {
            className: u,
            style: p,
            ...s
        }), x[20] = s, x[21] = u, x[22] = p, x[23] = h) : h = x[23], h
    }

    function g(e) {
        let r, a, n, s, o = (0, i.c)(8);
        return o[0] !== e ? ({
            className: r,
            ...a
        } = e, o[0] = e, o[1] = r, o[2] = a) : (r = o[1], a = o[2]), o[3] !== r ? (n = (0, d.cn)("w-fit h-full flex justify-center items-center", r), o[3] = r, o[4] = n) : n = o[4], o[5] !== a || o[6] !== n ? (s = (0, t.jsx)("div", {
            className: n,
            ...a
        }), o[5] = a, o[6] = n, o[7] = s) : s = o[7], s
    }
    let v = (0, l.cva)(["flex border-none justify-center items-center w-fit h-8 px-2 rounded-md", "cursor-pointer outline-none pointer-events-auto", "focus:outline-none active:outline-none", "disabled:opacity-50 disabled:pointer-events-none"], {
        variants: {
            icon: {
                true: "p-0"
            },
            size: {
                default: "",
                large: "h-8 w-8"
            },
            autosize: {
                true: "h-full aspect-square rounded-none"
            }
        },
        defaultVariants: {
            size: "default"
        }
    });

    function y(e) {
        let r, a, n, s, o, l, u, m, p, h, f, x = (0, i.c)(25);
        x[0] !== e ? ({
            className: a,
            icon: n,
            size: o,
            autosize: r,
            style: l,
            ...s
        } = e, x[0] = e, x[1] = r, x[2] = a, x[3] = n, x[4] = s, x[5] = o, x[6] = l) : (r = x[1], a = x[2], n = x[3], s = x[4], o = x[5], l = x[6]), x[7] !== r || x[8] !== n || x[9] !== o ? (u = () => !n || r ? {} : "large" === o ? {
            height: "32px",
            width: "32px"
        } : {
            height: "36px",
            width: "36px"
        }, x[7] = r, x[8] = n, x[9] = o, x[10] = u) : u = x[10];
        let g = u;
        return x[11] !== r || x[12] !== a || x[13] !== n || x[14] !== o ? (m = (0, d.cn)(v({
            icon: n,
            size: o,
            autosize: r
        }), a), x[11] = r, x[12] = a, x[13] = n, x[14] = o, x[15] = m) : m = x[15], x[16] !== g ? (p = g(), x[16] = g, x[17] = p) : p = x[17], x[18] !== l || x[19] !== p ? (h = { ...p,
            ...l
        }, x[18] = l, x[19] = p, x[20] = h) : h = x[20], x[21] !== s || x[22] !== m || x[23] !== h ? (f = (0, t.jsx)(c.motion.button, {
            className: m,
            style: h,
            ...s
        }), x[21] = s, x[22] = m, x[23] = h, x[24] = f) : f = x[24], f
    }
    let b = (0, l.cva)("self-center w-fit flex h-full z-2", {
        variants: {
            side: {
                left: "",
                right: ""
            },
            straddle: {
                true: ""
            }
        }
    });

    function k(e) {
        let r, a, n, s, o, l, c = (0, i.c)(12);
        return c[0] !== e ? ({
            className: r,
            side: n,
            straddle: s,
            ...a
        } = e, c[0] = e, c[1] = r, c[2] = a, c[3] = n, c[4] = s) : (r = c[1], a = c[2], n = c[3], s = c[4]), c[5] !== r || c[6] !== n || c[7] !== s ? (o = (0, d.cn)(b({
            side: n,
            straddle: s
        }), s && ("left" === n ? "mr-1" : "ml-1"), r), c[5] = r, c[6] = n, c[7] = s, c[8] = o) : o = c[8], c[9] !== a || c[10] !== o ? (l = (0, t.jsx)("div", {
            className: o,
            ...a
        }), c[9] = a, c[10] = o, c[11] = l) : l = c[11], l
    }
    let w = [.26, .08, .25, 1];

    function S(e) {
        let r, a, n, l, c, d, u, m, p, h, f, x, v = (0, i.c)(44),
            {
                label: b,
                icon: k,
                variant: S,
                size: j,
                fn: C,
                autosize: _,
                style: T,
                disabled: M
            } = e,
            N = void 0 === S ? "solid" : S,
            I = void 0 === j ? "default" : j;
        e: {
            let e;
            if ("ghost" === N) {
                let e;
                v[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                    backgroundColor: "var(--colors-gray6)",
                    transition: {
                        ease: w,
                        duration: .08,
                        backgroundColor: {
                            ease: "easeOut",
                            duration: .5
                        }
                    }
                }, v[0] = e) : e = v[0], r = e;
                break e
            }
            v[1] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                backgroundColor: "var(--colors-gray5)",
                transition: {
                    ease: w,
                    duration: .08,
                    backgroundColor: {
                        ease: "easeOut",
                        duration: .5
                    }
                }
            }, v[1] = e) : e = v[1],
            r = e
        }
        let P = r;
        t: {
            let e, t, r;v[2] !== k || v[3] !== b ? (e = !b && !k && {
                display: "none"
            }, v[2] = k, v[3] = b, v[4] = e) : e = v[4],
            v[5] !== T || v[6] !== e ? (t = { ...e,
                userSelect: "none",
                ...T
            }, v[5] = T, v[6] = e, v[7] = t) : t = v[7];
            let i = t;
            if ("ghost" === N) {
                let e;
                v[8] !== i ? (e = { ...i,
                    backgroundColor: "transparent",
                    opacity: 1
                }, v[8] = i, v[9] = e) : e = v[9], a = e;
                break t
            }
            v[10] !== i ? (r = { ...i,
                backgroundColor: "var(--colors-gray6)"
            }, v[10] = i, v[11] = r) : r = v[11],
            a = r
        }
        let E = a,
            A = !!k;
        v[12] !== _ || v[13] !== I ? (n = !_ && {
            scale: "default" === I ? .95 : .87
        }, v[12] = _, v[13] = I, v[14] = n) : n = v[14], v[15] !== n ? (l = { ...n
        }, v[15] = n, v[16] = l) : l = v[16], v[17] === Symbol.for("react.memo_cache_sentinel") ? (c = {
            ease: w,
            duration: .08,
            backgroundColor: {
                ease: "easeOut",
                duration: .5
            }
        }, v[17] = c) : c = v[17], v[18] !== C ? (d = e => {
            e.preventDefault(), C()
        }, v[18] = C, v[19] = d) : d = v[19];
        let O = "default" === I ? "scale(0.75)" : "scale(0.9)";
        return v[20] !== O ? (u = {
            display: "flex",
            transform: O
        }, v[20] = O, v[21] = u) : u = v[21], v[22] !== k ? (m = "dash" === k && (0, t.jsx)(s, {
            className: "text-text"
        }), v[22] = k, v[23] = m) : m = v[23], v[24] !== k ? (p = "plus" === k && (0, t.jsx)(o.IconPlusOutline12, {
            className: "text-text"
        }), v[24] = k, v[25] = p) : p = v[25], v[26] !== u || v[27] !== m || v[28] !== p ? (h = (0, t.jsxs)("span", {
            style: u,
            children: [m, p]
        }), v[26] = u, v[27] = m, v[28] = p, v[29] = h) : h = v[29], v[30] !== k || v[31] !== b ? (f = !k && b && (0, t.jsx)("span", {
            className: "font-semibold text-sm leading-[21px] tracking-[0.15px]",
            children: b
        }), v[30] = k, v[31] = b, v[32] = f) : f = v[32], v[33] !== _ || v[34] !== E || v[35] !== M || v[36] !== P || v[37] !== I || v[38] !== h || v[39] !== f || v[40] !== A || v[41] !== l || v[42] !== d ? (x = (0, t.jsx)(g, {
            children: (0, t.jsxs)(y, {
                tabIndex: -1,
                "aria-hidden": "true",
                icon: A,
                size: I,
                autosize: _,
                disabled: M,
                style: E,
                whileTap: l,
                whileHover: P,
                transition: c,
                onClick: d,
                "data-adornment": "",
                children: [h, f]
            })
        }), v[33] = _, v[34] = E, v[35] = M, v[36] = P, v[37] = I, v[38] = h, v[39] = f, v[40] = A, v[41] = l, v[42] = d, v[43] = x) : x = v[43], x
    }

    function j(e, t, r) {
        let a = document.createElement("span");
        a.style.position = "absolute", a.style.left = "-9999px", a.style.visibility = "hidden", a.style.whiteSpace = "pre";
        let i = window.getComputedStyle(r);
        a.style.fontFamily = i.fontFamily, a.style.fontWeight = i.fontWeight, a.style.fontFeatureSettings = i.fontFeatureSettings, a.style.fontVariantNumeric = i.fontVariantNumeric || "tabular-nums lining-nums", a.style.letterSpacing = i.letterSpacing, a.style.fontSize = `${t}px`, a.textContent = e, document.body.appendChild(a);
        let n = a.scrollWidth;
        return document.body.removeChild(a), n
    }
    e.s(["AutosizableInput", 0, function({
        ref: e,
        placeholder: i,
        decrements: n = [],
        increments: s = [],
        className: o,
        value: l,
        defaultValue: c,
        type: d,
        adornments: u = "none",
        prefix: p,
        suffix: f,
        align: g,
        height: v = "50px",
        autosizeOptions: y,
        autoscaleFontOptions: b,
        onInput: w,
        fontColor: C = "var(--color-text-primary)",
        readOnly: _,
        id: T,
        fontSize: M,
        variant: N = "ghost",
        onFocus: I,
        onBlur: P,
        ...E
    }) {
        let A = r.default.useRef(null),
            [O, D] = r.default.useState(!1);
        r.default.useEffect(() => D(!0), []);
        let L = r.default.useMemo(() => {
                let {
                    enabled: e = !1,
                    mode: t,
                    minWidth: r = 1,
                    placeholderIsMinWidth: a = !0,
                    ...n
                } = y ? ? {};
                return {
                    placeholder: i,
                    type: d,
                    autosize: t ? ? !1,
                    enabled: e,
                    minWidth: r,
                    placeholderIsMinWidth: a,
                    onInput: w,
                    ...n
                }
            }, [i, d, w, y]),
            {
                inputRef: z,
                sizerRef: R,
                placeholderSizerRef: F
            } = (({
                enabled: e = !0,
                extraWidth: t,
                minWidth: a = 1,
                placeholderIsMinWidth: i,
                onAutosize: n,
                placeholder: s,
                type: o,
                autosize: l
            }) => {
                let c = r.default.useRef(a),
                    d = r.default.useRef(null),
                    u = r.default.useRef(null),
                    m = r.default.useRef(null),
                    p = r.default.useCallback(() => {
                        if (!d.current) return;
                        let e = window.getComputedStyle(d.current);
                        e && ["fontSize", "fontFamily", "fontWeight", "fontStyle", "letterSpacing", "textTransform"].forEach(t => {
                            u.current && (u.current.style[t] = e[t], m.current && (m.current.style[t] = e[t]))
                        })
                    }, []),
                    h = r.default.useCallback(() => {
                        if (!e || !d.current || !u.current) return;
                        let r = d.current.value ? ? "";
                        u.current.textContent = r;
                        let l = u.current.scrollWidth + 2;
                        s && m.current && (m.current.textContent = s, !r || i) && (l = Math.max(l, m.current.scrollWidth + 2));
                        let p = 0;
                        "number" !== o || t ? null != t && (p = parseInt(String(t), 10) || 0) : p = 16, l += p, (l = Math.max(l, a)) !== c.current && (c.current = l, n ? .(l), d.current && (d.current.style.width = `${l}px`))
                    }, [s, i, o, t, a, n, e]),
                    f = r.default.useCallback(() => {
                        if (!e || !d.current || !u.current) return 0;
                        p();
                        let t = d.current.value;
                        return u.current.textContent = t, u.current.scrollWidth
                    }, [p, e]);
                return r.default.useEffect(() => {
                    "fit" === l && (p(), h())
                }), {
                    inputRef: d,
                    sizerRef: u,
                    placeholderSizerRef: m,
                    width: f()
                }
            })(L),
            $ = r.default.useMemo(() => {
                let {
                    enabled: e = !1,
                    minFontSize: t = 20,
                    defaultFontSize: r = 40,
                    maxFontSize: a = 40,
                    fontScaleStep: n = 1,
                    onAutosize: s,
                    monitorOnly: o,
                    defaultValue: c = "2"
                } = b ? ? {};
                return {
                    enabled: e,
                    minFontSize: t,
                    maxFontSize: a,
                    defaultFontSize: r,
                    onAutosize: s,
                    placeholder: i,
                    fontScaleStep: n,
                    value: l ? void 0 : l,
                    prefix: p,
                    monitorOnly: o,
                    defaultValue: c
                }
            }, [b, i, l, p]),
            {
                onInput: B,
                getFontState: q
            } = (({
                inputRef: e,
                enabled: t,
                minFontSize: a = 20,
                maxFontSize: i = 40,
                defaultFontSize: n = 40,
                fontScaleStep: s = 1,
                onAutosize: o,
                placeholder: l,
                onInput: c,
                value: d,
                prefix: u = "",
                monitorOnly: m,
                defaultValue: p,
                resizeMode: h = "auto"
            }) => {
                let f = r.default.useRef(""),
                    x = r.default.useRef(0),
                    g = r.default.useRef({
                        fontSize: n,
                        textWidth: 0
                    }),
                    v = r.default.useCallback(t => {
                        if (!e.current) return g.current;
                        let r = t || d || e.current.value || p || "",
                            c = r ? `${u}${r}` : r,
                            v = f.current;
                        if (f.current = c, v.length > 5 && c.length > 5 && v === c) return g.current;
                        let y = (e => {
                                let {
                                    minFontSize: t = 20,
                                    maxFontSize: r = 40,
                                    defaultFontSize: a = 40,
                                    fontScaleStep: i = 1,
                                    placeholder: n,
                                    maxWidth: s,
                                    prev: {
                                        fontSize: o
                                    },
                                    el: l,
                                    text: c = "",
                                    monitorOnly: d
                                } = e, u = window.getComputedStyle(l), m = o || parseInt(u.fontSize, 10), p = n ? j(n, m, l) : 0, h = s ? Math.min(l.offsetWidth - (c ? 0 : p), s) : l.offsetWidth - (c ? 0 : p), f = j(c, o, l);
                                if (d) return {
                                    fontSize: parseInt(u.fontSize.replace("px", ""), 10),
                                    textWidth: f
                                };
                                if (!c) return {
                                    fontSize: a,
                                    textWidth: 0
                                };
                                if (f > h) {
                                    let e = r => {
                                        if (r <= t) return {
                                            fontSize: t,
                                            textWidth: j(c, t, l)
                                        };
                                        let a = Math.max(r - i, t),
                                            n = j(c, a, l);
                                        return n > h ? e(a) : {
                                            fontSize: a,
                                            textWidth: n
                                        }
                                    };
                                    return e(o)
                                }
                                if (o < r) {
                                    let e = t => {
                                            if (t >= r) return {
                                                fontSize: r,
                                                textWidth: j(c, r, l)
                                            };
                                            let a = Math.min(t + i, r),
                                                n = j(c, a, l);
                                            return 2 * i <= h - n ? e(a) : {
                                                fontSize: a,
                                                textWidth: n
                                            }
                                        },
                                        {
                                            fontSize: t,
                                            textWidth: a
                                        } = e(o);
                                    if (t > o) return {
                                        fontSize: t,
                                        textWidth: a
                                    }
                                }
                                return {
                                    fontSize: o,
                                    textWidth: f
                                }
                            })({
                                el: e.current,
                                text: c,
                                minFontSize: a,
                                maxFontSize: i,
                                defaultFontSize: n,
                                fontScaleStep: s,
                                placeholder: l,
                                prev: { ...g.current
                                },
                                monitorOnly: m
                            }),
                            b = x.current,
                            k = c.length;
                        return x.current = k, "auto" === h && b === k || (y.fontSize !== g.current.fontSize && o ? .(y.fontSize), g.current = y), g.current
                    }, [i, a, e, o, s, l, n, d, u, m, p, h]),
                    y = r.default.useCallback(e => {
                        let r;
                        return t && (r = v(e.target.value)), c ? .(e), r
                    }, [t, v, c]);
                return r.default.useMemo(() => ({
                    onInput: y,
                    getFontState: v
                }), [y, v])
            })({ ...$,
                inputRef: z
            }),
            [V, H] = r.default.useState(!1),
            U = r.default.useRef(null),
            W = (0, a.useComposedRefs)(e, z),
            G = r.default.useCallback((e, t) => {
                if (!A.current) return;
                b ? .enabled && !b.monitorOnly && A.current.style.setProperty("--font-size", `${e.fontSize}px`);
                let r = 2 * !!p;
                if (U.current && z.current) {
                    let a = void 0 !== t ? t : z.current.value || l || c || "";
                    a ? (U.current.textContent = `${p??""}${a}`, A.current.style.setProperty("--text-width", `${U.current.scrollWidth+r}px`)) : A.current.style.setProperty("--text-width", `${e.textWidth+r}px`)
                } else A.current.style.setProperty("--text-width", `${e.textWidth+r}px`)
            }, [b, p, l, c]),
            Z = r.default.useCallback(e => {
                A.current && A.current.style.setProperty("--affix-opacity", e ? "1" : "0")
            }, []),
            K = r.default.useCallback(e => $.enabled && "straddle" === u && "center" === g ? p ? e ? "1ch" : "0" : f ? e ? "-1ch" : "0" : e ? "0" : "1ch" : "0", [$.enabled, u, g, p, f]),
            Y = r.default.useRef("0"),
            Q = r.default.useCallback(e => {
                if (A.current) {
                    let t = K(e);
                    t !== Y.current && (A.current.style.setProperty("--text-indent", t), Y.current = t)
                }
            }, [K]),
            X = r.default.useCallback(e => {
                let t = B(e);
                t && G(t, e.currentTarget.value), Z(e.currentTarget.value), Q(e.currentTarget.value), w ? .(e)
            }, [B, w, Z, Q, G]),
            J = r.default.useCallback(e => {
                A.current ? A.current.setAttribute("data-focused", "") : H(!0), I ? .(e)
            }, [I, H]),
            ee = r.default.useCallback(e => {
                A.current && A.current.removeAttribute("data-focused"), P ? .(e)
            }, [P]);
        return r.default.useLayoutEffect(() => {
            _ && b ? .enabled && requestAnimationFrame(() => {
                if (z.current) {
                    z.current.value = l;
                    let e = new Event("input", {
                        bubbles: !0
                    });
                    z.current.dispatchEvent(e)
                }
            })
        }, [l, b ? .enabled, _]), r.default.useLayoutEffect(() => {
            G(q(l)), Z(l), Q(l)
        }, [p, f, O, l]), r.default.useLayoutEffect(() => {
            V && (H(!1), requestAnimationFrame(() => {
                A.current && A.current.setAttribute("data-focused", "")
            }))
        }, [V]), (0, t.jsxs)(h, {
            ref: A,
            autosize: L.autosize,
            adornments: u,
            autoscaleFont: b ? .enabled,
            style: {
                height: v,
                fontWeight: 600,
                color: C,
                justifyContent: "center",
                fontSize: M ? ? "var(--font-size)"
            },
            variant: N,
            children: [n.length > 0 && (0, t.jsx)(k, {
                side: "left",
                straddle: "straddle" === u,
                style: {
                    height: v
                },
                children: n.map(({
                    step: e,
                    order: r,
                    ...a
                }) => (0, t.jsx)(S, { ...a
                }, a.id))
            }), (0, t.jsxs)("div", {
                style: { ..."stretch" === L.autosize && {
                        flex: 1,
                        minWidth: 1
                    }
                },
                children: [(0, t.jsx)(x, {
                    variant: "prefix",
                    containerAlignment: g,
                    enabled: !!p,
                    children: (0, t.jsx)("span", {
                        children: p
                    })
                }), (0, t.jsx)(m, {
                    ref: W,
                    type: d,
                    placeholder: O ? i : void 0,
                    prefix: !!p,
                    suffix: !!f,
                    scaled: $.enabled,
                    isEmpty: !l,
                    className: o,
                    autosize: L.autosize,
                    adornments: u,
                    align: g,
                    onInput: X,
                    readOnly: _,
                    id: T,
                    onFocus: J,
                    onBlur: ee,
                    value: l,
                    defaultValue: c,
                    ...E
                }), (0, t.jsx)("div", {
                    ref: R,
                    className: "absolute top-0 left-0 invisible h-0 overflow-scroll whitespace-pre font-[inherit]",
                    children: l ? ? c ? ? ""
                }), (p || f) && (0, t.jsx)("div", {
                    ref: U,
                    "aria-hidden": !0,
                    className: "absolute top-0 left-0 invisible h-0 overflow-scroll whitespace-pre font-[inherit] [font-variant-numeric:tabular-nums] tracking-tight"
                }), "fit" === L.autosize && !!i && (0, t.jsx)("div", {
                    ref: F,
                    className: "absolute top-0 left-0 invisible h-0 overflow-scroll whitespace-pre font-[inherit]",
                    children: i
                }), (0, t.jsx)(x, {
                    variant: "suffix",
                    containerAlignment: g,
                    enabled: !!f,
                    children: (0, t.jsx)("span", {
                        children: f
                    })
                })]
            }), s.length > 0 && (0, t.jsx)(k, {
                side: "right",
                straddle: "straddle" === u,
                style: {
                    height: v
                },
                children: s.map(({
                    step: e,
                    order: r,
                    ...a
                }) => (0, t.jsx)(S, { ...a
                }, a.id))
            })]
        })
    }], 820203)
}, 910806, e => {
    "use strict";
    e.s(["LimitOrderPriceSection", () => N]);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(219469),
        i = e.i(215959),
        n = e.i(416340),
        s = e.i(840216),
        o = e.i(604777),
        l = e.i(458255),
        c = e.i(288576),
        d = e.i(557033),
        u = e.i(797159),
        m = e.i(605325),
        p = e.i(63782),
        h = e.i(507909),
        f = e.i(900519),
        x = e.i(652333),
        g = e.i(399336),
        v = e.i(6204),
        y = e.i(880809),
        b = e.i(156591),
        k = e.i(820203);
    let w = {
            type: "spring",
            duration: .3,
            bounce: .1
        },
        S = {
            ease: h.transition.ease,
            duration: .1,
            opacity: {
                ease: h.opacityTransition.ease,
                duration: .1
            }
        },
        j = {
            initial: {
                opacity: 0,
                transform: "translateY(4px) scale(0.98)"
            },
            animate: {
                opacity: 1,
                transform: "translateY(0px) scale(1)",
                transition: { ...S
                }
            },
            exit: {
                opacity: 0,
                transform: "translateY(4px) scale(0.98)",
                transition: { ...S
                }
            }
        },
        C = {
            autosizeOptions: {
                enabled: !0,
                mode: "fit"
            },
            autoscaleFontOptions: {
                enabled: !0,
                monitorOnly: !0
            },
            style: {
                minWidth: "5ch"
            }
        },
        _ = {
            fontSize: "12px",
            lineHeight: "12px",
            fontVariantNumeric: "tabular-nums"
        },
        T = ({
            curr: e,
            prev: t,
            direction: r,
            precision: a
        }) => {
            if (e === t) {
                if ("increment" === r && (2 === a && void 0 !== t && t >= 99 || 3 === a && void 0 !== t && t >= 99.9)) return "error";
                if ("decrement" === r && (2 === a && void 0 !== t && t <= 1 || 3 === a && void 0 !== t && t <= .1)) return "noop"
            } else if ("decrement" === r && 0 === e) return "clear";
            return "success"
        },
        M = () => {
            let e, o, u, m, p, h, x, v, k, C = (0, r.c)(38);
            C[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["price"], C[0] = e) : e = C[0];
            let {
                price: T
            } = (0, y.useTradeContext)(e), M = (0, s.useSportsStore)(I);
            C[1] === Symbol.for("react.memo_cache_sentinel") ? (o = ["activeMarket"], C[1] = o) : o = C[1];
            let {
                activeMarket: N
            } = (0, g.useEventActiveMarketContext)(o), {
                priceInputRef: P
            } = (0, c.useTradeAnimationContext)(), E = n.default.useRef(!1), [A, O] = n.default.useState("hide");
            e: {
                let e, t, r, a, i, n, s;
                if ("hide" === A || "price" === M || "fractional" === M || "" === T || "0" === T || "00" === T || "000" === T) {
                    let e;
                    C[2] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        canRender: !1,
                        convertedPrice: "",
                        value: void 0,
                        decimals: void 0,
                        prefix: void 0,
                        suffix: void 0
                    }, C[2] = e) : e = C[2], u = e;
                    break e
                }
                if (C[3] !== N.orderPriceMinTickSize || C[4] !== M || C[5] !== T) {
                    let s, o, l = (0, b.getPrecisionFromTickSize)(N.orderPriceMinTickSize ? ? .01),
                        c = (0, f.unpadValue)({
                            value: T,
                            precision: l
                        }),
                        {
                            formatted: u,
                            value: m
                        } = (0, d.convertPrice)({
                            price: c,
                            outputMode: M,
                            inputMode: "scaled",
                            precision: l
                        }),
                        p = m;
                    switch (M) {
                        case "american":
                            {
                                let e;s = m < 0 ? "–" : "+",
                                C[12] !== m ? (e = Math.abs(m), C[12] = m, C[13] = e) : e = C[13],
                                p = e;
                                break
                            }
                        case "indonesian":
                        case "malaysian":
                            {
                                let e;m < 0 && (s = "–"),
                                C[14] !== m ? (e = Math.abs(m), C[14] = m, C[15] = e) : e = C[15],
                                p = e;
                                break
                            }
                        case "decimal":
                        case "hongKong":
                            break;
                        case "percentage":
                            o = "%"
                    }
                    e = !0, t = u, r = p, a = s, i = o, n = (({
                        oddsFormat: e,
                        precision: t
                    }) => "american" === e ? 0 : "decimal" === e || "hongKong" === e || "indonesian" === e || "malaysian" === e ? 2 : t - 2)({
                        oddsFormat: M,
                        precision: l
                    }), C[3] = N.orderPriceMinTickSize, C[4] = M, C[5] = T, C[6] = e, C[7] = t, C[8] = r, C[9] = a, C[10] = i, C[11] = n
                } else e = C[6],
                t = C[7],
                r = C[8],
                a = C[9],
                i = C[10],
                n = C[11];C[16] !== e || C[17] !== t || C[18] !== r || C[19] !== a || C[20] !== i || C[21] !== n ? (s = {
                    canRender: e,
                    convertedPrice: t,
                    value: r,
                    prefix: a,
                    suffix: i,
                    decimals: n
                }, C[16] = e, C[17] = t, C[18] = r, C[19] = a, C[20] = i, C[21] = n, C[22] = s) : s = C[22],
                u = s
            }
            let D = u;
            return C[23] !== P ? (m = () => {
                let e, t = P.current;
                if (t) {
                    let r = () => {
                            E.current = !0, O("show")
                        },
                        a = () => {
                            E.current = !1, O("hide")
                        },
                        i = e => {
                            "Escape" === e.key && O("hide")
                        };
                    t.addEventListener("focus", r), t.addEventListener("blur", a), window.addEventListener("keydown", i), e = () => {
                        t.removeEventListener("focus", r), t.removeEventListener("blur", a), window.removeEventListener("keydown", i)
                    }
                }
                return () => e ? .()
            }, C[23] = P, C[24] = m) : m = C[24], C[25] === Symbol.for("react.memo_cache_sentinel") ? (p = [], C[25] = p) : p = C[25], n.default.useEffect(m, p), C[26] !== A ? (h = () => {
                "hide" === A && E.current && O("show")
            }, C[26] = A, C[27] = h) : h = C[27], C[28] !== T ? (x = [T], C[28] = T, C[29] = x) : x = C[29], n.default.useEffect(h, x), C[30] !== D.canRender || C[31] !== D.decimals || C[32] !== D.prefix || C[33] !== D.suffix || C[34] !== D.value ? (v = D.canRender && (0, t.jsx)(i.motion.div, {
                variants: j,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                className: "absolute top-0 left-1/2 -translate-y-3/4 -translate-x-1/2 py-1 px-1.5 rounded-sm bg-neutral-50 shadow-lg",
                transition: S,
                children: (0, t.jsxs)(l.AnimatedNumber.Root, {
                    value: D.value,
                    decimalCount: D.decimals,
                    fontSize: 12,
                    transition: w,
                    children: [!!D.prefix && (0, t.jsx)(l.AnimatedNumber.Prefix, {
                        style: _,
                        children: D.prefix
                    }), (0, t.jsx)(l.AnimatedNumber.Digits, {
                        stiffness: 1900,
                        damping: 65,
                        style: _,
                        children: D.decimals > 0 && (0, t.jsx)(l.AnimatedNumber.Decimal, {
                            style: _
                        })
                    }), !!D.suffix && (0, t.jsx)(l.AnimatedNumber.Suffix, {
                        style: _,
                        children: D.suffix
                    })]
                })
            }), C[30] = D.canRender, C[31] = D.decimals, C[32] = D.prefix, C[33] = D.suffix, C[34] = D.value, C[35] = v) : v = C[35], C[36] !== v ? (k = (0, t.jsx)(a.AnimatePresence, {
                mode: "sync",
                initial: !1,
                children: v
            }), C[36] = v, C[37] = k) : k = C[37], k
        };

    function N(e) {
        let a, i, n, s, l, d, h, f, g, y, b, w, S, j, _, N, I, P, E, A, O, D = (0, r.c)(61);
        D[0] !== e ? ({
            ref: n,
            precision: i,
            className: a,
            ...s
        } = e, D[0] = e, D[1] = a, D[2] = i, D[3] = n, D[4] = s) : (a = D[1], i = D[2], n = D[3], s = D[4]);
        let L = (0, o.useTranslations)();
        D[5] === Symbol.for("react.memo_cache_sentinel") ? (l = ["isSportsPage"], D[5] = l) : l = D[5];
        let {
            isSportsPage: z
        } = (0, v.useSportsContext)(l), {
            shakePrice: R,
            setShakePrice: F,
            priceInputRef: $
        } = (0, c.useTradeAnimationContext)(), B = (0, u.useOnBlur)(), q = 2 === i ? "0¢" : "0.0¢", {
            ref: V,
            value: H,
            updateValue: U
        } = (0, m.usePriceMask)();
        D[6] !== $ || D[7] !== V ? (d = e => {
            V.current = e, $.current = e
        }, D[6] = $, D[7] = V, D[8] = d) : d = D[8];
        let W = d;
        D[9] !== V || D[10] !== i || D[11] !== F ? (h = e => {
            (0, x.validatePriceKeyPress)(V.current, e, i) || F(!0)
        }, D[9] = V, D[10] = i, D[11] = F, D[12] = h) : h = D[12];
        let G = h,
            Z = i < 3 ? 1 : .1;
        D[13] !== F || D[14] !== Z || D[15] !== U ? (f = () => {
            let {
                shake: e
            } = U({
                amount: Z,
                direction: "increment",
                validate: T
            });
            e && F(!0)
        }, D[13] = F, D[14] = Z, D[15] = U, D[16] = f) : f = D[16], D[17] !== Z || D[18] !== f ? (g = [{
            step: Z,
            id: "limit-inc-adornment",
            icon: "plus",
            fn: f,
            variant: "ghost",
            color: "grey",
            enableLongPress: !0,
            autosize: !0
        }], D[17] = Z, D[18] = f, D[19] = g) : g = D[19];
        let K = g,
            Y = -Z;
        D[20] !== F || D[21] !== Z || D[22] !== U ? (y = () => {
            let {
                shake: e
            } = U({
                amount: Z,
                direction: "decrement",
                validate: T
            });
            e && F(!0)
        }, D[20] = F, D[21] = Z, D[22] = U, D[23] = y) : y = D[23], D[24] !== Y || D[25] !== y ? (b = [{
            step: Y,
            id: "limit-dec-adornment",
            icon: "dash",
            fn: y,
            variant: "ghost",
            color: "grey",
            enableLongPress: !0,
            autosize: !0
        }], D[24] = Y, D[25] = y, D[26] = b) : b = D[26];
        let Q = b;
        D[27] !== Q || D[28] !== K ? (w = {
            increments: K,
            decrements: Q
        }, D[27] = Q, D[28] = K, D[29] = w) : w = D[29];
        let {
            increments: X,
            decrements: J
        } = w;
        D[30] !== F ? (S = {
            duration: .5,
            onComplete: () => {
                F(!1)
            }
        }, D[30] = F, D[31] = S) : S = D[31], D[32] !== R || D[33] !== S ? (j = {
            enabled: R,
            animationOptions: S
        }, D[32] = R, D[33] = S, D[34] = j) : j = D[34];
        let {
            ref: ee
        } = (0, p.useShake)(j);
        return D[35] !== L ? (_ = L("trading.limitPrice"), D[35] = L, D[36] = _) : _ = D[36], D[37] !== _ ? (N = (0, t.jsx)("div", {
            className: "h-full flex-1",
            children: (0, t.jsx)("div", {
                className: "flex flex-col justify-center h-full",
                children: (0, t.jsx)("span", {
                    className: "text-base font-medium leading-5 text-text-primary",
                    children: _
                })
            })
        }), D[37] = _, D[38] = N) : N = D[38], D[39] !== J || D[40] !== X || D[41] !== W || D[42] !== B || D[43] !== G || D[44] !== q || D[45] !== H ? (I = (0, t.jsx)(k.AutosizableInput, {
            ref: W,
            inputMode: "decimal",
            type: "text",
            placeholder: q,
            autoComplete: "off",
            increments: X,
            decrements: J,
            adornments: "straddle",
            onBlur: B,
            value: H,
            align: "center",
            suffix: "¢",
            fontSize: "18px",
            onKeyDown: G,
            variant: "outlined",
            height: "40px",
            ...C
        }, "limit-price-section-input"), D[39] = J, D[40] = X, D[41] = W, D[42] = B, D[43] = G, D[44] = q, D[45] = H, D[46] = I) : I = D[46], D[47] !== z ? (P = z && (0, t.jsx)(M, {}), D[47] = z, D[48] = P) : P = D[48], D[49] !== I || D[50] !== P ? (E = (0, t.jsxs)("div", {
            className: "relative",
            children: [I, P]
        }), D[49] = I, D[50] = P, D[51] = E) : E = D[51], D[52] !== ee || D[53] !== N || D[54] !== E ? (A = (0, t.jsxs)("div", {
            ref: ee,
            className: "w-full flex items-center relative",
            children: [N, E]
        }), D[52] = ee, D[53] = N, D[54] = E, D[55] = A) : A = D[55], D[56] !== a || D[57] !== n || D[58] !== s || D[59] !== A ? (O = (0, t.jsx)("div", {
            ref: n,
            className: a,
            ...s,
            children: A
        }), D[56] = a, D[57] = n, D[58] = s, D[59] = A, D[60] = O) : O = D[60], O
    }

    function I(e) {
        return e.oddsFormat
    }
}, 410988, e => {
    "use strict";
    e.s(["useAmountFieldMask", () => c], 410988);
    var t = e.i(999061),
        r = e.i(416340),
        a = e.i(922445),
        i = e.i(880809);
    e.i(311091);
    var n = e.i(926387);
    let s = {
        mask: Number,
        thousandsSeparator: ",",
        radix: ".",
        mapToRadix: ["."],
        min: 0,
        max: 1e9,
        scale: 2,
        lazy: !1,
        padFractionalZeros: !1,
        prepare: (e, t) => "" === t._value && ("0" === e || "." === e) ? "0." : e
    };
    var o = e.i(879756);
    let l = new RegExp(/^\d*\.?\d{0,5}$/),
        c = (e, c) => {
            let d, u, m, p, h, f, x, g, v, y, b, k, w = (0, t.c)(35),
                S = void 0 === e ? "auto" : e,
                j = void 0 !== c && c,
                C = r.default.useRef(null),
                _ = r.default.useRef(void 0),
                T = r.default.useRef(0);
            w[0] === Symbol.for("react.memo_cache_sentinel") ? (d = ["setShares", "setSellAmountPrefilled", "shares", "amountUpdateLocation", "setAmountUpdateLocation", "setHasClicked", "cursorActive", "setCursorActive"], w[0] = d) : d = w[0];
            let {
                setShares: M,
                setSellAmountPrefilled: N,
                shares: I,
                amountUpdateLocation: P,
                setAmountUpdateLocation: E,
                setHasClicked: A,
                cursorActive: O,
                setCursorActive: D
            } = (0, i.useTradeContext)(d), {
                setHasClicked: L
            } = (0, o.useMobileTradeContext)();
            w[1] !== A || w[2] !== L || w[3] !== N || w[4] !== M ? (u = e => {
                A(!1), L ? .(!1);
                let t = e.replace(/[^0-9.]/g, ""),
                    r = Date.now(),
                    a = "string" == typeof _.current && r - T.current >= 0 && r - T.current <= 750;
                l.test(t) && !a && (M(t), N(!1)), a && (_.current = void 0)
            }, w[1] = A, w[2] = L, w[3] = N, w[4] = M, w[5] = u) : u = w[5];
            let z = u;
            w[6] !== I ? (m = () => I, w[6] = I, w[7] = m) : m = w[7];
            let [R] = r.default.useState(m);
            w[8] !== R || w[9] !== z ? (p = {
                onAccept: z,
                defaultValue: R
            }, w[8] = R, w[9] = z, w[10] = p) : p = w[10];
            let {
                ref: F,
                value: $,
                unmaskedValue: B,
                setValue: q,
                updateValue: V
            } = function(e) {
                let t = r.default.useRef(null),
                    a = r.default.useRef(e ? .onAccept);
                a.current = e ? .onAccept;
                let [i] = r.default.useState(() => (function(e) {
                    if (!e || "" === e || "0" === e || "0." === e) return;
                    let t = parseFloat(e.replace(/[^0-9.]/g, "")),
                        r = Number.isNaN(t) ? 0 : parseFloat(t.toFixed(2)),
                        a = `${r.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:2})}`;
                    return {
                        defaultTypedValue: r,
                        defaultUnmaskedValue: e,
                        defaultValue: a
                    }
                })(e ? .defaultValue)), o = r.default.useCallback(() => {
                    if (t.current) {
                        let e = new Event("input", {
                            bubbles: !0
                        });
                        t.current.dispatchEvent(e)
                    }
                }, []), {
                    setValue: l,
                    unmaskedValue: c,
                    value: d,
                    ref: u,
                    maskRef: m
                } = (0, n.useIMask)(s, {
                    ref: t,
                    onAccept: (e, t, r) => {
                        let i = t._unmaskedValue.replace(/[^0-9.]/g, "");
                        a.current ? .(i), !r && u.current && o()
                    },
                    ...i
                }), p = r.default.useCallback(e => m.current ? (m.current.value = e, m.current.updateValue(), o(), {
                    success: !0,
                    value: m.current.value
                }) : {
                    success: !1
                }, [m, o]), h = r.default.useCallback(({
                    amount: e,
                    direction: t,
                    validate: r = () => !0
                }) => {
                    let a = function(e, t, r) {
                        let a = parseInt("" === e ? "0" : e, 10);
                        if (Number.isNaN(a)) return "0";
                        let i = Math.max("increment" === t ? a + r : a - r, 0);
                        return 0 === i ? "" : `${i}`
                    }(d.replace(/[^0-9.]/g, ""), t, e);
                    return r(a) ? (p(a), {
                        success: !0
                    }) : {
                        success: !1
                    }
                }, [d, p]);
                return r.default.useMemo(() => ({
                    ref: u,
                    value: d,
                    unmaskedValue: c,
                    setValue: p,
                    updateValue: h
                }), [u, d, c, p, h])
            }(p);
            w[11] !== P || w[12] !== E || w[13] !== q || w[14] !== I ? (h = () => {
                ("click" === P || "slider" === P || "update-only" === P) && (_.current = I, T.current = Date.now(), q(I), E("type"))
            }, f = [P, I, q, E], w[11] = P, w[12] = E, w[13] = q, w[14] = I, w[15] = h, w[16] = f) : (h = w[15], f = w[16]), r.default.useEffect(h, f), w[17] !== O || w[18] !== F || w[19] !== D ? (x = () => {
                let e, t = e => D(!1);
                return !(0, a.isTouchScreenOnlyDevice)() && O && F.current && (F.current.focus ? .(), F.current.addEventListener("blur", t), e = () => {
                    F.current ? .removeEventListener("blur", t)
                }), () => e ? .()
            }, g = [O, F, D], w[17] = O, w[18] = F, w[19] = D, w[20] = x, w[21] = g) : (x = w[20], g = w[21]), r.default.useEffect(x, g), w[22] !== S || w[23] !== F || w[24] !== j ? (v = e => {
                j && F.current ? F.current.select() : (C.current && clearTimeout(C.current), "auto" !== S && (C.current = setTimeout(() => {
                    if (F.current) {
                        let e = "left" === S ? 0 : F.current.value.length;
                        F.current.setSelectionRange(e, e)
                    }
                }, 0)))
            }, w[22] = S, w[23] = F, w[24] = j, w[25] = v) : v = w[25];
            let H = v;
            return w[26] === Symbol.for("react.memo_cache_sentinel") ? (y = () => () => {
                C.current && clearTimeout(C.current)
            }, b = [], w[26] = y, w[27] = b) : (y = w[26], b = w[27]), r.default.useEffect(y, b), w[28] !== H || w[29] !== F || w[30] !== q || w[31] !== B || w[32] !== V || w[33] !== $ ? (k = {
                ref: F,
                setValue: q,
                unmaskedValue: B,
                value: $,
                updateValue: V,
                onFocus: H
            }, w[28] = H, w[29] = F, w[30] = q, w[31] = B, w[32] = V, w[33] = $, w[34] = k) : k = w[34], k
        }
}, 668235, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(740594),
        a = e.i(723823);
    e.i(416340);
    var i = e.i(635868),
        n = e.i(880809),
        s = e.i(348262);
    e.s(["useMatchingShares", 0, () => {
        let e, o, l, c = (0, t.c)(5);
        c[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["price", "shares", "side", "selectedOutcomeIdx"], c[0] = e) : e = c[0];
        let {
            price: d,
            shares: u,
            side: m,
            selectedOutcomeIdx: p
        } = (0, n.useTradeContext)(e);
        c[1] === Symbol.for("react.memo_cache_sentinel") ? (o = ["market"], c[1] = o) : o = c[1];
        let {
            market: h
        } = (0, i.useBookContext)(o), f = (0, a.useMatchingShares)(d, h, p, m === r.Side.BUY ? "ask" : "bid");
        return c[2] !== f || c[3] !== u ? (l = (0, s.findMatchingAmount)(u, f), c[2] = f, c[3] = u, c[4] = l) : l = c[4], l
    }])
}, 749450, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(23128),
        i = e.i(169010),
        n = e.i(86831);
    e.s(["QuickSelectItem", 0, function(e) {
        let s, o, l, c = (0, r.c)(13),
            {
                label: d,
                onClick: u,
                tooltip: m,
                labelClassName: p,
                labelStyle: h,
                className: f
            } = e;
        c[0] !== f ? (s = (0, n.cn)("!text-xs !h-7.5 !rounded-md !px-2.5 !text-text-secondary", f), c[0] = f, c[1] = s) : s = c[1], c[2] !== d || c[3] !== p || c[4] !== h ? (o = p || h ? (0, t.jsx)("span", {
            className: p,
            style: h,
            children: d
        }) : d, c[2] = d, c[3] = p, c[4] = h, c[5] = o) : o = c[5], c[6] !== u || c[7] !== s || c[8] !== o ? (l = (0, t.jsx)(a.Button, {
            variant: "secondary",
            size: "sm",
            onClick: u,
            className: s,
            children: o
        }), c[6] = u, c[7] = s, c[8] = o, c[9] = l) : l = c[9];
        let x = l;
        if (m) {
            let e;
            return c[10] !== x || c[11] !== m ? (e = (0, t.jsx)(i.Tooltip, {
                content: m,
                showArrow: !1,
                delayDuration: 0,
                triggerAsChild: !0,
                side: "bottom",
                sideOffset: 4,
                children: x
            }), c[10] = x, c[11] = m, c[12] = e) : e = c[12], e
        }
        return x
    }])
}, 176902, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(416340),
        a = e.i(999061),
        i = e.i(219469),
        n = e.i(215959),
        s = e.i(749450),
        o = e.i(740594),
        l = e.i(328113),
        c = e.i(313305),
        d = e.i(369038),
        u = e.i(348262),
        m = e.i(458164),
        p = e.i(5146),
        h = e.i(604777),
        f = e.i(827681),
        x = e.i(863828),
        g = e.i(880809),
        v = e.i(196593),
        y = e.i(174136),
        b = e.i(784521),
        k = e.i(288576),
        w = e.i(507909),
        S = e.i(870555);
    let j = {
            ease: w.opacityTransition.ease,
            duration: w.opacityTransition.duration
        },
        C = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: j
            },
            exit: {
                opacity: 0,
                transition: j
            }
        };

    function _(e) {
        return (0, r.createElement)(s.QuickSelectItem, { ...e,
            key: e.id,
            label: e.label ? ? "",
            onClick: e.fn
        })
    }
    e.s(["QuickActionGroup", 0, function(e) {
        let s, w, j, T, M, N, I, P = (0, a.c)(15);
        P[0] !== e ? ({
            clamp: j,
            className: s,
            ...w
        } = e, P[0] = e, P[1] = s, P[2] = w, P[3] = j) : (s = P[1], w = P[2], j = P[3]);
        let {
            key: E,
            actions: A
        } = ((e = !1) => {
            let t = (0, h.useTranslations)(),
                {
                    side: a,
                    orderType: i,
                    setShares: n,
                    setAmountUpdateLocation: s,
                    setSellAmountPrefilled: w,
                    shares: S
                } = (0, g.useTradeContext)(["side", "orderType", "setShares", "setAmountUpdateLocation", "setSellAmountPrefilled", "shares"]),
                {
                    marketBuyMax: j,
                    sellMax: C,
                    limitBuyMax: _
                } = (0, d.useOrderLimitsWithPendingSell)(),
                {
                    trackedProxyUsdcBalance: T
                } = (0, p.default)(),
                {
                    setShakeAmount: M,
                    setShakePrice: N
                } = (0, k.useTradeAnimationContext)(),
                {
                    rewardMarket: I
                } = (0, c.useMarketRewardContext)(),
                {
                    showMaxButton: P
                } = (0, y.useLocalStorageShowMaxButton)(),
                {
                    authenticated: E
                } = (0, b.useAccountContext)(["authenticated"]),
                {
                    setOpen: A,
                    setConnectorRoute: O
                } = (0, x.useSiwx)(),
                D = (0, l.useLatest)(S),
                L = r.default.useCallback(e => {
                    let t = parseFloat(e);
                    !Number.isNaN(t) && t < 1e9 ? (n("0" === e ? "" : e), s("click"), w(!1)) : M(!0)
                }, [n, s, w, M]),
                z = I ? .minSize,
                R = r.default.useMemo(() => i === m.OrderType.Limit && !!z && z > 0, [i, z]),
                F = r.default.useMemo(() => R && z ? {
                    id: "liquidity-reward-min",
                    label: `+${z}`,
                    tooltip: t("trading.minimumLiquidityReward"),
                    className: 'relative overflow-hidden before:content-[""] before:absolute before:inset-0 before:pointer-events-none before:bg-gradient-to-r before:from-transparent before:via-white/60 dark:before:via-white/10 before:to-transparent before:animate-[rewards-shimmer_2.5s_ease-in-out_infinite]',
                    labelClassName: "bg-[linear-gradient(92.41deg,_#1652F0_2.15%,_#9B51E0_92.62%)] bg-clip-text text-transparent dark:bg-[linear-gradient(92.41deg,_#769CFF_2.15%,_#D2A8FF_92.62%)] dark:bg-clip-text dark:text-transparent",
                    fn: () => {
                        L((0, u.handleStep)(D.current ? ? "", "increment", z))
                    }
                } : null, [R, z, L, D, t]),
                $ = r.default.useMemo(() => {
                    if (a === o.Side.BUY) {
                        if (i === m.OrderType.Market) return {
                            key: "market-buy-quick-actions",
                            actions: [{
                                id: "market-buy-plus-1",
                                label: "+$1",
                                fn: () => {
                                    L((0, u.handleStep)(D.current ? ? "", "increment", 1, void 0, { ...e && {
                                            max: T.current
                                        }
                                    }))
                                },
                                enableLongPress: !0
                            }, {
                                id: "market-buy-plus-5",
                                label: "+$5",
                                fn: () => {
                                    L((0, u.handleStep)(D.current ? ? "", "increment", 5, void 0, { ...e && {
                                            max: T.current
                                        }
                                    }))
                                },
                                enableLongPress: !0
                            }, {
                                id: "market-buy-plus-10",
                                label: "+$10",
                                fn: () => {
                                    L((0, u.handleStep)(D.current ? ? "", "increment", 10, void 0, { ...e && {
                                            max: T.current
                                        }
                                    }))
                                },
                                enableLongPress: !0
                            }, {
                                id: "market-buy-plus-100",
                                label: "+$100",
                                fn: () => {
                                    L((0, u.handleStep)(D.current ? ? "", "increment", 100, void 0, { ...e && {
                                            max: T.current
                                        }
                                    }))
                                },
                                enableLongPress: !0
                            }, {
                                id: "market-buy-max",
                                label: t("trading.max"),
                                fn: () => {
                                    n((0, v.formatUSDCUnits)(j)), s("click"), w(!1)
                                }
                            }]
                        };
                        if (i === m.OrderType.RFQ) return {
                            key: "rfq-buy-quick-actions",
                            actions: [{
                                id: "rfq-buy-plus-5",
                                label: "+$5",
                                fn: () => {
                                    L((0, u.handleStep)(D.current ? ? "", "increment", 5, void 0, { ...e && {
                                            max: T.current
                                        }
                                    }))
                                },
                                enableLongPress: !0
                            }, {
                                id: "rfq-buy-plus-25",
                                label: "+$25",
                                fn: () => {
                                    L((0, u.handleStep)(D.current ? ? "", "increment", 25, void 0, { ...e && {
                                            max: T.current
                                        }
                                    }))
                                },
                                enableLongPress: !0
                            }, {
                                id: "rfq-buy-plus-50",
                                label: "+$50",
                                fn: () => {
                                    L((0, u.handleStep)(D.current ? ? "", "increment", 50, void 0, { ...e && {
                                            max: T.current
                                        }
                                    }))
                                },
                                enableLongPress: !0
                            }, {
                                id: "rfq-buy-max",
                                label: t("trading.max"),
                                fn: () => {
                                    n((0, v.formatUSDCUnits)(j)), s("click"), w(!1)
                                }
                            }]
                        };
                        let r = [{
                            id: "limit-buy-minus-100",
                            label: "-100",
                            fn: () => {
                                L((0, u.handleStep)(D.current ? ? "", "decrement", 100))
                            },
                            enableLongPress: !0
                        }, {
                            id: "limit-buy-minus-10",
                            label: "-10",
                            fn: () => {
                                L((0, u.handleStep)(D.current ? ? "", "decrement", 10))
                            },
                            enableLongPress: !0
                        }, {
                            id: "limit-buy-plus-10",
                            label: "+10",
                            fn: () => {
                                L((0, u.handleStep)(D.current ? ? "", "increment", 10))
                            },
                            enableLongPress: !0
                        }, {
                            id: "limit-buy-plus-100",
                            label: "+100",
                            fn: () => {
                                L((0, u.handleStep)(D.current ? ? "", "increment", 100))
                            },
                            enableLongPress: !0
                        }, {
                            id: "limit-buy-max",
                            label: t("trading.max"),
                            fn: () => {
                                _ <= 0 n ? N(!0) : (n((0, v.formatUSDCUnits)(_)), s("click"))
                            }
                        }];
                        if (F && z) {
                            let e = r.findIndex(e => e.label === `+${z}`);
                            if (-1 !== e) r[e] = F;
                            else {
                                let e = r.findIndex(e => "limit-buy-max" === e.id),
                                    t = -1 === e ? r.length : e,
                                    a = t;
                                for (let e = 0; e < t; e++) {
                                    let t = parseFloat(r[e].label ? ? "");
                                    if (Number.isFinite(t) && t > z) {
                                        a = e;
                                        break
                                    }
                                }
                                r.splice(a, 0, F)
                            }
                        }
                        return {
                            key: "limit-buy-quick-actions",
                            actions: r
                        }
                    }
                    let r = 25 n * C / 100 n,
                        l = 50 n * C / 100 n,
                        c = 75 n * C / 100 n,
                        d = () => {
                            O(f.ConnectorRoute.LOGIN), A(!0)
                        };
                    return {
                        key: "sell-quick-actions",
                        actions: [{
                            id: "sell-25%",
                            label: "25%",
                            fn: () => {
                                if (!E) return d();
                                r <= 0 n || (n((0, v.formatUSDCUnits)(r)), s("click"), w(!1))
                            }
                        }, {
                            id: "sell-50%",
                            label: "50%",
                            fn: () => {
                                if (!E) return d();
                                l <= 0 n || (n((0, v.formatUSDCUnits)(l)), s("click"), w(!1))
                            }
                        }, {
                            id: "sell-75%",
                            label: "75%",
                            fn: () => {
                                if (!E) return d();
                                c <= 0 n || (n((0, v.formatUSDCUnits)(c)), s("click"), w(!1))
                            }
                        }, {
                            id: "sell-max",
                            label: t("trading.max"),
                            fn: () => {
                                if (!E) return d();
                                C <= 0 n || (n((0, v.formatUSDCUnits)(C)), s("click"), w(!0))
                            }
                        }]
                    }
                }, [a, i, T.current, n, j, s, w, e, D, L, F, z, t, C, _, N, E, A, O]),
                B = ["market-buy-max", "limit-buy-max", "rfq-buy-max"];
            return E ? P ? $ : { ...$,
                actions: $.actions.filter(e => !B.includes(e.id))
            } : { ...$,
                actions: $.actions.filter(e => !B.includes(e.id))
            }
        })(void 0 !== j && j);
        return P[4] !== s ? (T = (0, S.cn)("flex gap-1", s), P[4] = s, P[5] = T) : T = P[5], P[6] !== A ? (M = A.map(_), P[6] = A, P[7] = M) : M = P[7], P[8] !== w || P[9] !== T || P[10] !== M ? (N = (0, t.jsx)(n.motion.div, {
            className: T,
            ...w,
            children: M
        }), P[8] = w, P[9] = T, P[10] = M, P[11] = N) : N = P[11], P[12] !== E || P[13] !== N ? (I = (0, t.jsx)(i.AnimatePresence, {
            initial: !1,
            mode: "popLayout",
            children: (0, t.jsx)(n.motion.div, {
                variants: C,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                children: N
            }, E)
        }), P[12] = E, P[13] = N, P[14] = I) : I = P[14], I
    }], 176902)
}, 768837, 702550, 718882, 97637, e => {
    "use strict";
    e.s(["LimitOrderSharesSection", () => _], 768837);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(740594),
        i = e.i(169010),
        n = e.i(219469),
        s = e.i(215959),
        o = e.i(213567),
        l = e.i(44326),
        c = e.i(416340),
        d = e.i(369038),
        u = e.i(458164),
        m = e.i(288576),
        p = e.i(410988),
        h = e.i(797159),
        f = e.i(63782),
        x = e.i(900519),
        g = e.i(652333),
        v = e.i(5146),
        y = e.i(668235),
        b = e.i(604777),
        k = e.i(870555),
        w = e.i(880809),
        S = e.i(196593),
        j = e.i(820203),
        C = e.i(176902);

    function _(e) {
        let c, _, T, M, N, I, P, E, A, O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y = (0, r.c)(63);
        Y[0] !== e ? ({
            ref: _,
            variant: M,
            className: c,
            ...T
        } = e, Y[0] = e, Y[1] = c, Y[2] = _, Y[3] = T, Y[4] = M) : (c = Y[1], _ = Y[2], T = Y[3], M = Y[4]);
        let Q = void 0 === M ? "desktop" : M,
            X = (0, b.useTranslations)(),
            {
                ref: J,
                value: ee,
                onFocus: et
            } = (0, p.useAmountFieldMask)("right"),
            er = (0, y.useMatchingShares)(),
            ea = (0, h.useOnBlur)(),
            {
                shakeAmount: ei,
                setShakeAmount: en
            } = (0, m.useTradeAnimationContext)();
        Y[5] === Symbol.for("react.memo_cache_sentinel") ? (N = ["side", "orderType"], Y[5] = N) : N = Y[5];
        let {
            side: es,
            orderType: eo
        } = (0, w.useTradeContext)(N), {
            sellMax: el
        } = (0, d.useOrderValidationWithPendingSell)(), {
            trackedProxyUsdcBalance: ec
        } = (0, v.default)();
        Y[6] !== en || Y[7] !== J ? (I = e => {
            (0, g.validateAmountKeyPress)(J.current, e) || en(!0)
        }, Y[6] = en, Y[7] = J, Y[8] = I) : I = Y[8];
        let ed = I,
            eu = 2 * (er < 1e3);
        Y[9] !== eu || Y[10] !== er ? (P = er.toLocaleString("en-US", {
            minimumFractionDigits: eu,
            maximumFractionDigits: eu
        }), Y[9] = eu, Y[10] = er, Y[11] = P) : P = Y[11], Y[12] !== X ? (E = X("trading.matching"), Y[12] = X, Y[13] = E) : E = Y[13];
        let em = `${P} ${E}`;
        Y[14] !== en ? (A = {
            duration: .5,
            onComplete: () => {
                en(!1)
            }
        }, Y[14] = en, Y[15] = A) : A = Y[15], Y[16] !== ei || Y[17] !== A ? (O = {
            enabled: ei,
            animationOptions: A
        }, Y[16] = ei, Y[17] = A, Y[18] = O) : O = Y[18];
        let {
            ref: ep
        } = (0, f.useShake)(O), eh = eo === u.OrderType.Limit && (es === a.Side.BUY ? ec.current > 0 : el > 0), ef = "mobile" === Q && "pb-2";
        return Y[19] !== ef ? (D = (0, k.cn)("flex flex-col w-full gap-2", ef), Y[19] = ef, Y[20] = D) : D = Y[20], Y[21] !== X ? (L = X("trading.shares"), Y[21] = X, Y[22] = L) : L = Y[22], Y[23] !== L ? (z = (0, t.jsx)("span", {
            className: "text-base font-medium leading-4 text-text-primary",
            children: L
        }), Y[23] = L, Y[24] = z) : z = Y[24], Y[25] !== el || Y[26] !== eh || Y[27] !== es || Y[28] !== X || Y[29] !== ec.current ? (R = eh && (0, t.jsx)("span", {
            className: "text-xs font-medium text-text-secondary whitespace-nowrap truncate mt-1",
            children: es === a.Side.SELL ? `${Number((0,S.formatUSDCUnits)(el)).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})} ${X("trading.shares").toLowerCase()}` : (0, x.cashBalanceFormatter)({
                balance: ec.current,
                cashLabel: X("trading.cash")
            })
        }), Y[25] = el, Y[26] = eh, Y[27] = es, Y[28] = X, Y[29] = ec.current, Y[30] = R) : R = Y[30], Y[31] !== z || Y[32] !== R ? (F = (0, t.jsxs)("div", {
            className: "flex-1 flex flex-col justify-center",
            children: [z, R]
        }), Y[31] = z, Y[32] = R, Y[33] = F) : F = Y[33], Y[34] === Symbol.for("react.memo_cache_sentinel") ? ($ = {
            enabled: !0,
            mode: "fit"
        }, B = {
            enabled: !0,
            monitorOnly: !0
        }, q = {
            minWidth: "calc(5ch + 88px)",
            paddingRight: "8px"
        }, Y[34] = $, Y[35] = B, Y[36] = q) : ($ = Y[34], B = Y[35], q = Y[36]), Y[37] !== ea || Y[38] !== et || Y[39] !== ed || Y[40] !== J || Y[41] !== ee ? (V = (0, t.jsx)(j.AutosizableInput, {
            ref: J,
            inputMode: "decimal",
            type: "text",
            placeholder: "0",
            autoComplete: "off",
            onBlur: ea,
            value: ee,
            align: "right",
            fontSize: "18px",
            onKeyDown: ed,
            variant: "outlined",
            height: "40px",
            autoFocus: !0,
            onFocus: et,
            autosizeOptions: $,
            autoscaleFontOptions: B,
            style: q
        }, "limit-shares-section-input"), Y[37] = ea, Y[38] = et, Y[39] = ed, Y[40] = J, Y[41] = ee, Y[42] = V) : V = Y[42], Y[43] !== ep || Y[44] !== F || Y[45] !== V ? (H = (0, t.jsxs)(s.motion.div, {
            ref: ep,
            className: "w-full flex items-center",
            children: [F, V]
        }), Y[43] = ep, Y[44] = F, Y[45] = V, Y[46] = H) : H = Y[46], Y[47] === Symbol.for("react.memo_cache_sentinel") ? (U = (0, t.jsx)("div", {
            className: "flex items-center",
            children: (0, t.jsx)(C.QuickActionGroup, {
                color: "grey",
                className: "w-full justify-between"
            })
        }), Y[47] = U) : U = Y[47], Y[48] !== em || Y[49] !== er || Y[50] !== X ? (W = er ? (0, t.jsx)(s.motion.div, {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1
            },
            exit: {
                opacity: 0
            },
            transition: {
                duration: .075
            },
            className: "flex items-center justify-center bg-green-500/10 rounded-md py-1 px-2 gap-1 w-fit cursor-help [&_span]:text-green-500 [&_span]:text-xs [&_span]:font-semibold [&_span]:leading-4 [&_svg]:text-green-500 [&_svg]:size-3",
            children: (0, t.jsx)(i.TooltipProvider, {
                delayDuration: 0,
                children: (0, t.jsxs)(l.Tooltip.Root, {
                    children: [(0, t.jsx)(i.TooltipTrigger, {
                        asChild: !0,
                        children: (0, t.jsxs)("div", {
                            className: "flex items-center gap-1",
                            children: [(0, t.jsx)(o.IconCircleInfoOutline12, {}), (0, t.jsx)("span", {
                                children: em
                            })]
                        })
                    }), (0, t.jsxs)(i.TooltipContent, {
                        side: "bottom",
                        align: "center",
                        children: [er.toLocaleString("en-US", {
                            minimumFractionDigits: 2 * (er < 1e3),
                            maximumFractionDigits: 2 * (er < 1e3)
                        }), " ", X("trading.sharesFromOrderExecuted")]
                    })]
                })
            })
        }, "matching-shares-badge") : null, Y[48] = em, Y[49] = er, Y[50] = X, Y[51] = W) : W = Y[51], Y[52] !== W ? (G = (0, t.jsxs)("div", {
            className: "w-full flex flex-col gap-2 items-end",
            children: [U, (0, t.jsx)("div", {
                className: "w-full h-6 flex justify-end",
                children: (0, t.jsx)(n.AnimatePresence, {
                    children: W
                })
            })]
        }), Y[52] = W, Y[53] = G) : G = Y[53], Y[54] !== H || Y[55] !== G || Y[56] !== D ? (Z = (0, t.jsxs)("div", {
            className: D,
            children: [H, G]
        }), Y[54] = H, Y[55] = G, Y[56] = D, Y[57] = Z) : Z = Y[57], Y[58] !== c || Y[59] !== _ || Y[60] !== T || Y[61] !== Z ? (K = (0, t.jsx)(s.motion.div, {
            ref: _,
            className: c,
            ...T,
            children: Z
        }), Y[58] = c, Y[59] = _, Y[60] = T, Y[61] = Z, Y[62] = K) : K = Y[62], K
    }
    var T = e.i(149534);
    e.s(["IconCircleDollarOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...t
    }) => c.default.createElement(T.Icon, {
        size: "18px",
        ...t
    }, c.default.createElement("path", {
        d: "M9 16.25C13.0041 16.25 16.25 13.004 16.25 9C16.25 4.996 13.0041 1.75 9 1.75C4.9959 1.75 1.75 4.996 1.75 9C1.75 13.004 4.9959 16.25 9 16.25Z",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }), c.default.createElement("path", {
        d: "M10.75 6.25011H8.3748C7.6155 6.25011 7 6.86561 7 7.62491C7 8.38421 7.6155 9.00011 8.3748 9.00011H9.6251C10.3844 9.00011 10.9999 9.61561 10.9999 10.3749C10.9999 11.1342 10.3844 11.7498 9.6251 11.7498H7.2499M8.9999 5.24991V6.25011M8.9999 12.7499V11.7499",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }))], 702550);
    var M = e.i(9187);
    let N = e => {
            let a, i, n, s = (0, r.c)(8),
                {
                    label: o,
                    value: l,
                    valueClassName: c
                } = e;
            s[0] !== o ? (a = (0, t.jsx)("div", {
                className: "flex items-center w-full",
                children: (0, t.jsx)("p", {
                    className: "text-sm font-normal text-text-secondary",
                    children: o
                })
            }), s[0] = o, s[1] = a) : a = s[1];
            let d = c ? ? "text-[15px] font-medium text-text-primary";
            return s[2] !== d || s[3] !== l ? (i = (0, t.jsx)("p", {
                className: d,
                children: l
            }), s[2] = d, s[3] = l, s[4] = i) : i = s[4], s[5] !== a || s[6] !== i ? (n = (0, t.jsxs)("div", {
                className: "flex justify-between items-center w-full gap-8",
                children: [a, i]
            }), s[5] = a, s[6] = i, s[7] = n) : n = s[7], n
        },
        I = e => {
            let a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v = (0, r.c)(60),
                {
                    price: y,
                    feeEnabled: k,
                    feeValue: w,
                    roiValue: j
                } = e,
                C = (0, b.useTranslations)();
            e: {
                if (y) {
                    let e, t = Math.min(100 * parseFloat(y), 100);
                    v[0] !== t ? (e = (0, S.formatToDecimal)(t, 1), v[0] = t, v[1] = e) : e = v[1], a = e;
                    break e
                }
                a = null
            }
            let _ = a;
            t: {
                if (y) {
                    let e;
                    v[2] !== y ? (e = (0, M.calculateAmericanOddsFromPrice)(y, 0), v[2] = y, v[3] = e) : e = v[3], i = e;
                    break t
                }
                i = null
            }
            let T = i;
            r: {
                if (y) {
                    let e, t;
                    v[4] !== y ? (e = (0, M.calculateDecimalOddsFromPrice)(y) || 0, v[4] = y, v[5] = e) : e = v[5];
                    let r = 100 * e;
                    v[6] !== r ? (t = (0, S.formatToDecimal)(r, 3), v[6] = r, v[7] = t) : t = v[7], n = `${t}x`;
                    break r
                }
                n = null
            }
            let I = n;
            if (!k || !w) {
                let e, r, a, i, n, s, o, l;
                v[8] !== C ? (e = C("sports.price"), v[8] = C, v[9] = e) : e = v[9];
                let c = `${_||0}\xa2`;
                v[10] !== e || v[11] !== c ? (r = (0, t.jsx)(N, {
                    label: e,
                    value: c
                }), v[10] = e, v[11] = c, v[12] = r) : r = v[12], v[13] !== C ? (a = C("sports.american"), v[13] = C, v[14] = a) : a = v[14];
                let d = T || "0";
                v[15] !== a || v[16] !== d ? (i = (0, t.jsx)(N, {
                    label: a,
                    value: d
                }), v[15] = a, v[16] = d, v[17] = i) : i = v[17], v[18] !== C ? (n = C("sports.decimal"), v[18] = C, v[19] = n) : n = v[19];
                let u = I || "0.000x";
                return v[20] !== n || v[21] !== u ? (s = (0, t.jsx)(N, {
                    label: n,
                    value: u
                }), v[20] = n, v[21] = u, v[22] = s) : s = v[22], v[23] !== j ? (o = j && (0, t.jsx)(N, {
                    label: "ROI",
                    value: j,
                    valueClassName: "text-[15px] font-medium text-green-600 dark:text-green-500"
                }), v[23] = j, v[24] = o) : o = v[24], v[25] !== s || v[26] !== o || v[27] !== r || v[28] !== i ? (l = (0, t.jsxs)("div", {
                    className: "flex w-full flex-col justify-start gap-1 p-4 bg-background border rounded-[10px]",
                    children: [r, i, s, o]
                }), v[25] = s, v[26] = o, v[27] = r, v[28] = i, v[29] = l) : l = v[29], l
            }
            v[30] !== C ? (s = C("sports.price"), v[30] = C, v[31] = s) : s = v[31];
            let P = `${_||0}\xa2`;
            v[32] !== s || v[33] !== P ? (o = (0, t.jsx)(N, {
                label: s,
                value: P
            }), v[32] = s, v[33] = P, v[34] = o) : o = v[34], v[35] !== C ? (l = C("sports.american"), v[35] = C, v[36] = l) : l = v[36];
            let E = T || "0";
            v[37] !== l || v[38] !== E ? (c = (0, t.jsx)(N, {
                label: l,
                value: E
            }), v[37] = l, v[38] = E, v[39] = c) : c = v[39], v[40] !== C ? (d = C("sports.decimal"), v[40] = C, v[41] = d) : d = v[41];
            let A = I || "0.000x";
            return v[42] !== d || v[43] !== A ? (u = (0, t.jsx)(N, {
                label: d,
                value: A
            }), v[42] = d, v[43] = A, v[44] = u) : u = v[44], v[45] !== j ? (m = j && (0, t.jsx)(N, {
                label: "ROI",
                value: j,
                valueClassName: "text-[15px] font-medium text-green-600 dark:text-green-500"
            }), v[45] = j, v[46] = m) : m = v[46], v[47] !== u || v[48] !== m || v[49] !== o || v[50] !== c ? (p = (0, t.jsxs)("div", {
                className: "w-full p-4 gap-1 pb-0 flex flex-col bg-background border-b-0 border rounded-b-none rounded-[10px]",
                children: [o, c, u, m]
            }), v[47] = u, v[48] = m, v[49] = o, v[50] = c, v[51] = p) : p = v[51], v[52] === Symbol.for("react.memo_cache_sentinel") ? (h = (0, t.jsx)("div", {
                className: "w-full h-4 bg-neutral-50/50 flex border-x relative",
                children: (0, t.jsx)("div", {
                    className: "w-[calc(100%+2px)] h-full rounded-b-lg border-b absolute border-x -left-px bg-background"
                })
            }), v[52] = h) : h = v[52], v[53] !== w ? (f = w.toFixed(2), v[53] = w, v[54] = f) : f = v[54], v[55] !== f ? (x = (0, t.jsx)("div", {
                className: "flex gap-2 items-center w-full flex-col px-4 py-2.5 border-x border-b rounded-b-[10px] bg-neutral-50/50",
                children: (0, t.jsxs)("p", {
                    className: "text-xs text-text-secondary",
                    children: ["Price includes a fee of $", f]
                })
            }), v[55] = f, v[56] = x) : x = v[56], v[57] !== p || v[58] !== x ? (g = (0, t.jsxs)("div", {
                className: "flex w-full flex-col bg-background rounded-[11px]",
                children: [p, h, x]
            }), v[57] = p, v[58] = x, v[59] = g) : g = v[59], g
        };
    e.s(["OddsConverterTooltip", 0, e => {
        let a, n, s = (0, r.c)(8),
            {
                price: o,
                feeEnabled: l,
                feeValue: c,
                roiValue: d,
                children: u
            } = e;
        return s[0] !== l || s[1] !== c || s[2] !== o || s[3] !== d ? (a = (0, t.jsx)(I, {
            price: o,
            feeEnabled: l,
            feeValue: c,
            roiValue: d
        }), s[0] = l, s[1] = c, s[2] = o, s[3] = d, s[4] = a) : a = s[4], s[5] !== u || s[6] !== a ? (n = (0, t.jsx)(i.Tooltip, {
            mobileSupport: !0,
            className: "border-none p-0 bg-transparent min-w-[224px]",
            collisionPadding: 12,
            delayDuration: 500,
            content: a,
            children: u
        }), s[5] = u, s[6] = a, s[7] = n) : n = s[7], n
    }], 718882);
    var P = e.i(723823),
        E = e.i(488549),
        A = e.i(348262),
        O = e.i(79126),
        D = e.i(720756),
        L = e.i(399336),
        z = e.i(119332);
    let R = {
        averagePrice: 0,
        sharesReceived: 0,
        usdcReceived: 0,
        withinRange: !0,
        hasMarketablePortion: !1,
        feeValue: 0,
        feeEnabled: !1
    };
    e.s(["useLimitOrderDetail", 0, () => {
        let e, t, i, n = (0, r.c)(15);
        n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket", "activeMarketTickSize"], n[0] = e) : e = n[0];
        let {
            activeMarket: s,
            activeMarketTickSize: o
        } = (0, L.useEventActiveMarketContext)(e);
        n[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["orderType", "price", "shares", "side"], n[1] = t) : t = n[1];
        let {
            orderType: l,
            price: d,
            shares: m,
            side: p
        } = (0, w.useTradeContext)(t), {
            bids: h,
            asks: f
        } = (() => {
            let e, t, a, i = (0, r.c)(5);
            i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], i[0] = e) : e = i[0];
            let {
                activeMarket: n
            } = (0, L.useEventActiveMarketContext)(e);
            i[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["selectedOutcomeIdx"], i[1] = t) : t = i[1];
            let {
                selectedOutcomeIdx: s
            } = (0, w.useTradeContext)(t), o = (0, P.useAsks)(n, s), l = (0, P.useBids)(n, s);
            return i[2] !== o || i[3] !== l ? (a = {
                bids: l,
                asks: o
            }, i[2] = o, i[3] = l, i[4] = a) : a = i[4], c.default.useDeferredValue(a)
        })(), {
            feeEnabled: x
        } = (0, D.useOrderFee)(), {
            feeAdjustedShares: g
        } = (0, z.useLocalStorageFeeAdjustedShares)();
        if (n[2] !== s || n[3] !== o || n[4] !== f || n[5] !== h || n[6] !== g || n[7] !== x || n[8] !== l || n[9] !== d || n[10] !== m || n[11] !== p) {
            e: {
                if ("" === m || !m) {
                    i = R;
                    break e
                }
                let e = parseFloat(m);
                if (e <= 0) {
                    i = R;
                    break e
                }
                if (l === u.OrderType.Limit) {
                    let t = parseFloat(d) * o,
                        r = h ? (0, A.convertPriceRowsToPriceAndSizeAndNet)(h.rows) : [],
                        c = f ? (0, A.convertPriceRowsToPriceAndSizeAndNet)(f.rows) : [],
                        u = g && x && p === a.Side.BUY,
                        v = {
                            feeSchedule: s.feeSchedule,
                            feeType: s.feeType
                        },
                        y = m;
                    if (u) {
                        let {
                            marketableSize: r,
                            unmarketableSize: a
                        } = (0, E.getMarketablePortionOfLimitBuy)(c, e, t);
                        y = String((0, O.computeFeeAdjustedLimitSize)(e, r, a, t, v))
                    }
                    let {
                        sharesReceived: b,
                        averagePrice: k,
                        usdcReceived: w,
                        withinRange: S,
                        hasMarketablePortion: j,
                        feeValue: C
                    } = (0, E.getLimitOrderInfo)(r, c, t, y, l, p, x, v), _ = Number.isNaN(b) ? 0 : b, T = Number.isNaN(w) ? 0 : w;
                    if (u && _ > 0) {
                        let r, a = t * parseFloat(y) / e;
                        n[13] !== a ? (r = Number.isFinite(a) ? a : 0, n[13] = a, n[14] = r) : r = n[14], i = {
                            sharesReceived: e,
                            averagePrice: r,
                            usdcReceived: T,
                            withinRange: S,
                            hasMarketablePortion: j,
                            feeValue: C,
                            feeEnabled: x
                        };
                        break e
                    }
                    i = {
                        sharesReceived: _,
                        averagePrice: Number.isNaN(k) ? 0 : k,
                        usdcReceived: T,
                        withinRange: S,
                        hasMarketablePortion: j,
                        feeValue: C,
                        feeEnabled: x
                    };
                    break e
                }
                i = R
            }
            n[2] = s,
            n[3] = o,
            n[4] = f,
            n[5] = h,
            n[6] = g,
            n[7] = x,
            n[8] = l,
            n[9] = d,
            n[10] = m,
            n[11] = p,
            n[12] = i
        }
        else i = n[12];
        return i
    }], 97637)
}, 454619, e => {
    "use strict";
    var t = e.i(999061);
    e.i(416340);
    var r = e.i(399336),
        a = e.i(156591);
    e.s(["usePrecision", 0, () => {
        let e, i, n = (0, t.c)(3);
        n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarketTickSize"], n[0] = e) : e = n[0];
        let {
            activeMarketTickSize: s
        } = (0, r.useEventActiveMarketContext)(e);
        return n[1] !== s ? (i = (0, a.getPrecisionFromTickSize)(s), n[1] = s, n[2] = i) : i = n[2], i
    }])
}, 111706, e => {
    "use strict";
    e.s(["LimitOrderContent", () => eu], 111706);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(766181),
        i = e.i(416340),
        n = e.i(870555),
        s = e.i(399336),
        o = e.i(156591),
        l = e.i(910806),
        c = e.i(768837),
        d = e.i(740594),
        u = e.i(219469),
        m = e.i(215959),
        p = e.i(507909),
        h = e.i(85510),
        f = e.i(134709),
        x = e.i(880809),
        g = e.i(169010),
        v = e.i(196593),
        y = e.i(213567),
        b = e.i(702550),
        k = e.i(718882),
        w = e.i(97637),
        S = e.i(900519),
        j = e.i(454619),
        C = e.i(604777),
        _ = e.i(839156),
        T = e.i(723823),
        M = e.i(458164),
        N = e.i(79126),
        I = e.i(720756),
        P = e.i(119332),
        E = e.i(488549),
        A = e.i(348262);
    let O = {
        averagePrice: 0,
        sharesReceived: 0,
        usdcReceived: 0,
        withinRange: !0,
        hasMarketablePortion: !1,
        feeValue: 0,
        feeEnabled: !1
    };
    var D = e.i(684656);
    let L = () => {
        let e, a, i, n, o, l, c, u, m, p, h, f, g, v, y, b = (0, r.c)(37),
            k = (0, C.useTranslations)(),
            {
                averagePrice: w
            } = (() => {
                let e, t, a = (0, r.c)(13),
                    i = (0, s.useEventActiveMarket)();
                a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["orderType", "price", "shares", "side", "selectedOutcomeIdx"], a[0] = e) : e = a[0];
                let {
                    orderType: n,
                    price: o,
                    shares: l,
                    side: c,
                    selectedOutcomeIdx: u
                } = (0, x.useTradeContext)(e), m = (0, T.useAsks)(i, u), p = (0, T.useBids)(i, u), {
                    feeEnabled: h
                } = (0, I.useOrderFee)(), {
                    feeAdjustedShares: f
                } = (0, P.useLocalStorageFeeAdjustedShares)();
                if (a[1] !== i || a[2] !== m || a[3] !== p || a[4] !== f || a[5] !== h || a[6] !== n || a[7] !== o || a[8] !== l || a[9] !== c) {
                    e: {
                        if ("" === l || !l || !m || !p) {
                            t = O;
                            break e
                        }
                        let e = parseFloat(l);
                        if (e <= 0) {
                            t = O;
                            break e
                        }
                        if (n === M.OrderType.Limit) {
                            let r = parseFloat(o) * i.orderPriceMinTickSize,
                                s = (0, A.convertPriceRowsToPriceAndSizeAndNet)(p ? .rows ? ? []),
                                u = (0, A.convertPriceRowsToPriceAndSizeAndNet)(m ? .rows ? ? []),
                                x = f && h && c === d.Side.BUY,
                                g = {
                                    feeSchedule: i.feeSchedule,
                                    feeType: i.feeType
                                },
                                v = l;
                            if (x) {
                                let {
                                    marketableSize: t,
                                    unmarketableSize: a
                                } = (0, E.getMarketablePortionOfLimitBuy)(u, e, r);
                                v = String((0, N.computeFeeAdjustedLimitSize)(e, t, a, r, g))
                            }
                            let {
                                sharesReceived: y,
                                averagePrice: b,
                                usdcReceived: k,
                                withinRange: w,
                                hasMarketablePortion: S,
                                feeValue: j
                            } = (0, E.getLimitOrderInfo)(s, u, r, v, n, c, h, g), C = Number.isNaN(y) ? 0 : y, _ = Number.isNaN(k) ? 0 : k;
                            if (x && C > 0) {
                                let i, n = r * parseFloat(v) / e;
                                a[11] !== n ? (i = Number.isFinite(n) ? n : 0, a[11] = n, a[12] = i) : i = a[12], t = {
                                    sharesReceived: e,
                                    averagePrice: i,
                                    usdcReceived: _,
                                    withinRange: w,
                                    hasMarketablePortion: S,
                                    feeValue: j,
                                    feeEnabled: h
                                };
                                break e
                            }
                            t = {
                                sharesReceived: C,
                                averagePrice: Number.isNaN(b) ? 0 : b,
                                usdcReceived: _,
                                withinRange: w,
                                hasMarketablePortion: S,
                                feeValue: j,
                                feeEnabled: h
                            };
                            break e
                        }
                        t = O
                    }
                    a[1] = i,
                    a[2] = m,
                    a[3] = p,
                    a[4] = f,
                    a[5] = h,
                    a[6] = n,
                    a[7] = o,
                    a[8] = l,
                    a[9] = c,
                    a[10] = t
                }
                else t = a[10];
                return t
            })();
        b[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["shares", "sharesUsdc", "priceUsdc"], b[0] = e) : e = b[0];
        let {
            shares: S,
            sharesUsdc: j,
            priceUsdc: _
        } = (0, x.useTradeContext)(e), L = parseFloat(S ? ? "0");
        b[1] !== w || b[2] !== _ || b[3] !== j || b[4] !== L ? (a = (({
            shares: e,
            averagePrice: t,
            sharesUsdc: r,
            priceUsdc: a
        }) => ({
            roi: ((e, t) => {
                let r = (0, D.calculateLimitROI)(e, t);
                if (Number.isNaN(r) || 0 === r) return "+0%";
                let a = `+${r.toLocaleString("en-US",{minimumFractionDigits:2*(r<10),maximumFractionDigits:2*(r<10)})}`;
                return `${a.endsWith(".00")?a.slice(0,-3):a}%`
            })(r, a),
            profit: ((e, t) => {
                if (0 === e || 0 === t) return "+$0";
                let r = `+$${((1-e)*t).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`;
                return r.endsWith(".00") ? r.slice(0, -3) : r
            })(t, e),
            multiplier: (e => {
                if (0 === e) return "0x";
                let t = `${(1/e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`;
                return `${t.endsWith(".00")?t.slice(0,-3):t}x`
            })(t)
        }))({
            shares: L,
            averagePrice: w,
            sharesUsdc: j,
            priceUsdc: _
        }), b[1] = w, b[2] = _, b[3] = j, b[4] = L, b[5] = a) : a = b[5];
        let {
            roi: z,
            profit: R,
            multiplier: F
        } = a;
        return b[6] !== k ? (i = k("trading.profit"), b[6] = k, b[7] = i) : i = b[7], b[8] !== i ? (n = (0, t.jsx)("p", {
            className: "text-sm font-normal text-text-secondary",
            children: i
        }), b[8] = i, b[9] = n) : n = b[9], b[10] !== R ? (o = (0, t.jsx)("p", {
            className: "text-[15px] font-medium text-green-600 dark:text-green-500",
            children: R
        }), b[10] = R, b[11] = o) : o = b[11], b[12] !== n || b[13] !== o ? (l = (0, t.jsxs)("div", {
            className: "flex w-full justify-between items-center gap-10",
            children: [n, o]
        }), b[12] = n, b[13] = o, b[14] = l) : l = b[14], b[15] !== k ? (c = k("trading.change"), b[15] = k, b[16] = c) : c = b[16], b[17] !== c ? (u = (0, t.jsx)("p", {
            className: "text-sm font-normal text-text-secondary",
            children: c
        }), b[17] = c, b[18] = u) : u = b[18], b[19] !== z ? (m = (0, t.jsx)("p", {
            className: "text-[15px] font-medium text-green-600 dark:text-green-500",
            children: z
        }), b[19] = z, b[20] = m) : m = b[20], b[21] !== u || b[22] !== m ? (p = (0, t.jsxs)("div", {
            className: "flex w-full justify-between items-center gap-10",
            children: [u, m]
        }), b[21] = u, b[22] = m, b[23] = p) : p = b[23], b[24] !== k ? (h = k("trading.multiplier"), b[24] = k, b[25] = h) : h = b[25], b[26] !== h ? (f = (0, t.jsx)("p", {
            className: "text-sm font-normal text-text-secondary",
            children: h
        }), b[26] = h, b[27] = f) : f = b[27], b[28] !== F ? (g = (0, t.jsx)("p", {
            className: "text-[15px] font-medium text-green-600 dark:text-green-500",
            children: F
        }), b[28] = F, b[29] = g) : g = b[29], b[30] !== f || b[31] !== g ? (v = (0, t.jsxs)("div", {
            className: "flex w-full justify-between items-center gap-10",
            children: [f, g]
        }), b[30] = f, b[31] = g, b[32] = v) : v = b[32], b[33] !== p || b[34] !== v || b[35] !== l ? (y = (0, t.jsxs)("div", {
            className: "flex flex-col gap-2 p-1",
            children: [l, p, v]
        }), b[33] = p, b[34] = v, b[35] = l, b[36] = y) : y = b[36], y
    };
    L.displayName = "LimitInfoTooltipContent";
    var z = e.i(86831);
    let R = Object.assign({}, {
            Root: function(e) {
                let a, i, n, s, o, l = (0, r.c)(10);
                return l[0] !== e ? ({
                    className: i,
                    children: a,
                    ...n
                } = e, l[0] = e, l[1] = a, l[2] = i, l[3] = n) : (a = l[1], i = l[2], n = l[3]), l[4] !== i ? (s = (0, z.cn)("flex flex-col size-full gap-2", i), l[4] = i, l[5] = s) : s = l[5], l[6] !== a || l[7] !== n || l[8] !== s ? (o = (0, t.jsx)("div", {
                    className: s,
                    ...n,
                    children: a
                }), l[6] = a, l[7] = n, l[8] = s, l[9] = o) : o = l[9], o
            },
            Item: function(e) {
                let a, i, n, s, o, l = (0, r.c)(10);
                return l[0] !== e ? ({
                    className: i,
                    children: a,
                    ...n
                } = e, l[0] = e, l[1] = a, l[2] = i, l[3] = n) : (a = l[1], i = l[2], n = l[3]), l[4] !== i ? (s = (0, z.cn)("flex justify-between items-center", i), l[4] = i, l[5] = s) : s = l[5], l[6] !== a || l[7] !== n || l[8] !== s ? (o = (0, t.jsx)("div", {
                    className: s,
                    ...n,
                    children: a
                }), l[6] = a, l[7] = n, l[8] = s, l[9] = o) : o = l[9], o
            },
            Label: function(e) {
                let a, i, n, s, o, l, c, d = (0, r.c)(14);
                d[0] !== e ? ({
                    ref: n,
                    variant: o,
                    children: a,
                    className: i,
                    ...s
                } = e, d[0] = e, d[1] = a, d[2] = i, d[3] = n, d[4] = s, d[5] = o) : (a = d[1], i = d[2], n = d[3], s = d[4], o = d[5]);
                let u = "mobile" === (void 0 === o ? "desktop" : o) && "font-medium";
                return d[6] !== i || d[7] !== u ? (l = (0, z.cn)("flex text-text-primary text-base leading-5", u, i), d[6] = i, d[7] = u, d[8] = l) : l = d[8], d[9] !== a || d[10] !== n || d[11] !== s || d[12] !== l ? (c = (0, t.jsx)("p", {
                    ref: n,
                    className: l,
                    ...s,
                    children: a
                }), d[9] = a, d[10] = n, d[11] = s, d[12] = l, d[13] = c) : c = d[13], c
            },
            Value: function(e) {
                let a, i, n, s, o, l, c, d, u, m, p, h = (0, r.c)(22);
                h[0] !== e ? ({
                    ref: n,
                    color: o,
                    size: l,
                    underline: d,
                    weight: c,
                    children: a,
                    className: i,
                    ...s
                } = e, h[0] = e, h[1] = a, h[2] = i, h[3] = n, h[4] = s, h[5] = o, h[6] = l, h[7] = c, h[8] = d) : (a = h[1], i = h[2], n = h[3], s = h[4], o = h[5], l = h[6], c = h[7], d = h[8]);
                let f = void 0 === o ? "gray" : o,
                    x = void 0 === l ? "md" : l,
                    g = void 0 === c ? "normal" : c;
                return h[9] !== i || h[10] !== f || h[11] !== n || h[12] !== x || h[13] !== d || h[14] !== g ? (u = n, m = (0, z.cn)("flex items-center gap-1.5", {
                    gray: "text-neutral-800",
                    blue: "text-brand-500",
                    green: "text-green-600"
                }[f], {
                    sm: "text-sm leading-4",
                    md: "text-[18px] leading-6",
                    lg: "text-[20px] leading-6",
                    xl: "text-2xl leading-8"
                }[x], {
                    normal: "font-normal",
                    medium: "font-medium",
                    semi: "font-semibold",
                    bold: "font-bold"
                }[g], "dotted" === d && "underline decoration-dotted underline-offset-4", i), h[9] = i, h[10] = f, h[11] = n, h[12] = x, h[13] = d, h[14] = g, h[15] = u, h[16] = m) : (u = h[15], m = h[16]), h[17] !== a || h[18] !== s || h[19] !== u || h[20] !== m ? (p = (0, t.jsx)("p", {
                    ref: u,
                    className: m,
                    ...s,
                    children: a
                }), h[17] = a, h[18] = s, h[19] = u, h[20] = m, h[21] = p) : p = h[21], p
            }
        }),
        F = i.default.memo(function(e) {
            let a, s, o, l, c, d, u, m, p, h, f, T, M, N, I, P, E, A, O, D = (0, r.c)(49);
            D[0] !== e ? ({
                variant: o,
                className: a,
                ...s
            } = e, D[0] = e, D[1] = a, D[2] = s, D[3] = o) : (a = D[1], s = D[2], o = D[3]);
            let z = void 0 === o ? "desktop" : o,
                F = (0, C.useTranslations)(),
                {
                    receiveValue: $,
                    toWinValue: B,
                    averagePrice: q,
                    feeEnabled: V,
                    feeValue: H
                } = (() => {
                    let e, t, a, n, s, o = (0, r.c)(22),
                        {
                            sharesReceived: l,
                            averagePrice: c,
                            feeEnabled: d,
                            feeValue: u
                        } = (0, w.useLimitOrderDetail)();
                    o[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["price", "selectedOutcomeIdx", "side"], o[0] = e) : e = o[0];
                    let {
                        price: m,
                        selectedOutcomeIdx: p,
                        side: h
                    } = (0, x.useTradeContext)(e), f = (0, j.usePrecision)();
                    o[1] !== c || o[2] !== d || o[3] !== u || o[4] !== m || o[5] !== p || o[6] !== l || o[7] !== h ? (t = {
                        sharesReceived: l,
                        avgPrice: c,
                        price: m,
                        selectedOutcomeIdx: p,
                        side: h,
                        feeEnabled: d,
                        feeValue: u
                    }, o[1] = c, o[2] = d, o[3] = u, o[4] = m, o[5] = p, o[6] = l, o[7] = h, o[8] = t) : t = o[8];
                    let {
                        sharesReceived: g,
                        avgPrice: v,
                        price: y,
                        selectedOutcomeIdx: b,
                        side: k,
                        feeEnabled: C,
                        feeValue: _
                    } = i.default.useDeferredValue(t);
                    o[9] !== y || o[10] !== f ? (a = (0, S.unpadValue)({
                        value: y,
                        precision: f
                    }), o[9] = y, o[10] = f, o[11] = a) : a = o[11];
                    let T = a / 100 * g + (C ? _ : 0);
                    o[12] !== v || o[13] !== y || o[14] !== f ? (n = v || (0, S.unpadValue)({
                        value: y,
                        precision: f
                    }) / 100, o[12] = v, o[13] = y, o[14] = f, o[15] = n) : n = o[15];
                    let M = n,
                        N = `${M}`;
                    return o[16] !== C || o[17] !== _ || o[18] !== T || o[19] !== N || o[20] !== g ? (s = {
                        receiveValue: T,
                        toWinValue: g,
                        averagePrice: N,
                        feeEnabled: C,
                        feeValue: _
                    }, o[16] = C, o[17] = _, o[18] = T, o[19] = N, o[20] = g, o[21] = s) : s = o[21], s
                })();
            D[4] !== a ? (l = (0, n.cn)("flex flex-col w-full h-full gap-2", a), D[4] = a, D[5] = l) : l = D[5], D[6] !== F ? (c = F("trading.orderBook.total"), D[6] = F, D[7] = c) : c = D[7], D[8] !== c || D[9] !== z ? (d = (0, t.jsx)(R.Label, {
                className: "font-medium",
                variant: z,
                children: c
            }), D[8] = c, D[9] = z, D[10] = d) : d = D[10], D[11] !== $ ? (u = (0, v.formatToDollar)($), D[11] = $, D[12] = u) : u = D[12], D[13] !== u ? (m = (0, t.jsx)(R.Value, {
                color: "blue",
                size: "md",
                weight: "medium",
                children: u
            }), D[13] = u, D[14] = m) : m = D[14], D[15] !== d || D[16] !== m ? (p = (0, t.jsxs)(R.Item, {
                children: [d, m]
            }), D[15] = d, D[16] = m, D[17] = p) : p = D[17], D[18] !== F ? (h = F("trading.toWin"), D[18] = F, D[19] = h) : h = D[19], D[20] !== h ? (f = (0, t.jsx)("span", {
                children: h
            }), D[20] = h, D[21] = f) : f = D[21], D[22] !== q || D[23] !== V || D[24] !== H || D[25] !== z ? (T = "desktop" === z && (0, t.jsx)(k.OddsConverterTooltip, {
                price: q,
                feeEnabled: V,
                feeValue: H,
                children: V && H > 0 ? (0, t.jsx)(b.IconCircleDollarOutline18, {
                    size: 14,
                    className: "text-text-secondary"
                }) : (0, t.jsx)(y.IconCircleInfoOutline12, {
                    size: 14,
                    className: "text-text-secondary"
                })
            }), D[22] = q, D[23] = V, D[24] = H, D[25] = z, D[26] = T) : T = D[26], D[27] !== T || D[28] !== f || D[29] !== z ? (M = (0, t.jsxs)(R.Label, {
                variant: z,
                className: "font-medium gap-1.5 items-center",
                children: [f, T]
            }), D[27] = T, D[28] = f, D[29] = z, D[30] = M) : M = D[30];
            let U = "mobile" === z ? "xl" : "lg";
            return D[31] !== z ? (N = "desktop" === z && (0, t.jsx)(g.Tooltip, {
                delayDuration: 500,
                content: (0, t.jsx)(L, {}),
                children: (0, t.jsx)(_.CashBalanceIcon, {
                    className: "size-5"
                })
            }), D[31] = z, D[32] = N) : N = D[32], D[33] !== B ? (I = (0, v.formatToDollar)(B), D[33] = B, D[34] = I) : I = D[34], D[35] !== U || D[36] !== N || D[37] !== I ? (P = (0, t.jsxs)(R.Value, {
                color: "green",
                size: U,
                weight: "medium",
                children: [N, I]
            }), D[35] = U, D[36] = N, D[37] = I, D[38] = P) : P = D[38], D[39] !== M || D[40] !== P ? (E = (0, t.jsxs)(R.Item, {
                children: [M, P]
            }), D[39] = M, D[40] = P, D[41] = E) : E = D[41], D[42] !== E || D[43] !== p ? (A = (0, t.jsxs)(R.Root, {
                children: [p, E]
            }), D[42] = E, D[43] = p, D[44] = A) : A = D[44], D[45] !== s || D[46] !== A || D[47] !== l ? (O = (0, t.jsx)("div", {
                className: l,
                ...s,
                children: A
            }), D[45] = s, D[46] = A, D[47] = l, D[48] = O) : O = D[48], O
        });
    var $ = e.i(449372),
        B = e.i(269101);
    let q = i.default.memo(function(e) {
            let a, o, l, c, d, u, m, p, h, f, g, S, j, T, M, N = (0, r.c)(40);
            N[0] !== e ? ({
                variant: l,
                className: a,
                ...o
            } = e, N[0] = e, N[1] = a, N[2] = o, N[3] = l) : (a = N[1], o = N[2], l = N[3]);
            let I = void 0 === l ? "desktop" : l,
                P = (0, C.useTranslations)(),
                {
                    amountValue: E,
                    averagePrice: A,
                    feeEnabled: O,
                    feeValue: D,
                    roiLabel: L
                } = (() => {
                    let e, t, a, n, o, l, c, d = (0, r.c)(22),
                        {
                            usdcReceived: u,
                            averagePrice: m,
                            feeEnabled: p,
                            feeValue: h
                        } = (0, w.useLimitOrderDetail)();
                    d[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], d[0] = e) : e = d[0];
                    let {
                        activeMarket: f
                    } = (0, s.useEventActiveMarketContext)(e);
                    d[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["positions"], d[1] = t) : t = d[1];
                    let {
                        positions: g
                    } = (0, B.useEventPositionsContext)(t);
                    d[2] === Symbol.for("react.memo_cache_sentinel") ? (a = ["selectedOutcomeIdx"], d[2] = a) : a = d[2];
                    let {
                        selectedOutcomeIdx: v
                    } = (0, x.useTradeContext)(a);
                    if (d[3] !== f || d[4] !== g || d[5] !== v) {
                        e: {
                            let e = (0, $.getPositionsForMarket)({
                                    market: f,
                                    positions: g ? ? []
                                }),
                                t = (0, $.getSharesForMarket)({
                                    positions: e,
                                    outcomeIndex: v
                                });
                            if (!t || t.qty <= 0) {
                                n = void 0;
                                break e
                            }
                            n = Number.isFinite(t.avgPrice) ? t.avgPrice : void 0
                        }
                        d[3] = f,
                        d[4] = g,
                        d[5] = v,
                        d[6] = n
                    }
                    else n = d[6];
                    let y = n;
                    d[7] !== m || d[8] !== y || d[9] !== p || d[10] !== h || d[11] !== u ? (o = {
                        usdcReceived: u,
                        averagePrice: m,
                        feeEnabled: p,
                        feeValue: h,
                        avgEntryPrice: y
                    }, d[7] = m, d[8] = y, d[9] = p, d[10] = h, d[11] = u, d[12] = o) : o = d[12];
                    let {
                        usdcReceived: b,
                        averagePrice: k,
                        feeEnabled: S,
                        feeValue: j,
                        avgEntryPrice: C
                    } = i.default.useDeferredValue(o), _ = `${k}`;
                    d[13] !== k || d[14] !== C ? (l = void 0 === C ? null : ((e, t) => {
                        if (t <= 0) return null;
                        let r = (e - t) / t * 100;
                        if (!Number.isFinite(r) || r <= 0) return null;
                        let a = r.toLocaleString("en-US", {
                            minimumFractionDigits: 2 * (r < 10),
                            maximumFractionDigits: 2 * (r < 10)
                        });
                        return `${a.endsWith(".00")?a.slice(0,-3):a}%`
                    })(k, C), d[13] = k, d[14] = C, d[15] = l) : l = d[15];
                    let T = l;
                    return d[16] !== b || d[17] !== _ || d[18] !== S || d[19] !== j || d[20] !== T ? (c = {
                        amountValue: b,
                        averagePrice: _,
                        feeEnabled: S,
                        feeValue: j,
                        roiLabel: T
                    }, d[16] = b, d[17] = _, d[18] = S, d[19] = j, d[20] = T, d[21] = c) : c = d[21], c
                })();
            N[4] !== a ? (c = (0, n.cn)("flex flex-col w-full h-full", a), N[4] = a, N[5] = c) : c = N[5];
            let z = "mobile" === I ? "gap-1" : "gap-1.5";
            N[6] !== z ? (d = (0, n.cn)("flex items-center", z), N[6] = z, N[7] = d) : d = N[7], N[8] !== P ? (u = P("trading.youllReceive"), N[8] = P, N[9] = u) : u = N[9], N[10] !== u ? (m = (0, t.jsx)("span", {
                children: u
            }), N[10] = u, N[11] = m) : m = N[11], N[12] !== A || N[13] !== O || N[14] !== D || N[15] !== L || N[16] !== I ? (p = "desktop" === I && (0, t.jsx)(k.OddsConverterTooltip, {
                price: A,
                feeEnabled: O,
                feeValue: D,
                roiValue: L,
                children: O && D > 0 ? (0, t.jsx)(b.IconCircleDollarOutline18, {
                    size: 14,
                    className: "text-text-secondary"
                }) : (0, t.jsx)(y.IconCircleInfoOutline12, {
                    size: 14,
                    className: "text-text-secondary"
                })
            }), N[12] = A, N[13] = O, N[14] = D, N[15] = L, N[16] = I, N[17] = p) : p = N[17], N[18] !== d || N[19] !== m || N[20] !== p ? (h = (0, t.jsxs)("span", {
                className: d,
                children: [m, p]
            }), N[18] = d, N[19] = m, N[20] = p, N[21] = h) : h = N[21], N[22] !== h || N[23] !== I ? (f = (0, t.jsx)(R.Label, {
                className: "font-medium",
                variant: I,
                children: h
            }), N[22] = h, N[23] = I, N[24] = f) : f = N[24];
            let F = "mobile" === I ? "xl" : "lg";
            return N[25] !== I ? (g = "desktop" === I && (0, t.jsx)(_.CashBalanceIcon, {
                className: "size-7"
            }), N[25] = I, N[26] = g) : g = N[26], N[27] !== E ? (S = (0, v.formatToDollar)(E), N[27] = E, N[28] = S) : S = N[28], N[29] !== F || N[30] !== g || N[31] !== S ? (j = (0, t.jsxs)(R.Value, {
                color: "green",
                size: F,
                weight: "semi",
                children: [g, S]
            }), N[29] = F, N[30] = g, N[31] = S, N[32] = j) : j = N[32], N[33] !== j || N[34] !== f ? (T = (0, t.jsx)(R.Root, {
                children: (0, t.jsxs)(R.Item, {
                    children: [f, j]
                })
            }), N[33] = j, N[34] = f, N[35] = T) : T = N[35], N[36] !== o || N[37] !== T || N[38] !== c ? (M = (0, t.jsx)("div", {
                className: c,
                ...o,
                children: T
            }), N[36] = o, N[37] = T, N[38] = c, N[39] = M) : M = N[39], M
        }),
        V = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                y: 0
            },
            exit: {
                opacity: 0
            }
        },
        H = ({
            ref: e,
            variant: a = "desktop",
            ...n
        }) => {
            let s = (() => {
                    let e, t = (0, r.c)(1);
                    t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side"], t[0] = e) : e = t[0];
                    let {
                        side: a
                    } = (0, x.useTradeContext)(e);
                    return a
                })(),
                o = (0, f.default)(),
                [l, c] = (0, h.useMeasure)(),
                g = i.default.useRef(0),
                [v, y] = i.default.useState(s),
                [b, k] = i.default.useState(!1),
                w = i.default.useMemo(() => {
                    switch (s) {
                        case d.Side.BUY:
                            return (0, t.jsx)(F, {
                                variant: a
                            });
                        case d.Side.SELL:
                            return (0, t.jsx)(q, {
                                variant: a
                            });
                        default:
                            return (0, t.jsx)(F, {
                                variant: a
                            })
                    }
                }, [s, a]),
                S = i.default.useMemo(() => {
                    let e = c.height,
                        t = g.current;
                    if (!t) return g.current = e, .15;
                    let r = Math.abs(e - t);
                    return g.current = e, Math.min(Math.max(r / 500, .15), .27)
                }, [c.height]),
                j = i.default.useMemo(() => v !== s ? (k(!0), .75 * p.transition.duration) : b ? .75 * p.transition.duration : 0, [s, b, v]);
            i.default.useEffect(() => {
                y(s)
            }, [s]);
            let C = i.default.useCallback(() => {
                k(!1)
            }, [k]);
            return (0, t.jsx)(m.motion.div, {
                ref: e,
                className: "w-full",
                initial: {
                    height: "100%"
                },
                animate: {
                    height: o ? c.height : "100%",
                    transition: {
                        ease: p.transition.ease,
                        duration: o ? j : 0
                    }
                },
                onAnimationComplete: C,
                ...n,
                children: (0, t.jsx)("div", {
                    ref: l,
                    className: "relative w-full",
                    children: (0, t.jsx)(u.AnimatePresence, {
                        initial: !1,
                        mode: "popLayout",
                        custom: s,
                        children: (0, t.jsx)(m.motion.div, {
                            className: "w-full",
                            variants: V,
                            initial: "initial",
                            animate: "animate",
                            exit: "exit",
                            transition: {
                                ease: p.opacityTransition.ease,
                                duration: S
                            },
                            children: w
                        }, s)
                    })
                })
            })
        };
    H.displayName = "LimitOrderTradeInfo";
    var U = e.i(373230),
        W = e.i(23128),
        G = e.i(574778),
        Z = e.i(525962),
        K = e.i(158789),
        Y = e.i(927249),
        Q = e.i(618832),
        X = e.i(90783),
        J = e.i(455466),
        ee = e.i(94609),
        et = e.i(798631),
        er = e.i(211721),
        ea = e.i(567476),
        ei = e.i(864006),
        en = e.i(891685),
        es = e.i(6204),
        eo = e.i(294472);
    let el = (e, t) => {
        let [r = "0", a = "0", i = "0"] = e.split(":");
        return (0, J.set)(new Date(t), {
            hours: Number(r),
            minutes: Number(a),
            seconds: Number(i)
        })
    };

    function ec({
        variant: e = "desktop",
        ...r
    }) {
        let a, {
                setOrderExpiration: s,
                orderExpiration: o
            } = (0, x.useTradeContext)(["setOrderExpiration", "orderExpiration"]),
            [l, c] = i.default.useState(!1),
            [d, p] = i.default.useState(!1),
            [h, f] = i.default.useState(!1),
            [g, v] = i.default.useState(() => {
                if (void 0 === o) return "never";
                if (-1 === o) return "in-30-seconds";
                let e = (0, ea.getPersistedExpirationMode)();
                return e || "custom"
            }),
            y = i.default.useCallback(e => {
                v(e), (0, ea.persistExpirationMode)(e)
            }, []),
            [b, k] = i.default.useState(() => new Date),
            [w] = i.default.useState(() => (0, ee.startOfDay)(new Date)),
            [S, j] = i.default.useState(() => {
                var e;
                let t = new Date,
                    r = String(23 === (e = t.getHours()) ? 0 : e + 1).padStart(2, "0"),
                    a = String(t.getMinutes()).padStart(2, "0"),
                    i = String(t.getSeconds()).padStart(2, "0");
                return `${r}:${a}:${i}`
            }),
            [_, T] = i.default.useState(""),
            [M, N] = i.default.useState(!1),
            {
                event: I
            } = (0, en.useEventContext)(["event"]),
            {
                isSportsPage: P
            } = (0, es.useSportsContext)(["isSportsPage"]),
            E = (0, C.useTranslations)(),
            A = (0, ei.useMessages)().time,
            {
                savedExpirationPresets: O,
                addSavedExpirationPreset: D,
                removeSavedExpirationPreset: L
            } = (0, ea.useExpirationPresets)(),
            z = i.default.useMemo(() => P && (I ? .live || I ? .isLive), [P, I]),
            R = i.default.useMemo(() => z ? "end-of-day" : "5m", [z]),
            F = i.default.useMemo(() => (0, ea.parseRelativeExpirationSeconds)(_), [_]),
            $ = i.default.useMemo(() => _.trim().length > 0 && void 0 === F, [_, F]),
            B = i.default.useCallback(e => {
                if ("custom" === e) {
                    y("custom"), p(!0);
                    return
                }
                if (p(!1), "never" === e) {
                    s(void 0), y("never");
                    return
                }
                if ("end-of-day" === e) {
                    s((0, eo.fromDateToUnix)((0, Q.endOfDay)(new Date))), y("end-of-day");
                    return
                }
                if ("in-30-seconds" === e) {
                    s(-1), y("in-30-seconds");
                    return
                }
                if (e in ea.RELATIVE_DURATION_SECONDS) {
                    s((0, ea.getRelativeExpirationTimestamp)(ea.RELATIVE_DURATION_SECONDS[e])), y(e);
                    return
                }
                let t = (0, ea.fromSavedExpirationMode)(e);
                if (!t) return;
                let r = O.find(e => e.id === t);
                r && (s((0, ea.getRelativeExpirationTimestamp)(r.seconds)), y(e))
            }, [O, s, y]),
            q = i.default.useMemo(() => [{
                id: "never",
                label: E("trading.never"),
                onClick: () => B("never")
            }, ...z ? [{
                id: "end-of-day",
                label: E("rewards.endOfDay"),
                onClick: () => B("end-of-day")
            }, {
                id: "in-30-seconds",
                label: E("rewards.expirationModal.in30Seconds"),
                onClick: () => B("in-30-seconds")
            }] : [{
                id: "5m",
                label: E("rewards.expirationModal.fiveMinutes"),
                onClick: () => B("5m")
            }, {
                id: "1h",
                label: E("rewards.expirationModal.oneHour"),
                onClick: () => B("1h")
            }, {
                id: "12h",
                label: E("rewards.expirationModal.twelveHours"),
                onClick: () => B("12h")
            }, {
                id: "24h",
                label: E("rewards.expirationModal.twentyFourHours"),
                onClick: () => B("24h")
            }, {
                id: "end-of-day",
                label: E("rewards.endOfDay"),
                onClick: () => B("end-of-day")
            }], ...O.map(e => ({
                id: (0, ea.toSavedExpirationMode)(e.id),
                label: e.label,
                removable: !0,
                presetId: e.id,
                onClick: () => B((0, ea.toSavedExpirationMode)(e.id))
            })), {
                id: "custom",
                label: E("rewards.custom"),
                onClick: () => B("custom")
            }], [z, O, B, E]),
            V = i.default.useRef(!1);
        i.default.useEffect(() => {
            if ("never" === g) return void s(void 0);
            if (void 0 !== o && !V.current) {
                if (V.current = !0, g in ea.RELATIVE_DURATION_SECONDS) return void s((0, ea.getRelativeExpirationTimestamp)(ea.RELATIVE_DURATION_SECONDS[g]));
                if ("end-of-day" === g) return void s((0, eo.fromDateToUnix)((0, Q.endOfDay)(new Date)));
                if ("in-30-seconds" === g) return void s(-1);
                let e = (0, ea.fromSavedExpirationMode)(g);
                if (e) {
                    let t = O.find(t => t.id === e);
                    if (t) return void s((0, ea.getRelativeExpirationTimestamp)(t.seconds))
                }
                return
            }
            void 0 === o && "custom" !== g && B(R)
        }, [R, g, o, s, B, O]), i.default.useEffect(() => {
            let e = (0, ea.fromSavedExpirationMode)(g);
            !e || O.some(t => t.id === e) || y("custom")
        }, [O, g, y]);
        let [H] = i.default.useState(() => Date.now()), U = E("rewards.custom"), J = i.default.useMemo(() => {
            if ("never" === g) return E("trading.never");
            if ("custom" === g) return o ? (0, eo.getRelativeTime)(1e3 * o, H, !0, A) : U;
            let e = (0, ea.fromSavedExpirationMode)(g);
            if (e) return O.find(t => t.id === e) ? .label ? ? U;
            let t = q.find(e => e.id === g);
            return t ? .label ? ? U
        }, [q, o, O, g, H, U, A]), ed = i.default.useCallback(() => {
            if (_.trim().length > 0) return f(!1), !1;
            let e = el(S, b),
                t = new Date;
            return (0, X.isBefore)(e, t) ? (f(!0), !0) : (f(!1), !1)
        }, [_, b, S]), eu = i.default.useCallback(() => {
            if ($) return !1;
            let e = 0,
                t = 0;
            if (void 0 !== F) t = F, e = (0, ea.getRelativeExpirationTimestamp)(t), f(!1);
            else {
                let r = el(S, b),
                    a = new Date;
                if ((0, X.isBefore)(r, a) || (e = (0, eo.fromDateToUnix)(r), (t = Math.round((r.getTime() - a.getTime()) / 1e3)) < 60)) return f(!0), !1
            }
            s(e);
            let r = "custom";
            if (M) {
                let e = D(t);
                e && (r = (0, ea.toSavedExpirationMode)(e.id))
            }
            return y(r), N(!1), T(""), p(!1), !0
        }, [D, b, $, F, M, s, y, S]), em = i.default.useCallback(() => !!o || eu(), [eu, o]), ep = i.default.useCallback(e => {
            g === (0, ea.toSavedExpirationMode)(e) && y("custom"), L(e)
        }, [L, g, y]);
        return (0, t.jsx)("div", { ...r,
            children: (0, t.jsxs)("div", {
                className: "flex flex-col",
                children: [(0, t.jsxs)("div", {
                    className: "flex w-full justify-between items-center",
                    children: [(0, t.jsx)("span", {
                        className: "text-sm font-medium leading-[18px] text-text-secondary",
                        children: E("trading.expires")
                    }), (0, t.jsxs)(K.DropdownMenu, {
                        open: l,
                        onOpenChange: c,
                        modal: !1,
                        children: [(0, t.jsx)(K.DropdownMenuTrigger, {
                            asChild: !0,
                            children: (0, t.jsxs)("button", {
                                type: "button",
                                className: "inline-flex items-center gap-1 cursor-pointer bg-transparent border-none p-0 text-text-tertiary text-sm font-medium data-[state=open]:[&_svg]:rotate-180",
                                children: [(0, t.jsx)("span", {
                                    className: "capitalize",
                                    children: J
                                }), (0, t.jsx)(et.IconChevronDownOutline12, {
                                    className: "transition-transform duration-200"
                                })]
                            })
                        }), (0, t.jsx)(K.DropdownMenuContent, {
                            sideOffset: 4,
                            align: "end",
                            className: "z-1005 min-w-[120px]",
                            children: q.map(e => (0, t.jsx)(K.DropdownMenuItem, {
                                onClick: e.onClick,
                                className: "py-1.5 px-3 text-sm",
                                children: (0, t.jsxs)("div", {
                                    className: "flex items-center justify-between gap-2 w-full",
                                    children: [(0, t.jsx)("span", {
                                        children: e.label
                                    }), e.removable && e.presetId ? (0, t.jsx)("button", {
                                        type: "button",
                                        className: "inline-flex cursor-pointer items-center justify-center text-neutral-500 hover:text-neutral-900",
                                        onPointerDown: e => {
                                            e.preventDefault(), e.stopPropagation()
                                        },
                                        onClick: t => {
                                            t.preventDefault(), t.stopPropagation(), e.presetId && ep(e.presetId)
                                        },
                                        children: (0, t.jsx)(er.IconXmarkOutline12, {})
                                    }) : null]
                                })
                            }, e.id))
                        })]
                    })]
                }), "desktop" === e && (0, t.jsx)(Z.Modal, {
                    open: d,
                    onOpenChange: p,
                    size: "sm",
                    children: (0, t.jsxs)(Z.ModalContent, {
                        className: "w-full max-w-[348px] flex flex-col",
                        onPointerDownOutside: e => {
                            e.preventDefault(), em() && p(!1)
                        },
                        onInteractOutside: e => {
                            e.preventDefault(), em() && p(!1)
                        },
                        onEscapeKeyDown: e => {
                            e.preventDefault(), em() && p(!1)
                        },
                        children: [(0, t.jsx)("div", {
                            className: "mt-4 mb-2",
                            children: (0, t.jsx)("p", {
                                className: "font-bold text-sm",
                                children: E("rewards.expirationModal.relativeTime")
                            })
                        }), (0, t.jsx)("input", {
                            type: "text",
                            value: _,
                            onChange: e => T(e.target.value),
                            placeholder: E("rewards.expirationModal.relativeTimeHint"),
                            className: (0, n.cn)("border p-3 rounded-md w-full self-center bg-background text-text placeholder:text-neutral-500", $ ? "border-red-600" : "border-border-light")
                        }), _.trim().length > 0 ? (0, t.jsx)("span", {
                            className: (0, n.cn)("text-[10px] font-semibold mt-1", $ ? "text-red-600" : "text-neutral-500"),
                            children: $ ? E("rewards.expirationModal.relativeTimeError") : E("rewards.expirationModal.expiresIn", {
                                time: (0, eo.getRelativeTime)(1e3 * (0, ea.getRelativeExpirationTimestamp)(F ? ? 0), H, !1, A)
                            })
                        }) : null, (0, t.jsx)("div", {
                            className: "mt-4 mb-2",
                            children: (0, t.jsx)("p", {
                                className: "font-bold text-sm",
                                children: E("rewards.date")
                            })
                        }), (0, t.jsx)(G.DatePickerInline, {
                            minDate: w,
                            onChange: e => {
                                h && f(!1), e && k(e)
                            },
                            value: b
                        }), (0, t.jsx)("div", {
                            className: "mt-4 mb-2",
                            children: (0, t.jsx)("p", {
                                className: "font-bold text-sm",
                                children: E("rewards.time")
                            })
                        }), (0, t.jsx)("input", {
                            type: "time",
                            step: 1,
                            onFocus: () => f(!1),
                            onBlur: ed,
                            onChange: e => j(e.target.value),
                            value: S,
                            className: (0, n.cn)("border p-3 rounded-md w-full self-center bg-background text-text", h ? "border-red-600" : "border-border-light")
                        }), (0, t.jsxs)("div", {
                            className: "flex justify-between items-center mt-4",
                            children: [(0, t.jsx)("p", {
                                className: "text-sm font-medium leading-[18px] text-neutral-500",
                                children: E("rewards.expirationModal.saveThisOption")
                            }), (0, t.jsx)(Y.Switch, {
                                checked: M,
                                onCheckedChange: N
                            })]
                        }), (0, t.jsx)(W.Button, {
                            disabled: h || $,
                            onClick: eu,
                            className: "p-4 mt-4 h-[44px]",
                            children: E("rewards.apply")
                        }), h ? (0, t.jsx)("span", {
                            className: "text-red-600 text-[10px] font-semibold mt-1",
                            children: E("rewards.expirationError")
                        }) : null]
                    })
                }), "mobile" === e && (0, t.jsx)(u.AnimatePresence, {
                    children: d && (0, t.jsx)(m.motion.div, {
                        initial: {
                            height: 0,
                            opacity: 0
                        },
                        animate: {
                            height: "auto",
                            opacity: 1
                        },
                        exit: {
                            height: 0,
                            opacity: 0
                        },
                        transition: {
                            duration: .15,
                            ease: [.26, .08, .25, 1]
                        },
                        className: "overflow-hidden",
                        children: (0, t.jsxs)("div", {
                            className: "flex flex-col gap-3 mt-3",
                            children: [(0, t.jsxs)("div", {
                                children: [(0, t.jsx)("p", {
                                    className: "font-medium text-xs text-text-secondary mb-1.5",
                                    children: E("rewards.expirationModal.relativeTime")
                                }), (0, t.jsx)("input", {
                                    type: "text",
                                    value: _,
                                    onChange: e => {
                                        let t = e.target.value;
                                        T(t);
                                        let r = (0, ea.parseRelativeExpirationSeconds)(t);
                                        void 0 !== r && r >= 60 && (s((0, ea.getRelativeExpirationTimestamp)(r)), f(!1))
                                    },
                                    onBlur: () => {
                                        M && void 0 !== F && F >= 60 && (D(F), N(!1))
                                    },
                                    placeholder: E("rewards.expirationModal.relativeTimeHint"),
                                    className: (0, n.cn)("border p-2.5 rounded-md w-full bg-background text-text text-sm placeholder:text-neutral-500", $ || void 0 !== F && F < 60 ? "border-red-600" : "border-border-light")
                                }), _.trim().length > 0 && (0, t.jsx)("span", {
                                    className: (0, n.cn)("text-[10px] font-semibold mt-1 block", $ || void 0 !== F && F < 60 ? "text-red-600" : "text-neutral-500"),
                                    children: $ ? E("rewards.expirationModal.relativeTimeError") : void 0 !== F && F < 60 ? E("rewards.expirationError") : E("rewards.expirationModal.expiresIn", {
                                        time: (0, eo.getRelativeTime)(1e3 * (0, ea.getRelativeExpirationTimestamp)(F ? ? 0), H, !1, A)
                                    })
                                })]
                            }), (0, t.jsxs)("div", {
                                className: "flex items-center gap-2",
                                children: [(0, t.jsx)("span", {
                                    className: "text-xs font-medium text-text-secondary",
                                    children: E("rewards.expirationModal.orPickDateTime")
                                }), (0, t.jsx)("input", {
                                    type: "datetime-local",
                                    min: ((a = new Date).setMinutes(a.getMinutes() - a.getTimezoneOffset()), a.toISOString().slice(0, 16)),
                                    onChange: e => {
                                        let t = e.target.value;
                                        if (!t) return;
                                        let r = new Date(t),
                                            a = new Date,
                                            i = Math.round((r.getTime() - a.getTime()) / 1e3);
                                        (0, X.isBefore)(r, a) || i < 60 ? f(!0) : (f(!1), s((0, eo.fromDateToUnix)(r)), M && (D(i), N(!1)))
                                    },
                                    className: "flex-1 border border-border-light p-2 rounded-md bg-background text-text text-sm"
                                })]
                            }), (0, t.jsxs)("div", {
                                className: "flex justify-between items-center",
                                children: [(0, t.jsx)("p", {
                                    className: "text-xs font-medium text-neutral-500",
                                    children: E("rewards.expirationModal.saveThisOption")
                                }), (0, t.jsx)(Y.Switch, {
                                    checked: M,
                                    onCheckedChange: N
                                })]
                            }), h && (0, t.jsx)("span", {
                                className: "text-red-600 text-[10px] font-semibold",
                                children: E("rewards.expirationError")
                            })]
                        })
                    })
                })]
            })
        })
    }
    let ed = (0, a.cva)("w-full h-full relative box-border", {
        variants: {
            variant: {
                desktop: "",
                mobile: "pt-2 pb-3"
            }
        },
        defaultVariants: {
            variant: "desktop"
        }
    });

    function eu(e) {
        let a, i, d, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C = (0, r.c)(40);
        C[0] !== e ? ({
            variant: d,
            className: a,
            ...i
        } = e, C[0] = e, C[1] = a, C[2] = i, C[3] = d) : (a = C[1], i = C[2], d = C[3]);
        let _ = void 0 === d ? "desktop" : d;
        C[4] === Symbol.for("react.memo_cache_sentinel") ? (u = ["activeMarket"], C[4] = u) : u = C[4];
        let {
            activeMarket: T
        } = (0, s.useEventActiveMarketContext)(u);
        C[5] !== T.orderPriceMinTickSize ? (m = (0, o.getPrecisionFromTickSize)(T.orderPriceMinTickSize), C[5] = T.orderPriceMinTickSize, C[6] = m) : m = C[6];
        let M = m,
            N = `limit-price-section-${M}`;
        C[7] !== M || C[8] !== N ? (p = {
            precision: M,
            limitPriceKey: N
        }, C[7] = M, C[8] = N, C[9] = p) : p = C[9];
        let {
            precision: I,
            limitPriceKey: P
        } = p;
        C[10] !== a || C[11] !== _ ? (h = (0, n.cn)(ed({
            variant: _
        }), a), C[10] = a, C[11] = _, C[12] = h) : h = C[12], C[13] !== P || C[14] !== I ? (f = (0, t.jsx)(l.LimitOrderPriceSection, {
            precision: I
        }, P), C[13] = P, C[14] = I, C[15] = f) : f = C[15];
        let E = "desktop" === _ ? "w-[calc(100%+32px)] -ml-4" : "w-[calc(100%+48px)] -ml-6";
        C[16] !== E ? (x = (0, n.cn)("my-3 border-b border-b-border", E), C[16] = E, C[17] = x) : x = C[17], C[18] !== x ? (g = (0, t.jsx)("div", {
            className: x
        }), C[18] = x, C[19] = g) : g = C[19], C[20] !== _ ? (v = (0, t.jsx)(c.LimitOrderSharesSection, {
            variant: _
        }), C[20] = _, C[21] = v) : v = C[21];
        let A = "desktop" === _ ? "w-[calc(100%+32px)] -ml-4" : "w-[calc(100%+48px)] -ml-6";
        return C[22] !== A ? (y = (0, n.cn)("my-3 border-b border-b-border", A), C[22] = A, C[23] = y) : y = C[23], C[24] !== y ? (b = (0, t.jsx)("div", {
            className: y
        }), C[24] = y, C[25] = b) : b = C[25], C[26] !== _ ? (k = (0, t.jsx)("div", {
            className: "mb-3",
            children: (0, t.jsx)(ec, {
                variant: _
            })
        }), w = (0, t.jsx)(H, {
            className: "limit-trade-info",
            variant: _
        }), S = "desktop" === _ && (0, t.jsx)(U.TradeError, {}), C[26] = _, C[27] = k, C[28] = w, C[29] = S) : (k = C[27], w = C[28], S = C[29]), C[30] !== i || C[31] !== g || C[32] !== v || C[33] !== b || C[34] !== k || C[35] !== w || C[36] !== S || C[37] !== h || C[38] !== f ? (j = (0, t.jsxs)("div", {
            className: h,
            ...i,
            children: [f, g, v, b, k, w, S]
        }), C[30] = i, C[31] = g, C[32] = v, C[33] = b, C[34] = k, C[35] = w, C[36] = S, C[37] = h, C[38] = f, C[39] = j) : j = C[39], j
    }
}, 242022, 633873, 361651, e => {
    "use strict";
    e.s(["MergeShares", () => u], 242022);
    var t = e.i(221628),
        r = e.i(215959),
        a = e.i(416340),
        i = e.i(306243),
        n = e.i(820203),
        s = e.i(749450),
        o = e.i(709638),
        l = e.i(797159),
        c = e.i(604777),
        d = e.i(196593);
    let u = e => {
        let {
            merge: {
                amount: u,
                onChangeAmount: m,
                maxMergeAmount: p
            }
        } = (0, o.useMobileTransactionContext)(), h = (0, c.useTranslations)(), f = (0, l.useOnBlur)(), x = a.default.useRef(null), g = a.default.useCallback(e => {
            let t, r;
            return m(((t = e.replace(/[^0-9.]/g, "")).startsWith(".") && (t = `0${t}`), (r = t.split(".")).length > 2 && (t = `${r[0]}.${r.slice(1).join("")}`), t))
        }, [m]), v = p > 0 n && p !== i.maxUint256, y = a.default.useMemo(() => v ? (0, d.formatUSDCUnits)(p) : "0", [p, v]), b = a.default.useMemo(() => v ? (0, d.formatUSDCUnits)(25 n * p / 100 n) : "0", [p, v]), k = a.default.useMemo(() => v ? (0, d.formatUSDCUnits)(50 n * p / 100 n) : "0", [p, v]);
        return (0, t.jsxs)(r.motion.div, {
            className: "flex flex-col size-full items-center pb-6",
            ...e,
            children: [(0, t.jsxs)("div", {
                className: "w-full flex flex-col items-center pt-8 pb-4 px-8",
                children: [(0, t.jsx)(n.AutosizableInput, {
                    ref: x,
                    inputMode: "decimal",
                    type: "text",
                    placeholder: "0",
                    autoComplete: "off",
                    onBlur: f,
                    value: u,
                    onInput: e => g(e.target.value),
                    align: "center",
                    adornments: "straddle",
                    autosizeOptions: {
                        enabled: !0,
                        mode: "fill"
                    },
                    autoscaleFontOptions: {
                        enabled: !0,
                        maxFontSize: 56,
                        defaultFontSize: 56
                    }
                }), (0, t.jsx)("span", {
                    className: "text-sm font-medium text-text-tertiary -mt-1",
                    children: h("trading.shares").toLowerCase()
                }), v && (0, t.jsxs)("span", {
                    className: "text-xs font-medium text-text-secondary mt-2",
                    children: [y, " ", h("trading.shares").toLowerCase()]
                })]
            }), v && (0, t.jsx)("div", {
                className: "flex flex-1 justify-center",
                children: (0, t.jsxs)("div", {
                    className: "flex gap-1",
                    children: [(0, t.jsx)(s.QuickSelectItem, {
                        label: "25%",
                        onClick: () => m(b)
                    }), (0, t.jsx)(s.QuickSelectItem, {
                        label: "50%",
                        onClick: () => m(k)
                    }), (0, t.jsx)(s.QuickSelectItem, {
                        label: h("trading.max"),
                        onClick: () => m(y)
                    })]
                })
            })]
        })
    };
    u.displayName = "MergeShares", e.s(["OneTapEditContent", () => b], 633873);
    var m = e.i(999061),
        p = e.i(66199),
        h = e.i(23128),
        f = e.i(484275),
        x = e.i(249792),
        g = e.i(606572),
        v = e.i(118818),
        y = e.i(36561);

    function b() {
        let e, r, i, n, s, o, l, c, d, u, b, j, C = (0, m.c)(30),
            {
                setOpen: _
            } = (0, v.useMobileMarketContext)();
        C[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
            defaultValue: f.DEFAULT_PRESETS,
            listenStorageChange: !0
        }, C[0] = e) : e = C[0];
        let [T, M] = (0, p.useLocalStorageState)(f.PRESETS_LS_KEY, e), N = T ? ? f.DEFAULT_PRESETS, I = (0, x.useToast)();
        C[1] !== N ? (r = () => N.map(String), C[1] = N, C[2] = r) : r = C[2];
        let [P, E] = (0, a.useState)(r);
        C[3] !== N ? (i = () => {
            E(N.map(String))
        }, n = [N], C[3] = N, C[4] = i, C[5] = n) : (i = C[4], n = C[5]), a.default.useEffect(i, n), C[6] !== P || C[7] !== _ || C[8] !== M || C[9] !== I ? (s = () => {
            let e = P.map(S);
            e.some(w) ? I.error(new g.ToastBuilder().title("Invalid preset amount").description(`Each preset must be at least $${f.MIN_PRESET}.`)) : (M(e.map(k)), _(!1))
        }, C[6] = P, C[7] = _, C[8] = M, C[9] = I, C[10] = s) : s = C[10];
        let A = s;
        C[11] !== _ ? (o = () => {
            _(!1)
        }, C[11] = _, C[12] = o) : o = C[12];
        let O = o;
        if (C[13] !== P || C[14] !== A) {
            let e;
            C[16] !== A ? (e = (e, r) => (0, t.jsx)(y.PresetEditCard, {
                value: e,
                onChange: e => E(t => {
                    let a = [...t];
                    return a[r] = e, a
                }),
                onSubmit: A
            }, r), C[16] = A, C[17] = e) : e = C[17], l = P.map(e), C[13] = P, C[14] = A, C[15] = l
        } else l = C[15];
        return C[18] !== l ? (c = (0, t.jsx)("div", {
            className: "grid grid-cols-3 gap-2",
            children: l
        }), C[18] = l, C[19] = c) : c = C[19], C[20] !== O ? (d = (0, t.jsx)(h.Button, {
            variant: "outline",
            size: "lg",
            className: "flex-1",
            onClick: O,
            children: "Cancel"
        }), C[20] = O, C[21] = d) : d = C[21], C[22] !== A ? (u = (0, t.jsx)(h.Button, {
            size: "lg",
            className: "flex-1",
            onClick: A,
            children: "Save"
        }), C[22] = A, C[23] = u) : u = C[23], C[24] !== d || C[25] !== u ? (b = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 w-full",
            children: [d, u]
        }), C[24] = d, C[25] = u, C[26] = b) : b = C[26], C[27] !== b || C[28] !== c ? (j = (0, t.jsxs)("div", {
            className: "flex flex-col gap-4 w-full",
            children: [c, b]
        }), C[27] = b, C[28] = c, C[29] = j) : j = C[29], j
    }

    function k(e) {
        return Math.min(e, f.MAX_PRESET)
    }

    function w(e) {
        return !Number.isFinite(e) || e < f.MIN_PRESET
    }

    function S(e) {
        return Number.parseInt(e, 10)
    }
    b.displayName = "OneTapEditContent", e.s(["SplitShares", () => _], 361651);
    var j = e.i(348262),
        C = e.i(900519);
    let _ = e => {
        let i, d, u, p, h, f, x, g, v, y, b, k, w, S, _, T, M, N, I = (0, m.c)(50),
            {
                split: P
            } = (0, o.useMobileTransactionContext)(),
            {
                onChangeAmount: E,
                amount: A,
                trackedProxyUsdcBalance: O
            } = P,
            D = (0, c.useTranslations)(),
            L = (0, l.useOnBlur)(),
            z = a.default.useRef(null);
        I[0] !== E ? (i = e => {
            let t, r;
            return E(((t = e.replace(/[^0-9.]/g, "")).startsWith(".") && (t = `0${t}`), (r = t.split(".")).length > 2 && (t = `${r[0]}.${r.slice(1).join("")}`), t))
        }, I[0] = E, I[1] = i) : i = I[1];
        let R = i,
            F = O.current;
        I[2] !== F ? (d = F > 1 ? Math.floor(F).toString() : F.toFixed(2), I[2] = F, I[3] = d) : d = I[3];
        let $ = d;
        return I[4] !== R ? (u = e => R(e.target.value), I[4] = R, I[5] = u) : u = I[5], I[6] === Symbol.for("react.memo_cache_sentinel") ? (p = {
            enabled: !0,
            mode: "fill"
        }, h = {
            enabled: !0,
            maxFontSize: 56,
            defaultFontSize: 56
        }, I[6] = p, I[7] = h) : (p = I[6], h = I[7]), I[8] !== A || I[9] !== L || I[10] !== u ? (f = (0, t.jsx)(n.AutosizableInput, {
            ref: z,
            inputMode: "decimal",
            type: "text",
            placeholder: "$0",
            autoComplete: "off",
            onBlur: L,
            value: A,
            onInput: u,
            align: "center",
            prefix: "$",
            adornments: "straddle",
            autosizeOptions: p,
            autoscaleFontOptions: h
        }), I[8] = A, I[9] = L, I[10] = u, I[11] = f) : f = I[11], I[12] !== F || I[13] !== D ? (x = (0, C.cashBalanceFormatter)({
            balance: F,
            cashLabel: D("trading.cash")
        }), I[12] = F, I[13] = D, I[14] = x) : x = I[14], I[15] !== x ? (g = (0, t.jsx)("span", {
            className: "text-xs font-medium text-text-secondary mt-2",
            children: x
        }), I[15] = x, I[16] = g) : g = I[16], I[17] !== f || I[18] !== g ? (v = (0, t.jsxs)("div", {
            className: "w-full flex flex-col items-center pt-8 pb-4 px-8",
            children: [f, g]
        }), I[17] = f, I[18] = g, I[19] = v) : v = I[19], I[20] !== A || I[21] !== R ? (y = (0, t.jsx)(s.QuickSelectItem, {
            label: "+$1",
            onClick: () => R((0, j.handleStep)(A, "increment", 1))
        }), I[20] = A, I[21] = R, I[22] = y) : y = I[22], I[23] !== A || I[24] !== R ? (b = (0, t.jsx)(s.QuickSelectItem, {
            label: "+$5",
            onClick: () => R((0, j.handleStep)(A, "increment", 5))
        }), I[23] = A, I[24] = R, I[25] = b) : b = I[25], I[26] !== A || I[27] !== R ? (k = (0, t.jsx)(s.QuickSelectItem, {
            label: "+$10",
            onClick: () => R((0, j.handleStep)(A, "increment", 10))
        }), I[26] = A, I[27] = R, I[28] = k) : k = I[28], I[29] !== A || I[30] !== R ? (w = (0, t.jsx)(s.QuickSelectItem, {
            label: "+$100",
            onClick: () => R((0, j.handleStep)(A, "increment", 100))
        }), I[29] = A, I[30] = R, I[31] = w) : w = I[31], I[32] !== D ? (S = D("trading.max"), I[32] = D, I[33] = S) : S = I[33], I[34] !== R || I[35] !== $ ? (_ = () => R($), I[34] = R, I[35] = $, I[36] = _) : _ = I[36], I[37] !== S || I[38] !== _ ? (T = (0, t.jsx)(s.QuickSelectItem, {
            label: S,
            onClick: _
        }), I[37] = S, I[38] = _, I[39] = T) : T = I[39], I[40] !== y || I[41] !== b || I[42] !== k || I[43] !== w || I[44] !== T ? (M = (0, t.jsx)("div", {
            className: "flex flex-1 justify-center",
            children: (0, t.jsxs)("div", {
                className: "flex gap-1",
                children: [y, b, k, w, T]
            })
        }), I[40] = y, I[41] = b, I[42] = k, I[43] = w, I[44] = T, I[45] = M) : M = I[45], I[46] !== e || I[47] !== M || I[48] !== v ? (N = (0, t.jsxs)(r.motion.div, {
            className: "flex flex-col size-full items-center pb-6",
            ...e,
            children: [v, M]
        }), I[46] = e, I[47] = M, I[48] = v, I[49] = N) : N = I[49], N
    };
    _.displayName = "SplitShares"
}, 43286, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(525962),
        i = e.i(604777),
        n = e.i(211721),
        s = e.i(416340),
        o = e.i(88240),
        l = e.i(771596),
        c = e.i(392566);
    e.s(["UpgradeBalanceModal", 0, e => {
        let d, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C = (0, r.c)(38),
            {
                open: _,
                onOpenChange: T
            } = e,
            M = (0, i.useTranslations)(),
            {
                handleUsdceWrap: N,
                isWrapping: I,
                isSignerLoading: P
            } = (0, l.default)(),
            E = I || P;
        C[0] !== _ ? (d = () => {
            _ && (0, c.ctfV2Info)("upgrade_balance_modal_opened", {
                source: "trade_blocker"
            })
        }, u = [_], C[0] = _, C[1] = d, C[2] = u) : (d = C[1], u = C[2]), s.default.useEffect(d, u), C[3] !== N || C[4] !== T ? (m = async () => {
            (0, c.ctfV2Info)("upgrade_balance_modal_action", {
                action: "upgrade"
            }), (await N()).state === o.TransactionResponseState.Success && T(!1)
        }, C[3] = N, C[4] = T, C[5] = m) : m = C[5];
        let A = m;
        C[6] !== I || C[7] !== T ? (p = () => {
            (0, c.ctfV2Info)("upgrade_balance_modal_action", {
                action: "cancel",
                isWrapping: I
            }), I || T(!1)
        }, C[6] = I, C[7] = T, C[8] = p) : p = C[8];
        let O = p;
        return C[9] === Symbol.for("react.memo_cache_sentinel") ? (h = (0, t.jsx)("h2", {
            className: "text-text-primary text-center text-base font-semibold leading-5",
            children: "Upgrade Balance"
        }), C[9] = h) : h = C[9], C[10] === Symbol.for("react.memo_cache_sentinel") ? (f = (0, t.jsx)(n.IconXmarkOutline12, {
            className: "size-5"
        }), C[10] = f) : f = C[10], C[11] !== O || C[12] !== I ? (x = (0, t.jsxs)("div", {
            className: "relative flex h-8 items-center justify-center",
            children: [h, (0, t.jsx)("button", {
                type: "button",
                onClick: O,
                disabled: I,
                className: "text-text-primary absolute right-0 top-0 flex h-8 items-center justify-center rounded-[10px] bg-[#f4f4f6] px-1.5 transition-opacity hover:opacity-70 disabled:opacity-50 dark:bg-white/10",
                children: f
            })]
        }), C[11] = O, C[12] = I, C[13] = x) : x = C[13], C[14] === Symbol.for("react.memo_cache_sentinel") ? (g = (0, t.jsx)("p", {
            className: "text-text-secondary text-sm font-medium leading-5",
            children: "Part of your balance is in an outdated version of wrapped USDC. Sign the transaction to upgrade the balance to continue with your transaction."
        }), C[14] = g) : g = C[14], C[15] !== x ? (v = (0, t.jsxs)("div", {
            className: "flex flex-col gap-7",
            children: [x, g]
        }), C[15] = x, C[16] = v) : v = C[16], C[17] !== O || C[18] !== I ? (y = (0, t.jsx)("button", {
            type: "button",
            onClick: O,
            disabled: I,
            className: "border-border-primary text-text-primary flex h-10 flex-1 items-center justify-center rounded-[12px] border text-sm font-semibold transition-opacity hover:opacity-70 disabled:opacity-50",
            children: "Cancel"
        }), C[17] = O, C[18] = I, C[19] = y) : y = C[19], C[20] !== P || C[21] !== I || C[22] !== M ? (b = M(I ? "upgradeModal.balance.upgrading" : P ? "upgradeModal.balance.loadingWallet" : "upgradeModal.balance.upgrade"), C[20] = P, C[21] = I, C[22] = M, C[23] = b) : b = C[23], C[24] !== A || C[25] !== E || C[26] !== b ? (k = (0, t.jsx)("button", {
            type: "button",
            onClick: A,
            disabled: E,
            className: "flex h-10 flex-1 items-center justify-center rounded-[12px] bg-(--color-button-primary-bg) text-sm font-semibold text-white transition-opacity hover:opacity-90 disabled:opacity-60",
            children: b
        }), C[24] = A, C[25] = E, C[26] = b, C[27] = k) : k = C[27], C[28] !== y || C[29] !== k ? (w = (0, t.jsxs)("div", {
            className: "flex gap-2",
            children: [y, k]
        }), C[28] = y, C[29] = k, C[30] = w) : w = C[30], C[31] !== w || C[32] !== v ? (S = (0, t.jsxs)(a.ModalContent, {
            className: "flex w-full max-w-[386px] flex-col gap-7 overflow-hidden rounded-[28px] border p-7 shadow-[0px_1px_30px_0px_rgba(9,9,11,0.08)]",
            children: [v, w]
        }), C[31] = w, C[32] = v, C[33] = S) : S = C[33], C[34] !== T || C[35] !== _ || C[36] !== S ? (j = (0, t.jsx)(a.Modal, {
            open: _,
            onOpenChange: T,
            children: S
        }), C[34] = T, C[35] = _, C[36] = S, C[37] = j) : j = C[37], j
    }])
}, 102881, 185291, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(145429);
    e.s(["UpgradeBalanceTooltipContent", 0, e => {
        let i, n, s, o = (0, r.c)(4),
            {
                onUpgrade: l
            } = e;
        return o[0] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsxs)("div", {
            className: "flex items-center gap-1.5",
            children: [(0, t.jsx)(a.IconTriangleWarningOutline18, {
                className: "text-text-primary size-5 shrink-0"
            }), (0, t.jsx)("span", {
                className: "text-text-primary text-sm font-semibold leading-4",
                children: "Partial outdated balance"
            })]
        }), n = (0, t.jsx)("p", {
            className: "text-text-secondary text-sm font-medium leading-5",
            children: "Part of your balance is in an outdated currency. Upgrade your balance to continue with transactions."
        }), o[0] = i, o[1] = n) : (i = o[0], n = o[1]), o[2] !== l ? (s = (0, t.jsxs)("div", {
            className: "border-border-primary flex w-[300px] flex-col gap-3 rounded-[28px] border bg-white p-5 shadow-[0px_1px_30px_0px_rgba(9,9,11,0.08)] dark:bg-[#1a1b1e]",
            children: [i, n, (0, t.jsx)("button", {
                type: "button",
                onClick: l,
                className: "border-border-primary text-text-primary hover:bg-background-secondary hover:border-border-hover flex h-10 w-full items-center justify-center rounded-xl border text-sm font-semibold transition-colors",
                children: "Upgrade balance"
            })]
        }), o[2] = l, o[3] = s) : s = o[3], s
    }], 102881);
    var i = e.i(771596),
        n = e.i(213264),
        s = e.i(784521);

    function o(e) {
        return e.completedUsers
    }
    e.s(["useNeedsBalanceUpgrade", 0, function() {
        let e, t, a = (0, r.c)(4);
        a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["baseAddress"], a[0] = e) : e = a[0];
        let {
            baseAddress: l
        } = (0, s.useAccountContext)(e), {
            hasUsdceBalance: c
        } = (0, i.default)(), d = (0, n.default)(o);
        a[1] !== l || a[2] !== d ? (t = void 0 !== l && d.includes(l.toLowerCase()), a[1] = l, a[2] = d, a[3] = t) : t = a[3];
        let u = t;
        return c && u
    }], 185291)
}, 471179, e => {
    "use strict";
    e.s(["MobileCheckoutButton", () => D], 471179);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(740594),
        i = e.i(723823),
        n = e.i(169010),
        s = e.i(983707),
        o = e.i(215959),
        l = e.i(208956),
        c = e.i(416340),
        d = e.i(100825),
        u = e.i(458164),
        m = e.i(43286),
        p = e.i(102881),
        h = e.i(185291),
        f = e.i(593332),
        x = e.i(349488),
        g = e.i(5146),
        v = e.i(780641),
        y = e.i(668122),
        b = e.i(604777),
        k = e.i(848872),
        w = e.i(730474),
        S = e.i(784521),
        j = e.i(305457),
        C = e.i(399336),
        _ = e.i(767074),
        T = e.i(6204),
        M = e.i(880809),
        N = e.i(631222),
        I = e.i(709638),
        P = e.i(202187),
        E = e.i(928810);

    function A(e) {
        return e.setShowDepositWalletMigrationModal
    }
    let O = c.default.memo(function(e) {
        let O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K = (0, r.c)(97);
        K[0] !== e ? ({
            children: O,
            ...D
        } = e, K[0] = e, K[1] = O, K[2] = D) : (O = K[1], D = K[2]);
        let Y = (0, b.useTranslations)();
        K[3] === Symbol.for("react.memo_cache_sentinel") ? (L = ["orderType", "side", "selectedOutcomeIdx", "selectedOutcome", "shares"], K[3] = L) : L = K[3];
        let {
            orderType: Q,
            side: X,
            selectedOutcomeIdx: J,
            selectedOutcome: ee,
            shares: et
        } = (0, M.useTradeContext)(L), {
            color: er,
            customColors: ea,
            label: ei,
            disabled: en,
            onTap: es,
            orderCreationState: eo
        } = (0, I.useMobileTransactionContext)(), {
            confetti: el
        } = (0, P.useOnTapConfetti)();
        K[4] === Symbol.for("react.memo_cache_sentinel") ? (z = ["activeMarket"], K[4] = z) : z = K[4];
        let {
            activeMarket: ec
        } = (0, C.useEventActiveMarketContext)(z), {
            trackedProxyUsdcBalance: ed
        } = (0, g.default)(), eu = (0, j.useAmplitudeAnalytics)(), {
            onBeginCheckout: em
        } = (0, _.useFunkitContext)();
        K[5] === Symbol.for("react.memo_cache_sentinel") ? (R = ["authenticated", "baseAddress"], K[5] = R) : R = K[5];
        let {
            authenticated: ep,
            baseAddress: eh
        } = (0, S.useAccountContext)(R), ef = (0, w.useModalStore)(A);
        K[6] !== eh ? (F = e => e.isStuck(eh), K[6] = eh, K[7] = F) : F = K[7];
        let ex = (0, k.useStuckSafeMigrationStore)(F);
        K[8] === Symbol.for("react.memo_cache_sentinel") ? ($ = ["isSportsPage"], K[8] = $) : $ = K[8];
        let {
            isSportsPage: eg
        } = (0, T.useSportsContext)($), ev = (0, d.useSportSlug)(), ey = (0, v.usePermissions)(), eb = (0, h.useNeedsBalanceUpgrade)(), [ek, ew] = c.default.useState(!1), eS = (0, i.useBestPrice)(ec, J, "ask"), ej = (0, i.useBestPrice)(ec, J, "bid");
        K[9] !== eS || K[10] !== ej || K[11] !== Q || K[12] !== X || K[13] !== Y ? (B = Q !== u.OrderType.Market || X !== a.Side.BUY || eS.valid ? Q !== u.OrderType.Market || X !== a.Side.SELL || ej.valid ? null : Y("trading.orderBook.noBids") : Y("trading.orderBook.noAsks"), K[9] = eS, K[10] = ej, K[11] = Q, K[12] = X, K[13] = Y, K[14] = B) : B = K[14];
        let eC = B;
        K[15] !== el || K[16] !== Q || K[17] !== X ? (q = (e, t) => {
            Q === u.OrderType.Market && X === a.Side.BUY && el({
                e,
                info: t,
                mode: {
                    type: "event",
                    location: "center"
                }
            })
        }, K[15] = el, K[16] = Q, K[17] = X, K[18] = q) : q = K[18];
        let e_ = q;
        K[19] !== ec.question || K[20] !== ec.slug || K[21] !== ex || K[22] !== e_ || K[23] !== es || K[24] !== Q || K[25] !== ef || K[26] !== et || K[27] !== X ? (V = async (e, t) => {
            if (ex) return void ef(!0); {
                let e = {
                    content_ids: [ec.slug],
                    content_type: "market",
                    content_name: ec.question,
                    currency: "USD",
                    value: parseFloat(et) || 0,
                    order_type: Q === u.OrderType.Market ? "market" : "limit",
                    side: X === a.Side.BUY ? "buy" : "sell"
                };
                window.dataLayer ? .push({
                    event: "initiate_checkout",
                    ...e
                })
            }
            return es(e, t, e_)
        }, K[19] = ec.question, K[20] = ec.slug, K[21] = ex, K[22] = e_, K[23] = es, K[24] = Q, K[25] = ef, K[26] = et, K[27] = X, K[28] = V) : V = K[28];
        let eT = V;
        e: {
            let e;
            if (ep && X === a.Side.BUY && Q === u.OrderType.Market) {
                let e = parseFloat(et);
                if (!Number.isNaN(e) && e > 0 && e > ed.current) {
                    let t, r, a, i = e - ed.current;
                    K[29] !== eu || K[30] !== i || K[31] !== em ? (t = (e, t) => {
                        eu.trackEvent(y.Events.DepositBuySellButtonClicked), em(i.toString())
                    }, K[29] = eu, K[30] = i, K[31] = em, K[32] = t) : t = K[32], K[33] !== Y ? (r = Y("trading.deposit"), K[33] = Y, K[34] = r) : r = K[34], K[35] !== t || K[36] !== r ? (a = {
                        depositOverride: !0,
                        onDepositClick: t,
                        label: r
                    }, K[35] = t, K[36] = r, K[37] = a) : a = K[37], H = a;
                    break e
                }
                if (0 === ed.current) {
                    let e, t, r;
                    K[38] !== eu || K[39] !== em ? (e = (e, t) => {
                        eu.trackEvent(y.Events.DepositBuySellButtonClicked), em()
                    }, K[38] = eu, K[39] = em, K[40] = e) : e = K[40], K[41] !== Y ? (t = Y("trading.deposit"), K[41] = Y, K[42] = t) : t = K[42], K[43] !== e || K[44] !== t ? (r = {
                        depositOverride: !0,
                        onDepositClick: e,
                        label: t
                    }, K[43] = e, K[44] = t, K[45] = r) : r = K[45], H = r;
                    break e
                }
            }
            if (eg && ev === f.SportSlug.MLB) {
                let e = x.mlbNameToAliasMap[ee];
                if (e) {
                    let t, r;
                    K[46] !== X || K[47] !== Y ? (t = Y(X === a.Side.BUY ? "trading.buy" : "trading.sell"), K[46] = X, K[47] = Y, K[48] = t) : t = K[48];
                    let i = t,
                        n = `${i} ${e}`;
                    K[49] !== n ? (r = {
                        label: n,
                        depositOverride: !1
                    }, K[49] = n, K[50] = r) : r = K[50], H = r;
                    break e
                }
            }
            K[51] !== ei ? (e = {
                label: ei,
                depositOverride: !1
            }, K[51] = ei, K[52] = e) : e = K[52],
            H = e
        }
        if (K[53] !== H ? ({
                label: W,
                ...U
            } = H, K[53] = H, K[54] = U, K[55] = W) : (U = K[54], W = K[55]), eC) {
            let e;
            return K[56] !== eC ? (e = (0, t.jsx)(o.motion.div, {
                className: "flex overflow-hidden w-full",
                children: (0, t.jsx)(s.TradingButton, {
                    color: "gray",
                    hoverHeightOffset: 0,
                    className: "opacity-50",
                    softDisable: !0,
                    "aria-disabled": "true",
                    children: (0, t.jsx)("span", {
                        className: "text-sm font-semibold text-text-secondary",
                        children: eC
                    })
                })
            }), K[56] = eC, K[57] = e) : e = K[57], e
        }
        let eM = U.depositOverride && !ey.canDeposit,
            eN = `${X}-${J}`,
            eI = `${X}-${J}-${U.depositOverride}-${Q}`,
            eP = U.depositOverride ? "blue" : er,
            eE = U.depositOverride ? void 0 : ea,
            eA = U.depositOverride ? U.onDepositClick : eT,
            eO = eM || eb || !U.depositOverride && en;
        K[58] !== ec.secondsDelay || K[59] !== O || K[60] !== W || K[61] !== eo || K[62] !== Q || K[63] !== D || K[64] !== eN || K[65] !== eI || K[66] !== eP || K[67] !== eE || K[68] !== eA || K[69] !== eO ? (G = (0, t.jsx)(E.AnimatedButton, {
            textKey: eI,
            color: eP,
            customColors: eE,
            onTap: eA,
            label: W,
            disabled: eO,
            orderCreationState: eo,
            type: "button",
            orderType: Q,
            orderCreationDelay: ec.secondsDelay,
            ...D,
            children: O
        }, eN), K[58] = ec.secondsDelay, K[59] = O, K[60] = W, K[61] = eo, K[62] = Q, K[63] = D, K[64] = eN, K[65] = eI, K[66] = eP, K[67] = eE, K[68] = eA, K[69] = eO, K[70] = G) : G = K[70];
        let eD = G;
        if (eM) {
            let e, r, a, i, s, c, d;
            return K[71] !== Y ? (e = Y("trading.geoRestrictions.depositingUnavailableInRegion"), K[71] = Y, K[72] = e) : e = K[72], K[73] !== e ? (r = (0, t.jsx)("p", {
                children: e
            }), K[73] = e, K[74] = r) : r = K[74], K[75] !== Y ? (a = Y("trading.geoRestrictions.availableRegions"), K[75] = Y, K[76] = a) : a = K[76], K[77] !== a ? (i = (0, t.jsx)(l.default, {
                href: `${N.POLYMARKET_DOCS_LINK}/api-reference/geoblock#blocked-countries`,
                target: "_blank",
                rel: "noopener noreferrer",
                className: "underline text-brand-500 hover:opacity-80",
                children: a
            }), K[77] = a, K[78] = i) : i = K[78], K[79] !== r || K[80] !== i ? (s = (0, t.jsxs)("div", {
                className: "flex flex-col gap-1 py-1",
                children: [r, i]
            }), K[79] = r, K[80] = i, K[81] = s) : s = K[81], K[82] !== eD ? (c = (0, t.jsx)("span", {
                className: "flex w-full opacity-50",
                children: eD
            }), K[82] = eD, K[83] = c) : c = K[83], K[84] !== s || K[85] !== c ? (d = (0, t.jsx)(o.motion.div, {
                className: "flex overflow-hidden w-full",
                children: (0, t.jsx)(n.Tooltip, {
                    content: s,
                    side: "top",
                    sideOffset: 8,
                    children: c
                })
            }), K[84] = s, K[85] = c, K[86] = d) : d = K[86], d
        }
        if (eb) {
            let e, r, a, i;
            return K[87] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(p.UpgradeBalanceTooltipContent, {
                onUpgrade: () => ew(!0)
            }), K[87] = e) : e = K[87], K[88] !== eD ? (r = (0, t.jsx)(o.motion.div, {
                className: "flex overflow-hidden w-full",
                children: (0, t.jsx)(n.Tooltip, {
                    content: e,
                    side: "top",
                    sideOffset: 8,
                    children: (0, t.jsx)("div", {
                        className: "flex w-full",
                        children: eD
                    })
                })
            }), K[88] = eD, K[89] = r) : r = K[89], K[90] !== ek ? (a = (0, t.jsx)(m.UpgradeBalanceModal, {
                open: ek,
                onOpenChange: ew
            }), K[90] = ek, K[91] = a) : a = K[91], K[92] !== r || K[93] !== a ? (i = (0, t.jsxs)(t.Fragment, {
                children: [r, a]
            }), K[92] = r, K[93] = a, K[94] = i) : i = K[94], i
        }
        return K[95] !== eD ? (Z = (0, t.jsx)(o.motion.div, {
            className: "flex overflow-hidden w-full",
            children: eD
        }), K[95] = eD, K[96] = Z) : Z = K[96], Z
    });

    function D() {
        let e, a = (0, r.c)(1);
        return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)("div", {
            className: "w-full",
            children: (0, t.jsx)(O, {}, "trade-button")
        }), a[0] = e) : e = a[0], e
    }
}, 260259, 629141, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(197994);
    let n = ({ ...e
    }) => a.default.createElement(i.Icon, {
        size: "18px",
        ...e
    }, a.default.createElement("path", {
        d: "m15.25,7.5H2.75c-.4141,0-.75-.3359-.75-.75s.3359-.75.75-.75h12.5c.4141,0,.75.3359.75.75s-.3359.75-.75.75Z",
        strokeWidth: "0",
        fill: "currentColor"
    }), a.default.createElement("path", {
        d: "m15.25,12H2.75c-.4141,0-.75-.3359-.75-.75s.3359-.75.75-.75h12.5c.4141,0,.75.3359.75.75s-.3359.75-.75.75Z",
        strokeWidth: "0",
        fill: "currentColor"
    }));
    var s = e.i(86831);
    e.s(["DrawIcon", 0, function(e) {
        let a, i, o, l, c = (0, r.c)(8),
            {
                size: d,
                className: u
            } = e,
            m = void 0 === d ? 40 : d;
        return c[0] !== u ? (a = (0, s.cn)("rounded-full bg-neutral-100 flex justify-center items-center shrink-0", u), c[0] = u, c[1] = a) : a = c[1], c[2] !== m ? (i = {
            width: m,
            height: m,
            minWidth: m,
            minHeight: m
        }, c[2] = m, c[3] = i) : i = c[3], c[4] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)(n, {
            className: "size-5 fill-text-secondary"
        }), c[4] = o) : o = c[4], c[5] !== a || c[6] !== i ? (l = (0, t.jsx)("div", {
            className: a,
            style: i,
            children: o
        }), c[5] = a, c[6] = i, c[7] = l) : l = c[7], l
    }], 260259);
    var o = e.i(184612),
        l = e.i(870555);
    e.s(["SportsMarketImage", 0, function(e) {
        let a, i, n, s, c, d, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C, _ = (0, r.c)(43);
        _[0] !== e ? ({
            ref: c,
            src: u,
            size: p,
            height: s,
            width: b,
            sizes: h,
            placeholder: f,
            blurDataURL: x,
            quality: g,
            className: i,
            containerClassName: n,
            forceHasLoaded: v,
            fallbackImage: y,
            borderRadius: a,
            style: m,
            ...d
        } = e, _[0] = e, _[1] = a, _[2] = i, _[3] = n, _[4] = s, _[5] = c, _[6] = d, _[7] = u, _[8] = m, _[9] = p, _[10] = h, _[11] = f, _[12] = x, _[13] = g, _[14] = v, _[15] = y, _[16] = b) : (a = _[1], i = _[2], n = _[3], s = _[4], c = _[5], d = _[6], u = _[7], m = _[8], p = _[9], h = _[10], f = _[11], x = _[12], g = _[13], v = _[14], y = _[15], b = _[16]);
        let T = void 0 === p ? 40 : p,
            M = void 0 === h ? "(max-width: 768px) 15vw, (max-width: 1400px) 10vw, 90px" : h,
            N = void 0 === f ? "blur" : f,
            I = void 0 === x ? "data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" : x,
            P = void 0 === g ? 100 : g,
            E = void 0 === y ? "/default-avatar.png" : y,
            A = b ? ? T,
            O = s ? ? T;
        _[17] !== n ? (k = (0, l.cn)("relative overflow-hidden", n), _[17] = n, _[18] = k) : k = _[18];
        let D = `${A}px`,
            L = `${O}px`,
            z = `${A}px`,
            R = `${O}px`,
            F = a || 999;
        _[19] !== L || _[20] !== z || _[21] !== R || _[22] !== F || _[23] !== D ? (w = {
            width: D,
            height: L,
            minWidth: z,
            minHeight: R,
            borderRadius: F
        }, _[19] = L, _[20] = z, _[21] = R, _[22] = F, _[23] = D, _[24] = w) : w = _[24];
        let $ = u || E;
        return _[25] !== i ? (S = (0, l.cn)("object-contain", i), _[25] = i, _[26] = S) : S = _[26], _[27] !== I || _[28] !== O || _[29] !== A || _[30] !== N || _[31] !== P || _[32] !== c || _[33] !== d || _[34] !== M || _[35] !== m || _[36] !== $ || _[37] !== S ? (j = (0, t.jsx)(o.default, {
            ref: c,
            src: $,
            width: A,
            height: O,
            quality: P,
            placeholder: N,
            blurDataURL: I,
            sizes: M,
            className: S,
            style: m,
            priority: !0,
            ...d
        }), _[27] = I, _[28] = O, _[29] = A, _[30] = N, _[31] = P, _[32] = c, _[33] = d, _[34] = M, _[35] = m, _[36] = $, _[37] = S, _[38] = j) : j = _[38], _[39] !== w || _[40] !== j || _[41] !== k ? (C = (0, t.jsx)("div", {
            className: k,
            style: w,
            children: j
        }), _[39] = w, _[40] = j, _[41] = k, _[42] = C) : C = _[42], C
    }], 629141)
}, 439442, 467943, e => {
    "use strict";
    e.s(["TradeHeader", () => D], 439442);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(740594),
        i = e.i(766181),
        n = e.i(219469),
        s = e.i(215959),
        o = e.i(821986),
        l = e.i(416340),
        c = e.i(23128),
        d = e.i(158789),
        u = e.i(260259),
        m = e.i(458164),
        p = e.i(896414),
        h = e.i(276918),
        f = e.i(642396),
        x = e.i(500324),
        g = e.i(629141),
        v = e.i(422868),
        y = e.i(879756),
        b = e.i(467126),
        k = e.i(909420),
        w = e.i(870555),
        S = e.i(604777),
        j = e.i(784521),
        C = e.i(399336),
        _ = e.i(891685),
        T = e.i(6204),
        M = e.i(880809);
    let N = {
            containerClassName: "overflow-hidden bg-transparent flex justify-center items-center",
            style: {
                width: "auto",
                height: 40
            }
        },
        I = [.26, .08, .25, 1],
        P = {
            opacity: 1,
            transition: {
                duration: .22,
                ease: I,
                delay: .1
            }
        },
        E = {
            opacity: 0,
            transition: {
                duration: .1,
                ease: I
            }
        },
        A = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: {
                    type: "tween",
                    ease: "easeOut",
                    duration: .075,
                    delay: .05
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    type: "tween",
                    ease: "easeOut",
                    duration: .075
                }
            }
        },
        O = (0, i.cva)("flex-1 box-border gap-3 w-full", {
            variants: {
                row: {
                    top: "justify-between pb-3",
                    bottom: "h-16 w-full pt-3 pb-2"
                }
            }
        });

    function D(e) {
        let i, I, D, F, $, B, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er, ea, ei, en, es, eo, el, ec = (0, r.c)(108);
        ec[0] !== e ? ({
            className: i,
            ...I
        } = e, ec[0] = e, ec[1] = i, ec[2] = I) : (i = ec[1], I = ec[2]);
        let ed = (0, S.useTranslations)();
        ec[3] === Symbol.for("react.memo_cache_sentinel") ? (D = ["isSportsPage"], ec[3] = D) : D = ec[3];
        let {
            isSportsPage: eu
        } = (0, T.useSportsContext)(D);
        ec[4] === Symbol.for("react.memo_cache_sentinel") ? (F = ["selectedOutcomeIdx", "side", "orderType", "setOrderType", "setSelectedOutcomeIdx"], ec[4] = F) : F = ec[4];
        let {
            selectedOutcomeIdx: em,
            side: ep,
            orderType: eh,
            setOrderType: ef,
            setSelectedOutcomeIdx: ex
        } = (0, M.useTradeContext)(F), {
            tradeType: eg,
            setTradeState: ev
        } = (0, y.useMobileTradeContext)();
        ec[5] === Symbol.for("react.memo_cache_sentinel") ? ($ = ["activeMarket"], ec[5] = $) : $ = ec[5];
        let {
            activeMarket: ey
        } = (0, C.useEventActiveMarketContext)($);
        ec[6] === Symbol.for("react.memo_cache_sentinel") ? (B = ["event"], ec[6] = B) : B = ec[6];
        let {
            event: eb
        } = (0, _.useEventContext)(B);
        ec[7] === Symbol.for("react.memo_cache_sentinel") ? (q = ["authenticated"], ec[7] = q) : q = ec[7];
        let {
            authenticated: ek
        } = (0, j.useAccountContext)(q), {
            hasAllShares: ew,
            numericalShareBalances: eS
        } = (0, v.useMobileMarketPositionContext)(), ej = !!ey.negRiskSportsMarketType, eC = (0, b.useOneClickEligible)(), [, e_] = (0, b.useOneClickEnabled)(), eT = eC && ep === a.Side.BUY, eM = eC && ep === a.Side.BUY;
        ec[8] !== eS ? (V = eS.some(R), ec[8] = eS, ec[9] = V) : V = ec[9];
        let eN = V;
        ec[10] !== ey.negRiskSportsMarketType || ec[11] !== ey.outcomes || ec[12] !== ey.sportsMarketType || ec[13] !== ej || ec[14] !== eu || ec[15] !== eS || ec[16] !== eh || ec[17] !== ep || ec[18] !== eg ? (H = eh === m.OrderType.Limit && "trade" === eg && ey.outcomes.length >= 2 && !(eu && ej && "draw" === ey.negRiskSportsMarketType) && "totals" !== ey.sportsMarketType && "spreads" !== ey.sportsMarketType && (ep !== a.Side.SELL || eS.filter(z).length >= 2), ec[10] = ey.negRiskSportsMarketType, ec[11] = ey.outcomes, ec[12] = ey.sportsMarketType, ec[13] = ej, ec[14] = eu, ec[15] = eS, ec[16] = eh, ec[17] = ep, ec[18] = eg, ec[19] = H) : H = ec[19];
        let eI = H;
        ec[20] !== ex ? (U = () => {
            ex(L)
        }, ec[20] = ex, ec[21] = U) : U = ec[21];
        let eP = U;
        ec[22] !== ev || ec[23] !== ep || ec[24] !== eg ? (W = e => {
            (e !== ep || "trade" !== eg) && ev({
                type: "trade",
                side: e
            })
        }, ec[22] = ev, ec[23] = ep, ec[24] = eg, ec[25] = W) : W = ec[25];
        let eE = W,
            [eA, eO] = l.default.useState(!1);
        ec[26] !== eM || ec[27] !== e_ || ec[28] !== ef || ec[29] !== ev || ec[30] !== ep || ec[31] !== eg ? (G = e => {
            switch (e) {
                case "market":
                    eM && e_(!1), ef(m.OrderType.Market), "trade" !== eg && ev({
                        type: "trade",
                        side: ep
                    });
                    break;
                case "limit":
                    eM && e_(!1), ef(m.OrderType.Limit), "trade" !== eg && ev({
                        type: "trade",
                        side: ep
                    });
                    break;
                case "one-tap":
                    e_(!0), ev({
                        type: "one-tap"
                    });
                    break;
                case "merge":
                    eM && e_(!1), ev({
                        type: "merge"
                    });
                    break;
                case "split":
                    eM && e_(!1), ev({
                        type: "split"
                    })
            }
        }, ec[26] = eM, ec[27] = e_, ec[28] = ef, ec[29] = ev, ec[30] = ep, ec[31] = eg, ec[32] = G) : G = ec[32];
        let eD = G;
        e: {
            if ("merge" === eg) {
                Z = "merge";
                break e
            }
            if ("split" === eg) {
                Z = "split";
                break e
            }
            if ("one-tap" === eg) {
                Z = "one-tap";
                break e
            }
            Z = eh === m.OrderType.Limit ? "limit" : "market"
        }
        let eL = Z;
        t: {
            let e;
            if (eu) {
                let e, t;
                ec[33] !== ey || ec[34] !== ej || ec[35] !== em ? (e = (0, k.getSportsHeaders)({
                    market: ey,
                    outcomeIndex: em,
                    isNegRisk: ej
                }), ec[33] = ey, ec[34] = ej, ec[35] = em, ec[36] = e) : e = ec[36];
                let r = e,
                    a = r.image ? ? ey.image,
                    i = ej && "draw" === ey.negRiskSportsMarketType;
                ec[37] !== r.header || ec[38] !== r.subheader || ec[39] !== a || ec[40] !== i ? (t = {
                    title: r.header,
                    subtitle: void 0,
                    chipText: r.subheader,
                    image: a,
                    isNegRiskDraw: i
                }, ec[37] = r.header, ec[38] = r.subheader, ec[39] = a, ec[40] = i, ec[41] = t) : t = ec[41], K = t;
                break t
            }
            if (eb.markets.length > 1) {
                let e, t = ey.outcomes[em];
                ec[42] !== ey.groupItemTitle || ec[43] !== ey.image || ec[44] !== eb.title || ec[45] !== t ? (e = {
                    title: eb.title,
                    subtitle: ey.groupItemTitle,
                    chipText: t,
                    image: ey.image,
                    isNegRiskDraw: !1
                }, ec[42] = ey.groupItemTitle, ec[43] = ey.image, ec[44] = eb.title, ec[45] = t, ec[46] = e) : e = ec[46], K = e;
                break t
            }
            let t = ey.outcomes[em];ec[47] !== ey.image || ec[48] !== eb.title || ec[49] !== t ? (e = {
                title: eb.title,
                subtitle: void 0,
                chipText: t,
                image: ey.image,
                isNegRiskDraw: !1
            }, ec[47] = ey.image, ec[48] = eb.title, ec[49] = t, ec[50] = e) : e = ec[50],
            K = e
        }
        let {
            title: ez,
            subtitle: eR,
            chipText: eF,
            image: e$,
            isNegRiskDraw: eB
        } = K;
        ec[51] !== i ? (Y = (0, w.cn)("flex w-full flex-col relative", i), ec[51] = i, ec[52] = Y) : Y = ec[52], ec[53] === Symbol.for("react.memo_cache_sentinel") ? (Q = (0, w.cn)(O({
            row: "top"
        }), "flex"), ec[53] = Q) : Q = ec[53];
        let eq = "trade" === eg ? "trade-tabs" : "empty";
        return ec[54] === Symbol.for("react.memo_cache_sentinel") ? (X = {
            opacity: 0
        }, ec[54] = X) : X = ec[54], ec[55] !== eN || ec[56] !== eE || ec[57] !== ep || ec[58] !== ed || ec[59] !== eg ? (J = "trade" === eg ? (0, t.jsxs)("div", {
            className: "flex items-center gap-1.5",
            children: [(0, t.jsx)("button", {
                type: "button",
                onClick: () => eE(a.Side.BUY),
                className: (0, w.cn)("rounded-full px-4 h-8 text-sm font-semibold cursor-pointer transition-colors duration-150", ep === a.Side.BUY ? "bg-neutral-50 dark:bg-neutral-100 text-text-primary" : "text-text-secondary hover:text-text-tertiary"),
                children: ed("trading.buy")
            }), eN && (0, t.jsx)("button", {
                type: "button",
                onClick: () => eE(a.Side.SELL),
                className: (0, w.cn)("rounded-full px-4 h-8 text-sm font-semibold cursor-pointer transition-colors duration-150", ep === a.Side.SELL ? "bg-neutral-50 dark:bg-neutral-100 text-text-primary" : "text-text-secondary hover:text-text-tertiary"),
                children: ed("trading.sell")
            })]
        }) : (0, t.jsx)("div", {}), ec[55] = eN, ec[56] = eE, ec[57] = ep, ec[58] = ed, ec[59] = eg, ec[60] = J) : J = ec[60], ec[61] !== eq || ec[62] !== J ? (ee = (0, t.jsx)(n.AnimatePresence, {
            initial: !1,
            mode: "popLayout",
            children: (0, t.jsx)(s.motion.div, {
                initial: X,
                animate: P,
                exit: E,
                children: J
            }, eq)
        }), ec[61] = eq, ec[62] = J, ec[63] = ee) : ee = ec[63], ec[64] !== ek || ec[65] !== ew || ec[66] !== eD || ec[67] !== eA || ec[68] !== eL || ec[69] !== eT || ec[70] !== ed || ec[71] !== eg ? (et = "redeem" !== eg && "sports-redeem" !== eg && (0, t.jsx)(s.motion.div, {
            className: "flex items-center",
            variants: A,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            children: (0, t.jsxs)(d.DropdownMenu, {
                open: eA,
                onOpenChange: eO,
                children: [(0, t.jsx)(d.DropdownMenuTrigger, {
                    asChild: !0,
                    children: (0, t.jsx)(c.Button, {
                        variant: "ghost",
                        size: "iconSm",
                        "aria-label": "Order type settings",
                        className: "focus-visible:ring-0 focus-visible:ring-offset-0",
                        children: (0, t.jsx)(f.Sliders, {
                            active: eA
                        })
                    })
                }), (0, t.jsx)(d.DropdownMenuContent, {
                    align: "end",
                    side: "bottom",
                    sideOffset: 6,
                    className: "min-w-[120px] z-[calc(var(--z-drawer)+20)]",
                    children: (0, t.jsxs)(d.DropdownMenuRadioGroup, {
                        value: eL,
                        onValueChange: eD,
                        children: [(0, t.jsx)(d.DropdownMenuRadioItem, {
                            value: "market",
                            className: "py-1.5 px-3 text-sm",
                            hideIndicator: !0,
                            children: ed("trading.market")
                        }), (0, t.jsx)(d.DropdownMenuRadioItem, {
                            value: "limit",
                            className: "py-1.5 px-3 text-sm",
                            hideIndicator: !0,
                            children: ed("trading.limit")
                        }), eT && (0, t.jsx)(d.DropdownMenuRadioItem, {
                            value: "one-tap",
                            className: "py-1.5 px-3 text-sm",
                            hideIndicator: !0,
                            children: "1-Tap"
                        }), ek && (0, t.jsxs)(t.Fragment, {
                            children: [(0, t.jsx)(d.DropdownMenuSeparator, {
                                className: "-mx-1.5"
                            }), ew && (0, t.jsx)(d.DropdownMenuRadioItem, {
                                value: "merge",
                                className: "py-1.5 px-3 text-sm",
                                hideIndicator: !0,
                                children: (0, t.jsx)("span", {
                                    className: "text-text-secondary",
                                    children: ed("trading.merge")
                                })
                            }), (0, t.jsx)(d.DropdownMenuRadioItem, {
                                value: "split",
                                className: "py-1.5 px-3 text-sm",
                                hideIndicator: !0,
                                children: (0, t.jsx)("span", {
                                    className: "text-text-secondary",
                                    children: ed("trading.split")
                                })
                            })]
                        })]
                    })
                })]
            })
        }, "settings-dropdown"), ec[64] = ek, ec[65] = ew, ec[66] = eD, ec[67] = eA, ec[68] = eL, ec[69] = eT, ec[70] = ed, ec[71] = eg, ec[72] = et) : et = ec[72], ec[73] !== et ? (er = (0, t.jsx)(n.AnimatePresence, {
            initial: !1,
            children: et
        }), ec[73] = et, ec[74] = er) : er = ec[74], ec[75] !== ee || ec[76] !== er ? (ea = (0, t.jsxs)("div", {
            className: Q,
            children: [ee, er]
        }), ec[75] = ee, ec[76] = er, ec[77] = ea) : ea = ec[77], ec[78] !== ey.sportsMarketType ? (ei = "totals" === ey.sportsMarketType && (0, t.jsx)("div", {
            className: "flex h-fit overflow-visible items-end",
            children: (0, t.jsx)(x.LineSelector, {
                type: "totals",
                location: "trade-header"
            })
        }), ec[78] = ey.sportsMarketType, ec[79] = ei) : ei = ec[79], ec[80] !== ey.sportsMarketType ? (en = "spreads" === ey.sportsMarketType && (0, t.jsx)("div", {
            className: "flex h-fit overflow-visible items-end",
            children: (0, t.jsx)(x.LineSelector, {
                type: "spreads",
                location: "trade-header"
            })
        }), ec[80] = ey.sportsMarketType, ec[81] = en) : en = ec[81], ec[82] !== ey.outcomes || ec[83] !== ey.sportsMarketType || ec[84] !== eI || ec[85] !== eF || ec[86] !== e$ || ec[87] !== ej || ec[88] !== eB || ec[89] !== eu || ec[90] !== eP || ec[91] !== eh || ec[92] !== em || ec[93] !== ep || ec[94] !== eR || ec[95] !== ed || ec[96] !== ez || ec[97] !== eg ? (es = "one-tap" !== eg && (0, t.jsxs)(s.motion.div, {
            initial: {
                opacity: 0
            },
            animate: P,
            exit: E,
            className: (0, w.cn)(O({
                row: "bottom"
            }), "flex items-center"),
            children: [eu && !eB && "totals" !== ey.sportsMarketType && (0, t.jsx)(g.SportsMarketImage, {
                src: e$,
                borderRadius: "7px",
                alt: (0, h.getMarketImageAlt)(eR ? ? ez),
                size: 42,
                ...N
            }, e$), eu && "totals" === ey.sportsMarketType && (0, t.jsxs)("div", {
                className: "relative min-w-[42px] w-[42px] min-h-[42px] h-[42px] rounded-md bg-neutral-50 justify-center items-center overflow-hidden",
                children: [(0, t.jsxs)("div", {
                    className: "absolute w-[42px] h-[42px] left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 overflow-hidden",
                    children: [(0, t.jsx)("div", {
                        className: (0, w.cn)("absolute inset-0 bg-green-500 opacity-100 transition-opacity", 1 === em && "opacity-35"),
                        style: {
                            clipPath: "polygon(0 0, 100% 0, 0 100%)"
                        }
                    }), (0, t.jsx)("div", {
                        className: (0, w.cn)("absolute inset-0 bg-red-600 opacity-100 transition-opacity", 0 === em && "opacity-35"),
                        style: {
                            clipPath: "polygon(100% 0, 0 100%, 100% 100%)"
                        }
                    })]
                }), (0, t.jsx)("div", {
                    className: "absolute left-1.5 top-1 z-1",
                    children: (0, t.jsx)("p", {
                        className: (0, w.cn)("text-[white] text-xs font-medium opacity-100 transition-opacity", 0 !== em && "opacity-90 dark:opacity-60"),
                        children: "O"
                    })
                }), (0, t.jsx)("div", {
                    className: "absolute right-1.5 bottom-1 z-1",
                    children: (0, t.jsx)("p", {
                        className: (0, w.cn)("text-[white] text-xs font-medium opacity-100 transition-opacity", 1 !== em && "opacity-90 dark:opacity-60"),
                        children: "U"
                    })
                })]
            }), !eu && !eB && (0, t.jsx)(p.MarketImage, {
                image: e$,
                marketName: eR ? ? ez,
                containerClassName: "rounded-[7px]",
                size: 42
            }, e$), eB && (0, t.jsx)(u.DrawIcon, {
                size: 42
            }), (0, t.jsx)("div", {
                className: "flex flex-col gap-1 flex-1 min-w-0 w-0 overflow-hidden justify-center",
                children: "trade" === eg ? (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)("div", {
                        className: "flex flex-1 justify-between",
                        children: (0, t.jsx)("span", {
                            className: "flex-1 text-sm font-medium text-text-secondary overflow-hidden text-ellipsis whitespace-nowrap line-clamp-1",
                            children: ez
                        })
                    }), (0, t.jsx)("div", {
                        className: (0, w.cn)("flex w-full justify-between gap-2", ep === a.Side.SELL && eh === m.OrderType.Limit && "justify-start"),
                        children: (() => {
                            let e = (0, t.jsxs)(t.Fragment, {
                                children: [!!eR && (0, t.jsx)("span", {
                                    className: "text-base font-semibold text-text-primary mr-1.5 min-w-0 line-clamp-1",
                                    children: eR
                                }), (0, t.jsx)("span", {
                                    className: "flex items-center gap-1.5 text-base font-semibold whitespace-nowrap",
                                    children: eu && !ej ? (0, t.jsx)("span", {
                                        className: "text-text-primary",
                                        children: eF
                                    }) : (0, t.jsxs)(t.Fragment, {
                                        children: [(!!eR || eu && ej) && (0, t.jsxs)(t.Fragment, {
                                            children: [!eR && (0, t.jsx)("span", {
                                                className: "text-text-primary",
                                                children: eF
                                            }), (0, t.jsx)("span", {
                                                className: "text-text-tertiary",
                                                children: "·"
                                            })]
                                        }), (0, t.jsx)("span", {
                                            className: 0 === em ? "text-green-500" : "text-red-500",
                                            children: eR || eu && ej ? ey.outcomes[em] : eF
                                        })]
                                    })
                                })]
                            });
                            if (eI) {
                                let r = ey.outcomes[+(0 === em)];
                                return (0, t.jsxs)("button", {
                                    type: "button",
                                    onClick: eP,
                                    "aria-label": `Switch to ${r}`,
                                    className: "flex items-center h-5 flex-1 min-w-0 cursor-pointer text-left",
                                    children: [e, (0, t.jsx)(o.IconArrowsOppositeDirectionXOutline12, {
                                        className: "text-text-secondary size-3 shrink-0 ml-1.5"
                                    })]
                                })
                            }
                            return (0, t.jsx)("div", {
                                className: "flex items-center h-5 flex-1 min-w-0",
                                children: e
                            })
                        })()
                    })]
                }) : (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)("span", {
                        className: "text-sm font-medium text-text-secondary overflow-hidden text-ellipsis whitespace-nowrap line-clamp-1",
                        children: ez
                    }), (0, t.jsxs)("span", {
                        className: "text-base font-semibold text-text-primary",
                        children: [ed("merge" === eg ? "trading.merge" : "trading.split"), " ", ed("trading.shares").toLowerCase()]
                    })]
                })
            })]
        }, `bottom-${eg}`), ec[82] = ey.outcomes, ec[83] = ey.sportsMarketType, ec[84] = eI, ec[85] = eF, ec[86] = e$, ec[87] = ej, ec[88] = eB, ec[89] = eu, ec[90] = eP, ec[91] = eh, ec[92] = em, ec[93] = ep, ec[94] = eR, ec[95] = ed, ec[96] = ez, ec[97] = eg, ec[98] = es) : es = ec[98], ec[99] !== es ? (eo = (0, t.jsx)(n.AnimatePresence, {
            initial: !1,
            mode: "popLayout",
            children: es
        }), ec[99] = es, ec[100] = eo) : eo = ec[100], ec[101] !== I || ec[102] !== Y || ec[103] !== ea || ec[104] !== ei || ec[105] !== en || ec[106] !== eo ? (el = (0, t.jsxs)(s.motion.div, {
            className: Y,
            ...I,
            children: [ea, ei, en, eo]
        }), ec[101] = I, ec[102] = Y, ec[103] = ea, ec[104] = ei, ec[105] = en, ec[106] = eo, ec[107] = el) : el = ec[107], el
    }

    function L(e) {
        return +(0 === e)
    }

    function z(e) {
        return e > 0
    }

    function R(e) {
        return e > 0
    }
    var F = e.i(261391);
    let $ = ({
            shares: e,
            sharesReceived: t,
            averagePrice: r,
            usdcReceived: a,
            feeEnabled: i,
            feeValue: n
        }) => {
            let s = parseFloat(e);
            return !Number.isNaN(s) && s > 0 ? {
                canRender: !0,
                sharesReceived: t,
                shares: s,
                averagePrice: r,
                usdcReceived: a,
                feeEnabled: i,
                feeValue: n
            } : {
                canRender: !1,
                sharesReceived: t,
                shares: void 0,
                averagePrice: void 0,
                usdcReceived: void 0,
                feeEnabled: i,
                feeValue: n
            }
        },
        B = l.default.createContext({});
    e.s(["MarketOrderContextProvider", 0, e => {
        let a, i, n, s, o, c, d = (0, r.c)(27),
            {
                mode: u,
                children: m
            } = e,
            p = void 0 === u ? "desktop" : u;
        d[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["shares"], d[0] = a) : a = d[0];
        let {
            shares: h
        } = (0, M.useTradeContext)(a), {
            averagePrice: f,
            sharesReceived: x,
            usdcReceived: g,
            feeEnabled: v,
            feeValue: y
        } = (0, F.useMarketOrderDetail)();
        d[1] !== f || d[2] !== v || d[3] !== y || d[4] !== h || d[5] !== x || d[6] !== g ? (i = () => $({
            shares: h,
            sharesReceived: x,
            averagePrice: f,
            usdcReceived: g,
            feeEnabled: v,
            feeValue: y
        }), d[1] = f, d[2] = v, d[3] = y, d[4] = h, d[5] = x, d[6] = g, d[7] = i) : i = d[7];
        let [b, k] = l.default.useState(i);
        d[8] !== f || d[9] !== v || d[10] !== y || d[11] !== p || d[12] !== h || d[13] !== x || d[14] !== g ? (n = () => {
            "mobile" === p && k($({
                shares: h,
                sharesReceived: x,
                averagePrice: f,
                usdcReceived: g,
                feeEnabled: v,
                feeValue: y
            }))
        }, s = [h, x, f, g, p, v, y], d[8] = f, d[9] = v, d[10] = y, d[11] = p, d[12] = h, d[13] = x, d[14] = g, d[15] = n, d[16] = s) : (n = d[15], s = d[16]), l.default.useEffect(n, s);
        e: {
            if ("desktop" === p) {
                let e;
                d[17] !== f || d[18] !== v || d[19] !== y || d[20] !== h || d[21] !== x || d[22] !== g ? (e = $({
                    shares: h,
                    sharesReceived: x,
                    averagePrice: f,
                    usdcReceived: g,
                    feeEnabled: v,
                    feeValue: y
                }), d[17] = f, d[18] = v, d[19] = y, d[20] = h, d[21] = x, d[22] = g, d[23] = e) : e = d[23], o = e;
                break e
            }
            o = b
        }
        let w = o;
        return d[24] !== m || d[25] !== w ? (c = (0, t.jsx)(B.Provider, {
            value: w,
            children: m
        }), d[24] = m, d[25] = w, d[26] = c) : c = d[26], c
    }, "useMarketOrderContext", 0, () => l.default.useContext(B)], 467943)
}, 626622, 897765, e => {
    "use strict";
    e.s(["MobileMarketOrderAmountSection", () => S], 626622);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(740594),
        i = e.i(188474),
        n = e.i(219469),
        s = e.i(215959);
    e.i(416340);
    var o = e.i(288576),
        l = e.i(410988),
        c = e.i(797159),
        d = e.i(63782),
        u = e.i(900519),
        m = e.i(507909),
        p = e.i(5146),
        h = e.i(604777),
        f = e.i(85510),
        x = e.i(134709),
        g = e.i(870555),
        v = e.i(784521),
        y = e.i(880809),
        b = e.i(422868),
        k = e.i(820203);
    let w = {
        initial: {
            opacity: 0
        },
        animate: {
            opacity: 1,
            y: 0
        },
        exit: {
            opacity: 0
        }
    };

    function S(e) {
        let S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, R, F, $, B = (0, r.c)(47);
        B[0] !== e ? ({
            className: S,
            ...j
        } = e, B[0] = e, B[1] = S, B[2] = j) : (S = B[1], j = B[2]);
        let q = (0, h.useTranslations)(),
            {
                side: V
            } = (() => {
                let e, t, a = (0, r.c)(6);
                a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side", "shares", "setShares", "setAmountUpdateLocation"], a[0] = e) : e = a[0];
                let {
                    side: i,
                    shares: n,
                    setShares: s,
                    setAmountUpdateLocation: o
                } = (0, y.useTradeContext)(e);
                return a[1] !== o || a[2] !== s || a[3] !== n || a[4] !== i ? (t = {
                    side: i,
                    shares: n,
                    setShares: s,
                    setAmountUpdateLocation: o
                }, a[1] = o, a[2] = s, a[3] = n, a[4] = i, a[5] = t) : t = a[5], t
            })();
        B[3] === Symbol.for("react.memo_cache_sentinel") ? (C = ["authenticated"], B[3] = C) : C = B[3];
        let {
            authenticated: H
        } = (0, v.useAccountContext)(C), {
            trackedProxyUsdcBalance: U
        } = (0, p.default)(), {
            formattedSharesForOutcome: W
        } = (0, b.useMobileMarketPositionContext)(), [G, Z] = (0, f.useMeasure)(), K = (0, x.default)(), {
            shakeAmount: Y,
            setShakeAmount: Q
        } = (0, o.useTradeAnimationContext)();
        B[4] !== Q ? (_ = {
            duration: .5,
            onComplete: () => {
                Q(!1)
            }
        }, B[4] = Q, B[5] = _) : _ = B[5], B[6] !== Y || B[7] !== _ ? (T = {
            enabled: Y,
            animationOptions: _
        }, B[6] = Y, B[7] = _, B[8] = T) : T = B[8];
        let {
            ref: X
        } = (0, d.useShake)(T), J = (0, i.useComposedRefs)(G, X), {
            ref: ee,
            value: et
        } = (0, l.useAmountFieldMask)(), er = (0, c.useOnBlur)();
        B[9] !== S ? (M = (0, g.cn)("w-full h-full flex items-center px-8", S), B[9] = S, B[10] = M) : M = B[10], B[11] === Symbol.for("react.memo_cache_sentinel") ? (N = {
            height: "100%"
        }, B[11] = N) : N = B[11];
        let ea = K ? Z.height : "100%";
        B[12] === Symbol.for("react.memo_cache_sentinel") ? (I = [.25, 1, .5, 1], B[12] = I) : I = B[12];
        let ei = K ? m.transition.duration : 0;
        B[13] !== ei ? (P = {
            ease: I,
            duration: ei
        }, B[13] = ei, B[14] = P) : P = B[14], B[15] !== ea || B[16] !== P ? (E = {
            height: ea,
            transition: P
        }, B[15] = ea, B[16] = P, B[17] = E) : E = B[17];
        let en = V === a.Side.BUY ? "$0" : "0",
            es = V === a.Side.BUY ? "$" : "";
        return B[18] === Symbol.for("react.memo_cache_sentinel") ? (A = {
            enabled: !0,
            mode: "fill"
        }, O = {
            enabled: !0,
            maxFontSize: 56,
            defaultFontSize: 56
        }, B[18] = A, B[19] = O) : (A = B[18], O = B[19]), B[20] !== ee || B[21] !== et || B[22] !== er || B[23] !== en || B[24] !== es ? (D = (0, t.jsx)(k.AutosizableInput, {
            ref: ee,
            inputMode: "decimal",
            type: "text",
            placeholder: en,
            autoComplete: "off",
            onBlur: er,
            value: et,
            align: "center",
            prefix: es,
            adornments: "straddle",
            autosizeOptions: A,
            autoscaleFontOptions: O
        }), B[20] = ee, B[21] = et, B[22] = er, B[23] = en, B[24] = es, B[25] = D) : D = B[25], B[26] !== V || B[27] !== q ? (L = V === a.Side.SELL && (0, t.jsx)(s.motion.div, {
            className: "flex justify-center -mt-1",
            variants: w,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            transition: m.opacityTransition,
            children: (0, t.jsx)("span", {
                className: "text-sm font-medium text-text-tertiary",
                children: q("trading.shares").toLowerCase()
            })
        }), B[26] = V, B[27] = q, B[28] = L) : L = B[28], B[29] !== L ? (z = (0, t.jsx)(n.AnimatePresence, {
            initial: !1,
            mode: "popLayout",
            children: L
        }), B[29] = L, B[30] = z) : z = B[30], B[31] !== H || B[32] !== W || B[33] !== V || B[34] !== q || B[35] !== U ? (R = H && (0, t.jsx)("div", {
            className: "flex h-[18px] items-center gap-1.5 mt-2",
            children: (0, t.jsx)("span", {
                className: "text-xs font-medium text-text-secondary",
                children: V === a.Side.SELL ? `${W} ${q("trading.shares").toLowerCase()}` : (0, u.cashBalanceFormatter)({
                    balance: U.current,
                    cashLabel: q("trading.cash")
                })
            })
        }), B[31] = H, B[32] = W, B[33] = V, B[34] = q, B[35] = U, B[36] = R) : R = B[36], B[37] !== J || B[38] !== D || B[39] !== z || B[40] !== R ? (F = (0, t.jsxs)("div", {
            ref: J,
            className: "w-full flex flex-col items-center pt-8 pb-4",
            children: [D, z, R]
        }), B[37] = J, B[38] = D, B[39] = z, B[40] = R, B[41] = F) : F = B[41], B[42] !== j || B[43] !== E || B[44] !== F || B[45] !== M ? ($ = (0, t.jsx)(s.motion.div, {
            className: M,
            initial: N,
            animate: E,
            ...j,
            children: F
        }), B[42] = j, B[43] = E, B[44] = F, B[45] = M, B[46] = $) : $ = B[46], $
    }
    e.i(686518);
    var j = e.i(907855),
        C = e.i(86831);
    let _ = {
        duration: 450,
        easing: "linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"
    };
    e.s(["AnimatedAmount", 0, function(e) {
        let a, i, n, s = (0, r.c)(11),
            {
                value: o,
                prefix: l,
                suffix: c,
                minimumFractionDigits: d,
                maximumFractionDigits: u,
                className: m
            } = e,
            p = void 0 === l ? "$" : l,
            h = void 0 === u ? 2 : u,
            f = d ? ? Math.min(2, h);
        s[0] !== h || s[1] !== f ? (a = {
            minimumFractionDigits: f,
            maximumFractionDigits: h
        }, s[0] = h, s[1] = f, s[2] = a) : a = s[2];
        let x = a,
            g = Number.isFinite(o) ? o : 0;
        return s[3] !== m ? (i = (0, C.cn)("tabular-nums", m), s[3] = m, s[4] = i) : i = s[4], s[5] !== x || s[6] !== p || s[7] !== c || s[8] !== g || s[9] !== i ? (n = (0, t.jsx)(j.default, {
            value: g,
            prefix: p,
            suffix: c,
            format: x,
            trend: 0,
            willChange: !0,
            transformTiming: _,
            className: i
        }), s[5] = x, s[6] = p, s[7] = c, s[8] = g, s[9] = i, s[10] = n) : n = s[10], n
    }], 897765)
}, 118818, e => {
    "use strict";
    e.s(["MobileMarketContextProvider", () => ep, "useMobileMarketContext", () => eh], 118818);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(210308),
        n = e.i(668122),
        s = e.i(28589),
        o = e.i(305457),
        l = e.i(399336),
        c = e.i(891685),
        d = e.i(6204),
        u = e.i(385773),
        m = e.i(201607),
        p = e.i(114659),
        h = e.i(740594),
        f = e.i(827525),
        x = e.i(336846),
        g = e.i(604777),
        v = e.i(415142),
        y = e.i(484864),
        b = e.i(458164),
        k = e.i(709638),
        w = e.i(288576),
        S = e.i(202187),
        j = e.i(468540),
        C = e.i(660635),
        _ = e.i(880809),
        T = e.i(879756),
        M = e.i(754738),
        N = e.i(373230),
        I = e.i(111706),
        P = e.i(242022),
        E = e.i(633873),
        A = e.i(361651),
        O = e.i(471179),
        D = e.i(439442),
        L = e.i(219469),
        z = e.i(215959),
        R = e.i(507909),
        F = e.i(870555),
        $ = e.i(422868),
        B = e.i(467943),
        q = e.i(176902),
        V = e.i(626622),
        H = e.i(897765),
        U = e.i(454619);
    let W = {
        initial: e => ({
            transform: `translateY(${e===h.Side.BUY?"0px":"4px"})`
        }),
        animate: e => ({
            transform: `translateY(${e===h.Side.BUY?"0px":"4px"})`
        }),
        exit: e => ({
            transform: `translateY(${e===h.Side.BUY?"0px":"4px"})`
        })
    };

    function G(e) {
        let a, i, n, s, o, l, c, d, u, m, p, f, x, v, y, b, k = (0, r.c)(37);
        k[0] !== e ? ({
            shares: s,
            averagePrice: a,
            usdcReceived: o,
            className: i,
            ...n
        } = e, k[0] = e, k[1] = a, k[2] = i, k[3] = n, k[4] = s, k[5] = o) : (a = k[1], i = k[2], n = k[3], s = k[4], o = k[5]);
        let w = (0, g.useTranslations)();
        k[6] === Symbol.for("react.memo_cache_sentinel") ? (l = ["side"], k[6] = l) : l = k[6];
        let {
            side: S
        } = (0, _.useTradeContext)(l), j = (0, U.usePrecision)(), C = S === h.Side.BUY ? s : o, T = C > 1e3, M = T ? Math.floor(C) : C, N = 2 * !T, I = 100 * a;
        k[7] !== j || k[8] !== I ? (c = I.toLocaleString("en-US", {
            minimumFractionDigits: 0,
            maximumFractionDigits: j > 2 ? j - 2 : 0
        }), k[7] = j, k[8] = I, k[9] = c) : c = k[9];
        let P = `${c}\xa2`;
        k[10] !== M || k[11] !== N || k[12] !== P ? (d = {
            amountValue: M,
            amountMaxDecimals: N,
            formattedAveragePrice: P
        }, k[10] = M, k[11] = N, k[12] = P, k[13] = d) : d = k[13];
        let {
            amountValue: E,
            amountMaxDecimals: A,
            formattedAveragePrice: O
        } = d;
        return k[14] !== i ? (u = (0, F.cn)("w-full", i), k[14] = i, k[15] = u) : u = k[15], k[16] !== S || k[17] !== w ? (m = w(S === h.Side.BUY ? "trading.toWin" : "trading.youllReceive"), k[16] = S, k[17] = w, k[18] = m) : m = k[18], k[19] !== m ? (p = (0, t.jsx)("span", {
            className: "text-base font-medium leading-5 text-neutral-700 line-clamp-1",
            children: m
        }), k[19] = m, k[20] = p) : p = k[20], k[21] !== A || k[22] !== E ? (f = (0, t.jsx)(H.AnimatedAmount, {
            value: E,
            maximumFractionDigits: A,
            className: "text-lg font-semibold leading-5 text-green-500"
        }), k[21] = A, k[22] = E, k[23] = f) : f = k[23], k[24] !== p || k[25] !== f ? (x = (0, t.jsxs)("div", {
            className: "flex items-center gap-1.5",
            children: [p, f]
        }), k[24] = p, k[25] = f, k[26] = x) : x = k[26], k[27] !== O ? (v = (0, t.jsx)("span", {
            className: "text-xs font-medium text-text-secondary",
            children: O
        }), k[27] = O, k[28] = v) : v = k[28], k[29] !== x || k[30] !== v ? (y = (0, t.jsxs)("div", {
            className: "w-full flex flex-col items-center gap-1 pb-2",
            children: [x, v]
        }), k[29] = x, k[30] = v, k[31] = y) : y = k[31], k[32] !== n || k[33] !== S || k[34] !== y || k[35] !== u ? (b = (0, t.jsx)(z.motion.div, {
            className: u,
            custom: S,
            variants: W,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            transition: R.transition,
            ...n,
            children: y
        }), k[32] = n, k[33] = S, k[34] = y, k[35] = u, k[36] = b) : b = k[36], b
    }
    let Z = {
            ease: R.transition.ease,
            duration: .5 * R.transition.duration
        },
        K = {
            ease: R.opacityTransition.ease,
            duration: .5 * R.opacityTransition.duration
        },
        Y = {
            hidden: {
                height: "24px",
                transition: { ...Z
                }
            },
            visible: {
                height: "64px",
                transition: { ...Z
                }
            }
        },
        Q = {
            hidden: {
                opacity: 0,
                transition: { ...K
                }
            },
            visible: {
                opacity: 1,
                transition: { ...R.opacityTransition,
                    delay: Z.duration - K.duration
                }
            }
        },
        X = a.default.memo(function() {
            let e, a, i, n, s, o = (0, r.c)(16);
            o[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["side"], o[0] = e) : e = o[0];
            let {
                side: l
            } = (0, _.useTradeContext)(e), c = (0, B.useMarketOrderContext)(), d = c.canRender ? "visible" : "hidden", u = c.canRender ? "visible" : "hidden", m = c.canRender ? "visible" : "hidden";
            return o[1] === Symbol.for("react.memo_cache_sentinel") ? (a = { ...Z
            }, o[1] = a) : a = o[1], o[2] !== c.averagePrice || o[3] !== c.canRender || o[4] !== c.sharesReceived || o[5] !== c.usdcReceived ? (i = c.canRender && (0, t.jsx)(z.motion.div, {
                className: "flex h-full items-end",
                variants: Q,
                initial: "hidden",
                animate: "visible",
                exit: "hidden",
                transition: { ...K
                },
                children: (0, t.jsx)(G, {
                    shares: c.sharesReceived,
                    averagePrice: c.averagePrice,
                    usdcReceived: c.usdcReceived
                })
            }, "market-order-to-win"), o[2] = c.averagePrice, o[3] = c.canRender, o[4] = c.sharesReceived, o[5] = c.usdcReceived, o[6] = i) : i = o[6], o[7] !== c || o[8] !== i ? (n = (0, t.jsx)(L.AnimatePresence, {
                initial: !1,
                mode: "sync",
                custom: c,
                children: i
            }), o[7] = c, o[8] = i, o[9] = n) : n = o[9], o[10] !== l || o[11] !== d || o[12] !== u || o[13] !== m || o[14] !== n ? (s = (0, t.jsx)("div", {
                className: "flex w-full flex-col items-center pb-4 relative",
                children: (0, t.jsx)(z.motion.div, {
                    className: "w-full relative",
                    variants: Y,
                    custom: l,
                    initial: d,
                    animate: u,
                    exit: m,
                    transition: a,
                    children: n
                })
            }), o[10] = l, o[11] = d, o[12] = u, o[13] = m, o[14] = n, o[15] = s) : s = o[15], s
        });

    function J() {
        let e, i, n, s, o, c, d, u, m = (0, r.c)(17);
        m[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], m[0] = e) : e = m[0];
        let {
            activeMarket: p
        } = (0, l.useEventActiveMarketContext)(e);
        m[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["selectedOutcomeIdx", "setSelectedOutcomeIdx", "side"], m[1] = i) : i = m[1];
        let {
            selectedOutcomeIdx: f,
            setSelectedOutcomeIdx: x,
            side: g
        } = (0, _.useTradeContext)(i), {
            numericalShareBalances: v
        } = (0, $.useMobileMarketPositionContext)(), y = p.outcomes;
        m[2] === Symbol.for("react.memo_cache_sentinel") ? (n = [], m[2] = n) : n = m[2];
        let b = a.default.useRef(n),
            [k, w] = a.default.useState(null);
        return (m[3] !== f ? (s = () => {
            let e = b.current[f];
            e && w({
                left: e.offsetLeft,
                width: e.offsetWidth
            })
        }, m[3] = f, m[4] = s) : s = m[4], m[5] !== y || m[6] !== f ? (o = [f, y], m[5] = y, m[6] = f, m[7] = o) : o = m[7], a.default.useLayoutEffect(s, o), !y || y.length < 2 || g === h.Side.SELL && v.filter(ee).length <= 1) ? null : (m[8] !== k ? (c = k && (0, t.jsx)("div", {
            className: "absolute top-1 bottom-1 rounded-full bg-surface-1 dark:bg-neutral-100 transition-all duration-200 ease-out",
            style: {
                width: k.width,
                left: k.left
            }
        }), m[8] = k, m[9] = c) : c = m[9], m[10] !== y || m[11] !== f || m[12] !== x ? (d = y.slice(0, 2).map((e, r) => (0, t.jsx)("button", {
            ref: e => {
                b.current[r] = e
            },
            type: "button",
            onClick: () => x(r),
            className: (0, F.cn)("relative z-10 px-4 py-1.5 text-sm font-medium rounded-full cursor-pointer transition-colors duration-150 whitespace-nowrap", f === r ? "text-text-primary" : "text-text-tertiary"),
            children: e
        }, e)), m[10] = y, m[11] = f, m[12] = x, m[13] = d) : d = m[13], m[14] !== c || m[15] !== d ? (u = (0, t.jsx)("div", {
            className: "flex justify-center py-2",
            children: (0, t.jsxs)("div", {
                className: "relative flex bg-neutral-50 dark:bg-neutral-25 rounded-full p-1",
                children: [c, d]
            })
        }), m[14] = c, m[15] = d, m[16] = u) : u = m[16], u)
    }

    function ee(e) {
        return e > 0
    }
    let et = e => {
        let a, i, n, s, o, l, c, d, u = (0, r.c)(12);
        return u[0] !== e ? ({
            className: a,
            ...i
        } = e, u[0] = e, u[1] = a, u[2] = i) : (a = u[1], i = u[2]), u[3] !== a ? (n = (0, F.cn)("flex flex-col size-full pb-6", a), u[3] = a, u[4] = n) : n = u[4], u[5] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)(V.MobileMarketOrderAmountSection, {}), o = (0, t.jsx)(J, {}), l = (0, t.jsx)(X, {}), u[5] = s, u[6] = o, u[7] = l) : (s = u[5], o = u[6], l = u[7]), u[8] === Symbol.for("react.memo_cache_sentinel") ? (c = (0, t.jsx)("div", {
            className: "flex flex-1 justify-center min-h-[30px]",
            children: (0, t.jsx)(q.QuickActionGroup, {
                color: "grey"
            })
        }), u[8] = c) : c = u[8], u[9] !== i || u[10] !== n ? (d = (0, t.jsxs)(z.motion.div, {
            className: n,
            ...i,
            children: [s, o, l, c]
        }), u[9] = i, u[10] = n, u[11] = d) : d = u[11], d
    };
    et.displayName = "MarketOrderContentInternals";
    let er = a.default.memo(et),
        ea = a.default.memo(e => {
            let a, i, n, s = (0, r.c)(6);
            return s[0] !== e ? ({
                ref: a,
                ...i
            } = e, s[0] = e, s[1] = a, s[2] = i) : (a = s[1], i = s[2]), s[3] !== a || s[4] !== i ? (n = (0, t.jsx)(B.MarketOrderContextProvider, {
                mode: "mobile",
                children: (0, t.jsx)(er, {
                    ref: a,
                    ...i
                })
            }), s[3] = a, s[4] = i, s[5] = n) : n = s[5], n
        });
    ea.displayName = "MarketOrderContent";
    let ei = e => {
        let a, i, n = (0, r.c)(4);
        return n[0] !== e ? ({ ...a
        } = e, n[0] = e, n[1] = a) : a = n[1], n[2] !== a ? (i = (0, t.jsx)(ea, { ...a
        }), n[2] = a, n[3] = i) : i = n[3], i
    };
    ei.displayName = "MarketOrderContent";
    let en = e => {
        let a, i, n, s, o, d, u, m, p, v, w, j, L, z, R, F, $ = (0, r.c)(53);
        $[0] !== e ? ({
            ref: i,
            ...a
        } = e, $[0] = e, $[1] = a, $[2] = i) : (a = $[1], i = $[2]);
        let B = (0, g.useTranslations)(),
            {
                tradeType: q,
                sportsRedemptionType: V
            } = (0, T.useMobileTradeContext)();
        $[3] === Symbol.for("react.memo_cache_sentinel") ? (n = ["event"], $[3] = n) : n = $[3];
        let {
            event: H
        } = (0, c.useEventContext)(n);
        $[4] === Symbol.for("react.memo_cache_sentinel") ? (s = ["activeMarket"], $[4] = s) : s = $[4];
        let {
            activeMarket: U
        } = (0, l.useEventActiveMarketContext)(s);
        $[5] === Symbol.for("react.memo_cache_sentinel") ? (o = ["orderType", "side", "shouldShowSlippageWarning", "setShouldShowSlippageWarning"], $[5] = o) : o = $[5];
        let {
            orderType: W,
            side: G,
            shouldShowSlippageWarning: Z,
            setShouldShowSlippageWarning: K
        } = (0, _.useTradeContext)(o);
        $[6] !== H ? .tags ? (d = H ? .tags ? .some(el) ? ? !1, $[6] = H ? .tags, $[7] = d) : d = $[7];
        let Y = d,
            Q = H ? .live || H ? .isLive,
            X = U.gameStartTime ? new Date(U.gameStartTime) : null,
            J = Y && W === b.OrderType.Limit && !Q && null != X && X.getTime() > (0, C.getServerNow)(),
            {
                onTap: ee
            } = (0, k.useMobileTransactionContext)(),
            {
                confetti: et
            } = (0, S.useOnTapConfetti)();
        $[8] !== et || $[9] !== W || $[10] !== G ? (u = (e, t) => {
            W === b.OrderType.Market && G === h.Side.BUY && et({
                e,
                info: t,
                mode: {
                    type: "event",
                    location: "center"
                }
            })
        }, $[8] = et, $[9] = W, $[10] = G, $[11] = u) : u = $[11];
        let er = u;
        $[12] !== er || $[13] !== ee ? (m = async (e, t) => ee(e, t, er, !0), $[12] = er, $[13] = ee, $[14] = m) : m = $[14];
        let ea = m;
        e: {
            if (Z) {
                let e, r;
                $[15] !== K ? (e = () => K(!1), $[15] = K, $[16] = e) : e = $[16], $[17] !== ea || $[18] !== e ? (r = {
                    key: "slippage-warning",
                    content: (0, t.jsx)(y.default, {
                        onConfirm: ea,
                        hideWarning: e
                    })
                }, $[17] = ea, $[18] = e, $[19] = r) : r = $[19], p = r;
                break e
            }
            switch (q) {
                case "trade":
                    {
                        let e;$[20] !== W ? (e = W === b.OrderType.Limit ? {
                            key: "trade-limit",
                            content: (0, t.jsx)(I.LimitOrderContent, {
                                variant: "mobile"
                            })
                        } : {
                            key: "trade-market",
                            content: (0, t.jsx)(ei, {})
                        }, $[20] = W, $[21] = e) : e = $[21],
                        p = e;
                        break e
                    }
                case "split":
                    {
                        let e;$[22] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                            key: "split",
                            content: (0, t.jsx)(A.SplitShares, {})
                        }, $[22] = e) : e = $[22],
                        p = e;
                        break e
                    }
                case "merge":
                    {
                        let e;$[23] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                            key: "merge",
                            content: (0, t.jsx)(P.MergeShares, {})
                        }, $[23] = e) : e = $[23],
                        p = e;
                        break e
                    }
                case "sports-redeem":
                    {
                        let e;$[24] !== V ? (e = {
                            key: "sports-redeem",
                            content: (0, t.jsx)(M.SportsRedeemContent, {
                                variant: V
                            })
                        }, $[24] = V, $[25] = e) : e = $[25],
                        p = e;
                        break e
                    }
                case "one-tap":
                    {
                        let e;$[26] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                            key: "one-tap",
                            content: (0, t.jsx)(E.OneTapEditContent, {})
                        }, $[26] = e) : e = $[26],
                        p = e;
                        break e
                    }
                case "redeem":
                    p = null;
                    break e;
                default:
                    {
                        let e;$[27] !== W ? (e = W === b.OrderType.Limit ? {
                            key: "trade-limit",
                            content: (0, t.jsx)(I.LimitOrderContent, {
                                variant: "mobile"
                            })
                        } : {
                            key: "trade-market",
                            content: (0, t.jsx)(ei, {})
                        }, $[27] = W, $[28] = e) : e = $[28],
                        p = e
                    }
            }
        }
        let en = p;
        if (!en) {
            let e;
            return $[29] !== a || $[30] !== i ? (e = (0, t.jsx)("div", {
                ref: i,
                className: "relative w-full",
                ...a
            }), $[29] = a, $[30] = i, $[31] = e) : e = $[31], e
        }
        let es = "redeem" !== q && "sports-redeem" !== q,
            eo = "redeem" !== q && "sports-redeem" !== q && "one-tap" !== q && !Z;
        $[32] === Symbol.for("react.memo_cache_sentinel") ? (v = (0, t.jsx)(f.Drawer.Handle, {
            className: "absolute! top-2 left-1/2 -translate-x-1/2 w-[60px]! h-[5px]! rounded-full bg-muted! z-3"
        }), $[32] = v) : v = $[32], $[33] !== es ? (w = es && (0, t.jsx)(D.TradeHeader, {}), $[33] = es, $[34] = w) : w = $[34];
        let ec = "sports-redeem" === q;
        $[35] !== en.content || $[36] !== en.key || $[37] !== ec ? (j = (0, t.jsx)(x.OrderContentAnimator, {
            contentKey: en.key,
            disableHeightAnimation: ec,
            children: en.content
        }), $[35] = en.content, $[36] = en.key, $[37] = ec, $[38] = j) : j = $[38], $[39] === Symbol.for("react.memo_cache_sentinel") ? (L = (0, t.jsx)(N.TradeError, {
            variant: "mobile"
        }), $[39] = L) : L = $[39], $[40] !== eo ? (z = eo && (0, t.jsx)(O.MobileCheckoutButton, {}), $[40] = eo, $[41] = z) : z = $[41];
        let ed = J && X && (0, t.jsx)("div", {
            className: "flex items-center justify-center pt-2",
            children: (0, t.jsx)("p", {
                className: "text-xs text-text-secondary text-center",
                children: B("trading.orderBook.clearDisclaimer", {
                    time: X.toLocaleString([], {
                        hour: "numeric",
                        minute: "2-digit",
                        timeZoneName: "short"
                    })
                })
            })
        });
        return $[42] !== z || $[43] !== ed ? (R = (0, t.jsxs)("div", {
            className: "flex-col w-full backdrop-blur-[5px]",
            children: [z, ed]
        }), $[42] = z, $[43] = ed, $[44] = R) : R = $[44], $[45] !== a || $[46] !== i || $[47] !== w || $[48] !== j || $[49] !== L || $[50] !== R || $[51] !== v ? (F = (0, t.jsxs)("div", {
            ref: i,
            className: "relative w-full p-6",
            ...a,
            children: [v, w, j, L, R]
        }), $[45] = a, $[46] = i, $[47] = w, $[48] = j, $[49] = L, $[50] = R, $[51] = v, $[52] = F) : F = $[52], F
    };
    en.displayName = "MobileTradingDrawerContent";
    let es = a.default.memo(en);

    function eo(e) {
        let a, i, n, s, o, l, c, d = (0, r.c)(17),
            {
                children: u
            } = e,
            {
                open: m,
                setOpen: p,
                tradeDrawerRef: h,
                closeDrawerClickRef: x
            } = eh(),
            {
                tradeType: g
            } = (0, T.useMobileTradeContext)(),
            {
                reset: y
            } = (0, j.useResetPointerEvents)();
        d[0] !== y || d[1] !== p ? (a = e => {
            p(e), e || y()
        }, d[0] = y, d[1] = p, d[2] = a) : a = d[2];
        let b = a,
            k = m && "redeem" !== g;
        return d[3] !== x ? (i = (0, t.jsx)(f.Drawer.Overlay, {
            className: "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/40 z-[calc(var(--z-drawer)+10)]",
            onClick: () => {
                x.current = !0
            }
        }), d[3] = x, d[4] = i) : i = d[4], d[5] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsxs)(v.VisuallyHidden.Root, {
            children: [(0, t.jsx)(f.Drawer.Title, {
                children: "Trade drawer"
            }), (0, t.jsx)(f.Drawer.Description, {
                children: "Trade drawer"
            })]
        }), s = (0, t.jsx)(es, {}), d[5] = n, d[6] = s) : (n = d[5], s = d[6]), d[7] !== h ? (o = (0, t.jsxs)(f.Drawer.Content, {
            ref: h,
            className: "z-[calc(var(--z-drawer)+15)] fixed bottom-0 inset-x-0 flex flex-col rounded-t-3xl border-t mt-24 max-h-[85dvh] overflow-y-auto bg-background pb-[env(safe-area-inset-bottom)]",
            children: [n, s]
        }), d[7] = h, d[8] = o) : o = d[8], d[9] !== i || d[10] !== o ? (l = (0, t.jsxs)(f.Drawer.Portal, {
            children: [i, o]
        }), d[9] = i, d[10] = o, d[11] = l) : l = d[11], d[12] !== u || d[13] !== b || d[14] !== k || d[15] !== l ? (c = (0, t.jsx)(w.TradeAnimationContextProvider, {
            children: (0, t.jsxs)(f.Drawer.Root, {
                shouldScaleBackground: !0,
                open: k,
                onOpenChange: b,
                repositionInputs: !1,
                children: [u, l]
            })
        }), d[12] = u, d[13] = b, d[14] = k, d[15] = l, d[16] = c) : c = d[16], c
    }

    function el(e) {
        return "sports" === e.slug || "esports" === e.slug
    }
    var ec = e.i(627433),
        ed = e.i(561992),
        eu = e.i(51743);
    let em = a.default.createContext({}),
        ep = e => {
            let h, f, x, g, v, y, b, k, w, S, j, C, _, M, N, I, P, E = (0, r.c)(42),
                {
                    market: A,
                    hideControls: O,
                    hideSingleMarketView: D,
                    children: L
                } = e,
                z = void 0 !== O && O,
                R = void 0 !== D && D;
            E[0] === Symbol.for("react.memo_cache_sentinel") ? (h = ["isSportsPage"], E[0] = h) : h = E[0];
            let {
                isSportsPage: F
            } = (0, d.useSportsContext)(h), B = (0, u.useVisualStateStore)(ef);
            E[1] === Symbol.for("react.memo_cache_sentinel") ? (f = ["event"], E[1] = f) : f = E[1];
            let {
                event: q
            } = (0, c.useEventContext)(f);
            E[2] === Symbol.for("react.memo_cache_sentinel") ? (x = ["activeMarket"], E[2] = x) : x = E[2];
            let {
                activeMarket: V
            } = (0, l.useEventActiveMarketContext)(x);
            e: {
                let e = 1 === q.markets.length;
                if (F) {
                    g = e && !(q.series && q.series.length > 0);
                    break e
                }
                g = e
            }
            let H = g;
            E[3] !== V || E[4] !== A ? (v = () => ({
                market: A ? ? V,
                mode: A ? "group" : "single"
            }), y = [A, V], E[3] = V, E[4] = A, E[5] = v, E[6] = y) : (v = E[5], y = E[6]);
            let {
                market: U,
                mode: W
            } = (0, i.useDeepCompareMemo)(v, y), G = (0, o.useAmplitudeAnalytics)(), [Z] = a.default.useState(ex), K = a.default.useRef(null), Y = a.default.useRef(null), {
                open: Q,
                setOpen: X,
                liveChatOpen: J,
                setLiveChatOpen: ee,
                view: et,
                setView: er,
                limitOrderPage: ea,
                setLimitOrderPage: ei
            } = (() => {
                let e, t, i = (0, r.c)(8),
                    {
                        setView: n
                    } = (0, ed.useMobileEventContext)(),
                    [s, o] = a.default.useState(!1),
                    [l, c] = a.default.useState(!1),
                    [d, u] = a.default.useState("default"),
                    [m, p] = a.default.useState("resting");
                i[0] !== n ? (e = e => {
                    u(e), n(e)
                }, i[0] = n, i[1] = e) : e = i[1];
                let h = e;
                return i[2] !== m || i[3] !== l || i[4] !== s || i[5] !== h || i[6] !== d ? (t = {
                    open: s,
                    setOpen: o,
                    liveChatOpen: l,
                    setLiveChatOpen: c,
                    view: d,
                    setView: h,
                    limitOrderPage: m,
                    setLimitOrderPage: p
                }, i[2] = m, i[3] = l, i[4] = s, i[5] = h, i[6] = d, i[7] = t) : t = i[7], t
            })(), en = a.default.useRef(!1), es = a.default.useRef(!1), el = a.default.useRef(Q), ep = a.default.useRef(et);
            E[7] !== G || E[8] !== et ? (k = () => {
                "default" === et && "smp" === ep.current && (G.trackEvent(n.Events.MobileTradingSmpClose, {
                    method: es.current ? "click" : "swipe"
                }), ep.current = et, es.current = !1)
            }, b = [et, G], E[7] = G, E[8] = et, E[9] = b, E[10] = k) : (b = E[9], k = E[10]), a.default.useEffect(k, b), E[11] !== G || E[12] !== Q ? (w = () => {
                !Q && el.current && (G.trackEvent(n.Events.MobileTradingDrawerClose, {
                    method: en.current ? "click" : "swipe"
                }), el.current = !1, en.current = !1)
            }, S = [Q, G], E[11] = G, E[12] = Q, E[13] = w, E[14] = S) : (w = E[13], S = E[14]), a.default.useEffect(w, S), E[15] !== Z || E[16] !== ea || E[17] !== J || E[18] !== U || E[19] !== W || E[20] !== Q || E[21] !== ei || E[22] !== ee || E[23] !== X || E[24] !== er || E[25] !== et ? (j = {
                market: U,
                open: Q,
                setOpen: X,
                liveChatOpen: J,
                setLiveChatOpen: ee,
                view: et,
                setView: er,
                limitOrderPage: ea,
                setLimitOrderPage: ei,
                amountPortalNode: Z,
                mode: W,
                tradeDrawerRef: K,
                smpContentRef: Y,
                closeSmpClickRef: es,
                closeDrawerClickRef: en
            }, E[15] = Z, E[16] = ea, E[17] = J, E[18] = U, E[19] = W, E[20] = Q, E[21] = ei, E[22] = ee, E[23] = X, E[24] = er, E[25] = et, E[26] = j) : j = E[26];
            let eh = j;
            return E[27] !== R ? (C = !R && (0, t.jsx)(m.MobileSingleMarketView, {}), E[27] = R, E[28] = C) : C = E[28], E[29] === Symbol.for("react.memo_cache_sentinel") ? (_ = (0, t.jsx)(eo, {}), M = (0, t.jsx)(p.RedeemDrawer, {}), E[29] = _, E[30] = M) : (_ = E[29], M = E[30]), E[31] !== z || E[32] !== H || E[33] !== B ? (N = H && !z && (0, t.jsx)(s.InPortal, {
                node: B,
                children: (0, t.jsx)(ec.MobileMarketControls, {}, "mobile-single-market-detail-drawer-controls")
            }), E[31] = z, E[32] = H, E[33] = B, E[34] = N) : N = E[34], E[35] !== L || E[36] !== C || E[37] !== N ? (I = (0, t.jsx)($.MobileMarketPositionContextProvider, {
                children: (0, t.jsx)(eu.MobileExpirationContextProvider, {
                    children: (0, t.jsxs)(T.MobileTradeContextProvider, {
                        children: [L, C, _, M, N]
                    })
                })
            }), E[35] = L, E[36] = C, E[37] = N, E[38] = I) : I = E[38], E[39] !== I || E[40] !== eh ? (P = (0, t.jsx)(em.Provider, {
                value: eh,
                children: I
            }), E[39] = I, E[40] = eh, E[41] = P) : P = E[41], P
        },
        eh = () => a.default.useContext(em);

    function ef(e) {
        return e.smpDrawerControlsPortalNode
    }

    function ex() {
        return (0, s.createHtmlPortalNode)()
    }
}, 100684, 438015, 801518, 572795, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(416340),
        a = e.i(197935),
        i = e.i(720959),
        n = e.i(847829),
        s = e.i(999061),
        o = e.i(213333),
        l = e.i(87846),
        c = e.i(299691);
    let d = () => r.default.useContext(c.AnnotationsContext);
    e.s(["AnnotationsContextProvider", 0, e => {
        let a, i, n, d, u, m, p, h, f, x = (0, s.c)(26),
            {
                annotations: g,
                enabled: v,
                annotationMode: y,
                xAxisTopOffset: b,
                children: k
            } = e,
            w = void 0 === v || v,
            [S, j] = r.default.useState(),
            [C, _] = r.default.useState(!1),
            [T, M] = r.default.useState(!1),
            [N, I] = r.default.useState(!1),
            [P, E] = r.default.useState(!1),
            [A, O] = r.default.useState(!1),
            [D, L] = r.default.useState(null),
            z = (0, o.usePrevious)(D);
        x[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
            key: "group_chart_annotations",
            path: "/"
        }, x[0] = a) : a = x[0];
        let [R, F] = (0, l.default)(!0, a), [$, B] = r.default.useState(null);
        x[1] === Symbol.for("react.memo_cache_sentinel") ? (i = new Map, x[1] = i) : i = x[1];
        let q = r.default.useRef(i),
            V = r.default.useRef(null);
        x[2] === Symbol.for("react.memo_cache_sentinel") ? (n = (e, t) => {
            q.current.set(e.timestamp, {
                annotation: e,
                x: t
            })
        }, x[2] = n) : n = x[2];
        let H = n;
        x[3] === Symbol.for("react.memo_cache_sentinel") ? (d = e => {
            q.current.delete(e.timestamp)
        }, x[3] = d) : d = x[3];
        let U = d;
        x[4] === Symbol.for("react.memo_cache_sentinel") ? (u = e => {
            let t = null,
                r = 1 / 0;
            return q.current.forEach(a => {
                let {
                    annotation: i,
                    x: n
                } = a, s = Math.abs(n - e);
                s < 15 && s < r && (r = s, t = i)
            }), t
        }, x[4] = u) : u = x[4];
        let W = u;
        x[5] === Symbol.for("react.memo_cache_sentinel") ? (m = e => {
            V.current = e, B(W(e))
        }, x[5] = m) : m = x[5];
        let G = m;
        x[6] === Symbol.for("react.memo_cache_sentinel") ? (p = e => {
            B(e)
        }, x[6] = p) : p = x[6];
        let Z = p;
        x[7] !== y || x[8] !== g || x[9] !== P || x[10] !== R || x[11] !== D || x[12] !== w || x[13] !== C || x[14] !== S || x[15] !== $ || x[16] !== N || x[17] !== z || x[18] !== T || x[19] !== F || x[20] !== A || x[21] !== b ? (h = {
            annotations: g,
            currAnnotation: D,
            setCurrAnnotation: L,
            popoverOpen: N,
            setPopoverOpen: I,
            tweetsDrawerOpen: A,
            setTweetsDrawerOpen: O,
            annotationsDrawerOpen: P,
            setAnnotationsDrawerOpen: E,
            prevAnnotation: z,
            annotationsEnabled: w,
            annotationsVisible: R,
            setAnnotationsVisible: F,
            annotationMode: y,
            xAxisTopOffset: b,
            forcedTooltipPoint: S,
            setForcedTooltipPoint: j,
            forceShowDateTooltip: C,
            setForceShowDateTooltip: _,
            preventTooltip: T,
            setPreventTooltip: M,
            hoveredAnnotation: $,
            setHoveredAnnotation: Z,
            registerAnnotationPosition: H,
            unregisterAnnotation: U,
            updateHoverPosition: G
        }, x[7] = y, x[8] = g, x[9] = P, x[10] = R, x[11] = D, x[12] = w, x[13] = C, x[14] = S, x[15] = $, x[16] = N, x[17] = z, x[18] = T, x[19] = F, x[20] = A, x[21] = b, x[22] = h) : h = x[22];
        let K = h;
        return x[23] !== k || x[24] !== K ? (f = (0, t.jsx)(c.AnnotationsContext.Provider, {
            value: K,
            children: k
        }), x[23] = k, x[24] = K, x[25] = f) : f = x[25], f
    }, "useAnnotationsContext", 0, d], 438015);
    var u = e.i(12884),
        m = e.i(333035);
    let p = e => {
        let t = e[0].x,
            r = e[e.length - 1].x;
        return {
            id: e.map(e => e.annotation.timestamp).join("|"),
            items: e.map(e => e.annotation).toReversed(),
            xStart: t,
            xEnd: r,
            xCenter: (t + r) / 2
        }
    };

    function h(e, t) {
        return e.x - t.x
    }
    let f = r.default.createContext({});
    e.s(["NewsOverlayProvider", 0, ({
        children: e
    }) => {
        let {
            annotations: o,
            annotationsVisible: l,
            setForcedTooltipPoint: c,
            setForceShowDateTooltip: x
        } = d(), {
            tooltipLeft: g
        } = (0, i.useTooltipPositionContext)(), {
            showDateTooltip: v
        } = (0, a.useInteractivityContext)(), {
            isDragging: y,
            isLocked: b
        } = (0, n.useDragRangeContext)(), {
            selectedAssetIndex: k,
            showBothOutcomes: w,
            options: S
        } = (0, u.useChartContext)(), j = "single" === S.mode && "single" === S.outcomeMode && !w && 1 === k, C = r.default.useMemo(() => j ? [] : o ? ? [], [o, j]), _ = (e => {
            let t, r = (0, s.c)(12),
                {
                    xAxisScale: a
                } = (0, m.useLineChartContext)();
            if (r[0] !== e || r[1] !== a) {
                e: {
                    let i, n, s;
                    if (!e ? .length) {
                        let e;
                        r[3] === Symbol.for("react.memo_cache_sentinel") ? (e = [], r[3] = e) : e = r[3], t = e;
                        break e
                    }
                    r[4] !== a ? (i = a.range(), r[4] = a, r[5] = i) : i = r[5];
                    let [o, l] = i;r[6] !== a ? (n = e => ({
                        annotation: e,
                        x: a(1e3 * e.unixTime)
                    }), r[6] = a, r[7] = n) : n = r[7],
                    r[8] !== l || r[9] !== o ? (s = e => Number.isFinite(e.x) && e.x >= o && e.x <= l, r[8] = l, r[9] = o, r[10] = s) : s = r[10];
                    let c = e.map(n).filter(s).sort(h);
                    if (!c.length) {
                        let e;
                        r[11] === Symbol.for("react.memo_cache_sentinel") ? (e = [], r[11] = e) : e = r[11], t = e;
                        break e
                    }
                    let d = [],
                        u = [c[0]];
                    for (let e = 1; e < c.length; e++) {
                        let t = u[u.length - 1];
                        c[e].x - t.x <= 30 ? u.push(c[e]) : (d.push(p(u)), u = [c[e]])
                    }
                    d.push(p(u)),
                    t = d
                }
                r[0] = e,
                r[1] = a,
                r[2] = t
            }
            else t = r[2];
            return t
        })(!1 !== l ? C : void 0), [T, M] = r.default.useState(null), [N, I] = r.default.useState(0), [P, E] = r.default.useState(!1), [A, O] = r.default.useState(null), D = r.default.useRef(null), [L, z] = r.default.useState(!1);
        r.default.useEffect(() => {
            !v && (L || z(!0))
        }, [v, L]);
        let R = r.default.useMemo(() => {
                if (y || b || !v || void 0 === g || 0 === g || !L) return null;
                let e = null,
                    t = 1 / 0;
                for (let r of _) {
                    let a = Math.abs(g - r.xCenter);
                    a <= 10 && a < t && (t = a, e = r)
                }
                return e
            }, [v, g, _, L, y, b]),
            F = null !== T || P && null !== A,
            $ = r.default.useMemo(() => F ? null : R, [R, F]),
            B = T ? ? $;
        r.default.useEffect(() => {
            if (y || b) {
                D.current && (clearTimeout(D.current), D.current = null), O(null);
                return
            }
            return B ? (D.current && (clearTimeout(D.current), D.current = null), O(B)) : P || (D.current = setTimeout(() => {
                O(null), D.current = null
            }, 100)), () => {
                D.current && (clearTimeout(D.current), D.current = null)
            }
        }, [B, P, y, b]), r.default.useEffect(() => {
            if (y || b) {
                c(void 0), x(!1);
                return
            }
            T ? (c(T.xCenter), x(!0)) : P && A ? (c(A.xCenter), x(!0)) : (c(void 0), x(!1))
        }, [y, b, T, P, A, c, x]);
        let q = r.default.useRef(null),
            V = A ? .id ? ? null;
        V !== q.current && (q.current = V, null !== V && I(0));
        let H = A ? .items[N] ? ? null,
            U = r.default.useRef(A);
        U.current = A;
        let W = r.default.useCallback(() => {
                let e = U.current,
                    t = e ? .items.length ? ? 0;
                0 !== t && I(e => Math.min(e + 1, t - 1))
            }, []),
            G = r.default.useCallback(() => {
                let e = U.current;
                0 !== (e ? .items.length ? ? 0) && I(e => Math.max(e - 1, 0))
            }, []),
            Z = r.default.useRef(null),
            K = r.default.useCallback(e => {
                Z.current && (clearTimeout(Z.current), Z.current = null), e ? M(e) : Z.current = setTimeout(() => {
                    M(null), Z.current = null
                }, 80)
            }, []);
        r.default.useEffect(() => {
            if (!T) return;
            let e = !1,
                t = setTimeout(() => {
                    e = !0
                }, 100),
                r = t => {
                    if (!e) return;
                    let r = t.target;
                    r ? .closest("[data-news-overlay]") || K(null)
                };
            return document.addEventListener("touchstart", r, {
                passive: !0
            }), () => {
                clearTimeout(t), document.removeEventListener("touchstart", r)
            }
        }, [T, K]);
        let Y = r.default.useMemo(() => ({
            clusters: _,
            activeCluster: A,
            activeItem: H,
            activeItemIndex: N,
            setActiveCluster: K,
            setCardHovered: E,
            nextItem: W,
            prevItem: G
        }), [_, A, H, N, K, E, W, G]);
        return (0, t.jsx)(f.Provider, {
            value: Y,
            children: e
        })
    }, "useNewsOverlayContext", 0, () => r.default.useContext(f)], 100684), e.s(["ChevronLeftSmallIcon20", 0, function(e) {
        let r, a, i = (0, s.c)(3);
        return i[0] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)("path", {
            fill: "currentColor",
            d: "M12.286 14.786a.877.877 0 0 1-1.238 0L6.882 10.62a.875.875 0 0 1 0-1.237l4.166-4.167a.876.876 0 0 1 1.238 1.237l-3.548 3.55 3.548 3.546a.876.876 0 0 1 0 1.238"
        }), i[0] = r) : r = i[0], i[1] !== e ? (a = (0, t.jsx)("svg", {
            xmlns: "http://www.w3.org/2000/svg",
            width: 20,
            height: 20,
            fill: "none",
            viewBox: "0 0 20 20",
            "aria-hidden": !0,
            ...e,
            children: r
        }), i[1] = e, i[2] = a) : a = i[2], a
    }], 801518), e.s(["ChevronRightSmallIcon20", 0, function(e) {
        let r, a, i = (0, s.c)(3);
        return i[0] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, t.jsx)("path", {
            fill: "currentColor",
            d: "M7.714 5.214a.877.877 0 0 1 1.238 0l4.166 4.167a.875.875 0 0 1 0 1.237l-4.166 4.167a.876.876 0 0 1-1.238-1.237l3.548-3.55-3.548-3.546a.877.877 0 0 1 0-1.238"
        }), i[0] = r) : r = i[0], i[1] !== e ? (a = (0, t.jsx)("svg", {
            xmlns: "http://www.w3.org/2000/svg",
            width: 20,
            height: 20,
            fill: "none",
            viewBox: "0 0 20 20",
            "aria-hidden": !0,
            ...e,
            children: r
        }), i[1] = e, i[2] = a) : a = i[2], a
    }], 572795)
}, 11643, e => {
    "use strict";
    e.s(["getFaviconUrl", 0, function(e) {
        try {
            let t = new URL(e).hostname;
            return `https://www.google.com/s2/favicons?domain=${t}&sz=64`
        } catch {
            return null
        }
    }])
}, 581623, 753870, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(801518),
        i = e.i(572795),
        n = e.i(169010),
        s = e.i(491636),
        o = e.i(219469),
        l = e.i(215959),
        c = e.i(416340),
        d = e.i(333035),
        u = e.i(100684),
        m = e.i(11643);

    function p(e) {
        let r = (0, m.getFaviconUrl)(e.url);
        return (0, t.jsx)(n.Tooltip, {
            content: e.name,
            side: "top",
            children: (0, t.jsx)("a", {
                href: e.url,
                target: "_blank",
                rel: "noopener noreferrer",
                className: "flex items-center justify-center rounded-md overflow-hidden",
                style: {
                    width: 28,
                    height: 28,
                    border: "1px solid var(--color-border)"
                },
                children: r ? (0, t.jsx)("img", {
                    src: r,
                    alt: e.name,
                    referrerPolicy: "no-referrer",
                    width: 18,
                    height: 18,
                    style: {
                        objectFit: "contain"
                    }
                }) : (0, t.jsx)("span", {
                    style: {
                        fontSize: 10,
                        fontWeight: 600,
                        color: "var(--color-text-secondary)"
                    },
                    children: e.name.slice(0, 2).toUpperCase()
                })
            })
        }, e.url)
    }
    e.s(["NewsCard", 0, () => {
        let e, n, m, h, f, x = (0, r.c)(15),
            {
                activeCluster: g,
                activeItem: v,
                activeItemIndex: y,
                nextItem: b,
                prevItem: k,
                setCardHovered: w
            } = (0, u.useNewsOverlayContext)(),
            {
                width: S,
                margin: j
            } = (0, d.useLineChartContext)(),
            [C, _] = c.default.useState(!1),
            T = c.default.useRef(null),
            M = g ? `${g.id}:${y}` : null;
        M !== T.current && (T.current = M, _(!1));
        e: {
            if (!g) {
                e = 0;
                break e
            }
            let t = g.xCenter + j.left,
                r = S - j.right;e = Math.max(j.left, Math.min(t - 160, r - 320))
        }
        let N = e;
        x[0] !== k ? (n = e => {
            e.stopPropagation(), k()
        }, x[0] = k, x[1] = n) : n = x[1];
        let I = n;
        x[2] !== b ? (m = e => {
            e.stopPropagation(), b()
        }, x[2] = b, x[3] = m) : m = x[3];
        let P = m;
        return x[4] !== g || x[5] !== v || x[6] !== y || x[7] !== N || x[8] !== C || x[9] !== P || x[10] !== I || x[11] !== w ? (h = g && v && (0, t.jsx)(l.motion.div, {
            "data-news-overlay": !0,
            className: "absolute z-10 pointer-events-auto",
            style: {
                left: N,
                top: "calc(100% + 56px)",
                width: 320
            },
            initial: {
                opacity: 0,
                y: 4
            },
            animate: {
                opacity: 1,
                y: 0,
                transition: {
                    duration: .1
                }
            },
            exit: {
                opacity: 0,
                transition: {
                    duration: .08
                }
            },
            onPointerEnter: () => w(!0),
            onPointerLeave: () => w(!1),
            children: (0, t.jsx)("div", {
                className: "rounded-2xl p-4 flex flex-col overflow-hidden selection:bg-[var(--color-accent-bg)] selection:text-[var(--color-primary)]",
                style: {
                    background: "var(--color-background)",
                    border: "1px solid var(--color-border)",
                    boxShadow: "0 1px 30px rgba(9, 9, 11, 0.12)"
                },
                children: (0, t.jsx)(o.AnimatePresence, {
                    mode: "popLayout",
                    initial: !1,
                    children: (0, t.jsxs)(l.motion.div, {
                        initial: {
                            opacity: 0
                        },
                        animate: {
                            opacity: 1
                        },
                        exit: {
                            opacity: 0
                        },
                        transition: {
                            duration: .15
                        },
                        children: [(0, t.jsx)("span", {
                            style: {
                                color: "var(--color-text-secondary)",
                                fontSize: 14,
                                fontWeight: 500,
                                lineHeight: "16px",
                                letterSpacing: "-0.09px"
                            },
                            children: (0, s.format)(new Date(v.timestamp), "MMM d yyyy")
                        }), (0, t.jsx)("p", {
                            style: {
                                color: "var(--color-primary)",
                                fontSize: 16,
                                fontWeight: 600,
                                lineHeight: "20px",
                                letterSpacing: "-0.18px",
                                marginTop: 14
                            },
                            children: v.title
                        }), (0, t.jsxs)("p", {
                            className: "text-pretty",
                            style: {
                                color: "var(--color-text-secondary)",
                                fontSize: 14,
                                fontWeight: 400,
                                lineHeight: "16px",
                                letterSpacing: "-0.09px",
                                marginTop: 6
                            },
                            children: [C || v.summary.length <= 90 ? v.summary : `${v.summary.slice(0,90).trimEnd()}... `, !C && v.summary.length > 90 && (0, t.jsx)("button", {
                                type: "button",
                                className: "cursor-pointer",
                                style: {
                                    color: "var(--color-primary)",
                                    fontSize: 14,
                                    fontWeight: 700,
                                    lineHeight: "16px",
                                    letterSpacing: "-0.09px"
                                },
                                onClick: e => {
                                    e.stopPropagation(), _(!0)
                                },
                                children: "Read more"
                            })]
                        }), (0, t.jsxs)("div", {
                            className: "flex items-center justify-between",
                            style: {
                                marginTop: 14
                            },
                            children: [v.sources && v.sources.length > 0 ? (0, t.jsx)("div", {
                                className: "flex items-center gap-2",
                                children: v.sources.map(p)
                            }) : (0, t.jsx)("div", {}), g.items.length > 1 && (0, t.jsxs)("div", {
                                className: "flex items-center gap-0.5",
                                children: [(0, t.jsx)("button", {
                                    type: "button",
                                    onClick: I,
                                    disabled: 0 === y,
                                    className: "flex items-center justify-center rounded text-[var(--color-text-tertiary)] transition-colors hover:!text-[var(--color-text-primary)] disabled:opacity-30 disabled:pointer-events-none",
                                    children: (0, t.jsx)(a.ChevronLeftSmallIcon20, {})
                                }), (0, t.jsxs)("span", {
                                    className: "tabular-nums",
                                    style: {
                                        color: "var(--color-text-secondary)",
                                        fontSize: 13,
                                        lineHeight: "16px"
                                    },
                                    children: [y + 1, "/", g.items.length]
                                }), (0, t.jsx)("button", {
                                    type: "button",
                                    onClick: P,
                                    disabled: y === g.items.length - 1,
                                    className: "flex items-center justify-center rounded text-[var(--color-text-tertiary)] transition-colors hover:!text-[var(--color-text-primary)] disabled:opacity-30 disabled:pointer-events-none",
                                    children: (0, t.jsx)(i.ChevronRightSmallIcon20, {})
                                })]
                            })]
                        })]
                    }, y)
                })
            })
        }, g.id), x[4] = g, x[5] = v, x[6] = y, x[7] = N, x[8] = C, x[9] = P, x[10] = I, x[11] = w, x[12] = h) : h = x[12], x[13] !== h ? (f = (0, t.jsx)(o.AnimatePresence, {
            children: h
        }), x[13] = h, x[14] = f) : f = x[14], f
    }], 581623);
    var h = e.i(148369),
        f = e.i(720959),
        x = e.i(12884);
    e.s(["NewsChartTooltip", 0, () => {
        let e, a, i, n, s, c, m, p, g, v, y, b, k, w, S, j, C, _, T, M = (0, r.c)(47),
            {
                activeCluster: N,
                activeItem: I,
                activeItemIndex: P
            } = (0, u.useNewsOverlayContext)(),
            {
                margin: E,
                width: A
            } = (0, d.useLineChartContext)(),
            {
                tooltipTops: O,
                tooltipLeft: D
            } = (0, f.useTooltipPositionContext)(),
            {
                visibleMarkets: L,
                series: z
            } = (0, x.useChartContext)();
        e: {
            let t;
            if (!I) {
                e = null;
                break e
            }
            M[0] !== I || M[1] !== L ? (t = function(e, t) {
                if (t.length <= 1) return 0;
                if (e.outcome) {
                    let r = e.outcome.toLowerCase().trim(),
                        a = t.findIndex(e => (e.groupItemTitle || e.question || "").toLowerCase().trim() === r);
                    if (-1 !== a) return a
                }
                for (let r of [e.outcome, e.title]) {
                    if (!r) continue;
                    let e = r.toLowerCase(),
                        a = t.findIndex(t => {
                            let r = (t.groupItemTitle || t.question || "").toLowerCase();
                            return r && (e.includes(r) || r.includes(e))
                        });
                    if (-1 !== a) return a
                }
                return null
            }(I, L), M[0] = I, M[1] = L, M[2] = t) : t = M[2],
            e = t
        }
        let R = e;
        t: {
            if (!I) {
                a = null;
                break t
            }
            if (null === R) {
                a = I.outcome ? ? "Yes";
                break t
            }
            if (1 === L.length) {
                a = "Yes";
                break t
            }
            let e = L[R];a = e ? .groupItemTitle || e ? .question || "Yes"
        }
        let F = a;
        r: {
            if (!I) {
                i = null;
                break r
            }
            if (null !== R) {
                let e;
                M[3] !== I.unixTime || M[4] !== R || M[5] !== z ? (e = function(e, t, r) {
                    let a = e[t];
                    if (!a || a.data.length < 2) return null;
                    let i = a.data,
                        n = 0,
                        s = Math.abs(i[0].time - r);
                    for (let e = 1; e < i.length; e++) {
                        let t = Math.abs(i[e].time - r);
                        t < s && (s = t, n = e)
                    }
                    let o = Math.round(100 * i[n].value),
                        l = Math.min(n, 24),
                        c = n - l,
                        d = c >= 0 ? Math.round(100 * i[c].value) : o;
                    return {
                        price: o,
                        priceChange: o - d
                    }
                }(z, R, I.unixTime), M[3] = I.unixTime, M[4] = R, M[5] = z, M[6] = e) : e = M[6], i = e;
                break r
            }
            if (null != I.priceAfter && null != I.priceBefore) {
                let e, t = I.priceAfter - I.priceBefore;
                M[7] !== I.priceAfter || M[8] !== t ? (e = {
                    price: I.priceAfter,
                    priceChange: t
                }, M[7] = I.priceAfter, M[8] = t, M[9] = e) : e = M[9], i = e;
                break r
            }
            i = null
        }
        let $ = i,
            B = F ? `label-tooltip-${F}` : null;
        M[10] !== I || M[11] !== B ? (n = B && I ? `[id="${CSS.escape(B)}"] { visibility: hidden !important; }` : null, M[10] = I, M[11] = B, M[12] = n) : n = M[12];
        let q = n;
        if (!I || !$) return null;
        let V = R ? ? 0,
            H = O ? .[V] ? ? O ? .[0] ? ? null;
        if (null == H || !D) return null;
        let U = H + E.top,
            W = D + E.left,
            G = D > .65 * (A - E.left - E.right),
            Z = $.priceChange > 0;
        M[13] !== $.priceChange ? (s = Math.abs($.priceChange), M[13] = $.priceChange, M[14] = s) : s = M[14];
        let K = s,
            Y = z[V] ? .color ? ? "var(--color-primary)";
        M[15] !== q ? (c = q && (0, t.jsx)("style", {
            dangerouslySetInnerHTML: {
                __html: q
            }
        }), M[15] = q, M[16] = c) : c = M[16];
        let Q = N ? `${N.id}:${P}` : "empty",
            X = W + (G ? -8 : 8),
            J = U - 10,
            ee = G ? "translateX(-100%)" : void 0;
        return M[17] !== X || M[18] !== J || M[19] !== ee ? (m = {
            left: X,
            top: J,
            transform: ee
        }, M[17] = X, M[18] = J, M[19] = ee, M[20] = m) : m = M[20], M[21] === Symbol.for("react.memo_cache_sentinel") ? (p = {
            opacity: 0
        }, g = {
            opacity: 1
        }, v = {
            opacity: 0
        }, y = {
            duration: .12
        }, M[21] = p, M[22] = g, M[23] = v, M[24] = y) : (p = M[21], g = M[22], v = M[23], y = M[24]), M[25] === Symbol.for("react.memo_cache_sentinel") ? (b = {
            backgroundColor: "var(--color-background, white)",
            border: "1px solid var(--color-border, #e5e5e5)",
            gap: "4px",
            paddingRight: "6px"
        }, M[25] = b) : b = M[25], M[26] !== Y ? (k = (0, t.jsx)("div", {
            className: "rounded-sm shrink-0",
            style: {
                width: "4px",
                height: "12px",
                backgroundColor: Y,
                marginLeft: "4px"
            }
        }), M[26] = Y, M[27] = k) : k = M[27], M[28] === Symbol.for("react.memo_cache_sentinel") ? (w = {
            color: "var(--color-primary, #1d1f24)"
        }, M[28] = w) : w = M[28], M[29] !== $.price || M[30] !== F ? (S = (0, t.jsxs)("p", {
            className: "text-xs font-semibold capitalize leading-5 truncate p-0",
            style: w,
            children: [F, " ", $.price, "%"]
        }), M[29] = $.price, M[30] = F, M[31] = S) : S = M[31], M[32] !== K || M[33] !== $.priceChange || M[34] !== Z ? (j = 0 !== $.priceChange && (0, t.jsxs)("span", {
            className: `flex items-center shrink-0 gap-0.5 ${Z?"text-green-500":"text-red-500"}`,
            children: [Z ? (0, t.jsx)(h.TriangleUp, {}) : (0, t.jsx)(h.TriangleDown, {}), (0, t.jsxs)("span", {
                className: "text-xs font-semibold leading-5",
                children: [K, "%"]
            })]
        }), M[32] = K, M[33] = $.priceChange, M[34] = Z, M[35] = j) : j = M[35], M[36] !== k || M[37] !== S || M[38] !== j ? (C = (0, t.jsxs)("div", {
            className: "flex items-center h-5 box-border rounded whitespace-nowrap",
            style: b,
            children: [k, S, j]
        }), M[36] = k, M[37] = S, M[38] = j, M[39] = C) : C = M[39], M[40] !== m || M[41] !== C || M[42] !== Q ? (_ = (0, t.jsx)(o.AnimatePresence, {
            children: (0, t.jsx)(l.motion.div, {
                className: "absolute pointer-events-none z-10",
                style: m,
                initial: p,
                animate: g,
                exit: v,
                transition: y,
                children: C
            }, Q)
        }), M[40] = m, M[41] = C, M[42] = Q, M[43] = _) : _ = M[43], M[44] !== _ || M[45] !== c ? (T = (0, t.jsxs)(t.Fragment, {
            children: [c, _]
        }), M[44] = _, M[45] = c, M[46] = T) : T = M[46], T
    }], 753870)
}, 261974, (e, t, r) => {
    "use strict";
    var a = Object.defineProperty,
        i = Object.getOwnPropertyDescriptor,
        n = Object.getOwnPropertyNames,
        s = Object.prototype.hasOwnProperty,
        o = {},
        l = {
            SYMBOL_FOR_REQ_CONTEXT: () => d,
            getContext: () => u
        };
    for (var c in l) a(o, c, {
        get: l[c],
        enumerable: !0
    });
    t.exports = ((e, t, r, o) => {
        if (t && "object" == typeof t || "function" == typeof t)
            for (let l of n(t)) s.call(e, l) || l === r || a(e, l, {
                get: () => t[l],
                enumerable: !(o = i(t, l)) || o.enumerable
            });
        return e
    })(a({}, "__esModule", {
        value: !0
    }), o);
    let d = Symbol.for("@vercel/request-context");

    function u() {
        let e = globalThis;
        return e[d] ? .get ? .() ? ? {}
    }
}, 295161, (e, t, r) => {
    "use strict";
    var a = Object.defineProperty,
        i = Object.getOwnPropertyDescriptor,
        n = Object.getOwnPropertyNames,
        s = Object.prototype.hasOwnProperty,
        o = {},
        l = {
            AccessTokenMissingError: () => d,
            RefreshAccessTokenFailedError: () => u
        };
    for (var c in l) a(o, c, {
        get: l[c],
        enumerable: !0
    });
    t.exports = ((e, t, r, o) => {
        if (t && "object" == typeof t || "function" == typeof t)
            for (let l of n(t)) s.call(e, l) || l === r || a(e, l, {
                get: () => t[l],
                enumerable: !(o = i(t, l)) || o.enumerable
            });
        return e
    })(a({}, "__esModule", {
        value: !0
    }), o);
    class d extends Error {
        constructor() {
            super("No authentication found. Please log in with the Vercel CLI (vercel login)."), this.name = "AccessTokenMissingError"
        }
    }
    class u extends Error {
        constructor(e) {
            super("Failed to refresh authentication token.", {
                cause: e
            }), this.name = "RefreshAccessTokenFailedError"
        }
    }
}, 296080, (e, t, r) => {
    "use strict";
    var a = Object.defineProperty,
        i = Object.getOwnPropertyDescriptor,
        n = Object.getOwnPropertyNames,
        s = Object.prototype.hasOwnProperty,
        o = {},
        l = {
            AccessTokenMissingError: () => u.AccessTokenMissingError,
            RefreshAccessTokenFailedError: () => u.RefreshAccessTokenFailedError,
            getContext: () => d.getContext,
            getVercelOidcToken: () => m,
            getVercelOidcTokenSync: () => p,
            getVercelToken: () => h
        };
    for (var c in l) a(o, c, {
        get: l[c],
        enumerable: !0
    });
    t.exports = ((e, t, r, o) => {
        if (t && "object" == typeof t || "function" == typeof t)
            for (let l of n(t)) s.call(e, l) || l === r || a(e, l, {
                get: () => t[l],
                enumerable: !(o = i(t, l)) || o.enumerable
            });
        return e
    })(a({}, "__esModule", {
        value: !0
    }), o);
    var d = e.r(261974),
        u = e.r(295161);
    async function m() {
        return ""
    }

    function p() {
        return ""
    }
    async function h() {
        throw Error("getVercelToken is not supported in browser environments")
    }
}, 282728, (e, t, r) => {
    t.exports = function(e, t) {
        let r;
        if ("function" != typeof e) throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);
        let a = 0;
        return function(...i) {
            clearTimeout(r);
            let n = Date.now(),
                s = t - (n - a);
            s <= 0 ? (a = n, e.apply(this, i)) : r = setTimeout(() => {
                a = Date.now(), e.apply(this, i)
            }, s)
        }
    }
}, 503974, 840420, 110278, e => {
    "use strict";
    let t;
    var r, a, i, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C, _, T, M, N, I, P, E, A, O, D, L, z, R, F, $, B, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er, ea = e.i(416340),
        ei = e.i(284553),
        en = e.i(93257),
        es = "vercel.ai.error",
        eo = Symbol.for(es),
        el = class e extends(c = Error, l = eo, c) {
            constructor({
                name: e,
                message: t,
                cause: r
            }) {
                super(t), this[l] = !0, this.name = e, this.cause = r
            }
            static isInstance(t) {
                return e.hasMarker(t, es)
            }
            static hasMarker(e, t) {
                let r = Symbol.for(t);
                return null != e && "object" == typeof e && r in e && "boolean" == typeof e[r] && !0 === e[r]
            }
        },
        ec = "AI_APICallError",
        ed = `vercel.ai.error.${ec}`,
        eu = Symbol.for(ed),
        em = class extends(u = el, d = eu, u) {
            constructor({
                message: e,
                url: t,
                requestBodyValues: r,
                statusCode: a,
                responseHeaders: i,
                responseBody: n,
                cause: s,
                isRetryable: o = null != a && (408 === a || 409 === a || 429 === a || a >= 500),
                data: l
            }) {
                super({
                    name: ec,
                    message: e,
                    cause: s
                }), this[d] = !0, this.url = t, this.requestBodyValues = r, this.statusCode = a, this.responseHeaders = i, this.responseBody = n, this.isRetryable = o, this.data = l
            }
            static isInstance(e) {
                return el.hasMarker(e, ed)
            }
        },
        ep = "AI_EmptyResponseBodyError",
        eh = `vercel.ai.error.${ep}`,
        ef = Symbol.for(eh),
        ex = class extends(p = el, m = ef, p) {
            constructor({
                message: e = "Empty response body"
            } = {}) {
                super({
                    name: ep,
                    message: e
                }), this[m] = !0
            }
            static isInstance(e) {
                return el.hasMarker(e, eh)
            }
        };

    function eg(e) {
        return null == e ? "unknown error" : "string" == typeof e ? e : e instanceof Error ? e.message : JSON.stringify(e)
    }
    var ev = "AI_InvalidArgumentError",
        ey = `vercel.ai.error.${ev}`,
        eb = Symbol.for(ey),
        ek = class extends(f = el, h = eb, f) {
            constructor({
                message: e,
                cause: t,
                argument: r
            }) {
                super({
                    name: ev,
                    message: e,
                    cause: t
                }), this[h] = !0, this.argument = r
            }
            static isInstance(e) {
                return el.hasMarker(e, ey)
            }
        },
        ew = Symbol.for("vercel.ai.error.AI_InvalidPromptError");
    Symbol.for("vercel.ai.error.AI_InvalidResponseDataError");
    var eS = "AI_JSONParseError",
        ej = `vercel.ai.error.${eS}`,
        eC = Symbol.for(ej),
        e_ = class extends(g = el, x = eC, g) {
            constructor({
                text: e,
                cause: t
            }) {
                super({
                    name: eS,
                    message: `JSON parsing failed: Text: ${e}.
Error message: ${eg(t)}`,
                    cause: t
                }), this[x] = !0, this.text = e
            }
            static isInstance(e) {
                return el.hasMarker(e, ej)
            }
        },
        eT = Symbol.for("vercel.ai.error.AI_LoadAPIKeyError");
    Symbol.for("vercel.ai.error.AI_LoadSettingError");
    Symbol.for("vercel.ai.error.AI_NoContentGeneratedError");
    Symbol.for("vercel.ai.error.AI_NoSuchModelError");
    Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError");
    var eM = "AI_TypeValidationError",
        eN = `vercel.ai.error.${eM}`,
        eI = Symbol.for(eN),
        eP = class e extends(y = el, v = eI, y) {
            constructor({
                value: e,
                cause: t,
                context: r
            }) {
                let a = "Type validation failed";
                if ((null == r ? void 0 : r.field) && (a += ` for ${r.field}`), (null == r ? void 0 : r.entityName) || (null == r ? void 0 : r.entityId)) {
                    a += " (";
                    const e = [];
                    r.entityName && e.push(r.entityName), r.entityId && e.push(`id: "${r.entityId}"`), a += e.join(", "), a += ")"
                }
                super({
                    name: eM,
                    message: `${a}: Value: ${JSON.stringify(e)}.
Error message: ${eg(t)}`,
                    cause: t
                }), this[v] = !0, this.value = e, this.context = r
            }
            static isInstance(e) {
                return el.hasMarker(e, eN)
            }
            static wrap({
                value: t,
                cause: r,
                context: a
            }) {
                var i, n, s;
                return e.isInstance(r) && r.value === t && (null == (i = r.context) ? void 0 : i.field) === (null == a ? void 0 : a.field) && (null == (n = r.context) ? void 0 : n.entityName) === (null == a ? void 0 : a.entityName) && (null == (s = r.context) ? void 0 : s.entityId) === (null == a ? void 0 : a.entityId) ? r : new e({
                    value: t,
                    cause: r,
                    context: a
                })
            }
        },
        eE = Symbol.for("vercel.ai.error.AI_UnsupportedFunctionalityError"),
        eA = e.i(263749),
        eO = e.i(459434);
    (r = b || (b = {})).assertEqual = e => {}, r.assertIs = function(e) {}, r.assertNever = function(e) {
        throw Error()
    }, r.arrayToEnum = e => {
        let t = {};
        for (let r of e) t[r] = r;
        return t
    }, r.getValidEnumValues = e => {
        let t = r.objectKeys(e).filter(t => "number" != typeof e[e[t]]),
            a = {};
        for (let r of t) a[r] = e[r];
        return r.objectValues(a)
    }, r.objectValues = e => r.objectKeys(e).map(function(t) {
        return e[t]
    }), r.objectKeys = "function" == typeof Object.keys ? e => Object.keys(e) : e => {
        let t = [];
        for (let r in e) Object.prototype.hasOwnProperty.call(e, r) && t.push(r);
        return t
    }, r.find = (e, t) => {
        for (let r of e)
            if (t(r)) return r
    }, r.isInteger = "function" == typeof Number.isInteger ? e => Number.isInteger(e) : e => "number" == typeof e && Number.isFinite(e) && Math.floor(e) === e, r.joinValues = function(e, t = " | ") {
        return e.map(e => "string" == typeof e ? `'${e}'` : e).join(t)
    }, r.jsonStringifyReplacer = (e, t) => "bigint" == typeof t ? t.toString() : t, (k || (k = {})).mergeShapes = (e, t) => ({ ...e,
        ...t
    });
    let eD = b.arrayToEnum(["string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set"]),
        eL = e => {
            switch (typeof e) {
                case "undefined":
                    return eD.undefined;
                case "string":
                    return eD.string;
                case "number":
                    return Number.isNaN(e) ? eD.nan : eD.number;
                case "boolean":
                    return eD.boolean;
                case "function":
                    return eD.function;
                case "bigint":
                    return eD.bigint;
                case "symbol":
                    return eD.symbol;
                case "object":
                    if (Array.isArray(e)) return eD.array;
                    if (null === e) return eD.null;
                    if (e.then && "function" == typeof e.then && e.catch && "function" == typeof e.catch) return eD.promise;
                    if ("u" > typeof Map && e instanceof Map) return eD.map;
                    if ("u" > typeof Set && e instanceof Set) return eD.set;
                    if ("u" > typeof Date && e instanceof Date) return eD.date;
                    return eD.object;
                default:
                    return eD.unknown
            }
        },
        ez = b.arrayToEnum(["invalid_type", "invalid_literal", "custom", "invalid_union", "invalid_union_discriminator", "invalid_enum_value", "unrecognized_keys", "invalid_arguments", "invalid_return_type", "invalid_date", "invalid_string", "too_small", "too_big", "invalid_intersection_types", "not_multiple_of", "not_finite"]);
    class eR extends Error {
        get errors() {
            return this.issues
        }
        constructor(e) {
            super(), this.issues = [], this.addIssue = e => {
                this.issues = [...this.issues, e]
            }, this.addIssues = (e = []) => {
                this.issues = [...this.issues, ...e]
            };
            const t = new.target.prototype;
            Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e
        }
        format(e) {
            let t = e || function(e) {
                    return e.message
                },
                r = {
                    _errors: []
                },
                a = e => {
                    for (let i of e.issues)
                        if ("invalid_union" === i.code) i.unionErrors.map(a);
                        else if ("invalid_return_type" === i.code) a(i.returnTypeError);
                    else if ("invalid_arguments" === i.code) a(i.argumentsError);
                    else if (0 === i.path.length) r._errors.push(t(i));
                    else {
                        let e = r,
                            a = 0;
                        for (; a < i.path.length;) {
                            let r = i.path[a];
                            a === i.path.length - 1 ? (e[r] = e[r] || {
                                _errors: []
                            }, e[r]._errors.push(t(i))) : e[r] = e[r] || {
                                _errors: []
                            }, e = e[r], a++
                        }
                    }
                };
            return a(this), r
        }
        static assert(e) {
            if (!(e instanceof eR)) throw Error(`Not a ZodError: ${e}`)
        }
        toString() {
            return this.message
        }
        get message() {
            return JSON.stringify(this.issues, b.jsonStringifyReplacer, 2)
        }
        get isEmpty() {
            return 0 === this.issues.length
        }
        flatten(e = e => e.message) {
            let t = Object.create(null),
                r = [];
            for (let a of this.issues)
                if (a.path.length > 0) {
                    let r = a.path[0];
                    t[r] = t[r] || [], t[r].push(e(a))
                } else r.push(e(a));
            return {
                formErrors: r,
                fieldErrors: t
            }
        }
        get formErrors() {
            return this.flatten()
        }
    }
    eR.create = e => new eR(e);
    let eF = (e, t) => {
        let r;
        switch (e.code) {
            case ez.invalid_type:
                r = e.received === eD.undefined ? "Required" : `Expected ${e.expected}, received ${e.received}`;
                break;
            case ez.invalid_literal:
                r = `Invalid literal value, expected ${JSON.stringify(e.expected,b.jsonStringifyReplacer)}`;
                break;
            case ez.unrecognized_keys:
                r = `Unrecognized key(s) in object: ${b.joinValues(e.keys,", ")}`;
                break;
            case ez.invalid_union:
                r = "Invalid input";
                break;
            case ez.invalid_union_discriminator:
                r = `Invalid discriminator value. Expected ${b.joinValues(e.options)}`;
                break;
            case ez.invalid_enum_value:
                r = `Invalid enum value. Expected ${b.joinValues(e.options)}, received '${e.received}'`;
                break;
            case ez.invalid_arguments:
                r = "Invalid function arguments";
                break;
            case ez.invalid_return_type:
                r = "Invalid function return type";
                break;
            case ez.invalid_date:
                r = "Invalid date";
                break;
            case ez.invalid_string:
                "object" == typeof e.validation ? "includes" in e.validation ? (r = `Invalid input: must include "${e.validation.includes}"`, "number" == typeof e.validation.position && (r = `${r} at one or more positions greater than or equal to ${e.validation.position}`)) : "startsWith" in e.validation ? r = `Invalid input: must start with "${e.validation.startsWith}"` : "endsWith" in e.validation ? r = `Invalid input: must end with "${e.validation.endsWith}"` : b.assertNever(e.validation) : r = "regex" !== e.validation ? `Invalid ${e.validation}` : "Invalid";
                break;
            case ez.too_small:
                r = "array" === e.type ? `Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)` : "string" === e.type ? `String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)` : "number" === e.type || "bigint" === e.type ? `Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}` : "date" === e.type ? `Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}` : "Invalid input";
                break;
            case ez.too_big:
                r = "array" === e.type ? `Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)` : "string" === e.type ? `String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)` : "number" === e.type ? `Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}` : "bigint" === e.type ? `BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}` : "date" === e.type ? `Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}` : "Invalid input";
                break;
            case ez.custom:
                r = "Invalid input";
                break;
            case ez.invalid_intersection_types:
                r = "Intersection results could not be merged";
                break;
            case ez.not_multiple_of:
                r = `Number must be a multiple of ${e.multipleOf}`;
                break;
            case ez.not_finite:
                r = "Number must be finite";
                break;
            default:
                r = t.defaultError, b.assertNever(e)
        }
        return {
            message: r
        }
    };
    (a = w || (w = {})).errToObj = e => "string" == typeof e ? {
        message: e
    } : e || {}, a.toString = e => "string" == typeof e ? e : e ? .message;
    let e$ = e => {
        let {
            data: t,
            path: r,
            errorMaps: a,
            issueData: i
        } = e, n = [...r, ...i.path || []], s = { ...i,
            path: n
        };
        if (void 0 !== i.message) return { ...i,
            path: n,
            message: i.message
        };
        let o = "";
        for (let e of a.filter(e => !!e).slice().reverse()) o = e(s, {
            data: t,
            defaultError: o
        }).message;
        return { ...i,
            path: n,
            message: o
        }
    };

    function eB(e, t) {
        let r = e$({
            issueData: t,
            data: e.data,
            path: e.path,
            errorMaps: [e.common.contextualErrorMap, e.schemaErrorMap, eF, void 0].filter(e => !!e)
        });
        e.common.issues.push(r)
    }
    class eq {
        constructor() {
            this.value = "valid"
        }
        dirty() {
            "valid" === this.value && (this.value = "dirty")
        }
        abort() {
            "aborted" !== this.value && (this.value = "aborted")
        }
        static mergeArray(e, t) {
            let r = [];
            for (let a of t) {
                if ("aborted" === a.status) return eV;
                "dirty" === a.status && e.dirty(), r.push(a.value)
            }
            return {
                status: e.value,
                value: r
            }
        }
        static async mergeObjectAsync(e, t) {
            let r = [];
            for (let e of t) {
                let t = await e.key,
                    a = await e.value;
                r.push({
                    key: t,
                    value: a
                })
            }
            return eq.mergeObjectSync(e, r)
        }
        static mergeObjectSync(e, t) {
            let r = {};
            for (let a of t) {
                let {
                    key: t,
                    value: i
                } = a;
                if ("aborted" === t.status || "aborted" === i.status) return eV;
                "dirty" === t.status && e.dirty(), "dirty" === i.status && e.dirty(), "__proto__" !== t.value && (void 0 !== i.value || a.alwaysSet) && (r[t.value] = i.value)
            }
            return {
                status: e.value,
                value: r
            }
        }
    }
    let eV = Object.freeze({
            status: "aborted"
        }),
        eH = e => ({
            status: "dirty",
            value: e
        }),
        eU = e => ({
            status: "valid",
            value: e
        }),
        eW = e => "u" > typeof Promise && e instanceof Promise;
    class eG {
        constructor(e, t, r, a) {
            this._cachedPath = [], this.parent = e, this.data = t, this._path = r, this._key = a
        }
        get path() {
            return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath
        }
    }
    let eZ = (e, t) => {
        if ("valid" === t.status) return {
            success: !0,
            data: t.value
        };
        if (!e.common.issues.length) throw Error("Validation failed but no issues detected.");
        return {
            success: !1,
            get error() {
                if (this._error) return this._error;
                let t = new eR(e.common.issues);
                return this._error = t, this._error
            }
        }
    };

    function eK(e) {
        if (!e) return {};
        let {
            errorMap: t,
            invalid_type_error: r,
            required_error: a,
            description: i
        } = e;
        if (t && (r || a)) throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');
        return t ? {
            errorMap: t,
            description: i
        } : {
            errorMap: (t, i) => {
                let {
                    message: n
                } = e;
                return "invalid_enum_value" === t.code ? {
                    message: n ? ? i.defaultError
                } : void 0 === i.data ? {
                    message: n ? ? a ? ? i.defaultError
                } : "invalid_type" !== t.code ? {
                    message: i.defaultError
                } : {
                    message: n ? ? r ? ? i.defaultError
                }
            },
            description: i
        }
    }
    class eY {
        get description() {
            return this._def.description
        }
        _getType(e) {
            return eL(e.data)
        }
        _getOrReturnCtx(e, t) {
            return t || {
                common: e.parent.common,
                data: e.data,
                parsedType: eL(e.data),
                schemaErrorMap: this._def.errorMap,
                path: e.path,
                parent: e.parent
            }
        }
        _processInputParams(e) {
            return {
                status: new eq,
                ctx: {
                    common: e.parent.common,
                    data: e.data,
                    parsedType: eL(e.data),
                    schemaErrorMap: this._def.errorMap,
                    path: e.path,
                    parent: e.parent
                }
            }
        }
        _parseSync(e) {
            let t = this._parse(e);
            if (eW(t)) throw Error("Synchronous parse encountered promise.");
            return t
        }
        _parseAsync(e) {
            return Promise.resolve(this._parse(e))
        }
        parse(e, t) {
            let r = this.safeParse(e, t);
            if (r.success) return r.data;
            throw r.error
        }
        safeParse(e, t) {
            let r = {
                    common: {
                        issues: [],
                        async: t ? .async ? ? !1,
                        contextualErrorMap: t ? .errorMap
                    },
                    path: t ? .path || [],
                    schemaErrorMap: this._def.errorMap,
                    parent: null,
                    data: e,
                    parsedType: eL(e)
                },
                a = this._parseSync({
                    data: e,
                    path: r.path,
                    parent: r
                });
            return eZ(r, a)
        }
        "~validate" (e) {
            let t = {
                common: {
                    issues: [],
                    async: !!this["~standard"].async
                },
                path: [],
                schemaErrorMap: this._def.errorMap,
                parent: null,
                data: e,
                parsedType: eL(e)
            };
            if (!this["~standard"].async) try {
                let r = this._parseSync({
                    data: e,
                    path: [],
                    parent: t
                });
                return "valid" === r.status ? {
                    value: r.value
                } : {
                    issues: t.common.issues
                }
            } catch (e) {
                e ? .message ? .toLowerCase() ? .includes("encountered") && (this["~standard"].async = !0), t.common = {
                    issues: [],
                    async: !0
                }
            }
            return this._parseAsync({
                data: e,
                path: [],
                parent: t
            }).then(e => "valid" === e.status ? {
                value: e.value
            } : {
                issues: t.common.issues
            })
        }
        async parseAsync(e, t) {
            let r = await this.safeParseAsync(e, t);
            if (r.success) return r.data;
            throw r.error
        }
        async safeParseAsync(e, t) {
            let r = {
                    common: {
                        issues: [],
                        contextualErrorMap: t ? .errorMap,
                        async: !0
                    },
                    path: t ? .path || [],
                    schemaErrorMap: this._def.errorMap,
                    parent: null,
                    data: e,
                    parsedType: eL(e)
                },
                a = this._parse({
                    data: e,
                    path: r.path,
                    parent: r
                });
            return eZ(r, await (eW(a) ? a : Promise.resolve(a)))
        }
        refine(e, t) {
            return this._refinement((r, a) => {
                let i = e(r),
                    n = () => a.addIssue({
                        code: ez.custom,
                        ..."string" == typeof t || void 0 === t ? {
                            message: t
                        } : "function" == typeof t ? t(r) : t
                    });
                return "u" > typeof Promise && i instanceof Promise ? i.then(e => !!e || (n(), !1)) : !!i || (n(), !1)
            })
        }
        refinement(e, t) {
            return this._refinement((r, a) => !!e(r) || (a.addIssue("function" == typeof t ? t(r, a) : t), !1))
        }
        _refinement(e) {
            return new tA({
                schema: this,
                typeName: S.ZodEffects,
                effect: {
                    type: "refinement",
                    refinement: e
                }
            })
        }
        superRefine(e) {
            return this._refinement(e)
        }
        constructor(e) {
            this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
                version: 1,
                vendor: "zod",
                validate: e => this["~validate"](e)
            }
        }
        optional() {
            return tO.create(this, this._def)
        }
        nullable() {
            return tD.create(this, this._def)
        }
        nullish() {
            return this.nullable().optional()
        }
        array() {
            return tx.create(this)
        }
        promise() {
            return tE.create(this, this._def)
        }
        or(e) {
            return tv.create([this, e], this._def)
        }
        and(e) {
            return tk.create(this, e, this._def)
        }
        transform(e) {
            return new tA({ ...eK(this._def),
                schema: this,
                typeName: S.ZodEffects,
                effect: {
                    type: "transform",
                    transform: e
                }
            })
        }
        default (e) {
            return new tL({ ...eK(this._def),
                innerType: this,
                defaultValue: "function" == typeof e ? e : () => e,
                typeName: S.ZodDefault
            })
        }
        brand() {
            return new tF({
                typeName: S.ZodBranded,
                type: this,
                ...eK(this._def)
            })
        } catch (e) {
            return new tz({ ...eK(this._def),
                innerType: this,
                catchValue: "function" == typeof e ? e : () => e,
                typeName: S.ZodCatch
            })
        }
        describe(e) {
            return new this.constructor({ ...this._def,
                description: e
            })
        }
        pipe(e) {
            return t$.create(this, e)
        }
        readonly() {
            return tB.create(this)
        }
        isOptional() {
            return this.safeParse(void 0).success
        }
        isNullable() {
            return this.safeParse(null).success
        }
    }
    let eQ = /^c[^\s-]{8,}$/i,
        eX = /^[0-9a-z]+$/,
        eJ = /^[0-9A-HJKMNP-TV-Z]{26}$/i,
        e0 = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,
        e1 = /^[a-z0-9_-]{21}$/i,
        e2 = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,
        e3 = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,
        e4 = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,
        e5 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
        e6 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
        e9 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,
        e8 = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
        e7 = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
        te = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
        tt = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",
        tr = RegExp(`^${tt}$`);

    function ta(e) {
        let t = "[0-5]\\d";
        e.precision ? t = `${t}\\.\\d{${e.precision}}` : null == e.precision && (t = `${t}(\\.\\d+)?`);
        let r = e.precision ? "+" : "?";
        return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`
    }
    class ti extends eY {
        _parse(e) {
            var r, a, i, n;
            let s;
            if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== eD.string) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.string,
                    received: t.parsedType
                }), eV
            }
            let o = new eq;
            for (let l of this._def.checks)
                if ("min" === l.kind) e.data.length < l.value && (eB(s = this._getOrReturnCtx(e, s), {
                    code: ez.too_small,
                    minimum: l.value,
                    type: "string",
                    inclusive: !0,
                    exact: !1,
                    message: l.message
                }), o.dirty());
                else if ("max" === l.kind) e.data.length > l.value && (eB(s = this._getOrReturnCtx(e, s), {
                code: ez.too_big,
                maximum: l.value,
                type: "string",
                inclusive: !0,
                exact: !1,
                message: l.message
            }), o.dirty());
            else if ("length" === l.kind) {
                let t = e.data.length > l.value,
                    r = e.data.length < l.value;
                (t || r) && (s = this._getOrReturnCtx(e, s), t ? eB(s, {
                    code: ez.too_big,
                    maximum: l.value,
                    type: "string",
                    inclusive: !0,
                    exact: !0,
                    message: l.message
                }) : r && eB(s, {
                    code: ez.too_small,
                    minimum: l.value,
                    type: "string",
                    inclusive: !0,
                    exact: !0,
                    message: l.message
                }), o.dirty())
            } else if ("email" === l.kind) e4.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "email",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty());
            else if ("emoji" === l.kind) t || (t = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), t.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "emoji",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty());
            else if ("uuid" === l.kind) e0.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "uuid",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty());
            else if ("nanoid" === l.kind) e1.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "nanoid",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty());
            else if ("cuid" === l.kind) eQ.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "cuid",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty());
            else if ("cuid2" === l.kind) eX.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "cuid2",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty());
            else if ("ulid" === l.kind) eJ.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "ulid",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty());
            else if ("url" === l.kind) try {
                new URL(e.data)
            } catch {
                eB(s = this._getOrReturnCtx(e, s), {
                    validation: "url",
                    code: ez.invalid_string,
                    message: l.message
                }), o.dirty()
            } else "regex" === l.kind ? (l.regex.lastIndex = 0, l.regex.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "regex",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty())) : "trim" === l.kind ? e.data = e.data.trim() : "includes" === l.kind ? e.data.includes(l.value, l.position) || (eB(s = this._getOrReturnCtx(e, s), {
                code: ez.invalid_string,
                validation: {
                    includes: l.value,
                    position: l.position
                },
                message: l.message
            }), o.dirty()) : "toLowerCase" === l.kind ? e.data = e.data.toLowerCase() : "toUpperCase" === l.kind ? e.data = e.data.toUpperCase() : "startsWith" === l.kind ? e.data.startsWith(l.value) || (eB(s = this._getOrReturnCtx(e, s), {
                code: ez.invalid_string,
                validation: {
                    startsWith: l.value
                },
                message: l.message
            }), o.dirty()) : "endsWith" === l.kind ? e.data.endsWith(l.value) || (eB(s = this._getOrReturnCtx(e, s), {
                code: ez.invalid_string,
                validation: {
                    endsWith: l.value
                },
                message: l.message
            }), o.dirty()) : "datetime" === l.kind ? (function(e) {
                let t = `${tt}T${ta(e)}`,
                    r = [];
                return r.push(e.local ? "Z?" : "Z"), e.offset && r.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${r.join("|")})`, RegExp(`^${t}$`)
            })(l).test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                code: ez.invalid_string,
                validation: "datetime",
                message: l.message
            }), o.dirty()) : "date" === l.kind ? tr.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                code: ez.invalid_string,
                validation: "date",
                message: l.message
            }), o.dirty()) : "time" === l.kind ? RegExp(`^${ta(l)}$`).test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                code: ez.invalid_string,
                validation: "time",
                message: l.message
            }), o.dirty()) : "duration" === l.kind ? e3.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "duration",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty()) : "ip" === l.kind ? (r = e.data, !(("v4" === (a = l.version) || !a) && e5.test(r) || ("v6" === a || !a) && e9.test(r)) && 1 && (eB(s = this._getOrReturnCtx(e, s), {
                validation: "ip",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty())) : "jwt" === l.kind ? ! function(e, t) {
                if (!e2.test(e)) return !1;
                try {
                    let [r] = e.split(".");
                    if (!r) return !1;
                    let a = r.replace(/-/g, "+").replace(/_/g, "/").padEnd(r.length + (4 - r.length % 4) % 4, "="),
                        i = JSON.parse(atob(a));
                    if ("object" != typeof i || null === i || "typ" in i && i ? .typ !== "JWT" || !i.alg || t && i.alg !== t) return !1;
                    return !0
                } catch {
                    return !1
                }
            }(e.data, l.alg) && (eB(s = this._getOrReturnCtx(e, s), {
                validation: "jwt",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty()) : "cidr" === l.kind ? (i = e.data, !(("v4" === (n = l.version) || !n) && e6.test(i) || ("v6" === n || !n) && e8.test(i)) && 1 && (eB(s = this._getOrReturnCtx(e, s), {
                validation: "cidr",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty())) : "base64" === l.kind ? e7.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "base64",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty()) : "base64url" === l.kind ? te.test(e.data) || (eB(s = this._getOrReturnCtx(e, s), {
                validation: "base64url",
                code: ez.invalid_string,
                message: l.message
            }), o.dirty()) : b.assertNever(l);
            return {
                status: o.value,
                value: e.data
            }
        }
        _regex(e, t, r) {
            return this.refinement(t => e.test(t), {
                validation: t,
                code: ez.invalid_string,
                ...w.errToObj(r)
            })
        }
        _addCheck(e) {
            return new ti({ ...this._def,
                checks: [...this._def.checks, e]
            })
        }
        email(e) {
            return this._addCheck({
                kind: "email",
                ...w.errToObj(e)
            })
        }
        url(e) {
            return this._addCheck({
                kind: "url",
                ...w.errToObj(e)
            })
        }
        emoji(e) {
            return this._addCheck({
                kind: "emoji",
                ...w.errToObj(e)
            })
        }
        uuid(e) {
            return this._addCheck({
                kind: "uuid",
                ...w.errToObj(e)
            })
        }
        nanoid(e) {
            return this._addCheck({
                kind: "nanoid",
                ...w.errToObj(e)
            })
        }
        cuid(e) {
            return this._addCheck({
                kind: "cuid",
                ...w.errToObj(e)
            })
        }
        cuid2(e) {
            return this._addCheck({
                kind: "cuid2",
                ...w.errToObj(e)
            })
        }
        ulid(e) {
            return this._addCheck({
                kind: "ulid",
                ...w.errToObj(e)
            })
        }
        base64(e) {
            return this._addCheck({
                kind: "base64",
                ...w.errToObj(e)
            })
        }
        base64url(e) {
            return this._addCheck({
                kind: "base64url",
                ...w.errToObj(e)
            })
        }
        jwt(e) {
            return this._addCheck({
                kind: "jwt",
                ...w.errToObj(e)
            })
        }
        ip(e) {
            return this._addCheck({
                kind: "ip",
                ...w.errToObj(e)
            })
        }
        cidr(e) {
            return this._addCheck({
                kind: "cidr",
                ...w.errToObj(e)
            })
        }
        datetime(e) {
            return "string" == typeof e ? this._addCheck({
                kind: "datetime",
                precision: null,
                offset: !1,
                local: !1,
                message: e
            }) : this._addCheck({
                kind: "datetime",
                precision: void 0 === e ? .precision ? null : e ? .precision,
                offset: e ? .offset ? ? !1,
                local: e ? .local ? ? !1,
                ...w.errToObj(e ? .message)
            })
        }
        date(e) {
            return this._addCheck({
                kind: "date",
                message: e
            })
        }
        time(e) {
            return "string" == typeof e ? this._addCheck({
                kind: "time",
                precision: null,
                message: e
            }) : this._addCheck({
                kind: "time",
                precision: void 0 === e ? .precision ? null : e ? .precision,
                ...w.errToObj(e ? .message)
            })
        }
        duration(e) {
            return this._addCheck({
                kind: "duration",
                ...w.errToObj(e)
            })
        }
        regex(e, t) {
            return this._addCheck({
                kind: "regex",
                regex: e,
                ...w.errToObj(t)
            })
        }
        includes(e, t) {
            return this._addCheck({
                kind: "includes",
                value: e,
                position: t ? .position,
                ...w.errToObj(t ? .message)
            })
        }
        startsWith(e, t) {
            return this._addCheck({
                kind: "startsWith",
                value: e,
                ...w.errToObj(t)
            })
        }
        endsWith(e, t) {
            return this._addCheck({
                kind: "endsWith",
                value: e,
                ...w.errToObj(t)
            })
        }
        min(e, t) {
            return this._addCheck({
                kind: "min",
                value: e,
                ...w.errToObj(t)
            })
        }
        max(e, t) {
            return this._addCheck({
                kind: "max",
                value: e,
                ...w.errToObj(t)
            })
        }
        length(e, t) {
            return this._addCheck({
                kind: "length",
                value: e,
                ...w.errToObj(t)
            })
        }
        nonempty(e) {
            return this.min(1, w.errToObj(e))
        }
        trim() {
            return new ti({ ...this._def,
                checks: [...this._def.checks, {
                    kind: "trim"
                }]
            })
        }
        toLowerCase() {
            return new ti({ ...this._def,
                checks: [...this._def.checks, {
                    kind: "toLowerCase"
                }]
            })
        }
        toUpperCase() {
            return new ti({ ...this._def,
                checks: [...this._def.checks, {
                    kind: "toUpperCase"
                }]
            })
        }
        get isDatetime() {
            return !!this._def.checks.find(e => "datetime" === e.kind)
        }
        get isDate() {
            return !!this._def.checks.find(e => "date" === e.kind)
        }
        get isTime() {
            return !!this._def.checks.find(e => "time" === e.kind)
        }
        get isDuration() {
            return !!this._def.checks.find(e => "duration" === e.kind)
        }
        get isEmail() {
            return !!this._def.checks.find(e => "email" === e.kind)
        }
        get isURL() {
            return !!this._def.checks.find(e => "url" === e.kind)
        }
        get isEmoji() {
            return !!this._def.checks.find(e => "emoji" === e.kind)
        }
        get isUUID() {
            return !!this._def.checks.find(e => "uuid" === e.kind)
        }
        get isNANOID() {
            return !!this._def.checks.find(e => "nanoid" === e.kind)
        }
        get isCUID() {
            return !!this._def.checks.find(e => "cuid" === e.kind)
        }
        get isCUID2() {
            return !!this._def.checks.find(e => "cuid2" === e.kind)
        }
        get isULID() {
            return !!this._def.checks.find(e => "ulid" === e.kind)
        }
        get isIP() {
            return !!this._def.checks.find(e => "ip" === e.kind)
        }
        get isCIDR() {
            return !!this._def.checks.find(e => "cidr" === e.kind)
        }
        get isBase64() {
            return !!this._def.checks.find(e => "base64" === e.kind)
        }
        get isBase64url() {
            return !!this._def.checks.find(e => "base64url" === e.kind)
        }
        get minLength() {
            let e = null;
            for (let t of this._def.checks) "min" === t.kind && (null === e || t.value > e) && (e = t.value);
            return e
        }
        get maxLength() {
            let e = null;
            for (let t of this._def.checks) "max" === t.kind && (null === e || t.value < e) && (e = t.value);
            return e
        }
    }
    ti.create = e => new ti({
        checks: [],
        typeName: S.ZodString,
        coerce: e ? .coerce ? ? !1,
        ...eK(e)
    });
    class tn extends eY {
        constructor() {
            super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf
        }
        _parse(e) {
            let t;
            if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== eD.number) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.number,
                    received: t.parsedType
                }), eV
            }
            let r = new eq;
            for (let a of this._def.checks) "int" === a.kind ? b.isInteger(e.data) || (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.invalid_type,
                expected: "integer",
                received: "float",
                message: a.message
            }), r.dirty()) : "min" === a.kind ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.too_small,
                minimum: a.value,
                type: "number",
                inclusive: a.inclusive,
                exact: !1,
                message: a.message
            }), r.dirty()) : "max" === a.kind ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.too_big,
                maximum: a.value,
                type: "number",
                inclusive: a.inclusive,
                exact: !1,
                message: a.message
            }), r.dirty()) : "multipleOf" === a.kind ? 0 !== function(e, t) {
                let r = (e.toString().split(".")[1] || "").length,
                    a = (t.toString().split(".")[1] || "").length,
                    i = r > a ? r : a;
                return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i
            }(e.data, a.value) && (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.not_multiple_of,
                multipleOf: a.value,
                message: a.message
            }), r.dirty()) : "finite" === a.kind ? Number.isFinite(e.data) || (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.not_finite,
                message: a.message
            }), r.dirty()) : b.assertNever(a);
            return {
                status: r.value,
                value: e.data
            }
        }
        gte(e, t) {
            return this.setLimit("min", e, !0, w.toString(t))
        }
        gt(e, t) {
            return this.setLimit("min", e, !1, w.toString(t))
        }
        lte(e, t) {
            return this.setLimit("max", e, !0, w.toString(t))
        }
        lt(e, t) {
            return this.setLimit("max", e, !1, w.toString(t))
        }
        setLimit(e, t, r, a) {
            return new tn({ ...this._def,
                checks: [...this._def.checks, {
                    kind: e,
                    value: t,
                    inclusive: r,
                    message: w.toString(a)
                }]
            })
        }
        _addCheck(e) {
            return new tn({ ...this._def,
                checks: [...this._def.checks, e]
            })
        }
        int(e) {
            return this._addCheck({
                kind: "int",
                message: w.toString(e)
            })
        }
        positive(e) {
            return this._addCheck({
                kind: "min",
                value: 0,
                inclusive: !1,
                message: w.toString(e)
            })
        }
        negative(e) {
            return this._addCheck({
                kind: "max",
                value: 0,
                inclusive: !1,
                message: w.toString(e)
            })
        }
        nonpositive(e) {
            return this._addCheck({
                kind: "max",
                value: 0,
                inclusive: !0,
                message: w.toString(e)
            })
        }
        nonnegative(e) {
            return this._addCheck({
                kind: "min",
                value: 0,
                inclusive: !0,
                message: w.toString(e)
            })
        }
        multipleOf(e, t) {
            return this._addCheck({
                kind: "multipleOf",
                value: e,
                message: w.toString(t)
            })
        }
        finite(e) {
            return this._addCheck({
                kind: "finite",
                message: w.toString(e)
            })
        }
        safe(e) {
            return this._addCheck({
                kind: "min",
                inclusive: !0,
                value: Number.MIN_SAFE_INTEGER,
                message: w.toString(e)
            })._addCheck({
                kind: "max",
                inclusive: !0,
                value: Number.MAX_SAFE_INTEGER,
                message: w.toString(e)
            })
        }
        get minValue() {
            let e = null;
            for (let t of this._def.checks) "min" === t.kind && (null === e || t.value > e) && (e = t.value);
            return e
        }
        get maxValue() {
            let e = null;
            for (let t of this._def.checks) "max" === t.kind && (null === e || t.value < e) && (e = t.value);
            return e
        }
        get isInt() {
            return !!this._def.checks.find(e => "int" === e.kind || "multipleOf" === e.kind && b.isInteger(e.value))
        }
        get isFinite() {
            let e = null,
                t = null;
            for (let r of this._def.checks)
                if ("finite" === r.kind || "int" === r.kind || "multipleOf" === r.kind) return !0;
                else "min" === r.kind ? (null === t || r.value > t) && (t = r.value) : "max" === r.kind && (null === e || r.value < e) && (e = r.value);
            return Number.isFinite(t) && Number.isFinite(e)
        }
    }
    tn.create = e => new tn({
        checks: [],
        typeName: S.ZodNumber,
        coerce: e ? .coerce || !1,
        ...eK(e)
    });
    class ts extends eY {
        constructor() {
            super(...arguments), this.min = this.gte, this.max = this.lte
        }
        _parse(e) {
            let t;
            if (this._def.coerce) try {
                e.data = BigInt(e.data)
            } catch {
                return this._getInvalidInput(e)
            }
            if (this._getType(e) !== eD.bigint) return this._getInvalidInput(e);
            let r = new eq;
            for (let a of this._def.checks) "min" === a.kind ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.too_small,
                type: "bigint",
                minimum: a.value,
                inclusive: a.inclusive,
                message: a.message
            }), r.dirty()) : "max" === a.kind ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.too_big,
                type: "bigint",
                maximum: a.value,
                inclusive: a.inclusive,
                message: a.message
            }), r.dirty()) : "multipleOf" === a.kind ? e.data % a.value !== BigInt(0) && (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.not_multiple_of,
                multipleOf: a.value,
                message: a.message
            }), r.dirty()) : b.assertNever(a);
            return {
                status: r.value,
                value: e.data
            }
        }
        _getInvalidInput(e) {
            let t = this._getOrReturnCtx(e);
            return eB(t, {
                code: ez.invalid_type,
                expected: eD.bigint,
                received: t.parsedType
            }), eV
        }
        gte(e, t) {
            return this.setLimit("min", e, !0, w.toString(t))
        }
        gt(e, t) {
            return this.setLimit("min", e, !1, w.toString(t))
        }
        lte(e, t) {
            return this.setLimit("max", e, !0, w.toString(t))
        }
        lt(e, t) {
            return this.setLimit("max", e, !1, w.toString(t))
        }
        setLimit(e, t, r, a) {
            return new ts({ ...this._def,
                checks: [...this._def.checks, {
                    kind: e,
                    value: t,
                    inclusive: r,
                    message: w.toString(a)
                }]
            })
        }
        _addCheck(e) {
            return new ts({ ...this._def,
                checks: [...this._def.checks, e]
            })
        }
        positive(e) {
            return this._addCheck({
                kind: "min",
                value: BigInt(0),
                inclusive: !1,
                message: w.toString(e)
            })
        }
        negative(e) {
            return this._addCheck({
                kind: "max",
                value: BigInt(0),
                inclusive: !1,
                message: w.toString(e)
            })
        }
        nonpositive(e) {
            return this._addCheck({
                kind: "max",
                value: BigInt(0),
                inclusive: !0,
                message: w.toString(e)
            })
        }
        nonnegative(e) {
            return this._addCheck({
                kind: "min",
                value: BigInt(0),
                inclusive: !0,
                message: w.toString(e)
            })
        }
        multipleOf(e, t) {
            return this._addCheck({
                kind: "multipleOf",
                value: e,
                message: w.toString(t)
            })
        }
        get minValue() {
            let e = null;
            for (let t of this._def.checks) "min" === t.kind && (null === e || t.value > e) && (e = t.value);
            return e
        }
        get maxValue() {
            let e = null;
            for (let t of this._def.checks) "max" === t.kind && (null === e || t.value < e) && (e = t.value);
            return e
        }
    }
    ts.create = e => new ts({
        checks: [],
        typeName: S.ZodBigInt,
        coerce: e ? .coerce ? ? !1,
        ...eK(e)
    });
    class to extends eY {
        _parse(e) {
            if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== eD.boolean) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.boolean,
                    received: t.parsedType
                }), eV
            }
            return eU(e.data)
        }
    }
    to.create = e => new to({
        typeName: S.ZodBoolean,
        coerce: e ? .coerce || !1,
        ...eK(e)
    });
    class tl extends eY {
        _parse(e) {
            let t;
            if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== eD.date) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.date,
                    received: t.parsedType
                }), eV
            }
            if (Number.isNaN(e.data.getTime())) return eB(this._getOrReturnCtx(e), {
                code: ez.invalid_date
            }), eV;
            let r = new eq;
            for (let a of this._def.checks) "min" === a.kind ? e.data.getTime() < a.value && (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.too_small,
                message: a.message,
                inclusive: !0,
                exact: !1,
                minimum: a.value,
                type: "date"
            }), r.dirty()) : "max" === a.kind ? e.data.getTime() > a.value && (eB(t = this._getOrReturnCtx(e, t), {
                code: ez.too_big,
                message: a.message,
                inclusive: !0,
                exact: !1,
                maximum: a.value,
                type: "date"
            }), r.dirty()) : b.assertNever(a);
            return {
                status: r.value,
                value: new Date(e.data.getTime())
            }
        }
        _addCheck(e) {
            return new tl({ ...this._def,
                checks: [...this._def.checks, e]
            })
        }
        min(e, t) {
            return this._addCheck({
                kind: "min",
                value: e.getTime(),
                message: w.toString(t)
            })
        }
        max(e, t) {
            return this._addCheck({
                kind: "max",
                value: e.getTime(),
                message: w.toString(t)
            })
        }
        get minDate() {
            let e = null;
            for (let t of this._def.checks) "min" === t.kind && (null === e || t.value > e) && (e = t.value);
            return null != e ? new Date(e) : null
        }
        get maxDate() {
            let e = null;
            for (let t of this._def.checks) "max" === t.kind && (null === e || t.value < e) && (e = t.value);
            return null != e ? new Date(e) : null
        }
    }
    tl.create = e => new tl({
        checks: [],
        coerce: e ? .coerce || !1,
        typeName: S.ZodDate,
        ...eK(e)
    });
    class tc extends eY {
        _parse(e) {
            if (this._getType(e) !== eD.symbol) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.symbol,
                    received: t.parsedType
                }), eV
            }
            return eU(e.data)
        }
    }
    tc.create = e => new tc({
        typeName: S.ZodSymbol,
        ...eK(e)
    });
    class td extends eY {
        _parse(e) {
            if (this._getType(e) !== eD.undefined) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.undefined,
                    received: t.parsedType
                }), eV
            }
            return eU(e.data)
        }
    }
    td.create = e => new td({
        typeName: S.ZodUndefined,
        ...eK(e)
    });
    class tu extends eY {
        _parse(e) {
            if (this._getType(e) !== eD.null) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.null,
                    received: t.parsedType
                }), eV
            }
            return eU(e.data)
        }
    }
    tu.create = e => new tu({
        typeName: S.ZodNull,
        ...eK(e)
    });
    class tm extends eY {
        constructor() {
            super(...arguments), this._any = !0
        }
        _parse(e) {
            return eU(e.data)
        }
    }
    tm.create = e => new tm({
        typeName: S.ZodAny,
        ...eK(e)
    });
    class tp extends eY {
        constructor() {
            super(...arguments), this._unknown = !0
        }
        _parse(e) {
            return eU(e.data)
        }
    }
    tp.create = e => new tp({
        typeName: S.ZodUnknown,
        ...eK(e)
    });
    class th extends eY {
        _parse(e) {
            let t = this._getOrReturnCtx(e);
            return eB(t, {
                code: ez.invalid_type,
                expected: eD.never,
                received: t.parsedType
            }), eV
        }
    }
    th.create = e => new th({
        typeName: S.ZodNever,
        ...eK(e)
    });
    class tf extends eY {
        _parse(e) {
            if (this._getType(e) !== eD.undefined) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.void,
                    received: t.parsedType
                }), eV
            }
            return eU(e.data)
        }
    }
    tf.create = e => new tf({
        typeName: S.ZodVoid,
        ...eK(e)
    });
    class tx extends eY {
        _parse(e) {
            let {
                ctx: t,
                status: r
            } = this._processInputParams(e), a = this._def;
            if (t.parsedType !== eD.array) return eB(t, {
                code: ez.invalid_type,
                expected: eD.array,
                received: t.parsedType
            }), eV;
            if (null !== a.exactLength) {
                let e = t.data.length > a.exactLength.value,
                    i = t.data.length < a.exactLength.value;
                (e || i) && (eB(t, {
                    code: e ? ez.too_big : ez.too_small,
                    minimum: i ? a.exactLength.value : void 0,
                    maximum: e ? a.exactLength.value : void 0,
                    type: "array",
                    inclusive: !0,
                    exact: !0,
                    message: a.exactLength.message
                }), r.dirty())
            }
            if (null !== a.minLength && t.data.length < a.minLength.value && (eB(t, {
                    code: ez.too_small,
                    minimum: a.minLength.value,
                    type: "array",
                    inclusive: !0,
                    exact: !1,
                    message: a.minLength.message
                }), r.dirty()), null !== a.maxLength && t.data.length > a.maxLength.value && (eB(t, {
                    code: ez.too_big,
                    maximum: a.maxLength.value,
                    type: "array",
                    inclusive: !0,
                    exact: !1,
                    message: a.maxLength.message
                }), r.dirty()), t.common.async) return Promise.all([...t.data].map((e, r) => a.type._parseAsync(new eG(t, e, t.path, r)))).then(e => eq.mergeArray(r, e));
            let i = [...t.data].map((e, r) => a.type._parseSync(new eG(t, e, t.path, r)));
            return eq.mergeArray(r, i)
        }
        get element() {
            return this._def.type
        }
        min(e, t) {
            return new tx({ ...this._def,
                minLength: {
                    value: e,
                    message: w.toString(t)
                }
            })
        }
        max(e, t) {
            return new tx({ ...this._def,
                maxLength: {
                    value: e,
                    message: w.toString(t)
                }
            })
        }
        length(e, t) {
            return new tx({ ...this._def,
                exactLength: {
                    value: e,
                    message: w.toString(t)
                }
            })
        }
        nonempty(e) {
            return this.min(1, e)
        }
    }
    tx.create = (e, t) => new tx({
        type: e,
        minLength: null,
        maxLength: null,
        exactLength: null,
        typeName: S.ZodArray,
        ...eK(t)
    });
    class tg extends eY {
        constructor() {
            super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend
        }
        _getCached() {
            if (null !== this._cached) return this._cached;
            let e = this._def.shape(),
                t = b.objectKeys(e);
            return this._cached = {
                shape: e,
                keys: t
            }, this._cached
        }
        _parse(e) {
            if (this._getType(e) !== eD.object) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.object,
                    received: t.parsedType
                }), eV
            }
            let {
                status: t,
                ctx: r
            } = this._processInputParams(e), {
                shape: a,
                keys: i
            } = this._getCached(), n = [];
            if (!(this._def.catchall instanceof th && "strip" === this._def.unknownKeys))
                for (let e in r.data) i.includes(e) || n.push(e);
            let s = [];
            for (let e of i) {
                let t = a[e],
                    i = r.data[e];
                s.push({
                    key: {
                        status: "valid",
                        value: e
                    },
                    value: t._parse(new eG(r, i, r.path, e)),
                    alwaysSet: e in r.data
                })
            }
            if (this._def.catchall instanceof th) {
                let e = this._def.unknownKeys;
                if ("passthrough" === e)
                    for (let e of n) s.push({
                        key: {
                            status: "valid",
                            value: e
                        },
                        value: {
                            status: "valid",
                            value: r.data[e]
                        }
                    });
                else if ("strict" === e) n.length > 0 && (eB(r, {
                    code: ez.unrecognized_keys,
                    keys: n
                }), t.dirty());
                else if ("strip" === e);
                else throw Error("Internal ZodObject error: invalid unknownKeys value.")
            } else {
                let e = this._def.catchall;
                for (let t of n) {
                    let a = r.data[t];
                    s.push({
                        key: {
                            status: "valid",
                            value: t
                        },
                        value: e._parse(new eG(r, a, r.path, t)),
                        alwaysSet: t in r.data
                    })
                }
            }
            return r.common.async ? Promise.resolve().then(async () => {
                let e = [];
                for (let t of s) {
                    let r = await t.key,
                        a = await t.value;
                    e.push({
                        key: r,
                        value: a,
                        alwaysSet: t.alwaysSet
                    })
                }
                return e
            }).then(e => eq.mergeObjectSync(t, e)) : eq.mergeObjectSync(t, s)
        }
        get shape() {
            return this._def.shape()
        }
        strict(e) {
            return w.errToObj, new tg({ ...this._def,
                unknownKeys: "strict",
                ...void 0 !== e ? {
                    errorMap: (t, r) => {
                        let a = this._def.errorMap ? .(t, r).message ? ? r.defaultError;
                        return "unrecognized_keys" === t.code ? {
                            message: w.errToObj(e).message ? ? a
                        } : {
                            message: a
                        }
                    }
                } : {}
            })
        }
        strip() {
            return new tg({ ...this._def,
                unknownKeys: "strip"
            })
        }
        passthrough() {
            return new tg({ ...this._def,
                unknownKeys: "passthrough"
            })
        }
        extend(e) {
            return new tg({ ...this._def,
                shape: () => ({ ...this._def.shape(),
                    ...e
                })
            })
        }
        merge(e) {
            return new tg({
                unknownKeys: e._def.unknownKeys,
                catchall: e._def.catchall,
                shape: () => ({ ...this._def.shape(),
                    ...e._def.shape()
                }),
                typeName: S.ZodObject
            })
        }
        setKey(e, t) {
            return this.augment({
                [e]: t
            })
        }
        catchall(e) {
            return new tg({ ...this._def,
                catchall: e
            })
        }
        pick(e) {
            let t = {};
            for (let r of b.objectKeys(e)) e[r] && this.shape[r] && (t[r] = this.shape[r]);
            return new tg({ ...this._def,
                shape: () => t
            })
        }
        omit(e) {
            let t = {};
            for (let r of b.objectKeys(this.shape)) e[r] || (t[r] = this.shape[r]);
            return new tg({ ...this._def,
                shape: () => t
            })
        }
        deepPartial() {
            return function e(t) {
                if (t instanceof tg) {
                    let r = {};
                    for (let a in t.shape) {
                        let i = t.shape[a];
                        r[a] = tO.create(e(i))
                    }
                    return new tg({ ...t._def,
                        shape: () => r
                    })
                }
                if (t instanceof tx) return new tx({ ...t._def,
                    type: e(t.element)
                });
                if (t instanceof tO) return tO.create(e(t.unwrap()));
                if (t instanceof tD) return tD.create(e(t.unwrap()));
                if (t instanceof tw) return tw.create(t.items.map(t => e(t)));
                else return t
            }(this)
        }
        partial(e) {
            let t = {};
            for (let r of b.objectKeys(this.shape)) {
                let a = this.shape[r];
                e && !e[r] ? t[r] = a : t[r] = a.optional()
            }
            return new tg({ ...this._def,
                shape: () => t
            })
        }
        required(e) {
            let t = {};
            for (let r of b.objectKeys(this.shape))
                if (e && !e[r]) t[r] = this.shape[r];
                else {
                    let e = this.shape[r];
                    for (; e instanceof tO;) e = e._def.innerType;
                    t[r] = e
                }
            return new tg({ ...this._def,
                shape: () => t
            })
        }
        keyof() {
            return tN(b.objectKeys(this.shape))
        }
    }
    tg.create = (e, t) => new tg({
        shape: () => e,
        unknownKeys: "strip",
        catchall: th.create(),
        typeName: S.ZodObject,
        ...eK(t)
    }), tg.strictCreate = (e, t) => new tg({
        shape: () => e,
        unknownKeys: "strict",
        catchall: th.create(),
        typeName: S.ZodObject,
        ...eK(t)
    }), tg.lazycreate = (e, t) => new tg({
        shape: e,
        unknownKeys: "strip",
        catchall: th.create(),
        typeName: S.ZodObject,
        ...eK(t)
    });
    class tv extends eY {
        _parse(e) {
            let {
                ctx: t
            } = this._processInputParams(e), r = this._def.options;
            if (t.common.async) return Promise.all(r.map(async e => {
                let r = { ...t,
                    common: { ...t.common,
                        issues: []
                    },
                    parent: null
                };
                return {
                    result: await e._parseAsync({
                        data: t.data,
                        path: t.path,
                        parent: r
                    }),
                    ctx: r
                }
            })).then(function(e) {
                for (let t of e)
                    if ("valid" === t.result.status) return t.result;
                for (let r of e)
                    if ("dirty" === r.result.status) return t.common.issues.push(...r.ctx.common.issues), r.result;
                let r = e.map(e => new eR(e.ctx.common.issues));
                return eB(t, {
                    code: ez.invalid_union,
                    unionErrors: r
                }), eV
            }); {
                let e, a = [];
                for (let i of r) {
                    let r = { ...t,
                            common: { ...t.common,
                                issues: []
                            },
                            parent: null
                        },
                        n = i._parseSync({
                            data: t.data,
                            path: t.path,
                            parent: r
                        });
                    if ("valid" === n.status) return n;
                    "dirty" !== n.status || e || (e = {
                        result: n,
                        ctx: r
                    }), r.common.issues.length && a.push(r.common.issues)
                }
                if (e) return t.common.issues.push(...e.ctx.common.issues), e.result;
                let i = a.map(e => new eR(e));
                return eB(t, {
                    code: ez.invalid_union,
                    unionErrors: i
                }), eV
            }
        }
        get options() {
            return this._def.options
        }
    }
    tv.create = (e, t) => new tv({
        options: e,
        typeName: S.ZodUnion,
        ...eK(t)
    });
    let ty = e => {
        if (e instanceof tT) return ty(e.schema);
        if (e instanceof tA) return ty(e.innerType());
        if (e instanceof tM) return [e.value];
        if (e instanceof tI) return e.options;
        if (e instanceof tP) return b.objectValues(e.enum);
        else if (e instanceof tL) return ty(e._def.innerType);
        else if (e instanceof td) return [void 0];
        else if (e instanceof tu) return [null];
        else if (e instanceof tO) return [void 0, ...ty(e.unwrap())];
        else if (e instanceof tD) return [null, ...ty(e.unwrap())];
        else if (e instanceof tF) return ty(e.unwrap());
        else if (e instanceof tB) return ty(e.unwrap());
        else if (e instanceof tz) return ty(e._def.innerType);
        else return []
    };
    class tb extends eY {
        _parse(e) {
            let {
                ctx: t
            } = this._processInputParams(e);
            if (t.parsedType !== eD.object) return eB(t, {
                code: ez.invalid_type,
                expected: eD.object,
                received: t.parsedType
            }), eV;
            let r = this.discriminator,
                a = t.data[r],
                i = this.optionsMap.get(a);
            return i ? t.common.async ? i._parseAsync({
                data: t.data,
                path: t.path,
                parent: t
            }) : i._parseSync({
                data: t.data,
                path: t.path,
                parent: t
            }) : (eB(t, {
                code: ez.invalid_union_discriminator,
                options: Array.from(this.optionsMap.keys()),
                path: [r]
            }), eV)
        }
        get discriminator() {
            return this._def.discriminator
        }
        get options() {
            return this._def.options
        }
        get optionsMap() {
            return this._def.optionsMap
        }
        static create(e, t, r) {
            let a = new Map;
            for (let r of t) {
                let t = ty(r.shape[e]);
                if (!t.length) throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
                for (let i of t) {
                    if (a.has(i)) throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);
                    a.set(i, r)
                }
            }
            return new tb({
                typeName: S.ZodDiscriminatedUnion,
                discriminator: e,
                options: t,
                optionsMap: a,
                ...eK(r)
            })
        }
    }
    class tk extends eY {
        _parse(e) {
            let {
                status: t,
                ctx: r
            } = this._processInputParams(e), a = (e, a) => {
                if ("aborted" === e.status || "aborted" === a.status) return eV;
                let i = function e(t, r) {
                    let a = eL(t),
                        i = eL(r);
                    if (t === r) return {
                        valid: !0,
                        data: t
                    };
                    if (a === eD.object && i === eD.object) {
                        let a = b.objectKeys(r),
                            i = b.objectKeys(t).filter(e => -1 !== a.indexOf(e)),
                            n = { ...t,
                                ...r
                            };
                        for (let a of i) {
                            let i = e(t[a], r[a]);
                            if (!i.valid) return {
                                valid: !1
                            };
                            n[a] = i.data
                        }
                        return {
                            valid: !0,
                            data: n
                        }
                    }
                    if (a === eD.array && i === eD.array) {
                        if (t.length !== r.length) return {
                            valid: !1
                        };
                        let a = [];
                        for (let i = 0; i < t.length; i++) {
                            let n = e(t[i], r[i]);
                            if (!n.valid) return {
                                valid: !1
                            };
                            a.push(n.data)
                        }
                        return {
                            valid: !0,
                            data: a
                        }
                    }
                    if (a === eD.date && i === eD.date && +t == +r) return {
                        valid: !0,
                        data: t
                    };
                    return {
                        valid: !1
                    }
                }(e.value, a.value);
                return i.valid ? (("dirty" === e.status || "dirty" === a.status) && t.dirty(), {
                    status: t.value,
                    value: i.data
                }) : (eB(r, {
                    code: ez.invalid_intersection_types
                }), eV)
            };
            return r.common.async ? Promise.all([this._def.left._parseAsync({
                data: r.data,
                path: r.path,
                parent: r
            }), this._def.right._parseAsync({
                data: r.data,
                path: r.path,
                parent: r
            })]).then(([e, t]) => a(e, t)) : a(this._def.left._parseSync({
                data: r.data,
                path: r.path,
                parent: r
            }), this._def.right._parseSync({
                data: r.data,
                path: r.path,
                parent: r
            }))
        }
    }
    tk.create = (e, t, r) => new tk({
        left: e,
        right: t,
        typeName: S.ZodIntersection,
        ...eK(r)
    });
    class tw extends eY {
        _parse(e) {
            let {
                status: t,
                ctx: r
            } = this._processInputParams(e);
            if (r.parsedType !== eD.array) return eB(r, {
                code: ez.invalid_type,
                expected: eD.array,
                received: r.parsedType
            }), eV;
            if (r.data.length < this._def.items.length) return eB(r, {
                code: ez.too_small,
                minimum: this._def.items.length,
                inclusive: !0,
                exact: !1,
                type: "array"
            }), eV;
            !this._def.rest && r.data.length > this._def.items.length && (eB(r, {
                code: ez.too_big,
                maximum: this._def.items.length,
                inclusive: !0,
                exact: !1,
                type: "array"
            }), t.dirty());
            let a = [...r.data].map((e, t) => {
                let a = this._def.items[t] || this._def.rest;
                return a ? a._parse(new eG(r, e, r.path, t)) : null
            }).filter(e => !!e);
            return r.common.async ? Promise.all(a).then(e => eq.mergeArray(t, e)) : eq.mergeArray(t, a)
        }
        get items() {
            return this._def.items
        }
        rest(e) {
            return new tw({ ...this._def,
                rest: e
            })
        }
    }
    tw.create = (e, t) => {
        if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
        return new tw({
            items: e,
            typeName: S.ZodTuple,
            rest: null,
            ...eK(t)
        })
    };
    class tS extends eY {
        get keySchema() {
            return this._def.keyType
        }
        get valueSchema() {
            return this._def.valueType
        }
        _parse(e) {
            let {
                status: t,
                ctx: r
            } = this._processInputParams(e);
            if (r.parsedType !== eD.object) return eB(r, {
                code: ez.invalid_type,
                expected: eD.object,
                received: r.parsedType
            }), eV;
            let a = [],
                i = this._def.keyType,
                n = this._def.valueType;
            for (let e in r.data) a.push({
                key: i._parse(new eG(r, e, r.path, e)),
                value: n._parse(new eG(r, r.data[e], r.path, e)),
                alwaysSet: e in r.data
            });
            return r.common.async ? eq.mergeObjectAsync(t, a) : eq.mergeObjectSync(t, a)
        }
        get element() {
            return this._def.valueType
        }
        static create(e, t, r) {
            return new tS(t instanceof eY ? {
                keyType: e,
                valueType: t,
                typeName: S.ZodRecord,
                ...eK(r)
            } : {
                keyType: ti.create(),
                valueType: e,
                typeName: S.ZodRecord,
                ...eK(t)
            })
        }
    }
    class tj extends eY {
        get keySchema() {
            return this._def.keyType
        }
        get valueSchema() {
            return this._def.valueType
        }
        _parse(e) {
            let {
                status: t,
                ctx: r
            } = this._processInputParams(e);
            if (r.parsedType !== eD.map) return eB(r, {
                code: ez.invalid_type,
                expected: eD.map,
                received: r.parsedType
            }), eV;
            let a = this._def.keyType,
                i = this._def.valueType,
                n = [...r.data.entries()].map(([e, t], n) => ({
                    key: a._parse(new eG(r, e, r.path, [n, "key"])),
                    value: i._parse(new eG(r, t, r.path, [n, "value"]))
                }));
            if (r.common.async) {
                let e = new Map;
                return Promise.resolve().then(async () => {
                    for (let r of n) {
                        let a = await r.key,
                            i = await r.value;
                        if ("aborted" === a.status || "aborted" === i.status) return eV;
                        ("dirty" === a.status || "dirty" === i.status) && t.dirty(), e.set(a.value, i.value)
                    }
                    return {
                        status: t.value,
                        value: e
                    }
                })
            } {
                let e = new Map;
                for (let r of n) {
                    let a = r.key,
                        i = r.value;
                    if ("aborted" === a.status || "aborted" === i.status) return eV;
                    ("dirty" === a.status || "dirty" === i.status) && t.dirty(), e.set(a.value, i.value)
                }
                return {
                    status: t.value,
                    value: e
                }
            }
        }
    }
    tj.create = (e, t, r) => new tj({
        valueType: t,
        keyType: e,
        typeName: S.ZodMap,
        ...eK(r)
    });
    class tC extends eY {
        _parse(e) {
            let {
                status: t,
                ctx: r
            } = this._processInputParams(e);
            if (r.parsedType !== eD.set) return eB(r, {
                code: ez.invalid_type,
                expected: eD.set,
                received: r.parsedType
            }), eV;
            let a = this._def;
            null !== a.minSize && r.data.size < a.minSize.value && (eB(r, {
                code: ez.too_small,
                minimum: a.minSize.value,
                type: "set",
                inclusive: !0,
                exact: !1,
                message: a.minSize.message
            }), t.dirty()), null !== a.maxSize && r.data.size > a.maxSize.value && (eB(r, {
                code: ez.too_big,
                maximum: a.maxSize.value,
                type: "set",
                inclusive: !0,
                exact: !1,
                message: a.maxSize.message
            }), t.dirty());
            let i = this._def.valueType;

            function n(e) {
                let r = new Set;
                for (let a of e) {
                    if ("aborted" === a.status) return eV;
                    "dirty" === a.status && t.dirty(), r.add(a.value)
                }
                return {
                    status: t.value,
                    value: r
                }
            }
            let s = [...r.data.values()].map((e, t) => i._parse(new eG(r, e, r.path, t)));
            return r.common.async ? Promise.all(s).then(e => n(e)) : n(s)
        }
        min(e, t) {
            return new tC({ ...this._def,
                minSize: {
                    value: e,
                    message: w.toString(t)
                }
            })
        }
        max(e, t) {
            return new tC({ ...this._def,
                maxSize: {
                    value: e,
                    message: w.toString(t)
                }
            })
        }
        size(e, t) {
            return this.min(e, t).max(e, t)
        }
        nonempty(e) {
            return this.min(1, e)
        }
    }
    tC.create = (e, t) => new tC({
        valueType: e,
        minSize: null,
        maxSize: null,
        typeName: S.ZodSet,
        ...eK(t)
    });
    class t_ extends eY {
        constructor() {
            super(...arguments), this.validate = this.implement
        }
        _parse(e) {
            let {
                ctx: t
            } = this._processInputParams(e);
            if (t.parsedType !== eD.function) return eB(t, {
                code: ez.invalid_type,
                expected: eD.function,
                received: t.parsedType
            }), eV;

            function r(e, r) {
                return e$({
                    data: e,
                    path: t.path,
                    errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, eF, eF].filter(e => !!e),
                    issueData: {
                        code: ez.invalid_arguments,
                        argumentsError: r
                    }
                })
            }

            function a(e, r) {
                return e$({
                    data: e,
                    path: t.path,
                    errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, eF, eF].filter(e => !!e),
                    issueData: {
                        code: ez.invalid_return_type,
                        returnTypeError: r
                    }
                })
            }
            let i = {
                    errorMap: t.common.contextualErrorMap
                },
                n = t.data;
            if (this._def.returns instanceof tE) {
                let e = this;
                return eU(async function(...t) {
                    let s = new eR([]),
                        o = await e._def.args.parseAsync(t, i).catch(e => {
                            throw s.addIssue(r(t, e)), s
                        }),
                        l = await Reflect.apply(n, this, o);
                    return await e._def.returns._def.type.parseAsync(l, i).catch(e => {
                        throw s.addIssue(a(l, e)), s
                    })
                })
            } {
                let e = this;
                return eU(function(...t) {
                    let s = e._def.args.safeParse(t, i);
                    if (!s.success) throw new eR([r(t, s.error)]);
                    let o = Reflect.apply(n, this, s.data),
                        l = e._def.returns.safeParse(o, i);
                    if (!l.success) throw new eR([a(o, l.error)]);
                    return l.data
                })
            }
        }
        parameters() {
            return this._def.args
        }
        returnType() {
            return this._def.returns
        }
        args(...e) {
            return new t_({ ...this._def,
                args: tw.create(e).rest(tp.create())
            })
        }
        returns(e) {
            return new t_({ ...this._def,
                returns: e
            })
        }
        implement(e) {
            return this.parse(e)
        }
        strictImplement(e) {
            return this.parse(e)
        }
        static create(e, t, r) {
            return new t_({
                args: e || tw.create([]).rest(tp.create()),
                returns: t || tp.create(),
                typeName: S.ZodFunction,
                ...eK(r)
            })
        }
    }
    class tT extends eY {
        get schema() {
            return this._def.getter()
        }
        _parse(e) {
            let {
                ctx: t
            } = this._processInputParams(e);
            return this._def.getter()._parse({
                data: t.data,
                path: t.path,
                parent: t
            })
        }
    }
    tT.create = (e, t) => new tT({
        getter: e,
        typeName: S.ZodLazy,
        ...eK(t)
    });
    class tM extends eY {
        _parse(e) {
            if (e.data !== this._def.value) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    received: t.data,
                    code: ez.invalid_literal,
                    expected: this._def.value
                }), eV
            }
            return {
                status: "valid",
                value: e.data
            }
        }
        get value() {
            return this._def.value
        }
    }

    function tN(e, t) {
        return new tI({
            values: e,
            typeName: S.ZodEnum,
            ...eK(t)
        })
    }
    tM.create = (e, t) => new tM({
        value: e,
        typeName: S.ZodLiteral,
        ...eK(t)
    });
    class tI extends eY {
        _parse(e) {
            if ("string" != typeof e.data) {
                let t = this._getOrReturnCtx(e),
                    r = this._def.values;
                return eB(t, {
                    expected: b.joinValues(r),
                    received: t.parsedType,
                    code: ez.invalid_type
                }), eV
            }
            if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
                let t = this._getOrReturnCtx(e),
                    r = this._def.values;
                return eB(t, {
                    received: t.data,
                    code: ez.invalid_enum_value,
                    options: r
                }), eV
            }
            return eU(e.data)
        }
        get options() {
            return this._def.values
        }
        get enum() {
            let e = {};
            for (let t of this._def.values) e[t] = t;
            return e
        }
        get Values() {
            let e = {};
            for (let t of this._def.values) e[t] = t;
            return e
        }
        get Enum() {
            let e = {};
            for (let t of this._def.values) e[t] = t;
            return e
        }
        extract(e, t = this._def) {
            return tI.create(e, { ...this._def,
                ...t
            })
        }
        exclude(e, t = this._def) {
            return tI.create(this.options.filter(t => !e.includes(t)), { ...this._def,
                ...t
            })
        }
    }
    tI.create = tN;
    class tP extends eY {
        _parse(e) {
            let t = b.getValidEnumValues(this._def.values),
                r = this._getOrReturnCtx(e);
            if (r.parsedType !== eD.string && r.parsedType !== eD.number) {
                let e = b.objectValues(t);
                return eB(r, {
                    expected: b.joinValues(e),
                    received: r.parsedType,
                    code: ez.invalid_type
                }), eV
            }
            if (this._cache || (this._cache = new Set(b.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
                let e = b.objectValues(t);
                return eB(r, {
                    received: r.data,
                    code: ez.invalid_enum_value,
                    options: e
                }), eV
            }
            return eU(e.data)
        }
        get enum() {
            return this._def.values
        }
    }
    tP.create = (e, t) => new tP({
        values: e,
        typeName: S.ZodNativeEnum,
        ...eK(t)
    });
    class tE extends eY {
        unwrap() {
            return this._def.type
        }
        _parse(e) {
            let {
                ctx: t
            } = this._processInputParams(e);
            return t.parsedType !== eD.promise && !1 === t.common.async ? (eB(t, {
                code: ez.invalid_type,
                expected: eD.promise,
                received: t.parsedType
            }), eV) : eU((t.parsedType === eD.promise ? t.data : Promise.resolve(t.data)).then(e => this._def.type.parseAsync(e, {
                path: t.path,
                errorMap: t.common.contextualErrorMap
            })))
        }
    }
    tE.create = (e, t) => new tE({
        type: e,
        typeName: S.ZodPromise,
        ...eK(t)
    });
    class tA extends eY {
        innerType() {
            return this._def.schema
        }
        sourceType() {
            return this._def.schema._def.typeName === S.ZodEffects ? this._def.schema.sourceType() : this._def.schema
        }
        _parse(e) {
            let {
                status: t,
                ctx: r
            } = this._processInputParams(e), a = this._def.effect || null, i = {
                addIssue: e => {
                    eB(r, e), e.fatal ? t.abort() : t.dirty()
                },
                get path() {
                    return r.path
                }
            };
            if (i.addIssue = i.addIssue.bind(i), "preprocess" === a.type) {
                let e = a.transform(r.data, i);
                if (r.common.async) return Promise.resolve(e).then(async e => {
                    if ("aborted" === t.value) return eV;
                    let a = await this._def.schema._parseAsync({
                        data: e,
                        path: r.path,
                        parent: r
                    });
                    return "aborted" === a.status ? eV : "dirty" === a.status || "dirty" === t.value ? eH(a.value) : a
                }); {
                    if ("aborted" === t.value) return eV;
                    let a = this._def.schema._parseSync({
                        data: e,
                        path: r.path,
                        parent: r
                    });
                    return "aborted" === a.status ? eV : "dirty" === a.status || "dirty" === t.value ? eH(a.value) : a
                }
            }
            if ("refinement" === a.type) {
                let e = e => {
                    let t = a.refinement(e, i);
                    if (r.common.async) return Promise.resolve(t);
                    if (t instanceof Promise) throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
                    return e
                };
                if (!1 !== r.common.async) return this._def.schema._parseAsync({
                    data: r.data,
                    path: r.path,
                    parent: r
                }).then(r => "aborted" === r.status ? eV : ("dirty" === r.status && t.dirty(), e(r.value).then(() => ({
                    status: t.value,
                    value: r.value
                })))); {
                    let a = this._def.schema._parseSync({
                        data: r.data,
                        path: r.path,
                        parent: r
                    });
                    return "aborted" === a.status ? eV : ("dirty" === a.status && t.dirty(), e(a.value), {
                        status: t.value,
                        value: a.value
                    })
                }
            }
            if ("transform" === a.type)
                if (!1 !== r.common.async) return this._def.schema._parseAsync({
                    data: r.data,
                    path: r.path,
                    parent: r
                }).then(e => "valid" !== e.status ? eV : Promise.resolve(a.transform(e.value, i)).then(e => ({
                    status: t.value,
                    value: e
                })));
                else {
                    let e = this._def.schema._parseSync({
                        data: r.data,
                        path: r.path,
                        parent: r
                    });
                    if ("valid" !== e.status) return eV;
                    let n = a.transform(e.value, i);
                    if (n instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
                    return {
                        status: t.value,
                        value: n
                    }
                }
            b.assertNever(a)
        }
    }
    tA.create = (e, t, r) => new tA({
        schema: e,
        typeName: S.ZodEffects,
        effect: t,
        ...eK(r)
    }), tA.createWithPreprocess = (e, t, r) => new tA({
        schema: t,
        effect: {
            type: "preprocess",
            transform: e
        },
        typeName: S.ZodEffects,
        ...eK(r)
    });
    class tO extends eY {
        _parse(e) {
            return this._getType(e) === eD.undefined ? eU(void 0) : this._def.innerType._parse(e)
        }
        unwrap() {
            return this._def.innerType
        }
    }
    tO.create = (e, t) => new tO({
        innerType: e,
        typeName: S.ZodOptional,
        ...eK(t)
    });
    class tD extends eY {
        _parse(e) {
            return this._getType(e) === eD.null ? eU(null) : this._def.innerType._parse(e)
        }
        unwrap() {
            return this._def.innerType
        }
    }
    tD.create = (e, t) => new tD({
        innerType: e,
        typeName: S.ZodNullable,
        ...eK(t)
    });
    class tL extends eY {
        _parse(e) {
            let {
                ctx: t
            } = this._processInputParams(e), r = t.data;
            return t.parsedType === eD.undefined && (r = this._def.defaultValue()), this._def.innerType._parse({
                data: r,
                path: t.path,
                parent: t
            })
        }
        removeDefault() {
            return this._def.innerType
        }
    }
    tL.create = (e, t) => new tL({
        innerType: e,
        typeName: S.ZodDefault,
        defaultValue: "function" == typeof t.default ? t.default : () => t.default,
        ...eK(t)
    });
    class tz extends eY {
        _parse(e) {
            let {
                ctx: t
            } = this._processInputParams(e), r = { ...t,
                common: { ...t.common,
                    issues: []
                }
            }, a = this._def.innerType._parse({
                data: r.data,
                path: r.path,
                parent: { ...r
                }
            });
            return eW(a) ? a.then(e => ({
                status: "valid",
                value: "valid" === e.status ? e.value : this._def.catchValue({
                    get error() {
                        return new eR(r.common.issues)
                    },
                    input: r.data
                })
            })) : {
                status: "valid",
                value: "valid" === a.status ? a.value : this._def.catchValue({
                    get error() {
                        return new eR(r.common.issues)
                    },
                    input: r.data
                })
            }
        }
        removeCatch() {
            return this._def.innerType
        }
    }
    tz.create = (e, t) => new tz({
        innerType: e,
        typeName: S.ZodCatch,
        catchValue: "function" == typeof t.catch ? t.catch : () => t.catch,
        ...eK(t)
    });
    class tR extends eY {
        _parse(e) {
            if (this._getType(e) !== eD.nan) {
                let t = this._getOrReturnCtx(e);
                return eB(t, {
                    code: ez.invalid_type,
                    expected: eD.nan,
                    received: t.parsedType
                }), eV
            }
            return {
                status: "valid",
                value: e.data
            }
        }
    }
    tR.create = e => new tR({
        typeName: S.ZodNaN,
        ...eK(e)
    }), Symbol("zod_brand");
    class tF extends eY {
        _parse(e) {
            let {
                ctx: t
            } = this._processInputParams(e), r = t.data;
            return this._def.type._parse({
                data: r,
                path: t.path,
                parent: t
            })
        }
        unwrap() {
            return this._def.type
        }
    }
    class t$ extends eY {
        _parse(e) {
            let {
                status: t,
                ctx: r
            } = this._processInputParams(e);
            if (r.common.async) return (async () => {
                let e = await this._def.in._parseAsync({
                    data: r.data,
                    path: r.path,
                    parent: r
                });
                return "aborted" === e.status ? eV : "dirty" === e.status ? (t.dirty(), eH(e.value)) : this._def.out._parseAsync({
                    data: e.value,
                    path: r.path,
                    parent: r
                })
            })(); {
                let e = this._def.in._parseSync({
                    data: r.data,
                    path: r.path,
                    parent: r
                });
                return "aborted" === e.status ? eV : "dirty" === e.status ? (t.dirty(), {
                    status: "dirty",
                    value: e.value
                }) : this._def.out._parseSync({
                    data: e.value,
                    path: r.path,
                    parent: r
                })
            }
        }
        static create(e, t) {
            return new t$({ in: e,
                out: t,
                typeName: S.ZodPipeline
            })
        }
    }
    class tB extends eY {
        _parse(e) {
            let t = this._def.innerType._parse(e),
                r = e => ("valid" === e.status && (e.value = Object.freeze(e.value)), e);
            return eW(t) ? t.then(e => r(e)) : r(t)
        }
        unwrap() {
            return this._def.innerType
        }
    }
    tB.create = (e, t) => new tB({
        innerType: e,
        typeName: S.ZodReadonly,
        ...eK(t)
    }), tg.lazycreate, (i = S || (S = {})).ZodString = "ZodString", i.ZodNumber = "ZodNumber", i.ZodNaN = "ZodNaN", i.ZodBigInt = "ZodBigInt", i.ZodBoolean = "ZodBoolean", i.ZodDate = "ZodDate", i.ZodSymbol = "ZodSymbol", i.ZodUndefined = "ZodUndefined", i.ZodNull = "ZodNull", i.ZodAny = "ZodAny", i.ZodUnknown = "ZodUnknown", i.ZodNever = "ZodNever", i.ZodVoid = "ZodVoid", i.ZodArray = "ZodArray", i.ZodObject = "ZodObject", i.ZodUnion = "ZodUnion", i.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", i.ZodIntersection = "ZodIntersection", i.ZodTuple = "ZodTuple", i.ZodRecord = "ZodRecord", i.ZodMap = "ZodMap", i.ZodSet = "ZodSet", i.ZodFunction = "ZodFunction", i.ZodLazy = "ZodLazy", i.ZodLiteral = "ZodLiteral", i.ZodEnum = "ZodEnum", i.ZodEffects = "ZodEffects", i.ZodNativeEnum = "ZodNativeEnum", i.ZodOptional = "ZodOptional", i.ZodNullable = "ZodNullable", i.ZodDefault = "ZodDefault", i.ZodCatch = "ZodCatch", i.ZodPromise = "ZodPromise", i.ZodBranded = "ZodBranded", i.ZodPipeline = "ZodPipeline", i.ZodReadonly = "ZodReadonly", ti.create, tn.create, tR.create, ts.create, to.create, tl.create, tc.create, td.create, tu.create, tm.create, tp.create, th.create, tf.create, tx.create, tg.create, tg.strictCreate, tv.create, tb.create, tk.create, tw.create, tS.create, tj.create, tC.create, t_.create, tT.create, tM.create, tI.create, tP.create, tE.create, tA.create, tO.create, tD.create, tA.createWithPreprocess, t$.create;
    class tq extends Error {
        constructor(e, t) {
            super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line
        }
    }

    function tV(e) {}

    function tH(e, t, r) {
        return 100 === r && 97 === e.charCodeAt(t + 1) && 116 === e.charCodeAt(t + 2) && 97 === e.charCodeAt(t + 3) && 58 === e.charCodeAt(t + 4)
    }

    function tU(e, t, r) {
        return 101 === r && 118 === e.charCodeAt(t + 1) && 101 === e.charCodeAt(t + 2) && 110 === e.charCodeAt(t + 3) && 116 === e.charCodeAt(t + 4) && 58 === e.charCodeAt(t + 5)
    }
    class tW extends TransformStream {
        constructor({
            onError: e,
            onRetry: t,
            onComment: r
        } = {}) {
            let a;
            super({
                start(i) {
                    a = function(e) {
                        if ("function" == typeof e) throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
                        let {
                            onEvent: t = tV,
                            onError: r = tV,
                            onRetry: a = tV,
                            onComment: i
                        } = e, n = [], s = !0, o, l = "", c = 0, d;

                        function u(e) {
                            let r = 0;
                            if (-1 === e.indexOf("\r")) {
                                let a = e.indexOf(`
`, r);
                                for (; - 1 !== a;) {
                                    if (r === a) {
                                        c > 0 && t({
                                            id: o,
                                            event: d,
                                            data: l
                                        }), o = void 0, l = "", c = 0, d = void 0, r = a + 1, a = e.indexOf(`
`, r);
                                        continue
                                    }
                                    let i = e.charCodeAt(r);
                                    if (tH(e, r, i)) {
                                        let i = 32 === e.charCodeAt(r + 5) ? r + 6 : r + 5,
                                            n = e.slice(i, a);
                                        if (0 === c && 10 === e.charCodeAt(a + 1)) {
                                            t({
                                                id: o,
                                                event: d,
                                                data: n
                                            }), o = void 0, l = "", d = void 0, r = a + 2, a = e.indexOf(`
`, r);
                                            continue
                                        }
                                        l = 0 === c ? n : `${l}
${n}`, c++
                                    } else tU(e, r, i) ? d = e.slice(32 === e.charCodeAt(r + 6) ? r + 7 : r + 6, a) || void 0 : m(e, r, a);
                                    r = a + 1, a = e.indexOf(`
`, r)
                                }
                                return e.slice(r)
                            }
                            for (; r < e.length;) {
                                let t = e.indexOf("\r", r),
                                    a = e.indexOf(`
`, r),
                                    i = -1;
                                if (-1 !== t && -1 !== a ? i = t < a ? t : a : -1 !== t ? i = t === e.length - 1 ? -1 : t : -1 !== a && (i = a), -1 === i) break;
                                m(e, r, i), r = i + 1, 13 === e.charCodeAt(r - 1) && 10 === e.charCodeAt(r) && r++
                            }
                            return e.slice(r)
                        }

                        function m(e, r, a) {
                            if (r === a) return void(c > 0 && t({
                                id: o,
                                event: d,
                                data: l
                            }), o = void 0, l = "", c = 0, d = void 0);
                            let n = e.charCodeAt(r);
                            if (tH(e, r, n)) {
                                let t = 32 === e.charCodeAt(r + 5) ? r + 6 : r + 5,
                                    i = e.slice(t, a);
                                l = 0 === c ? i : `${l}
${i}`, c++;
                                return
                            }
                            if (tU(e, r, n)) {
                                d = e.slice(32 === e.charCodeAt(r + 6) ? r + 7 : r + 6, a) || void 0;
                                return
                            }
                            if (105 === n && 100 === e.charCodeAt(r + 1) && 58 === e.charCodeAt(r + 2)) {
                                let t = e.slice(32 === e.charCodeAt(r + 3) ? r + 4 : r + 3, a);
                                o = t.includes("\0") ? void 0 : t;
                                return
                            }
                            if (58 === n) {
                                i && i(e.slice(r, a).slice(32 === e.charCodeAt(r + 1) ? 2 : 1));
                                return
                            }
                            let s = e.slice(r, a),
                                u = s.indexOf(":");
                            if (-1 === u) return void p(s, "", s);
                            let m = s.slice(0, u),
                                h = 32 === s.charCodeAt(u + 1) ? 2 : 1;
                            p(m, s.slice(u + h), s)
                        }

                        function p(e, t, i) {
                            switch (e) {
                                case "event":
                                    d = t || void 0;
                                    break;
                                case "data":
                                    l = 0 === c ? t : `${l}
${t}`, c++;
                                    break;
                                case "id":
                                    o = t.includes("\0") ? void 0 : t;
                                    break;
                                case "retry":
                                    /^\d+$/.test(t) ? a(parseInt(t, 10)) : r(new tq(`Invalid \`retry\` value: "${t}"`, {
                                        type: "invalid-retry",
                                        value: t,
                                        line: i
                                    }));
                                    break;
                                default:
                                    r(new tq(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`, {
                                        type: "unknown-field",
                                        field: e,
                                        value: t,
                                        line: i
                                    }))
                            }
                        }
                        return {
                            feed: function(e) {
                                if (s && (s = !1, 239 === e.charCodeAt(0) && 187 === e.charCodeAt(1) && 191 === e.charCodeAt(2) && (e = e.slice(3))), 0 === n.length) {
                                    let t = u(e);
                                    "" !== t && n.push(t);
                                    return
                                }
                                if (-1 === e.indexOf(`
`) && -1 === e.indexOf("\r")) return void n.push(e);
                                n.push(e);
                                let t = n.join("");
                                n.length = 0;
                                let r = u(t);
                                "" !== r && n.push(r)
                            },
                            reset: function(e = {}) {
                                if (e.consume && n.length > 0) {
                                    let e = n.join("");
                                    m(e, 0, e.length)
                                }
                                s = !0, o = void 0, l = "", c = 0, d = void 0, n.length = 0
                            }
                        }
                    }({
                        onEvent: e => {
                            i.enqueue(e)
                        },
                        onError(t) {
                            "terminate" === e ? i.error(t) : "function" == typeof e && e(t)
                        },
                        onRetry: t,
                        onComment: r
                    })
                },
                transform(e) {
                    a.feed(e)
                }
            })
        }
    }

    function tG(...e) {
        return e.reduce((e, t) => ({ ...e,
            ...null != t ? t : {}
        }), {})
    }

    function tZ(e) {
        return Object.fromEntries([...e.headers])
    }
    var {
        btoa: tK,
        atob: tY
    } = globalThis;

    function tQ(e) {
        let t = "";
        for (let r = 0; r < e.length; r++) t += String.fromCodePoint(e[r]);
        return tK(t)
    }
    var tX = "AI_DownloadError",
        tJ = `vercel.ai.error.${tX}`,
        t0 = Symbol.for(tJ),
        t1 = class extends(C = el, j = t0, C) {
            constructor({
                url: e,
                statusCode: t,
                statusText: r,
                cause: a,
                message: i = null == a ? `Failed to download ${e}: ${t} ${r}` : `Failed to download ${e}: ${a}`
            }) {
                super({
                    name: tX,
                    message: i,
                    cause: a
                }), this[j] = !0, this.url = e, this.statusCode = t, this.statusText = r
            }
            static isInstance(e) {
                return el.hasMarker(e, tJ)
            }
        };
    async function t2({
        response: e,
        url: t,
        maxBytes: r = 0x80000000
    }) {
        let a = e.headers.get("content-length");
        if (null != a) {
            let e = parseInt(a, 10);
            if (!isNaN(e) && e > r) throw new t1({
                url: t,
                message: `Download of ${t} exceeded maximum size of ${r} bytes (Content-Length: ${e}).`
            })
        }
        let i = e.body;
        if (null == i) return new Uint8Array(0);
        let n = i.getReader(),
            s = [],
            o = 0;
        try {
            for (;;) {
                let {
                    done: e,
                    value: a
                } = await n.read();
                if (e) break;
                if ((o += a.length) > r) throw new t1({
                    url: t,
                    message: `Download of ${t} exceeded maximum size of ${r} bytes.`
                });
                s.push(a)
            }
        } finally {
            try {
                await n.cancel()
            } finally {
                n.releaseLock()
            }
        }
        let l = new Uint8Array(o),
            c = 0;
        for (let e of s) l.set(e, c), c += e.length;
        return l
    }

    function t3(e) {
        let t;
        try {
            t = new URL(e)
        } catch (t) {
            throw new t1({
                url: e,
                message: `Invalid URL: ${e}`
            })
        }
        if ("data:" === t.protocol) return;
        if ("http:" !== t.protocol && "https:" !== t.protocol) throw new t1({
            url: e,
            message: `URL scheme must be http, https, or data, got ${t.protocol}`
        });
        let r = t.hostname;
        if (!r) throw new t1({
            url: e,
            message: "URL must have a hostname"
        });
        if ("localhost" === r || r.endsWith(".local") || r.endsWith(".localhost")) throw new t1({
            url: e,
            message: `URL with hostname ${r} is not allowed`
        });
        if (r.startsWith("[") && r.endsWith("]")) {
            if (function(e) {
                    let t = e.toLowerCase();
                    if ("::1" === t || "::" === t) return !0;
                    if (t.startsWith("::ffff:")) {
                        let e = t.slice(7);
                        if (t4(e)) return t5(e);
                        let r = e.split(":");
                        if (2 === r.length) {
                            let e = parseInt(r[0], 16),
                                t = parseInt(r[1], 16);
                            if (!isNaN(e) && !isNaN(t)) return t5(`${e>>8&255}.${255&e}.${t>>8&255}.${255&t}`)
                        }
                    }
                    return !!(t.startsWith("fc") || t.startsWith("fd") || t.startsWith("fe80"))
                }(r.slice(1, -1))) throw new t1({
                url: e,
                message: `URL with IPv6 address ${r} is not allowed`
            });
            return
        }
        if (t4(r)) {
            if (t5(r)) throw new t1({
                url: e,
                message: `URL with IP address ${r} is not allowed`
            });
            return
        }
    }

    function t4(e) {
        let t = e.split(".");
        return 4 === t.length && t.every(e => {
            let t = Number(e);
            return Number.isInteger(t) && t >= 0 && t <= 255 && String(t) === e
        })
    }

    function t5(e) {
        let [t, r] = e.split(".").map(Number);
        return 0 === t || 10 === t || 127 === t || 169 === t && 254 === r || 172 === t && !!(r >= 16) && !!(r <= 31) || 192 === t && 168 === r
    }
    var t6 = ({
            prefix: e,
            size: t = 16,
            alphabet: r = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
            separator: a = "-"
        } = {}) => {
            let i = () => {
                let e = r.length,
                    a = Array(t);
                for (let i = 0; i < t; i++) a[i] = r[Math.random() * e | 0];
                return a.join("")
            };
            if (null == e) return i;
            if (r.includes(a)) throw new ek({
                argument: "separator",
                message: `The separator "${a}" must not be part of the alphabet "${r}".`
            });
            return () => `${e}${a}${i()}`
        },
        t9 = t6();

    function t8(e) {
        return (e instanceof Error || e instanceof DOMException) && ("AbortError" === e.name || "ResponseAborted" === e.name || "TimeoutError" === e.name)
    }
    var t7 = ["fetch failed", "failed to fetch"],
        re = ["ConnectionRefused", "ConnectionClosed", "FailedToOpenSocket", "ECONNRESET", "ECONNREFUSED", "ETIMEDOUT", "EPIPE"];

    function rt({
        error: e,
        url: t,
        requestBodyValues: r
    }) {
        if (t8(e)) return e;
        if (e instanceof TypeError && t7.includes(e.message.toLowerCase())) {
            let a = e.cause;
            if (null != a) return new em({
                message: `Cannot connect to API: ${a.message}`,
                cause: a,
                url: t,
                requestBodyValues: r,
                isRetryable: !0
            })
        }
        return ! function(e) {
            if (!(e instanceof Error)) return !1;
            let t = e.code;
            return !!("string" == typeof t && re.includes(t))
        }(e) ? e : new em({
            message: `Cannot connect to API: ${e.message}`,
            cause: e,
            url: t,
            requestBodyValues: r,
            isRetryable: !0
        })
    }

    function rr(e = globalThis) {
        var t, r, a;
        return e.window ? "runtime/browser" : (null == (t = e.navigator) ? void 0 : t.userAgent) ? `runtime/${e.navigator.userAgent.toLowerCase()}` : (null == (a = null == (r = e.process) ? void 0 : r.versions) ? void 0 : a.node) ? `runtime/node.js/${e.process.version.substring(0)}` : e.EdgeRuntime ? "runtime/vercel-edge" : "runtime/unknown"
    }

    function ra(e) {
        if (null == e) return {};
        let t = {};
        if (e instanceof Headers) e.forEach((e, r) => {
            t[r.toLowerCase()] = e
        });
        else
            for (let [r, a] of (Array.isArray(e) || (e = Object.entries(e)), e)) null != a && (t[r.toLowerCase()] = a);
        return t
    }

    function ri(e, ...t) {
        let r = new Headers(ra(e)),
            a = r.get("user-agent") || "";
        return r.set("user-agent", [a, ...t].filter(Boolean).join(" ")), Object.fromEntries(r.entries())
    }
    var rn = "4.0.27",
        rs = () => globalThis.fetch,
        ro = async ({
            url: e,
            headers: t = {},
            successfulResponseHandler: r,
            failedResponseHandler: a,
            abortSignal: i,
            fetch: n = rs()
        }) => {
            try {
                let s = await n(e, {
                        method: "GET",
                        headers: ri(t, `ai-sdk/provider-utils/${rn}`, rr()),
                        signal: i
                    }),
                    o = tZ(s);
                if (!s.ok) {
                    let t;
                    try {
                        t = await a({
                            response: s,
                            url: e,
                            requestBodyValues: {}
                        })
                    } catch (t) {
                        if (t8(t) || em.isInstance(t)) throw t;
                        throw new em({
                            message: "Failed to process error response",
                            cause: t,
                            statusCode: s.status,
                            url: e,
                            responseHeaders: o,
                            requestBodyValues: {}
                        })
                    }
                    throw t.value
                }
                try {
                    return await r({
                        response: s,
                        url: e,
                        requestBodyValues: {}
                    })
                } catch (t) {
                    if (t instanceof Error && (t8(t) || em.isInstance(t))) throw t;
                    throw new em({
                        message: "Failed to process successful response",
                        cause: t,
                        statusCode: s.status,
                        url: e,
                        responseHeaders: o,
                        requestBodyValues: {}
                    })
                }
            } catch (t) {
                throw rt({
                    error: t,
                    url: e,
                    requestBodyValues: {}
                })
            }
        };

    function rl({
        settingValue: e,
        environmentVariableName: t
    }) {
        return "string" == typeof e ? e : null != e || void 0 === ei.default ? void 0 : null != (e = ei.default.env[t]) && "string" == typeof e ? e : void 0
    }
    var rc = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,
        rd = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;

    function ru(e) {
        let t = JSON.parse(e);
        return null === t || "object" != typeof t || !1 === rc.test(e) && !1 === rd.test(e) ? t : function(e) {
            let t = [e];
            for (; t.length;) {
                let e = t;
                for (let r of (t = [], e)) {
                    if (Object.prototype.hasOwnProperty.call(r, "__proto__") || Object.prototype.hasOwnProperty.call(r, "constructor") && null !== r.constructor && "object" == typeof r.constructor && Object.prototype.hasOwnProperty.call(r.constructor, "prototype")) throw SyntaxError("Object contains forbidden prototype property");
                    for (let e in r) {
                        let a = r[e];
                        a && "object" == typeof a && t.push(a)
                    }
                }
            }
            return e
        }(t)
    }

    function rm(e) {
        let {
            stackTraceLimit: t
        } = Error;
        try {
            Error.stackTraceLimit = 0
        } catch (t) {
            return ru(e)
        }
        try {
            return ru(e)
        } finally {
            Error.stackTraceLimit = t
        }
    }

    function rp(e) {
        if ("object" === e.type || Array.isArray(e.type) && e.type.includes("object")) {
            e.additionalProperties = !1;
            let {
                properties: t
            } = e;
            if (null != t)
                for (let e of Object.keys(t)) t[e] = rh(t[e])
        }
        null != e.items && (e.items = Array.isArray(e.items) ? e.items.map(rh) : rh(e.items)), null != e.anyOf && (e.anyOf = e.anyOf.map(rh)), null != e.allOf && (e.allOf = e.allOf.map(rh)), null != e.oneOf && (e.oneOf = e.oneOf.map(rh));
        let {
            definitions: t
        } = e;
        if (null != t)
            for (let e of Object.keys(t)) t[e] = rh(t[e]);
        return e
    }

    function rh(e) {
        return "boolean" == typeof e ? e : rp(e)
    }
    var rf = Symbol("Let zodToJsonSchema decide on which parser to use"),
        rx = {
            name: void 0,
            $refStrategy: "root",
            basePath: ["#"],
            effectStrategy: "input",
            pipeStrategy: "all",
            dateStrategy: "format:date-time",
            mapStrategy: "entries",
            removeAdditionalStrategy: "passthrough",
            allowedAdditionalProperties: !0,
            rejectedAdditionalProperties: !1,
            definitionPath: "definitions",
            strictUnions: !1,
            definitions: {},
            errorMessages: !1,
            patternStrategy: "escape",
            applyRegexFlags: !1,
            emailStrategy: "format:email",
            base64Strategy: "contentEncoding:base64",
            nameStrategy: "ref"
        };

    function rg(e, t) {
        return rR(e.type._def, t)
    }
    var rv = void 0,
        ry = /^[cC][^\s-]{8,}$/,
        rb = /^[0-9a-z]+$/,
        rk = /^[0-9A-HJKMNP-TV-Z]{26}$/,
        rw = /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
        rS = () => (void 0 === rv && (rv = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), rv),
        rj = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
        rC = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
        r_ = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
        rT = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
        rM = /^[a-zA-Z0-9_-]{21}$/,
        rN = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;

    function rI(e, t) {
        let r = {
            type: "string"
        };
        if (e.checks)
            for (let a of e.checks) switch (a.kind) {
                case "min":
                    r.minLength = "number" == typeof r.minLength ? Math.max(r.minLength, a.value) : a.value;
                    break;
                case "max":
                    r.maxLength = "number" == typeof r.maxLength ? Math.min(r.maxLength, a.value) : a.value;
                    break;
                case "email":
                    switch (t.emailStrategy) {
                        case "format:email":
                            rA(r, "email", a.message, t);
                            break;
                        case "format:idn-email":
                            rA(r, "idn-email", a.message, t);
                            break;
                        case "pattern:zod":
                            rO(r, rw, a.message, t)
                    }
                    break;
                case "url":
                    rA(r, "uri", a.message, t);
                    break;
                case "uuid":
                    rA(r, "uuid", a.message, t);
                    break;
                case "regex":
                    rO(r, a.regex, a.message, t);
                    break;
                case "cuid":
                    rO(r, ry, a.message, t);
                    break;
                case "cuid2":
                    rO(r, rb, a.message, t);
                    break;
                case "startsWith":
                    rO(r, RegExp(`^${rP(a.value,t)}`), a.message, t);
                    break;
                case "endsWith":
                    rO(r, RegExp(`${rP(a.value,t)}$`), a.message, t);
                    break;
                case "datetime":
                    rA(r, "date-time", a.message, t);
                    break;
                case "date":
                    rA(r, "date", a.message, t);
                    break;
                case "time":
                    rA(r, "time", a.message, t);
                    break;
                case "duration":
                    rA(r, "duration", a.message, t);
                    break;
                case "length":
                    r.minLength = "number" == typeof r.minLength ? Math.max(r.minLength, a.value) : a.value, r.maxLength = "number" == typeof r.maxLength ? Math.min(r.maxLength, a.value) : a.value;
                    break;
                case "includes":
                    rO(r, RegExp(rP(a.value, t)), a.message, t);
                    break;
                case "ip":
                    "v6" !== a.version && rA(r, "ipv4", a.message, t), "v4" !== a.version && rA(r, "ipv6", a.message, t);
                    break;
                case "base64url":
                    rO(r, rT, a.message, t);
                    break;
                case "jwt":
                    rO(r, rN, a.message, t);
                    break;
                case "cidr":
                    "v6" !== a.version && rO(r, rj, a.message, t), "v4" !== a.version && rO(r, rC, a.message, t);
                    break;
                case "emoji":
                    rO(r, rS(), a.message, t);
                    break;
                case "ulid":
                    rO(r, rk, a.message, t);
                    break;
                case "base64":
                    switch (t.base64Strategy) {
                        case "format:binary":
                            rA(r, "binary", a.message, t);
                            break;
                        case "contentEncoding:base64":
                            r.contentEncoding = "base64";
                            break;
                        case "pattern:zod":
                            rO(r, r_, a.message, t)
                    }
                    break;
                case "nanoid":
                    rO(r, rM, a.message, t)
            }
        return r
    }

    function rP(e, t) {
        return "escape" === t.patternStrategy ? function(e) {
            let t = "";
            for (let r = 0; r < e.length; r++) rE.has(e[r]) || (t += "\\"), t += e[r];
            return t
        }(e) : e
    }
    var rE = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");

    function rA(e, t, r, a) {
        var i;
        e.format || (null == (i = e.anyOf) ? void 0 : i.some(e => e.format)) ? (e.anyOf || (e.anyOf = []), e.format && (e.anyOf.push({
            format: e.format
        }), delete e.format), e.anyOf.push({
            format: t,
            ...r && a.errorMessages && {
                errorMessage: {
                    format: r
                }
            }
        })) : e.format = t
    }

    function rO(e, t, r, a) {
        var i;
        e.pattern || (null == (i = e.allOf) ? void 0 : i.some(e => e.pattern)) ? (e.allOf || (e.allOf = []), e.pattern && (e.allOf.push({
            pattern: e.pattern
        }), delete e.pattern), e.allOf.push({
            pattern: rD(t, a),
            ...r && a.errorMessages && {
                errorMessage: {
                    pattern: r
                }
            }
        })) : e.pattern = rD(t, a)
    }

    function rD(e, t) {
        var r;
        if (!t.applyRegexFlags || !e.flags) return e.source;
        let a = {
                i: e.flags.includes("i"),
                m: e.flags.includes("m"),
                s: e.flags.includes("s")
            },
            i = a.i ? e.source.toLowerCase() : e.source,
            n = "",
            s = !1,
            o = !1,
            l = !1;
        for (let e = 0; e < i.length; e++) {
            if (s) {
                n += i[e], s = !1;
                continue
            }
            if (a.i) {
                if (o) {
                    if (i[e].match(/[a-z]/)) {
                        l ? (n += i[e], n += `${i[e-2]}-${i[e]}`.toUpperCase(), l = !1) : "-" === i[e + 1] && (null == (r = i[e + 2]) ? void 0 : r.match(/[a-z]/)) ? (n += i[e], l = !0) : n += `${i[e]}${i[e].toUpperCase()}`;
                        continue
                    }
                } else if (i[e].match(/[a-z]/)) {
                    n += `[${i[e]}${i[e].toUpperCase()}]`;
                    continue
                }
            }
            if (a.m) {
                if ("^" === i[e]) {
                    n += `(^|(?<=[\r
]))`;
                    continue
                } else if ("$" === i[e]) {
                    n += `($|(?=[\r
]))`;
                    continue
                }
            }
            if (a.s && "." === i[e]) {
                n += o ? `${i[e]}\r
` : `[${i[e]}\r
]`;
                continue
            }
            n += i[e], "\\" === i[e] ? s = !0 : o && "]" === i[e] ? o = !1 : o || "[" !== i[e] || (o = !0)
        }
        try {
            new RegExp(n)
        } catch (r) {
            return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`), e.source
        }
        return n
    }

    function rL(e, t) {
        var r, a, i, n, s, o;
        let l = {
            type: "object",
            additionalProperties: null != (r = rR(e.valueType._def, { ...t,
                currentPath: [...t.currentPath, "additionalProperties"]
            })) ? r : t.allowedAdditionalProperties
        };
        if ((null == (a = e.keyType) ? void 0 : a._def.typeName) === S.ZodString && (null == (i = e.keyType._def.checks) ? void 0 : i.length)) {
            let {
                type: r,
                ...a
            } = rI(e.keyType._def, t);
            return { ...l,
                propertyNames: a
            }
        }
        if ((null == (n = e.keyType) ? void 0 : n._def.typeName) === S.ZodEnum) return { ...l,
            propertyNames: {
                enum: e.keyType._def.values
            }
        };
        if ((null == (s = e.keyType) ? void 0 : s._def.typeName) === S.ZodBranded && e.keyType._def.type._def.typeName === S.ZodString && (null == (o = e.keyType._def.type._def.checks) ? void 0 : o.length)) {
            let {
                type: r,
                ...a
            } = rg(e.keyType._def, t);
            return { ...l,
                propertyNames: a
            }
        }
        return l
    }
    var rz = {
        ZodString: "string",
        ZodNumber: "number",
        ZodBigInt: "integer",
        ZodBoolean: "boolean",
        ZodNull: "null"
    };

    function rR(e, t, r = !1) {
        var a;
        let i = t.seen.get(e);
        if (t.override) {
            let n = null == (a = t.override) ? void 0 : a.call(t, e, t, i, r);
            if (n !== rf) return n
        }
        if (i && !r) {
            let e = rF(i, t);
            if (void 0 !== e) return e
        }
        let n = {
            def: e,
            path: t.currentPath,
            jsonSchema: void 0
        };
        t.seen.set(e, n);
        let s = ((e, t, r) => {
                var a, i, n, s, o, l;
                switch (t) {
                    case S.ZodString:
                        return rI(e, r);
                    case S.ZodNumber:
                        let c = {
                            type: "number"
                        };
                        if (!e.checks) return c;
                        for (let t of e.checks) switch (t.kind) {
                            case "int":
                                c.type = "integer";
                                break;
                            case "min":
                                t.inclusive ? c.minimum = t.value : c.exclusiveMinimum = t.value;
                                break;
                            case "max":
                                t.inclusive ? c.maximum = t.value : c.exclusiveMaximum = t.value;
                                break;
                            case "multipleOf":
                                c.multipleOf = t.value
                        }
                        return c;
                    case S.ZodObject:
                        return function(e, t) {
                            let r = {
                                    type: "object",
                                    properties: {}
                                },
                                a = [],
                                i = e.shape();
                            for (let e in i) {
                                let n = i[e];
                                if (void 0 === n || void 0 === n._def) continue;
                                let s = function(e) {
                                        try {
                                            return e.isOptional()
                                        } catch (e) {
                                            return !0
                                        }
                                    }(n),
                                    o = rR(n._def, { ...t,
                                        currentPath: [...t.currentPath, "properties", e],
                                        propertyPath: [...t.currentPath, "properties", e]
                                    });
                                void 0 !== o && (r.properties[e] = o, s || a.push(e))
                            }
                            a.length && (r.required = a);
                            let n = function(e, t) {
                                if ("ZodNever" !== e.catchall._def.typeName) return rR(e.catchall._def, { ...t,
                                    currentPath: [...t.currentPath, "additionalProperties"]
                                });
                                switch (e.unknownKeys) {
                                    case "passthrough":
                                        return t.allowedAdditionalProperties;
                                    case "strict":
                                        return t.rejectedAdditionalProperties;
                                    case "strip":
                                        return "strict" === t.removeAdditionalStrategy ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties
                                }
                            }(e, t);
                            return void 0 !== n && (r.additionalProperties = n), r
                        }(e, r);
                    case S.ZodBigInt:
                        let d = {
                            type: "integer",
                            format: "int64"
                        };
                        if (!e.checks) return d;
                        for (let t of e.checks) switch (t.kind) {
                            case "min":
                                t.inclusive ? d.minimum = t.value : d.exclusiveMinimum = t.value;
                                break;
                            case "max":
                                t.inclusive ? d.maximum = t.value : d.exclusiveMaximum = t.value;
                                break;
                            case "multipleOf":
                                d.multipleOf = t.value
                        }
                        return d;
                    case S.ZodBoolean:
                        return {
                            type: "boolean"
                        };
                    case S.ZodDate:
                        return function e(t, r, a) {
                            let i = null != a ? a : r.dateStrategy;
                            if (Array.isArray(i)) return {
                                anyOf: i.map((a, i) => e(t, r, a))
                            };
                            switch (i) {
                                case "string":
                                case "format:date-time":
                                    return {
                                        type: "string",
                                        format: "date-time"
                                    };
                                case "format:date":
                                    return {
                                        type: "string",
                                        format: "date"
                                    };
                                case "integer":
                                    var n = t;
                                    let s = {
                                        type: "integer",
                                        format: "unix-time"
                                    };
                                    for (let e of n.checks) switch (e.kind) {
                                        case "min":
                                            s.minimum = e.value;
                                            break;
                                        case "max":
                                            s.maximum = e.value
                                    }
                                    return s
                            }
                        }(e, r);
                    case S.ZodUndefined:
                        return {
                            not: {}
                        };
                    case S.ZodNull:
                        return {
                            type: "null"
                        };
                    case S.ZodArray:
                        let u;
                        return u = {
                            type: "array"
                        }, (null == (n = e.type) ? void 0 : n._def) && (null == (o = null == (s = e.type) ? void 0 : s._def) ? void 0 : o.typeName) !== S.ZodAny && (u.items = rR(e.type._def, { ...r,
                            currentPath: [...r.currentPath, "items"]
                        })), e.minLength && (u.minItems = e.minLength.value), e.maxLength && (u.maxItems = e.maxLength.value), e.exactLength && (u.minItems = e.exactLength.value, u.maxItems = e.exactLength.value), u;
                    case S.ZodUnion:
                    case S.ZodDiscriminatedUnion:
                        let m, p = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
                        if (p.every(e => e._def.typeName in rz && (!e._def.checks || !e._def.checks.length))) {
                            let e = p.reduce((e, t) => {
                                let r = rz[t._def.typeName];
                                return r && !e.includes(r) ? [...e, r] : e
                            }, []);
                            return {
                                type: e.length > 1 ? e : e[0]
                            }
                        }
                        if (p.every(e => "ZodLiteral" === e._def.typeName && !e.description)) {
                            let e = p.reduce((e, t) => {
                                let r = typeof t._def.value;
                                switch (r) {
                                    case "string":
                                    case "number":
                                    case "boolean":
                                        return [...e, r];
                                    case "bigint":
                                        return [...e, "integer"];
                                    case "object":
                                        if (null === t._def.value) return [...e, "null"];
                                    default:
                                        return e
                                }
                            }, []);
                            if (e.length === p.length) {
                                let t = e.filter((e, t, r) => r.indexOf(e) === t);
                                return {
                                    type: t.length > 1 ? t : t[0],
                                    enum: p.reduce((e, t) => e.includes(t._def.value) ? e : [...e, t._def.value], [])
                                }
                            }
                        } else if (p.every(e => "ZodEnum" === e._def.typeName)) return {
                            type: "string",
                            enum: p.reduce((e, t) => [...e, ...t._def.values.filter(t => !e.includes(t))], [])
                        };
                        return a = e, i = r, (m = (a.options instanceof Map ? Array.from(a.options.values()) : a.options).map((e, t) => rR(e._def, { ...i,
                            currentPath: [...i.currentPath, "anyOf", `${t}`]
                        })).filter(e => !!e && (!i.strictUnions || "object" == typeof e && Object.keys(e).length > 0))).length ? {
                            anyOf: m
                        } : void 0;
                    case S.ZodIntersection:
                        let h, f;
                        return h = [rR(e.left._def, { ...r,
                            currentPath: [...r.currentPath, "allOf", "0"]
                        }), rR(e.right._def, { ...r,
                            currentPath: [...r.currentPath, "allOf", "1"]
                        })].filter(e => !!e), f = [], h.forEach(e => {
                            if ((!("type" in e) || "string" !== e.type) && "allOf" in e) f.push(...e.allOf);
                            else {
                                let t = e;
                                if ("additionalProperties" in e && !1 === e.additionalProperties) {
                                    let {
                                        additionalProperties: r,
                                        ...a
                                    } = e;
                                    t = a
                                }
                                f.push(t)
                            }
                        }), f.length ? {
                            allOf: f
                        } : void 0;
                    case S.ZodTuple:
                        return e.rest ? {
                            type: "array",
                            minItems: e.items.length,
                            items: e.items.map((e, t) => rR(e._def, { ...r,
                                currentPath: [...r.currentPath, "items", `${t}`]
                            })).reduce((e, t) => void 0 === t ? e : [...e, t], []),
                            additionalItems: rR(e.rest._def, { ...r,
                                currentPath: [...r.currentPath, "additionalItems"]
                            })
                        } : {
                            type: "array",
                            minItems: e.items.length,
                            maxItems: e.items.length,
                            items: e.items.map((e, t) => rR(e._def, { ...r,
                                currentPath: [...r.currentPath, "items", `${t}`]
                            })).reduce((e, t) => void 0 === t ? e : [...e, t], [])
                        };
                    case S.ZodRecord:
                        return rL(e, r);
                    case S.ZodLiteral:
                        let x;
                        return "bigint" != (x = typeof e.value) && "number" !== x && "boolean" !== x && "string" !== x ? {
                            type: Array.isArray(e.value) ? "array" : "object"
                        } : {
                            type: "bigint" === x ? "integer" : x,
                            const: e.value
                        };
                    case S.ZodEnum:
                        return {
                            type: "string",
                            enum: Array.from(e.values)
                        };
                    case S.ZodNativeEnum:
                        let g, v, y;
                        return g = e.values, {
                            type: 1 === (y = Array.from(new Set((v = Object.keys(e.values).filter(e => "number" != typeof g[g[e]]).map(e => g[e])).map(e => typeof e)))).length ? "string" === y[0] ? "string" : "number" : ["string", "number"],
                            enum: v
                        };
                    case S.ZodNullable:
                        if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return {
                            type: [rz[e.innerType._def.typeName], "null"]
                        };
                        let b = rR(e.innerType._def, { ...r,
                            currentPath: [...r.currentPath, "anyOf", "0"]
                        });
                        return b && {
                            anyOf: [b, {
                                type: "null"
                            }]
                        };
                    case S.ZodOptional:
                        if (r.currentPath.toString() === (null == (l = r.propertyPath) ? void 0 : l.toString())) return rR(e.innerType._def, r);
                        let k = rR(e.innerType._def, { ...r,
                            currentPath: [...r.currentPath, "anyOf", "1"]
                        });
                        return k ? {
                            anyOf: [{
                                not: {}
                            }, k]
                        } : {};
                    case S.ZodMap:
                        if ("record" === r.mapStrategy) return rL(e, r);
                        return {
                            type: "array",
                            maxItems: 125,
                            items: {
                                type: "array",
                                items: [rR(e.keyType._def, { ...r,
                                    currentPath: [...r.currentPath, "items", "items", "0"]
                                }) || {}, rR(e.valueType._def, { ...r,
                                    currentPath: [...r.currentPath, "items", "items", "1"]
                                }) || {}],
                                minItems: 2,
                                maxItems: 2
                            }
                        };
                    case S.ZodSet:
                        let w;
                        return w = {
                            type: "array",
                            uniqueItems: !0,
                            items: rR(e.valueType._def, { ...r,
                                currentPath: [...r.currentPath, "items"]
                            })
                        }, e.minSize && (w.minItems = e.minSize.value), e.maxSize && (w.maxItems = e.maxSize.value), w;
                    case S.ZodLazy:
                        return () => e.getter()._def;
                    case S.ZodPromise:
                        return rR(e.type._def, r);
                    case S.ZodNaN:
                    case S.ZodNever:
                        return {
                            not: {}
                        };
                    case S.ZodEffects:
                        return "input" === r.effectStrategy ? rR(e.schema._def, r) : {};
                    case S.ZodAny:
                    case S.ZodUnknown:
                        return {};
                    case S.ZodDefault:
                        return { ...rR(e.innerType._def, r),
                            default: e.defaultValue()
                        };
                    case S.ZodBranded:
                        return rg(e, r);
                    case S.ZodReadonly:
                    case S.ZodCatch:
                        return rR(e.innerType._def, r);
                    case S.ZodPipeline:
                        if ("input" === r.pipeStrategy) return rR(e.in._def, r);
                        if ("output" === r.pipeStrategy) return rR(e.out._def, r);
                        let j = rR(e.in._def, { ...r,
                                currentPath: [...r.currentPath, "allOf", "0"]
                            }),
                            C = rR(e.out._def, { ...r,
                                currentPath: [...r.currentPath, "allOf", j ? "1" : "0"]
                            });
                        return {
                            allOf: [j, C].filter(e => void 0 !== e)
                        };
                    case S.ZodFunction:
                    case S.ZodVoid:
                    case S.ZodSymbol:
                    default:
                        return
                }
            })(e, e.typeName, t),
            o = "function" == typeof s ? rR(s(), t) : s;
        if (o && r$(e, t, o), t.postProcess) {
            let r = t.postProcess(o, e, t);
            return n.jsonSchema = o, r
        }
        return n.jsonSchema = o, o
    }
    var rF = (e, t) => {
            switch (t.$refStrategy) {
                case "root":
                    return {
                        $ref: e.path.join("/")
                    };
                case "relative":
                    return {
                        $ref: ((e, t) => {
                            let r = 0;
                            for (; r < e.length && r < t.length && e[r] === t[r]; r++);
                            return [(e.length - r).toString(), ...t.slice(r)].join("/")
                        })(t.currentPath, e.path)
                    };
                case "none":
                case "seen":
                    if (e.path.length < t.currentPath.length && e.path.every((e, r) => t.currentPath[r] === e)) return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), {};
                    return "seen" === t.$refStrategy ? {} : void 0
            }
        },
        r$ = (e, t, r) => (e.description && (r.description = e.description), r),
        rB = Symbol.for("vercel.ai.schema");

    function rq(e) {
        let t;
        return () => (null == t && (t = e()), t)
    }

    function rV(e, {
        validate: t
    } = {}) {
        return {
            [rB]: !0,
            _type: void 0,
            get jsonSchema() {
                return "function" == typeof e && (e = e()), e
            },
            validate: t
        }
    }

    function rH(e) {
        var t;
        return null == e ? rV({
            properties: {},
            additionalProperties: !1
        }) : "object" == typeof e && null !== e && rB in e && !0 === e[rB] && "jsonSchema" in e && "validate" in e ? e : "~standard" in e ? "zod" === e["~standard"].vendor ? rU(e) : (t = e, rV(() => rp(t["~standard"].jsonSchema.input({
            target: "draft-07"
        })), {
            validate: async e => {
                let r = await t["~standard"].validate(e);
                return "value" in r ? {
                    success: !0,
                    value: r.value
                } : {
                    success: !1,
                    error: new eP({
                        value: e,
                        cause: r.issues
                    })
                }
            }
        })) : e()
    }

    function rU(e, t) {
        var r, a;
        let i;
        if ("_zod" in e) {
            let a;
            return a = null != (r = null == t ? void 0 : t.useReferences) && r, rV(() => rp(eO.toJSONSchema(e, {
                target: "draft-7",
                io: "input",
                reused: a ? "ref" : "inline"
            })), {
                validate: async t => {
                    let r = await eA.safeParseAsync(e, t);
                    return r.success ? {
                        success: !0,
                        value: r.data
                    } : {
                        success: !1,
                        error: r.error
                    }
                }
            })
        }
        return i = null != (a = null == t ? void 0 : t.useReferences) && a, rV(() => ((e, t) => {
            var r;
            let a, i, n = (i = void 0 !== (a = "string" == typeof t ? { ...rx,
                    name: t
                } : { ...rx,
                    ...t
                }).name ? [...a.basePath, a.definitionPath, a.name] : a.basePath, { ...a,
                    currentPath: i,
                    propertyPath: void 0,
                    seen: new Map(Object.entries(a.definitions).map(([e, t]) => [t._def, {
                        def: t._def,
                        path: [...a.basePath, a.definitionPath, e],
                        jsonSchema: void 0
                    }]))
                }),
                s = "object" == typeof t && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => {
                    var a;
                    return { ...e,
                        [t]: null != (a = rR(r._def, { ...n,
                            currentPath: [...n.basePath, n.definitionPath, t]
                        }, !0)) ? a : {}
                    }
                }, {}) : void 0,
                o = "string" == typeof t ? t : (null == t ? void 0 : t.nameStrategy) === "title" || null == t ? void 0 : t.name,
                l = null != (r = rR(e._def, void 0 === o ? n : { ...n,
                    currentPath: [...n.basePath, n.definitionPath, o]
                }, !1)) ? r : {},
                c = "object" == typeof t && void 0 !== t.name && "title" === t.nameStrategy ? t.name : void 0;
            void 0 !== c && (l.title = c);
            let d = void 0 === o ? s ? { ...l,
                [n.definitionPath]: s
            } : l : {
                $ref: [..."relative" === n.$refStrategy ? [] : n.basePath, n.definitionPath, o].join("/"),
                [n.definitionPath]: { ...s,
                    [o]: l
                }
            };
            return d.$schema = "http://json-schema.org/draft-07/schema#", d
        })(e, {
            $refStrategy: i ? "root" : "none"
        }), {
            validate: async t => {
                let r = await e.safeParseAsync(t);
                return r.success ? {
                    success: !0,
                    value: r.data
                } : {
                    success: !1,
                    error: r.error
                }
            }
        })
    }
    async function rW({
        value: e,
        schema: t,
        context: r
    }) {
        let a = await rG({
            value: e,
            schema: t,
            context: r
        });
        if (!a.success) throw eP.wrap({
            value: e,
            cause: a.error,
            context: r
        });
        return a.value
    }
    async function rG({
        value: e,
        schema: t,
        context: r
    }) {
        let a = rH(t);
        try {
            if (null == a.validate) return {
                success: !0,
                value: e,
                rawValue: e
            };
            let t = await a.validate(e);
            if (t.success) return {
                success: !0,
                value: t.value,
                rawValue: e
            };
            return {
                success: !1,
                error: eP.wrap({
                    value: e,
                    cause: t.error,
                    context: r
                }),
                rawValue: e
            }
        } catch (t) {
            return {
                success: !1,
                error: eP.wrap({
                    value: e,
                    cause: t,
                    context: r
                }),
                rawValue: e
            }
        }
    }
    async function rZ({
        text: e,
        schema: t
    }) {
        try {
            let r = rm(e);
            if (null == t) return r;
            return rW({
                value: r,
                schema: t
            })
        } catch (t) {
            if (e_.isInstance(t) || eP.isInstance(t)) throw t;
            throw new e_({
                text: e,
                cause: t
            })
        }
    }
    async function rK({
        text: e,
        schema: t
    }) {
        try {
            let r = rm(e);
            if (null == t) return {
                success: !0,
                value: r,
                rawValue: r
            };
            return await rG({
                value: r,
                schema: t
            })
        } catch (t) {
            return {
                success: !1,
                error: e_.isInstance(t) ? t : new e_({
                    text: e,
                    cause: t
                }),
                rawValue: void 0
            }
        }
    }

    function rY({
        stream: e,
        schema: t
    }) {
        return e.pipeThrough(new TextDecoderStream).pipeThrough(new tW).pipeThrough(new TransformStream({
            async transform({
                data: e
            }, r) {
                "[DONE]" !== e && r.enqueue(await rK({
                    text: e,
                    schema: t
                }))
            }
        }))
    }
    var rQ = () => globalThis.fetch,
        rX = async ({
            url: e,
            headers: t,
            body: r,
            failedResponseHandler: a,
            successfulResponseHandler: i,
            abortSignal: n,
            fetch: s
        }) => rJ({
            url: e,
            headers: {
                "Content-Type": "application/json",
                ...t
            },
            body: {
                content: JSON.stringify(r),
                values: r
            },
            failedResponseHandler: a,
            successfulResponseHandler: i,
            abortSignal: n,
            fetch: s
        }),
        rJ = async ({
            url: e,
            headers: t = {},
            body: r,
            successfulResponseHandler: a,
            failedResponseHandler: i,
            abortSignal: n,
            fetch: s = rQ()
        }) => {
            try {
                let o = await s(e, {
                        method: "POST",
                        headers: ri(t, `ai-sdk/provider-utils/${rn}`, rr()),
                        body: r.content,
                        signal: n
                    }),
                    l = tZ(o);
                if (!o.ok) {
                    let t;
                    try {
                        t = await i({
                            response: o,
                            url: e,
                            requestBodyValues: r.values
                        })
                    } catch (t) {
                        if (t8(t) || em.isInstance(t)) throw t;
                        throw new em({
                            message: "Failed to process error response",
                            cause: t,
                            statusCode: o.status,
                            url: e,
                            responseHeaders: l,
                            requestBodyValues: r.values
                        })
                    }
                    throw t.value
                }
                try {
                    return await a({
                        response: o,
                        url: e,
                        requestBodyValues: r.values
                    })
                } catch (t) {
                    if (t instanceof Error && (t8(t) || em.isInstance(t))) throw t;
                    throw new em({
                        message: "Failed to process successful response",
                        cause: t,
                        statusCode: o.status,
                        url: e,
                        responseHeaders: l,
                        requestBodyValues: r.values
                    })
                }
            } catch (t) {
                throw rt({
                    error: t,
                    url: e,
                    requestBodyValues: r.values
                })
            }
        };

    function r0({
        id: e,
        inputSchema: t,
        outputSchema: r,
        supportsDeferredResults: a
    }) {
        return ({
            execute: i,
            needsApproval: n,
            toModelOutput: s,
            onInputStart: o,
            onInputDelta: l,
            onInputAvailable: c,
            ...d
        }) => ({
            type: "provider",
            id: e,
            args: d,
            inputSchema: t,
            outputSchema: r,
            execute: i,
            needsApproval: n,
            toModelOutput: s,
            onInputStart: o,
            onInputDelta: l,
            onInputAvailable: c,
            supportsDeferredResults: a
        })
    }
    async function r1(e) {
        return "function" == typeof e && (e = e()), Promise.resolve(e)
    }
    var r2 = ({
            errorSchema: e,
            errorToMessage: t,
            isRetryable: r
        }) => async ({
            response: a,
            url: i,
            requestBodyValues: n
        }) => {
            let s = await a.text(),
                o = tZ(a);
            if ("" === s.trim()) return {
                responseHeaders: o,
                value: new em({
                    message: a.statusText,
                    url: i,
                    requestBodyValues: n,
                    statusCode: a.status,
                    responseHeaders: o,
                    responseBody: s,
                    isRetryable: null == r ? void 0 : r(a)
                })
            };
            try {
                let l = await rZ({
                    text: s,
                    schema: e
                });
                return {
                    responseHeaders: o,
                    value: new em({
                        message: t(l),
                        url: i,
                        requestBodyValues: n,
                        statusCode: a.status,
                        responseHeaders: o,
                        responseBody: s,
                        data: l,
                        isRetryable: null == r ? void 0 : r(a, l)
                    })
                }
            } catch (e) {
                return {
                    responseHeaders: o,
                    value: new em({
                        message: a.statusText,
                        url: i,
                        requestBodyValues: n,
                        statusCode: a.status,
                        responseHeaders: o,
                        responseBody: s,
                        isRetryable: null == r ? void 0 : r(a)
                    })
                }
            }
        },
        r3 = e => async ({
            response: t,
            url: r,
            requestBodyValues: a
        }) => {
            let i = await t.text(),
                n = await rK({
                    text: i,
                    schema: e
                }),
                s = tZ(t);
            if (!n.success) throw new em({
                message: "Invalid JSON response",
                cause: n.error,
                statusCode: t.status,
                responseHeaders: s,
                responseBody: i,
                url: r,
                requestBodyValues: a
            });
            return {
                responseHeaders: s,
                value: n.value,
                rawValue: n.rawValue
            }
        },
        r4 = e.i(573337),
        r5 = e.i(296080),
        r6 = Symbol.for("vercel.ai.gateway.error"),
        r9 = class e extends(T = Error, _ = r6, T) {
            constructor({
                message: e,
                statusCode: t = 500,
                cause: r,
                generationId: a
            }) {
                super(a ? `${e} [${a}]` : e), this[_] = !0, this.statusCode = t, this.cause = r, this.generationId = a
            }
            static isInstance(t) {
                return e.hasMarker(t)
            }
            static hasMarker(e) {
                return "object" == typeof e && null !== e && r6 in e && !0 === e[r6]
            }
        },
        r8 = "GatewayAuthenticationError",
        r7 = Symbol.for(`vercel.ai.gateway.error.${r8}`),
        ae = class e extends(N = r9, M = r7, N) {
            constructor({
                message: e = "Authentication failed",
                statusCode: t = 401,
                cause: r,
                generationId: a
            } = {}) {
                super({
                    message: e,
                    statusCode: t,
                    cause: r,
                    generationId: a
                }), this[M] = !0, this.name = r8, this.type = "authentication_error"
            }
            static isInstance(e) {
                return r9.hasMarker(e) && r7 in e
            }
            static createContextualError({
                apiKeyProvided: t,
                oidcTokenProvided: r,
                message: a = "Authentication failed",
                statusCode: i = 401,
                cause: n,
                generationId: s
            }) {
                return new e({
                    message: t ? `AI Gateway authentication failed: Invalid API key.

Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys

Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.` : r ? `AI Gateway authentication failed: Invalid OIDC token.

Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.

Alternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys` : `AI Gateway authentication failed: No authentication provided.

Option 1 - API key:
Create an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.

Option 2 - OIDC token:
Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.`,
                    statusCode: i,
                    cause: n,
                    generationId: s
                })
            }
        },
        at = "GatewayInvalidRequestError",
        ar = Symbol.for(`vercel.ai.gateway.error.${at}`),
        aa = class extends(P = r9, I = ar, P) {
            constructor({
                message: e = "Invalid request",
                statusCode: t = 400,
                cause: r,
                generationId: a
            } = {}) {
                super({
                    message: e,
                    statusCode: t,
                    cause: r,
                    generationId: a
                }), this[I] = !0, this.name = at, this.type = "invalid_request_error"
            }
            static isInstance(e) {
                return r9.hasMarker(e) && ar in e
            }
        },
        ai = "GatewayRateLimitError",
        an = Symbol.for(`vercel.ai.gateway.error.${ai}`),
        as = class extends(A = r9, E = an, A) {
            constructor({
                message: e = "Rate limit exceeded",
                statusCode: t = 429,
                cause: r,
                generationId: a
            } = {}) {
                super({
                    message: e,
                    statusCode: t,
                    cause: r,
                    generationId: a
                }), this[E] = !0, this.name = ai, this.type = "rate_limit_exceeded"
            }
            static isInstance(e) {
                return r9.hasMarker(e) && an in e
            }
        },
        ao = "GatewayModelNotFoundError",
        al = Symbol.for(`vercel.ai.gateway.error.${ao}`),
        ac = rq(() => rU(r4.z.object({
            modelId: r4.z.string()
        }))),
        ad = class extends(D = r9, O = al, D) {
            constructor({
                message: e = "Model not found",
                statusCode: t = 404,
                modelId: r,
                cause: a,
                generationId: i
            } = {}) {
                super({
                    message: e,
                    statusCode: t,
                    cause: a,
                    generationId: i
                }), this[O] = !0, this.name = ao, this.type = "model_not_found", this.modelId = r
            }
            static isInstance(e) {
                return r9.hasMarker(e) && al in e
            }
        },
        au = "GatewayInternalServerError",
        am = Symbol.for(`vercel.ai.gateway.error.${au}`),
        ap = class extends(z = r9, L = am, z) {
            constructor({
                message: e = "Internal server error",
                statusCode: t = 500,
                cause: r,
                generationId: a
            } = {}) {
                super({
                    message: e,
                    statusCode: t,
                    cause: r,
                    generationId: a
                }), this[L] = !0, this.name = au, this.type = "internal_server_error"
            }
            static isInstance(e) {
                return r9.hasMarker(e) && am in e
            }
        },
        ah = "GatewayResponseError",
        af = Symbol.for(`vercel.ai.gateway.error.${ah}`),
        ax = class extends(F = r9, R = af, F) {
            constructor({
                message: e = "Invalid response from Gateway",
                statusCode: t = 502,
                response: r,
                validationError: a,
                cause: i,
                generationId: n
            } = {}) {
                super({
                    message: e,
                    statusCode: t,
                    cause: i,
                    generationId: n
                }), this[R] = !0, this.name = ah, this.type = "response_error", this.response = r, this.validationError = a
            }
            static isInstance(e) {
                return r9.hasMarker(e) && af in e
            }
        };
    async function ag({
        response: e,
        statusCode: t,
        defaultMessage: r = "Gateway request failed",
        cause: a,
        authMethod: i
    }) {
        var n;
        let s = await rG({
            value: e,
            schema: av
        });
        if (!s.success) {
            let i = "object" == typeof e && null !== e && "generationId" in e ? e.generationId : void 0;
            return new ax({
                message: `Invalid error response format: ${r}`,
                statusCode: t,
                response: e,
                validationError: s.error,
                cause: a,
                generationId: i
            })
        }
        let o = s.value,
            l = o.error.type,
            c = o.error.message,
            d = null != (n = o.generationId) ? n : void 0;
        switch (l) {
            case "authentication_error":
                return ae.createContextualError({
                    apiKeyProvided: "api-key" === i,
                    oidcTokenProvided: "oidc" === i,
                    statusCode: t,
                    cause: a,
                    generationId: d
                });
            case "invalid_request_error":
                return new aa({
                    message: c,
                    statusCode: t,
                    cause: a,
                    generationId: d
                });
            case "rate_limit_exceeded":
                return new as({
                    message: c,
                    statusCode: t,
                    cause: a,
                    generationId: d
                });
            case "model_not_found":
                {
                    let e = await rG({
                        value: o.error.param,
                        schema: ac
                    });
                    return new ad({
                        message: c,
                        statusCode: t,
                        modelId: e.success ? e.value.modelId : void 0,
                        cause: a,
                        generationId: d
                    })
                }
            default:
                return new ap({
                    message: c,
                    statusCode: t,
                    cause: a,
                    generationId: d
                })
        }
    }
    var av = rq(() => rU(r4.z.object({
            error: r4.z.object({
                message: r4.z.string(),
                type: r4.z.string().nullish(),
                param: r4.z.unknown().nullish(),
                code: r4.z.union([r4.z.string(), r4.z.number()]).nullish()
            }),
            generationId: r4.z.string().nullish()
        }))),
        ay = "GatewayTimeoutError",
        ab = Symbol.for(`vercel.ai.gateway.error.${ay}`),
        ak = class e extends(B = r9, $ = ab, B) {
            constructor({
                message: e = "Request timed out",
                statusCode: t = 408,
                cause: r,
                generationId: a
            } = {}) {
                super({
                    message: e,
                    statusCode: t,
                    cause: r,
                    generationId: a
                }), this[$] = !0, this.name = ay, this.type = "timeout_error"
            }
            static isInstance(e) {
                return r9.hasMarker(e) && ab in e
            }
            static createTimeoutError({
                originalMessage: t,
                statusCode: r = 408,
                cause: a,
                generationId: i
            }) {
                return new e({
                    message: `Gateway request timed out: ${t}

    This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`,
                    statusCode: r,
                    cause: a,
                    generationId: i
                })
            }
        };

    function aw(e) {
        if (!(e instanceof Error)) return !1;
        let t = e.code;
        return "string" == typeof t && ["UND_ERR_HEADERS_TIMEOUT", "UND_ERR_BODY_TIMEOUT", "UND_ERR_CONNECT_TIMEOUT"].includes(t)
    }
    async function aS(e, t) {
        var r;
        return r9.isInstance(e) ? e : aw(e) ? ak.createTimeoutError({
            originalMessage: e instanceof Error ? e.message : "Unknown error",
            cause: e
        }) : em.isInstance(e) ? e.cause && aw(e.cause) ? ak.createTimeoutError({
            originalMessage: e.message,
            cause: e
        }) : await ag({
            response: function(e) {
                if (void 0 !== e.data) return e.data;
                if (null != e.responseBody) try {
                    return JSON.parse(e.responseBody)
                } catch (t) {
                    return e.responseBody
                }
                return {}
            }(e),
            statusCode: null != (r = e.statusCode) ? r : 500,
            defaultMessage: "Gateway request failed",
            cause: e,
            authMethod: t
        }) : await ag({
            response: {},
            statusCode: 500,
            defaultMessage: e instanceof Error ? `Gateway request failed: ${e.message}` : "Unknown Gateway error",
            cause: e,
            authMethod: t
        })
    }
    var aj = "ai-gateway-auth-method";
    async function aC(e) {
        let t = await rG({
            value: e[aj],
            schema: a_
        });
        return t.success ? t.value : void 0
    }
    var a_ = rq(() => rU(r4.z.union([r4.z.literal("api-key"), r4.z.literal("oidc")]))),
        aT = ["embedding", "image", "language", "reranking", "video"],
        aM = class {
            constructor(e) {
                this.config = e
            }
            async getAvailableModels() {
                try {
                    let {
                        value: e
                    } = await ro({
                        url: `${this.config.baseURL}/config`,
                        headers: await r1(this.config.headers()),
                        successfulResponseHandler: r3(aN),
                        failedResponseHandler: r2({
                            errorSchema: r4.z.any(),
                            errorToMessage: e => e
                        }),
                        fetch: this.config.fetch
                    });
                    return e
                } catch (e) {
                    throw await aS(e)
                }
            }
            async getCredits() {
                try {
                    let e = new URL(this.config.baseURL),
                        {
                            value: t
                        } = await ro({
                            url: `${e.origin}/v1/credits`,
                            headers: await r1(this.config.headers()),
                            successfulResponseHandler: r3(aI),
                            failedResponseHandler: r2({
                                errorSchema: r4.z.any(),
                                errorToMessage: e => e
                            }),
                            fetch: this.config.fetch
                        });
                    return t
                } catch (e) {
                    throw await aS(e)
                }
            }
        },
        aN = rq(() => rU(r4.z.object({
            models: r4.z.array(r4.z.object({
                id: r4.z.string(),
                name: r4.z.string(),
                description: r4.z.string().nullish(),
                pricing: r4.z.object({
                    input: r4.z.string(),
                    output: r4.z.string(),
                    input_cache_read: r4.z.string().nullish(),
                    input_cache_write: r4.z.string().nullish()
                }).transform(({
                    input: e,
                    output: t,
                    input_cache_read: r,
                    input_cache_write: a
                }) => ({
                    input: e,
                    output: t,
                    ...r ? {
                        cachedInputTokens: r
                    } : {},
                    ...a ? {
                        cacheCreationInputTokens: a
                    } : {}
                })).nullish(),
                specification: r4.z.object({
                    specificationVersion: r4.z.literal("v3"),
                    provider: r4.z.string(),
                    modelId: r4.z.string()
                }),
                modelType: r4.z.string().nullish()
            })).transform(e => e.filter(e => null == e.modelType || aT.includes(e.modelType)))
        }))),
        aI = rq(() => rU(r4.z.object({
            balance: r4.z.string(),
            total_used: r4.z.string()
        }).transform(({
            balance: e,
            total_used: t
        }) => ({
            balance: e,
            totalUsed: t
        })))),
        aP = class {
            constructor(e) {
                this.config = e
            }
            async getSpendReport(e) {
                try {
                    let t = new URL(this.config.baseURL),
                        r = new URLSearchParams;
                    r.set("start_date", e.startDate), r.set("end_date", e.endDate), e.groupBy && r.set("group_by", e.groupBy), e.datePart && r.set("date_part", e.datePart), e.userId && r.set("user_id", e.userId), e.model && r.set("model", e.model), e.provider && r.set("provider", e.provider), e.credentialType && r.set("credential_type", e.credentialType), e.tags && e.tags.length > 0 && r.set("tags", e.tags.join(","));
                    let {
                        value: a
                    } = await ro({
                        url: `${t.origin}/v1/report?${r.toString()}`,
                        headers: await r1(this.config.headers()),
                        successfulResponseHandler: r3(aE),
                        failedResponseHandler: r2({
                            errorSchema: r4.z.any(),
                            errorToMessage: e => e
                        }),
                        fetch: this.config.fetch
                    });
                    return a
                } catch (e) {
                    throw await aS(e)
                }
            }
        },
        aE = rq(() => rU(r4.z.object({
            results: r4.z.array(r4.z.object({
                day: r4.z.string().optional(),
                hour: r4.z.string().optional(),
                user: r4.z.string().optional(),
                model: r4.z.string().optional(),
                tag: r4.z.string().optional(),
                provider: r4.z.string().optional(),
                credential_type: r4.z.enum(["byok", "system"]).optional(),
                total_cost: r4.z.number(),
                market_cost: r4.z.number().optional(),
                input_tokens: r4.z.number().optional(),
                output_tokens: r4.z.number().optional(),
                cached_input_tokens: r4.z.number().optional(),
                cache_creation_input_tokens: r4.z.number().optional(),
                reasoning_tokens: r4.z.number().optional(),
                request_count: r4.z.number().optional()
            }).transform(({
                credential_type: e,
                total_cost: t,
                market_cost: r,
                input_tokens: a,
                output_tokens: i,
                cached_input_tokens: n,
                cache_creation_input_tokens: s,
                reasoning_tokens: o,
                request_count: l,
                ...c
            }) => ({ ...c,
                ...void 0 !== e ? {
                    credentialType: e
                } : {},
                totalCost: t,
                ...void 0 !== r ? {
                    marketCost: r
                } : {},
                ...void 0 !== a ? {
                    inputTokens: a
                } : {},
                ...void 0 !== i ? {
                    outputTokens: i
                } : {},
                ...void 0 !== n ? {
                    cachedInputTokens: n
                } : {},
                ...void 0 !== s ? {
                    cacheCreationInputTokens: s
                } : {},
                ...void 0 !== o ? {
                    reasoningTokens: o
                } : {},
                ...void 0 !== l ? {
                    requestCount: l
                } : {}
            })))
        }))),
        aA = class {
            constructor(e) {
                this.config = e
            }
            async getGenerationInfo(e) {
                try {
                    let t = new URL(this.config.baseURL),
                        {
                            value: r
                        } = await ro({
                            url: `${t.origin}/v1/generation?id=${encodeURIComponent(e.id)}`,
                            headers: await r1(this.config.headers()),
                            successfulResponseHandler: r3(aO),
                            failedResponseHandler: r2({
                                errorSchema: r4.z.any(),
                                errorToMessage: e => e
                            }),
                            fetch: this.config.fetch
                        });
                    return r
                } catch (e) {
                    throw await aS(e)
                }
            }
        },
        aO = rq(() => rU(r4.z.object({
            data: r4.z.object({
                id: r4.z.string(),
                total_cost: r4.z.number(),
                upstream_inference_cost: r4.z.number(),
                usage: r4.z.number(),
                created_at: r4.z.string(),
                model: r4.z.string(),
                is_byok: r4.z.boolean(),
                provider_name: r4.z.string(),
                streamed: r4.z.boolean(),
                finish_reason: r4.z.string(),
                latency: r4.z.number(),
                generation_time: r4.z.number(),
                native_tokens_prompt: r4.z.number(),
                native_tokens_completion: r4.z.number(),
                native_tokens_reasoning: r4.z.number(),
                native_tokens_cached: r4.z.number(),
                native_tokens_cache_creation: r4.z.number(),
                billable_web_search_calls: r4.z.number()
            }).transform(({
                total_cost: e,
                upstream_inference_cost: t,
                created_at: r,
                is_byok: a,
                provider_name: i,
                finish_reason: n,
                generation_time: s,
                native_tokens_prompt: o,
                native_tokens_completion: l,
                native_tokens_reasoning: c,
                native_tokens_cached: d,
                native_tokens_cache_creation: u,
                billable_web_search_calls: m,
                ...p
            }) => ({ ...p,
                totalCost: e,
                upstreamInferenceCost: t,
                createdAt: r,
                isByok: a,
                providerName: i,
                finishReason: n,
                generationTime: s,
                promptTokens: o,
                completionTokens: l,
                reasoningTokens: c,
                cachedTokens: d,
                cacheCreationTokens: u,
                billableWebSearchCalls: m
            }))
        }).transform(({
            data: e
        }) => e))),
        aD = class {
            constructor(e, t) {
                this.modelId = e, this.config = t, this.specificationVersion = "v3", this.supportedUrls = {
                    "*/*": [/.*/]
                }
            }
            get provider() {
                return this.config.provider
            }
            async getArgs(e) {
                let {
                    abortSignal: t,
                    ...r
                } = e;
                return {
                    args: this.maybeEncodeFileParts(r),
                    warnings: []
                }
            }
            async doGenerate(e) {
                let {
                    args: t,
                    warnings: r
                } = await this.getArgs(e), {
                    abortSignal: a
                } = e, i = await r1(this.config.headers());
                try {
                    let {
                        responseHeaders: n,
                        value: s,
                        rawValue: o
                    } = await rX({
                        url: this.getUrl(),
                        headers: tG(i, e.headers, this.getModelConfigHeaders(this.modelId, !1), await r1(this.config.o11yHeaders)),
                        body: t,
                        successfulResponseHandler: r3(r4.z.any()),
                        failedResponseHandler: r2({
                            errorSchema: r4.z.any(),
                            errorToMessage: e => e
                        }),
                        ...a && {
                            abortSignal: a
                        },
                        fetch: this.config.fetch
                    });
                    return { ...s,
                        request: {
                            body: t
                        },
                        response: {
                            headers: n,
                            body: o
                        },
                        warnings: r
                    }
                } catch (e) {
                    throw await aS(e, await aC(i))
                }
            }
            async doStream(e) {
                let {
                    args: t,
                    warnings: r
                } = await this.getArgs(e), {
                    abortSignal: a
                } = e, i = await r1(this.config.headers());
                try {
                    let n, {
                        value: s,
                        responseHeaders: o
                    } = await rX({
                        url: this.getUrl(),
                        headers: tG(i, e.headers, this.getModelConfigHeaders(this.modelId, !0), await r1(this.config.o11yHeaders)),
                        body: t,
                        successfulResponseHandler: (n = r4.z.any(), async ({
                            response: e
                        }) => {
                            let t = tZ(e);
                            if (null == e.body) throw new ex({});
                            return {
                                responseHeaders: t,
                                value: rY({
                                    stream: e.body,
                                    schema: n
                                })
                            }
                        }),
                        failedResponseHandler: r2({
                            errorSchema: r4.z.any(),
                            errorToMessage: e => e
                        }),
                        ...a && {
                            abortSignal: a
                        },
                        fetch: this.config.fetch
                    });
                    return {
                        stream: s.pipeThrough(new TransformStream({
                            start(e) {
                                r.length > 0 && e.enqueue({
                                    type: "stream-start",
                                    warnings: r
                                })
                            },
                            transform(t, r) {
                                if (t.success) {
                                    let a = t.value;
                                    ("raw" !== a.type || e.includeRawChunks) && ("response-metadata" === a.type && a.timestamp && "string" == typeof a.timestamp && (a.timestamp = new Date(a.timestamp)), r.enqueue(a))
                                } else r.error(t.error)
                            }
                        })),
                        request: {
                            body: t
                        },
                        response: {
                            headers: o
                        }
                    }
                } catch (e) {
                    throw await aS(e, await aC(i))
                }
            }
            isFilePart(e) {
                return e && "object" == typeof e && "type" in e && "file" === e.type
            }
            maybeEncodeFileParts(e) {
                for (let t of e.prompt)
                    for (let e of t.content)
                        if (this.isFilePart(e) && e.data instanceof Uint8Array) {
                            let t = Uint8Array.from(e.data),
                                r = en.Buffer.from(t).toString("base64");
                            e.data = new URL(`data:${e.mediaType||"application/octet-stream"};base64,${r}`)
                        }
                return e
            }
            getUrl() {
                return `${this.config.baseURL}/language-model`
            }
            getModelConfigHeaders(e, t) {
                return {
                    "ai-language-model-specification-version": "3",
                    "ai-language-model-id": e,
                    "ai-language-model-streaming": String(t)
                }
            }
        },
        aL = class {
            constructor(e, t) {
                this.modelId = e, this.config = t, this.specificationVersion = "v3", this.maxEmbeddingsPerCall = 2048, this.supportsParallelCalls = !0
            }
            get provider() {
                return this.config.provider
            }
            async doEmbed({
                values: e,
                headers: t,
                abortSignal: r,
                providerOptions: a
            }) {
                var i;
                let n = await r1(this.config.headers());
                try {
                    let {
                        responseHeaders: s,
                        value: o,
                        rawValue: l
                    } = await rX({
                        url: this.getUrl(),
                        headers: tG(n, null != t ? t : {}, this.getModelConfigHeaders(), await r1(this.config.o11yHeaders)),
                        body: {
                            values: e,
                            ...a ? {
                                providerOptions: a
                            } : {}
                        },
                        successfulResponseHandler: r3(az),
                        failedResponseHandler: r2({
                            errorSchema: r4.z.any(),
                            errorToMessage: e => e
                        }),
                        ...r && {
                            abortSignal: r
                        },
                        fetch: this.config.fetch
                    });
                    return {
                        embeddings: o.embeddings,
                        usage: null != (i = o.usage) ? i : void 0,
                        providerMetadata: o.providerMetadata,
                        response: {
                            headers: s,
                            body: l
                        },
                        warnings: []
                    }
                } catch (e) {
                    throw await aS(e, await aC(n))
                }
            }
            getUrl() {
                return `${this.config.baseURL}/embedding-model`
            }
            getModelConfigHeaders() {
                return {
                    "ai-embedding-model-specification-version": "3",
                    "ai-model-id": this.modelId
                }
            }
        },
        az = rq(() => rU(r4.z.object({
            embeddings: r4.z.array(r4.z.array(r4.z.number())),
            usage: r4.z.object({
                tokens: r4.z.number()
            }).nullish(),
            providerMetadata: r4.z.record(r4.z.string(), r4.z.record(r4.z.string(), r4.z.unknown())).optional()
        }))),
        aR = class {
            constructor(e, t) {
                this.modelId = e, this.config = t, this.specificationVersion = "v3", this.maxImagesPerCall = Number.MAX_SAFE_INTEGER
            }
            get provider() {
                return this.config.provider
            }
            async doGenerate({
                prompt: e,
                n: t,
                size: r,
                aspectRatio: a,
                seed: i,
                files: n,
                mask: s,
                providerOptions: o,
                headers: l,
                abortSignal: c
            }) {
                var d, u, m, p;
                let h = await r1(this.config.headers());
                try {
                    let {
                        responseHeaders: f,
                        value: x,
                        rawValue: g
                    } = await rX({
                        url: this.getUrl(),
                        headers: tG(h, null != l ? l : {}, this.getModelConfigHeaders(), await r1(this.config.o11yHeaders)),
                        body: {
                            prompt: e,
                            n: t,
                            ...r && {
                                size: r
                            },
                            ...a && {
                                aspectRatio: a
                            },
                            ...i && {
                                seed: i
                            },
                            ...o && {
                                providerOptions: o
                            },
                            ...n && {
                                files: n.map(e => aF(e))
                            },
                            ...s && {
                                mask: aF(s)
                            }
                        },
                        successfulResponseHandler: r3(aV),
                        failedResponseHandler: r2({
                            errorSchema: r4.z.any(),
                            errorToMessage: e => e
                        }),
                        ...c && {
                            abortSignal: c
                        },
                        fetch: this.config.fetch
                    });
                    return {
                        images: x.images,
                        warnings: null != (d = x.warnings) ? d : [],
                        providerMetadata: x.providerMetadata,
                        response: {
                            timestamp: new Date,
                            modelId: this.modelId,
                            headers: f
                        },
                        ...null != x.usage && {
                            usage: {
                                inputTokens: null != (u = x.usage.inputTokens) ? u : void 0,
                                outputTokens: null != (m = x.usage.outputTokens) ? m : void 0,
                                totalTokens: null != (p = x.usage.totalTokens) ? p : void 0
                            }
                        }
                    }
                } catch (e) {
                    throw await aS(e, await aC(h))
                }
            }
            getUrl() {
                return `${this.config.baseURL}/image-model`
            }
            getModelConfigHeaders() {
                return {
                    "ai-image-model-specification-version": "3",
                    "ai-model-id": this.modelId
                }
            }
        };

    function aF(e) {
        return "file" === e.type && e.data instanceof Uint8Array ? { ...e,
            data: tQ(e.data)
        } : e
    }
    var a$ = r4.z.object({
            images: r4.z.array(r4.z.unknown()).optional()
        }).catchall(r4.z.unknown()),
        aB = r4.z.discriminatedUnion("type", [r4.z.object({
            type: r4.z.literal("unsupported"),
            feature: r4.z.string(),
            details: r4.z.string().optional()
        }), r4.z.object({
            type: r4.z.literal("compatibility"),
            feature: r4.z.string(),
            details: r4.z.string().optional()
        }), r4.z.object({
            type: r4.z.literal("other"),
            message: r4.z.string()
        })]),
        aq = r4.z.object({
            inputTokens: r4.z.number().nullish(),
            outputTokens: r4.z.number().nullish(),
            totalTokens: r4.z.number().nullish()
        }),
        aV = r4.z.object({
            images: r4.z.array(r4.z.string()),
            warnings: r4.z.array(aB).optional(),
            providerMetadata: r4.z.record(r4.z.string(), a$).optional(),
            usage: aq.optional()
        }),
        aH = class {
            constructor(e, t) {
                this.modelId = e, this.config = t, this.specificationVersion = "v3", this.maxVideosPerCall = Number.MAX_SAFE_INTEGER
            }
            get provider() {
                return this.config.provider
            }
            async doGenerate({
                prompt: e,
                n: t,
                aspectRatio: r,
                resolution: a,
                duration: i,
                fps: n,
                seed: s,
                image: o,
                providerOptions: l,
                headers: c,
                abortSignal: d
            }) {
                var u, m;
                let p = await r1(this.config.headers());
                try {
                    let {
                        responseHeaders: h,
                        value: f
                    } = await rX({
                        url: this.getUrl(),
                        headers: tG(p, null != c ? c : {}, this.getModelConfigHeaders(), await r1(this.config.o11yHeaders), {
                            accept: "text/event-stream"
                        }),
                        body: {
                            prompt: e,
                            n: t,
                            ...r && {
                                aspectRatio: r
                            },
                            ...a && {
                                resolution: a
                            },
                            ...i && {
                                duration: i
                            },
                            ...n && {
                                fps: n
                            },
                            ...s && {
                                seed: s
                            },
                            ...l && {
                                providerOptions: l
                            },
                            ...o && {
                                image: (m = o, "file" === m.type && m.data instanceof Uint8Array ? { ...m,
                                    data: tQ(m.data)
                                } : m)
                            }
                        },
                        successfulResponseHandler: async ({
                            response: e,
                            url: t,
                            requestBodyValues: r
                        }) => {
                            if (null == e.body) throw new em({
                                message: "SSE response body is empty",
                                url: t,
                                requestBodyValues: r,
                                statusCode: e.status
                            });
                            let a = rY({
                                    stream: e.body,
                                    schema: aZ
                                }).getReader(),
                                {
                                    done: i,
                                    value: n
                                } = await a.read();
                            if (a.releaseLock(), i || !n) throw new em({
                                message: "SSE stream ended without a data event",
                                url: t,
                                requestBodyValues: r,
                                statusCode: e.status
                            });
                            if (!n.success) throw new em({
                                message: "Failed to parse video SSE event",
                                cause: n.error,
                                url: t,
                                requestBodyValues: r,
                                statusCode: e.status
                            });
                            let s = n.value;
                            if ("error" === s.type) throw new em({
                                message: s.message,
                                statusCode: s.statusCode,
                                url: t,
                                requestBodyValues: r,
                                responseHeaders: Object.fromEntries([...e.headers]),
                                responseBody: JSON.stringify(s),
                                data: {
                                    error: {
                                        message: s.message,
                                        type: s.errorType,
                                        param: s.param
                                    }
                                }
                            });
                            return {
                                value: {
                                    videos: s.videos,
                                    warnings: s.warnings,
                                    providerMetadata: s.providerMetadata
                                },
                                responseHeaders: Object.fromEntries([...e.headers])
                            }
                        },
                        failedResponseHandler: r2({
                            errorSchema: r4.z.any(),
                            errorToMessage: e => e
                        }),
                        ...d && {
                            abortSignal: d
                        },
                        fetch: this.config.fetch
                    });
                    return {
                        videos: f.videos,
                        warnings: null != (u = f.warnings) ? u : [],
                        providerMetadata: f.providerMetadata,
                        response: {
                            timestamp: new Date,
                            modelId: this.modelId,
                            headers: h
                        }
                    }
                } catch (e) {
                    throw await aS(e, await aC(p))
                }
            }
            getUrl() {
                return `${this.config.baseURL}/video-model`
            }
            getModelConfigHeaders() {
                return {
                    "ai-video-model-specification-version": "3",
                    "ai-model-id": this.modelId
                }
            }
        },
        aU = r4.z.object({
            videos: r4.z.array(r4.z.unknown()).optional()
        }).catchall(r4.z.unknown()),
        aW = r4.z.union([r4.z.object({
            type: r4.z.literal("url"),
            url: r4.z.string(),
            mediaType: r4.z.string()
        }), r4.z.object({
            type: r4.z.literal("base64"),
            data: r4.z.string(),
            mediaType: r4.z.string()
        })]),
        aG = r4.z.discriminatedUnion("type", [r4.z.object({
            type: r4.z.literal("unsupported"),
            feature: r4.z.string(),
            details: r4.z.string().optional()
        }), r4.z.object({
            type: r4.z.literal("compatibility"),
            feature: r4.z.string(),
            details: r4.z.string().optional()
        }), r4.z.object({
            type: r4.z.literal("other"),
            message: r4.z.string()
        })]),
        aZ = r4.z.discriminatedUnion("type", [r4.z.object({
            type: r4.z.literal("result"),
            videos: r4.z.array(aW),
            warnings: r4.z.array(aG).optional(),
            providerMetadata: r4.z.record(r4.z.string(), aU).optional()
        }), r4.z.object({
            type: r4.z.literal("error"),
            message: r4.z.string(),
            errorType: r4.z.string(),
            statusCode: r4.z.number(),
            param: r4.z.unknown().nullable()
        })]),
        aK = class {
            constructor(e, t) {
                this.modelId = e, this.config = t, this.specificationVersion = "v3"
            }
            get provider() {
                return this.config.provider
            }
            async doRerank({
                documents: e,
                query: t,
                topN: r,
                headers: a,
                abortSignal: i,
                providerOptions: n
            }) {
                let s = await r1(this.config.headers());
                try {
                    let {
                        responseHeaders: o,
                        value: l,
                        rawValue: c
                    } = await rX({
                        url: this.getUrl(),
                        headers: tG(s, null != a ? a : {}, this.getModelConfigHeaders(), await r1(this.config.o11yHeaders)),
                        body: {
                            documents: e,
                            query: t,
                            ...null != r ? {
                                topN: r
                            } : {},
                            ...n ? {
                                providerOptions: n
                            } : {}
                        },
                        successfulResponseHandler: r3(aY),
                        failedResponseHandler: r2({
                            errorSchema: r4.z.any(),
                            errorToMessage: e => e
                        }),
                        ...i && {
                            abortSignal: i
                        },
                        fetch: this.config.fetch
                    });
                    return {
                        ranking: l.ranking,
                        providerMetadata: l.providerMetadata,
                        response: {
                            headers: o,
                            body: c
                        },
                        warnings: []
                    }
                } catch (e) {
                    throw await aS(e, await aC(s))
                }
            }
            getUrl() {
                return `${this.config.baseURL}/reranking-model`
            }
            getModelConfigHeaders() {
                return {
                    "ai-reranking-model-specification-version": "3",
                    "ai-model-id": this.modelId
                }
            }
        },
        aY = rq(() => rU(r4.z.object({
            ranking: r4.z.array(r4.z.object({
                index: r4.z.number(),
                relevanceScore: r4.z.number()
            })),
            providerMetadata: r4.z.record(r4.z.string(), r4.z.record(r4.z.string(), r4.z.unknown())).optional()
        }))),
        aQ = r0({
            id: "gateway.parallel_search",
            inputSchema: rq(() => rU(r4.z.object({
                objective: r4.z.string().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),
                search_queries: r4.z.array(r4.z.string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),
                mode: r4.z.enum(["one-shot", "agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),
                max_results: r4.z.number().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),
                source_policy: r4.z.object({
                    include_domains: r4.z.array(r4.z.string()).optional().describe("List of domains to include in search results."),
                    exclude_domains: r4.z.array(r4.z.string()).optional().describe("List of domains to exclude from search results."),
                    after_date: r4.z.string().optional().describe("Only include results published after this date (ISO 8601 format).")
                }).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),
                excerpts: r4.z.object({
                    max_chars_per_result: r4.z.number().optional().describe("Maximum characters per result."),
                    max_chars_total: r4.z.number().optional().describe("Maximum total characters across all results.")
                }).optional().describe("Excerpt configuration for controlling result length."),
                fetch_policy: r4.z.object({
                    max_age_seconds: r4.z.number().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")
                }).optional().describe("Fetch policy for controlling content freshness.")
            }))),
            outputSchema: rq(() => rU(r4.z.union([r4.z.object({
                searchId: r4.z.string(),
                results: r4.z.array(r4.z.object({
                    url: r4.z.string(),
                    title: r4.z.string(),
                    excerpt: r4.z.string(),
                    publishDate: r4.z.string().nullable().optional(),
                    relevanceScore: r4.z.number().optional()
                }))
            }), r4.z.object({
                error: r4.z.enum(["api_error", "rate_limit", "timeout", "invalid_input", "configuration_error", "unknown"]),
                statusCode: r4.z.number().optional(),
                message: r4.z.string()
            })])))
        }),
        aX = r0({
            id: "gateway.perplexity_search",
            inputSchema: rq(() => rU(r4.z.object({
                query: r4.z.union([r4.z.string(), r4.z.array(r4.z.string())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),
                max_results: r4.z.number().optional().describe("Maximum number of search results to return (1-20, default: 10)"),
                max_tokens_per_page: r4.z.number().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),
                max_tokens: r4.z.number().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),
                country: r4.z.string().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),
                search_domain_filter: r4.z.array(r4.z.string()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),
                search_language_filter: r4.z.array(r4.z.string()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),
                search_after_date: r4.z.string().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),
                search_before_date: r4.z.string().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),
                last_updated_after_filter: r4.z.string().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),
                last_updated_before_filter: r4.z.string().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),
                search_recency_filter: r4.z.enum(["day", "week", "month", "year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")
            }))),
            outputSchema: rq(() => rU(r4.z.union([r4.z.object({
                results: r4.z.array(r4.z.object({
                    title: r4.z.string(),
                    url: r4.z.string(),
                    snippet: r4.z.string(),
                    date: r4.z.string().optional(),
                    lastUpdated: r4.z.string().optional()
                })),
                id: r4.z.string()
            }), r4.z.object({
                error: r4.z.enum(["api_error", "rate_limit", "timeout", "invalid_input", "unknown"]),
                statusCode: r4.z.number().optional(),
                message: r4.z.string()
            })])))
        }),
        aJ = {
            parallelSearch: (e = {}) => aQ(e),
            perplexitySearch: (e = {}) => aX(e)
        };
    async function a0() {
        var e;
        return null == (e = (0, r5.getContext)().headers) ? void 0 : e["x-vercel-id"]
    }
    async function a1(e) {
        let t = rl({
            settingValue: e.apiKey,
            environmentVariableName: "AI_GATEWAY_API_KEY"
        });
        return t ? {
            token: t,
            authMethod: "api-key"
        } : {
            token: await (0, r5.getVercelOidcToken)(),
            authMethod: "oidc"
        }
    }! function(e = {}) {
        var t, r, a;
        let i = null,
            n = null,
            s = null != (t = e.metadataCacheRefreshMillis) ? t : 3e5,
            o = 0,
            l = null != (r = null == (a = e.baseURL) ? void 0 : a.replace(/\/$/, "")) ? r : "https://ai-gateway.vercel.sh/v3/ai",
            c = async () => {
                try {
                    let t = await a1(e);
                    return ri({
                        Authorization: `Bearer ${t.token}`,
                        "ai-gateway-protocol-version": "0.0.1",
                        [aj]: t.authMethod,
                        ...e.headers
                    }, "ai-sdk/gateway/3.0.112")
                } catch (e) {
                    throw ae.createContextualError({
                        apiKeyProvided: !1,
                        oidcTokenProvided: !1,
                        statusCode: 401,
                        cause: e
                    })
                }
            },
            d = () => {
                let e = rl({
                        settingValue: void 0,
                        environmentVariableName: "VERCEL_DEPLOYMENT_ID"
                    }),
                    t = rl({
                        settingValue: void 0,
                        environmentVariableName: "VERCEL_ENV"
                    }),
                    r = rl({
                        settingValue: void 0,
                        environmentVariableName: "VERCEL_REGION"
                    }),
                    a = rl({
                        settingValue: void 0,
                        environmentVariableName: "VERCEL_PROJECT_ID"
                    });
                return async () => {
                    let i = await a0();
                    return { ...e && {
                            "ai-o11y-deployment-id": e
                        },
                        ...t && {
                            "ai-o11y-environment": t
                        },
                        ...r && {
                            "ai-o11y-region": r
                        },
                        ...i && {
                            "ai-o11y-request-id": i
                        },
                        ...a && {
                            "ai-o11y-project-id": a
                        }
                    }
                }
            },
            u = t => new aD(t, {
                provider: "gateway",
                baseURL: l,
                headers: c,
                fetch: e.fetch,
                o11yHeaders: d()
            }),
            m = async () => {
                var t, r, a;
                let d = null != (a = null == (r = null == (t = e._internal) ? void 0 : t.currentDate) ? void 0 : r.call(t).getTime()) ? a : Date.now();
                return (!i || d - o > s) && (o = d, i = new aM({
                    baseURL: l,
                    headers: c,
                    fetch: e.fetch
                }).getAvailableModels().then(e => (n = e, e)).catch(async e => {
                    throw await aS(e, await aC(await c()))
                })), n ? Promise.resolve(n) : i
            },
            p = async () => new aM({
                baseURL: l,
                headers: c,
                fetch: e.fetch
            }).getCredits().catch(async e => {
                throw await aS(e, await aC(await c()))
            }),
            h = async t => new aP({
                baseURL: l,
                headers: c,
                fetch: e.fetch
            }).getSpendReport(t).catch(async e => {
                throw await aS(e, await aC(await c()))
            }),
            f = async t => new aA({
                baseURL: l,
                headers: c,
                fetch: e.fetch
            }).getGenerationInfo(t).catch(async e => {
                throw await aS(e, await aC(await c()))
            }),
            x = function(e) {
                if (new.target) throw Error("The Gateway Provider model function cannot be called with the new keyword.");
                return u(e)
            };
        x.specificationVersion = "v3", x.getAvailableModels = m, x.getCredits = p, x.getSpendReport = h, x.getGenerationInfo = f, x.imageModel = t => new aR(t, {
            provider: "gateway",
            baseURL: l,
            headers: c,
            fetch: e.fetch,
            o11yHeaders: d()
        }), x.languageModel = u;
        let g = t => new aL(t, {
            provider: "gateway",
            baseURL: l,
            headers: c,
            fetch: e.fetch,
            o11yHeaders: d()
        });
        x.embeddingModel = g, x.textEmbeddingModel = g, x.videoModel = t => new aH(t, {
            provider: "gateway",
            baseURL: l,
            headers: c,
            fetch: e.fetch,
            o11yHeaders: d()
        });
        let v = t => new aK(t, {
            provider: "gateway",
            baseURL: l,
            headers: c,
            fetch: e.fetch,
            o11yHeaders: d()
        });
        x.rerankingModel = v, x.reranking = v, x.chat = x.languageModel, x.embedding = x.embeddingModel, x.image = x.imageModel, x.video = x.videoModel, x.tools = aJ
    }();
    var a2 = "object" == typeof globalThis ? globalThis : "object" == typeof self ? self : "object" == typeof window ? window : e.g,
        a3 = "1.9.0",
        a4 = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,
        a5 = function(e) {
            var t = new Set([e]),
                r = new Set,
                a = e.match(a4);
            if (!a) return function() {
                return !1
            };
            var i = {
                major: +a[1],
                minor: +a[2],
                patch: +a[3],
                prerelease: a[4]
            };
            if (null != i.prerelease) return function(t) {
                return t === e
            };

            function n(e) {
                return r.add(e), !1
            }
            return function(e) {
                if (t.has(e)) return !0;
                if (r.has(e)) return !1;
                var a = e.match(a4);
                if (!a) return n(e);
                var s = {
                    major: +a[1],
                    minor: +a[2],
                    patch: +a[3],
                    prerelease: a[4]
                };
                if (null != s.prerelease || i.major !== s.major) return n(e);
                if (0 === i.major) return i.minor === s.minor && i.patch <= s.patch ? (t.add(e), !0) : n(e);
                return i.minor <= s.minor ? (t.add(e), !0) : n(e)
            }
        }(a3),
        a6 = Symbol.for("opentelemetry.js.api." + a3.split(".")[0]);

    function a9(e, t, r, a) {
        void 0 === a && (a = !1);
        var i, n = a2[a6] = null != (i = a2[a6]) ? i : {
            version: a3
        };
        if (!a && n[e]) {
            var s = Error("@opentelemetry/api: Attempted duplicate registration of API: " + e);
            return r.error(s.stack || s.message), !1
        }
        if (n.version !== a3) {
            var s = Error("@opentelemetry/api: Registration of version v" + n.version + " for " + e + " does not match previously registered API v" + a3);
            return r.error(s.stack || s.message), !1
        }
        return n[e] = t, r.debug("@opentelemetry/api: Registered a global for " + e + " v" + a3 + "."), !0
    }

    function a8(e) {
        var t, r, a = null == (t = a2[a6]) ? void 0 : t.version;
        if (a && a5(a)) return null == (r = a2[a6]) ? void 0 : r[e]
    }

    function a7(e, t) {
        t.debug("@opentelemetry/api: Unregistering a global for " + e + " v" + a3 + ".");
        var r = a2[a6];
        r && delete r[e]
    }
    var ie = new function e(t) {
            var r = this;
            r._currentContext = t ? new Map(t) : new Map, r.getValue = function(e) {
                return r._currentContext.get(e)
            }, r.setValue = function(t, a) {
                var i = new e(r._currentContext);
                return i._currentContext.set(t, a), i
            }, r.deleteValue = function(t) {
                var a = new e(r._currentContext);
                return a._currentContext.delete(t), a
            }
        },
        it = function(e, t) {
            var r = "function" == typeof Symbol && e[Symbol.iterator];
            if (!r) return e;
            var a, i, n = r.call(e),
                s = [];
            try {
                for (;
                    (void 0 === t || t-- > 0) && !(a = n.next()).done;) s.push(a.value)
            } catch (e) {
                i = {
                    error: e
                }
            } finally {
                try {
                    a && !a.done && (r = n.return) && r.call(n)
                } finally {
                    if (i) throw i.error
                }
            }
            return s
        },
        ir = function(e, t, r) {
            if (r || 2 == arguments.length)
                for (var a, i = 0, n = t.length; i < n; i++) !a && i in t || (a || (a = Array.prototype.slice.call(t, 0, i)), a[i] = t[i]);
            return e.concat(a || Array.prototype.slice.call(t))
        },
        ia = function() {
            function e() {}
            return e.prototype.active = function() {
                return ie
            }, e.prototype.with = function(e, t, r) {
                for (var a = [], i = 3; i < arguments.length; i++) a[i - 3] = arguments[i];
                return t.call.apply(t, ir([r], it(a), !1))
            }, e.prototype.bind = function(e, t) {
                return t
            }, e.prototype.enable = function() {
                return this
            }, e.prototype.disable = function() {
                return this
            }, e
        }(),
        ii = function(e, t) {
            var r = "function" == typeof Symbol && e[Symbol.iterator];
            if (!r) return e;
            var a, i, n = r.call(e),
                s = [];
            try {
                for (;
                    (void 0 === t || t-- > 0) && !(a = n.next()).done;) s.push(a.value)
            } catch (e) {
                i = {
                    error: e
                }
            } finally {
                try {
                    a && !a.done && (r = n.return) && r.call(n)
                } finally {
                    if (i) throw i.error
                }
            }
            return s
        },
        is = function(e, t, r) {
            if (r || 2 == arguments.length)
                for (var a, i = 0, n = t.length; i < n; i++) !a && i in t || (a || (a = Array.prototype.slice.call(t, 0, i)), a[i] = t[i]);
            return e.concat(a || Array.prototype.slice.call(t))
        },
        io = function() {
            function e(e) {
                this._namespace = e.namespace || "DiagComponentLogger"
            }
            return e.prototype.debug = function() {
                for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                return il("debug", this._namespace, e)
            }, e.prototype.error = function() {
                for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                return il("error", this._namespace, e)
            }, e.prototype.info = function() {
                for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                return il("info", this._namespace, e)
            }, e.prototype.warn = function() {
                for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                return il("warn", this._namespace, e)
            }, e.prototype.verbose = function() {
                for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
                return il("verbose", this._namespace, e)
            }, e
        }();

    function il(e, t, r) {
        var a = a8("diag");
        if (a) return r.unshift(t), a[e].apply(a, is([], ii(r), !1))
    }(n = q || (q = {}))[n.NONE = 0] = "NONE", n[n.ERROR = 30] = "ERROR", n[n.WARN = 50] = "WARN", n[n.INFO = 60] = "INFO", n[n.DEBUG = 70] = "DEBUG", n[n.VERBOSE = 80] = "VERBOSE", n[n.ALL = 9999] = "ALL";
    var ic = function(e, t) {
            var r = "function" == typeof Symbol && e[Symbol.iterator];
            if (!r) return e;
            var a, i, n = r.call(e),
                s = [];
            try {
                for (;
                    (void 0 === t || t-- > 0) && !(a = n.next()).done;) s.push(a.value)
            } catch (e) {
                i = {
                    error: e
                }
            } finally {
                try {
                    a && !a.done && (r = n.return) && r.call(n)
                } finally {
                    if (i) throw i.error
                }
            }
            return s
        },
        id = function(e, t, r) {
            if (r || 2 == arguments.length)
                for (var a, i = 0, n = t.length; i < n; i++) !a && i in t || (a || (a = Array.prototype.slice.call(t, 0, i)), a[i] = t[i]);
            return e.concat(a || Array.prototype.slice.call(t))
        },
        iu = function() {
            function e() {
                function e(e) {
                    return function() {
                        for (var t = [], r = 0; r < arguments.length; r++) t[r] = arguments[r];
                        var a = a8("diag");
                        if (a) return a[e].apply(a, id([], ic(t), !1))
                    }
                }
                var t = this;
                t.setLogger = function(e, r) {
                    if (void 0 === r && (r = {
                            logLevel: q.INFO
                        }), e === t) {
                        var a, i, n, s = Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
                        return t.error(null != (a = s.stack) ? a : s.message), !1
                    }
                    "number" == typeof r && (r = {
                        logLevel: r
                    });
                    var o = a8("diag"),
                        l = function(e, t) {
                            function r(r, a) {
                                var i = t[r];
                                return "function" == typeof i && e >= a ? i.bind(t) : function() {}
                            }
                            return e < q.NONE ? e = q.NONE : e > q.ALL && (e = q.ALL), t = t || {}, {
                                error: r("error", q.ERROR),
                                warn: r("warn", q.WARN),
                                info: r("info", q.INFO),
                                debug: r("debug", q.DEBUG),
                                verbose: r("verbose", q.VERBOSE)
                            }
                        }(null != (i = r.logLevel) ? i : q.INFO, e);
                    if (o && !r.suppressOverrideMessage) {
                        var c = null != (n = Error().stack) ? n : "<failed to generate stacktrace>";
                        o.warn("Current logger will be overwritten from " + c), l.warn("Current logger will overwrite one already registered from " + c)
                    }
                    return a9("diag", l, t, !0)
                }, t.disable = function() {
                    a7("diag", t)
                }, t.createComponentLogger = function(e) {
                    return new io(e)
                }, t.verbose = e("verbose"), t.debug = e("debug"), t.info = e("info"), t.warn = e("warn"), t.error = e("error")
            }
            return e.instance = function() {
                return this._instance || (this._instance = new e), this._instance
            }, e
        }(),
        im = function(e, t) {
            var r = "function" == typeof Symbol && e[Symbol.iterator];
            if (!r) return e;
            var a, i, n = r.call(e),
                s = [];
            try {
                for (;
                    (void 0 === t || t-- > 0) && !(a = n.next()).done;) s.push(a.value)
            } catch (e) {
                i = {
                    error: e
                }
            } finally {
                try {
                    a && !a.done && (r = n.return) && r.call(n)
                } finally {
                    if (i) throw i.error
                }
            }
            return s
        },
        ip = function(e, t, r) {
            if (r || 2 == arguments.length)
                for (var a, i = 0, n = t.length; i < n; i++) !a && i in t || (a || (a = Array.prototype.slice.call(t, 0, i)), a[i] = t[i]);
            return e.concat(a || Array.prototype.slice.call(t))
        },
        ih = "context",
        ix = new ia,
        ig = function() {
            function e() {}
            return e.getInstance = function() {
                return this._instance || (this._instance = new e), this._instance
            }, e.prototype.setGlobalContextManager = function(e) {
                return a9(ih, e, iu.instance())
            }, e.prototype.active = function() {
                return this._getContextManager().active()
            }, e.prototype.with = function(e, t, r) {
                for (var a, i = [], n = 3; n < arguments.length; n++) i[n - 3] = arguments[n];
                return (a = this._getContextManager()).with.apply(a, ip([e, t, r], im(i), !1))
            }, e.prototype.bind = function(e, t) {
                return this._getContextManager().bind(e, t)
            }, e.prototype._getContextManager = function() {
                return a8(ih) || ix
            }, e.prototype.disable = function() {
                this._getContextManager().disable(), a7(ih, iu.instance())
            }, e
        }();
    (s = V || (V = {}))[s.NONE = 0] = "NONE", s[s.SAMPLED = 1] = "SAMPLED";
    var iv = "0000000000000000",
        iy = "00000000000000000000000000000000",
        ib = {
            traceId: iy,
            spanId: iv,
            traceFlags: V.NONE
        },
        ik = function() {
            function e(e) {
                void 0 === e && (e = ib), this._spanContext = e
            }
            return e.prototype.spanContext = function() {
                return this._spanContext
            }, e.prototype.setAttribute = function(e, t) {
                return this
            }, e.prototype.setAttributes = function(e) {
                return this
            }, e.prototype.addEvent = function(e, t) {
                return this
            }, e.prototype.addLink = function(e) {
                return this
            }, e.prototype.addLinks = function(e) {
                return this
            }, e.prototype.setStatus = function(e) {
                return this
            }, e.prototype.updateName = function(e) {
                return this
            }, e.prototype.end = function(e) {}, e.prototype.isRecording = function() {
                return !1
            }, e.prototype.recordException = function(e, t) {}, e
        }(),
        iw = Symbol.for("OpenTelemetry Context Key SPAN");

    function iS(e) {
        return e.getValue(iw) || void 0
    }

    function ij() {
        return iS(ig.getInstance().active())
    }

    function iC(e, t) {
        return e.setValue(iw, t)
    }

    function i_(e) {
        return e.deleteValue(iw)
    }

    function iT(e, t) {
        return iC(e, new ik(t))
    }

    function iM(e) {
        var t;
        return null == (t = iS(e)) ? void 0 : t.spanContext()
    }
    var iN = /^([0-9a-f]{32})$/i,
        iI = /^[0-9a-f]{16}$/i;

    function iP(e) {
        var t, r;
        return t = e.traceId, iN.test(t) && t !== iy && (r = e.spanId, iI.test(r) && r !== iv)
    }

    function iE(e) {
        return new ik(e)
    }
    var iA = ig.getInstance(),
        iO = function() {
            function e() {}
            return e.prototype.startSpan = function(e, t, r) {
                if (void 0 === r && (r = iA.active()), null == t ? void 0 : t.root) return new ik;
                var a, i = r && iM(r);
                return "object" == typeof(a = i) && "string" == typeof a.spanId && "string" == typeof a.traceId && "number" == typeof a.traceFlags && iP(i) ? new ik(i) : new ik
            }, e.prototype.startActiveSpan = function(e, t, r, a) {
                if (!(arguments.length < 2)) {
                    2 == arguments.length ? s = t : 3 == arguments.length ? (i = t, s = r) : (i = t, n = r, s = a);
                    var i, n, s, o = null != n ? n : iA.active(),
                        l = this.startSpan(e, i, o),
                        c = iC(o, l);
                    return iA.with(c, s, void 0, l)
                }
            }, e
        }(),
        iD = new iO,
        iL = function() {
            function e(e, t, r, a) {
                this._provider = e, this.name = t, this.version = r, this.options = a
            }
            return e.prototype.startSpan = function(e, t, r) {
                return this._getTracer().startSpan(e, t, r)
            }, e.prototype.startActiveSpan = function(e, t, r, a) {
                var i = this._getTracer();
                return Reflect.apply(i.startActiveSpan, i, arguments)
            }, e.prototype._getTracer = function() {
                if (this._delegate) return this._delegate;
                var e = this._provider.getDelegateTracer(this.name, this.version, this.options);
                return e ? (this._delegate = e, this._delegate) : iD
            }, e
        }(),
        iz = new(function() {
            function e() {}
            return e.prototype.getTracer = function(e, t, r) {
                return new iO
            }, e
        }()),
        iR = function() {
            function e() {}
            return e.prototype.getTracer = function(e, t, r) {
                var a;
                return null != (a = this.getDelegateTracer(e, t, r)) ? a : new iL(this, e, t, r)
            }, e.prototype.getDelegate = function() {
                var e;
                return null != (e = this._delegate) ? e : iz
            }, e.prototype.setDelegate = function(e) {
                this._delegate = e
            }, e.prototype.getDelegateTracer = function(e, t, r) {
                var a;
                return null == (a = this._delegate) ? void 0 : a.getTracer(e, t, r)
            }, e
        }(),
        iF = "trace";
    (function() {
        function e() {
            this._proxyTracerProvider = new iR, this.wrapSpanContext = iE, this.isSpanContextValid = iP, this.deleteSpan = i_, this.getSpan = iS, this.getActiveSpan = ij, this.getSpanContext = iM, this.setSpan = iC, this.setSpanContext = iT
        }
        return e.getInstance = function() {
            return this._instance || (this._instance = new e), this._instance
        }, e.prototype.setGlobalTracerProvider = function(e) {
            var t = a9(iF, this._proxyTracerProvider, iu.instance());
            return t && this._proxyTracerProvider.setDelegate(e), t
        }, e.prototype.getTracerProvider = function() {
            return a8(iF) || this._proxyTracerProvider
        }, e.prototype.getTracer = function(e, t) {
            return this.getTracerProvider().getTracer(e, t)
        }, e.prototype.disable = function() {
            a7(iF, iu.instance()), this._proxyTracerProvider = new iR
        }, e
    })().getInstance(), (o = H || (H = {}))[o.UNSET = 0] = "UNSET", o[o.OK = 1] = "OK", o[o.ERROR = 2] = "ERROR", ig.getInstance();
    var i$ = Object.defineProperty,
        iB = (Symbol.for("vercel.ai.error.AI_InvalidArgumentError"), Symbol.for("vercel.ai.error.AI_InvalidStreamPartError"), Symbol.for("vercel.ai.error.AI_InvalidToolApprovalError"), Symbol.for("vercel.ai.error.AI_InvalidToolInputError"), Symbol.for("vercel.ai.error.AI_ToolCallNotFoundForApprovalError"), Symbol.for("vercel.ai.error.AI_MissingToolResultsError"), Symbol.for("vercel.ai.error.AI_NoImageGeneratedError"), "AI_NoObjectGeneratedError"),
        iq = `vercel.ai.error.${iB}`,
        iV = Symbol.for(iq),
        iH = class extends el {
            constructor({
                message: e = "No object generated.",
                cause: t,
                text: r,
                response: a,
                usage: i,
                finishReason: n
            }) {
                super({
                    name: iB,
                    message: e,
                    cause: t
                }), this[U] = !0, this.text = r, this.response = a, this.usage = i, this.finishReason = n
            }
            static isInstance(e) {
                return el.hasMarker(e, iq)
            }
        };
    U = iV, Symbol.for("vercel.ai.error.AI_NoOutputGeneratedError"), Symbol.for("vercel.ai.error.AI_NoSpeechGeneratedError"), Symbol.for("vercel.ai.error.AI_NoTranscriptGeneratedError"), Symbol.for("vercel.ai.error.AI_NoVideoGeneratedError"), Symbol.for("vercel.ai.error.AI_NoSuchToolError"), Symbol.for("vercel.ai.error.AI_ToolCallRepairError");
    var iU = "AI_UIMessageStreamError",
        iW = `vercel.ai.error.${iU}`,
        iG = Symbol.for(iW),
        iZ = class extends el {
            constructor({
                chunkType: e,
                chunkId: t,
                message: r
            }) {
                super({
                    name: iU,
                    message: r
                }), this[W] = !0, this.chunkType = e, this.chunkId = t
            }
            static isInstance(e) {
                return el.hasMarker(e, iW)
            }
        };
    W = iG, Symbol.for("vercel.ai.error.AI_InvalidDataContentError"), Symbol.for("vercel.ai.error.AI_InvalidMessageRoleError"), Symbol.for("vercel.ai.error.AI_MessageConversionError"), Symbol.for("vercel.ai.error.AI_RetryError");
    var iK = "6.0.177",
        iY = async ({
            url: e,
            maxBytes: t,
            abortSignal: r
        }) => {
            var a;
            let i = e.toString();
            t3(i);
            try {
                let e = await fetch(i, {
                    headers: ri({}, `ai-sdk/${iK}`, rr()),
                    signal: r
                });
                if (e.redirected && t3(e.url), !e.ok) throw new t1({
                    url: i,
                    statusCode: e.status,
                    statusText: e.statusText
                });
                return {
                    data: await t2({
                        response: e,
                        url: i,
                        maxBytes: null != t ? t : 0x80000000
                    }),
                    mediaType: null != (a = e.headers.get("content-type")) ? a : void 0
                }
            } catch (e) {
                if (t1.isInstance(e)) throw e;
                throw new t1({
                    url: i,
                    cause: e
                })
            }
        },
        iQ = r4.z.union([r4.z.string(), r4.z.instanceof(Uint8Array), r4.z.instanceof(ArrayBuffer), r4.z.custom(e => {
            var t, r;
            return null != (r = null == (t = globalThis.Buffer) ? void 0 : t.isBuffer(e)) && r
        }, {
            message: "Must be a Buffer"
        })]),
        iX = r4.z.lazy(() => r4.z.union([r4.z.null(), r4.z.string(), r4.z.number(), r4.z.boolean(), r4.z.record(r4.z.string(), iX.optional()), r4.z.array(iX)])),
        iJ = r4.z.record(r4.z.string(), r4.z.record(r4.z.string(), iX.optional())),
        i0 = r4.z.object({
            type: r4.z.literal("text"),
            text: r4.z.string(),
            providerOptions: iJ.optional()
        }),
        i1 = r4.z.object({
            type: r4.z.literal("image"),
            image: r4.z.union([iQ, r4.z.instanceof(URL)]),
            mediaType: r4.z.string().optional(),
            providerOptions: iJ.optional()
        }),
        i2 = r4.z.object({
            type: r4.z.literal("file"),
            data: r4.z.union([iQ, r4.z.instanceof(URL)]),
            filename: r4.z.string().optional(),
            mediaType: r4.z.string(),
            providerOptions: iJ.optional()
        }),
        i3 = r4.z.object({
            type: r4.z.literal("reasoning"),
            text: r4.z.string(),
            providerOptions: iJ.optional()
        }),
        i4 = r4.z.object({
            type: r4.z.literal("tool-call"),
            toolCallId: r4.z.string(),
            toolName: r4.z.string(),
            input: r4.z.unknown(),
            providerOptions: iJ.optional(),
            providerExecuted: r4.z.boolean().optional()
        }),
        i5 = r4.z.discriminatedUnion("type", [r4.z.object({
            type: r4.z.literal("text"),
            value: r4.z.string(),
            providerOptions: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("json"),
            value: iX,
            providerOptions: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("execution-denied"),
            reason: r4.z.string().optional(),
            providerOptions: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("error-text"),
            value: r4.z.string(),
            providerOptions: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("error-json"),
            value: iX,
            providerOptions: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("content"),
            value: r4.z.array(r4.z.union([r4.z.object({
                type: r4.z.literal("text"),
                text: r4.z.string(),
                providerOptions: iJ.optional()
            }), r4.z.object({
                type: r4.z.literal("media"),
                data: r4.z.string(),
                mediaType: r4.z.string()
            }), r4.z.object({
                type: r4.z.literal("file-data"),
                data: r4.z.string(),
                mediaType: r4.z.string(),
                filename: r4.z.string().optional(),
                providerOptions: iJ.optional()
            }), r4.z.object({
                type: r4.z.literal("file-url"),
                url: r4.z.string(),
                providerOptions: iJ.optional()
            }), r4.z.object({
                type: r4.z.literal("file-id"),
                fileId: r4.z.union([r4.z.string(), r4.z.record(r4.z.string(), r4.z.string())]),
                providerOptions: iJ.optional()
            }), r4.z.object({
                type: r4.z.literal("image-data"),
                data: r4.z.string(),
                mediaType: r4.z.string(),
                providerOptions: iJ.optional()
            }), r4.z.object({
                type: r4.z.literal("image-url"),
                url: r4.z.string(),
                providerOptions: iJ.optional()
            }), r4.z.object({
                type: r4.z.literal("image-file-id"),
                fileId: r4.z.union([r4.z.string(), r4.z.record(r4.z.string(), r4.z.string())]),
                providerOptions: iJ.optional()
            }), r4.z.object({
                type: r4.z.literal("custom"),
                providerOptions: iJ.optional()
            })]))
        })]),
        i6 = r4.z.object({
            type: r4.z.literal("tool-result"),
            toolCallId: r4.z.string(),
            toolName: r4.z.string(),
            output: i5,
            providerOptions: iJ.optional()
        }),
        i9 = r4.z.object({
            type: r4.z.literal("tool-approval-request"),
            approvalId: r4.z.string(),
            toolCallId: r4.z.string()
        }),
        i8 = r4.z.object({
            type: r4.z.literal("tool-approval-response"),
            approvalId: r4.z.string(),
            approved: r4.z.boolean(),
            reason: r4.z.string().optional()
        }),
        i7 = r4.z.object({
            role: r4.z.literal("system"),
            content: r4.z.string(),
            providerOptions: iJ.optional()
        }),
        ne = r4.z.object({
            role: r4.z.literal("user"),
            content: r4.z.union([r4.z.string(), r4.z.array(r4.z.union([i0, i1, i2]))]),
            providerOptions: iJ.optional()
        }),
        nt = r4.z.object({
            role: r4.z.literal("assistant"),
            content: r4.z.union([r4.z.string(), r4.z.array(r4.z.union([i0, i2, i3, i4, i6, i9]))]),
            providerOptions: iJ.optional()
        }),
        nr = r4.z.object({
            role: r4.z.literal("tool"),
            content: r4.z.array(r4.z.union([i6, i8])),
            providerOptions: iJ.optional()
        });
    r4.z.union([i7, ne, nt, nr]);
    var na = {},
        ni = {
            array: () => nc,
            choice: () => nd,
            json: () => nu,
            object: () => nl,
            text: () => no
        };
    for (var nn in ni) i$(na, nn, {
        get: ni[nn],
        enumerable: !0
    });
    async function ns(e) {
        if (void 0 === e) return {
            value: void 0,
            state: "undefined-input"
        };
        let t = await rK({
            text: e
        });
        return t.success ? {
            value: t.value,
            state: "successful-parse"
        } : (t = await rK({
            text: function(e) {
                let t = ["ROOT"],
                    r = -1,
                    a = null;

                function i(e, i, n) {
                    switch (e) {
                        case '"':
                            r = i, t.pop(), t.push(n), t.push("INSIDE_STRING");
                            break;
                        case "f":
                        case "t":
                        case "n":
                            r = i, a = i, t.pop(), t.push(n), t.push("INSIDE_LITERAL");
                            break;
                        case "-":
                            t.pop(), t.push(n), t.push("INSIDE_NUMBER");
                            break;
                        case "0":
                        case "1":
                        case "2":
                        case "3":
                        case "4":
                        case "5":
                        case "6":
                        case "7":
                        case "8":
                        case "9":
                            r = i, t.pop(), t.push(n), t.push("INSIDE_NUMBER");
                            break;
                        case "{":
                            r = i, t.pop(), t.push(n), t.push("INSIDE_OBJECT_START");
                            break;
                        case "[":
                            r = i, t.pop(), t.push(n), t.push("INSIDE_ARRAY_START")
                    }
                }

                function n(e, a) {
                    switch (e) {
                        case ",":
                            t.pop(), t.push("INSIDE_OBJECT_AFTER_COMMA");
                            break;
                        case "}":
                            r = a, t.pop()
                    }
                }

                function s(e, a) {
                    switch (e) {
                        case ",":
                            t.pop(), t.push("INSIDE_ARRAY_AFTER_COMMA");
                            break;
                        case "]":
                            r = a, t.pop()
                    }
                }
                for (let o = 0; o < e.length; o++) {
                    let l = e[o];
                    switch (t[t.length - 1]) {
                        case "ROOT":
                            i(l, o, "FINISH");
                            break;
                        case "INSIDE_OBJECT_START":
                            switch (l) {
                                case '"':
                                    t.pop(), t.push("INSIDE_OBJECT_KEY");
                                    break;
                                case "}":
                                    r = o, t.pop()
                            }
                            break;
                        case "INSIDE_OBJECT_AFTER_COMMA":
                            '"' === l && (t.pop(), t.push("INSIDE_OBJECT_KEY"));
                            break;
                        case "INSIDE_OBJECT_KEY":
                            '"' === l && (t.pop(), t.push("INSIDE_OBJECT_AFTER_KEY"));
                            break;
                        case "INSIDE_OBJECT_AFTER_KEY":
                            ":" === l && (t.pop(), t.push("INSIDE_OBJECT_BEFORE_VALUE"));
                            break;
                        case "INSIDE_OBJECT_BEFORE_VALUE":
                            i(l, o, "INSIDE_OBJECT_AFTER_VALUE");
                            break;
                        case "INSIDE_OBJECT_AFTER_VALUE":
                            n(l, o);
                            break;
                        case "INSIDE_STRING":
                            switch (l) {
                                case '"':
                                    t.pop(), r = o;
                                    break;
                                case "\\":
                                    t.push("INSIDE_STRING_ESCAPE");
                                    break;
                                default:
                                    r = o
                            }
                            break;
                        case "INSIDE_ARRAY_START":
                            "]" === l ? (r = o, t.pop()) : (r = o, i(l, o, "INSIDE_ARRAY_AFTER_VALUE"));
                            break;
                        case "INSIDE_ARRAY_AFTER_VALUE":
                            switch (l) {
                                case ",":
                                    t.pop(), t.push("INSIDE_ARRAY_AFTER_COMMA");
                                    break;
                                case "]":
                                    r = o, t.pop();
                                    break;
                                default:
                                    r = o
                            }
                            break;
                        case "INSIDE_ARRAY_AFTER_COMMA":
                            i(l, o, "INSIDE_ARRAY_AFTER_VALUE");
                            break;
                        case "INSIDE_STRING_ESCAPE":
                            t.pop(), r = o;
                            break;
                        case "INSIDE_NUMBER":
                            switch (l) {
                                case "0":
                                case "1":
                                case "2":
                                case "3":
                                case "4":
                                case "5":
                                case "6":
                                case "7":
                                case "8":
                                case "9":
                                    r = o;
                                    break;
                                case "e":
                                case "E":
                                case "-":
                                case ".":
                                    break;
                                case ",":
                                    t.pop(), "INSIDE_ARRAY_AFTER_VALUE" === t[t.length - 1] && s(l, o), "INSIDE_OBJECT_AFTER_VALUE" === t[t.length - 1] && n(l, o);
                                    break;
                                case "}":
                                    t.pop(), "INSIDE_OBJECT_AFTER_VALUE" === t[t.length - 1] && n(l, o);
                                    break;
                                case "]":
                                    t.pop(), "INSIDE_ARRAY_AFTER_VALUE" === t[t.length - 1] && s(l, o);
                                    break;
                                default:
                                    t.pop()
                            }
                            break;
                        case "INSIDE_LITERAL":
                            {
                                let i = e.substring(a, o + 1);
                                "false".startsWith(i) || "true".startsWith(i) || "null".startsWith(i) ? r = o : (t.pop(), "INSIDE_OBJECT_AFTER_VALUE" === t[t.length - 1] ? n(l, o) : "INSIDE_ARRAY_AFTER_VALUE" === t[t.length - 1] && s(l, o))
                            }
                    }
                }
                let o = e.slice(0, r + 1);
                for (let r = t.length - 1; r >= 0; r--) switch (t[r]) {
                    case "INSIDE_STRING":
                        o += '"';
                        break;
                    case "INSIDE_OBJECT_KEY":
                    case "INSIDE_OBJECT_AFTER_KEY":
                    case "INSIDE_OBJECT_AFTER_COMMA":
                    case "INSIDE_OBJECT_START":
                    case "INSIDE_OBJECT_BEFORE_VALUE":
                    case "INSIDE_OBJECT_AFTER_VALUE":
                        o += "}";
                        break;
                    case "INSIDE_ARRAY_START":
                    case "INSIDE_ARRAY_AFTER_COMMA":
                    case "INSIDE_ARRAY_AFTER_VALUE":
                        o += "]";
                        break;
                    case "INSIDE_LITERAL":
                        {
                            let t = e.substring(a, e.length);
                            "true".startsWith(t) ? o += "true".slice(t.length) : "false".startsWith(t) ? o += "false".slice(t.length) : "null".startsWith(t) && (o += "null".slice(t.length))
                        }
                }
                return o
            }(e)
        })).success ? {
            value: t.value,
            state: "repaired-parse"
        } : {
            value: void 0,
            state: "failed-parse"
        }
    }
    var no = () => ({
            name: "text",
            responseFormat: Promise.resolve({
                type: "text"
            }),
            parseCompleteOutput: async ({
                text: e
            }) => e,
            parsePartialOutput: async ({
                text: e
            }) => ({
                partial: e
            }),
            createElementStreamTransform() {}
        }),
        nl = ({
            schema: e,
            name: t,
            description: r
        }) => {
            let a = rH(e);
            return {
                name: "object",
                responseFormat: r1(a.jsonSchema).then(e => ({
                    type: "json",
                    schema: e,
                    ...null != t && {
                        name: t
                    },
                    ...null != r && {
                        description: r
                    }
                })),
                async parseCompleteOutput({
                    text: e
                }, t) {
                    let r = await rK({
                        text: e
                    });
                    if (!r.success) throw new iH({
                        message: "No object generated: could not parse the response.",
                        cause: r.error,
                        text: e,
                        response: t.response,
                        usage: t.usage,
                        finishReason: t.finishReason
                    });
                    let i = await rG({
                        value: r.value,
                        schema: a
                    });
                    if (!i.success) throw new iH({
                        message: "No object generated: response did not match schema.",
                        cause: i.error,
                        text: e,
                        response: t.response,
                        usage: t.usage,
                        finishReason: t.finishReason
                    });
                    return i.value
                },
                async parsePartialOutput({
                    text: e
                }) {
                    let t = await ns(e);
                    switch (t.state) {
                        case "failed-parse":
                        case "undefined-input":
                            return;
                        case "repaired-parse":
                        case "successful-parse":
                            return {
                                partial: t.value
                            }
                    }
                },
                createElementStreamTransform() {}
            }
        },
        nc = ({
            element: e,
            name: t,
            description: r
        }) => {
            let a = rH(e);
            return {
                name: "array",
                responseFormat: r1(a.jsonSchema).then(e => {
                    let {
                        $schema: a,
                        ...i
                    } = e;
                    return {
                        type: "json",
                        schema: {
                            $schema: "http://json-schema.org/draft-07/schema#",
                            type: "object",
                            properties: {
                                elements: {
                                    type: "array",
                                    items: i
                                }
                            },
                            required: ["elements"],
                            additionalProperties: !1
                        },
                        ...null != t && {
                            name: t
                        },
                        ...null != r && {
                            description: r
                        }
                    }
                }),
                async parseCompleteOutput({
                    text: e
                }, t) {
                    let r = await rK({
                        text: e
                    });
                    if (!r.success) throw new iH({
                        message: "No object generated: could not parse the response.",
                        cause: r.error,
                        text: e,
                        response: t.response,
                        usage: t.usage,
                        finishReason: t.finishReason
                    });
                    let i = r.value;
                    if (null == i || "object" != typeof i || !("elements" in i) || !Array.isArray(i.elements)) throw new iH({
                        message: "No object generated: response did not match schema.",
                        cause: new eP({
                            value: i,
                            cause: "response must be an object with an elements array"
                        }),
                        text: e,
                        response: t.response,
                        usage: t.usage,
                        finishReason: t.finishReason
                    });
                    for (let r of i.elements) {
                        let i = await rG({
                            value: r,
                            schema: a
                        });
                        if (!i.success) throw new iH({
                            message: "No object generated: response did not match schema.",
                            cause: i.error,
                            text: e,
                            response: t.response,
                            usage: t.usage,
                            finishReason: t.finishReason
                        })
                    }
                    return i.elements
                },
                async parsePartialOutput({
                    text: e
                }) {
                    let t = await ns(e);
                    switch (t.state) {
                        case "failed-parse":
                        case "undefined-input":
                            return;
                        case "repaired-parse":
                        case "successful-parse":
                            {
                                let e = t.value;
                                if (null == e || "object" != typeof e || !("elements" in e) || !Array.isArray(e.elements)) return;
                                let r = "repaired-parse" === t.state && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements,
                                    i = [];
                                for (let e of r) {
                                    let t = await rG({
                                        value: e,
                                        schema: a
                                    });
                                    t.success && i.push(t.value)
                                }
                                return {
                                    partial: i
                                }
                            }
                    }
                },
                createElementStreamTransform() {
                    let e = 0;
                    return new TransformStream({
                        transform({
                            partialOutput: t
                        }, r) {
                            if (null != t)
                                for (; e < t.length; e++) r.enqueue(t[e])
                        }
                    })
                }
            }
        },
        nd = ({
            options: e,
            name: t,
            description: r
        }) => ({
            name: "choice",
            responseFormat: Promise.resolve({
                type: "json",
                schema: {
                    $schema: "http://json-schema.org/draft-07/schema#",
                    type: "object",
                    properties: {
                        result: {
                            type: "string",
                            enum: e
                        }
                    },
                    required: ["result"],
                    additionalProperties: !1
                },
                ...null != t && {
                    name: t
                },
                ...null != r && {
                    description: r
                }
            }),
            async parseCompleteOutput({
                text: t
            }, r) {
                let a = await rK({
                    text: t
                });
                if (!a.success) throw new iH({
                    message: "No object generated: could not parse the response.",
                    cause: a.error,
                    text: t,
                    response: r.response,
                    usage: r.usage,
                    finishReason: r.finishReason
                });
                let i = a.value;
                if (null == i || "object" != typeof i || !("result" in i) || "string" != typeof i.result || !e.includes(i.result)) throw new iH({
                    message: "No object generated: response did not match schema.",
                    cause: new eP({
                        value: i,
                        cause: "response must be an object that contains a choice value."
                    }),
                    text: t,
                    response: r.response,
                    usage: r.usage,
                    finishReason: r.finishReason
                });
                return i.result
            },
            async parsePartialOutput({
                text: t
            }) {
                let r = await ns(t);
                switch (r.state) {
                    case "failed-parse":
                    case "undefined-input":
                        return;
                    case "repaired-parse":
                    case "successful-parse":
                        {
                            let t = r.value;
                            if (null == t || "object" != typeof t || !("result" in t) || "string" != typeof t.result) return;
                            let a = e.filter(e => e.startsWith(t.result));
                            if ("successful-parse" === r.state) return a.includes(t.result) ? {
                                partial: t.result
                            } : void 0;
                            return 1 === a.length ? {
                                partial: a[0]
                            } : void 0
                        }
                }
            },
            createElementStreamTransform() {}
        }),
        nu = ({
            name: e,
            description: t
        } = {}) => ({
            name: "json",
            responseFormat: Promise.resolve({
                type: "json",
                ...null != e && {
                    name: e
                },
                ...null != t && {
                    description: t
                }
            }),
            async parseCompleteOutput({
                text: e
            }, t) {
                let r = await rK({
                    text: e
                });
                if (!r.success) throw new iH({
                    message: "No object generated: could not parse the response.",
                    cause: r.error,
                    text: e,
                    response: t.response,
                    usage: t.usage,
                    finishReason: t.finishReason
                });
                return r.value
            },
            async parsePartialOutput({
                text: e
            }) {
                let t = await ns(e);
                switch (t.state) {
                    case "failed-parse":
                    case "undefined-input":
                        return;
                    case "repaired-parse":
                    case "successful-parse":
                        return void 0 === t.value ? void 0 : {
                            partial: t.value
                        }
                }
            },
            createElementStreamTransform() {}
        });
    t6({
        prefix: "aitxt",
        size: 24
    }), TransformStream;
    var nm = r4.z.record(r4.z.string(), iX.optional()),
        np = rq(() => rU(r4.z.union([r4.z.strictObject({
            type: r4.z.literal("text-start"),
            id: r4.z.string(),
            providerMetadata: iJ.optional()
        }), r4.z.strictObject({
            type: r4.z.literal("text-delta"),
            id: r4.z.string(),
            delta: r4.z.string(),
            providerMetadata: iJ.optional()
        }), r4.z.strictObject({
            type: r4.z.literal("text-end"),
            id: r4.z.string(),
            providerMetadata: iJ.optional()
        }), r4.z.strictObject({
            type: r4.z.literal("error"),
            errorText: r4.z.string()
        }), r4.z.strictObject({
            type: r4.z.literal("tool-input-start"),
            toolCallId: r4.z.string(),
            toolName: r4.z.string(),
            providerExecuted: r4.z.boolean().optional(),
            providerMetadata: iJ.optional(),
            toolMetadata: nm.optional(),
            dynamic: r4.z.boolean().optional(),
            title: r4.z.string().optional()
        }), r4.z.strictObject({
            type: r4.z.literal("tool-input-delta"),
            toolCallId: r4.z.string(),
            inputTextDelta: r4.z.string()
        }), r4.z.strictObject({
            type: r4.z.literal("tool-input-available"),
            toolCallId: r4.z.string(),
            toolName: r4.z.string(),
            input: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            providerMetadata: iJ.optional(),
            toolMetadata: nm.optional(),
            dynamic: r4.z.boolean().optional(),
            title: r4.z.string().optional()
        }), r4.z.strictObject({
            type: r4.z.literal("tool-input-error"),
            toolCallId: r4.z.string(),
            toolName: r4.z.string(),
            input: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            providerMetadata: iJ.optional(),
            toolMetadata: nm.optional(),
            dynamic: r4.z.boolean().optional(),
            errorText: r4.z.string(),
            title: r4.z.string().optional()
        }), r4.z.strictObject({
            type: r4.z.literal("tool-approval-request"),
            approvalId: r4.z.string(),
            toolCallId: r4.z.string()
        }), r4.z.strictObject({
            type: r4.z.literal("tool-output-available"),
            toolCallId: r4.z.string(),
            output: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            providerMetadata: iJ.optional(),
            toolMetadata: nm.optional(),
            dynamic: r4.z.boolean().optional(),
            preliminary: r4.z.boolean().optional()
        }), r4.z.strictObject({
            type: r4.z.literal("tool-output-error"),
            toolCallId: r4.z.string(),
            errorText: r4.z.string(),
            providerExecuted: r4.z.boolean().optional(),
            providerMetadata: iJ.optional(),
            toolMetadata: nm.optional(),
            dynamic: r4.z.boolean().optional()
        }), r4.z.strictObject({
            type: r4.z.literal("tool-output-denied"),
            toolCallId: r4.z.string()
        }), r4.z.strictObject({
            type: r4.z.literal("reasoning-start"),
            id: r4.z.string(),
            providerMetadata: iJ.optional()
        }), r4.z.strictObject({
            type: r4.z.literal("reasoning-delta"),
            id: r4.z.string(),
            delta: r4.z.string(),
            providerMetadata: iJ.optional()
        }), r4.z.strictObject({
            type: r4.z.literal("reasoning-end"),
            id: r4.z.string(),
            providerMetadata: iJ.optional()
        }), r4.z.strictObject({
            type: r4.z.literal("source-url"),
            sourceId: r4.z.string(),
            url: r4.z.string(),
            title: r4.z.string().optional(),
            providerMetadata: iJ.optional()
        }), r4.z.strictObject({
            type: r4.z.literal("source-document"),
            sourceId: r4.z.string(),
            mediaType: r4.z.string(),
            title: r4.z.string(),
            filename: r4.z.string().optional(),
            providerMetadata: iJ.optional()
        }), r4.z.strictObject({
            type: r4.z.literal("file"),
            url: r4.z.string(),
            mediaType: r4.z.string(),
            providerMetadata: iJ.optional()
        }), r4.z.strictObject({
            type: r4.z.custom(e => "string" == typeof e && e.startsWith("data-"), {
                message: 'Type must start with "data-"'
            }),
            id: r4.z.string().optional(),
            data: r4.z.unknown(),
            transient: r4.z.boolean().optional()
        }), r4.z.strictObject({
            type: r4.z.literal("start-step")
        }), r4.z.strictObject({
            type: r4.z.literal("finish-step")
        }), r4.z.strictObject({
            type: r4.z.literal("start"),
            messageId: r4.z.string().optional(),
            messageMetadata: r4.z.unknown().optional()
        }), r4.z.strictObject({
            type: r4.z.literal("finish"),
            finishReason: r4.z.enum(["stop", "length", "content-filter", "tool-calls", "error", "other"]).optional(),
            messageMetadata: r4.z.unknown().optional()
        }), r4.z.strictObject({
            type: r4.z.literal("abort"),
            reason: r4.z.string().optional()
        }), r4.z.strictObject({
            type: r4.z.literal("message-metadata"),
            messageMetadata: r4.z.unknown()
        })])));

    function nh(e) {
        return e.type.startsWith("tool-")
    }

    function nf(e) {
        return nh(e) || "dynamic-tool" === e.type
    }

    function nx(e) {
        return e.type.split("-").slice(1).join("-")
    }
    async function ng({
        stream: e,
        onError: t
    }) {
        let r = e.getReader();
        try {
            for (;;) {
                let {
                    done: e
                } = await r.read();
                if (e) break
            }
        } catch (e) {
            null == t || t(e)
        } finally {
            r.releaseLock()
        }
    }
    t6({
        prefix: "aitxt",
        size: 24
    });
    var nv = r4.z.record(r4.z.string(), iX.optional());

    function ny(e) {
        return ({
            url: t,
            abortSignal: r
        }) => iY({
            url: t,
            maxBytes: null == e ? void 0 : e.maxBytes,
            abortSignal: r
        })
    }
    rq(() => rU(r4.z.array(r4.z.object({
        id: r4.z.string(),
        role: r4.z.enum(["system", "user", "assistant"]),
        metadata: r4.z.unknown().optional(),
        parts: r4.z.array(r4.z.union([r4.z.object({
            type: r4.z.literal("text"),
            text: r4.z.string(),
            state: r4.z.enum(["streaming", "done"]).optional(),
            providerMetadata: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("reasoning"),
            text: r4.z.string(),
            state: r4.z.enum(["streaming", "done"]).optional(),
            providerMetadata: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("source-url"),
            sourceId: r4.z.string(),
            url: r4.z.string(),
            title: r4.z.string().optional(),
            providerMetadata: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("source-document"),
            sourceId: r4.z.string(),
            mediaType: r4.z.string(),
            title: r4.z.string(),
            filename: r4.z.string().optional(),
            providerMetadata: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("file"),
            mediaType: r4.z.string(),
            filename: r4.z.string().optional(),
            url: r4.z.string(),
            providerMetadata: iJ.optional()
        }), r4.z.object({
            type: r4.z.literal("step-start")
        }), r4.z.object({
            type: r4.z.string().startsWith("data-"),
            id: r4.z.string().optional(),
            data: r4.z.unknown()
        }), r4.z.object({
            type: r4.z.literal("dynamic-tool"),
            toolName: r4.z.string(),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("input-streaming"),
            input: r4.z.unknown().optional(),
            providerExecuted: r4.z.boolean().optional(),
            callProviderMetadata: iJ.optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            approval: r4.z.never().optional()
        }), r4.z.object({
            type: r4.z.literal("dynamic-tool"),
            toolName: r4.z.string(),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("input-available"),
            input: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            approval: r4.z.never().optional()
        }), r4.z.object({
            type: r4.z.literal("dynamic-tool"),
            toolName: r4.z.string(),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("approval-requested"),
            input: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.never().optional(),
                reason: r4.z.never().optional()
            })
        }), r4.z.object({
            type: r4.z.literal("dynamic-tool"),
            toolName: r4.z.string(),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("approval-responded"),
            input: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.boolean(),
                reason: r4.z.string().optional()
            })
        }), r4.z.object({
            type: r4.z.literal("dynamic-tool"),
            toolName: r4.z.string(),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("output-available"),
            input: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            output: r4.z.unknown(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            resultProviderMetadata: iJ.optional(),
            preliminary: r4.z.boolean().optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.literal(!0),
                reason: r4.z.string().optional()
            }).optional()
        }), r4.z.object({
            type: r4.z.literal("dynamic-tool"),
            toolName: r4.z.string(),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("output-error"),
            input: r4.z.unknown(),
            rawInput: r4.z.unknown().optional(),
            providerExecuted: r4.z.boolean().optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.string(),
            callProviderMetadata: iJ.optional(),
            resultProviderMetadata: iJ.optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.literal(!0),
                reason: r4.z.string().optional()
            }).optional()
        }), r4.z.object({
            type: r4.z.literal("dynamic-tool"),
            toolName: r4.z.string(),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("output-denied"),
            input: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.literal(!1),
                reason: r4.z.string().optional()
            })
        }), r4.z.object({
            type: r4.z.string().startsWith("tool-"),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("input-streaming"),
            providerExecuted: r4.z.boolean().optional(),
            callProviderMetadata: iJ.optional(),
            input: r4.z.unknown().optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            approval: r4.z.never().optional()
        }), r4.z.object({
            type: r4.z.string().startsWith("tool-"),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("input-available"),
            providerExecuted: r4.z.boolean().optional(),
            input: r4.z.unknown(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            approval: r4.z.never().optional()
        }), r4.z.object({
            type: r4.z.string().startsWith("tool-"),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("approval-requested"),
            input: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.never().optional(),
                reason: r4.z.never().optional()
            })
        }), r4.z.object({
            type: r4.z.string().startsWith("tool-"),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("approval-responded"),
            input: r4.z.unknown(),
            providerExecuted: r4.z.boolean().optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.boolean(),
                reason: r4.z.string().optional()
            })
        }), r4.z.object({
            type: r4.z.string().startsWith("tool-"),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("output-available"),
            providerExecuted: r4.z.boolean().optional(),
            input: r4.z.unknown(),
            output: r4.z.unknown(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            resultProviderMetadata: iJ.optional(),
            preliminary: r4.z.boolean().optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.literal(!0),
                reason: r4.z.string().optional()
            }).optional()
        }), r4.z.object({
            type: r4.z.string().startsWith("tool-"),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("output-error"),
            providerExecuted: r4.z.boolean().optional(),
            input: r4.z.unknown(),
            rawInput: r4.z.unknown().optional(),
            output: r4.z.never().optional(),
            errorText: r4.z.string(),
            callProviderMetadata: iJ.optional(),
            resultProviderMetadata: iJ.optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.literal(!0),
                reason: r4.z.string().optional()
            }).optional()
        }), r4.z.object({
            type: r4.z.string().startsWith("tool-"),
            toolCallId: r4.z.string(),
            toolMetadata: nv.optional(),
            state: r4.z.literal("output-denied"),
            providerExecuted: r4.z.boolean().optional(),
            input: r4.z.unknown(),
            output: r4.z.never().optional(),
            errorText: r4.z.never().optional(),
            callProviderMetadata: iJ.optional(),
            approval: r4.z.object({
                id: r4.z.string(),
                approved: r4.z.literal(!1),
                reason: r4.z.string().optional()
            })
        })])).nonempty("Message must contain at least one part")
    })).nonempty("Messages array must not be empty"))), t6({
        prefix: "aiobj",
        size: 24
    });
    var nb = class {
        constructor() {
            this.queue = [], this.isProcessing = !1
        }
        async processQueue() {
            if (!this.isProcessing) {
                for (this.isProcessing = !0; this.queue.length > 0;) await this.queue[0](), this.queue.shift();
                this.isProcessing = !1
            }
        }
        async run(e) {
            return new Promise((t, r) => {
                this.queue.push(async () => {
                    try {
                        await e(), t()
                    } catch (e) {
                        r(e)
                    }
                }), this.processQueue()
            })
        }
    };
    async function nk({
        stream: e,
        onTextPart: t
    }) {
        let r = e.pipeThrough(new TextDecoderStream).getReader();
        for (;;) {
            let {
                done: e,
                value: a
            } = await r.read();
            if (e) break;
            await t(a)
        }
    }
    async function nw({
        api: e,
        prompt: t,
        credentials: r,
        headers: a,
        body: i,
        streamProtocol: n = "data",
        setCompletion: s,
        setLoading: o,
        setError: l,
        setAbortController: c,
        onFinish: d,
        onError: u,
        fetch: m = fetch
    }) {
        var p;
        try {
            o(!0), l(void 0);
            let u = new AbortController;
            c(u), s("");
            let h = await m(e, {
                method: "POST",
                body: JSON.stringify({
                    prompt: t,
                    ...i
                }),
                credentials: r,
                headers: ri({
                    "Content-Type": "application/json",
                    ...a
                }, `ai-sdk/${iK}`, rr()),
                signal: u.signal
            }).catch(e => {
                throw e
            });
            if (!h.ok) throw Error(null != (p = await h.text()) ? p : "Failed to fetch the chat response.");
            if (!h.body) throw Error("The response body is empty.");
            let f = "";
            switch (n) {
                case "text":
                    await nk({
                        stream: h.body,
                        onTextPart: e => {
                            f += e, s(f)
                        }
                    });
                    break;
                case "data":
                    await ng({
                        stream: rY({
                            stream: h.body,
                            schema: np
                        }).pipeThrough(new TransformStream({
                            async transform(e) {
                                if (!e.success) throw e.error;
                                let t = e.value;
                                if ("text-delta" === t.type) f += t.delta, s(f);
                                else if ("error" === t.type) throw Error(t.errorText)
                            }
                        })),
                        onError: e => {
                            throw e
                        }
                    });
                    break;
                default:
                    throw Error(`Unknown stream protocol: ${n}`)
            }
            return d && d(t, f), c(null), f
        } catch (e) {
            if ("AbortError" === e.name) return c(null), null;
            e instanceof Error && u && u(e), l(e)
        } finally {
            o(!1)
        }
    }
    async function nS(e) {
        if (null == e) return [];
        if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw Error("FileList is not supported in the current environment");
        return Promise.all(Array.from(e).map(async e => {
            let {
                name: t,
                type: r
            } = e;
            return {
                type: "file",
                mediaType: r,
                filename: t,
                url: await new Promise((t, r) => {
                    let a = new FileReader;
                    a.onload = e => {
                        var r;
                        t(null == (r = e.target) ? void 0 : r.result)
                    }, a.onerror = e => r(e), a.readAsDataURL(e)
                })
            }
        }))
    }
    t6({
        prefix: "aiobj",
        size: 24
    }), ny(), Symbol.for("vercel.ai.error.AI_NoSuchProviderError"), ny();
    var nj = class {
            constructor({
                api: e = "/api/chat",
                credentials: t,
                headers: r,
                body: a,
                fetch: i,
                prepareSendMessagesRequest: n,
                prepareReconnectToStreamRequest: s
            }) {
                this.api = e, this.credentials = t, this.headers = r, this.body = a, this.fetch = i, this.prepareSendMessagesRequest = n, this.prepareReconnectToStreamRequest = s
            }
            async sendMessages({
                abortSignal: e,
                ...t
            }) {
                var r, a, i, n, s;
                let o = await r1(this.body),
                    l = await r1(this.headers),
                    c = await r1(this.credentials),
                    d = { ...ra(l),
                        ...ra(t.headers)
                    },
                    u = await (null == (r = this.prepareSendMessagesRequest) ? void 0 : r.call(this, {
                        api: this.api,
                        id: t.chatId,
                        messages: t.messages,
                        body: { ...o,
                            ...t.body
                        },
                        headers: d,
                        credentials: c,
                        requestMetadata: t.metadata,
                        trigger: t.trigger,
                        messageId: t.messageId
                    })),
                    m = null != (a = null == u ? void 0 : u.api) ? a : this.api,
                    p = (null == u ? void 0 : u.headers) !== void 0 ? ra(u.headers) : d,
                    h = (null == u ? void 0 : u.body) !== void 0 ? u.body : { ...o,
                        ...t.body,
                        id: t.chatId,
                        messages: t.messages,
                        trigger: t.trigger,
                        messageId: t.messageId
                    },
                    f = null != (i = null == u ? void 0 : u.credentials) ? i : c,
                    x = null != (n = this.fetch) ? n : globalThis.fetch,
                    g = await x(m, {
                        method: "POST",
                        headers: {
                            "Content-Type": "application/json",
                            ...p
                        },
                        body: JSON.stringify(h),
                        credentials: f,
                        signal: e
                    });
                if (!g.ok) throw Error(null != (s = await g.text()) ? s : "Failed to fetch the chat response.");
                if (!g.body) throw Error("The response body is empty.");
                return this.processResponseStream(g.body)
            }
            async reconnectToStream(e) {
                var t, r, a, i, n;
                let s = await r1(this.body),
                    o = await r1(this.headers),
                    l = await r1(this.credentials),
                    c = { ...ra(o),
                        ...ra(e.headers)
                    },
                    d = await (null == (t = this.prepareReconnectToStreamRequest) ? void 0 : t.call(this, {
                        api: this.api,
                        id: e.chatId,
                        body: { ...s,
                            ...e.body
                        },
                        headers: c,
                        credentials: l,
                        requestMetadata: e.metadata
                    })),
                    u = null != (r = null == d ? void 0 : d.api) ? r : `${this.api}/${e.chatId}/stream`,
                    m = (null == d ? void 0 : d.headers) !== void 0 ? ra(d.headers) : c,
                    p = null != (a = null == d ? void 0 : d.credentials) ? a : l,
                    h = null != (i = this.fetch) ? i : globalThis.fetch,
                    f = await h(u, {
                        method: "GET",
                        headers: m,
                        credentials: p
                    });
                if (204 === f.status) return null;
                if (!f.ok) throw Error(null != (n = await f.text()) ? n : "Failed to fetch the chat response.");
                if (!f.body) throw Error("The response body is empty.");
                return this.processResponseStream(f.body)
            }
        },
        nC = class extends nj {
            constructor(e = {}) {
                super(e)
            }
            processResponseStream(e) {
                return rY({
                    stream: e,
                    schema: np
                }).pipeThrough(new TransformStream({
                    async transform(e, t) {
                        if (!e.success) throw e.error;
                        t.enqueue(e.value)
                    }
                }))
            }
        },
        n_ = class {
            constructor({
                generateId: e = t9,
                id: t = e(),
                transport: r = new nC,
                messageMetadataSchema: a,
                dataPartSchemas: i,
                state: n,
                onError: s,
                onToolCall: o,
                onFinish: l,
                onData: c,
                sendAutomaticallyWhen: d
            }) {
                this.activeResponse = void 0, this.jobExecutor = new nb, this.sendMessage = async (e, t) => {
                    var r, a, i, n;
                    let s;
                    if (null == e) return void await this.makeRequest({
                        trigger: "submit-message",
                        messageId: null == (r = this.lastMessage) ? void 0 : r.id,
                        ...t
                    });
                    if (s = "text" in e || "files" in e ? {
                            parts: [...Array.isArray(e.files) ? e.files : await nS(e.files), ..."text" in e && null != e.text ? [{
                                type: "text",
                                text: e.text
                            }] : []]
                        } : e, null != e.messageId) {
                        let t = this.state.messages.findIndex(t => t.id === e.messageId);
                        if (-1 === t) throw Error(`message with id ${e.messageId} not found`);
                        if ("user" !== this.state.messages[t].role) throw Error(`message with id ${e.messageId} is not a user message`);
                        this.state.messages = this.state.messages.slice(0, t + 1), this.state.replaceMessage(t, { ...s,
                            id: e.messageId,
                            role: null != (a = s.role) ? a : "user",
                            metadata: e.metadata
                        })
                    } else this.state.pushMessage({ ...s,
                        id: null != (i = s.id) ? i : this.generateId(),
                        role: null != (n = s.role) ? n : "user",
                        metadata: e.metadata
                    });
                    await this.makeRequest({
                        trigger: "submit-message",
                        messageId: e.messageId,
                        ...t
                    })
                }, this.regenerate = async ({
                    messageId: e,
                    ...t
                } = {}) => {
                    let r = null == e ? this.state.messages.length - 1 : this.state.messages.findIndex(t => t.id === e);
                    if (-1 === r) throw Error(`message ${e} not found`);
                    this.state.messages = this.state.messages.slice(0, "assistant" === this.messages[r].role ? r : r + 1), await this.makeRequest({
                        trigger: "regenerate-message",
                        messageId: e,
                        ...t
                    })
                }, this.resumeStream = async (e = {}) => {
                    await this.makeRequest({
                        trigger: "resume-stream",
                        ...e
                    })
                }, this.clearError = () => {
                    "error" === this.status && (this.state.error = void 0, this.setStatus({
                        status: "ready"
                    }))
                }, this.addToolApprovalResponse = async ({
                    id: e,
                    approved: t,
                    reason: r,
                    options: a
                }) => this.jobExecutor.run(async () => {
                    let i = this.state.messages,
                        n = i[i.length - 1],
                        s = a => nf(a) && "approval-requested" === a.state && a.approval.id === e ? { ...a,
                            state: "approval-responded",
                            approval: {
                                id: e,
                                approved: t,
                                reason: r
                            }
                        } : a;
                    this.state.replaceMessage(i.length - 1, { ...n,
                        parts: n.parts.map(s)
                    }), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(s)), "streaming" !== this.status && "submitted" !== this.status && this.sendAutomaticallyWhen && this.shouldSendAutomatically().then(e => {
                        var t;
                        e && this.makeRequest({
                            trigger: "submit-message",
                            messageId: null == (t = this.lastMessage) ? void 0 : t.id,
                            ...a
                        })
                    })
                }), this.addToolOutput = async ({
                    state: e = "output-available",
                    toolCallId: t,
                    output: r,
                    errorText: a,
                    options: i
                }) => this.jobExecutor.run(async () => {
                    let n = this.state.messages,
                        s = n[n.length - 1],
                        o = i => nf(i) && i.toolCallId === t ? { ...i,
                            state: e,
                            output: r,
                            errorText: a
                        } : i;
                    this.state.replaceMessage(n.length - 1, { ...s,
                        parts: s.parts.map(o)
                    }), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(o)), "streaming" !== this.status && "submitted" !== this.status && this.sendAutomaticallyWhen && this.shouldSendAutomatically().then(e => {
                        var t;
                        e && this.makeRequest({
                            trigger: "submit-message",
                            messageId: null == (t = this.lastMessage) ? void 0 : t.id,
                            ...i
                        })
                    })
                }), this.addToolResult = this.addToolOutput, this.stop = async () => {
                    var e;
                    ("streaming" === this.status || "submitted" === this.status) && (null == (e = this.activeResponse) ? void 0 : e.abortController) && this.activeResponse.abortController.abort()
                }, this.id = t, this.transport = r, this.generateId = e, this.messageMetadataSchema = a, this.dataPartSchemas = i, this.state = n, this.onError = s, this.onToolCall = o, this.onFinish = l, this.onData = c, this.sendAutomaticallyWhen = d
            }
            get status() {
                return this.state.status
            }
            setStatus({
                status: e,
                error: t
            }) {
                this.status !== e && (this.state.status = e, this.state.error = t)
            }
            get error() {
                return this.state.error
            }
            get messages() {
                return this.state.messages
            }
            get lastMessage() {
                return this.state.messages[this.state.messages.length - 1]
            }
            set messages(e) {
                this.state.messages = e
            }
            async shouldSendAutomatically() {
                if (!this.sendAutomaticallyWhen) return !1;
                let e = this.sendAutomaticallyWhen({
                    messages: this.state.messages
                });
                return e && "object" == typeof e && "then" in e ? await e : e
            }
            async makeRequest({
                trigger: e,
                metadata: t,
                headers: r,
                body: a,
                messageId: i
            }) {
                var n, s, o;
                let l;
                if ("resume-stream" === e) try {
                    let e = await this.transport.reconnectToStream({
                        chatId: this.id,
                        metadata: t,
                        headers: r,
                        body: a
                    });
                    if (null == e) return;
                    l = e
                } catch (e) {
                    this.onError && e instanceof Error && this.onError(e), this.setStatus({
                        status: "error",
                        error: e
                    });
                    return
                }
                this.setStatus({
                    status: "submitted",
                    error: void 0
                });
                let c = this.lastMessage,
                    d = !1,
                    u = !1,
                    m = !1;
                try {
                    let n, s = {
                        state: function({
                            lastMessage: e,
                            messageId: t
                        }) {
                            return {
                                message: (null == e ? void 0 : e.role) === "assistant" ? e : {
                                    id: t,
                                    metadata: void 0,
                                    role: "assistant",
                                    parts: []
                                },
                                activeTextParts: {},
                                activeReasoningParts: {},
                                partialToolCalls: {}
                            }
                        }({
                            lastMessage: this.state.snapshot(c),
                            messageId: this.generateId()
                        }),
                        abortController: new AbortController
                    };
                    s.abortController.signal.addEventListener("abort", () => {
                        d = !0
                    }), this.activeResponse = s, n = "resume-stream" === e ? l : await this.transport.sendMessages({
                        chatId: this.id,
                        messages: this.state.messages,
                        abortSignal: s.abortController.signal,
                        metadata: t,
                        headers: r,
                        body: a,
                        trigger: e,
                        messageId: i
                    });
                    let o = e => this.jobExecutor.run(() => e({
                        state: s.state,
                        write: () => {
                            var e;
                            this.setStatus({
                                status: "streaming"
                            }), s.state.message.id === (null == (e = this.lastMessage) ? void 0 : e.id) ? this.state.replaceMessage(this.state.messages.length - 1, s.state.message) : this.state.pushMessage(s.state.message)
                        }
                    }));
                    await ng({
                        stream: function({
                            stream: e,
                            messageMetadataSchema: t,
                            dataPartSchemas: r,
                            runUpdateMessageJob: a,
                            onError: i,
                            onToolCall: n,
                            onData: s
                        }) {
                            return e.pipeThrough(new TransformStream({
                                async transform(e, o) {
                                    await a(async ({
                                        state: a,
                                        write: l
                                    }) => {
                                        var c, d, u, m;

                                        function p(e) {
                                            let t = a.message.parts.filter(nf).find(t => t.toolCallId === e);
                                            if (null == t) throw new iZ({
                                                chunkType: "tool-invocation",
                                                chunkId: e,
                                                message: `No tool invocation found for tool call ID "${e}".`
                                            });
                                            return t
                                        }

                                        function h(e) {
                                            var t;
                                            let r = a.message.parts.find(t => nh(t) && t.toolCallId === e.toolCallId);
                                            if (null != r) {
                                                r.state = e.state, r.input = e.input, r.output = e.output, r.errorText = e.errorText, r.rawInput = e.rawInput, r.preliminary = e.preliminary, void 0 !== e.title && (r.title = e.title), void 0 !== e.toolMetadata && (r.toolMetadata = e.toolMetadata), r.providerExecuted = null != (t = e.providerExecuted) ? t : r.providerExecuted;
                                                let a = e.providerMetadata;
                                                null != a && ("output-available" === e.state || "output-error" === e.state ? r.resultProviderMetadata = a : r.callProviderMetadata = a)
                                            } else a.message.parts.push({
                                                type: `tool-${e.toolName}`,
                                                toolCallId: e.toolCallId,
                                                state: e.state,
                                                title: e.title,
                                                ...void 0 !== e.toolMetadata ? {
                                                    toolMetadata: e.toolMetadata
                                                } : {},
                                                input: e.input,
                                                output: e.output,
                                                rawInput: e.rawInput,
                                                errorText: e.errorText,
                                                providerExecuted: e.providerExecuted,
                                                preliminary: e.preliminary,
                                                ...null != e.providerMetadata && ("output-available" === e.state || "output-error" === e.state) ? {
                                                    resultProviderMetadata: e.providerMetadata
                                                } : {},
                                                ...null != e.providerMetadata && "output-available" !== e.state && "output-error" !== e.state ? {
                                                    callProviderMetadata: e.providerMetadata
                                                } : {}
                                            })
                                        }

                                        function f(e) {
                                            var t, r;
                                            let i = a.message.parts.find(t => "dynamic-tool" === t.type && t.toolCallId === e.toolCallId);
                                            if (null != i) {
                                                i.state = e.state, i.toolName = e.toolName, i.input = e.input, i.output = e.output, i.errorText = e.errorText, i.rawInput = null != (t = e.rawInput) ? t : i.rawInput, i.preliminary = e.preliminary, void 0 !== e.title && (i.title = e.title), void 0 !== e.toolMetadata && (i.toolMetadata = e.toolMetadata), i.providerExecuted = null != (r = e.providerExecuted) ? r : i.providerExecuted;
                                                let a = e.providerMetadata;
                                                null != a && ("output-available" === e.state || "output-error" === e.state ? i.resultProviderMetadata = a : i.callProviderMetadata = a)
                                            } else a.message.parts.push({
                                                type: "dynamic-tool",
                                                toolName: e.toolName,
                                                toolCallId: e.toolCallId,
                                                state: e.state,
                                                input: e.input,
                                                output: e.output,
                                                errorText: e.errorText,
                                                preliminary: e.preliminary,
                                                providerExecuted: e.providerExecuted,
                                                title: e.title,
                                                ...void 0 !== e.toolMetadata ? {
                                                    toolMetadata: e.toolMetadata
                                                } : {},
                                                ...null != e.providerMetadata && ("output-available" === e.state || "output-error" === e.state) ? {
                                                    resultProviderMetadata: e.providerMetadata
                                                } : {},
                                                ...null != e.providerMetadata && "output-available" !== e.state && "output-error" !== e.state ? {
                                                    callProviderMetadata: e.providerMetadata
                                                } : {}
                                            })
                                        }
                                        async function x(e) {
                                            if (null != e) {
                                                let r = null != a.message.metadata ? function e(t, r) {
                                                    if (void 0 === t && void 0 === r) return;
                                                    if (void 0 === t) return r;
                                                    if (void 0 === r) return t;
                                                    let a = { ...t
                                                    };
                                                    for (let i in r)
                                                        if ("__proto__" !== i && "constructor" !== i && "prototype" !== i && Object.prototype.hasOwnProperty.call(r, i)) {
                                                            let n = r[i];
                                                            if (void 0 === n) continue;
                                                            let s = i in t ? t[i] : void 0,
                                                                o = null !== n && "object" == typeof n && !Array.isArray(n) && !(n instanceof Date) && !(n instanceof RegExp),
                                                                l = null != s && "object" == typeof s && !Array.isArray(s) && !(s instanceof Date) && !(s instanceof RegExp);
                                                            o && l ? a[i] = e(s, n) : a[i] = n
                                                        }
                                                    return a
                                                }(a.message.metadata, e) : e;
                                                null != t && await rW({
                                                    value: r,
                                                    schema: t,
                                                    context: {
                                                        field: "message.metadata",
                                                        entityId: a.message.id
                                                    }
                                                }), a.message.metadata = r
                                            }
                                        }
                                        switch (e.type) {
                                            case "text-start":
                                                {
                                                    let t = {
                                                        type: "text",
                                                        text: "",
                                                        providerMetadata: e.providerMetadata,
                                                        state: "streaming"
                                                    };a.activeTextParts[e.id] = t,
                                                    a.message.parts.push(t),
                                                    l();
                                                    break
                                                }
                                            case "text-delta":
                                                {
                                                    let t = a.activeTextParts[e.id];
                                                    if (null == t) throw new iZ({
                                                        chunkType: "text-delta",
                                                        chunkId: e.id,
                                                        message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
                                                    });t.text += e.delta,
                                                    t.providerMetadata = null != (c = e.providerMetadata) ? c : t.providerMetadata,
                                                    l();
                                                    break
                                                }
                                            case "text-end":
                                                {
                                                    let t = a.activeTextParts[e.id];
                                                    if (null == t) throw new iZ({
                                                        chunkType: "text-end",
                                                        chunkId: e.id,
                                                        message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
                                                    });t.state = "done",
                                                    t.providerMetadata = null != (d = e.providerMetadata) ? d : t.providerMetadata,
                                                    delete a.activeTextParts[e.id],
                                                    l();
                                                    break
                                                }
                                            case "reasoning-start":
                                                {
                                                    let t = {
                                                        type: "reasoning",
                                                        text: "",
                                                        providerMetadata: e.providerMetadata,
                                                        state: "streaming"
                                                    };a.activeReasoningParts[e.id] = t,
                                                    a.message.parts.push(t),
                                                    l();
                                                    break
                                                }
                                            case "reasoning-delta":
                                                {
                                                    let t = a.activeReasoningParts[e.id];
                                                    if (null == t) throw new iZ({
                                                        chunkType: "reasoning-delta",
                                                        chunkId: e.id,
                                                        message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
                                                    });t.text += e.delta,
                                                    t.providerMetadata = null != (u = e.providerMetadata) ? u : t.providerMetadata,
                                                    l();
                                                    break
                                                }
                                            case "reasoning-end":
                                                {
                                                    let t = a.activeReasoningParts[e.id];
                                                    if (null == t) throw new iZ({
                                                        chunkType: "reasoning-end",
                                                        chunkId: e.id,
                                                        message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
                                                    });t.providerMetadata = null != (m = e.providerMetadata) ? m : t.providerMetadata,
                                                    t.state = "done",
                                                    delete a.activeReasoningParts[e.id],
                                                    l();
                                                    break
                                                }
                                            case "file":
                                                a.message.parts.push({
                                                    type: "file",
                                                    mediaType: e.mediaType,
                                                    url: e.url,
                                                    ...null != e.providerMetadata ? {
                                                        providerMetadata: e.providerMetadata
                                                    } : {}
                                                }), l();
                                                break;
                                            case "source-url":
                                                a.message.parts.push({
                                                    type: "source-url",
                                                    sourceId: e.sourceId,
                                                    url: e.url,
                                                    title: e.title,
                                                    providerMetadata: e.providerMetadata
                                                }), l();
                                                break;
                                            case "source-document":
                                                a.message.parts.push({
                                                    type: "source-document",
                                                    sourceId: e.sourceId,
                                                    mediaType: e.mediaType,
                                                    title: e.title,
                                                    filename: e.filename,
                                                    providerMetadata: e.providerMetadata
                                                }), l();
                                                break;
                                            case "tool-input-start":
                                                {
                                                    let t = a.message.parts.filter(nh);a.partialToolCalls[e.toolCallId] = {
                                                        text: "",
                                                        toolName: e.toolName,
                                                        index: t.length,
                                                        dynamic: e.dynamic,
                                                        title: e.title,
                                                        toolMetadata: e.toolMetadata
                                                    },
                                                    e.dynamic ? f({
                                                        toolCallId: e.toolCallId,
                                                        toolName: e.toolName,
                                                        state: "input-streaming",
                                                        input: void 0,
                                                        providerExecuted: e.providerExecuted,
                                                        title: e.title,
                                                        toolMetadata: e.toolMetadata,
                                                        providerMetadata: e.providerMetadata
                                                    }) : h({
                                                        toolCallId: e.toolCallId,
                                                        toolName: e.toolName,
                                                        state: "input-streaming",
                                                        input: void 0,
                                                        providerExecuted: e.providerExecuted,
                                                        title: e.title,
                                                        toolMetadata: e.toolMetadata,
                                                        providerMetadata: e.providerMetadata
                                                    }),
                                                    l();
                                                    break
                                                }
                                            case "tool-input-delta":
                                                {
                                                    let t = a.partialToolCalls[e.toolCallId];
                                                    if (null == t) throw new iZ({
                                                        chunkType: "tool-input-delta",
                                                        chunkId: e.toolCallId,
                                                        message: `Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
                                                    });t.text += e.inputTextDelta;
                                                    let {
                                                        value: r
                                                    } = await ns(t.text);t.dynamic ? f({
                                                        toolCallId: e.toolCallId,
                                                        toolName: t.toolName,
                                                        state: "input-streaming",
                                                        input: r,
                                                        title: t.title,
                                                        toolMetadata: t.toolMetadata
                                                    }) : h({
                                                        toolCallId: e.toolCallId,
                                                        toolName: t.toolName,
                                                        state: "input-streaming",
                                                        input: r,
                                                        title: t.title,
                                                        toolMetadata: t.toolMetadata
                                                    }),
                                                    l();
                                                    break
                                                }
                                            case "tool-input-available":
                                                e.dynamic ? f({
                                                    toolCallId: e.toolCallId,
                                                    toolName: e.toolName,
                                                    state: "input-available",
                                                    input: e.input,
                                                    providerExecuted: e.providerExecuted,
                                                    providerMetadata: e.providerMetadata,
                                                    title: e.title,
                                                    toolMetadata: e.toolMetadata
                                                }) : h({
                                                    toolCallId: e.toolCallId,
                                                    toolName: e.toolName,
                                                    state: "input-available",
                                                    input: e.input,
                                                    providerExecuted: e.providerExecuted,
                                                    providerMetadata: e.providerMetadata,
                                                    title: e.title,
                                                    toolMetadata: e.toolMetadata
                                                }), l(), n && !e.providerExecuted && await n({
                                                    toolCall: e
                                                });
                                                break;
                                            case "tool-input-error":
                                                {
                                                    let t = a.message.parts.filter(nf).find(t => t.toolCallId === e.toolCallId);
                                                    (null != t ? "dynamic-tool" === t.type : e.dynamic) ? f({
                                                        toolCallId: e.toolCallId,
                                                        toolName: e.toolName,
                                                        state: "output-error",
                                                        input: e.input,
                                                        errorText: e.errorText,
                                                        providerExecuted: e.providerExecuted,
                                                        providerMetadata: e.providerMetadata,
                                                        toolMetadata: e.toolMetadata
                                                    }) : h({
                                                        toolCallId: e.toolCallId,
                                                        toolName: e.toolName,
                                                        state: "output-error",
                                                        input: void 0,
                                                        rawInput: e.input,
                                                        errorText: e.errorText,
                                                        providerExecuted: e.providerExecuted,
                                                        providerMetadata: e.providerMetadata,
                                                        toolMetadata: e.toolMetadata
                                                    }),
                                                    l();
                                                    break
                                                }
                                            case "tool-approval-request":
                                                {
                                                    let t = p(e.toolCallId);t.state = "approval-requested",
                                                    t.approval = {
                                                        id: e.approvalId
                                                    },
                                                    l();
                                                    break
                                                }
                                            case "tool-output-denied":
                                                p(e.toolCallId).state = "output-denied", l();
                                                break;
                                            case "tool-output-available":
                                                {
                                                    let t = p(e.toolCallId);
                                                    "dynamic-tool" === t.type ? f({
                                                        toolCallId: e.toolCallId,
                                                        toolName: t.toolName,
                                                        state: "output-available",
                                                        input: t.input,
                                                        output: e.output,
                                                        preliminary: e.preliminary,
                                                        providerExecuted: e.providerExecuted,
                                                        providerMetadata: e.providerMetadata,
                                                        title: t.title,
                                                        toolMetadata: t.toolMetadata
                                                    }) : h({
                                                        toolCallId: e.toolCallId,
                                                        toolName: nx(t),
                                                        state: "output-available",
                                                        input: t.input,
                                                        output: e.output,
                                                        providerExecuted: e.providerExecuted,
                                                        preliminary: e.preliminary,
                                                        providerMetadata: e.providerMetadata,
                                                        title: t.title,
                                                        toolMetadata: t.toolMetadata
                                                    }),
                                                    l();
                                                    break
                                                }
                                            case "tool-output-error":
                                                {
                                                    let t = p(e.toolCallId);
                                                    "dynamic-tool" === t.type ? f({
                                                        toolCallId: e.toolCallId,
                                                        toolName: t.toolName,
                                                        state: "output-error",
                                                        input: t.input,
                                                        errorText: e.errorText,
                                                        providerExecuted: e.providerExecuted,
                                                        providerMetadata: e.providerMetadata,
                                                        title: t.title,
                                                        toolMetadata: t.toolMetadata
                                                    }) : h({
                                                        toolCallId: e.toolCallId,
                                                        toolName: nx(t),
                                                        state: "output-error",
                                                        input: t.input,
                                                        rawInput: t.rawInput,
                                                        errorText: e.errorText,
                                                        providerExecuted: e.providerExecuted,
                                                        providerMetadata: e.providerMetadata,
                                                        title: t.title,
                                                        toolMetadata: t.toolMetadata
                                                    }),
                                                    l();
                                                    break
                                                }
                                            case "start-step":
                                                a.message.parts.push({
                                                    type: "step-start"
                                                });
                                                break;
                                            case "finish-step":
                                                a.activeTextParts = {}, a.activeReasoningParts = {};
                                                break;
                                            case "start":
                                                null != e.messageId && (a.message.id = e.messageId), await x(e.messageMetadata), (null != e.messageId || null != e.messageMetadata) && l();
                                                break;
                                            case "finish":
                                                null != e.finishReason && (a.finishReason = e.finishReason), await x(e.messageMetadata), null != e.messageMetadata && l();
                                                break;
                                            case "message-metadata":
                                                await x(e.messageMetadata), null != e.messageMetadata && l();
                                                break;
                                            case "error":
                                                null == i || i(Error(e.errorText));
                                                break;
                                            default:
                                                if (e.type.startsWith("data-")) {
                                                    if ((null == r ? void 0 : r[e.type]) != null) {
                                                        let t = a.message.parts.findIndex(t => "id" in t && "data" in t && t.id === e.id && t.type === e.type),
                                                            i = t >= 0 ? t : a.message.parts.length;
                                                        await rW({
                                                            value: e.data,
                                                            schema: r[e.type],
                                                            context: {
                                                                field: `message.parts[${i}].data`,
                                                                entityName: e.type,
                                                                entityId: e.id
                                                            }
                                                        })
                                                    }
                                                    if (e.transient) {
                                                        null == s || s(e);
                                                        break
                                                    }
                                                    let t = null != e.id ? a.message.parts.find(t => e.type === t.type && e.id === t.id) : void 0;
                                                    null != t ? t.data = e.data : a.message.parts.push(e), null == s || s(e), l()
                                                }
                                        }
                                        o.enqueue(e)
                                    })
                                }
                            }))
                        }({
                            stream: n,
                            onToolCall: this.onToolCall,
                            onData: this.onData,
                            messageMetadataSchema: this.messageMetadataSchema,
                            dataPartSchemas: this.dataPartSchemas,
                            runUpdateMessageJob: o,
                            onError: e => {
                                throw e
                            }
                        }),
                        onError: e => {
                            throw e
                        }
                    }), this.setStatus({
                        status: "ready"
                    })
                } catch (e) {
                    if (d || "AbortError" === e.name) return d = !0, this.setStatus({
                        status: "ready"
                    }), null;
                    m = !0, e instanceof TypeError && (e.message.toLowerCase().includes("fetch") || e.message.toLowerCase().includes("network")) && (u = !0), this.onError && e instanceof Error && this.onError(e), this.setStatus({
                        status: "error",
                        error: e
                    })
                } finally {
                    try {
                        null == (s = this.onFinish) || s.call(this, {
                            message: this.activeResponse.state.message,
                            messages: this.state.messages,
                            isAbort: d,
                            isDisconnect: u,
                            isError: m,
                            finishReason: null == (n = this.activeResponse) ? void 0 : n.state.finishReason
                        })
                    } catch (e) {
                        console.error(e)
                    }
                    this.activeResponse = void 0
                }!m && await this.shouldSendAutomatically() && await this.makeRequest({
                    trigger: "submit-message",
                    messageId: null == (o = this.lastMessage) ? void 0 : o.id,
                    metadata: t,
                    headers: r,
                    body: a
                })
            }
        },
        nT = class extends nj {
            constructor(e = {}) {
                super(e)
            }
            processResponseStream(e) {
                return function({
                    stream: e
                }) {
                    return e.pipeThrough(new TransformStream({
                        start(e) {
                            e.enqueue({
                                type: "start"
                            }), e.enqueue({
                                type: "start-step"
                            }), e.enqueue({
                                type: "text-start",
                                id: "text-1"
                            })
                        },
                        async transform(e, t) {
                            t.enqueue({
                                type: "text-delta",
                                id: "text-1",
                                delta: e
                            })
                        },
                        async flush(e) {
                            e.enqueue({
                                type: "text-end",
                                id: "text-1"
                            }), e.enqueue({
                                type: "finish-step"
                            }), e.enqueue({
                                type: "finish"
                            })
                        }
                    }))
                }({
                    stream: e.pipeThrough(new TextDecoderStream)
                })
            }
        };
    e.s(["AbstractChat", 0, n_, "TextStreamChatTransport", 0, nT, "callCompletionApi", 0, nw, "isDeepEqualData", 0, function e(t, r) {
        if (t === r) return !0;
        if (null == t || null == r) return !1;
        if ("object" != typeof t && "object" != typeof r) return t === r;
        if (t.constructor !== r.constructor) return !1;
        if (t instanceof Date && r instanceof Date) return t.getTime() === r.getTime();
        if (Array.isArray(t)) {
            if (t.length !== r.length) return !1;
            for (let a = 0; a < t.length; a++)
                if (!e(t[a], r[a])) return !1;
            return !0
        }
        let a = Object.keys(t),
            i = Object.keys(r);
        if (a.length !== i.length) return !1;
        for (let n of a)
            if (!i.includes(n) || !e(t[n], r[n])) return !1;
        return !0
    }, "parsePartialJson", 0, ns], 840420);
    var nM = e.i(282728),
        nN = e.i(999977);
    e.s(["ERROR_REVALIDATE_EVENT", 0, 3, "FOCUS_EVENT", 0, 0, "MUTATE_EVENT", 0, 2, "RECONNECT_EVENT", 0, 1], 606914);
    var nI = Object.prototype.hasOwnProperty;
    let nP = new WeakMap,
        nE = () => {},
        nA = nE(),
        nO = Object,
        nD = e => e === nA,
        nL = (e, t) => ({ ...e,
            ...t
        }),
        nz = {},
        nR = {},
        nF = "undefined",
        n$ = typeof window != nF,
        nB = typeof document != nF,
        nq = n$ && "Deno" in window,
        nV = (e, t) => {
            let r = nP.get(e);
            return [() => !nD(t) && e.get(t) || nz, a => {
                if (!nD(t)) {
                    let i = e.get(t);
                    t in nR || (nR[t] = i), r[5](t, nL(i, a), i || nz)
                }
            }, r[6], () => !nD(t) && t in nR ? nR[t] : !nD(t) && e.get(t) || nz]
        },
        nH = !0,
        [nU, nW] = n$ && window.addEventListener ? [window.addEventListener.bind(window), window.removeEventListener.bind(window)] : [nE, nE],
        nG = {
            initFocus: e => (nB && document.addEventListener("visibilitychange", e), nU("focus", e), () => {
                nB && document.removeEventListener("visibilitychange", e), nW("focus", e)
            }),
            initReconnect: e => {
                let t = () => {
                        nH = !0, e()
                    },
                    r = () => {
                        nH = !1
                    };
                return nU("online", t), nU("offline", r), () => {
                    nW("online", t), nW("offline", r)
                }
            }
        },
        nZ = !ea.default.useId,
        nK = !n$ || nq,
        nY = nK ? ea.useEffect : ea.useLayoutEffect,
        nQ = "u" > typeof navigator && navigator.connection,
        nX = !nK && nQ && (["slow-2g", "2g"].includes(nQ.effectiveType) || nQ.saveData),
        nJ = new WeakMap,
        n0 = (e, t) => e === `[object ${t}]`,
        n1 = 0,
        n2 = e => {
            let t, r, a = typeof e,
                i = nO.prototype.toString.call(e),
                n = n0(i, "Date"),
                s = n0(i, "RegExp"),
                o = n0(i, "Object");
            if (nO(e) !== e || n || s) t = n ? e.toJSON() : "symbol" == a ? e.toString() : "string" == a ? JSON.stringify(e) : "" + e;
            else {
                if (t = nJ.get(e)) return t;
                if (t = ++n1 + "~", nJ.set(e, t), Array.isArray(e)) {
                    for (r = 0, t = "@"; r < e.length; r++) t += n2(e[r]) + ",";
                    nJ.set(e, t)
                }
                if (o) {
                    t = "#";
                    let a = nO.keys(e).sort();
                    for (; !nD(r = a.pop());) nD(e[r]) || (t += r + ":" + n2(e[r]) + ",");
                    nJ.set(e, t)
                }
            }
            return t
        },
        n3 = e => {
            if ("function" == typeof e) try {
                e = e()
            } catch (t) {
                e = ""
            }
            let t = e;
            return [e = "string" == typeof e ? e : (Array.isArray(e) ? e.length : e) ? n2(e) : "", t]
        },
        n4 = 0,
        n5 = () => ++n4;
    async function n6(...e) {
        let [t, r, a, i] = e, n = nL({
            populateCache: !0,
            throwOnError: !0
        }, "boolean" == typeof i ? {
            revalidate: i
        } : i || {}), s = n.populateCache, o = n.rollbackOnError, l = n.optimisticData, c = n.throwOnError;
        if ("function" == typeof r) {
            let e = [];
            for (let a of t.keys()) !/^\$(inf|sub)\$/.test(a) && r(t.get(a)._k) && e.push(a);
            return Promise.all(e.map(d))
        }
        return d(r);
        async function d(r) {
            let i, [d] = n3(r);
            if (!d) return;
            let [u, m] = nV(t, d), [p, h, f, x] = nP.get(t), g = () => {
                let e = p[d];
                return ("function" == typeof n.revalidate ? n.revalidate(u().data, r) : !1 !== n.revalidate) && (delete f[d], delete x[d], e && e[0]) ? e[0](2).then(() => u().data) : u().data
            };
            if (e.length < 3) return g();
            let v = a,
                y = !1,
                b = n5();
            h[d] = [b, 0];
            let k = !nD(l),
                w = u(),
                S = w.data,
                j = w._c,
                C = nD(j) ? S : j;
            if (k && m({
                    data: l = "function" == typeof l ? l(C, S) : l,
                    _c: C
                }), "function" == typeof v) try {
                v = v(C)
            } catch (e) {
                i = e, y = !0
            }
            if (v && "function" == typeof v.then) {
                let e;
                if (v = await v.catch(e => {
                        i = e, y = !0
                    }), b !== h[d][0]) {
                    if (y) throw i;
                    return v
                }
                y && k && (e = i, "function" == typeof o ? o(e) : !1 !== o) && (s = !0, m({
                    data: C,
                    _c: nA
                }))
            }
            if (s && !y && ("function" == typeof s ? m({
                    data: s(v, C),
                    error: nA,
                    _c: nA
                }) : m({
                    data: v,
                    error: nA,
                    _c: nA
                })), h[d][1] = n5(), Promise.resolve(g()).then(() => {
                    m({
                        _c: nA
                    })
                }), y) {
                if (c) throw i;
                return
            }
            return v
        }
    }
    let n9 = (e, t) => {
            for (let r in e) e[r][0] && e[r][0](t)
        },
        n8 = (e, t) => {
            if (!nP.has(e)) {
                let r = nL(nG, t),
                    a = Object.create(null),
                    i = n6.bind(nA, e),
                    n = nE,
                    s = Object.create(null),
                    o = (e, t) => {
                        let r = s[e] || [];
                        return s[e] = r, r.push(t), () => r.splice(r.indexOf(t), 1)
                    },
                    l = (t, r, a) => {
                        e.set(t, r);
                        let i = s[t];
                        if (i)
                            for (let e of i) e(r, a)
                    },
                    c = () => {
                        if (!nP.has(e) && (nP.set(e, [a, Object.create(null), Object.create(null), Object.create(null), i, l, o]), !nK)) {
                            let t = r.initFocus(setTimeout.bind(nA, n9.bind(nA, a, 0))),
                                i = r.initReconnect(setTimeout.bind(nA, n9.bind(nA, a, 1)));
                            n = () => {
                                t && t(), i && i(), nP.delete(e)
                            }
                        }
                    };
                return c(), [e, i, c, n]
            }
            return [e, nP.get(e)[4]]
        },
        [n7, se] = n8(new Map),
        st = nL({
            onLoadingSlow: nE,
            onSuccess: nE,
            onError: nE,
            onErrorRetry: (e, t, r, a, i) => {
                let n = r.errorRetryCount,
                    s = i.retryCount,
                    o = ~~((Math.random() + .5) * (1 << (s < 8 ? s : 8))) * r.errorRetryInterval;
                (nD(n) || !(s > n)) && setTimeout(a, o, i)
            },
            onDiscarded: nE,
            revalidateOnFocus: !0,
            revalidateOnReconnect: !0,
            revalidateIfStale: !0,
            shouldRetryOnError: !0,
            errorRetryInterval: nX ? 1e4 : 5e3,
            focusThrottleInterval: 5e3,
            dedupingInterval: 2e3,
            loadingTimeout: nX ? 5e3 : 3e3,
            compare: function e(t, r) {
                var a, i;
                if (t === r) return !0;
                if (t && r && (a = t.constructor) === r.constructor) {
                    if (a === Date) return t.getTime() === r.getTime();
                    if (a === RegExp) return t.toString() === r.toString();
                    if (a === Array) {
                        if ((i = t.length) === r.length)
                            for (; i-- && e(t[i], r[i]););
                        return -1 === i
                    }
                    if (!a || "object" == typeof t) {
                        for (a in i = 0, t)
                            if (nI.call(t, a) && ++i && !nI.call(r, a) || !(a in r) || !e(t[a], r[a])) return !1;
                        return Object.keys(r).length === i
                    }
                }
                return t != t && r != r
            },
            isPaused: () => !1,
            cache: n7,
            mutate: se,
            fallback: {}
        }, {
            isOnline: () => nH,
            isVisible: () => {
                let e = nB && document.visibilityState;
                return nD(e) || "hidden" !== e
            }
        }),
        sr = (0, ea.createContext)({});
    e.i(606914);
    let sa = n$ && window.__SWR_DEVTOOLS_USE__;
    (sa ? window.__SWR_DEVTOOLS_USE__ : []).concat(e => (t, r, a) => {
        let i = r && ((...e) => {
            let [a] = n3(t), [, , , i] = nP.get(n7);
            if (a.startsWith("$inf$")) return r(...e);
            let n = i[a];
            return nD(n) ? r(...e) : (delete i[a], n)
        });
        return e(t, i, a)
    }), sa && (window.__SWR_DEVTOOLS_REACT__ = ea.default);
    let si = () => {},
        sn = si(),
        ss = (new WeakMap, ea.default.use || (e => {
            switch (e.status) {
                case "pending":
                    throw e;
                case "fulfilled":
                    return e.value;
                case "rejected":
                    throw e.reason;
                default:
                    throw e.status = "pending", e.then(t => {
                        e.status = "fulfilled", e.value = t
                    }, t => {
                        e.status = "rejected", e.reason = t
                    }), e
            }
        })),
        so = {
            dedupe: !0
        },
        sl = Promise.resolve(nA);
    nO.defineProperty(e => {
        let {
            value: t
        } = e, r = (0, ea.useContext)(sr), a = "function" == typeof t, i = (0, ea.useMemo)(() => a ? t(r) : t, [a, r, t]), n = (0, ea.useMemo)(() => a ? i : ((e, t) => {
            let r = nL(e, t);
            if (t) {
                let {
                    use: a,
                    fallback: i
                } = e, {
                    use: n,
                    fallback: s
                } = t;
                a && n && (r.use = a.concat(n)), i && s && (r.fallback = nL(i, s))
            }
            return r
        })(r, i), [a, r, i]), s = i && i.provider, o = (0, ea.useRef)(nA);
        s && !o.current && (o.current = n8(s(n.cache || n7), i));
        let l = o.current;
        return l && (n.cache = l[0], n.mutate = l[1]), nY(() => {
            if (l) return l[2] && l[2](), l[3]
        }, []), (0, ea.createElement)(sr.Provider, nL(e, {
            value: n
        }))
    }, "defaultValue", {
        value: st
    });
    var sc = (e, t, r) => {
            if (!t.has(e)) throw TypeError("Cannot " + r)
        },
        sd = (e, t, r) => (sc(e, t, "read from private field"), r ? r.call(e) : t.get(e)),
        su = (e, t, r) => {
            if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
            t instanceof WeakSet ? t.add(e) : t.set(e, r)
        },
        sm = (e, t, r, a) => (sc(e, t, "write to private field"), a ? a.call(e, r) : t.set(e, r), r),
        sp = class {
            constructor(e = []) {
                su(this, G, void 0), su(this, Z, "ready"), su(this, K, void 0), su(this, Y, new Set), su(this, Q, new Set), su(this, X, new Set), this.pushMessage = e => {
                    sm(this, G, sd(this, G).concat(e)), sd(this, J).call(this)
                }, this.popMessage = () => {
                    sm(this, G, sd(this, G).slice(0, -1)), sd(this, J).call(this)
                }, this.replaceMessage = (e, t) => {
                    sm(this, G, [...sd(this, G).slice(0, e), this.snapshot(t), ...sd(this, G).slice(e + 1)]), sd(this, J).call(this)
                }, this.snapshot = e => structuredClone(e), this["~registerMessagesCallback"] = (e, t) => {
                    let r = t ? null != t ? (0, nM.default)(e, t) : e : e;
                    return sd(this, Y).add(r), () => {
                        sd(this, Y).delete(r)
                    }
                }, this["~registerStatusCallback"] = e => (sd(this, Q).add(e), () => {
                    sd(this, Q).delete(e)
                }), this["~registerErrorCallback"] = e => (sd(this, X).add(e), () => {
                    sd(this, X).delete(e)
                }), su(this, J, () => {
                    sd(this, Y).forEach(e => e())
                }), su(this, ee, () => {
                    sd(this, Q).forEach(e => e())
                }), su(this, et, () => {
                    sd(this, X).forEach(e => e())
                }), sm(this, G, e)
            }
            get status() {
                return sd(this, Z)
            }
            set status(e) {
                sm(this, Z, e), sd(this, ee).call(this)
            }
            get error() {
                return sd(this, K)
            }
            set error(e) {
                sm(this, K, e), sd(this, et).call(this)
            }
            get messages() {
                return sd(this, G)
            }
            set messages(e) {
                sm(this, G, [...e]), sd(this, J).call(this)
            }
        };
    G = new WeakMap, Z = new WeakMap, K = new WeakMap, Y = new WeakMap, Q = new WeakMap, X = new WeakMap, J = new WeakMap, ee = new WeakMap, et = new WeakMap;
    var sh = class extends n_ {
        constructor({
            messages: e,
            ...t
        }) {
            const r = new sp(e);
            super({ ...t,
                state: r
            }), su(this, er, void 0), this["~registerMessagesCallback"] = (e, t) => sd(this, er)["~registerMessagesCallback"](e, t), this["~registerStatusCallback"] = e => sd(this, er)["~registerStatusCallback"](e), this["~registerErrorCallback"] = e => sd(this, er)["~registerErrorCallback"](e), sm(this, er, r)
        }
    };
    er = new WeakMap, e.s(["useChat", 0, function({
        experimental_throttle: e,
        resume: t = !1,
        ...r
    } = {}) {
        let a = (0, ea.useRef)("chat" in r ? {} : {
            onToolCall: r.onToolCall,
            onData: r.onData,
            onFinish: r.onFinish,
            onError: r.onError,
            sendAutomaticallyWhen: r.sendAutomaticallyWhen
        });
        "chat" in r || (a.current = {
            onToolCall: r.onToolCall,
            onData: r.onData,
            onFinish: r.onFinish,
            onError: r.onError,
            sendAutomaticallyWhen: r.sendAutomaticallyWhen
        });
        let i = { ...r,
                onToolCall: e => {
                    var t, r;
                    return null == (r = (t = a.current).onToolCall) ? void 0 : r.call(t, e)
                },
                onData: e => {
                    var t, r;
                    return null == (r = (t = a.current).onData) ? void 0 : r.call(t, e)
                },
                onFinish: e => {
                    var t, r;
                    return null == (r = (t = a.current).onFinish) ? void 0 : r.call(t, e)
                },
                onError: e => {
                    var t, r;
                    return null == (r = (t = a.current).onError) ? void 0 : r.call(t, e)
                },
                sendAutomaticallyWhen: e => {
                    var t, r, i;
                    return null != (i = null == (r = (t = a.current).sendAutomaticallyWhen) ? void 0 : r.call(t, e)) && i
                }
            },
            n = (0, ea.useRef)("chat" in r ? r.chat : new sh(i));
        ("chat" in r && r.chat !== n.current || "id" in r && n.current.id !== r.id) && (n.current = "chat" in r ? r.chat : new sh(i));
        let s = (0, ea.useCallback)(t => n.current["~registerMessagesCallback"](t, e), [e, n.current.id]),
            o = (0, ea.useSyncExternalStore)(s, () => n.current.messages, () => n.current.messages),
            l = (0, ea.useSyncExternalStore)(n.current["~registerStatusCallback"], () => n.current.status, () => n.current.status),
            c = (0, ea.useSyncExternalStore)(n.current["~registerErrorCallback"], () => n.current.error, () => n.current.error),
            d = (0, ea.useCallback)(e => {
                "function" == typeof e && (e = e(n.current.messages)), n.current.messages = e
            }, [n]);
        return (0, ea.useEffect)(() => {
            t && n.current.resumeStream()
        }, [t, n]), {
            id: n.current.id,
            messages: o,
            setMessages: d,
            sendMessage: n.current.sendMessage,
            regenerate: n.current.regenerate,
            clearError: n.current.clearError,
            stop: n.current.stop,
            error: c,
            resumeStream: n.current.resumeStream,
            status: l,
            addToolResult: n.current.addToolOutput,
            addToolOutput: n.current.addToolOutput,
            addToolApprovalResponse: n.current.addToolApprovalResponse
        }
    }], 503974);
    var sf = e.i(221628),
        sx = e.i(999061),
        sg = e.i(766181),
        sv = e.i(215959),
        sy = e.i(86831);
    let sb = (0, sg.cva)("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent [background-repeat:no-repeat,padding-box] [--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]", {
        variants: {
            variant: {
                default: "[--base-color:var(--color-text-secondary)] [--base-gradient-color:var(--color-text-primary)] dark:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]",
                brand: "[--base-color:var(--color-brand-500)] [--base-gradient-color:var(--color-brand-200)] dark:[--base-gradient-color:var(--color-brand-900)] dark:[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--base-gradient-color),#0000_calc(50%+var(--spread)))]"
            }
        },
        defaultVariants: {
            variant: "default"
        }
    });
    e.s(["TextShimmer", 0, function(e) {
        let t, r, a, i, n, s, o, l, c, d, u, m, p, h = (0, sx.c)(25);
        h[0] !== e ? ({
            children: t,
            className: r,
            variant: i,
            duration: n,
            repeat: s,
            spread: o,
            ...a
        } = e, h[0] = e, h[1] = t, h[2] = r, h[3] = a, h[4] = i, h[5] = n, h[6] = s, h[7] = o) : (t = h[1], r = h[2], a = h[3], i = h[4], n = h[5], s = h[6], o = h[7]);
        let f = void 0 === i ? "default" : i,
            x = void 0 === n ? 2 : n,
            g = void 0 === s ? 1 / 0 : s,
            v = void 0 === o ? 2 : o,
            y = t.length * v;
        h[8] !== r || h[9] !== f ? (l = (0, sy.cn)(sb({
            variant: f
        }), r), h[8] = r, h[9] = f, h[10] = l) : l = h[10], h[11] === Symbol.for("react.memo_cache_sentinel") ? (c = {
            backgroundPosition: "100% center"
        }, d = {
            backgroundPosition: "0% center"
        }, h[11] = c, h[12] = d) : (c = h[11], d = h[12]), h[13] !== x || h[14] !== g ? (u = {
            repeat: g,
            duration: x,
            ease: "linear"
        }, h[13] = x, h[14] = g, h[15] = u) : u = h[15];
        let b = `${y}px`;
        h[16] !== a.style || h[17] !== b ? (m = {
            "--spread": b,
            backgroundImage: "var(--bg), linear-gradient(var(--base-color), var(--base-color))",
            ...a.style
        }, h[16] = a.style, h[17] = b, h[18] = m) : m = h[18];
        let k = m;
        return h[19] !== t || h[20] !== a || h[21] !== k || h[22] !== l || h[23] !== u ? (p = (0, sf.jsx)(sv.motion.span, {
            className: l,
            initial: c,
            animate: d,
            transition: u,
            style: k,
            ...a,
            children: t
        }), h[19] = t, h[20] = a, h[21] = k, h[22] = l, h[23] = u, h[24] = p) : p = h[24], p
    }], 110278)
}, 854219, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(503974),
        i = e.i(23128),
        n = e.i(655239),
        s = e.i(110278),
        o = e.i(992805),
        l = e.i(840420),
        c = e.i(219469),
        d = e.i(215959),
        u = e.i(814703),
        m = e.i(621409),
        p = e.i(416340),
        h = e.i(668122),
        f = e.i(446789),
        x = e.i(864006),
        g = e.i(604777),
        v = e.i(305457),
        y = e.i(891685),
        b = e.i(48331),
        k = e.i(148369),
        w = e.i(169010),
        S = e.i(491636),
        j = e.i(11643),
        C = e.i(661879);
    let _ = e => {
            let a, i, n, s, o, l = (0, r.c)(13),
                {
                    outcome: c,
                    priceBefore: d,
                    priceAfter: u
                } = e,
                m = u - d,
                p = m > 0,
                h = Math.abs(m),
                f = c ? ? "Yes";
            a = p ? h >= 15 ? "surges to" : h >= 5 ? "jumps to" : "rises to" : h >= 15 ? "plunges to" : h >= 5 ? "drops to" : "dips to", l[0] !== f || l[1] !== u || l[2] !== a ? (i = (0, t.jsxs)("span", {
                children: [f, " ", a, " ", u, "%"]
            }), l[0] = f, l[1] = u, l[2] = a, l[3] = i) : i = l[3];
            let x = `inline-flex items-center gap-0.5 font-semibold ${p?"text-green-500":"text-red-500"}`;
            return l[4] !== p ? (n = p ? (0, t.jsx)(k.TriangleUp, {
                size: 8
            }) : (0, t.jsx)(k.TriangleDown, {
                size: 8
            }), l[4] = p, l[5] = n) : n = l[5], l[6] !== h || l[7] !== x || l[8] !== n ? (s = (0, t.jsxs)("span", {
                className: x,
                children: [n, h, "%"]
            }), l[6] = h, l[7] = x, l[8] = n, l[9] = s) : s = l[9], l[10] !== i || l[11] !== s ? (o = (0, t.jsxs)("p", {
                className: "flex items-center gap-1 text-body-sm text-[var(--color-tertiary)] mt-0.5",
                children: [i, s]
            }), l[10] = i, l[11] = s, l[12] = o) : o = l[12], o
        },
        T = e => {
            let a, i, n, s, o, l, c, d, u, m, p, h, f, x = (0, r.c)(38),
                {
                    item: g,
                    isFirst: v,
                    isLast: y,
                    showPriceByline: b,
                    hidden: k
                } = e;
            x[0] !== g.timestamp ? (a = (0, S.format)(new Date(g.timestamp), "MMM d yyyy"), x[0] = g.timestamp, x[1] = a) : a = x[1];
            let w = a,
                j = `flex gap-3 relative${k?" !h-0 !overflow-hidden !p-0 !m-0":""}`;
            x[2] !== k ? (i = k ? {
                contentVisibility: "hidden"
            } : void 0, x[2] = k, x[3] = i) : i = x[3];
            let C = !!k || void 0,
                T = k || void 0;
            return x[4] !== v ? (n = v ? (0, t.jsx)("div", {
                className: "h-[7px]"
            }) : (0, t.jsx)("div", {
                className: "w-px h-[7px] bg-[var(--color-border)]"
            }), x[4] = v, x[5] = n) : n = x[5], x[6] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("div", {
                className: "w-3 h-3 rounded-full border-2 border-[var(--color-border-hover)] bg-background shrink-0"
            }), x[6] = s) : s = x[6], x[7] !== y ? (o = !y && (0, t.jsx)("div", {
                className: "w-px flex-1 bg-[var(--color-border)]"
            }), x[7] = y, x[8] = o) : o = x[8], x[9] !== n || x[10] !== o ? (l = (0, t.jsxs)("div", {
                className: "flex flex-col items-center shrink-0",
                children: [n, s, o]
            }), x[9] = n, x[10] = o, x[11] = l) : l = x[11], x[12] !== w ? (c = (0, t.jsx)("span", {
                className: "text-body-sm text-[var(--color-tertiary)]",
                children: w
            }), x[12] = w, x[13] = c) : c = x[13], x[14] !== g.title ? (d = (0, t.jsx)("p", {
                className: "text-body-base font-semibold text-[var(--color-primary)] leading-5 mt-1",
                children: g.title
            }), x[14] = g.title, x[15] = d) : d = x[15], x[16] !== g.outcome || x[17] !== g.priceAfter || x[18] !== g.priceBefore || x[19] !== b ? (u = b && null != g.priceAfter && null != g.priceBefore && g.priceAfter !== g.priceBefore && (0, t.jsx)(_, {
                outcome: g.outcome,
                priceBefore: g.priceBefore,
                priceAfter: g.priceAfter
            }), x[16] = g.outcome, x[17] = g.priceAfter, x[18] = g.priceBefore, x[19] = b, x[20] = u) : u = x[20], x[21] !== g.summary ? (m = (0, t.jsx)("p", {
                className: "text-body-sm text-[var(--color-text-secondary)] leading-5 mt-1",
                children: g.summary
            }), x[21] = g.summary, x[22] = m) : m = x[22], x[23] !== g.sources ? (p = g.sources && g.sources.length > 0 && (0, t.jsx)("div", {
                className: "flex items-center gap-1.5 mt-3",
                children: g.sources.map(N)
            }), x[23] = g.sources, x[24] = p) : p = x[24], x[25] !== c || x[26] !== d || x[27] !== u || x[28] !== m || x[29] !== p ? (h = (0, t.jsxs)("div", {
                className: "flex-1 pb-8",
                children: [c, d, u, m, p]
            }), x[25] = c, x[26] = d, x[27] = u, x[28] = m, x[29] = p, x[30] = h) : h = x[30], x[31] !== h || x[32] !== j || x[33] !== i || x[34] !== C || x[35] !== T || x[36] !== l ? (f = (0, t.jsxs)("div", {
                className: j,
                style: i,
                inert: C,
                "aria-hidden": T,
                children: [l, h]
            }), x[31] = h, x[32] = j, x[33] = i, x[34] = C, x[35] = T, x[36] = l, x[37] = f) : f = x[37], f
        },
        M = () => {
            let e, a, i, n, s, o, l, c, d = (0, r.c)(27);
            d[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], d[0] = e) : e = d[0];
            let {
                event: u
            } = (0, y.useEventContext)(e), [m, h] = p.default.useState(2), f = (0, C.useAnnotations)(u.slug);
            e: {
                let e;
                if (0 === f.length) {
                    let e;
                    d[1] === Symbol.for("react.memo_cache_sentinel") ? (e = [], d[1] = e) : e = d[1], a = e;
                    break e
                }
                d[2] !== f ? (e = [...f].sort(I), d[2] = f, d[3] = e) : e = d[3],
                a = e
            }
            let x = a;
            d[4] !== u.markets ? (i = u.markets.filter(P), d[4] = u.markets, d[5] = i) : i = d[5];
            let g = i.length > 1;
            if (0 === x.length) return null;
            let v = x.length - m,
                b = v > 0,
                k = Math.min(m, x.length) - 1;
            d[6] !== x.length ? (n = function() {
                h(e => Math.min(e + 10, x.length))
            }, d[6] = x.length, d[7] = n) : n = d[7];
            let w = n;
            d[8] !== x.length ? (s = function() {
                h(x.length)
            }, d[8] = x.length, d[9] = s) : s = d[9];
            let S = s;
            if (d[10] !== g || d[11] !== k || d[12] !== x || d[13] !== m) {
                let e;
                d[15] !== g || d[16] !== k || d[17] !== m ? (e = (e, r) => (0, t.jsx)(T, {
                    item: e,
                    isFirst: 0 === r,
                    isLast: r === k,
                    showPriceByline: !g || null != e.outcome,
                    hidden: r >= m
                }, `${e.unixTime}-${r}`), d[15] = g, d[16] = k, d[17] = m, d[18] = e) : e = d[18], o = x.map(e), d[10] = g, d[11] = k, d[12] = x, d[13] = m, d[14] = o
            } else o = d[14];
            return d[19] !== b || d[20] !== v || d[21] !== S || d[22] !== w ? (l = b && (0, t.jsx)("div", {
                className: "flex justify-center mt-4",
                children: (0, t.jsx)("button", {
                    type: "button",
                    onClick: v <= 10 ? S : w,
                    className: "text-body-sm font-medium text-[var(--color-primary)] px-4 py-2 rounded-full border border-[var(--color-border)] cursor-pointer transition-colors hover:bg-[var(--color-surface-hover)]",
                    children: v <= 10 ? "Show all" : "Show more"
                })
            }), d[19] = b, d[20] = v, d[21] = S, d[22] = w, d[23] = l) : l = d[23], d[24] !== o || d[25] !== l ? (c = (0, t.jsxs)("div", {
                className: "mt-6",
                children: [o, l]
            }), d[24] = o, d[25] = l, d[26] = c) : c = d[26], c
        };

    function N(e) {
        let r = (0, j.getFaviconUrl)(e.url);
        return (0, t.jsx)(w.Tooltip, {
            content: e.name,
            side: "top",
            children: (0, t.jsx)("a", {
                href: e.url,
                target: "_blank",
                rel: "noopener noreferrer",
                className: "flex items-center justify-center rounded-md overflow-hidden bg-white",
                style: {
                    width: 28,
                    height: 28,
                    border: "1px solid var(--color-border)"
                },
                children: r ? (0, t.jsx)("img", {
                    src: r,
                    alt: e.name,
                    referrerPolicy: "no-referrer",
                    width: 18,
                    height: 18,
                    loading: "lazy",
                    style: {
                        objectFit: "contain"
                    }
                }) : (0, t.jsx)("span", {
                    className: "text-[10px] font-semibold text-[var(--color-secondary)]",
                    children: e.name.slice(0, 2).toUpperCase()
                })
            })
        }, e.url)
    }

    function I(e, t) {
        return t.unixTime - e.unixTime
    }

    function P(e) {
        return e.active && !e.closed && !e.archived
    }
    let E = "pm:show-context-tab",
        A = new Set(["21"]);

    function O(e) {
        return (0, t.jsx)("span", {
            className: "sr-only",
            children: e
        }, e)
    }

    function D(e) {
        return e.description
    }

    function L(e) {
        return e.value
    }

    function z() {}

    function R() {}

    function F(e) {
        return "text" === e.type
    }

    function $(e) {
        return "assistant" === e.role
    }

    function B(e) {
        return A.has(e.id)
    }
    e.s(["RulesAndContextTabs", 0, function(e) {
        let k, w, S, j, C, _, T, N, I, P, A, q, V, H, U, W, G, Z, K, Y, Q, X, J, ee, et, er = (0, r.c)(93),
            {
                isMobileEventLevel: ea,
                isSMP: ei
            } = e,
            en = (0, g.useTranslations)(),
            es = (0, x.useLocale)(),
            eo = (0, v.useAmplitudeAnalytics)();
        er[0] === Symbol.for("react.memo_cache_sentinel") ? (k = ["event"], er[0] = k) : k = er[0];
        let {
            event: el
        } = (0, y.useEventContext)(k), [ec, ed] = p.default.useState("rules"), [eu, em] = p.default.useState(!1), ep = p.default.useRef(null), eh = el.eventMetadata ? .context_description, ef = el.eventMetadata ? .context_updated_at;
        er[1] !== el.tags ? (w = el.tags ? .some(B) ? ? !1, er[1] = el.tags, er[2] = w) : w = er[2];
        let ex = w,
            eg = p.default.useId(),
            ev = `${eg}-tab-rules`,
            ey = `${eg}-tab-context`,
            eb = `${eg}-panel-rules`,
            ek = `${eg}-panel-context`;
        er[3] !== ev || er[4] !== ey || er[5] !== eb || er[6] !== ek ? (S = {
            tabRules: ev,
            tabContext: ey,
            panelRules: eb,
            panelContext: ek
        }, er[3] = ev, er[4] = ey, er[5] = eb, er[6] = ek, er[7] = S) : S = er[7];
        let ew = S;
        if (er[8] !== ew.tabContext || er[9] !== ew.tabRules || er[10] !== en) {
            let e, t, r, a;
            j = [], er[12] !== en ? (e = en("events.aboutSection.rules"), er[12] = en, er[13] = e) : e = er[13], er[14] !== ew.tabRules || er[15] !== e ? (t = {
                value: "rules",
                label: e,
                id: ew.tabRules
            }, er[14] = ew.tabRules, er[15] = e, er[16] = t) : t = er[16], j.push(t), er[17] !== en ? (r = en("events.grokEventSummary.marketContext"), er[17] = en, er[18] = r) : r = er[18], er[19] !== ew.tabContext || er[20] !== r ? (a = {
                value: "context",
                label: r,
                id: ew.tabContext
            }, er[19] = ew.tabContext, er[20] = r, er[21] = a) : a = er[21], j.push(a), er[8] = ew.tabContext, er[9] = ew.tabRules, er[10] = en, er[11] = j
        } else j = er[11];
        let eS = j,
            ej = `/api/grok/event-summary?prompt=${el.slug}&locale=${es}`;
        er[22] !== ej ? (C = new l.TextStreamChatTransport({
            api: ej
        }), er[22] = ej, er[23] = C) : C = er[23];
        let eC = C;
        er[24] !== eC ? (_ = {
            transport: eC
        }, er[24] = eC, er[25] = _) : _ = er[25];
        let {
            messages: e_,
            status: eT,
            sendMessage: eM
        } = (0, a.useChat)(_), eN = "streaming" === eT || "submitted" === eT;
        if (er[26] !== e_) {
            let e, t = e_.filter($).pop(),
                r = t ? .parts.find(F);
            er[28] === Symbol.for("react.memo_cache_sentinel") ? (e = /\n__SOURCES__:.+$/, er[28] = e) : e = er[28], T = (r ? .text ? ? "").replace(e, ""), er[26] = e_, er[27] = T
        } else T = er[27];
        let eI = T;
        er[29] !== ef || er[30] !== el.id || er[31] !== ex ? (N = () => {
            !ef || ex || new Date(ef).getTime() < Date.now() - 36e5 && fetch("/api/market-context/regenerate", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    eventId: String(el.id),
                    contextUpdatedAt: ef
                })
            }).catch(R)
        }, I = [ef, el.id, ex], er[29] = ef, er[30] = el.id, er[31] = ex, er[32] = N, er[33] = I) : (N = er[32], I = er[33]), p.default.useEffect(N, I), er[34] === Symbol.for("react.memo_cache_sentinel") ? (P = () => {
            let e = () => {
                ed("context"), ep.current ? .scrollIntoView({
                    behavior: "smooth",
                    block: "start"
                })
            };
            return window.addEventListener(E, e), () => window.removeEventListener(E, e)
        }, A = [], er[34] = P, er[35] = A) : (P = er[34], A = er[35]), p.default.useEffect(P, A), er[36] !== eo || er[37] !== el.id || er[38] !== el.slug || er[39] !== el.title || er[40] !== eu || er[41] !== ex || er[42] !== eM ? (q = async () => {
            eu || (em(!0), eo.trackEvent(h.Events.GrokEventSummary, {
                eventSlug: el.slug,
                eventTitle: el.title
            }), ex || fetch("/api/market-context/regenerate", {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    eventId: String(el.id)
                })
            }).catch(z), await eM({
                text: ""
            }))
        }, er[36] = eo, er[37] = el.id, er[38] = el.slug, er[39] = el.title, er[40] = eu, er[41] = ex, er[42] = eM, er[43] = q) : q = er[43];
        let eP = q;
        er[44] === Symbol.for("react.memo_cache_sentinel") ? (V = e => ed(e), er[44] = V) : V = er[44];
        let eE = V;
        er[45] !== ec || er[46] !== eS ? (H = e => {
            let t, r = eS.map(L),
                a = r.indexOf(ec);
            switch (e.key) {
                case "ArrowRight":
                    t = (a + 1) % r.length;
                    break;
                case "ArrowLeft":
                    t = (a - 1 + r.length) % r.length;
                    break;
                case "Home":
                    t = 0;
                    break;
                case "End":
                    t = r.length - 1;
                    break;
                default:
                    return
            }
            e.preventDefault(), ed(r[t])
        }, er[45] = ec, er[46] = eS, er[47] = H) : H = er[47];
        let eA = H;
        er[48] !== el.markets ? (U = new Set(el.markets.map(D).filter(Boolean)), er[48] = el.markets, er[49] = U) : U = er[49], er[50] !== U ? (W = [...U].map(O), er[50] = U, er[51] = W) : W = er[51], er[52] !== eh ? (G = eh && (0, t.jsx)("span", {
            className: "sr-only",
            children: eh
        }), er[52] = eh, er[53] = G) : G = er[53], er[54] !== ec || er[55] !== eS ? (Z = (0, t.jsx)(o.TextTabs, {
            items: eS,
            value: ec,
            onValueChange: eE,
            className: "mb-4",
            headingLevel: "h2"
        }), er[54] = ec, er[55] = eS, er[56] = Z) : Z = er[56], er[57] !== eA || er[58] !== Z ? (K = (0, t.jsx)("div", {
            ref: ep,
            role: "tablist",
            "aria-label": "Market information",
            onKeyDown: eA,
            children: Z
        }), er[57] = eA, er[58] = Z, er[59] = K) : K = er[59];
        let eO = "rules" !== ec;
        er[60] !== ea || er[61] !== ei ? (Y = (0, t.jsx)(b.EventAboutSection, {
            isMobileEventLevel: ea,
            isSMP: ei,
            hideHeader: !0
        }), er[60] = ea, er[61] = ei, er[62] = Y) : Y = er[62], er[63] !== ew.panelRules || er[64] !== ew.tabRules || er[65] !== eO || er[66] !== Y ? (Q = (0, t.jsx)("div", {
            role: "tabpanel",
            id: ew.panelRules,
            "aria-labelledby": ew.tabRules,
            hidden: eO,
            children: Y
        }), er[63] = ew.panelRules, er[64] = ew.tabRules, er[65] = eO, er[66] = Y, er[67] = Q) : Q = er[67];
        let eD = "context" !== ec;
        if (er[68] !== eI || er[69] !== eh || er[70] !== ef || er[71] !== el.slug || er[72] !== el.startDate || er[73] !== el.title || er[74] !== eP || er[75] !== eu || er[76] !== eN || er[77] !== es || er[78] !== en) X = eh ? (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(u.default, {
                children: (0, t.jsx)("script", {
                    type: "application/ld+json",
                    dangerouslySetInnerHTML: {
                        __html: JSON.stringify({
                            "@context": "https://schema.org",
                            "@type": "Article",
                            mainEntityOfPage: {
                                "@type": "WebPage",
                                "@id": `https://polymarket.com/event/${el.slug}`
                            },
                            headline: `${el.title} — Market Context`,
                            description: function(e) {
                                if (e.length <= 150) return e;
                                let t = e.slice(0, 150),
                                    r = t.lastIndexOf(".");
                                return r > 75 ? t.slice(0, r + 1) : `${t.trimEnd()}…`
                            }(eh),
                            articleBody: eh,
                            image: `https://polymarket.com/api/og?eslug=${el.slug}`,
                            datePublished: el.startDate,
                            ...ef && {
                                dateModified: ef
                            },
                            author: {
                                "@type": "Organization",
                                name: "Polymarket",
                                url: "https://polymarket.com"
                            },
                            publisher: {
                                "@type": "Organization",
                                name: "Polymarket",
                                url: "https://polymarket.com",
                                logo: {
                                    "@type": "ImageObject",
                                    url: "https://polymarket.com/icons/apple-touch-icon.png"
                                }
                            },
                            isPartOf: {
                                "@id": `https://polymarket.com/event/${el.slug}#event`
                            }
                        })
                    }
                })
            }), (0, t.jsxs)("article", {
                children: [(0, t.jsx)("p", {
                    className: "text-sm text-text leading-6",
                    children: eh
                }), (0, t.jsxs)("small", {
                    className: "text-text-tertiary text-xs mt-2 block",
                    children: [en("events.grokEventSummary.contextDisclaimer"), ef && (0, t.jsxs)(t.Fragment, {
                        children: [` \xb7 ${en("events.grokEventSummary.contextUpdated")} `, (0, t.jsx)("time", {
                            dateTime: ef,
                            children: new Date(ef).toLocaleString((0, f.getIntlLocale)(es), {
                                month: "short",
                                day: "numeric",
                                year: "numeric",
                                hour: "numeric",
                                minute: "2-digit",
                                timeZoneName: "short"
                            })
                        })]
                    })]
                }), (0, t.jsx)(M, {})]
            })]
        }) : (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)("div", {
                children: eu ? (0, t.jsxs)("div", {
                    children: [(0, t.jsx)(c.AnimatePresence, {
                        mode: "wait",
                        children: eN && !eI ? (0, t.jsxs)(d.motion.div, {
                            initial: {
                                opacity: 0,
                                y: 8
                            },
                            animate: {
                                opacity: 1,
                                y: 0
                            },
                            transition: {
                                duration: .25,
                                ease: [.77, 0, .175, 1]
                            },
                            className: "flex flex-row gap-x-2 items-center",
                            children: [(0, t.jsx)(n.default, {}), (0, t.jsx)(s.TextShimmer, {
                                className: "font-medium text-sm",
                                variant: "default",
                                children: en("events.grokEventSummary.gettingSources")
                            })]
                        }, "loading") : null
                    }), eI && (0, t.jsx)("div", {
                        className: "text-sm text-text leading-6",
                        children: (0, t.jsx)("span", {
                            children: eI
                        })
                    }), (eN || eI) && (0, t.jsx)("div", {
                        className: "flex justify-end mt-2",
                        children: (0, t.jsx)("p", {
                            className: "text-text-tertiary text-xs",
                            children: en("events.grokEventSummary.resultsExperimental")
                        })
                    })]
                }) : (0, t.jsxs)(i.Button, {
                    type: "button",
                    onClick: eP,
                    variant: "secondary",
                    size: "sm",
                    className: "gap-2 group",
                    children: [(0, t.jsx)(m.IconSparkle4Fill12, {
                        className: "transition-transform group-hover:rotate-30"
                    }), en("events.grokEventSummary.generate")]
                })
            }), (0, t.jsx)(M, {})]
        }), er[68] = eI, er[69] = eh, er[70] = ef, er[71] = el.slug, er[72] = el.startDate, er[73] = el.title, er[74] = eP, er[75] = eu, er[76] = eN, er[77] = es, er[78] = en, er[79] = X;
        else X = er[79];
        return er[80] !== ew.panelContext || er[81] !== ew.tabContext || er[82] !== eD || er[83] !== X ? (J = (0, t.jsx)("div", {
            role: "tabpanel",
            id: ew.panelContext,
            "aria-labelledby": ew.tabContext,
            hidden: eD,
            children: X
        }), er[80] = ew.panelContext, er[81] = ew.tabContext, er[82] = eD, er[83] = X, er[84] = J) : J = er[84], er[85] !== Q || er[86] !== J ? (ee = (0, t.jsxs)("div", {
            className: "pt-1",
            children: [Q, J]
        }), er[85] = Q, er[86] = J, er[87] = ee) : ee = er[87], er[88] !== W || er[89] !== G || er[90] !== K || er[91] !== ee ? (et = (0, t.jsxs)("div", {
            className: "mt-8 w-full mb-6",
            children: [W, G, K, ee]
        }), er[88] = W, er[89] = G, er[90] = K, er[91] = ee, er[92] = et) : et = er[92], et
    }, "SHOW_CONTEXT_TAB_EVENT", 0, E], 854219)
}, 870046, 957902, 149388, e => {
    "use strict";
    e.s(["Chart", () => A], 870046);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(188474),
        i = e.i(416340),
        n = e.i(429411),
        s = e.i(85510),
        o = e.i(197935),
        l = e.i(333035),
        c = e.i(12884),
        d = e.i(695937),
        u = e.i(219469),
        m = e.i(215959),
        p = e.i(339393),
        h = e.i(146136),
        f = e.i(709539),
        x = e.i(79478),
        g = e.i(54127),
        v = e.i(24781),
        y = e.i(160162),
        b = e.i(547525),
        k = e.i(929446),
        w = e.i(118818),
        S = e.i(100684),
        j = e.i(581623),
        C = e.i(753870),
        _ = e.i(137918),
        T = e.i(720959),
        M = e.i(854219);
    let N = e => {
            let a, i = (0, r.c)(5),
                {
                    cx: n,
                    cy: s,
                    isActive: o
                } = e,
                l = n - 8.5,
                c = s - 5.5,
                d = o ? "var(--color-surface-hover)" : "var(--color-background)",
                u = o ? "none" : "var(--color-border)";
            return i[0] !== l || i[1] !== c || i[2] !== d || i[3] !== u ? (a = (0, t.jsx)("rect", {
                x: l,
                y: c,
                width: 17,
                height: 11,
                rx: 3,
                fill: d,
                stroke: u,
                strokeWidth: 1
            }), i[0] = l, i[1] = c, i[2] = d, i[3] = u, i[4] = a) : a = i[4], a
        },
        I = () => {
            window.dispatchEvent(new Event(M.SHOW_CONTEXT_TAB_EVENT))
        },
        P = () => {
            let e, a, n, s, d, u, p, h, f = (0, r.c)(36),
                {
                    clusters: x,
                    activeCluster: g,
                    setActiveCluster: v
                } = (0, S.useNewsOverlayContext)(),
                {
                    width: y,
                    height: b,
                    margin: k,
                    yAxisScale: w
                } = (0, l.useLineChartContext)(),
                {
                    options: j
                } = (0, c.useChartContext)(),
                {
                    tooltipLeft: C
                } = (0, T.useTooltipPositionContext)(),
                {
                    showDateTooltip: M
                } = (0, o.useInteractivityContext)(),
                [P, E] = i.default.useState(null),
                A = i.default.useRef(null);
            f[0] !== g ? .id ? (e = () => {
                let e = g ? .id ? ? null,
                    t = A.current;
                if (A.current = e, t && !e) {
                    E(t);
                    let e = setTimeout(() => E(null), 200);
                    return () => clearTimeout(e)
                }
                e && E(null)
            }, f[0] = g ? .id, f[1] = e) : e = f[1];
            let O = g ? .id;
            f[2] !== O ? (a = [O], f[2] = O, f[3] = a) : a = f[3], i.default.useEffect(e, a), f[4] !== w ? (n = w.range(), f[4] = w, f[5] = n) : n = f[5];
            let D = n[0] + 42,
                L = y - k.left - k.right;
            if (0 === x.length) return null;
            let z = b - k.bottom - 4,
                R = M && C > 0 && C <= L;
            if (f[6] !== z || f[7] !== D || f[8] !== R || f[9] !== C ? (s = R && (0, t.jsx)("line", {
                    x1: C,
                    y1: z,
                    x2: C,
                    y2: D,
                    stroke: "var(--neutral-50)",
                    strokeWidth: 1.5,
                    pointerEvents: "none"
                }), f[6] = z, f[7] = D, f[8] = R, f[9] = C, f[10] = s) : s = f[10], f[11] !== L || f[12] !== D ? (d = (0, t.jsx)("line", {
                    x1: 0,
                    y1: D,
                    x2: L,
                    y2: D,
                    stroke: "var(--color-border)",
                    strokeWidth: 1,
                    pointerEvents: "none"
                }), f[11] = L, f[12] = D, f[13] = d) : d = f[13], f[14] !== g ? .id || f[15] !== x || f[16] !== P || f[17] !== D || f[18] !== v) {
                let e;
                f[20] !== g ? .id || f[21] !== P || f[22] !== D || f[23] !== v ? (e = e => {
                    let r = g ? .id === e.id || P === e.id,
                        a = e.items.length >= 2;
                    return (0, t.jsxs)("g", {
                        onPointerEnter: t => {
                            "touch" !== t.pointerType && v(e)
                        },
                        onPointerLeave: e => {
                            "touch" !== e.pointerType && v(null)
                        },
                        onPointerUp: t => {
                            "touch" === t.pointerType && (t.stopPropagation(), v(g ? .id === e.id ? null : e))
                        },
                        style: {
                            cursor: "pointer"
                        },
                        children: [(0, t.jsx)("rect", {
                            x: e.xCenter - 18,
                            y: D - 15,
                            width: 36,
                            height: 30,
                            fill: "transparent"
                        }), a && !r && (0, t.jsx)(m.motion.rect, {
                            x: e.xCenter - 6.5,
                            width: 13,
                            height: 10,
                            rx: 2,
                            fill: "var(--color-background)",
                            stroke: "var(--color-border)",
                            strokeWidth: 1,
                            initial: {
                                y: D - 5
                            },
                            animate: {
                                y: D - 5 - 3
                            },
                            transition: {
                                type: "spring",
                                stiffness: 400,
                                damping: 15
                            }
                        }), (0, t.jsx)(N, {
                            cx: e.xCenter,
                            cy: D,
                            isActive: r
                        })]
                    }, e.id)
                }, f[20] = g ? .id, f[21] = P, f[22] = D, f[23] = v, f[24] = e) : e = f[24], u = x.map(e), f[14] = g ? .id, f[15] = x, f[16] = P, f[17] = D, f[18] = v, f[19] = u
            } else u = f[19];
            return f[25] !== x.length || f[26] !== L || f[27] !== D || f[28] !== k.right || f[29] !== j ? (p = x.length > 0 && (0, t.jsx)("foreignObject", {
                x: L + k.right / 2 - 16,
                y: D - 16,
                width: 32,
                height: 32,
                style: {
                    overflow: "visible"
                },
                className: "single" === j.mode ? "hidden lg:block" : void 0,
                children: (0, t.jsx)("button", {
                    type: "button",
                    onClick: I,
                    className: "flex items-center justify-center rounded-full cursor-pointer transition-colors bg-[var(--color-background)] hover:!bg-[var(--color-surface-hover)]",
                    style: {
                        width: 32,
                        height: 32,
                        border: "1px solid var(--color-border)",
                        color: "var(--color-text-primary)"
                    },
                    children: (0, t.jsx)(_.ClockIcon20, {})
                })
            }), f[25] = x.length, f[26] = L, f[27] = D, f[28] = k.right, f[29] = j, f[30] = p) : p = f[30], f[31] !== s || f[32] !== d || f[33] !== u || f[34] !== p ? (h = (0, t.jsxs)("g", {
                children: [s, d, u, p]
            }), f[31] = s, f[32] = d, f[33] = u, f[34] = p, f[35] = h) : h = f[35], h
        };

    function E(e) {
        let a, n, s, o, _, T, M, N, I, E, A = (0, r.c)(27);
        A[0] !== e ? ({
            ref: n,
            children: a,
            ...s
        } = e, A[0] = e, A[1] = a, A[2] = n, A[3] = s) : (a = A[1], n = A[2], s = A[3]);
        let {
            loading: O
        } = (0, c.useChartCanvasContext)(), {
            width: D,
            height: L,
            margin: z
        } = (0, l.useLineChartContext)(), {
            view: R
        } = (0, w.useMobileMarketContext)(), F = (0, d.useUpdate)(), [$, B] = i.default.useState(!1);
        A[4] !== $ ? (o = {
            enabled: $,
            wait: 250
        }, A[4] = $, A[5] = o) : o = A[5];
        let q = (0, p.useDeferredMounted)(o) && L > 0 && D > 0;
        return A[6] !== $ || A[7] !== O ? (_ = () => {
            O || $ || B(!0)
        }, A[6] = $, A[7] = O, A[8] = _) : _ = A[8], A[9] !== O ? (T = [O], A[9] = O, A[10] = T) : T = A[10], i.default.useEffect(_, T), A[11] !== q || A[12] !== F ? (M = () => {
            let e;
            if (q) {
                let t = setTimeout(() => F(), 1e3);
                e = () => clearTimeout(t)
            }
            return () => e ? .()
        }, A[11] = q, A[12] = F, A[13] = M) : M = A[13], A[14] !== q ? (N = [q], A[14] = q, A[15] = N) : N = A[15], i.default.useEffect(M, N), A[16] !== a || A[17] !== L || A[18] !== z || A[19] !== q || A[20] !== n || A[21] !== s || A[22] !== R || A[23] !== D ? (I = q && (0, t.jsx)(m.motion.div, {
            className: "flex w-full h-full relative overflow-visible",
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1,
                transition: {
                    type: "tween",
                    ease: "easeOut",
                    duration: .15
                }
            },
            children: (0, t.jsxs)(S.NewsOverlayProvider, {
                children: [(0, t.jsxs)("svg", {
                    ref: n,
                    width: D,
                    height: L,
                    className: "overflow-visible",
                    ...s,
                    children: [a, (0, t.jsxs)(v.Group, {
                        top: z.top,
                        left: z.left,
                        overflow: "visible",
                        children: [(0, t.jsx)(h.Axes, {}), (0, t.jsx)(k.TooltipObserver, {
                            view: R
                        }), (0, t.jsx)(y.GroupChartGrid, {}), (0, t.jsx)(b.LineChartRenderer, {}), (0, t.jsx)(x.CrosshairTooltip, {}, "crosshair-tooltip"), (0, t.jsx)(P, {}), (0, t.jsx)(g.DataMarkerTooltip, {}, "data-marker-tooltip")]
                    })]
                }), (0, t.jsx)(f.ChartOverlays, {}), (0, t.jsx)(C.NewsChartTooltip, {}), (0, t.jsx)(j.NewsCard, {})]
            })
        }), A[16] = a, A[17] = L, A[18] = z, A[19] = q, A[20] = n, A[21] = s, A[22] = R, A[23] = D, A[24] = I) : I = A[24], A[25] !== I ? (E = (0, t.jsx)(u.AnimatePresence, {
            children: I
        }), A[25] = I, A[26] = E) : E = A[26], E
    }
    let A = e => {
        let d, u, m, p, h, f = (0, r.c)(13),
            {
                children: x,
                height: g
            } = e;
        f[0] === Symbol.for("react.memo_cache_sentinel") ? (d = {
            offsetSize: !0
        }, f[0] = d) : d = f[0];
        let [v, y] = (0, s.useMeasure)(d), {
            ref: b
        } = (() => {
            let e, t, a, s = (0, r.c)(4),
                {
                    setPointerWithin: o
                } = (0, c.useChartCanvasContext)(),
                l = (0, n.useCallbackRef)(o),
                d = i.default.useRef(null);
            return s[0] !== l ? (e = () => {
                let e, t = d.current;
                if (t) {
                    let r = t.getBoundingClientRect(),
                        a = e => {
                            e.clientX >= r.left && e.clientX <= r.right && e.clientY >= r.top && e.clientY <= r.bottom ? l(!0) : l(!1)
                        };
                    document.documentElement.addEventListener("mousemove", a), e = () => document.documentElement.removeEventListener("mousemove", a)
                }
                return () => e ? .()
            }, t = [l], s[0] = l, s[1] = e, s[2] = t) : (e = s[1], t = s[2]), i.default.useEffect(e, t), s[3] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                ref: d
            }, s[3] = a) : a = s[3], a
        })(), k = (0, a.useComposedRefs)(b, v);
        f[1] !== g ? (u = {
            "--chart-height": g
        }, f[1] = g, f[2] = u) : u = f[2];
        let w = u;
        return f[3] !== x ? (m = (0, t.jsx)(o.InteractivityContextProvider, {
            children: (0, t.jsx)(E, {
                children: x
            })
        }), f[3] = x, f[4] = m) : m = f[4], f[5] !== y.height || f[6] !== y.width || f[7] !== m ? (p = (0, t.jsx)(l.LineChartContextProvider, {
            width: y.width,
            height: y.height,
            children: m
        }), f[5] = y.height, f[6] = y.width, f[7] = m, f[8] = p) : p = f[8], f[9] !== k || f[10] !== w || f[11] !== p ? (h = (0, t.jsx)("div", {
            ref: k,
            id: "group-chart-container",
            style: w,
            className: "flex flex-1 min-w-full w-full max-w-full sm:min-w-0 h-[var(--chart-height)] min-h-[var(--chart-height)] relative box-border mt-7",
            children: p
        }, "group-chart-container"), f[9] = k, f[10] = w, f[11] = p, f[12] = h) : h = f[12], h
    };
    e.s(["AnnotationDrawer", () => ea], 957902);
    var O = e.i(827525),
        D = e.i(213333),
        L = e.i(491636),
        z = e.i(390960),
        R = e.i(864006),
        F = e.i(604777),
        $ = e.i(458406),
        B = e.i(197994);
    let q = ({ ...e
    }) => i.default.createElement(B.Icon, {
        size: "18px",
        ...e
    }, i.default.createElement("path", {
        d: "M1.75,13c-.192,0-.384-.073-.53-.22-.293-.293-.293-.768,0-1.061L6.116,6.823c.487-.487,1.28-.487,1.768,0l3.116,3.116,4.72-4.72c.293-.293,.768-.293,1.061,0s.293,.768,0,1.061l-4.896,4.896c-.487,.487-1.28,.487-1.768,0l-3.116-3.116L2.28,12.78c-.146,.146-.338,.22-.53,.22Z",
        fill: "currentColor"
    }));
    var V = e.i(661879),
        H = e.i(507909),
        U = e.i(982214),
        W = e.i(438015),
        G = e.i(483940);

    function Z(e, t) {
        return !e || t.data.length > e.data.length ? t : e
    }
    var K = e.i(918997),
        Y = e.i(870555),
        Q = e.i(891685);
    let X = {
            enter: { ...H.transition,
                opacity: { ...H.opacityTransition
                }
            },
            exit: { ...H.transition,
                opacity: { ...H.opacityTransition,
                    duration: H.transition.duration,
                    delay: H.transition.duration - H.opacityTransition.duration - .05
                }
            }
        },
        J = {
            showSettings: !1,
            showOptions: !1,
            showLogo: !1,
            showTimeWindows: !1,
            initialWindow: "all",
            annotationMode: "bottom-bar",
            backfillData: !0,
            yAxisOrientation: "left",
            forcedWindow: "all",
            height: 250,
            yAxisEnabled: !1,
            xAxisEnabled: !1,
            margin: {
                top: 5,
                bottom: 5,
                left: 0,
                right: 0
            }
        };

    function ee(e) {
        let a, i, n, s, o, l, c, d, u, m, p, h, f = (0, r.c)(31),
            {
                annotations: x,
                activeAnnotation: g,
                setActiveAnnotation: v
            } = e,
            y = (0, R.useLocale)();
        f[0] !== g.index || f[1] !== x || f[2] !== v ? (a = () => {
            g.index > 0 && v(x[g.index - 1])
        }, f[0] = g.index, f[1] = x, f[2] = v, f[3] = a) : a = f[3];
        let b = a;
        f[4] !== g.index || f[5] !== x || f[6] !== v ? (i = () => {
            g.index < x.length - 1 && v(x[g.index + 1])
        }, f[4] = g.index, f[5] = x, f[6] = v, f[7] = i) : i = f[7];
        let k = i;
        f[8] !== g.timestamp || f[9] !== y ? (n = (0, L.format)(new Date(g.timestamp), "MMM d, y", {
            locale: (0, z.getDateFnsLocale)(y)
        }), f[8] = g.timestamp, f[9] = y, f[10] = n) : n = f[10], f[11] !== n ? (s = {
            formattedDate: n
        }, f[11] = n, f[12] = s) : s = f[12];
        let {
            formattedDate: w
        } = s, S = 0 === g.index, j = g.index === x.length - 1, C = S && "opacity-50 scale-100! hover:bg-neutral-100 dark:hover:bg-neutral-700 active:bg-neutral-100 dark:active:bg-neutral-700";
        f[13] !== C ? (o = (0, Y.cn)("w-9 h-8 p-0 flex justify-center items-center box-border border-none bg-neutral-100 dark:bg-neutral-700 outline-none scale-100 select-none transition-all duration-[70ms] ease-out rounded-[7px]", "hover:bg-neutral-200 dark:hover:bg-neutral-600", "active:bg-neutral-200 dark:active:bg-neutral-600", C), f[13] = C, f[14] = o) : o = f[14], f[15] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, t.jsx)($.IconArrowLeftFill24, {
            className: "size-5 text-text"
        }), f[15] = l) : l = f[15], f[16] !== b || f[17] !== o ? (c = (0, t.jsx)("button", {
            type: "button",
            onClick: b,
            className: o,
            children: l
        }), f[16] = b, f[17] = o, f[18] = c) : c = f[18], f[19] !== w ? (d = (0, t.jsx)("span", {
            className: "text-base font-medium text-neutral-500",
            children: w
        }), f[19] = w, f[20] = d) : d = f[20];
        let _ = j && "opacity-50 scale-100! hover:bg-neutral-100 dark:hover:bg-neutral-700 active:bg-neutral-100 dark:active:bg-neutral-700";
        return f[21] !== _ ? (u = (0, Y.cn)("w-9 h-8 p-0 flex justify-center items-center box-border border-none bg-neutral-100 dark:bg-neutral-700 outline-none scale-100 select-none transition-all duration-[70ms] ease-out rounded-[7px]", "hover:bg-neutral-200 dark:hover:bg-neutral-600", "active:bg-neutral-200 dark:active:bg-neutral-600", _), f[21] = _, f[22] = u) : u = f[22], f[23] === Symbol.for("react.memo_cache_sentinel") ? (m = (0, t.jsx)($.IconArrowLeftFill24, {
            className: "size-5 text-text rotate-180"
        }), f[23] = m) : m = f[23], f[24] !== k || f[25] !== u ? (p = (0, t.jsx)("button", {
            type: "button",
            onClick: k,
            className: u,
            children: m
        }), f[24] = k, f[25] = u, f[26] = p) : p = f[26], f[27] !== p || f[28] !== c || f[29] !== d ? (h = (0, t.jsxs)("div", {
            className: "w-full flex justify-between items-center",
            children: [c, d, p]
        }), f[27] = p, f[28] = c, f[29] = d, f[30] = h) : h = f[30], h
    }

    function et(e) {
        let a, i, n, o, l, c, d, p, h, f, x, g = (0, r.c)(31),
            {
                annotation: v
            } = e,
            [y, b] = (0, s.useMeasure)();
        if (g[0] !== v) a = {
            initial: e => ({
                opacity: 0,
                transform: (e ? .annotation ? .index ? ? 0) > (e ? .previousAnnotation ? .index ? ? 0) ? "translateX(calc(100% + 20px))" : "translateX(calc(-100% - 20px))",
                ...v.isFirst && {
                    transform: "translateX(calc(-100% - 20px))"
                },
                ...v.isLast && {
                    transform: "translateX(calc(100% + 20px))"
                }
            }),
            animate: {
                opacity: 1,
                transform: "translateX(0%)",
                transition: X.enter
            },
            exit: e => ({
                opacity: 0,
                transform: (e ? .previousAnnotation ? .index ? ? 0) < (e ? .annotation ? .index ? ? 0) ? "translateX(calc(-100% - 20px))" : "translateX(calc(100% + 20px))",
                ...v.isFirst && {
                    transform: "translateX(calc(-100% - 20px))"
                },
                ...v.isLast && {
                    transform: "translateX(calc(100% + 20px))"
                },
                transition: X.exit
            })
        }, g[0] = v, g[1] = a;
        else a = g[1];
        g[2] !== a ? (i = {
            animationVariants: a
        }, g[2] = a, g[3] = i) : i = g[3];
        let {
            animationVariants: k
        } = i, w = (0, D.usePrevious)(v), S = (0, D.usePrevious)(b), j = b.height ? ? S ? .height ? ? 0;
        return g[4] !== j ? (n = {
            height: j
        }, g[4] = j, g[5] = n) : n = g[5], g[6] !== v || g[7] !== w ? (o = {
            annotation: v,
            previousAnnotation: w
        }, g[6] = v, g[7] = w, g[8] = o) : o = g[8], g[9] !== v || g[10] !== w ? (l = {
            annotation: v,
            previousAnnotation: w
        }, g[9] = v, g[10] = w, g[11] = l) : l = g[11], g[12] !== v.title ? (c = (0, t.jsx)("span", {
            className: "text-xl font-medium text-text",
            children: v.title
        }), g[12] = v.title, g[13] = c) : c = g[13], g[14] !== v.summary ? (d = !!v.summary && (0, t.jsx)("span", {
            className: "text-[13px] font-medium text-text opacity-50",
            children: v.summary
        }), g[14] = v.summary, g[15] = d) : d = g[15], g[16] !== k || g[17] !== v.title || g[18] !== l || g[19] !== c || g[20] !== d ? (p = (0, t.jsxs)(m.motion.div, {
            custom: l,
            className: "flex flex-col h-max",
            variants: k,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            children: [c, d]
        }, v.title), g[16] = k, g[17] = v.title, g[18] = l, g[19] = c, g[20] = d, g[21] = p) : p = g[21], g[22] !== o || g[23] !== p ? (h = (0, t.jsx)(u.AnimatePresence, {
            mode: "popLayout",
            initial: !1,
            custom: o,
            children: p
        }), g[22] = o, g[23] = p, g[24] = h) : h = g[24], g[25] !== y || g[26] !== h ? (f = (0, t.jsx)("div", {
            ref: y,
            children: h
        }), g[25] = y, g[26] = h, g[27] = f) : f = g[27], g[28] !== f || g[29] !== n ? (x = (0, t.jsx)(m.motion.div, {
            animate: n,
            transition: H.transition,
            children: f
        }), g[28] = f, g[29] = n, g[30] = x) : x = g[30], x
    }

    function er(e) {
        let a, n, s, o, c, d, u, h, f, x, g = (0, r.c)(26),
            {
                annotation: v
            } = e,
            {
                annotationMode: y,
                setForcedTooltipPoint: b
            } = (0, W.useAnnotationsContext)(),
            {
                xAxisScale: k,
                yAxisScale: w,
                width: S,
                height: j
            } = (0, l.useLineChartContext)();
        g[0] !== v.timestamp || g[1] !== k ? (a = k(new Date(v.timestamp)), g[0] = v.timestamp, g[1] = k, g[2] = a) : a = g[2];
        let C = a,
            _ = C - 8,
            T = C - 8,
            M = j - 10;
        g[3] !== _ || g[4] !== T || g[5] !== M ? (n = {
            x1: _,
            x2: T,
            y1: -10,
            y2: M
        }, g[3] = _, g[4] = T, g[5] = M, g[6] = n) : n = g[6];
        let N = n;
        g[7] === Symbol.for("react.memo_cache_sentinel") ? (s = {
            wait: 1e3,
            enabled: !0
        }, g[7] = s) : s = g[7];
        let I = (0, p.useDeferredMounted)(s),
            P = (e => {
                let t, a = (0, r.c)(14),
                    {
                        annotationMode: i
                    } = (0, W.useAnnotationsContext)(),
                    {
                        xAxisScale: n,
                        yAxisScale: s,
                        width: o,
                        height: c,
                        series: d
                    } = (0, l.useLineChartContext)();
                if (a[0] !== e || a[1] !== i || a[2] !== c || a[3] !== d || a[4] !== o || a[5] !== n || a[6] !== s) {
                    e: {
                        let r, l, u;
                        if (a[8] !== e) {
                            let {
                                timestamp: t,
                                unixTime: i,
                                ...n
                            } = e;
                            l = i, r = n, a[8] = e, a[9] = r, a[10] = l
                        } else r = a[9],
                        l = a[10];
                        let m = n(1e3 * l),
                            p = n.invert(m),
                            h = d.reduce(Z, d.length ? d[0] : void 0);
                        if (!h) {
                            t = void 0;
                            break e
                        }
                        let f = (0, G.bisectDate)(h.data, p, 1),
                            x = h.data[f];
                        if (!x) {
                            t = void 0;
                            break e
                        }
                        let g = ((e, t, r, a) => {
                                if ("top" === r) return 0;
                                if ("bottom" === r) {
                                    let t = e.range()[0];
                                    return "bottom-bar" === a ? t - 39 : t
                                }
                                return e((0, G.getValue)(t)) ? ? 0
                            })(s, x, "bottom", i),
                            v = e.timestamp;a[11] !== c || a[12] !== o ? (u = ((e, t, r) => {
                            if (!e) return;
                            let {
                                orientation: a = "vertical",
                                ...i
                            } = e;
                            return {
                                orientation: a,
                                min: -24,
                                max: "vertical" === a ? r - 34 : t,
                                ...i
                            }
                        })({
                            orientation: "vertical"
                        }, o, c), a[11] = c, a[12] = o, a[13] = u) : u = a[13],
                        t = {
                            annotation: e,
                            enabled: !0,
                            x: m,
                            y: g,
                            dx: 6,
                            dy: -10,
                            id: v,
                            line: u,
                            ...r
                        }
                    }
                    a[0] = e,
                    a[1] = i,
                    a[2] = c,
                    a[3] = d,
                    a[4] = o,
                    a[5] = n,
                    a[6] = s,
                    a[7] = t
                }
                else t = a[7];
                return t
            })(v);
        g[8] !== P ? .x || g[9] !== b ? (o = () => {
            b(P ? .x)
        }, g[8] = P ? .x, g[9] = b, g[10] = o) : o = g[10], g[11] !== P ? (c = [P], g[11] = P, g[12] = c) : c = g[12], i.default.useEffect(o, c), g[13] !== N ? (d = {
            opacity: 0,
            ...N
        }, g[13] = N, g[14] = d) : d = g[14];
        let E = .2 * !!I;
        return g[15] !== E ? (u = { ...H.transition,
            opacity: {
                delay: E,
                ...H.opacityTransition
            }
        }, g[15] = E, g[16] = u) : u = g[16], g[17] !== N || g[18] !== u ? (h = {
            opacity: 1,
            ...N,
            transition: u
        }, g[17] = N, g[18] = u, g[19] = h) : h = g[19], g[20] !== N ? (f = {
            opacity: 0,
            ...N
        }, g[20] = N, g[21] = f) : f = g[21], g[22] !== h || g[23] !== f || g[24] !== d ? (x = (0, t.jsx)(m.motion.line, {
            className: "stroke-neutral-100 dark:stroke-neutral-600 stroke-[1.5] z-[1] translate-x-2.5 translate-y-1.5 pointer-events-none",
            fill: "transparent",
            pointerEvents: "none",
            initial: d,
            animate: h,
            exit: f,
            transition: H.transition
        }), g[22] = h, g[23] = f, g[24] = d, g[25] = x) : x = g[25], x
    }

    function ea(e) {
        let a, n, s, o, l, c, d, u, m, p, h, f, x, g, v, y, b, k, w, S, j, C = (0, r.c)(62),
            {
                open: _,
                onOpenChange: T,
                showTrigger: M,
                showHeader: N
            } = e,
            I = void 0 === M || M,
            P = void 0 !== N && N,
            E = (0, F.useTranslations)();
        C[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["event"], C[0] = a) : a = C[0];
        let {
            event: A
        } = (0, Q.useEventContext)(a);
        C[1] !== T || C[2] !== _ ? (n = {
            prop: _,
            defaultProp: !1,
            onChange: T
        }, C[1] = T, C[2] = _, C[3] = n) : n = C[3];
        let [D, L] = (0, K.useControllableState)(n), z = void 0 !== D && D, R = (0, V.useAnnotations)(A.slug);
        e: {
            let e;
            if (0 === R.length) {
                let e;
                C[4] === Symbol.for("react.memo_cache_sentinel") ? (e = [], C[4] = e) : e = C[4], s = e;
                break e
            }
            if (C[5] !== R) {
                let t = [...R].sort(ei);
                e = t.map((e, r) => ({ ...e,
                    index: r,
                    ...0 === r && {
                        isFirst: !0
                    },
                    ...r === t.length - 1 && {
                        isLast: !0
                    }
                })), C[5] = R, C[6] = e
            } else e = C[6];s = e
        }
        let $ = s,
            [B, H] = i.default.useState($.length ? $[0] : void 0);
        C[7] !== B || C[8] !== $[0] || C[9] !== $.length ? (o = () => {
            $.length > 0 && !B && H($[0])
        }, C[7] = B, C[8] = $[0], C[9] = $.length, C[10] = o) : o = C[10], C[11] !== B || C[12] !== $ ? (l = [$, B], C[11] = B, C[12] = $, C[13] = l) : l = C[13], i.default.useEffect(o, l);
        t: {
            if (!B || B.index > $.length - 1) {
                c = void 0;
                break t
            }
            c = $[B.index]
        }
        let W = c;
        r: {
            let e;
            if (!B) {
                let e;
                C[14] === Symbol.for("react.memo_cache_sentinel") ? (e = [], C[14] = e) : e = C[14], d = e;
                break r
            }
            if (B.index < $.length && (e = B.index), void 0 !== e) {
                let t;
                if (C[15] !== e || C[16] !== $) {
                    let r, a = $.slice(0, e),
                        i = $.slice(e + 1),
                        n = $[e];
                    C[18] !== n ? (r = { ...n,
                        isActive: !0
                    }, C[18] = n, C[19] = r) : r = C[19], t = [...a, r, ...i], C[15] = e, C[16] = $, C[17] = t
                } else t = C[17];
                d = t;
                break r
            }
            d = $
        }
        let G = d,
            Z = 1 === A.markets.length ? "single" : "group",
            Y = 1 === A.markets.length ? 224 : 300;
        C[20] !== Z || C[21] !== Y ? (u = { ...J,
            mode: Z,
            height: Y
        }, C[20] = Z, C[21] = Y, C[22] = u) : u = C[22];
        let X = u,
            ea = 1 === A.markets.length ? 224 : 350;
        if (!$.length || !B) return null;
        C[23] !== I ? (m = I && (0, t.jsx)(O.Drawer.Trigger, {
            asChild: !0,
            children: (0, t.jsx)("button", {
                type: "button",
                className: "absolute top-[86px] right-6 z-2 w-[30px] h-[30px] p-0 flex justify-center items-center bg-neutral-50 dark:bg-neutral-800 rounded-md outline-none select-none scale-100 transition-all duration-[70ms] ease-out fill-current text-text dark:opacity-70 hover:bg-neutral-200 dark:hover:bg-neutral-600 dark:hover:opacity-100 active:bg-neutral-200 dark:active:bg-neutral-600",
                children: (0, t.jsx)(q, {
                    className: "size-5"
                })
            })
        }), C[23] = I, C[24] = m) : m = C[24], C[25] === Symbol.for("react.memo_cache_sentinel") ? (p = (0, t.jsx)(O.Drawer.Overlay, {
            className: "fixed inset-0 bg-black/40 z-234"
        }), C[25] = p) : p = C[25], C[26] === Symbol.for("react.memo_cache_sentinel") ? (h = (0, t.jsx)(O.Drawer.Handle, {}), C[26] = h) : h = C[26], C[27] !== P || C[28] !== E ? (f = P && (0, t.jsx)("div", {
            className: "w-full flex justify-start items-center",
            children: (0, t.jsx)("div", {
                className: "flex-1",
                children: (0, t.jsx)("p", {
                    className: "text-text text-xl font-semibold whitespace-nowrap",
                    children: E("events.marketInsights")
                })
            })
        }), C[27] = P, C[28] = E, C[29] = f) : f = C[29], C[30] !== ea ? (x = {
            height: ea
        }, C[30] = ea, C[31] = x) : x = C[31];
        let en = `group-chart-open-${z}`;
        return C[32] !== B || C[33] !== W ? (g = !!W && (0, t.jsx)(er, {
            annotation: B
        }), C[32] = B, C[33] = W, C[34] = g) : g = C[34], C[35] !== G || C[36] !== X || C[37] !== A.markets || C[38] !== en || C[39] !== A || C[40] !== g ? (v = (0, t.jsx)(U.GroupChart, {
            event: A,
            markets: A.markets,
            options: X,
            annotations: G,
            children: g
        }, en), C[35] = G, C[36] = X, C[37] = A.markets, C[38] = en, C[39] = A, C[40] = g, C[41] = v) : v = C[41], C[42] !== x || C[43] !== v ? (y = (0, t.jsx)("div", {
            className: "w-full overflow-visible pl-2 mb-8 z-1 relative",
            style: x,
            children: v
        }), C[42] = x, C[43] = v, C[44] = y) : y = C[44], C[45] !== B || C[46] !== $ ? (b = (0, t.jsx)(ee, {
            annotations: $,
            activeAnnotation: B,
            setActiveAnnotation: H
        }), C[45] = B, C[46] = $, C[47] = b) : b = C[47], C[48] !== B ? (k = (0, t.jsx)(et, {
            annotation: B
        }), C[48] = B, C[49] = k) : k = C[49], C[50] !== b || C[51] !== k ? (w = (0, t.jsxs)("div", {
            className: "flex flex-col w-full gap-4 min-h-[300px]",
            children: [b, k]
        }), C[50] = b, C[51] = k, C[52] = w) : w = C[52], C[53] !== f || C[54] !== y || C[55] !== w ? (S = (0, t.jsxs)(O.Drawer.Portal, {
            children: [p, (0, t.jsxs)(O.Drawer.Content, {
                className: "z-235 fixed bottom-0 left-0 right-0 flex flex-col rounded-t-md bg-(--color-background) max-h-[calc(100dvh-40px)]",
                children: [h, (0, t.jsx)("div", {
                    className: "overflow-y-auto pt-6 pb-4 px-4 max-h-[calc(100dvh-40px)]",
                    children: (0, t.jsx)("div", {
                        children: (0, t.jsxs)("div", {
                            className: "flex flex-col w-full h-full gap-3",
                            children: [f, y, w]
                        })
                    })
                })]
            })]
        }), C[53] = f, C[54] = y, C[55] = w, C[56] = S) : S = C[56], C[57] !== L || C[58] !== z || C[59] !== m || C[60] !== S ? (j = (0, t.jsxs)(O.Drawer.Root, {
            open: z,
            onOpenChange: L,
            scrollLockTimeout: 100,
            children: [m, S]
        }), C[57] = L, C[58] = z, C[59] = m, C[60] = S, C[61] = j) : j = C[61], j
    }

    function ei(e, t) {
        return e.unixTime - t.unixTime
    }
    e.s(["IconBallCrystalFill18", 0, ({ ...e
    }) => i.default.createElement(B.Icon, {
        size: "18px",
        ...e
    }, i.default.createElement("path", {
        d: "M10.798 8.177L10.482 7.23C10.38 6.924 9.87301 6.924 9.77101 7.23L9.45501 8.177L8.50901 8.492C8.35601 8.543 8.25201 8.686 8.25201 8.848C8.25201 9.01 8.35601 9.153 8.50901 9.204L9.45501 9.519L9.77101 10.466C9.82201 10.619 9.96501 10.722 10.126 10.722C10.287 10.722 10.431 10.618 10.481 10.466L10.797 9.519L11.743 9.204C11.896 9.153 12 9.01 12 8.848C12 8.686 11.896 8.543 11.743 8.492H11.744L10.798 8.177Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), i.default.createElement("path", {
        d: "M2.75 2.5C3.16421 2.5 3.5 2.16421 3.5 1.75C3.5 1.33579 3.16421 1 2.75 1C2.33579 1 2 1.33579 2 1.75C2 2.16421 2.33579 2.5 2.75 2.5Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), i.default.createElement("path", {
        d: "M16.66 2.99L15.397 2.569L14.976 1.306C14.839 0.898 14.164 0.898 14.027 1.306L13.606 2.569L12.343 2.99C12.139 3.058 12.001 3.249 12.001 3.464C12.001 3.679 12.139 3.87 12.343 3.938L13.606 4.359L14.027 5.622C14.095 5.826 14.287 5.964 14.502 5.964C14.717 5.964 14.908 5.826 14.977 5.622L15.398 4.359L16.661 3.938C16.865 3.87 17.003 3.679 17.003 3.464C17.003 3.249 16.864 3.058 16.66 2.99Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), i.default.createElement("path", {
        d: "M9.00098 1.5C5.13476 1.5 2.00098 4.63379 2.00098 8.5C2.00098 10.4339 2.78617 12.1852 4.05278 13.4511L3.32602 15.288C3.17202 15.673 3.22002 16.108 3.45202 16.451C3.68402 16.795 4.07202 17 4.48702 17H13.514C13.928 17 14.315 16.795 14.547 16.453C14.78 16.11 14.828 15.675 14.676 15.288L13.9476 13.452C15.2155 12.1859 16.001 10.4342 16.001 8.5C16.001 8.34971 15.9948 8.20285 15.9844 8.05965C15.9542 7.64654 15.5948 7.33611 15.1817 7.36629C14.7686 7.39647 14.4582 7.75583 14.4884 8.16895C14.4965 8.28035 14.501 8.39049 14.501 8.5C14.501 10.0759 13.8388 11.4966 12.7749 12.5H5.22619C4.16314 11.4966 3.50098 10.0758 3.50098 8.5C3.50098 5.46221 5.96319 3 9.00098 3C9.29508 3 9.58463 3.02604 9.8703 3.07368C10.2789 3.14182 10.6653 2.86584 10.7335 2.45727C10.8016 2.0487 10.5256 1.66225 10.1171 1.59412C9.75632 1.53396 9.38408 1.5 9.00098 1.5Z",
        fill: "currentColor"
    }), i.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M9 6C7.62221 6 6.5 7.12221 6.5 8.5C6.5 8.91421 6.16421 9.25 5.75 9.25C5.33579 9.25 5 8.91421 5 8.5C5 6.29379 6.79379 4.5 9 4.5C9.41421 4.5 9.75 4.83579 9.75 5.25C9.75 5.66421 9.41421 6 9 6Z",
        fill: "currentColor"
    }))], 149388)
}, 251412, 803907, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061);
    e.i(686518);
    var a = e.i(907855),
        i = e.i(219469),
        n = e.i(215959),
        s = e.i(416340),
        o = e.i(149388),
        l = e.i(169010),
        c = e.i(918007),
        d = e.i(177600),
        u = e.i(994402),
        m = e.i(339393),
        p = e.i(870555),
        h = e.i(891685),
        f = e.i(12884),
        x = e.i(723823),
        g = e.i(488549),
        v = e.i(604777),
        y = e.i(507909),
        b = e.i(3643),
        k = e.i(399336),
        w = e.i(156591);
    let S = {
            initial: {
                height: 0,
                opacity: 0
            },
            animate: {
                height: "auto",
                opacity: 1,
                transition: {
                    ease: y.transition.ease,
                    duration: .125,
                    opacity: {
                        ease: y.opacityTransition.ease,
                        duration: .05,
                        delay: .1
                    }
                }
            },
            exit: {
                height: 0,
                opacity: 0,
                transition: {
                    ease: y.transition.ease,
                    duration: .125,
                    opacity: {
                        ease: y.opacityTransition.ease,
                        duration: .075
                    }
                }
            }
        },
        j = e => {
            let a, i, n, s, o, l, c = (0, r.c)(14),
                {
                    market: d,
                    lastPrice: u
                } = e,
                {
                    colors: m
                } = (0, f.useChartContext)(),
                {
                    color: p
                } = m[d.color];
            c[0] !== p ? (a = {
                backgroundColor: "var(--legend-color)",
                "--legend-color": p
            }, c[0] = p, c[1] = a) : a = c[1];
            let h = a;
            c[2] !== h ? (i = (0, t.jsx)("div", {
                className: "size-2 rounded-full",
                style: h
            }), c[2] = h, c[3] = i) : i = c[3], c[4] !== d ? (n = d.groupItemTitle ? ? (0, g.getAssetId)(d), c[4] = d, c[5] = n) : n = c[5];
            let x = `${n}`;
            return c[6] !== u ? (s = (0, t.jsxs)("span", {
                className: "text-neutral-800 font-semibold ml-0.5",
                children: [" ", u]
            }), c[6] = u, c[7] = s) : s = c[7], c[8] !== x || c[9] !== s ? (o = (0, t.jsxs)("p", {
                className: "text-text-secondary text-body-sm",
                children: [x, s]
            }), c[8] = x, c[9] = s, c[10] = o) : o = c[10], c[11] !== i || c[12] !== o ? (l = (0, t.jsxs)(t.Fragment, {
                children: [i, o]
            }), c[11] = i, c[12] = o, c[13] = l) : l = c[13], l
        },
        C = e => {
            let s, o, l, c, u, m, h, x, y, b, w, j, C, _, T = (0, r.c)(32),
                {
                    market: M,
                    lastPrice: N
                } = e,
                I = (0, v.useTranslations)();
            T[0] === Symbol.for("react.memo_cache_sentinel") ? (s = ["activeMarket"], T[0] = s) : s = T[0];
            let {
                activeMarket: P
            } = (0, k.useEventActiveMarketContext)(s), {
                colors: E,
                options: A,
                selectedAssetIndex: O,
                probabilitySeries: D
            } = (0, f.useChartContext)(), {
                color: L
            } = E[M.color];
            e: {
                let e = [...M.outcomes ? ? []].sort();
                if ("single" === A.mode && "single" === A.outcomeMode && 2 === e.length && ("no" !== e[0].toLowerCase() || "yes" !== e[1].toLowerCase())) {
                    o = !0;
                    break e
                }
                o = !1
            }
            let z = o;
            t: {
                if (P && z) {
                    l = P.outcomes[O];
                    break t
                }
                if ("single" === A.mode && "single" === A.outcomeMode && 1 === O && P) {
                    l = P.outcomes[1];
                    break t
                }
                l = void 0
            }
            let R = l;
            if (T[1] !== N) {
                let e, t, r;
                c = Number.isNaN(r = Math.round(parseFloat(t = (e = `${N}`).replace(/[%<]/g, "")))) ? {
                    lastPriceNumber: 1,
                    hasDecimal: !1,
                    prefix: "<"
                } : r > 99 ? {
                    lastPriceNumber: 99,
                    hasDecimal: !1,
                    prefix: ">"
                } : {
                    lastPriceNumber: r,
                    hasDecimal: t.includes("."),
                    prefix: e.includes("<") ? "<" : void 0
                }, T[1] = N, T[2] = c
            } else c = T[2];
            let {
                lastPriceNumber: F,
                prefix: $
            } = c;
            r: {
                let e;
                if (T[3] !== M || T[4] !== D) {
                    let t;
                    T[6] !== M ? (t = e => e.label.toLowerCase() === M.groupItemTitle ? .toLowerCase() || e.id === (0, g.getAssetId)(M), T[6] = M, T[7] = t) : t = T[7], e = D.find(t), T[3] = M, T[4] = D, T[5] = e
                } else e = T[5];
                let t = e;
                if (!t ? .data ? .length) {
                    u = void 0;
                    break r
                }
                let r = t.data[0];
                if (!r) {
                    u = void 0;
                    break r
                }
                u = (F - Math.round(100 * r.value)) / 100
            }
            let B = u,
                q = !z && void 0;
            T[8] !== L || T[9] !== R ? (m = !!R && (0, t.jsx)(n.motion.p, {
                className: "text-xs font-semibold uppercase text-(--text-color)/80",
                style: {
                    "--text-color": "var(--legend-color)",
                    "--legend-color": L
                },
                variants: S,
                initial: "initial",
                animate: "animate",
                exit: "exit",
                children: R
            }), T[8] = L, T[9] = R, T[10] = m) : m = T[10], T[11] !== q || T[12] !== m ? (h = (0, t.jsx)(i.AnimatePresence, {
                initial: q,
                children: m
            }), T[11] = q, T[12] = m, T[13] = h) : h = T[13];
            let V = $ || void 0;
            T[14] !== I ? (x = I("navbar.chance"), T[14] = I, T[15] = x) : x = T[15];
            let H = `% ${x}`;
            T[16] === Symbol.for("react.memo_cache_sentinel") ? (y = {
                duration: 450,
                easing: "linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"
            }, T[16] = y) : y = T[16];
            let U = R && 1 === O ? "text-red-500" : "text-text-brand";
            return T[17] !== U ? (b = (0, p.cn)("text-xl lg:text-2xl normal-nums!", U), T[17] = U, T[18] = b) : b = T[18], T[19] !== F || T[20] !== H || T[21] !== b || T[22] !== V ? (w = (0, t.jsx)(a.default, {
                prefix: V,
                value: F,
                suffix: H,
                trend: 0,
                transformTiming: y,
                className: b
            }), T[19] = F, T[20] = H, T[21] = b, T[22] = V, T[23] = w) : w = T[23], T[24] !== B ? (j = void 0 !== B && (0, t.jsx)(d.PriceChange, {
                className: "mt-1",
                priceChange: B,
                noDebounce: !0,
                decimalCount: 0,
                size: 12,
                delay: 100
            }), T[24] = B, T[25] = j) : j = T[25], T[26] !== w || T[27] !== j ? (C = (0, t.jsxs)("div", {
                className: "font-semibold flex items-center gap-2",
                children: [w, j]
            }), T[26] = w, T[27] = j, T[28] = C) : C = T[28], T[29] !== C || T[30] !== h ? (_ = (0, t.jsxs)("div", {
                className: "flex flex-col relative",
                children: [h, C]
            }), T[29] = C, T[30] = h, T[31] = _) : _ = T[31], _
        },
        _ = e => {
            let a, i, s, o, l, c, d, u, m, h, v, y, k = (0, r.c)(51);
            k[0] !== e ? ({
                market: s,
                isSingleMode: i,
                className: a,
                ...o
            } = e, k[0] = e, k[1] = a, k[2] = i, k[3] = s, k[4] = o) : (a = k[1], i = k[2], s = k[3], o = k[4]);
            let {
                selectedAssetIndex: S,
                showBothOutcomes: _,
                series: T
            } = (0, f.useChartContext)(), {
                hoverData: M
            } = (0, f.useChartHoverContext)(), N = s ? .resolutionData ? .proposedPrice === "0", I = (0, x.useAsks)(s, +!!N), P = s ? .resolutionData && s.resolutionData ? .proposedPrice !== "69" && I && !I.hasLiquidity;
            e: {
                let e, t, r, a;
                if (P) {
                    let e, t = N ? "0%" : "100%";
                    k[5] !== t ? (e = {
                        lastPrice: t
                    }, k[5] = t, k[6] = e) : e = k[6], l = e;
                    break e
                }
                if (M && M.length > 0) {
                    let e = i ? 0 : M.findIndex(e => e.label.toLowerCase() === s.groupItemTitle ? .toLowerCase()),
                        t = M[e];
                    if (t ? .point ? .value !== void 0) {
                        let e, r;
                        k[7] !== t.point.value ? (e = Math.round(100 * t.point.value), k[7] = t.point.value, k[8] = e) : e = k[8];
                        let a = `${Math.max(1,e)}%`;
                        k[9] !== a ? (r = {
                            lastPrice: a
                        }, k[9] = a, k[10] = r) : r = k[10], l = r;
                        break e
                    }
                }
                let n = s;k[11] !== n ? (e = (0, g.getAssetId)(n), k[11] = n, k[12] = e) : e = k[12];
                let o = e;
                if (k[13] !== o || k[14] !== s.groupItemTitle || k[15] !== T) {
                    let e;
                    k[17] !== o || k[18] !== s.groupItemTitle ? (e = e => e.label.toLowerCase() === s.groupItemTitle ? .toLowerCase() || e.id === o || e.id === `${o}-single`, k[17] = o, k[18] = s.groupItemTitle, k[19] = e) : e = k[19], t = T.find(e), k[13] = o, k[14] = s.groupItemTitle, k[15] = T, k[16] = t
                } else t = k[16];
                let c = t,
                    d = c ? .data ? .[c.data.length - 1];
                if (d ? .value !== void 0) {
                    let e, t, r, a = (0, w.getPrecisionFromTickSize)(s.orderPriceMinTickSize),
                        i = Math.max(0, a - 2),
                        n = 100 * d.value;
                    k[20] !== i || k[21] !== a || k[22] !== n ? (e = a ? parseFloat(n.toFixed(i)) : parseInt(n.toFixed(), 10), k[20] = i, k[21] = a, k[22] = n, k[23] = e) : e = k[23];
                    let o = e;
                    k[24] !== i || k[25] !== o ? (t = o < 1 ? "<1%" : `${o.toFixed(i)}%`, k[24] = i, k[25] = o, k[26] = t) : t = k[26], k[27] !== t ? (r = {
                        lastPrice: t
                    }, k[27] = t, k[28] = r) : r = k[28], l = r;
                    break e
                }
                let u = s;k[29] !== s.orderPriceMinTickSize || k[30] !== u ? (r = (0, b.getPercentChanceFromMarket)(u, (0, w.getPrecisionFromTickSize)(s.orderPriceMinTickSize)), k[29] = s.orderPriceMinTickSize, k[30] = u, k[31] = r) : r = k[31];
                let m = r;
                if (m.showLastPrice) {
                    let e;
                    k[32] !== m.lastPriceString ? (e = {
                        lastPrice: m.lastPriceString
                    }, k[32] = m.lastPriceString, k[33] = e) : e = k[33], l = e;
                    break e
                }
                k[34] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                    lastPrice: 0
                }, k[34] = a) : a = k[34],
                l = a
            }
            let {
                lastPrice: E
            } = l;
            return k[35] !== a ? (c = (0, p.cn)("flex items-center gap-1.5 whitespace-nowrap", a), k[35] = a, k[36] = c) : c = k[36], k[37] === Symbol.for("react.memo_cache_sentinel") ? (d = {
                opacity: 0
            }, u = {
                opacity: 1
            }, m = {
                opacity: 0
            }, h = {
                type: "spring",
                duration: .3,
                bounce: .05
            }, k[37] = d, k[38] = u, k[39] = m, k[40] = h) : (d = k[37], u = k[38], m = k[39], h = k[40]), k[41] !== i || k[42] !== E || k[43] !== s || k[44] !== S || k[45] !== _ ? (v = i && !_ ? (0, t.jsx)(C, {
                market: s,
                lastPrice: E
            }, `single-legend-${S}`) : (0, t.jsx)(j, {
                market: s,
                lastPrice: E
            }), k[41] = i, k[42] = E, k[43] = s, k[44] = S, k[45] = _, k[46] = v) : v = k[46], k[47] !== o || k[48] !== c || k[49] !== v ? (y = (0, t.jsx)(n.motion.div, {
                className: c,
                layout: "position",
                initial: d,
                animate: u,
                exit: m,
                transition: h,
                ...o,
                children: v
            }), k[47] = o, k[48] = c, k[49] = v, k[50] = y) : y = k[50], y
        },
        T = () => {
            let e, i, n, s, c, m, p, x, g, v = (0, r.c)(27);
            v[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], v[0] = e) : e = v[0];
            let {
                event: y
            } = (0, h.useEventContext)(e), {
                series: b,
                toDisplayValue: k
            } = (0, f.useChartContext)(), {
                hoverData: w
            } = (0, f.useChartHoverContext)(), S = u.slugToFormat[y ? .slug ? ? ""], j = "usd" === S, C = S && u.UNIT_LABELS[S] ? ` ${u.UNIT_LABELS[S]}` : "";
            e: {
                let e;
                if (w && w.length > 0) {
                    let e = w[0];
                    if (e ? .point ? .value !== void 0) {
                        let t;
                        v[1] !== e.point.value || v[2] !== k ? (t = Math.round(k(e.point.value)), v[1] = e.point.value, v[2] = k, v[3] = t) : t = v[3], i = t;
                        break e
                    }
                }
                let t = b[0] ? .data[b[0].data.length - 1];
                if (!t) {
                    i = void 0;
                    break e
                }
                v[4] !== t.value || v[5] !== k ? (e = Math.round(k(t.value)), v[4] = t.value, v[5] = k, v[6] = e) : e = v[6],
                i = e
            }
            let _ = i;
            t: {
                let e, t, r = b[0];
                if (!r ? .data ? .length) {
                    n = void 0;
                    break t
                }
                let a = r.data[0],
                    i = r.data[r.data.length - 1];
                if (!a || !i) {
                    n = void 0;
                    break t
                }
                v[7] !== i.value || v[8] !== k ? (e = Math.round(k(i.value)), v[7] = i.value, v[8] = k, v[9] = e) : e = v[9],
                v[10] !== a.value || v[11] !== k ? (t = Math.round(k(a.value)), v[10] = a.value, v[11] = k, v[12] = t) : t = v[12],
                n = e - t
            }
            let T = n;
            if (!y ? .estimatedValue || void 0 === _) return null;
            v[13] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)(l.Tooltip, {
                content: "Aggregate prediction based on recent trading activity.",
                side: "bottom",
                sideOffset: 8,
                collisionPadding: 8,
                className: "max-w-[200px]",
                children: (0, t.jsx)("button", {
                    type: "button",
                    className: "flex items-center",
                    children: (0, t.jsx)(o.IconBallCrystalFill18, {
                        className: "size-5 text-brand-500"
                    })
                })
            }), v[13] = s) : s = v[13];
            let M = C || void 0;
            return v[14] !== j ? (c = j ? {
                notation: "compact",
                style: "currency",
                currency: "USD",
                maximumFractionDigits: 3
            } : void 0, v[14] = j, v[15] = c) : c = v[15], v[16] === Symbol.for("react.memo_cache_sentinel") ? (m = {
                duration: 450,
                easing: "linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"
            }, v[16] = m) : m = v[16], v[17] !== _ || v[18] !== M || v[19] !== c ? (p = (0, t.jsx)(a.default, {
                value: _,
                suffix: M,
                format: c,
                trend: 0,
                transformTiming: m,
                className: "text-xl lg:text-2xl font-semibold text-brand-500 normal-nums!"
            }), v[17] = _, v[18] = M, v[19] = c, v[20] = p) : p = v[20], v[21] !== T || v[22] !== j ? (x = void 0 !== T && (0, t.jsx)(d.PriceChange, {
                className: "mt-1",
                priceChange: T,
                noDebounce: !0,
                decimalCount: 0,
                size: 12,
                suffix: j ? void 0 : "​",
                coerceToDollars: j
            }), v[21] = T, v[22] = j, v[23] = x) : x = v[23], v[24] !== p || v[25] !== x ? (g = (0, t.jsxs)("div", {
                className: "flex items-center gap-2",
                children: [s, p, x]
            }), v[24] = p, v[25] = x, v[26] = g) : g = v[26], g
        },
        M = e => {
            let a, s, o, l, c, d, u = (0, r.c)(17);
            if (u[0] !== e) {
                let {
                    closed: t,
                    style: r,
                    className: i,
                    ...n
                } = e;
                o = r, a = i, s = n, u[0] = e, u[1] = a, u[2] = s, u[3] = o
            } else a = u[1], s = u[2], o = u[3];
            let {
                visibleMarkets: h,
                options: x,
                useEstimateHistory: g
            } = (0, f.useChartContext)(), v = `${h.length}`;
            u[4] === Symbol.for("react.memo_cache_sentinel") ? (l = {
                enabled: !0,
                wait: 250
            }, u[4] = l) : l = u[4];
            let y = (0, m.useDeferredMounted)(l);
            if (!((x.showLogo || x.showLegend) && "price-market" === x.marketType && y || "price-market" !== x.marketType)) return null;
            if (g) {
                let e;
                return u[5] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(T, {}), u[5] = e) : e = u[5], e
            }
            return u[6] !== a || u[7] !== v || u[8] !== x.mode || u[9] !== x.outcomeMode || u[10] !== x.showLegend || u[11] !== s || u[12] !== o || u[13] !== h ? (c = x.showLegend && (0, t.jsx)(n.motion.div, {
                className: (0, p.cn)("flex flex-col w-full gap-3 justify-center", a),
                layout: "size",
                style: {
                    height: "auto",
                    ...o
                },
                layoutDependency: v,
                transition: {
                    type: "spring",
                    duration: .3,
                    bounce: 0
                },
                ...s,
                children: (0, t.jsx)(i.AnimatePresence, {
                    initial: !1,
                    mode: "popLayout",
                    children: (0, t.jsx)("div", {
                        className: "flex flex-col items-start gap-y-1 sm:flex-row sm:items-center sm:gap-x-3 sm:flex-wrap",
                        children: h.map(e => (0, t.jsx)(_, {
                            market: e,
                            layoutDependency: v,
                            isSingleMode: "single" === x.mode
                        }, "single" !== x.mode && "single" !== x.outcomeMode && e.groupItemTitle ? e.groupItemTitle ? ? e.slug : e.conditionId))
                    })
                })
            }, "group-chart-legend"), u[6] = a, u[7] = v, u[8] = x.mode, u[9] = x.outcomeMode, u[10] = x.showLegend, u[11] = s, u[12] = o, u[13] = h, u[14] = c) : c = u[14], u[15] !== c ? (d = (0, t.jsx)("div", {
                className: "flex w-full gap-3",
                children: c
            }), u[15] = c, u[16] = d) : d = u[16], d
        };

    function N(e) {
        let a, i, n, s = (0, r.c)(6),
            {
                showLogo: o
            } = e;
        if (!o) return null;
        let l = "only-on-large-devices" === o && "max-lg:hidden",
            d = "only-below-large-devices" === o && "lg:hidden";
        return s[0] !== l || s[1] !== d ? (a = (0, p.cn)("ml-auto self-end", l, d), s[0] = l, s[1] = d, s[2] = a) : a = s[2], s[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(c.PolymarketLogoFull, {
            className: "h-6 w-auto text-text-secondary [&_path]:fill-neutral-200"
        }), s[3] = i) : i = s[3], s[4] !== a ? (n = (0, t.jsx)("div", {
            className: a,
            children: i
        }), s[4] = a, s[5] = n) : n = s[5], n
    }
    let I = (0, s.memo)(N);
    N.displayName = "ChartLogoView", I.displayName = "ChartLogo", e.s(["DesktopLegend", 0, e => {
        let a, i, n, s = (0, r.c)(13),
            {
                closed: o,
                style: l,
                className: c
            } = e,
            {
                options: d
            } = (0, f.useChartNavContext)(),
            {
                showLogo: u
            } = d;
        if (!u) {
            let e;
            return s[0] !== c || s[1] !== o || s[2] !== l ? (e = (0, t.jsx)(M, {
                closed: o,
                style: l,
                className: c
            }), s[0] = c, s[1] = o, s[2] = l, s[3] = e) : e = s[3], e
        }
        return s[4] !== c || s[5] !== o || s[6] !== l ? (a = (0, t.jsx)(M, {
            closed: o,
            style: l,
            className: c
        }), s[4] = c, s[5] = o, s[6] = l, s[7] = a) : a = s[7], s[8] !== u ? (i = (0, t.jsx)(I, {
            showLogo: u
        }), s[8] = u, s[9] = i) : i = s[9], s[10] !== a || s[11] !== i ? (n = (0, t.jsxs)("div", {
            className: "flex w-full gap-3",
            children: [a, i]
        }), s[10] = a, s[11] = i, s[12] = n) : n = s[12], n
    }], 251412);
    var P = e.i(149534);
    e.s(["IconArrowsCrossOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...t
    }) => s.default.createElement(P.Icon, {
        size: "18px",
        ...t
    }, s.default.createElement("polyline", {
        points: "10.75 15.25 15.25 15.25 15.25 10.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), s.default.createElement("line", {
        x1: "7",
        y1: "7",
        x2: "2.75",
        y2: "2.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), s.default.createElement("line", {
        x1: "15.25",
        y1: "15.25",
        x2: "11",
        y2: "11",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), s.default.createElement("polyline", {
        points: "10.75 2.75 15.25 2.75 15.25 7.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), s.default.createElement("line", {
        x1: "15.25",
        y1: "2.75",
        x2: "2.75",
        y2: "15.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))], 803907)
}, 925633, 382861, 192839, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(169010),
        i = e.i(803907),
        n = e.i(219469),
        s = e.i(215959),
        o = e.i(416340),
        l = e.i(412879),
        c = e.i(399336),
        d = e.i(891685),
        u = e.i(12884),
        m = e.i(148858),
        p = e.i(86831);

    function h(e) {
        let a, i, n, s, o, l, c = (0, r.c)(15),
            {
                value: d,
                options: u,
                onChange: h,
                className: x
            } = e;
        return c[0] !== x ? (a = (0, p.cn)("flex w-fit items-start z-2", x), c[0] = x, c[1] = a) : a = c[1], c[2] !== h ? (i = e => h(e), c[2] = h, c[3] = i) : i = c[3], c[4] !== u ? (n = u.map(f), c[4] = u, c[5] = n) : n = c[5], c[6] !== n ? (s = (0, t.jsx)(m.TabsList, {
            variant: "hidden",
            "aria-label": "Select chart window",
            className: "bg-transparent z-3 font-medium items-start overflow-hidden p-0",
            indicatorClassName: "h-7",
            children: n
        }), c[6] = n, c[7] = s) : s = c[7], c[8] !== i || c[9] !== s || c[10] !== d ? (o = (0, t.jsx)(m.Tabs, {
            value: d,
            onValueChange: i,
            children: s
        }), c[8] = i, c[9] = s, c[10] = d, c[11] = o) : o = c[11], c[12] !== a || c[13] !== o ? (l = (0, t.jsx)("div", {
            className: a,
            children: o
        }), c[12] = a, c[13] = o, c[14] = l) : l = c[14], l
    }

    function f(e) {
        return (0, t.jsx)(m.TabsTrigger, {
            value: e.value,
            disabled: e.disabled,
            className: (0, p.cn)("uppercase text-body-base font-semibold px-1.5", e.disabled && "opacity-50 hover:cursor-not-allowed bg-transparent text-text-tertiary"),
            children: e.label
        }, e.value)
    }
    var x = e.i(483940),
        g = e.i(925437),
        v = e.i(864006),
        y = e.i(604777),
        b = e.i(134709);
    let k = e => {
        let a, i, n, s, o, l, c, d = (0, r.c)(10),
            {
                closed: m,
                tabs: p
            } = e,
            {
                window: f,
                setWindow: k,
                options: w
            } = (0, u.useChartNavContext)(),
            {
                tabs: S
            } = (o = (0, r.c)(5), l = void 0 !== m && m, c = (0, y.useTranslations)(), (0, v.useLocale)(), o[0] !== l || o[1] !== c ? (n = g.CHART_WINDOWS.map((e, t) => ({
                label: ((e, t) => {
                    switch (e.toLowerCase()) {
                        case "1h":
                        default:
                            return t("chart.intervals.oneHour");
                        case "6h":
                            return t("chart.intervals.sixHours");
                        case "1d":
                            return t("chart.intervals.oneDay");
                        case "7d":
                            return t("chart.intervals.oneWeek");
                        case "30d":
                            return t("chart.intervals.oneMonth");
                        case "all":
                            return t("chart.intervals.all")
                    }
                })(e, c),
                value: e,
                disabled: !!l && t !== g.CHART_WINDOWS.length - 1
            })), o[0] = l, o[1] = c, o[2] = n) : n = o[2], o[3] !== n ? (s = {
                tabs: n
            }, o[3] = n, o[4] = s) : s = o[4], s),
            j = p ? ? S;
        if (!(0, b.default)()) {
            let e;
            return d[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)("div", {
                className: "flex w-fit items-start z-2"
            }), d[0] = e) : e = d[0], e
        }
        if (d[1] !== w || d[2] !== j) {
            let e;
            d[4] !== w ? (e = e => ({
                value: (0, x.unformatWindow)(e.value),
                label: w.timeWindowLabels ? .[(0, x.unformatWindow)(e.value)] ? ? e.label,
                disabled: e.disabled
            }), d[4] = w, d[5] = e) : e = d[5], a = j.map(e), d[1] = w, d[2] = j, d[3] = a
        } else a = d[3];
        let C = a;
        return d[6] !== C || d[7] !== k || d[8] !== f ? (i = (0, t.jsx)(h, {
            value: f,
            options: C,
            onChange: k
        }), d[6] = C, d[7] = k, d[8] = f, d[9] = i) : i = d[9], i
    };
    var w = e.i(158789),
        S = e.i(149534);
    let j = ({
        strokeWidth: e = 1.5,
        ...t
    }) => o.default.createElement(S.Icon, {
        size: "18px",
        ...t
    }, o.default.createElement("polyline", {
        points: "10.25 12.75 12.75 15.25 15.25 12.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), o.default.createElement("line", {
        x1: "12.75",
        y1: "15.25",
        x2: "12.75",
        y2: "6.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), o.default.createElement("line", {
        x1: "2.75",
        y1: "9.75",
        x2: "9.25",
        y2: "9.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), o.default.createElement("line", {
        x1: "2.75",
        y1: "6.25",
        x2: "9.25",
        y2: "6.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), o.default.createElement("line", {
        x1: "2.75",
        y1: "2.75",
        x2: "12.75",
        y2: "2.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));
    e.s(["IconDescendingSortingOutline18", 0, j], 382861);
    var C = e.i(870555),
        _ = e.i(489397);

    function T() {
        let e, a, i, n, s, l, c = (0, r.c)(25),
            d = (0, y.useTranslations)(),
            {
                toggleMarket: m,
                visibleMarkets: p,
                hiddenMarkets: h,
                colors: f
            } = (0, u.useChartContext)();
        c[0] !== h || c[1] !== p ? (e = () => [...p.map(P), ...h.map(I)], c[0] = h, c[1] = p, c[2] = e) : e = c[2];
        let [x] = o.default.useState(e);
        if (c[3] !== h || c[4] !== x || c[5] !== p) {
            let e, t = [...p.map(N), ...h.map(M)];
            c[7] !== x ? (e = (e, t) => x.indexOf(e.slug) - x.indexOf(t.slug), c[7] = x, c[8] = e) : e = c[8], a = t.sort(e), c[3] = h, c[4] = x, c[5] = p, c[6] = a
        } else a = c[6];
        let g = a,
            v = p.length >= 4;
        if (c[9] !== d ? (i = d("chart.options.showOnChart"), c[9] = d, c[10] = i) : i = c[10], c[11] !== i ? (n = (0, t.jsx)("p", {
                className: "px-2.5 py-1.5 mb-1 text-sm font-medium text-text-secondary",
                children: i
            }), c[11] = i, c[12] = n) : n = c[12], c[13] !== v || c[14] !== f || c[15] !== g || c[16] !== m) {
            let e;
            c[18] !== v || c[19] !== f || c[20] !== m ? (e = e => {
                let r = !e.visible && v;
                return (0, t.jsxs)("button", {
                    type: "button",
                    disabled: r,
                    className: "flex cursor-pointer items-center gap-2 rounded-sm px-2.5 py-2 pr-2.5 text-sm outline-hidden select-none hover:bg-neutral-50 disabled:pointer-events-none disabled:opacity-50 w-full",
                    onClick: () => m(e, e.visible ? "hide" : "show"),
                    children: [(0, t.jsx)("span", {
                        className: "shrink-0 size-2.5 rounded-full",
                        style: {
                            background: e.visible && e.color ? f[e.color].color : "var(--color-neutral-100)"
                        }
                    }), (0, t.jsx)("span", {
                        className: "truncate flex-1 text-left text-text-primary",
                        children: e.groupItemTitle ? ? e.question
                    }), (0, t.jsx)(_.Switch.Root, {
                        checked: e.visible,
                        disabled: r,
                        className: "pointer-events-none relative h-[20px] min-w-[35px] w-[35px] shrink-0 rounded-full data-[state=unchecked]:bg-neutral-100 data-[state=unchecked]:dark:bg-neutral-200 shadow-sm outline-none data-[state=checked]:bg-brand-500 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",
                        children: (0, t.jsx)(_.Switch.Thumb, {
                            className: "block size-[16px] translate-x-0.5 rounded-full bg-white shadow-[0_2px_2px] shadow-[black]/10 will-change-transform data-[state=checked]:translate-x-[17px] transition-transform"
                        })
                    })]
                }, e.slug)
            }, c[18] = v, c[19] = f, c[20] = m, c[21] = e) : e = c[21], s = g.map(e), c[13] = v, c[14] = f, c[15] = g, c[16] = m, c[17] = s
        } else s = c[17];
        return c[22] !== n || c[23] !== s ? (l = (0, t.jsxs)(t.Fragment, {
            children: [n, s]
        }), c[22] = n, c[23] = s, c[24] = l) : l = c[24], l
    }

    function M(e) {
        return { ...e,
            visible: !1,
            color: void 0
        }
    }

    function N(e) {
        return { ...e,
            visible: !0
        }
    }

    function I(e) {
        return e.slug
    }

    function P(e) {
        return e.slug
    }
    let E = () => {
        let e, a, i, n, s, l = (0, r.c)(9),
            [c, d] = (0, o.useState)(!1),
            u = c ? "text-text-primary" : "text-text-secondary";
        return l[0] !== u ? (e = (0, C.cn)("hover:text-text-primary cursor-pointer", u), l[0] = u, l[1] = e) : e = l[1], l[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(j, {}), l[2] = a) : a = l[2], l[3] !== e ? (i = (0, t.jsx)(w.DropdownMenuTrigger, {
            asChild: !0,
            children: (0, t.jsx)("button", {
                type: "button",
                className: e,
                children: a
            })
        }), l[3] = e, l[4] = i) : i = l[4], l[5] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)(w.DropdownMenuPortal, {
            children: (0, t.jsx)(w.DropdownMenuContent, {
                align: "end",
                side: "bottom",
                sideOffset: 6,
                avoidCollisions: !1,
                className: "w-[280px] max-h-[300px]",
                onCloseAutoFocus: A,
                children: (0, t.jsx)(T, {})
            })
        }), l[5] = n) : n = l[5], l[6] !== c || l[7] !== i ? (s = (0, t.jsxs)(w.DropdownMenu, {
            open: c,
            onOpenChange: d,
            modal: !1,
            children: [i, n]
        }), l[6] = c, l[7] = i, l[8] = s) : s = l[8], s
    };

    function A(e) {
        return e.preventDefault()
    }
    var O = e.i(636071),
        D = e.i(438015);

    function L(e) {
        let a, i, n = (0, r.c)(4),
            {
                checked: s,
                disabled: o
            } = e;
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(_.Switch.Thumb, {
            className: "block size-[16px] translate-x-0.5 rounded-full bg-white shadow-[0_2px_2px] shadow-[black]/10 will-change-transform data-[state=checked]:translate-x-[17px] transition-transform"
        }), n[0] = a) : a = n[0], n[1] !== s || n[2] !== o ? (i = (0, t.jsx)(_.Switch.Root, {
            checked: s,
            disabled: o,
            className: "pointer-events-none relative h-[20px] min-w-[35px] w-[35px] shrink-0 rounded-full data-[state=unchecked]:bg-neutral-100 data-[state=unchecked]:dark:bg-neutral-200 shadow-sm outline-none data-[state=checked]:bg-brand-500 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",
            children: a
        }), n[1] = s, n[2] = o, n[3] = i) : i = n[3], i
    }

    function z() {
        let e, a, i, n, s, o, l, c, d, m, p, h, f, x, g, v, b, k, S = (0, r.c)(58),
            j = (0, y.useTranslations)(),
            {
                autoscale: C,
                setAutoscale: _,
                xAxisVisible: T,
                setXAxisVisible: M,
                yAxisVisible: N,
                setYAxisVisible: I,
                horizontalGridVisible: P,
                setHorizontalGridVisible: E,
                verticalGridVisible: A,
                setVerticalGridVisible: O,
                options: L,
                showBothOutcomes: z,
                setShowBothOutcomes: F
            } = (0, u.useChartSettingsContext)(),
            {
                annotationsVisible: $,
                setAnnotationsVisible: B
            } = (0, D.useAnnotationsContext)();
        S[0] !== j ? (e = j("chart.settings.autoscale"), S[0] = j, S[1] = e) : e = S[1], S[2] !== C || S[3] !== _ || S[4] !== e ? (a = {
            label: e,
            checked: C,
            onChange: _
        }, S[2] = C, S[3] = _, S[4] = e, S[5] = a) : a = S[5], S[6] !== j ? (i = j("chart.settings.xAxis"), S[6] = j, S[7] = i) : i = S[7], S[8] !== M || S[9] !== i || S[10] !== T ? (n = {
            label: i,
            checked: T,
            onChange: M
        }, S[8] = M, S[9] = i, S[10] = T, S[11] = n) : n = S[11], S[12] !== j ? (s = j("chart.settings.yAxis"), S[12] = j, S[13] = s) : s = S[13], S[14] !== I || S[15] !== s || S[16] !== N ? (o = {
            label: s,
            checked: N,
            onChange: I
        }, S[14] = I, S[15] = s, S[16] = N, S[17] = o) : o = S[17], S[18] !== j ? (l = j("chart.settings.horizontalGrid"), S[18] = j, S[19] = l) : l = S[19], S[20] !== P || S[21] !== E || S[22] !== l ? (c = {
            label: l,
            checked: P,
            onChange: E
        }, S[20] = P, S[21] = E, S[22] = l, S[23] = c) : c = S[23], S[24] !== j ? (d = j("chart.settings.verticalGrid"), S[24] = j, S[25] = d) : d = S[25], S[26] !== O || S[27] !== d || S[28] !== A ? (m = {
            label: d,
            checked: A,
            onChange: O
        }, S[26] = O, S[27] = d, S[28] = A, S[29] = m) : m = S[29], S[30] !== j ? (p = j("chart.settings.annotations"), S[30] = j, S[31] = p) : p = S[31], S[32] !== $ || S[33] !== B || S[34] !== p ? (h = {
            label: p,
            checked: $,
            onChange: B
        }, S[32] = $, S[33] = B, S[34] = p, S[35] = h) : h = S[35], S[36] !== L.mode || S[37] !== F || S[38] !== z || S[39] !== j ? (f = "single" === L.mode ? [{
            label: j("chart.settings.bothOutcomes"),
            checked: z,
            onChange: F
        }] : [], S[36] = L.mode, S[37] = F, S[38] = z, S[39] = j, S[40] = f) : f = S[40], S[41] !== a || S[42] !== h || S[43] !== f || S[44] !== n || S[45] !== o || S[46] !== c || S[47] !== m ? (x = [a, n, o, c, m, h, ...f], S[41] = a, S[42] = h, S[43] = f, S[44] = n, S[45] = o, S[46] = c, S[47] = m, S[48] = x) : x = S[48];
        let q = x;
        return S[49] !== j ? (g = j("chart.settings.settings"), S[49] = j, S[50] = g) : g = S[50], S[51] !== g ? (v = (0, t.jsx)(w.DropdownMenuLabel, {
            children: g
        }), S[51] = g, S[52] = v) : v = S[52], S[53] !== q ? (b = q.map(R), S[53] = q, S[54] = b) : b = S[54], S[55] !== v || S[56] !== b ? (k = (0, t.jsxs)(t.Fragment, {
            children: [v, b]
        }), S[55] = v, S[56] = b, S[57] = k) : k = S[57], k
    }

    function R(e) {
        return (0, t.jsxs)(w.DropdownMenuItem, {
            className: "pr-2.5",
            onSelect: t => {
                t.preventDefault(), e.onChange(!e.checked)
            },
            children: [(0, t.jsx)("span", {
                className: "flex-1 truncate",
                children: e.label
            }), (0, t.jsx)(L, {
                checked: e.checked
            })]
        }, e.label)
    }
    let F = () => {
        let e, a, i, n, s, l = (0, r.c)(9),
            [c, d] = (0, o.useState)(!1),
            u = c ? "text-text-primary" : "text-text-secondary";
        return l[0] !== u ? (e = (0, C.cn)("hover:text-text-primary cursor-pointer", u), l[0] = u, l[1] = e) : e = l[1], l[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(O.IconGearOutline18, {}), l[2] = a) : a = l[2], l[3] !== e ? (i = (0, t.jsx)(w.DropdownMenuTrigger, {
            asChild: !0,
            children: (0, t.jsx)("button", {
                type: "button",
                className: e,
                children: a
            })
        }), l[3] = e, l[4] = i) : i = l[4], l[5] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)(w.DropdownMenuPortal, {
            children: (0, t.jsx)(w.DropdownMenuContent, {
                align: "end",
                side: "bottom",
                sideOffset: 6,
                className: "w-[240px]",
                onCloseAutoFocus: $,
                children: (0, t.jsx)(z, {})
            })
        }), l[5] = n) : n = l[5], l[6] !== c || l[7] !== i ? (s = (0, t.jsxs)(w.DropdownMenu, {
            open: c,
            onOpenChange: d,
            children: [i, n]
        }), l[6] = c, l[7] = i, l[8] = s) : s = l[8], s
    };

    function $(e) {
        return e.preventDefault()
    }
    var B = e.i(6204);
    let q = () => {
        let e, o, m, p, h, f, x, g, v, y, b, w, S, j, C = (0, r.c)(35);
        C[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], C[0] = e) : e = C[0];
        let {
            activeMarket: _
        } = (0, c.useEventActiveMarketContext)(e);
        C[1] === Symbol.for("react.memo_cache_sentinel") ? (o = ["event"], C[1] = o) : o = C[1];
        let {
            event: T
        } = (0, d.useEventContext)(o), {
            options: M,
            selectedAssetIndex: N,
            setSelectedAssetIndex: I,
            showBothOutcomes: P,
            canShowEstimate: A,
            estimateViewEnabled: O,
            setEstimateViewEnabled: D,
            useEstimateHistory: L
        } = (0, u.useChartNavContext)();
        C[2] === Symbol.for("react.memo_cache_sentinel") ? (m = ["isSportsPage"], C[2] = m) : m = C[2];
        let {
            isSportsPage: z
        } = (0, B.useSportsContext)(m);
        _ ? .outcomes;
        e: {
            if (!_ ? .outcomes ? .length) {
                p = "";
                break e
            }
            if (0 === N) {
                p = `Switch to ${_.outcomes[1]}`;
                break e
            }
            p = `Switch to ${_.outcomes[0]}`
        }
        let R = p,
            $ = O ? "Switch to market view" : "Switch to estimate view";
        return C[3] !== T || C[4] !== z ? (h = !z && T && (0, t.jsx)(l.EventMetadata, {
            className: "flex gap-x-2.5 items-center"
        }), C[3] = T, C[4] = z, C[5] = h) : h = C[5], C[6] === Symbol.for("react.memo_cache_sentinel") ? (f = (0, t.jsx)(k, {}), C[6] = f) : f = C[6], C[7] !== z || C[8] !== M.showOptions || C[9] !== L ? (x = M.showOptions && !L && !z && (0, t.jsx)(s.motion.div, {
            initial: {
                opacity: 0,
                width: 0
            },
            animate: {
                opacity: 1,
                width: "auto",
                transition: {
                    width: {
                        type: "spring",
                        duration: .3,
                        bounce: 0
                    },
                    opacity: {
                        duration: .2,
                        delay: .05
                    }
                }
            },
            exit: {
                opacity: 0,
                width: 0,
                transition: {
                    width: {
                        type: "spring",
                        duration: .25,
                        bounce: 0
                    },
                    opacity: {
                        duration: .1
                    }
                }
            },
            className: "overflow-hidden flex items-center mt-1",
            children: (0, t.jsx)(E, {})
        }, "chart-options"), C[7] = z, C[8] = M.showOptions, C[9] = L, C[10] = x) : x = C[10], C[11] !== x ? (g = (0, t.jsx)(n.AnimatePresence, {
            initial: !1,
            children: x
        }), C[11] = x, C[12] = g) : g = C[12], C[13] !== A || C[14] !== $ || C[15] !== D ? (v = A && (0, t.jsx)(s.motion.div, {
            initial: {
                opacity: 0,
                scale: .9
            },
            animate: {
                opacity: 1,
                scale: 1
            },
            exit: {
                opacity: 0,
                scale: .9
            },
            className: "flex items-center",
            children: (0, t.jsx)(a.Tooltip, {
                content: $,
                delayDuration: 50,
                side: "top",
                sideOffset: 4,
                children: (0, t.jsx)("button", {
                    type: "button",
                    className: "hover:text-text-primary cursor-pointer text-text-secondary",
                    onClick: () => D(V),
                    children: (0, t.jsx)(i.IconArrowsCrossOutline18, {})
                })
            })
        }, "estimate-toggle"), C[13] = A, C[14] = $, C[15] = D, C[16] = v) : v = C[16], C[17] !== _ || C[18] !== M.mode || C[19] !== I || C[20] !== P || C[21] !== R ? (y = "single" === M.mode && !P && _ && (0, t.jsx)(s.motion.div, {
            initial: {
                opacity: 0,
                scale: .9
            },
            animate: {
                opacity: 1,
                scale: 1
            },
            exit: {
                opacity: 0,
                scale: .9
            },
            className: "flex items-center",
            children: (0, t.jsx)(a.Tooltip, {
                content: R,
                delayDuration: 50,
                side: "top",
                sideOffset: 4,
                children: (0, t.jsx)("button", {
                    type: "button",
                    className: "hover:text-text-primary cursor-pointer text-text-secondary",
                    onClick: () => I(H),
                    children: (0, t.jsx)(i.IconArrowsCrossOutline18, {})
                })
            })
        }, "arrows"), C[17] = _, C[18] = M.mode, C[19] = I, C[20] = P, C[21] = R, C[22] = y) : y = C[22], C[23] !== v || C[24] !== y ? (b = (0, t.jsxs)(n.AnimatePresence, {
            mode: "popLayout",
            children: [v, y]
        }), C[23] = v, C[24] = y, C[25] = b) : b = C[25], C[26] !== M.showSettings ? (w = M.showSettings && (0, t.jsx)(F, {}), C[26] = M.showSettings, C[27] = w) : w = C[27], C[28] !== b || C[29] !== w || C[30] !== g ? (S = (0, t.jsxs)("div", {
            className: "flex items-center gap-1 ml-auto",
            children: [f, (0, t.jsxs)("div", {
                className: "ml-1 flex items-center gap-3",
                children: [g, b, w]
            })]
        }), C[28] = b, C[29] = w, C[30] = g, C[31] = S) : S = C[31], C[32] !== S || C[33] !== h ? (j = (0, t.jsxs)("div", {
            className: "hidden lg:flex w-full items-center justify-between",
            children: [h, S]
        }), C[32] = S, C[33] = h, C[34] = j) : j = C[34], j
    };

    function V(e) {
        return !e
    }

    function H(e) {
        return +(0 === e)
    }
    let U = () => {
        let e, a, n, s, o, c, m, p, h, f, x = (0, r.c)(27),
            {
                event: b,
                options: w,
                setSettingsOpen: S,
                showBothOutcomes: j,
                setSelectedAssetIndex: C,
                canShowEstimate: _,
                setEstimateViewEnabled: T
            } = (0, u.useChartNavContext)();
        x[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], x[0] = e) : e = x[0];
        let {
            event: M
        } = (0, d.useEventContext)(e), {
            tabs: N
        } = function(e, t) {
            let a, i, n, s, o = (0, r.c)(15),
                l = void 0 !== t && t,
                c = (0, y.useTranslations)();
            (0, v.useLocale)(), o[0] !== e ? (a = e ? Date.now() - new Date(e).getTime() : 5184e6, o[0] = e, o[1] = a) : a = o[1];
            let d = a;
            if (o[2] !== d) i = new Set(d < 864e5 ? ["1H", "6H", "ALL"] : d < 6048e5 ? ["1H", "6H", "1D", "ALL"] : d < 2592e6 ? ["1H", "6H", "1D", "7D", "ALL"] : ["1H", "1D", "7D", "30D", "ALL"]), o[2] = d, o[3] = i;
            else i = o[3];
            let u = i;
            if (o[4] !== l || o[5] !== u || o[6] !== c) {
                let e, t;
                o[8] !== u ? (e = e => u.has(e), o[8] = u, o[9] = e) : e = o[9], o[10] !== l || o[11] !== c ? (t = (e, t, r) => ({
                    label: ((e, t) => {
                        switch (e.toLowerCase()) {
                            case "1h":
                                return t("chart.intervals.oneHour");
                            case "6h":
                                return t("chart.intervals.sixHours");
                            case "1d":
                                return t("chart.intervals.oneDay");
                            case "7d":
                                return t("chart.intervals.oneWeek");
                            case "30d":
                                return t("chart.intervals.oneMonth");
                            case "all":
                                return t("chart.intervals.max");
                            default:
                                return e
                        }
                    })(e, c),
                    value: e,
                    disabled: !!l && t !== r.length - 1
                }), o[10] = l, o[11] = c, o[12] = t) : t = o[12], n = g.CHART_WINDOWS.filter(e).map(t), o[4] = l, o[5] = u, o[6] = c, o[7] = n
            } else n = o[7];
            let m = n;
            return o[13] !== m ? (s = {
                tabs: m
            }, o[13] = m, o[14] = s) : s = o[14], s
        }(b.startDate ? ? M ? .startDate ? ? void 0, b.closed ? ? M ? .closed ? ? void 0);
        x[1] !== C ? (a = () => {
            C(W)
        }, x[1] = C, x[2] = a) : a = x[2];
        let I = a;
        return x[3] !== M ? (n = M && (0, t.jsx)(l.EventMetadata, {
            showDate: !1,
            showCreator: !1,
            showHoldingRewards: !1
        }), x[3] = M, x[4] = n) : n = x[4], x[5] !== n ? (s = (0, t.jsx)("div", {
            className: "flex-1",
            children: n
        }), x[5] = n, x[6] = s) : s = x[6], x[7] !== N ? (o = (0, t.jsx)("div", {
            className: "flex items-center",
            children: (0, t.jsx)(k, {
                tabs: N
            })
        }), x[7] = N, x[8] = o) : o = x[8], x[9] !== _ || x[10] !== T ? (c = _ && (0, t.jsx)("button", {
            type: "button",
            className: "flex items-center gap-1 text-text-secondary hover:text-text-primary transition cursor-pointer active:scale-95 text-sm",
            onClick: () => T(G),
            children: (0, t.jsx)(i.IconArrowsCrossOutline18, {})
        }), x[9] = _, x[10] = T, x[11] = c) : c = x[11], x[12] !== I || x[13] !== w.mode || x[14] !== j ? (m = "single" === w.mode && !j && (0, t.jsx)("button", {
            type: "button",
            className: "flex items-center gap-1 text-text-secondary hover:text-text-primary transition cursor-pointer active:scale-95 text-sm",
            onClick: I,
            children: (0, t.jsx)(i.IconArrowsCrossOutline18, {})
        }), x[12] = I, x[13] = w.mode, x[14] = j, x[15] = m) : m = x[15], x[16] !== w.showSettings || x[17] !== S ? (p = w.showSettings && (0, t.jsx)("button", {
            type: "button",
            className: "text-text-secondary hover:text-text-primary cursor-pointer",
            onClick: () => S(!0),
            children: (0, t.jsx)(O.IconGearOutline18, {})
        }), x[16] = w.showSettings, x[17] = S, x[18] = p) : p = x[18], x[19] !== c || x[20] !== m || x[21] !== p ? (h = (0, t.jsxs)("div", {
            className: "flex items-center gap-3.5",
            children: [c, m, p]
        }), x[19] = c, x[20] = m, x[21] = p, x[22] = h) : h = x[22], x[23] !== s || x[24] !== o || x[25] !== h ? (f = (0, t.jsx)("div", {
            className: "flex lg:hidden w-full flex-row gap-2.5",
            children: (0, t.jsxs)("div", {
                className: "flex w-full items-center gap-2.5",
                children: [s, o, h]
            })
        }), x[23] = s, x[24] = o, x[25] = h, x[26] = f) : f = x[26], f
    };

    function W(e) {
        return +(0 === e)
    }

    function G(e) {
        return !e
    }
    e.s(["ChartNav", 0, () => {
        let e, a = (0, r.c)(1);
        return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsxs)("div", {
            className: "flex w-full flex-1 box-border z-1",
            children: [(0, t.jsx)(U, {}), (0, t.jsx)(q, {})]
        }), a[0] = e) : e = a[0], e
    }], 925633);
    var Z = e.i(827525);
    e.s(["OptionsDrawer", 0, function() {
        let e, a, i, n, s, o = (0, r.c)(10),
            {
                optionsOpen: l,
                setOptionsOpen: c
            } = (0, u.useChartContext)();
        return o[0] !== c ? (e = (0, t.jsx)(Z.DrawerOverlay, {
            className: "z-9998",
            onClick: () => c(!1)
        }), o[0] = c, o[1] = e) : e = o[1], o[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(Z.DrawerHandle, {}), o[2] = a) : a = o[2], o[3] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsxs)(Z.DrawerContent, {
            className: "z-9999 fixed inset-x-0 bottom-0 min-h-[50dvh] max-h-[85dvh] rounded-t-xl border-t",
            children: [a, (0, t.jsx)("div", {
                className: "w-full flex-1 mx-auto flex flex-col overflow-auto bg-background",
                children: (0, t.jsx)(T, {})
            })]
        }), o[3] = i) : i = o[3], o[4] !== e ? (n = (0, t.jsxs)(Z.DrawerPortal, {
            children: [e, i]
        }), o[4] = e, o[5] = n) : n = o[5], o[6] !== l || o[7] !== c || o[8] !== n ? (s = (0, t.jsx)(Z.Drawer, {
            open: l,
            onOpenChange: c,
            modal: !0,
            children: n
        }), o[6] = l, o[7] = c, o[8] = n, o[9] = s) : s = o[9], s
    }], 192839)
}, 982214, e => {
    "use strict";
    e.s(["GroupChart", () => P, "GroupChartWithoutProvider", () => I], 982214);
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        i = e.i(688589),
        n = e.i(53950),
        s = e.i(870046),
        o = e.i(957902),
        l = e.i(944891),
        c = e.i(438015),
        d = e.i(12884),
        u = e.i(251412),
        m = e.i(925633),
        p = e.i(192839),
        h = e.i(827525),
        f = e.i(913909),
        x = e.i(399336),
        g = e.i(891685),
        v = e.i(435656),
        y = e.i(382861),
        b = e.i(604777);
    let k = e => {
        let a, i, n, s = (0, r.c)(8),
            {
                icon: o,
                label: l,
                onClick: c
            } = e;
        return s[0] !== o ? (a = (0, t.jsx)(o, {
            className: "text-text-primary shrink-0"
        }), s[0] = o, s[1] = a) : a = s[1], s[2] !== l ? (i = (0, t.jsx)("span", {
            className: "text-sm font-medium text-text-primary",
            children: l
        }), s[2] = l, s[3] = i) : i = s[3], s[4] !== c || s[5] !== a || s[6] !== i ? (n = (0, t.jsxs)("button", {
            type: "button",
            className: "flex items-center gap-2 cursor-pointer w-full py-1 px-3 hover:opacity-70 transition-opacity",
            onClick: c,
            children: [a, i]
        }), s[4] = c, s[5] = a, s[6] = i, s[7] = n) : n = s[7], n
    };
    var w = e.i(927249);
    let S = e => {
            let a, i, n, s, o, l = (0, r.c)(15),
                {
                    label: c,
                    checked: d,
                    onChange: u
                } = e;
            return l[0] !== d || l[1] !== u ? (a = () => u(!d), l[0] = d, l[1] = u, l[2] = a) : a = l[2], l[3] !== c ? (i = (0, t.jsx)("p", {
                className: "text-sm font-medium truncate text-text-primary",
                children: c
            }), l[3] = c, l[4] = i) : i = l[4], l[5] !== d || l[6] !== u ? (n = () => u(!d), l[5] = d, l[6] = u, l[7] = n) : n = l[7], l[8] !== d || l[9] !== n ? (s = (0, t.jsx)(w.Switch, {
                checked: d,
                onCheckedChange: n
            }), l[8] = d, l[9] = n, l[10] = s) : s = l[10], l[11] !== a || l[12] !== i || l[13] !== s ? (o = (0, t.jsxs)("button", {
                type: "button",
                className: "flex items-center cursor-pointer w-full justify-between gap-8 px-3",
                onClick: a,
                children: [i, s]
            }), l[11] = a, l[12] = i, l[13] = s, l[14] = o) : o = l[14], o
        },
        j = e => {
            let a, i, n, s, o, l, u, m, p, h, f, x, g, w, j, C, _, T, M, N = (0, r.c)(63),
                {
                    onEmbedClick: I
                } = e,
                P = (0, b.useTranslations)(),
                {
                    autoscale: E,
                    setAutoscale: A,
                    xAxisVisible: O,
                    setXAxisVisible: D,
                    yAxisVisible: L,
                    setYAxisVisible: z,
                    horizontalGridVisible: R,
                    setHorizontalGridVisible: F,
                    verticalGridVisible: $,
                    setVerticalGridVisible: B,
                    options: q,
                    showBothOutcomes: V,
                    setShowBothOutcomes: H,
                    setOptionsOpen: U
                } = (0, d.useChartSettingsContext)(),
                {
                    annotationsVisible: W,
                    setAnnotationsVisible: G
                } = (0, c.useAnnotationsContext)();
            return N[0] !== q.showOptions || N[1] !== U || N[2] !== P ? (a = q.showOptions && (0, t.jsx)("div", {
                className: "contents lg:hidden",
                children: (0, t.jsx)(k, {
                    icon: y.IconDescendingSortingOutline18,
                    label: P("chart.settings.chartOptions"),
                    onClick: () => U(!0)
                })
            }), N[0] = q.showOptions, N[1] = U, N[2] = P, N[3] = a) : a = N[3], N[4] !== P ? (i = P("chart.settings.embed"), N[4] = P, N[5] = i) : i = N[5], N[6] !== I || N[7] !== i ? (n = (0, t.jsx)(k, {
                icon: v.IconCode2Outline18,
                label: i,
                onClick: I
            }), N[6] = I, N[7] = i, N[8] = n) : n = N[8], N[9] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)("div", {
                className: "w-full h-px bg-popover-border my-2"
            }), N[9] = s) : s = N[9], N[10] !== P ? (o = P("chart.settings.autoscale"), N[10] = P, N[11] = o) : o = N[11], N[12] !== E || N[13] !== A || N[14] !== o ? (l = (0, t.jsx)(S, {
                label: o,
                checked: E,
                onChange: A
            }), N[12] = E, N[13] = A, N[14] = o, N[15] = l) : l = N[15], N[16] !== P ? (u = P("chart.settings.xAxis"), N[16] = P, N[17] = u) : u = N[17], N[18] !== D || N[19] !== u || N[20] !== O ? (m = (0, t.jsx)(S, {
                label: u,
                checked: O,
                onChange: D
            }), N[18] = D, N[19] = u, N[20] = O, N[21] = m) : m = N[21], N[22] !== P ? (p = P("chart.settings.yAxis"), N[22] = P, N[23] = p) : p = N[23], N[24] !== z || N[25] !== p || N[26] !== L ? (h = (0, t.jsx)(S, {
                label: p,
                checked: L,
                onChange: z
            }), N[24] = z, N[25] = p, N[26] = L, N[27] = h) : h = N[27], N[28] !== P ? (f = P("chart.settings.horizontalGrid"), N[28] = P, N[29] = f) : f = N[29], N[30] !== R || N[31] !== F || N[32] !== f ? (x = (0, t.jsx)(S, {
                label: f,
                checked: R,
                onChange: F
            }), N[30] = R, N[31] = F, N[32] = f, N[33] = x) : x = N[33], N[34] !== P ? (g = P("chart.settings.verticalGrid"), N[34] = P, N[35] = g) : g = N[35], N[36] !== B || N[37] !== g || N[38] !== $ ? (w = (0, t.jsx)(S, {
                label: g,
                checked: $,
                onChange: B
            }), N[36] = B, N[37] = g, N[38] = $, N[39] = w) : w = N[39], N[40] !== P ? (j = P("chart.settings.annotations"), N[40] = P, N[41] = j) : j = N[41], N[42] !== W || N[43] !== G || N[44] !== j ? (C = (0, t.jsx)(S, {
                label: j,
                checked: W,
                onChange: G
            }), N[42] = W, N[43] = G, N[44] = j, N[45] = C) : C = N[45], N[46] !== q.mode || N[47] !== H || N[48] !== V || N[49] !== P ? (_ = "single" === q.mode && (0, t.jsx)(S, {
                label: P("chart.settings.bothOutcomes"),
                checked: V,
                onChange: H
            }), N[46] = q.mode, N[47] = H, N[48] = V, N[49] = P, N[50] = _) : _ = N[50], N[51] !== h || N[52] !== x || N[53] !== w || N[54] !== C || N[55] !== _ || N[56] !== l || N[57] !== m ? (T = (0, t.jsx)("div", {
                className: "flex flex-col gap-2 overflow-y-scroll h-fit max-h-fit max-lg:pb-4",
                children: (0, t.jsxs)("div", {
                    className: "flex flex-col gap-2 max-lg:gap-3",
                    children: [l, m, h, x, w, C, _]
                })
            }), N[51] = h, N[52] = x, N[53] = w, N[54] = C, N[55] = _, N[56] = l, N[57] = m, N[58] = T) : T = N[58], N[59] !== a || N[60] !== T || N[61] !== n ? (M = (0, t.jsxs)("div", {
                className: "flex flex-col gap-2 w-full pt-4 md:pt-0",
                children: [a, n, s, T]
            }), N[59] = a, N[60] = T, N[61] = n, N[62] = M) : M = N[62], M
        };

    function C() {
        let e, i, n, s, o, l, c, u, m, p, v = (0, r.c)(23),
            {
                settingsOpen: y,
                setSettingsOpen: b
            } = (0, d.useChartNavContext)();
        v[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["event"], v[0] = e) : e = v[0];
        let {
            event: k
        } = (0, g.useEventContext)(e);
        v[1] === Symbol.for("react.memo_cache_sentinel") ? (i = ["activeMarket"], v[1] = i) : i = v[1];
        let {
            activeMarket: w
        } = (0, x.useEventActiveMarketContext)(i), [S, C] = (0, a.useState)(!1);
        v[2] !== b ? (n = () => {
            b(!1), C(!0)
        }, v[2] = b, v[3] = n) : n = v[3];
        let _ = n;
        return v[4] !== b ? (s = (0, t.jsx)(h.DrawerOverlay, {
            className: "z-9998",
            onClick: () => b(!1)
        }), v[4] = b, v[5] = s) : s = v[5], v[6] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)(h.DrawerHandle, {}), v[6] = o) : o = v[6], v[7] !== _ ? (l = (0, t.jsxs)(h.DrawerContent, {
            className: "z-9999 fixed inset-x-0 bottom-0 max-h-[80dvh] rounded-t-xl border-t",
            children: [o, (0, t.jsx)("div", {
                className: "w-full flex-1 mx-auto flex flex-col overflow-auto pt-2 bg-background",
                children: (0, t.jsx)(j, {
                    onEmbedClick: _
                })
            })]
        }), v[7] = _, v[8] = l) : l = v[8], v[9] !== s || v[10] !== l ? (c = (0, t.jsxs)(h.DrawerPortal, {
            children: [s, l]
        }), v[9] = s, v[10] = l, v[11] = c) : c = v[11], v[12] !== b || v[13] !== y || v[14] !== c ? (u = (0, t.jsx)(h.Drawer, {
            open: y,
            onOpenChange: b,
            modal: !0,
            children: c
        }), v[12] = b, v[13] = y, v[14] = c, v[15] = u) : u = v[15], v[16] !== w || v[17] !== S || v[18] !== k ? (m = k && w && (0, t.jsx)(f.EmbedMarketResponsiveDialog, {
            event: k,
            market: w,
            open: S,
            onOpenChange: C,
            trigger: (0, t.jsx)("span", {
                className: "hidden"
            })
        }), v[16] = w, v[17] = S, v[18] = k, v[19] = m) : m = v[19], v[20] !== u || v[21] !== m ? (p = (0, t.jsxs)(t.Fragment, {
            children: [u, m]
        }), v[20] = u, v[21] = m, v[22] = p) : p = v[22], p
    }

    function _() {
        let e, a = (0, r.c)(3),
            {
                annotationsDrawerOpen: i,
                setAnnotationsDrawerOpen: n
            } = (0, c.useAnnotationsContext)();
        return a[0] !== i || a[1] !== n ? (e = (0, t.jsx)(o.AnnotationDrawer, {
            showTrigger: !1,
            showHeader: !0,
            open: i,
            onOpenChange: n
        }), a[0] = i, a[1] = n, a[2] = e) : e = a[2], e
    }

    function T(e) {
        let a, i, n, s, o, h, f, x, g, v = (0, r.c)(25),
            {
                children: y,
                componentHeight: b
            } = e,
            {
                options: k
            } = (0, d.useChartNavContext)(),
            {
                annotations: w
            } = (0, c.useAnnotationsContext)(),
            S = !!w ? .length;
        v[0] !== b ? (a = {
            "--chart-height": b
        }, v[0] = b, v[1] = a) : a = v[1];
        let j = a;
        v[2] !== k.oddsDisplay ? (i = "tooltip" === k.oddsDisplay && (0, t.jsx)("div", {
            className: "mt-1.5",
            children: (0, t.jsx)(u.DesktopLegend, {}, "group-chart-legend")
        }), v[2] = k.oddsDisplay, v[3] = i) : i = v[3];
        let T = S ? "mt-14" : "mt-2 lg:mt-4";
        return v[4] !== k.showTimeWindows ? (n = k.showTimeWindows && (0, t.jsx)(m.ChartNav, {}), v[4] = k.showTimeWindows, v[5] = n) : n = v[5], v[6] !== k.showSettings ? (s = k.showSettings && (0, t.jsx)(C, {}), v[6] = k.showSettings, v[7] = s) : s = v[7], v[8] !== k.showOptions ? (o = k.showOptions && (0, t.jsx)(p.OptionsDrawer, {}), v[8] = k.showOptions, v[9] = o) : o = v[9], v[10] !== k.showAnnotationsDrawer ? (h = k.showAnnotationsDrawer && (0, t.jsx)(_, {}), v[10] = k.showAnnotationsDrawer, v[11] = h) : h = v[11], v[12] !== s || v[13] !== o || v[14] !== h ? (f = (0, t.jsxs)(l.Media, {
            lessThan: "lg",
            children: [s, o, h]
        }), v[12] = s, v[13] = o, v[14] = h, v[15] = f) : f = v[15], v[16] !== T || v[17] !== n || v[18] !== f ? (x = (0, t.jsxs)("div", {
            className: T,
            children: [n, f]
        }), v[16] = T, v[17] = n, v[18] = f, v[19] = x) : x = v[19], v[20] !== y || v[21] !== x || v[22] !== j || v[23] !== i ? (g = (0, t.jsxs)("div", {
            style: j,
            className: "flex flex-col w-full min-h-[var(--chart-height)] h-auto",
            children: [i, y, x]
        }, "group-chart"), v[20] = y, v[21] = x, v[22] = j, v[23] = i, v[24] = g) : g = v[24], g
    }
    T.displayName = "ChartLayout";
    let M = a.default.memo(T, (e, t) => e.componentHeight === t.componentHeight && e.children === t.children),
        N = (e, t) => {
            let a, i, n, s, o, l, c = (0, r.c)(41);
            c[0] !== e ? (a = e ? ? {}, c[0] = e, c[1] = a) : a = c[1];
            let {
                forcedWindow: d,
                initialWindow: u,
                mode: m,
                showLegend: p,
                legendMode: h,
                showSettings: f,
                showOptions: x,
                showAnnotationsDrawer: g,
                showTimeWindows: v,
                timeWindowLabels: y,
                showLogo: b,
                showSingleModeLegend: k,
                height: w,
                yAxisOrientation: S,
                backfillData: j,
                annotationMode: C,
                outcomeMode: _,
                customLabels: T,
                tooltipOptions: M,
                oddsDisplay: N,
                xAxisOffset: I,
                margin: P,
                yAxisEnabled: E,
                xAxisEnabled: A,
                forceShowAllMarkets: O,
                startColor: D,
                endColor: L,
                marketType: z,
                gameStartTime: R
            } = a, F = void 0 === m ? "group" : m, $ = void 0 === p || p;
            c[2] !== h ? (i = void 0 === h ? {
                desktop: "default",
                mobile: "default"
            } : h, c[2] = h, c[3] = i) : i = c[3];
            let B = i,
                q = void 0 === f || f,
                V = void 0 === x || x,
                H = void 0 !== g && g,
                U = void 0 === v || v,
                W = void 0 === b || b,
                G = void 0 !== k && k,
                Z = void 0 === w ? 288 : w,
                K = void 0 === S ? "right" : S,
                Y = void 0 !== j && j,
                Q = void 0 === _ ? "default" : _;
            c[4] !== T ? (n = void 0 === T ? {
                enabled: !1
            } : T, c[4] = T, c[5] = n) : n = c[5];
            let X = n;
            c[6] !== M ? (s = void 0 === M ? {
                mode: "default"
            } : M, c[6] = M, c[7] = s) : s = c[7];
            let J = s,
                ee = void 0 === N ? "tooltip" : N,
                et = void 0 === I ? 0 : I,
                er = void 0 === E || E,
                ea = void 0 === A || A,
                ei = void 0 !== O && O,
                en = void 0 === z ? "default" : z;
            c[8] !== Y || c[9] !== X || c[10] !== L || c[11] !== ei || c[12] !== d || c[13] !== R || c[14] !== u || c[15] !== B || c[16] !== P || c[17] !== en || c[18] !== F || c[19] !== ee || c[20] !== Q || c[21] !== H || c[22] !== $ || c[23] !== W || c[24] !== V || c[25] !== q || c[26] !== G || c[27] !== U || c[28] !== D || c[29] !== y || c[30] !== J || c[31] !== ea || c[32] !== et || c[33] !== er || c[34] !== K ? (o = {
                forcedWindow: d,
                initialWindow: u,
                mode: F,
                outcomeMode: Q,
                showLegend: $,
                legendMode: B,
                showSettings: q,
                showOptions: V,
                showAnnotationsDrawer: H,
                showTimeWindows: U,
                timeWindowLabels: y,
                showLogo: W,
                showSingleModeLegend: G,
                yAxisOrientation: K,
                backfillData: Y,
                customLabels: X,
                tooltipOptions: J,
                oddsDisplay: ee,
                xAxisOffset: et,
                margin: P,
                yAxisEnabled: er,
                xAxisEnabled: ea,
                forceShowAllMarkets: ei,
                startColor: D,
                endColor: L,
                marketType: en,
                gameStartTime: R
            }, c[8] = Y, c[9] = X, c[10] = L, c[11] = ei, c[12] = d, c[13] = R, c[14] = u, c[15] = B, c[16] = P, c[17] = en, c[18] = F, c[19] = ee, c[20] = Q, c[21] = H, c[22] = $, c[23] = W, c[24] = V, c[25] = q, c[26] = G, c[27] = U, c[28] = D, c[29] = y, c[30] = J, c[31] = ea, c[32] = et, c[33] = er, c[34] = K, c[35] = o) : o = c[35];
            let es = `${Z-48}px`,
                eo = `${void 0!==t&&t?Z+100:Z}px`;
            return c[36] !== C || c[37] !== o || c[38] !== es || c[39] !== eo ? (l = {
                options: o,
                chartHeight: es,
                layoutHeight: eo,
                annotationMode: C
            }, c[36] = C, c[37] = o, c[38] = es, c[39] = eo, c[40] = l) : l = c[40], l
        },
        I = e => {
            let a, n, o, l, d = (0, r.c)(11),
                {
                    options: u,
                    annotations: m,
                    children: p
                } = e,
                {
                    chartHeight: h,
                    layoutHeight: f,
                    annotationMode: x
                } = N(u, !!m ? .length);
            d[0] !== h || d[1] !== p ? (a = (0, t.jsx)(s.Chart, {
                height: h,
                children: p
            }), d[0] = h, d[1] = p, d[2] = a) : a = d[2];
            let g = a;
            d[3] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)(t.Fragment, {}), d[3] = n) : n = d[3];
            let v = x ? ? "bottom-bar";
            return d[4] !== g || d[5] !== f ? (o = (0, t.jsx)(M, {
                componentHeight: f,
                children: g
            }), d[4] = g, d[5] = f, d[6] = o) : o = d[6], d[7] !== m || d[8] !== v || d[9] !== o ? (l = (0, t.jsx)(i.ErrorBoundary, {
                onError: E,
                fallback: n,
                children: (0, t.jsx)(c.AnnotationsContextProvider, {
                    annotations: m,
                    annotationMode: v,
                    xAxisTopOffset: 46,
                    enabled: !0,
                    children: o
                })
            }), d[7] = m, d[8] = v, d[9] = o, d[10] = l) : l = d[10], l
        },
        P = e => {
            let a, i, n, s, o = (0, r.c)(16),
                {
                    markets: l,
                    lowChanceMarkets: c,
                    resolvedMarkets: u,
                    event: m,
                    options: p,
                    customColors: h,
                    annotations: f,
                    children: x
                } = e;
            o[0] !== c ? (a = void 0 === c ? [] : c, o[0] = c, o[1] = a) : a = o[1];
            let g = a;
            o[2] !== u ? (i = void 0 === u ? [] : u, o[2] = u, o[3] = i) : i = o[3];
            let v = i,
                {
                    options: y
                } = N(p, !!f ? .length);
            return o[4] !== f || o[5] !== x || o[6] !== p ? (n = (0, t.jsx)(I, {
                options: p,
                annotations: f,
                children: x
            }), o[4] = f, o[5] = x, o[6] = p, o[7] = n) : n = o[7], o[8] !== h || o[9] !== m || o[10] !== g || o[11] !== l || o[12] !== y || o[13] !== v || o[14] !== n ? (s = (0, t.jsx)(d.ChartContextProvider, {
                markets: l,
                lowChanceMarkets: g,
                resolvedMarkets: v,
                event: m,
                options: y,
                customColors: h,
                children: n
            }), o[8] = h, o[9] = m, o[10] = g, o[11] = l, o[12] = y, o[13] = v, o[14] = n, o[15] = s) : s = o[15], s
        };

    function E(e, t) {
        return n.logger.error("Error rendering group chart", {
            error: e,
            errorInfo: t
        })
    }
}]);

//# debugId=7549c676-e8f0-d5bd-db84-d8e3895c8794