;
! 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] = "2cca2563-6a4d-fb59-a6d6-2919182ea197")
    } catch (e) {}
}();
(globalThis.TURBOPACK || (globalThis.TURBOPACK = [])).push(["object" == typeof document ? document.currentScript : void 0, 893299, 403591, e => {
    "use strict";
    var t = e.i(284553),
        r = e.i(30408),
        a = e.i(655740),
        n = e.i(313582),
        i = e.i(631222);
    let s = async e => {
            try {
                let [t, r, n, i, s] = e.queryKey, o = new URLSearchParams({
                    tag: n,
                    status: i
                });
                s && "en" !== s && o.set("locale", s);
                let {
                    data: l
                } = await a.axios.get(`/api/tags/filtered?${o.toString()}`);
                return l
            } catch {
                return []
            }
        },
        o = async e => {
            try {
                let [t, r, n, i, s] = e.queryKey, o = new URLSearchParams({
                    tag: n,
                    status: i
                });
                s && "en" !== s && o.set("locale", s);
                let {
                    data: l
                } = await a.axios.get(`/api/tags/filteredBySlug?${o.toString()}`);
                return l
            } catch {
                return []
            }
        },
        l = async (e, t = "active", r) => {
            let s;
            if (!n.REGEX_NUMBER_CHECK.test(e)) return [];
            let {
                data: o
            } = await a.axios.get((s = new URLSearchParams({
                omit_empty: "true",
                status: (e => {
                    switch (e) {
                        case "active":
                        default:
                            return "active";
                        case "resolved":
                            return "closed";
                        case "all":
                            return "all"
                    }
                })(t)
            }), r && "en" !== r && s.set("locale", r), `${i.GAMMA_API_URL}/tags/${e}/related-tags/tags?${s.toString()}`));
            return o
        };
    e.s(["getFilteredTagsById", 0, l, "getFilteredTagsBySlugFetcher", 0, o, "getFilteredTagsFetcher", 0, s], 403591);
    var c = e.i(510954),
        u = e.i(57096);
    let d = t.default.env.NEXT_PUBLIC_TOP_NAVBAR_TAG_ID ? ? "102982";
    e.s(["TOP_NAV_TAG_ID", 0, d, "topNavTagsQueryOptions", 0, e => (0, r.queryOptions)({
        queryKey: c.queryKeys[u.QueryKey.Tags].filteredTags(d, "active", e).queryKey,
        queryFn: async e => await s(e),
        staleTime: 3e5,
        gcTime: 3e5,
        refetchOnWindowFocus: !1,
        refetchOnReconnect: !1
    })], 893299)
}, 448030, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        n = e.i(575339),
        i = e.i(461327),
        s = e.i(165974);
    let o = e => {
            e.isTrending = "trending" === e.primaryTagSlug && "all" === e.secondaryTagSlug && "volume_24hr" === e.sortBy && void 0 === e.recurrence && !e.isWatchlist
        },
        l = e => {
            e.shouldShowClearFilters = ("new" === e.primaryTagSlug ? "start_date:desc" !== e.sortBy : "volume_24hr" !== e.sortBy) || void 0 !== e.recurrence || "active" !== e.status || e.hideSports || e.hideCrypto || e.hideEarnings
        },
        c = a.default.createContext(null),
        u = () => {
            let e = a.default.useContext(c);
            if (!e) throw Error("useBoundDiscoveryFeedStore must be used within a DiscoveryFeedStoreProvider");
            return e
        };

    function d() {
        return (0, n.createWithEqualityFn)()((0, i.persist)((0, s.immer)(e => ({
            primaryTagSlug: "trending",
            secondaryTagSlug: "all",
            category: void 0,
            status: "active",
            sortBy: "volume_24hr",
            frequencyLabel: "All",
            recurrence: void 0,
            hideSports: !1,
            hideCrypto: !1,
            hideEarnings: !1,
            isTrending: !0,
            isWatchlist: !1,
            shouldShowClearFilters: !1,
            onSortByChange: t => {
                e(e => {
                    e.sortBy = t, o(e), l(e)
                })
            },
            onFrequencyChange: t => {
                e(e => {
                    let r = "All" === t ? void 0 : t.toLowerCase();
                    e.frequencyLabel = t, e.recurrence = r, o(e), l(e)
                })
            },
            onStatusChange: t => {
                e(e => {
                    e.status = t, "resolved" === t && "volume" !== e.sortBy ? e.sortBy = "closed_time:desc" : "active" === t && "closed_time:desc" === e.sortBy && (e.sortBy = "volume_24hr"), o(e), l(e)
                })
            },
            clearFilters: () => {
                e(e => {
                    "new" === e.primaryTagSlug ? e.sortBy = "start_date:desc" : e.sortBy = "volume_24hr", e.frequencyLabel = "All", e.recurrence = void 0, e.status = "active", e.hideSports = !1, e.hideCrypto = !1, e.hideEarnings = !1, o(e), l(e)
                })
            },
            onHideSportsChange: t => {
                e(e => {
                    e.hideSports = t, o(e), l(e)
                })
            },
            onHideCryptoChange: t => {
                e(e => {
                    e.hideCrypto = t, o(e), l(e)
                })
            },
            onHideEarningsChange: t => {
                e(e => {
                    e.hideEarnings = t, o(e), l(e)
                })
            },
            onPrimaryTagChange: t => {
                e(e => {
                    "trending" === t ? (e.category = void 0, e.sortBy = "volume_24hr") : "new" === t ? (e.category = void 0, e.sortBy = "start_date:desc") : (e.category = t, e.sortBy = "volume_24hr"), e.primaryTagSlug = t, e.secondaryTagSlug = "all", e.status = "active", e.frequencyLabel = "All", e.recurrence = void 0, e.hideSports = !1, e.hideCrypto = !1, e.hideEarnings = !1, o(e), l(e)
                })
            },
            onSecondaryTagChange: t => {
                e(e => {
                    "all" === t ? e.category = ["trending", "new"].includes(e.primaryTagSlug) ? void 0 : e.primaryTagSlug : e.category = t, e.secondaryTagSlug = t, o(e), l(e)
                })
            },
            onToggleWatchlist: () => {
                e(e => {
                    e.isWatchlist = !e.isWatchlist, o(e), l(e)
                })
            }
        })), {
            name: "polymarket.store.homepage.tabs",
            partialize: e => ({
                hideSports: e.hideSports,
                hideCrypto: e.hideCrypto,
                hideEarnings: e.hideEarnings
            }),
            version: 0,
            skipHydration: !0
        }))
    }
    e.s(["DiscoveryFeedStoreProvider", 0, e => {
        let n, i = (0, r.c)(3),
            {
                children: s
            } = e,
            [o] = (0, a.useState)(d);
        return i[0] !== s || i[1] !== o ? (n = (0, t.jsx)(c.Provider, {
            value: o,
            children: s
        }), i[0] = s, i[1] = o, i[2] = n) : n = i[2], n
    }, "useBoundDiscoveryFeedStore", 0, u, "useDiscoveryFeedStore", 0, (e, t) => {
        let r = u();
        return (0, n.useStoreWithEqualityFn)(r, e, t)
    }], 448030)
}, 713947, (e, t, r) => {
    t.exports = {
        trueFunc: function() {
            return !0
        },
        falseFunc: function() {
            return !1
        }
    }
}, 169008, 662855, 187835, 630102, 635267, 132877, 76095, 649909, 680359, 898792, 50836, 35479, 627287, 165799, 559363, 44899, 169177, 930266, e => {
    "use strict";
    var t, r, a, n, i, s, o, l, c, u, d, p, A, h, m, f, g, y, T, E, b, I, C, S, _, N, x, k, D, v, w, O, R, M, L, B, P, F, U, G, H, j, Q, K, Y, W, q, V, z, J, Z, $, X, ee, et, er, ea, en, ei, es, eo, el, ec, eu, ed, ep, eA, eh, em, ef, eg, ey, eT, eE = e.i(221628),
        eb = e.i(999061),
        eI = e.i(944891),
        eC = e.i(416340),
        eS = e.i(336896),
        e_ = e.i(604777),
        eN = e.i(675834),
        ex = e.i(662131),
        ek = e.i(593332),
        eD = e.i(318594),
        ev = e.i(215959),
        ew = e.i(267905);
    let eO = {
            normal: {
                opacity: 1,
                transition: {
                    duration: .3
                }
            },
            fadeOut: {
                opacity: .2,
                transition: {
                    duration: .6
                }
            },
            fadeIn: e => ({
                opacity: 1,
                transition: {
                    type: "spring",
                    stiffness: 300,
                    damping: 20,
                    delay: .2 * e
                }
            })
        },
        eR = function(e) {
            let t, r, a, n, i, s, o, l, c, u, d, p, A, h, m, f, g, y, T, E, b = (0, eb.c)(37);
            b[0] !== e ? ({
                ref: a,
                className: t,
                size: n,
                enabled: i,
                ...r
            } = e, b[0] = e, b[1] = t, b[2] = r, b[3] = a, b[4] = n, b[5] = i) : (t = b[1], r = b[2], a = b[3], n = b[4], i = b[5]);
            let I = void 0 === n ? 18 : n,
                C = void 0 === i || i,
                S = (0, ew.useAnimation)(),
                _ = (0, eC.useRef)(!1);
            return b[6] !== S ? (s = () => (_.current = !0, {
                startAnimation: async () => {
                    await S.start("fadeOut"), S.start("fadeIn")
                },
                stopAnimation: () => S.start("normal")
            }), b[6] = S, b[7] = s) : s = b[7], (0, eC.useImperativeHandle)(a, s), b[8] !== S || b[9] !== C ? (o = () => {
                if (_.current) return;
                let e = !1,
                    t = async () => {
                        e || !C || (await S.start("fadeOut"), e || !C || (await S.start("fadeIn"), !e && C && t()))
                    };
                return C ? requestAnimationFrame(() => {
                    e || t()
                }) : S.start("normal"), () => {
                    e = !0
                }
            }, l = [C, S], b[8] = S, b[9] = C, b[10] = o, b[11] = l) : (o = b[10], l = b[11]), (0, eC.useEffect)(o, l), b[12] === Symbol.for("react.memo_cache_sentinel") ? (c = {
                opacity: 1
            }, b[12] = c) : c = b[12], b[13] !== S ? (u = (0, eE.jsx)(ev.motion.path, {
                initial: c,
                variants: eO,
                animate: S,
                custom: 0,
                d: "M5.641,12.359c-1.855-1.855-1.855-4.863,0-6.718"
            }), b[13] = S, b[14] = u) : u = b[14], b[15] === Symbol.for("react.memo_cache_sentinel") ? (d = {
                opacity: 1
            }, b[15] = d) : d = b[15], b[16] !== S ? (p = (0, eE.jsx)(ev.motion.path, {
                initial: d,
                variants: eO,
                animate: S,
                custom: 1,
                d: "M3.52,14.48C.493,11.454,.493,6.546,3.52,3.52"
            }), b[16] = S, b[17] = p) : p = b[17], b[18] === Symbol.for("react.memo_cache_sentinel") ? (A = (0, eE.jsx)("circle", {
                cx: "9",
                cy: "9",
                r: "1.75"
            }), b[18] = A) : A = b[18], b[19] === Symbol.for("react.memo_cache_sentinel") ? (h = {
                opacity: 1
            }, b[19] = h) : h = b[19], b[20] !== S ? (m = (0, eE.jsx)(ev.motion.path, {
                initial: h,
                variants: eO,
                animate: S,
                custom: 0,
                d: "M12.359,12.359c1.855-1.855,1.855-4.863,0-6.718"
            }), b[20] = S, b[21] = m) : m = b[21], b[22] === Symbol.for("react.memo_cache_sentinel") ? (f = {
                opacity: 1
            }, b[22] = f) : f = b[22], b[23] !== S ? (g = (0, eE.jsx)(ev.motion.path, {
                initial: f,
                variants: eO,
                animate: S,
                custom: 1,
                d: "M14.48,14.48c3.027-3.027,3.027-7.934,0-10.96"
            }), b[23] = S, b[24] = g) : g = b[24], b[25] !== m || b[26] !== g || b[27] !== u || b[28] !== p ? (y = (0, eE.jsxs)("g", {
                fill: "none",
                strokeLinecap: "round",
                strokeLinejoin: "round",
                strokeWidth: "1.5",
                stroke: "currentColor",
                children: [u, p, A, m, g]
            }), b[25] = m, b[26] = g, b[27] = u, b[28] = p, b[29] = y) : y = b[29], b[30] !== t || b[31] !== I || b[32] !== y ? (T = (0, eE.jsx)("svg", {
                xmlns: "http://www.w3.org/2000/svg",
                width: I,
                height: I,
                viewBox: "0 0 18 18",
                className: t,
                children: y
            }), b[30] = t, b[31] = I, b[32] = y, b[33] = T) : T = b[33], b[34] !== r || b[35] !== T ? (E = (0, eE.jsx)("div", { ...r,
                children: T
            }), b[34] = r, b[35] = T, b[36] = E) : E = b[36], E
        };
    e.s(["Radio", 0, eR], 662855);
    var eM = e.i(499055),
        eL = e.i(476979),
        eB = e.i(684686);

    function eP() {
        let e, t = (0, eb.c)(3),
            r = (0, eB.useGeoStore)(eU),
            a = (0, eB.useGeoStore)(eF);
        return t[0] !== a || t[1] !== r ? (e = eL.allSportsInfo.map(e => {
            if (e.sportSlug === ek.SportSlug.SOCCER) {
                let t, n = (t = {
                    isUsa: r,
                    isCanada: a
                }).isUsa || t.isCanada ? "Soccer" : "Football";
                return { ...e,
                    displayHeader: n,
                    displayNav: n
                }
            }
            return e
        }), t[0] = a, t[1] = r, t[2] = e) : e = t[2], e
    }

    function eF(e) {
        return e.isCanada
    }

    function eU(e) {
        return e.isUsa
    }
    var eG = e.i(336593);
    let eH = function() {
        let e = (0, eD.useQueryClient)(),
            t = (0, eG.usePopularCounts)(),
            r = (0, eG.useSportsVolumes)(),
            a = (0, eG.useEsportsEventCounts)(),
            n = (0, e_.useTranslations)(),
            i = eP();
        return {
            topItems: (function({
                liveLabel: e,
                upcomingLabel: t,
                liveCount: r,
                upcomingCount: a
            }) {
                return [{
                    label: e,
                    href: "/esports/live",
                    count: r || void 0
                }, {
                    label: t,
                    href: "/esports/soon",
                    icon: (0, eE.jsx)(eM.IconClockOutline18, {
                        className: "size-5"
                    }),
                    count: a || void 0
                }]
            })({
                liveLabel: n("sports.live"),
                upcomingLabel: n("sports.upcoming"),
                liveCount: a ? .live,
                upcomingCount: a ? .upcoming
            }).map(e => ({ ...e,
                icon: e.label === n("sports.live") ? (0, eE.jsx)(eR, {
                    className: "size-5 text-red-500!",
                    enabled: !0
                }) : e.icon
            })),
            gameItems: eC.default.useMemo(() => {
                let a = [];
                for (let n of i) {
                    if (n.sportId !== eL.SportId.Esports || !n.isLeague || !n.isSupported) continue;
                    let i = n.icon,
                        s = r ? .[n.sportSlug] || 0,
                        o = (0, eL.fromSlugToSeriesId)(n.sportSlug),
                        l = o ? e.getQueryData(function({
                            sportSlug: e,
                            seriesId: t
                        }) {
                            return ["esports-sidebar-tournaments", e, t]
                        }({
                            sportSlug: n.sportSlug,
                            seriesId: o
                        })) : void 0;
                    a.push({
                        label: n.displayNav,
                        href: n.href,
                        icon: i ? (0, eE.jsx)(i, {
                            className: `size-5 ${n.iconClassName||"text-neutral-300!"}`
                        }) : void 0,
                        count: t ? .[n.sportSlug] || 0,
                        volume: s,
                        sportSlug: n.sportSlug,
                        seriesId: n.seriesId,
                        supportedSecondaryNav: n.supportedSecondaryNav,
                        hasProps: l ? .hasProps,
                        tournaments: l ? .tournaments
                    })
                }
                return a.sort((e, t) => t.volume - e.volume), a.map(({
                    volume: e,
                    ...t
                }) => t)
            }, [t, r, i])
        }
    };

    function ej(e, t) {
        let r = [];
        if (e.sportSlug && e.supportedSecondaryNav && (e.supportedSecondaryNav.includes(ek.SecondarySlug.GAMES) && r.push({
                id: `${e.sportSlug}-games`,
                label: t("sports.games"),
                href: `/esports/${e.sportSlug}/games`
            }), e.supportedSecondaryNav.includes(ek.SecondarySlug.PROPS) && !1 !== e.hasProps && r.push({
                id: `${e.sportSlug}-props`,
                label: t("sports.props"),
                href: `/esports/${e.sportSlug}/props`
            }), e.tournaments))
            for (let t = 0; t < e.tournaments.length; t++) {
                let a = e.tournaments[t];
                r.push({
                    id: `${e.sportSlug}-${a.slug}`,
                    label: a.label,
                    href: `/esports/${e.sportSlug}/${a.slug}`,
                    count: a.count,
                    dividerBefore: 0 === t && r.length > 0
                })
            }
        return {
            id: e.href,
            label: e.label,
            icon: e.icon,
            count: e.count,
            href: e.href,
            items: r.length > 0 ? r : void 0
        }
    }

    function eQ(e) {
        return !e.id.endsWith("-games") && !e.id.endsWith("-props")
    }

    function eK(e) {
        return e.id.endsWith("-games") || e.id.endsWith("-props")
    }

    function eY(e) {
        return e.items
    }
    let eW = function(e) {
        let t, r, a, n, i, s, o, l, c, u = (0, eb.c)(44),
            {
                asDrawer: d
            } = e,
            p = (0, e_.useTranslations)(),
            A = (0, eS.useRouter)(),
            {
                topItems: h,
                gameItems: m
            } = eH();
        u[0] !== A.asPath ? (t = A.asPath.split("?"), u[0] = A.asPath, u[1] = t) : t = u[1];
        let f = t[0];
        if (u[2] !== p || u[3] !== h) {
            let e;
            u[5] !== p ? (e = e => ej(e, p), u[5] = p, u[6] = e) : e = u[6], r = h.map(e), u[2] = p, u[3] = h, u[4] = r
        } else r = u[4];
        if (u[7] !== r ? (a = {
                items: r
            }, u[7] = r, u[8] = a) : a = u[8], u[9] !== p ? (n = p("sports.games"), u[9] = p, u[10] = n) : n = u[10], u[11] !== m || u[12] !== p) {
            let e;
            u[14] !== p ? (e = e => ej(e, p), u[14] = p, u[15] = e) : e = u[15], i = m.map(e), u[11] = m, u[12] = p, u[13] = i
        } else i = u[13];
        u[16] !== n || u[17] !== i ? (s = {
            label: n,
            items: i
        }, u[16] = n, u[17] = i, u[18] = s) : s = u[18], u[19] !== a || u[20] !== s ? (o = [a, s], u[19] = a, u[20] = s, u[21] = o) : o = u[21];
        let g = o;
        u[22] !== f ? (l = e => {
            if ("/esports/live" === e.href || "/esports/soon" === e.href) return f === e.href;
            if (!e.items || 0 === e.items.length) return f === e.href || f.startsWith(`${e.href}/`);
            let t = e.href.split("/")[2],
                r = f.split("/")[2];
            return !!t && t === r && "/esports/live" !== f && "/esports/soon" !== f
        }, u[22] = f, u[23] = l) : l = u[23];
        let y = l;
        if (d) {
            let e, t;
            if (u[24] !== f || u[25] !== y || u[26] !== g) {
                e = Symbol.for("react.early_return_sentinel");
                e: {
                    let t = g.flatMap(eY).find(e => y(e) && e.items && e.items.length > 0);
                    if (t ? .items) {
                        let r, a, n, i, s = t.items.filter(eK),
                            o = t.items.filter(eQ),
                            l = s.length > 0 ? [{
                                items: s
                            }] : [];
                        u[28] !== o ? (r = o.length > 0 ? [{
                            items: o
                        }] : [], u[28] = o, u[29] = r) : r = u[29], u[30] !== l || u[31] !== r ? (a = [...l, ...r], u[30] = l, u[31] = r, u[32] = a) : a = u[32];
                        let c = a;
                        u[33] !== f ? (n = e => f === e.href || f.startsWith(`${e.href}/`), u[33] = f, u[34] = n) : n = u[34];
                        let d = n;
                        u[35] !== d || u[36] !== c ? (i = (0, eE.jsx)(ex.CategoryMobileNav, {
                            sections: c,
                            isSelected: d
                        }), u[35] = d, u[36] = c, u[37] = i) : i = u[37], e = i;
                        break e
                    }
                }
                u[24] = f, u[25] = y, u[26] = g, u[27] = e
            } else e = u[27];
            return e !== Symbol.for("react.early_return_sentinel") ? e : (u[38] !== y || u[39] !== g ? (t = (0, eE.jsx)(ex.CategoryMobileNav, {
                sections: g,
                isSelected: y
            }), u[38] = y, u[39] = g, u[40] = t) : t = u[40], t)
        }
        return u[41] !== y || u[42] !== g ? (c = (0, eE.jsx)(eN.CategorySidebar, {
            sections: g,
            isSelected: y,
            stickyTop: "var(--navbar-height)",
            stickyHeight: "calc(100vh - var(--navbar-height))"
        }), u[41] = y, u[42] = g, u[43] = c) : c = u[43], c
    };
    e.s(["default", 0, function(e) {
        let t, r, a, n = (0, eb.c)(4),
            {
                children: i
            } = e;
        return n[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, eE.jsx)(eI.Media, {
            greaterThanOrEqual: "lg",
            children: (0, eE.jsx)(eW, {})
        }), n[0] = t) : t = n[0], n[1] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, eE.jsx)(eI.Media, {
            lessThan: "lg",
            children: (0, eE.jsx)(eW, {
                asDrawer: !0
            })
        }), n[1] = r) : r = n[1], n[2] !== i ? (a = (0, eE.jsxs)("div", {
            className: "flex min-w-0 min-h-0 flex-1 flex-col lg:flex-row lg:gap-2",
            children: [t, r, i]
        }), n[2] = i, n[3] = a) : a = n[3], a
    }], 169008);
    var eq = e.i(960334);
    let eV = ({
            query: e,
            pathname: t
        }) => {
            if ("/esports/live" === t || "/esports/soon" === t) return {
                sportSlug: ek.SportSlug.LIVE,
                secondarySlug: void 0,
                type: "noop",
                week: void 0,
                event: void 0,
                specialEvent: void 0
            };
            if ("/esports/[league]/games" === t) return {
                sportSlug: e ? .league ? ? ek.SportSlug.LIVE,
                secondarySlug: "games",
                type: "noop",
                week: void 0,
                event: void 0,
                specialEvent: void 0
            };
            if ("/esports/[league]/[tournament]" === t) {
                let t = e ? .league,
                    r = e ? .tournament;
                return r && (0, eL.getTournamentFilter)(r) ? {
                    sportSlug: t ? ? ek.SportSlug.LIVE,
                    secondarySlug: r,
                    type: "noop",
                    week: void 0,
                    event: void 0,
                    specialEvent: void 0
                } : {
                    sportSlug: t ? ? ek.SportSlug.LIVE,
                    secondarySlug: "games",
                    type: "noop",
                    week: void 0,
                    event: void 0,
                    specialEvent: void 0
                }
            }
            if ("/esports/[league]/[tournament]/[slug]" === t) {
                let t = e ? .league,
                    r = e ? .slug;
                return {
                    sportSlug: t ? ? ek.SportSlug.LIVE,
                    secondarySlug: "games",
                    type: "noop",
                    week: void 0,
                    event: r,
                    specialEvent: void 0
                }
            }
            if ("/sports/live" === t) return {
                sportSlug: ek.SportSlug.LIVE,
                secondarySlug: void 0,
                type: "noop",
                week: void 0,
                event: void 0,
                specialEvent: void 0
            };
            if ("/sports/futures/[league]" === t) {
                let t = e ? .league;
                return {
                    sportSlug: ek.SportSlug.FUTURES,
                    secondarySlug: t,
                    type: "noop",
                    week: void 0,
                    event: void 0,
                    specialEvent: void 0
                }
            }
            if ("/sports/[league]/games" === t) return {
                sportSlug: e ? .league ? ? ek.SportSlug.LIVE,
                secondarySlug: "games",
                type: "noop",
                week: void 0,
                event: void 0,
                specialEvent: void 0
            };
            if ("/sports/[league]/props" === t) return {
                sportSlug: e ? .league ? ? ek.SportSlug.LIVE,
                secondarySlug: "props",
                type: "noop",
                week: void 0,
                event: void 0,
                specialEvent: void 0
            };
            if ("/sports/[league]/bracket" === t) return {
                sportSlug: e ? .league ? ? ek.SportSlug.LIVE,
                secondarySlug: "bracket",
                type: "noop",
                week: void 0,
                event: void 0,
                specialEvent: void 0
            };
            if ("/sports/[league]/[slug]" === t) {
                let t = e ? .league,
                    r = e ? .slug;
                return r && (0, eL.getTournamentFilter)(r) ? {
                    sportSlug: t ? ? ek.SportSlug.LIVE,
                    secondarySlug: r,
                    type: "noop",
                    week: void 0,
                    event: void 0,
                    specialEvent: void 0
                } : {
                    sportSlug: t ? ? ek.SportSlug.LIVE,
                    secondarySlug: "games",
                    type: "noop",
                    week: void 0,
                    event: r,
                    specialEvent: void 0
                }
            }
            if ("/sports/[league]/games/week/[week]" === t) {
                let t = e ? .league,
                    r = e ? .week,
                    a = r ? parseInt(r, 10) : void 0;
                return {
                    sportSlug: t ? ? ek.SportSlug.LIVE,
                    secondarySlug: "games",
                    type: "week",
                    week: a,
                    event: void 0,
                    specialEvent: void 0
                }
            }
            if ("/sports/[league]/games/week/[week]/[slug]" === t) {
                let t = e ? .league,
                    r = e ? .week,
                    a = e ? .slug,
                    n = r ? parseInt(r, 10) : void 0;
                return {
                    sportSlug: t ? ? ek.SportSlug.LIVE,
                    secondarySlug: "games",
                    type: "week",
                    week: n,
                    event: a,
                    specialEvent: void 0
                }
            }
            return {
                sportSlug: ek.SportSlug.LIVE,
                secondarySlug: void 0,
                type: "noop",
                week: void 0,
                event: void 0,
                specialEvent: void 0
            }
        },
        ez = () => {
            let e, t, r, a, n, i, s, o, l, c, u = (0, eb.c)(22),
                d = (0, eS.useRouter)();
            u[0] !== d.pathname ? (e = d.pathname.startsWith("/sports") || d.pathname.startsWith("/esports"), u[0] = d.pathname, u[1] = e) : e = u[1];
            let p = e;
            if (u[2] !== p || u[3] !== d.pathname || u[4] !== d.query) {
                let {
                    sportSlug: e,
                    secondarySlug: c,
                    event: A,
                    ...h
                } = eV({
                    query: d.query,
                    pathname: d.pathname
                });
                t = p, r = p, a = e, n = c, i = A, s = "week" === h.type && {
                    week: `${h.week}`
                }, o = "noop" === h.type && {
                    week: d.query.week
                }, l = p && (0, eq.isSportsV2PageSupported)({
                    sportSlug: e,
                    secondarySlug: c
                }), u[2] = p, u[3] = d.pathname, u[4] = d.query, u[5] = t, u[6] = r, u[7] = a, u[8] = n, u[9] = i, u[10] = s, u[11] = o, u[12] = l
            } else t = u[5], r = u[6], a = u[7], n = u[8], i = u[9], s = u[10], o = u[11], l = u[12];
            return u[13] !== t || u[14] !== r || u[15] !== a || u[16] !== n || u[17] !== i || u[18] !== s || u[19] !== o || u[20] !== l ? (c = {
                valid: t,
                isSportsPage: r,
                sportSlug: a,
                secondarySlug: n,
                event: i,
                ...s,
                ...o,
                sportsV2Enabled: l
            }, u[13] = t, u[14] = r, u[15] = a, u[16] = n, u[17] = i, u[18] = s, u[19] = o, u[20] = l, u[21] = c) : c = u[21], c
        };
    e.s(["getRoutingParams", 0, eV, "useSportsRouterState", 0, ez], 187835);
    var eJ = e.i(822213);
    let eZ = [ek.SportSlug.NBA, ek.SportSlug.UCL, ek.SportSlug.MLB, ek.SportSlug.NHL],
        e$ = new Set(eZ),
        eX = [eL.SportId.UFC],
        e0 = new Set(eX),
        e1 = [eL.SportId.Football, eL.SportId.Soccer, eL.SportId.Tennis, eL.SportId.Cricket, eL.SportId.Basketball, eL.SportId.Baseball, eL.SportId.Hockey, eL.SportId.Rugby, eL.SportId.TableTennis, eL.SportId.Golf, eL.SportId.UFC, eL.SportId.Motorsports, eL.SportId.Chess, eL.SportId.Boxing, eL.SportId.Pickleball, eL.SportId.Lacrosse, eL.SportId.Rodeo],
        e2 = new Set([]);

    function e5(e) {
        let t = (0, eC.useRef)(e);
        return (t.current.length !== e.length || t.current.some((t, r) => ! function e(t, r) {
            if (t.label !== r.label || t.href !== r.href || t.count !== r.count) return !1;
            let a = t.items ? ? [],
                n = r.items ? ? [];
            if (a.length !== n.length) return !1;
            for (let t = 0; t < a.length; t += 1)
                if (!e(a[t], n[t])) return !1;
            return !0
        }(t, e[r]))) && (t.current = e), t.current
    }

    function e6(e) {
        if (!e) return !0;
        let t = new Date;
        return t.setDate(t.getDate() - 3), e < t.toISOString().split("T")[0]
    }
    let e3 = function() {
        let e, t, r, a, n, i = (0, eG.usePopularCounts)(),
            s = (0, eG.useSportsVolumes)(),
            o = (0, eG.useLatestEventDates)(),
            l = (0, e_.useTranslations)(),
            c = eP(),
            {
                getSportDisplayName: u
            } = (r = (0, eb.c)(4), a = (0, e_.useTranslations)(), r[0] !== a ? (e = e => {
                if (!e) return "";
                switch (e) {
                    case eL.SportId.Soccer:
                        return a("sports.types.soccer");
                    case eL.SportId.Football:
                        return a("sports.types.football");
                    case eL.SportId.Basketball:
                        return a("sports.types.basketball");
                    case eL.SportId.Hockey:
                        return a("sports.types.hockey");
                    case eL.SportId.Tennis:
                        return a("sports.types.tennis");
                    case eL.SportId.Esports:
                        return a("sports.types.esports");
                    case eL.SportId.Baseball:
                        return a("sports.types.baseball");
                    case eL.SportId.Cricket:
                        return a("sports.types.cricket");
                    case eL.SportId.Rugby:
                        return a("sports.types.rugby");
                    case eL.SportId.Golf:
                        return a("sports.types.golf");
                    case eL.SportId.UFC:
                        return a("sports.types.ufc");
                    case eL.SportId.Motorsports:
                        return a("sports.types.formula1");
                    case eL.SportId.Chess:
                        return a("sports.types.chess");
                    case eL.SportId.Boxing:
                        return a("sports.types.boxing");
                    case eL.SportId.Pickleball:
                        return a("sports.types.pickleball");
                    case eL.SportId.WinterOlympics:
                        return a("sports.types.winterOlympics");
                    case eL.SportId.TableTennis:
                        return a("sports.types.tableTennis");
                    case eL.SportId.Lacrosse:
                        return a("sports.types.lacrosse");
                    case eL.SportId.Rodeo:
                        return a("sports.types.rodeo");
                    default:
                        return e
                }
            }, r[0] = a, r[1] = e) : e = r[1], n = e, r[2] !== n ? (t = {
                getSportDisplayName: n
            }, r[2] = n, r[3] = t) : t = r[3], t),
            d = (0, eC.useMemo)(() => {
                let e = new Map;
                for (let t of eL.sports) {
                    let r = t.icon;
                    e.set(t.id, {
                        icon: r ? (0, eE.jsx)("div", {
                            className: "size-5 flex items-center justify-center",
                            children: (0, eE.jsx)(r, {
                                className: `size-4.5 ${t.iconClassName||"text-neutral-300!"}`
                            })
                        }) : void 0
                    })
                }
                return e
            }, []),
            p = (0, eC.useMemo)(() => [{
                label: l("sports.live"),
                href: c.find(e => "Live" === e.displayNav) ? .href || ""
            }, {
                label: l("sports.futures"),
                href: c.find(e => "Futures" === e.displayNav) ? .href || "",
                icon: (0, eE.jsx)(eJ.IconSquareChartOutline18, {
                    className: "size-5"
                })
            }], [c, l]),
            A = (0, eC.useMemo)(() => {
                let e = new Map,
                    t = {},
                    r = {},
                    a = {};
                for (let e of e1) r[e] = [];
                for (let e of eX) t[e] = [];
                for (let n of c) {
                    let l;
                    if (!n.sportId || !n.isLeague || !n.isSupported || e2.has(n.sportSlug)) continue;
                    let c = i ? .[n.sportSlug] || 0,
                        u = !n.supportedSecondaryNav.includes(ek.SecondarySlug.GAMES),
                        d = o ? .[n.sportSlug],
                        p = !!d && e6(d);
                    if (u) {
                        if (0 === c) continue
                    } else if (0 === c && e6(d) || p) continue;
                    let A = s ? .[n.sportSlug] || 0,
                        h = e$.has(n.sportSlug),
                        m = e0.has(n.sportId),
                        f = n.icon,
                        g = {
                            label: n.displayNav,
                            href: n.href,
                            icon: f ? (0, eE.jsx)(f, {
                                className: `size-5 ${n.iconClassName||"text-neutral-300!"}`
                            }) : void 0,
                            count: c,
                            volume: A
                        };
                    if (f) l = (0, eE.jsx)(f, {
                        className: "size-5 text-neutral-300!"
                    });
                    else {
                        let e = eL.sports.find(e => e.id === n.sportId) ? .icon;
                        e && (l = (0, eE.jsx)(e, {
                            className: "size-5 text-neutral-600!"
                        }))
                    }
                    if (u) {
                        a[n.sportId] || (a[n.sportId] = []), a[n.sportId].push({ ...g,
                            icon: l
                        });
                        continue
                    }
                    h && e.set(n.sportSlug, g), m && t[n.sportId].push({ ...g,
                        icon: l
                    }), r[n.sportId] || (r[n.sportId] = []), r[n.sportId].push({ ...g,
                        icon: l
                    })
                }
                for (let e of e1) {
                    let n = a[e];
                    n && 0 !== n.length && (e0.has(e) ? (t[e] || (t[e] = []), t[e].push(...n)) : (r[e] || (r[e] = []), r[e].push(...n)))
                }
                let n = [];
                for (let t of eZ) {
                    let r = e.get(t);
                    r && n.push(r)
                }
                let p = (e, t) => {
                        let r = +((e.count || 0) > 0),
                            a = +((t.count || 0) > 0);
                        return r !== a ? a - r : t.volume - e.volume
                    },
                    A = (e, t) => {
                        t.sort(p);
                        let r = t.reduce((e, t) => e + (t.count || 0), 0),
                            a = d.get(e),
                            n = `/sports/${e}/${eL.PROPS_ONLY_CATEGORIES.has(e)?"props":"games"}`,
                            i = t.map(({
                                volume: e,
                                ...t
                            }) => t);
                        return i.length > 1 && i.unshift({
                            label: l("sports.all"),
                            href: n,
                            count: r,
                            icon: a ? .icon
                        }), {
                            label: u(e),
                            href: n,
                            icon: a ? .icon,
                            items: i,
                            count: r
                        }
                    };
                for (let e of eX) {
                    let r = t[e];
                    r && 0 !== r.length && n.push(A(e, r))
                }
                for (let e of e1) {
                    if (e0.has(e)) continue;
                    let t = r[e];
                    t && 0 !== t.length && n.push(A(e, t))
                }
                n.sort((e, t) => {
                    let r = +((e.count || 0) > 0);
                    return ((t.count || 0) > 0) - r
                });
                let h = d.get(eL.SportId.Esports);
                return n.push({
                    label: u(eL.SportId.Esports),
                    href: "/esports/live",
                    icon: h ? .icon
                }), n
            }, [i, s, o, c, u, d]),
            h = (0, eC.useMemo)(() => p.map(e => ({ ...e,
                icon: e.label === l("sports.live") ? (0, eE.jsx)(eR, {
                    className: "size-5 text-red-500!",
                    enabled: !0
                }) : e.icon
            })), [p, l]),
            m = e5(A),
            f = e5(h);
        return (0, eC.useMemo)(() => ({
            sportsItems: m,
            topItems: f
        }), [m, f])
    };

    function e4(e) {
        return {
            id: e.href || e.label,
            label: e.label,
            icon: e.icon,
            count: e.count,
            href: e.href,
            items: e.items ? .map(e4)
        }
    }

    function e8(e) {
        let t, r, a, n, i, s, o, l = (0, eb.c)(19),
            {
                sections: c,
                isSelected: u
            } = e,
            d = (0, e_.useTranslations)();
        if (l[0] !== c) {
            let e = c.flatMap(e9);
            r = e.slice(0, 6), t = e.slice(6), l[0] = c, l[1] = t, l[2] = r
        } else t = l[1], r = l[2];
        let p = t;
        l[3] !== p || l[4] !== d ? (a = p.length > 0 ? [{
            label: d("sports.allSports"),
            items: p
        }] : void 0, l[3] = p, l[4] = d, l[5] = a) : a = l[5], l[6] !== a || l[7] !== r ? (n = {
            pillItems: r,
            moreSections: a
        }, l[6] = a, l[7] = r, l[8] = n) : n = l[8];
        let {
            pillItems: A,
            moreSections: h
        } = n;
        return l[9] !== d ? (i = d("sports.allSports"), l[9] = d, l[10] = i) : i = l[10], l[11] !== d ? (s = d("navbar.more"), l[11] = d, l[12] = s) : s = l[12], l[13] !== u || l[14] !== h || l[15] !== A || l[16] !== i || l[17] !== s ? (o = (0, eE.jsx)(ex.CategoryMobileNav, {
            items: A,
            moreSections: h,
            isSelected: u,
            moreTitle: i,
            moreLabel: s
        }), l[13] = u, l[14] = h, l[15] = A, l[16] = i, l[17] = s, l[18] = o) : o = l[18], o
    }

    function e9(e) {
        return e.items
    }
    e.s(["default", 0, function(e) {
        let t, r, a, n, i, s, o, l, c, u, d = (0, eb.c)(27),
            {
                children: p
            } = e,
            A = (0, e_.useTranslations)(),
            {
                sportSlug: h,
                event: m
            } = ez(),
            {
                sportsItems: f,
                topItems: g
            } = e3();
        d[0] !== A ? (t = A("sports.allSports"), d[0] = A, d[1] = t) : t = d[1];
        let y = t;
        d[2] !== g ? (r = g.map(e4), d[2] = g, d[3] = r) : r = d[3], d[4] !== r ? (a = {
            items: r
        }, d[4] = r, d[5] = a) : a = d[5], d[6] !== f ? (n = f.map(e4), d[6] = f, d[7] = n) : n = d[7], d[8] !== y || d[9] !== n ? (i = {
            label: y,
            items: n
        }, d[8] = y, d[9] = n, d[10] = i) : i = d[10], d[11] !== a || d[12] !== i ? (s = [a, i], d[11] = a, d[12] = i, d[13] = s) : s = d[13];
        let T = s;
        d[14] !== h ? (o = e => {
            if (!e.href) return !1;
            let t = e.href.toLowerCase(),
                r = `/sports/${h}`;
            if (!t.startsWith(r)) return !1;
            let a = t[r.length];
            return void 0 === a || "/" === a
        }, d[14] = h, d[15] = o) : o = d[15];
        let E = o;
        return d[16] !== E || d[17] !== T ? (l = (0, eE.jsx)("div", {
            className: "max-lg:hidden",
            children: (0, eE.jsx)(eN.CategorySidebar, {
                sections: T,
                isSelected: E,
                stickyTop: "var(--navbar-height)",
                stickyHeight: "calc(100vh - var(--navbar-height))"
            })
        }), d[16] = E, d[17] = T, d[18] = l) : l = d[18], d[19] !== m || d[20] !== E || d[21] !== T ? (c = !m && (0, eE.jsx)("div", {
            className: "lg:hidden",
            children: (0, eE.jsx)(e8, {
                sections: T,
                isSelected: E
            })
        }), d[19] = m, d[20] = E, d[21] = T, d[22] = c) : c = d[22], d[23] !== p || d[24] !== l || d[25] !== c ? (u = (0, eE.jsxs)("div", {
            className: "flex min-w-0 min-h-0 flex-1 flex-col lg:flex-row lg:gap-2",
            children: [l, c, p]
        }), d[23] = p, d[24] = l, d[25] = c, d[26] = u) : u = d[26], u
    }], 630102);
    var e7 = e.i(86831);

    function te(e) {
        let t, r, a, n, i, s, o = (0, eb.c)(19),
            {
                brand: l,
                beforeContent: c,
                content: u,
                bottom: d,
                className: p,
                containerClassName: A,
                contentWrapperClassName: h
            } = e;
        o[0] !== p ? (t = (0, e7.cn)("w-full bg-background pb-20 lg:pb-0", p), o[0] = p, o[1] = t) : t = o[1], o[2] !== A ? (r = (0, e7.cn)("w-full max-w-[1350px] mx-auto px-4 lg:px-6 py-12 lg:py-16", A), o[2] = A, o[3] = r) : r = o[3];
        let m = c ? "gap-6" : "gap-10";
        return o[4] !== h || o[5] !== m ? (a = (0, e7.cn)("flex flex-col", m, h), o[4] = h, o[5] = m, o[6] = a) : a = o[6], o[7] !== c || o[8] !== d || o[9] !== l || o[10] !== u || o[11] !== a ? (n = (0, eE.jsxs)("div", {
            className: a,
            children: [l, c, u, d]
        }), o[7] = c, o[8] = d, o[9] = l, o[10] = u, o[11] = a, o[12] = n) : n = o[12], o[13] !== r || o[14] !== n ? (i = (0, eE.jsx)("div", {
            className: r,
            children: n
        }), o[13] = r, o[14] = n, o[15] = i) : i = o[15], o[16] !== t || o[17] !== i ? (s = (0, eE.jsx)("footer", {
            className: t,
            children: i
        }), o[16] = t, o[17] = i, o[18] = s) : s = o[18], s
    }
    var tt = e.i(184612),
        tr = e.i(208956),
        ta = e.i(140787);

    function tn(e) {
        let t, r, a = (0, eb.c)(6),
            {
                title: n,
                children: i,
                className: s
            } = e,
            o = `flex flex-col ${s??""}`;
        return a[0] !== n ? (t = (0, eE.jsx)("h3", {
            className: "text-sm font-medium text-text-secondary mb-3",
            children: n
        }), a[0] = n, a[1] = t) : t = a[1], a[2] !== i || a[3] !== o || a[4] !== t ? (r = (0, eE.jsxs)("div", {
            className: o,
            children: [t, i]
        }), a[2] = i, a[3] = o, a[4] = t, a[5] = r) : r = a[5], r
    }
    var ti = e.i(329905),
        ts = e.i(798631),
        to = e.i(446789),
        tl = e.i(864006);

    function tc(e) {
        let t, r, a, n, i, s, o, l, c = (0, eb.c)(27),
            {
                title: u,
                items: d,
                visibleCount: p,
                className: A
            } = e,
            h = void 0 === p ? 10 : p,
            m = (0, e_.useTranslations)(),
            f = (0, tl.useLocale)(),
            [g, y] = (0, eC.useState)(!1),
            T = d.length > h;
        if (c[0] !== A || c[1] !== T || c[2] !== g || c[3] !== d || c[4] !== f || c[5] !== m || c[6] !== u || c[7] !== h) {
            let e, o, l = d.slice(0, h),
                p = d.slice(h);
            c[14] !== f ? (e = e => {
                if (!e.startsWith("/") || e.startsWith("//") || "en" === f) return e;
                let t = e.split("/")[1];
                return t && (0, to.isValidLocale)(t) ? e : `/${f}${e}`
            }, c[14] = f, c[15] = e) : e = c[15];
            let E = e;
            t = tn, i = u, s = A, r = "flex flex-col gap-3", c[16] !== E ? (o = (e, t) => (0, eE.jsxs)("a", {
                href: E(e.href),
                className: "text-sm font-medium text-text hover:text-text-secondary transition-colors",
                children: [e.label, e.sublabel && (0, eE.jsx)("span", {
                    className: "block text-xs text-text-tertiary",
                    children: e.sublabel
                })]
            }, `${e.href}-${t}`), c[16] = E, c[17] = o) : o = c[17], a = l.map(o), n = T && (0, eE.jsxs)("div", {
                className: "flex flex-col gap-3",
                children: [(0, eE.jsx)(ti.AnimateHeight, {
                    duration: 250,
                    easing: "cubic-bezier(0.77,0,0.175,1)",
                    height: g ? "auto" : 0,
                    disableDisplayNone: !0,
                    children: (0, eE.jsx)("div", {
                        className: "flex flex-col gap-3",
                        children: p.map((e, t) => (0, eE.jsxs)("a", {
                            href: E(e.href),
                            className: "text-sm font-medium text-text hover:text-text-secondary transition-colors",
                            children: [e.label, e.sublabel && (0, eE.jsx)("span", {
                                className: "block text-xs text-text-tertiary",
                                children: e.sublabel
                            })]
                        }, `${e.href}-hidden-${t}`))
                    })
                }), (0, eE.jsxs)("button", {
                    type: "button",
                    onClick: () => y(!g),
                    className: "flex items-center gap-1 text-sm font-medium text-text-secondary hover:text-text-tertiary transition-colors cursor-pointer",
                    children: [(0, eE.jsx)("span", {
                        children: m(g ? "footer.viewLess" : "footer.viewMore")
                    }), (0, eE.jsx)(ts.IconChevronDownOutline12, {
                        className: `w-3 h-3 transition-transform ${g?"rotate-180":""}`
                    })]
                })]
            }), c[0] = A, c[1] = T, c[2] = g, c[3] = d, c[4] = f, c[5] = m, c[6] = u, c[7] = h, c[8] = t, c[9] = r, c[10] = a, c[11] = n, c[12] = i, c[13] = s
        } else t = c[8], r = c[9], a = c[10], n = c[11], i = c[12], s = c[13];
        return c[18] !== r || c[19] !== a || c[20] !== n ? (o = (0, eE.jsxs)("div", {
            className: r,
            children: [a, n]
        }), c[18] = r, c[19] = a, c[20] = n, c[21] = o) : o = c[21], c[22] !== t || c[23] !== i || c[24] !== s || c[25] !== o ? (l = (0, eE.jsx)(t, {
            title: i,
            className: s,
            children: o
        }), c[22] = t, c[23] = i, c[24] = s, c[25] = o, c[26] = l) : l = c[26], l
    }
    let tu = {
            politics: "politics",
            tech: "tech",
            culture: "pop-culture",
            "pop-culture": "pop-culture",
            business: "business",
            science: "science",
            ai: "ai",
            world: "world",
            "middle-east": "middle-east",
            geopolitics: "geopolitics",
            economy: "economy",
            "climate-science": "climate-science",
            new: null
        },
        td = e => Object.hasOwn(tu, e),
        tp = {
            politics: "pages.politics",
            tech: "pages.technology",
            culture: "pages.popCulture",
            "pop-culture": "pages.popCulture",
            business: "pages.business",
            science: "pages.science",
            ai: "pages.ai",
            world: "pages.worldEvents",
            "middle-east": "pages.middleEast",
            geopolitics: "pages.geopolitics",
            economy: "pages.economy",
            "climate-science": "pages.climateScience",
            new: "pages.newPolymarkets"
        };

    function tA(e, t, r) {
        let a = tp[e];
        if (a) return r(a);
        let n = `footer.categories.${e}`,
            i = r(n);
        return i && i !== n ? i : t
    }

    function th(e) {
        let t, r, a, n, i, s, o, l = (0, eb.c)(34),
            {
                data: c
            } = e,
            u = (0, e_.useTranslations)();
        if (l[0] !== c.newestMarkets || l[1] !== c.popularMarkets || l[2] !== c.subTags || l[3] !== c.tagName || l[4] !== c.tagSlug || l[5] !== u) {
            let e, s, o, d = tA(c.tagSlug, c.tagName, u);
            if (l[11] !== c.subTags || l[12] !== u) {
                let t;
                l[14] !== u ? (t = e => ({
                    href: `/predictions/${e.slug}`,
                    label: e.label,
                    sublabel: u("footer.predictionsAndOdds")
                }), l[14] = u, l[15] = t) : t = l[15], e = c.subTags.map(t), l[11] = c.subTags, l[12] = u, l[13] = e
            } else e = l[13];
            let p = e;
            l[16] !== c.popularMarkets ? (s = c.popularMarkets.map(tf), l[16] = c.popularMarkets, l[17] = s) : s = l[17];
            let A = s;
            l[18] !== c.newestMarkets ? (o = c.newestMarkets.map(tm), l[18] = c.newestMarkets, l[19] = o) : o = l[19];
            let h = o,
                m = p.length > 0;
            a = `grid grid-cols-1 gap-8 lg:gap-16 ${m?"lg:grid-cols-3":"lg:grid-cols-2"}`, l[20] !== m || l[21] !== p || l[22] !== u ? (n = m && (0, eE.jsx)("div", {
                className: "order-3 lg:order-1",
                children: (0, eE.jsx)(tc, {
                    title: u("footer.relatedCategoriesTitle"),
                    items: p,
                    visibleCount: 10
                })
            }), l[20] = m, l[21] = p, l[22] = u, l[23] = n) : n = l[23];
            let f = A.length > 0 ? (0, eE.jsx)(tc, {
                title: u("footer.popularMarketsTitle", {
                    category: d
                }),
                items: A,
                visibleCount: 10
            }) : (0, eE.jsx)(tn, {
                title: u("footer.popularMarketsTitle", {
                    category: d
                }),
                children: (0, eE.jsx)("p", {
                    className: "text-sm text-text-tertiary",
                    children: u("footer.noMarkets")
                })
            });
            l[24] !== f ? (i = (0, eE.jsx)("div", {
                className: "order-1 lg:order-2",
                children: f
            }), l[24] = f, l[25] = i) : i = l[25], t = "order-2 lg:order-3", r = h.length > 0 ? (0, eE.jsx)(tc, {
                title: u("footer.newMarketsTitle", {
                    category: d
                }),
                items: h,
                visibleCount: 10
            }) : (0, eE.jsx)(tn, {
                title: u("footer.newMarketsTitle", {
                    category: d
                }),
                children: (0, eE.jsx)("p", {
                    className: "text-sm text-text-tertiary",
                    children: u("footer.noMarkets")
                })
            }), l[0] = c.newestMarkets, l[1] = c.popularMarkets, l[2] = c.subTags, l[3] = c.tagName, l[4] = c.tagSlug, l[5] = u, l[6] = t, l[7] = r, l[8] = a, l[9] = n, l[10] = i
        } else t = l[6], r = l[7], a = l[8], n = l[9], i = l[10];
        return l[26] !== t || l[27] !== r ? (s = (0, eE.jsx)("div", {
            className: t,
            children: r
        }), l[26] = t, l[27] = r, l[28] = s) : s = l[28], l[29] !== a || l[30] !== n || l[31] !== i || l[32] !== s ? (o = (0, eE.jsxs)("div", {
            className: a,
            children: [n, i, s]
        }), l[29] = a, l[30] = n, l[31] = i, l[32] = s, l[33] = o) : o = l[33], o
    }

    function tm(e) {
        return {
            href: `/event/${e.slug}`,
            label: e.title
        }
    }

    function tf(e) {
        return {
            href: `/event/${e.slug}`,
            label: e.title
        }
    }
    e.s(["CATEGORY_SLUG_MAPPINGS", 0, tu, "CATEGORY_TITLE_KEYS", 0, tp, "isCoreCategorySlug", 0, td], 635267);
    var tg = e.i(964974),
        ty = e.i(403591),
        tT = e.i(510954),
        tE = e.i(57096),
        tb = e.i(784521),
        tI = e.i(814703),
        tC = e.i(660635),
        tS = e.i(660006),
        t_ = e.i(196593);

    function tN(e, t = "en") {
        return (e ? ? new Date).toLocaleDateString(t, {
            year: "numeric",
            month: "long",
            day: "numeric"
        })
    }

    function tx(e) {
        return (0, t_.formatCurrency)(e, {
            decimals: 0
        })
    }

    function tk(e, t, r, a = "en", n, i) {
        let s = i ? .seo,
            o = s ? .metaDescription;
        if (!o) return e;
        if (r) {
            let t = o.resolved.replace("{title}", e);
            return t.length > 160 ? `${t.substring(0,157)}...` : t
        }
        let l = tN(t, a),
            c = null != n && n >= 1e3,
            u = c ? o.viewRealTimeOddsWithVolume : o.viewRealTimeOdds,
            d = u.replace("{title}", e).replace("{date}", l);
        if (c && (d = d.replace("{volume}", tx(n))), d.length > 160) {
            let t = u.replace("{title}", "").replace("{date}", l);
            if (c) {
                let r = 160 - t.replace("{volume}", tx(n)).length,
                    a = e.length > r ? `${e.substring(0,r-3)}...` : e,
                    i = u.replace("{title}", a).replace("{date}", l);
                return i.replace("{volume}", tx(n))
            }
            let r = 160 - t.length,
                a = e.length > r ? `${e.substring(0,r-3)}...` : e;
            return u.replace("{title}", a).replace("{date}", l)
        }
        return d
    }

    function tD({
        tag: e,
        activeMarketCount: t,
        currentDate: r,
        useResolvedDescription: a = !1,
        locale: n = "en",
        messages: i
    }) {
        let s = i ? .seo ? .predictionsPage;
        if (!s) return e;
        let o = tN(r, n);
        return a || 0 === t ? s.resolvedDescription.replace("{tag}", e).replace("{date}", o) : null == t ? s.description.replace("{tag}", e).replace("{date}", o) : s.liveDescription.replace("{activeMarketCount}", new Intl.NumberFormat((0, to.getIntlLocale)(n)).format(t)).replace("{tag}", e).replace("{date}", o)
    }
    e.s(["formatMetaDescriptionDate", 0, tN, "generateMetaDescription", 0, tk, "generatePredictionsPageMetaDescription", 0, tD], 132877);
    var tv = e.i(444298),
        tw = e.i(421452),
        tO = e.i(631222),
        tR = e.i(76953),
        tM = e.i(799471),
        tL = e.i(866192);
    let tB = e => e.replace(/-/g, " ").replace(/\b\w/g, e => e.toUpperCase()).replace(/\bUs\b/, "US").replace(/\bNyc\b/, "NYC").replace("'S", "'s").replace(/\bAi\b/, "AI").replace(/\bFbi\b/, "FBI").replace(/\bMvp\b/, "MVP").replace(/\bBtc\b/, "BTC").replace(/\bEth\b/, "ETH").replace(/\bFomc\b/, "FOMC").replace("Mrbeast", "MrBeast").replace(/\bLol\b/, "LoL"),
        tP = ["Breaking News", "Macro Election 1", "Macro Election 2", "Hide From New", "CryptoNewHide", "sceince", "artificail intelligence", "xtrd-1", "Macro Graph", "congres", "world election", "World Elections", "Kalshi", "All", "atmoic", "baeball", "Other", "Parent For Derivative"],
        tF = e => !!(tP.includes(e) || e.includes("Reward") || e.includes("Rewards")),
        tU = (e, t = []) => e.filter(e => !tF(e.label) && !t.includes(e.label)).sort((e, t) => parseInt(e.id, 10) - parseInt(t.id, 10));
    e.s(["isTagExcluded", 0, tF, "sortedFilteredTags", 0, tU, "toAdjustedTitleCase", 0, tB], 76095);
    let tG = [{
            property: "og:temporal:status",
            content: "active"
        }, {
            property: "og:temporal:link_preview_rendering_style",
            content: "enhanced_image_forward"
        }, {
            property: "og:temporal:trade_eligibility_US",
            content: "False"
        }, {
            property: "og:image:alt",
            content: "Polymarket"
        }],
        tH = "Polymarket is the world's largest prediction market, allowing you to stay informed and profit from your knowledge by trading on future events across various topics.",
        tj = [{
            property: "og:type",
            content: "website"
        }, {
            name: "twitter:card",
            content: "summary_large_image"
        }, {
            name: "twitter:site",
            content: "@polymarket"
        }],
        tQ = e => e.seo,
        tK = e => {
            let t = tQ(e);
            return [...tj, {
                name: "description",
                content: t.defaultDescription
            }, {
                name: "title",
                content: t.defaultTitle
            }, {
                property: "og:title",
                content: t.defaultTitle
            }, {
                property: "og:description",
                content: t.defaultDescription
            }, {
                property: "og:url",
                content: "https://polymarket.com"
            }, {
                property: "og:image",
                content: tR.DEFAULT_TWITTER_IMG
            }, ...tG, {
                name: "twitter:description",
                content: t.defaultDescription
            }, {
                name: "twitter:image:src",
                content: tR.DEFAULT_TWITTER_IMG
            }, {
                name: "twitter:image",
                content: tR.DEFAULT_TWITTER_IMG
            }]
        },
        tY = [...tj, {
            name: "description",
            content: tH
        }, {
            name: "title",
            content: tM.META_HOMEPAGE_OG_TITLE
        }, {
            property: "og:title",
            content: tM.META_HOMEPAGE_OG_TITLE
        }, {
            property: "og:description",
            content: tH
        }, {
            property: "og:url",
            content: "https://polymarket.com"
        }, {
            property: "og:image",
            content: tR.DEFAULT_TWITTER_IMG
        }, ...tG, {
            name: "twitter:description",
            content: tH
        }, {
            name: "twitter:image:src",
            content: tR.DEFAULT_TWITTER_IMG
        }, {
            name: "twitter:image",
            content: tR.DEFAULT_TWITTER_IMG
        }];
    e.s(["FALLBACK_META_TAGS", 0, tY, "STANDARD_META_TAGS", 0, tj, "getFallbackMetaTags", 0, tK, "getSeoTranslations", 0, tQ], 649909);
    var tW = e.i(692028);
    let tq = `${tO.CURRENT_ORIGIN}/api/og?accuracy=true`,
        tV = "Polymarket Brand Assets",
        tz = "Polymarket brand assets and guidelines.",
        tJ = `${tO.CURRENT_ORIGIN}/images/brand/brand-og-image.png`,
        tZ = [...tj, {
            name: "title",
            content: tV
        }, {
            name: "description",
            content: tz
        }, {
            property: "og:title",
            content: tV
        }, {
            property: "og:description",
            content: tz
        }, {
            property: "og:image",
            content: tJ
        }, {
            name: "twitter:image",
            content: tJ
        }];

    function t$(e, t) {
        let r = e.lastIndexOf(" | ");
        if (-1 === r) return e;
        let a = e.slice(0, r),
            n = e.slice(r),
            i = new Date().getFullYear().toString();
        return t ? .skipIfYearPresent && /\b(19|20)\d{2}\b/.test(a) ? e : `${a} ${i}${n}`
    }
    e.s(["insertYearInTitle", 0, t$], 680359);
    let tX = {
            politics: "political predictions, election odds, government markets, policy forecasts, political betting",
            tech: "tech predictions, AI forecasts, product launch odds, technology markets, startup predictions",
            culture: "entertainment predictions, celebrity odds, awards forecasts, pop culture markets",
            "pop-culture": "entertainment predictions, celebrity odds, awards forecasts, pop culture markets",
            world: "world events, global predictions, international markets, world news odds",
            economy: "economic predictions, inflation odds, GDP forecasts, unemployment markets, macro predictions",
            geopolitics: "geopolitical predictions, international relations, conflict odds, diplomatic markets",
            business: "business predictions, IPO odds, merger forecasts, corporate markets",
            finance: "finance predictions, stock market odds, crypto markets, interest rate forecasts, financial betting",
            crypto: "crypto predictions, bitcoin odds, ethereum markets, solana forecasts, cryptocurrency betting",
            science: "science predictions, research odds, space exploration, scientific discovery markets",
            ai: "AI predictions, AGI odds, machine learning markets, artificial intelligence forecasts",
            "middle-east": "middle east predictions, regional odds, MENA markets, regional forecasts",
            sports: "sports predictions, betting odds, nfl, nba, soccer markets, sports betting",
            new: "new markets, recent predictions, latest odds, fresh markets",
            trending: "trending markets, popular predictions, active trading, hot markets",
            breaking: "breaking news, market movers, price changes, trending predictions"
        },
        t0 = {
            "pop-culture": "culture",
            "middle-east": "middleEast",
            new: "newMarkets"
        },
        t1 = `${tO.CURRENT_ORIGIN}/images/crypto-twitter-card.png`,
        t2 = {
            "5m": "5-Minute Crypto",
            "15m": "15-Minute Crypto",
            hourly: "Hourly Crypto",
            "4hour": "4-Hour Crypto",
            daily: "Daily Crypto",
            today: "Daily Crypto",
            weekly: "Weekly Crypto",
            monthly: "Monthly Crypto",
            "pre-market": "Pre‑Market Crypto",
            etf: "Crypto ETFs",
            bitcoin: "Bitcoin",
            ethereum: "Ethereum",
            solana: "Solana",
            xrp: "XRP",
            dogecoin: "Dogecoin",
            bnb: "BNB",
            microstrategy: "Microstrategy"
        },
        t5 = "Federal Reserve rates | Polymarket",
        t6 = "Track Federal Reserve interest rate predictions and monetary policy decisions on Polymarket.",
        t3 = [...tj, {
            name: "title",
            content: t5
        }, {
            name: "description",
            content: t6
        }, {
            property: "og:title",
            content: t5
        }, {
            property: "og:description",
            content: t6
        }, {
            property: "og:url",
            content: `${tO.CURRENT_ORIGIN}/dashboards/fed-rates`
        }],
        t4 = "Global Elections Dashboard | Polymarket",
        t8 = "Track global election predictions and odds from around the world on Polymarket.",
        t9 = [...tj, {
            name: "title",
            content: t4
        }, {
            name: "description",
            content: t8
        }, {
            property: "og:title",
            content: t4
        }, {
            property: "og:description",
            content: t8
        }, {
            property: "og:url",
            content: `${tO.CURRENT_ORIGIN}/dashboards/global-elections`
        }],
        t7 = "Macro dashboard | Polymarket",
        re = "Track macroeconomic predictions including inflation, GDP, and global economic indicators on Polymarket.",
        rt = [...tj, {
            name: "title",
            content: t7
        }, {
            name: "description",
            content: re
        }, {
            property: "og:title",
            content: t7
        }, {
            property: "og:description",
            content: re
        }, {
            property: "og:url",
            content: `${tO.CURRENT_ORIGIN}/dashboards/macro`
        }],
        rr = "Oscars Predictions & Odds (2026) | Polymarket",
        ra = "View 2026 Oscars predictions with live odds for Best Picture, Best Director, Best Actor, Best Actress & more. Trade on The World's Largest Prediction Market™",
        rn = `${tO.CURRENT_ORIGIN}/predictions/oscars/2026`,
        ri = `${tO.CURRENT_ORIGIN}/images/oscars/oscars-2026-og-image.png`,
        rs = [...tj, {
            name: "title",
            content: rr
        }, {
            name: "description",
            content: ra
        }, {
            property: "og:title",
            content: rr
        }, {
            property: "og:description",
            content: ra
        }, {
            property: "og:image",
            content: ri
        }, {
            property: "og:url",
            content: rn
        }, {
            name: "twitter:description",
            content: ra
        }, {
            name: "twitter:image:src",
            content: ri
        }, {
            name: "twitter:image",
            content: ri
        }, {
            name: "twitter:url",
            content: rn
        }],
        ro = "Primary Elections Dashboard | Polymarket",
        rl = "Track 2026 primary election predictions and odds for House, Senate, and Governor races on Polymarket.",
        rc = [...tj, {
            name: "title",
            content: ro
        }, {
            name: "description",
            content: rl
        }, {
            property: "og:title",
            content: ro
        }, {
            property: "og:description",
            content: rl
        }, {
            property: "og:url",
            content: `${tO.CURRENT_ORIGIN}/dashboards/primaries`
        }],
        ru = "Trump won, now what? | Polymarket",
        rd = "Trump won the 2024 US Presidential Election, now what? Explore the latest polymarkets on Trump's policies and cabinet picks ahead of his inauguration.",
        rp = `${tO.CURRENT_ORIGIN}/dashboards/trump`,
        rA = `${tO.CURRENT_ORIGIN}/images/trump/trump-won-og-image.png`,
        rh = [...tj, {
            name: "title",
            content: ru
        }, {
            name: "description",
            content: rd
        }, {
            property: "og:title",
            content: ru
        }, {
            property: "og:description",
            content: rd
        }, {
            property: "og:image",
            content: rA
        }, {
            property: "og:url",
            content: rp
        }, {
            name: "twitter:description",
            content: rd
        }, {
            name: "twitter:image:src",
            content: rA
        }, {
            name: "twitter:image",
            content: rA
        }, {
            name: "twitter:url",
            content: rp
        }],
        rm = "Elections Odds & Predictions | Polymarket",
        rf = "https://polymarket-next-images.s3.amazonaws.com/elections/election-twitter-card-august-2024.png";
    var rg = e.i(177521),
        ry = e.i(987222);
    let rT = {
            "LA Galaxy": "LA Galaxy",
            "Los Angeles FC": "LAFC",
            "New York Red Bulls": "New York Red Bulls",
            "New York City FC": "NYCFC"
        },
        rE = new Set([ek.SportSlug.EPL, ek.SportSlug.UCL, ek.SportSlug.UEL, ek.SportSlug.LALIGA, ek.SportSlug.BUNDESLIGA, ek.SportSlug.LIGUE1, ek.SportSlug.SOCCER, ek.SportSlug.MLS, ek.SportSlug.FA_CUP, ek.SportSlug.EFL_CUP, ek.SportSlug.EFL_CHAMPIONSHIP, ek.SportSlug.CDR, ek.SportSlug.CDE, ek.SportSlug.DFB, ek.SportSlug.ITC, ek.SportSlug.ARG, ek.SportSlug.BRA, ek.SportSlug.MEX, ek.SportSlug.TUR, ek.SportSlug.POR, ek.SportSlug.ERE, ek.SportSlug.SPL, ek.SportSlug.JAP, ek.SportSlug.AUS, ek.SportSlug.CSL, ek.SportSlug.KOR, ek.SportSlug.JA2, ek.SportSlug.SEA, ek.SportSlug.FIF, ek.SportSlug.UCOL, ek.SportSlug.LIB, ek.SportSlug.SUD]),
        rb = ["Red Sox", "White Sox", "Blue Jays", "Trail Blazers", "Maple Leafs", "Blue Jackets", "Golden Knights", "Red Wings"],
        rI = (e, t) => {
            if (e.alias) return e.alias;
            let r = (0, ek.canonicalSportSlug)(t);
            if (r === ek.SportSlug.MLS) return rT[e.name] ? rT[e.name] : e.name.replace(/\s+(United|FC|SC|City FC|City)$/i, "").trim() || e.name;
            if (rE.has(r) || (0, eL.isEsportsSlug)(r)) return e.name;
            for (let t of rb)
                if (e.name.endsWith(t)) return t;
            return e.name.split(" ").pop() || e.name
        },
        rC = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sep.", "Oct.", "Nov.", "Dec."],
        rS = e => {
            let t = new Date(e.eventDate || e.startTime || e.gameStartTime || "");
            if (!Number.isNaN(t.getTime())) return `${rC[t.getUTCMonth()]} ${t.getUTCDate()}, ${t.getUTCFullYear()}`
        },
        r_ = e => {
            let t = e.markets.filter(e => (e.sportsMarketType ? ? "moneyline") === "moneyline");
            if (1 === t.length && t[0].teams ? .length === 2) {
                let [e, r] = t[0].teams;
                return "home" === e.hostStatus ? {
                    home: e,
                    away: r
                } : "home" === r.hostStatus ? {
                    home: r,
                    away: e
                } : {
                    home: e,
                    away: r
                }
            }
            if (3 === t.length) {
                let e, r;
                for (let a of t) a.team && "home" === a.negRiskSportsMarketType && (e = a.team), a.team && "away" === a.negRiskSportsMarketType && (r = a.team);
                if (e && r) return {
                    home: e,
                    away: r
                }
            }
        },
        rN = e => (0, ek.getEventLeague)(e),
        rx = e => (0, eL.getSportDisplayHeader)(e),
        rk = (e, t = "en", r, a) => {
            let n = r_(e);
            if (!n) return;
            let i = tQ(r),
                s = rN(e),
                o = rx(s),
                l = rS(e),
                c = rI(n.away, s),
                u = rI(n.home, s),
                d = `${c} vs. ${u}`,
                p = e.title || d,
                A = l ? ` (${l})` : "",
                h = `${p} ${i.event.oddsAndPredictions}${A}${i.titleSuffix}`,
                m = e.volume;
            if (null != m && m >= 1e3) return {
                title: h,
                description: tk(e.title, a, e.closed, t, m, r)
            };
            let f = l ? ` on ${l}` : "";
            return {
                title: h,
                description: `${i.sports.bettingOdds.replace("{league}",o).replace("{matchup}",d).replace("{date}",f)} ${i.event.predictTheWinner}`
            }
        };
    e.s(["extractTeamsFromEvent", 0, r_, "formatSportsEventDate", 0, rS, "generateSportsEventMeta", 0, rk, "getLeagueFromEvent", 0, rN, "getSportDisplayName", 0, rx, "getTeamDisplayName", 0, rI], 898792);
    let rD = `${tO.CURRENT_ORIGIN}/api/og?finance=true`,
        rv = {
            daily: "Daily Finance",
            weekly: "Weekly Finance",
            monthly: "Monthly Finance",
            stocks: "Stocks",
            earnings: "Earnings",
            indicies: "Indices",
            indices: "Indices",
            commodities: "Commodities",
            forex: "Forex",
            collectibles: "Collectibles",
            acquisitions: "Acquisitions",
            ipo: "IPO",
            ipos: "IPO",
            "fed-rates": "Fed Rates",
            "prediction-markets": "Prediction Markets",
            treasuries: "Treasuries",
            kpis: "KPIs"
        };

    function rw(e) {
        return e.type === P.Tag || e.type === P.Script || e.type === P.Style
    }(t = P || (P = {})).Root = "root", t.Text = "text", t.Directive = "directive", t.Comment = "comment", t.Script = "script", t.Style = "style", t.Tag = "tag", t.CDATA = "cdata", t.Doctype = "doctype";
    let rO = P.Root,
        rR = P.Text,
        rM = P.Directive,
        rL = P.Comment,
        rB = P.Script,
        rP = P.Style,
        rF = P.Tag,
        rU = P.CDATA,
        rG = P.Doctype;
    e.s(["CDATA", 0, rU, "Comment", 0, rL, "Directive", 0, rM, "Doctype", 0, rG, "ElementType", 0, P, "Root", 0, rO, "Script", 0, rB, "Style", 0, rP, "Tag", 0, rF, "Text", 0, rR, "isTag", 0, rw], 436186);
    class rH {
        constructor() {
            this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null
        }
        get parentNode() {
            return this.parent
        }
        set parentNode(e) {
            this.parent = e
        }
        get previousSibling() {
            return this.prev
        }
        set previousSibling(e) {
            this.prev = e
        }
        get nextSibling() {
            return this.next
        }
        set nextSibling(e) {
            this.next = e
        }
        cloneNode(e = !1) {
            return r5(this, e)
        }
    }
    class rj extends rH {
        constructor(e) {
            super(), this.data = e
        }
        get nodeValue() {
            return this.data
        }
        set nodeValue(e) {
            this.data = e
        }
    }
    class rQ extends rj {
        constructor() {
            super(...arguments), this.type = P.Text
        }
        get nodeType() {
            return 3
        }
    }
    class rK extends rj {
        constructor() {
            super(...arguments), this.type = P.Comment
        }
        get nodeType() {
            return 8
        }
    }
    class rY extends rj {
        constructor(e, t) {
            super(t), this.name = e, this.type = P.Directive
        }
        get nodeType() {
            return 1
        }
    }
    class rW extends rH {
        constructor(e) {
            super(), this.children = e
        }
        get firstChild() {
            var e;
            return null != (e = this.children[0]) ? e : null
        }
        get lastChild() {
            return this.children.length > 0 ? this.children[this.children.length - 1] : null
        }
        get childNodes() {
            return this.children
        }
        set childNodes(e) {
            this.children = e
        }
    }
    class rq extends rW {
        constructor() {
            super(...arguments), this.type = P.CDATA
        }
        get nodeType() {
            return 4
        }
    }
    class rV extends rW {
        constructor() {
            super(...arguments), this.type = P.Root
        }
        get nodeType() {
            return 9
        }
    }
    class rz extends rW {
        constructor(e, t, r = [], a = "script" === e ? P.Script : "style" === e ? P.Style : P.Tag) {
            super(r), this.name = e, this.attribs = t, this.type = a
        }
        get nodeType() {
            return 1
        }
        get tagName() {
            return this.name
        }
        set tagName(e) {
            this.name = e
        }
        get attributes() {
            return Object.keys(this.attribs).map(e => {
                var t, r;
                return {
                    name: e,
                    value: this.attribs[e],
                    namespace: null == (t = this["x-attribsNamespace"]) ? void 0 : t[e],
                    prefix: null == (r = this["x-attribsPrefix"]) ? void 0 : r[e]
                }
            })
        }
    }

    function rJ(e) {
        return rw(e)
    }

    function rZ(e) {
        return e.type === P.CDATA
    }

    function r$(e) {
        return e.type === P.Text
    }

    function rX(e) {
        return e.type === P.Comment
    }

    function r0(e) {
        return e.type === P.Directive
    }

    function r1(e) {
        return e.type === P.Root
    }

    function r2(e) {
        return Object.prototype.hasOwnProperty.call(e, "children")
    }

    function r5(e, t = !1) {
        let r;
        if (r$(e)) r = new rQ(e.data);
        else if (rX(e)) r = new rK(e.data);
        else if (rJ(e)) {
            let a = t ? r6(e.children) : [],
                n = new rz(e.name, { ...e.attribs
                }, a);
            a.forEach(e => e.parent = n), null != e.namespace && (n.namespace = e.namespace), e["x-attribsNamespace"] && (n["x-attribsNamespace"] = { ...e["x-attribsNamespace"]
            }), e["x-attribsPrefix"] && (n["x-attribsPrefix"] = { ...e["x-attribsPrefix"]
            }), r = n
        } else if (rZ(e)) {
            let a = t ? r6(e.children) : [],
                n = new rq(a);
            a.forEach(e => e.parent = n), r = n
        } else if (r1(e)) {
            let a = t ? r6(e.children) : [],
                n = new rV(a);
            a.forEach(e => e.parent = n), e["x-mode"] && (n["x-mode"] = e["x-mode"]), r = n
        } else if (r0(e)) {
            let t = new rY(e.name, e.data);
            null != e["x-name"] && (t["x-name"] = e["x-name"], t["x-publicId"] = e["x-publicId"], t["x-systemId"] = e["x-systemId"]), r = t
        } else throw Error(`Not implemented yet: ${e.type}`);
        return r.startIndex = e.startIndex, r.endIndex = e.endIndex, null != e.sourceCodeLocation && (r.sourceCodeLocation = e.sourceCodeLocation), r
    }

    function r6(e) {
        let t = e.map(e => r5(e, !0));
        for (let e = 1; e < t.length; e++) t[e].prev = t[e - 1], t[e - 1].next = t[e];
        return t
    }
    let r3 = {
        withStartIndices: !1,
        withEndIndices: !1,
        xmlMode: !1
    };
    class r4 {
        constructor(e, t, r) {
            this.dom = [], this.root = new rV(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, "function" == typeof t && (r = t, t = r3), "object" == typeof e && (t = e, e = void 0), this.callback = null != e ? e : null, this.options = null != t ? t : r3, this.elementCB = null != r ? r : null
        }
        onparserinit(e) {
            this.parser = e
        }
        onreset() {
            this.dom = [], this.root = new rV(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null
        }
        onend() {
            this.done || (this.done = !0, this.parser = null, this.handleCallback(null))
        }
        onerror(e) {
            this.handleCallback(e)
        }
        onclosetag() {
            this.lastNode = null;
            let e = this.tagStack.pop();
            this.options.withEndIndices && (e.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(e)
        }
        onopentag(e, t) {
            let r = new rz(e, t, void 0, this.options.xmlMode ? P.Tag : void 0);
            this.addNode(r), this.tagStack.push(r)
        }
        ontext(e) {
            let {
                lastNode: t
            } = this;
            if (t && t.type === P.Text) t.data += e, this.options.withEndIndices && (t.endIndex = this.parser.endIndex);
            else {
                let t = new rQ(e);
                this.addNode(t), this.lastNode = t
            }
        }
        oncomment(e) {
            if (this.lastNode && this.lastNode.type === P.Comment) {
                this.lastNode.data += e;
                return
            }
            let t = new rK(e);
            this.addNode(t), this.lastNode = t
        }
        oncommentend() {
            this.lastNode = null
        }
        oncdatastart() {
            let e = new rQ(""),
                t = new rq([e]);
            this.addNode(t), e.parent = t, this.lastNode = e
        }
        oncdataend() {
            this.lastNode = null
        }
        onprocessinginstruction(e, t) {
            let r = new rY(e, t);
            this.addNode(r)
        }
        handleCallback(e) {
            if ("function" == typeof this.callback) this.callback(e, this.dom);
            else if (e) throw e
        }
        addNode(e) {
            let t = this.tagStack[this.tagStack.length - 1],
                r = t.children[t.children.length - 1];
            this.options.withStartIndices && (e.startIndex = this.parser.startIndex), this.options.withEndIndices && (e.endIndex = this.parser.endIndex), t.children.push(e), r && (e.prev = r, r.next = e), e.parent = t, this.lastNode = null
        }
    }
    let r8 = new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e => e.charCodeAt(0))),
        r9 = new Uint16Array("Ȁaglq	\x15\x18\x1bɭ\x0f\0\0\x12p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e => e.charCodeAt(0))),
        r7 = new Map([
            [0, 65533],
            [128, 8364],
            [130, 8218],
            [131, 402],
            [132, 8222],
            [133, 8230],
            [134, 8224],
            [135, 8225],
            [136, 710],
            [137, 8240],
            [138, 352],
            [139, 8249],
            [140, 338],
            [142, 381],
            [145, 8216],
            [146, 8217],
            [147, 8220],
            [148, 8221],
            [149, 8226],
            [150, 8211],
            [151, 8212],
            [152, 732],
            [153, 8482],
            [154, 353],
            [155, 8250],
            [156, 339],
            [158, 382],
            [159, 376]
        ]),
        ae = null != (F = String.fromCodePoint) ? F : function(e) {
            let t = "";
            return e > 65535 && (e -= 65536, t += String.fromCharCode(e >>> 10 & 1023 | 55296), e = 56320 | 1023 & e), t += String.fromCharCode(e)
        };

    function at(e) {
        return e >= U.ZERO && e <= U.NINE
    }(r = U || (U = {}))[r.NUM = 35] = "NUM", r[r.SEMI = 59] = "SEMI", r[r.EQUALS = 61] = "EQUALS", r[r.ZERO = 48] = "ZERO", r[r.NINE = 57] = "NINE", r[r.LOWER_A = 97] = "LOWER_A", r[r.LOWER_F = 102] = "LOWER_F", r[r.LOWER_X = 120] = "LOWER_X", r[r.LOWER_Z = 122] = "LOWER_Z", r[r.UPPER_A = 65] = "UPPER_A", r[r.UPPER_F = 70] = "UPPER_F", r[r.UPPER_Z = 90] = "UPPER_Z", (a = G || (G = {}))[a.VALUE_LENGTH = 49152] = "VALUE_LENGTH", a[a.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", a[a.JUMP_TABLE = 127] = "JUMP_TABLE", (n = H || (H = {}))[n.EntityStart = 0] = "EntityStart", n[n.NumericStart = 1] = "NumericStart", n[n.NumericDecimal = 2] = "NumericDecimal", n[n.NumericHex = 3] = "NumericHex", n[n.NamedEntity = 4] = "NamedEntity", (i = j || (j = {}))[i.Legacy = 0] = "Legacy", i[i.Strict = 1] = "Strict", i[i.Attribute = 2] = "Attribute";
    class ar {
        constructor(e, t, r) {
            this.decodeTree = e, this.emitCodePoint = t, this.errors = r, this.state = H.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = j.Strict
        }
        startEntity(e) {
            this.decodeMode = e, this.state = H.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1
        }
        write(e, t) {
            switch (this.state) {
                case H.EntityStart:
                    if (e.charCodeAt(t) === U.NUM) return this.state = H.NumericStart, this.consumed += 1, this.stateNumericStart(e, t + 1);
                    return this.state = H.NamedEntity, this.stateNamedEntity(e, t);
                case H.NumericStart:
                    return this.stateNumericStart(e, t);
                case H.NumericDecimal:
                    return this.stateNumericDecimal(e, t);
                case H.NumericHex:
                    return this.stateNumericHex(e, t);
                case H.NamedEntity:
                    return this.stateNamedEntity(e, t)
            }
        }
        stateNumericStart(e, t) {
            return t >= e.length ? -1 : (32 | e.charCodeAt(t)) === U.LOWER_X ? (this.state = H.NumericHex, this.consumed += 1, this.stateNumericHex(e, t + 1)) : (this.state = H.NumericDecimal, this.stateNumericDecimal(e, t))
        }
        addToNumericResult(e, t, r, a) {
            if (t !== r) {
                let n = r - t;
                this.result = this.result * Math.pow(a, n) + parseInt(e.substr(t, n), a), this.consumed += n
            }
        }
        stateNumericHex(e, t) {
            let r = t;
            for (; t < e.length;) {
                var a;
                let n = e.charCodeAt(t);
                if (!at(n) && (!((a = n) >= U.UPPER_A) || !(a <= U.UPPER_F)) && (!(a >= U.LOWER_A) || !(a <= U.LOWER_F))) return this.addToNumericResult(e, r, t, 16), this.emitNumericEntity(n, 3);
                t += 1
            }
            return this.addToNumericResult(e, r, t, 16), -1
        }
        stateNumericDecimal(e, t) {
            let r = t;
            for (; t < e.length;) {
                let a = e.charCodeAt(t);
                if (!at(a)) return this.addToNumericResult(e, r, t, 10), this.emitNumericEntity(a, 2);
                t += 1
            }
            return this.addToNumericResult(e, r, t, 10), -1
        }
        emitNumericEntity(e, t) {
            var r, a, n;
            if (this.consumed <= t) return null == (r = this.errors) || r.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
            if (e === U.SEMI) this.consumed += 1;
            else if (this.decodeMode === j.Strict) return 0;
            return this.emitCodePoint((a = this.result) >= 55296 && a <= 57343 || a > 1114111 ? 65533 : null != (n = r7.get(a)) ? n : a, this.consumed), this.errors && (e !== U.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed
        }
        stateNamedEntity(e, t) {
            let {
                decodeTree: r
            } = this, a = r[this.treeIndex], n = (a & G.VALUE_LENGTH) >> 14;
            for (; t < e.length; t++, this.excess++) {
                let i = e.charCodeAt(t);
                if (this.treeIndex = function(e, t, r, a) {
                        let n = (t & G.BRANCH_LENGTH) >> 7,
                            i = t & G.JUMP_TABLE;
                        if (0 === n) return 0 !== i && a === i ? r : -1;
                        if (i) {
                            let t = a - i;
                            return t < 0 || t >= n ? -1 : e[r + t] - 1
                        }
                        let s = r,
                            o = s + n - 1;
                        for (; s <= o;) {
                            let t = s + o >>> 1,
                                r = e[t];
                            if (r < a) s = t + 1;
                            else {
                                if (!(r > a)) return e[t + n];
                                o = t - 1
                            }
                        }
                        return -1
                    }(r, a, this.treeIndex + Math.max(1, n), i), this.treeIndex < 0) return 0 === this.result || this.decodeMode === j.Attribute && (0 === n || function(e) {
                    var t;
                    return e === U.EQUALS || (t = e) >= U.UPPER_A && t <= U.UPPER_Z || t >= U.LOWER_A && t <= U.LOWER_Z || at(t)
                }(i)) ? 0 : this.emitNotTerminatedNamedEntity();
                if (0 != (n = ((a = r[this.treeIndex]) & G.VALUE_LENGTH) >> 14)) {
                    if (i === U.SEMI) return this.emitNamedEntityData(this.treeIndex, n, this.consumed + this.excess);
                    this.decodeMode !== j.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0)
                }
            }
            return -1
        }
        emitNotTerminatedNamedEntity() {
            var e;
            let {
                result: t,
                decodeTree: r
            } = this, a = (r[t] & G.VALUE_LENGTH) >> 14;
            return this.emitNamedEntityData(t, a, this.consumed), null == (e = this.errors) || e.missingSemicolonAfterCharacterReference(), this.consumed
        }
        emitNamedEntityData(e, t, r) {
            let {
                decodeTree: a
            } = this;
            return this.emitCodePoint(1 === t ? a[e] & ~G.VALUE_LENGTH : a[e + 1], r), 3 === t && this.emitCodePoint(a[e + 2], r), r
        }
        end() {
            var e;
            switch (this.state) {
                case H.NamedEntity:
                    return 0 !== this.result && (this.decodeMode !== j.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
                case H.NumericDecimal:
                    return this.emitNumericEntity(0, 2);
                case H.NumericHex:
                    return this.emitNumericEntity(0, 3);
                case H.NumericStart:
                    return null == (e = this.errors) || e.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
                case H.EntityStart:
                    return 0
            }
        }
    }

    function aa(e) {
        let t = "",
            r = new ar(e, e => t += ae(e));
        return function(e, a) {
            let n = 0,
                i = 0;
            for (;
                (i = e.indexOf("&", i)) >= 0;) {
                t += e.slice(n, i), r.startEntity(a);
                let s = r.write(e, i + 1);
                if (s < 0) {
                    n = i + r.end();
                    break
                }
                n = i + s, i = 0 === s ? n + 1 : n
            }
            let s = t + e.slice(n);
            return t = "", s
        }
    }
    aa(r8), aa(r9);
    let an = /["&'<>$\x80-\uFFFF]/g,
        ai = new Map([
            [34, "&quot;"],
            [38, "&amp;"],
            [39, "&apos;"],
            [60, "&lt;"],
            [62, "&gt;"]
        ]),
        as = null != String.prototype.codePointAt ? (e, t) => e.codePointAt(t) : (e, t) => (64512 & e.charCodeAt(t)) == 55296 ? (e.charCodeAt(t) - 55296) * 1024 + e.charCodeAt(t + 1) - 56320 + 65536 : e.charCodeAt(t);

    function ao(e) {
        let t, r = "",
            a = 0;
        for (; null !== (t = an.exec(e));) {
            let n = t.index,
                i = e.charCodeAt(n),
                s = ai.get(i);
            void 0 !== s ? (r += e.substring(a, n) + s, a = n + 1) : (r += `${e.substring(a,n)}&#x${as(e,n).toString(16)};`, a = an.lastIndex += Number((64512 & i) == 55296))
        }
        return r + e.substr(a)
    }

    function al(e, t) {
        return function(r) {
            let a, n = 0,
                i = "";
            for (; a = e.exec(r);) n !== a.index && (i += r.substring(n, a.index)), i += t.get(a[0].charCodeAt(0)), n = a.index + 1;
            return i + r.substring(n)
        }
    }
    al(/[&<>'"]/g, ai);
    let ac = al(/["&\u00A0]/g, new Map([
            [34, "&quot;"],
            [38, "&amp;"],
            [160, "&nbsp;"]
        ])),
        au = al(/[&<>\u00A0]/g, new Map([
            [38, "&amp;"],
            [60, "&lt;"],
            [62, "&gt;"],
            [160, "&nbsp;"]
        ]));
    (s = Q || (Q = {}))[s.XML = 0] = "XML", s[s.HTML = 1] = "HTML", (o = K || (K = {}))[o.UTF8 = 0] = "UTF8", o[o.ASCII = 1] = "ASCII", o[o.Extensive = 2] = "Extensive", o[o.Attribute = 3] = "Attribute", o[o.Text = 4] = "Text";
    let ad = new Map(["altGlyph", "altGlyphDef", "altGlyphItem", "animateColor", "animateMotion", "animateTransform", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "glyphRef", "linearGradient", "radialGradient", "textPath"].map(e => [e.toLowerCase(), e])),
        ap = new Map(["definitionURL", "attributeName", "attributeType", "baseFrequency", "baseProfile", "calcMode", "clipPathUnits", "diffuseConstant", "edgeMode", "filterUnits", "glyphRef", "gradientTransform", "gradientUnits", "kernelMatrix", "kernelUnitLength", "keyPoints", "keySplines", "keyTimes", "lengthAdjust", "limitingConeAngle", "markerHeight", "markerUnits", "markerWidth", "maskContentUnits", "maskUnits", "numOctaves", "pathLength", "patternContentUnits", "patternTransform", "patternUnits", "pointsAtX", "pointsAtY", "pointsAtZ", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", "refX", "refY", "repeatCount", "repeatDur", "requiredExtensions", "requiredFeatures", "specularConstant", "specularExponent", "spreadMethod", "startOffset", "stdDeviation", "stitchTiles", "surfaceScale", "systemLanguage", "tableValues", "targetX", "targetY", "textLength", "viewBox", "viewTarget", "xChannelSelector", "yChannelSelector", "zoomAndPan"].map(e => [e.toLowerCase(), e])),
        aA = new Set(["style", "script", "xmp", "iframe", "noembed", "noframes", "plaintext", "noscript"]);

    function ah(e) {
        return e.replace(/"/g, "&quot;")
    }
    let am = new Set(["area", "base", "basefont", "br", "col", "command", "embed", "frame", "hr", "img", "input", "isindex", "keygen", "link", "meta", "param", "source", "track", "wbr"]);

    function af(e, t = {}) {
        let r = "length" in e ? e : [e],
            a = "";
        for (let e = 0; e < r.length; e++) a += function(e, t) {
            var r, a, n;
            switch (e.type) {
                case rO:
                    return af(e.children, t);
                case rG:
                case rM:
                    return r = e, `<${r.data}>`;
                case rL:
                    return a = e, `<!--${a.data}-->`;
                case rU:
                    return n = e, `<![CDATA[${n.children[0].data}]]>`;
                case rB:
                case rP:
                case rF:
                    return function(e, t) {
                        var r;
                        "foreign" === t.xmlMode && (e.name = null != (r = ad.get(e.name)) ? r : e.name, e.parent && ag.has(e.parent.name) && (t = { ...t,
                            xmlMode: !1
                        })), !t.xmlMode && ay.has(e.name) && (t = { ...t,
                            xmlMode: "foreign"
                        });
                        let a = `<${e.name}`,
                            n = function(e, t) {
                                var r;
                                if (!e) return;
                                let a = (null != (r = t.encodeEntities) ? r : t.decodeEntities) === !1 ? ah : t.xmlMode || "utf8" !== t.encodeEntities ? ao : ac;
                                return Object.keys(e).map(r => {
                                    var n, i;
                                    let s = null != (n = e[r]) ? n : "";
                                    return ("foreign" === t.xmlMode && (r = null != (i = ap.get(r)) ? i : r), t.emptyAttrs || t.xmlMode || "" !== s) ? `${r}="${a(s)}"` : r
                                }).join(" ")
                            }(e.attribs, t);
                        return n && (a += ` ${n}`), 0 === e.children.length && (t.xmlMode ? !1 !== t.selfClosingTags : t.selfClosingTags && am.has(e.name)) ? (t.xmlMode || (a += " "), a += "/>") : (a += ">", e.children.length > 0 && (a += af(e.children, t)), (t.xmlMode || !am.has(e.name)) && (a += `</${e.name}>`)), a
                    }(e, t);
                case rR:
                    return function(e, t) {
                        var r;
                        let a = e.data || "";
                        return (null != (r = t.encodeEntities) ? r : t.decodeEntities) === !1 || !t.xmlMode && e.parent && aA.has(e.parent.name) || (a = t.xmlMode || "utf8" !== t.encodeEntities ? ao(a) : au(a)), a
                    }(e, t)
            }
        }(r[e], t);
        return a
    }
    let ag = new Set(["mi", "mo", "mn", "ms", "mtext", "annotation-xml", "foreignObject", "desc", "title"]),
        ay = new Set(["svg", "math"]);

    function aT(e, t) {
        return af(e, t)
    }

    function aE(e, t) {
        return r2(e) ? e.children.map(e => aT(e, t)).join("") : ""
    }

    function ab(e) {
        return Array.isArray(e) ? e.map(ab).join("") : rJ(e) ? "br" === e.name ? "\n" : ab(e.children) : rZ(e) ? ab(e.children) : r$(e) ? e.data : ""
    }

    function aI(e) {
        return Array.isArray(e) ? e.map(aI).join("") : r2(e) && !rX(e) ? aI(e.children) : r$(e) ? e.data : ""
    }

    function aC(e) {
        return Array.isArray(e) ? e.map(aC).join("") : r2(e) && (e.type === P.Tag || rZ(e)) ? aC(e.children) : r$(e) ? e.data : ""
    }

    function aS(e) {
        return r2(e) ? e.children : []
    }

    function a_(e) {
        return e.parent || null
    }

    function aN(e) {
        let t = a_(e);
        if (null != t) return aS(t);
        let r = [e],
            {
                prev: a,
                next: n
            } = e;
        for (; null != a;) r.unshift(a), {
            prev: a
        } = a;
        for (; null != n;) r.push(n), {
            next: n
        } = n;
        return r
    }

    function ax(e, t) {
        var r;
        return null == (r = e.attribs) ? void 0 : r[t]
    }

    function ak(e, t) {
        return null != e.attribs && Object.prototype.hasOwnProperty.call(e.attribs, t) && null != e.attribs[t]
    }

    function aD(e) {
        return e.name
    }

    function av(e) {
        let {
            next: t
        } = e;
        for (; null !== t && !rJ(t);)({
            next: t
        } = t);
        return t
    }

    function aw(e) {
        let {
            prev: t
        } = e;
        for (; null !== t && !rJ(t);)({
            prev: t
        } = t);
        return t
    }

    function aO(e, t, r = !0, a = 1 / 0) {
        return aR(e, Array.isArray(t) ? t : [t], r, a)
    }

    function aR(e, t, r, a) {
        let n = [],
            i = [Array.isArray(t) ? t : [t]],
            s = [0];
        for (;;) {
            if (s[0] >= i[0].length) {
                if (1 === s.length) return n;
                i.shift(), s.shift();
                continue
            }
            let t = i[0][s[0]++];
            if (e(t) && (n.push(t), --a <= 0)) return n;
            r && r2(t) && t.children.length > 0 && (s.unshift(0), i.unshift(t.children))
        }
    }

    function aM(e, t) {
        return t.find(e)
    }

    function aL(e, t, r = !0) {
        let a = Array.isArray(t) ? t : [t];
        for (let t = 0; t < a.length; t++) {
            let n = a[t];
            if (rJ(n) && e(n)) return n;
            if (r && r2(n) && n.children.length > 0) {
                let t = aL(e, n.children, !0);
                if (t) return t
            }
        }
        return null
    }

    function aB(e, t) {
        return (Array.isArray(t) ? t : [t]).some(t => rJ(t) && e(t) || r2(t) && aB(e, t.children))
    }

    function aP(e, t) {
        let r = [],
            a = [Array.isArray(t) ? t : [t]],
            n = [0];
        for (;;) {
            if (n[0] >= a[0].length) {
                if (1 === a.length) return r;
                a.shift(), n.shift();
                continue
            }
            let t = a[0][n[0]++];
            rJ(t) && e(t) && r.push(t), r2(t) && t.children.length > 0 && (n.unshift(0), a.unshift(t.children))
        }
    }
    e.s(["getInnerHTML", 0, aE, "getOuterHTML", 0, aT, "getText", 0, ab, "innerText", 0, aC, "textContent", 0, aI], 748294), e.s(["getAttributeValue", 0, ax, "getChildren", 0, aS, "getName", 0, aD, "getParent", 0, a_, "getSiblings", 0, aN, "hasAttrib", 0, ak, "nextElementSibling", 0, av, "prevElementSibling", 0, aw], 650874), e.s(["existsOne", 0, aB, "filter", 0, aO, "find", 0, aR, "findAll", 0, aP, "findOne", 0, aL, "findOneChild", 0, aM], 614790);
    let aF = {
        tag_name: e => "function" == typeof e ? t => rJ(t) && e(t.name) : "*" === e ? rJ : t => rJ(t) && t.name === e,
        tag_type: e => "function" == typeof e ? t => e(t.type) : t => t.type === e,
        tag_contains: e => "function" == typeof e ? t => r$(t) && e(t.data) : t => r$(t) && t.data === e
    };

    function aU(e, t) {
        return "function" == typeof t ? r => rJ(r) && t(r.attribs[e]) : r => rJ(r) && r.attribs[e] === t
    }

    function aG(e, t) {
        return r => e(r) || t(r)
    }

    function aH(e) {
        let t = Object.keys(e).map(t => {
            let r = e[t];
            return Object.prototype.hasOwnProperty.call(aF, t) ? aF[t](r) : aU(t, r)
        });
        return 0 === t.length ? null : t.reduce(aG)
    }

    function aj(e, t) {
        let r = aH(e);
        return !r || r(t)
    }

    function aQ(e, t, r, a = 1 / 0) {
        let n = aH(e);
        return n ? aO(n, t, r, a) : []
    }

    function aK(e, t, r = !0) {
        return Array.isArray(t) || (t = [t]), aL(aU("id", e), t, r)
    }

    function aY(e, t, r = !0, a = 1 / 0) {
        return aO(aF.tag_name(e), t, r, a)
    }

    function aW(e, t, r = !0, a = 1 / 0) {
        return aO(aU("class", e), t, r, a)
    }

    function aq(e, t, r = !0, a = 1 / 0) {
        return aO(aF.tag_type(e), t, r, a)
    }

    function aV(e) {
        let t = e.length;
        for (; --t >= 0;) {
            let r = e[t];
            if (t > 0 && e.lastIndexOf(r, t - 1) >= 0) {
                e.splice(t, 1);
                continue
            }
            for (let a = r.parent; a; a = a.parent)
                if (e.includes(a)) {
                    e.splice(t, 1);
                    break
                }
        }
        return e
    }

    function az(e, t) {
        let r = [],
            a = [];
        if (e === t) return 0;
        let n = r2(e) ? e : e.parent;
        for (; n;) r.unshift(n), n = n.parent;
        for (n = r2(t) ? t : t.parent; n;) a.unshift(n), n = n.parent;
        let i = Math.min(r.length, a.length),
            s = 0;
        for (; s < i && r[s] === a[s];) s++;
        if (0 === s) return Y.DISCONNECTED;
        let o = r[s - 1],
            l = o.children,
            c = r[s],
            u = a[s];
        return l.indexOf(c) > l.indexOf(u) ? o === t ? Y.FOLLOWING | Y.CONTAINED_BY : Y.FOLLOWING : o === e ? Y.PRECEDING | Y.CONTAINS : Y.PRECEDING
    }

    function aJ(e) {
        return (e = e.filter((e, t, r) => !r.includes(e, t + 1))).sort((e, t) => {
            let r = az(e, t);
            return r & Y.PRECEDING ? -1 : r & Y.FOLLOWING ? 1 : 0
        }), e
    }

    function aZ(e) {
        var t, r, a, n;
        let i, s, o, l, c, u, d, p = a1(a6, e);
        return p ? "feed" === p.name ? (s = {
            type: "atom",
            items: aY("entry", i = p.children).map(e => {
                var t;
                let {
                    children: r
                } = e, a = {
                    media: a0(r)
                };
                a5(a, "id", "id", r), a5(a, "title", "title", r);
                let n = null == (t = a1("link", r)) ? void 0 : t.attribs.href;
                n && (a.link = n);
                let i = a2("summary", r) || a2("content", r);
                i && (a.description = i);
                let s = a2("updated", r);
                return s && (a.pubDate = new Date(s)), a
            })
        }, a5(s, "id", "id", i), a5(s, "title", "title", i), (o = null == (t = a1("link", i)) ? void 0 : t.attribs.href) && (s.link = o), a5(s, "description", "subtitle", i), (l = a2("updated", i)) && (s.updated = new Date(l)), a5(s, "author", "email", i, !0), s) : (c = null != (n = null == (a = a1("channel", (r = p).children)) ? void 0 : a.children) ? n : [], u = {
            type: r.name.substr(0, 3),
            id: "",
            items: aY("item", r.children).map(e => {
                let {
                    children: t
                } = e, r = {
                    media: a0(t)
                };
                a5(r, "id", "guid", t), a5(r, "title", "title", t), a5(r, "link", "link", t), a5(r, "description", "description", t);
                let a = a2("pubDate", t) || a2("dc:date", t);
                return a && (r.pubDate = new Date(a)), r
            })
        }, a5(u, "title", "title", c), a5(u, "link", "link", c), a5(u, "description", "description", c), (d = a2("lastBuildDate", c)) && (u.updated = new Date(d)), a5(u, "author", "managingEditor", c, !0), u) : null
    }
    e.s(["getElementById", 0, aK, "getElements", 0, aQ, "getElementsByClassName", 0, aW, "getElementsByTagName", 0, aY, "getElementsByTagType", 0, aq, "testElement", 0, aj], 368047), (l = Y || (Y = {}))[l.DISCONNECTED = 1] = "DISCONNECTED", l[l.PRECEDING = 2] = "PRECEDING", l[l.FOLLOWING = 4] = "FOLLOWING", l[l.CONTAINS = 8] = "CONTAINS", l[l.CONTAINED_BY = 16] = "CONTAINED_BY", e.s(["DocumentPosition", 0, Y, "compareDocumentPosition", 0, az, "removeSubsets", 0, aV, "uniqueSort", 0, aJ], 195862);
    let a$ = ["url", "type", "lang"],
        aX = ["fileSize", "bitrate", "framerate", "samplingrate", "channels", "duration", "height", "width"];

    function a0(e) {
        return aY("media:content", e).map(e => {
            let {
                attribs: t
            } = e, r = {
                medium: t.medium,
                isDefault: !!t.isDefault
            };
            for (let e of a$) t[e] && (r[e] = t[e]);
            for (let e of aX) t[e] && (r[e] = parseInt(t[e], 10));
            return t.expression && (r.expression = t.expression), r
        })
    }

    function a1(e, t) {
        return aY(e, t, !0, 1)[0]
    }

    function a2(e, t, r = !1) {
        return aI(aY(e, t, r, 1)).trim()
    }

    function a5(e, t, r, a, n = !1) {
        let i = a2(r, a, n);
        i && (e[t] = i)
    }

    function a6(e) {
        return "rss" === e || "feed" === e || "rdf:RDF" === e
    }
    e.s(["getFeed", 0, aZ], 30744), e.s([], 63080);
    let a3 = {
        _useHtmlParser2: !1
    };

    function a4(e, t) {
        if (!e) return null != t ? t : a3;
        let r = {
            _useHtmlParser2: !!e.xmlMode,
            ...t,
            ...e
        };
        return e.xml ? (r._useHtmlParser2 = !0, r.xmlMode = !0, !0 !== e.xml && Object.assign(r, e.xml)) : e.xmlMode && (r._useHtmlParser2 = !0), r
    }

    function a8(e, t, r) {
        return e ? e(null != t ? t : e._root.children, null, void 0, r).toString() : ""
    }

    function a9(e) {
        let t = null != e ? e : this ? this.root() : [],
            r = "";
        for (let e = 0; e < t.length; e++) r += aI(t[e]);
        return r
    }

    function a7(e, t) {
        if (t === e) return !1;
        let r = t;
        for (; r && r !== r.parent;)
            if ((r = r.parent) === e) return !0;
        return !1
    }

    function ne(e) {
        if (Array.isArray(e)) return !0;
        if ("object" != typeof e || null === e || !("length" in e) || "number" != typeof e.length || e.length < 0) return !1;
        for (let t = 0; t < e.length; t++)
            if (!(t in e)) return !1;
        return !0
    }
    e.s(["contains", 0, a7, "extract", 0, function(e) {
        return this.root().extract(e)
    }, "html", 0, function(e, t) {
        return a8(this, "object" != typeof e || null == e || "length" in e || "type" in e ? e : void(t = e), { ...this === null || void 0 === this ? void 0 : this._options,
            ...a4(t)
        })
    }, "merge", 0, function(e, t) {
        if (!ne(e) || !ne(t)) return;
        let r = e.length,
            a = +t.length;
        for (let n = 0; n < a; n++) e[r++] = t[n];
        return e.length = r, e
    }, "parseHTML", 0, function(e, t, r = "boolean" == typeof t && t) {
        if (!e || "string" != typeof e) return null;
        "boolean" == typeof t && (r = t);
        let a = this.load(e, this._options, !1);
        return r || a("script").remove(), [...a.root()[0].children]
    }, "root", 0, function() {
        return this(this._root)
    }, "text", 0, a9, "xml", 0, function(e) {
        return a8(this, e, { ...this._options,
            xmlMode: !0
        })
    }], 74866);
    var nt = e.i(74866);

    function nr(e) {
        return null != e.cheerio
    }

    function na(e, t) {
        let r = e.length;
        for (let a = 0; a < r; a++) t(e[a], a);
        return e
    }

    function nn(e) {
        if ("string" != typeof e) return !1;
        let t = e.indexOf("<");
        if (-1 === t || t > e.length - 3) return !1;
        let r = e.charCodeAt(t + 1);
        return (r >= W.LowerA && r <= W.LowerZ || r >= W.UpperA && r <= W.UpperZ || r === W.Exclamation) && e.includes(">", t + 2)
    }(c = W || (W = {}))[c.LowerA = 97] = "LowerA", c[c.LowerZ = 122] = "LowerZ", c[c.UpperA = 65] = "UpperA", c[c.UpperZ = 90] = "UpperZ", c[c.Exclamation = 33] = "Exclamation";
    let ni = new Map([
            [0, 65533],
            [128, 8364],
            [130, 8218],
            [131, 402],
            [132, 8222],
            [133, 8230],
            [134, 8224],
            [135, 8225],
            [136, 710],
            [137, 8240],
            [138, 352],
            [139, 8249],
            [140, 338],
            [142, 381],
            [145, 8216],
            [146, 8217],
            [147, 8220],
            [148, 8221],
            [149, 8226],
            [150, 8211],
            [151, 8212],
            [152, 732],
            [153, 8482],
            [154, 353],
            [155, 8250],
            [156, 339],
            [158, 382],
            [159, 376]
        ]),
        ns = null != (q = String.fromCodePoint) ? q : e => {
            let t = "";
            return e > 65535 && (e -= 65536, t += String.fromCharCode(e >>> 10 & 1023 | 55296), e = 56320 | 1023 & e), t += String.fromCharCode(e)
        };
    var no = e.i(93257);

    function nl(e) {
        let t = "function" == typeof atob ? atob(e) : "function" == typeof no.Buffer.from ? no.Buffer.from(e, "base64").toString("binary") : new no.Buffer(e, "base64").toString("binary"),
            r = -2 & t.length,
            a = new Uint16Array(r / 2);
        for (let e = 0, n = 0; e < r; e += 2) {
            let r = t.charCodeAt(e),
                i = t.charCodeAt(e + 1);
            a[n++] = r | i << 8
        }
        return a
    }
    let nc = nl(" "),
        nu = nl("AAJhZ2xxBwARABMAFQBtAg0AAAAAAA8AcAAmYG8AcwAnYHQAPmB0ADxg9SFvdCJg");

    function nd(e) {
        return e >= z.ZERO && e <= z.NINE
    }(u = V || (V = {}))[u.VALUE_LENGTH = 49152] = "VALUE_LENGTH", u[u.FLAG13 = 8192] = "FLAG13", u[u.BRANCH_LENGTH = 8064] = "BRANCH_LENGTH", u[u.JUMP_TABLE = 127] = "JUMP_TABLE", (d = z || (z = {}))[d.NUM = 35] = "NUM", d[d.SEMI = 59] = "SEMI", d[d.EQUALS = 61] = "EQUALS", d[d.ZERO = 48] = "ZERO", d[d.NINE = 57] = "NINE", d[d.LOWER_A = 97] = "LOWER_A", d[d.LOWER_F = 102] = "LOWER_F", d[d.LOWER_X = 120] = "LOWER_X", d[d.LOWER_Z = 122] = "LOWER_Z", d[d.UPPER_A = 65] = "UPPER_A", d[d.UPPER_F = 70] = "UPPER_F", d[d.UPPER_Z = 90] = "UPPER_Z", (p = J || (J = {}))[p.EntityStart = 0] = "EntityStart", p[p.NumericStart = 1] = "NumericStart", p[p.NumericDecimal = 2] = "NumericDecimal", p[p.NumericHex = 3] = "NumericHex", p[p.NamedEntity = 4] = "NamedEntity", (A = Z || (Z = {}))[A.Legacy = 0] = "Legacy", A[A.Strict = 1] = "Strict", A[A.Attribute = 2] = "Attribute";
    class np {
        constructor(e, t, r) {
            this.decodeTree = e, this.emitCodePoint = t, this.errors = r, this.state = J.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = Z.Strict, this.runConsumed = 0
        }
        startEntity(e) {
            this.decodeMode = e, this.state = J.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1, this.runConsumed = 0
        }
        write(e, t) {
            switch (this.state) {
                case J.EntityStart:
                    if (e.charCodeAt(t) === z.NUM) return this.state = J.NumericStart, this.consumed += 1, this.stateNumericStart(e, t + 1);
                    return this.state = J.NamedEntity, this.stateNamedEntity(e, t);
                case J.NumericStart:
                    return this.stateNumericStart(e, t);
                case J.NumericDecimal:
                    return this.stateNumericDecimal(e, t);
                case J.NumericHex:
                    return this.stateNumericHex(e, t);
                case J.NamedEntity:
                    return this.stateNamedEntity(e, t)
            }
        }
        stateNumericStart(e, t) {
            return t >= e.length ? -1 : (32 | e.charCodeAt(t)) === z.LOWER_X ? (this.state = J.NumericHex, this.consumed += 1, this.stateNumericHex(e, t + 1)) : (this.state = J.NumericDecimal, this.stateNumericDecimal(e, t))
        }
        stateNumericHex(e, t) {
            for (; t < e.length;) {
                var r;
                let a = e.charCodeAt(t);
                if (!nd(a) && (!((r = a) >= z.UPPER_A) || !(r <= z.UPPER_F)) && (!(r >= z.LOWER_A) || !(r <= z.LOWER_F))) return this.emitNumericEntity(a, 3); {
                    let e = a <= z.NINE ? a - z.ZERO : (32 | a) - z.LOWER_A + 10;
                    this.result = 16 * this.result + e, this.consumed++, t++
                }
            }
            return -1
        }
        stateNumericDecimal(e, t) {
            for (; t < e.length;) {
                let r = e.charCodeAt(t);
                if (!nd(r)) return this.emitNumericEntity(r, 2);
                this.result = 10 * this.result + (r - z.ZERO), this.consumed++, t++
            }
            return -1
        }
        emitNumericEntity(e, t) {
            var r, a, n;
            if (this.consumed <= t) return null == (r = this.errors) || r.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
            if (e === z.SEMI) this.consumed += 1;
            else if (this.decodeMode === Z.Strict) return 0;
            return this.emitCodePoint((a = this.result) >= 55296 && a <= 57343 || a > 1114111 ? 65533 : null != (n = ni.get(a)) ? n : a, this.consumed), this.errors && (e !== z.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed
        }
        stateNamedEntity(e, t) {
            let {
                decodeTree: r
            } = this, a = r[this.treeIndex], n = (a & V.VALUE_LENGTH) >> 14;
            for (; t < e.length;) {
                if (0 === n && (a & V.FLAG13) != 0) {
                    let i = (a & V.BRANCH_LENGTH) >> 7;
                    if (0 === this.runConsumed) {
                        let r = a & V.JUMP_TABLE;
                        if (e.charCodeAt(t) !== r) return 0 === this.result ? 0 : this.emitNotTerminatedNamedEntity();
                        t++, this.excess++, this.runConsumed++
                    }
                    for (; this.runConsumed < i;) {
                        if (t >= e.length) return -1;
                        let a = this.runConsumed - 1,
                            n = r[this.treeIndex + 1 + (a >> 1)],
                            i = a % 2 == 0 ? 255 & n : n >> 8 & 255;
                        if (e.charCodeAt(t) !== i) return this.runConsumed = 0, 0 === this.result ? 0 : this.emitNotTerminatedNamedEntity();
                        t++, this.excess++, this.runConsumed++
                    }
                    this.runConsumed = 0, this.treeIndex += 1 + (i >> 1), n = ((a = r[this.treeIndex]) & V.VALUE_LENGTH) >> 14
                }
                if (t >= e.length) break;
                let i = e.charCodeAt(t);
                if (i === z.SEMI && 0 !== n && (a & V.FLAG13) != 0) return this.emitNamedEntityData(this.treeIndex, n, this.consumed + this.excess);
                if (this.treeIndex = function(e, t, r, a) {
                        let n = (t & V.BRANCH_LENGTH) >> 7,
                            i = t & V.JUMP_TABLE;
                        if (0 === n) return 0 !== i && a === i ? r : -1;
                        if (i) {
                            let t = a - i;
                            return t < 0 || t >= n ? -1 : e[r + t] - 1
                        }
                        let s = n + 1 >> 1,
                            o = 0,
                            l = n - 1;
                        for (; o <= l;) {
                            let t = o + l >>> 1,
                                n = e[r + (t >> 1)] >> (1 & t) * 8 & 255;
                            if (n < a) o = t + 1;
                            else {
                                if (!(n > a)) return e[r + s + t];
                                l = t - 1
                            }
                        }
                        return -1
                    }(r, a, this.treeIndex + Math.max(1, n), i), this.treeIndex < 0) return 0 === this.result || this.decodeMode === Z.Attribute && (0 === n || function(e) {
                    var t;
                    return e === z.EQUALS || (t = e) >= z.UPPER_A && t <= z.UPPER_Z || t >= z.LOWER_A && t <= z.LOWER_Z || nd(t)
                }(i)) ? 0 : this.emitNotTerminatedNamedEntity();
                if (0 != (n = ((a = r[this.treeIndex]) & V.VALUE_LENGTH) >> 14)) {
                    if (i === z.SEMI) return this.emitNamedEntityData(this.treeIndex, n, this.consumed + this.excess);
                    this.decodeMode !== Z.Strict && (a & V.FLAG13) == 0 && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0)
                }
                t++, this.excess++
            }
            return -1
        }
        emitNotTerminatedNamedEntity() {
            var e;
            let {
                result: t,
                decodeTree: r
            } = this, a = (r[t] & V.VALUE_LENGTH) >> 14;
            return this.emitNamedEntityData(t, a, this.consumed), null == (e = this.errors) || e.missingSemicolonAfterCharacterReference(), this.consumed
        }
        emitNamedEntityData(e, t, r) {
            let {
                decodeTree: a
            } = this;
            return this.emitCodePoint(1 === t ? a[e] & ~(V.VALUE_LENGTH | V.FLAG13) : a[e + 1], r), 3 === t && this.emitCodePoint(a[e + 2], r), r
        }
        end() {
            var e;
            switch (this.state) {
                case J.NamedEntity:
                    return 0 !== this.result && (this.decodeMode !== Z.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
                case J.NumericDecimal:
                    return this.emitNumericEntity(0, 2);
                case J.NumericHex:
                    return this.emitNumericEntity(0, 3);
                case J.NumericStart:
                    return null == (e = this.errors) || e.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
                case J.EntityStart:
                    return 0
            }
        }
    }

    function nA(e) {
        return e === $.Space || e === $.NewLine || e === $.Tab || e === $.FormFeed || e === $.CarriageReturn
    }

    function nh(e) {
        return e === $.Slash || e === $.Gt || nA(e)
    }(h = $ || ($ = {}))[h.Tab = 9] = "Tab", h[h.NewLine = 10] = "NewLine", h[h.FormFeed = 12] = "FormFeed", h[h.CarriageReturn = 13] = "CarriageReturn", h[h.Space = 32] = "Space", h[h.ExclamationMark = 33] = "ExclamationMark", h[h.Number = 35] = "Number", h[h.Amp = 38] = "Amp", h[h.SingleQuote = 39] = "SingleQuote", h[h.DoubleQuote = 34] = "DoubleQuote", h[h.Dash = 45] = "Dash", h[h.Slash = 47] = "Slash", h[h.Zero = 48] = "Zero", h[h.Nine = 57] = "Nine", h[h.Semi = 59] = "Semi", h[h.Lt = 60] = "Lt", h[h.Eq = 61] = "Eq", h[h.Gt = 62] = "Gt", h[h.Questionmark = 63] = "Questionmark", h[h.UpperA = 65] = "UpperA", h[h.LowerA = 97] = "LowerA", h[h.UpperF = 70] = "UpperF", h[h.LowerF = 102] = "LowerF", h[h.UpperZ = 90] = "UpperZ", h[h.LowerZ = 122] = "LowerZ", h[h.LowerX = 120] = "LowerX", h[h.OpeningSquareBracket = 91] = "OpeningSquareBracket", (m = X || (X = {}))[m.Text = 1] = "Text", m[m.BeforeTagName = 2] = "BeforeTagName", m[m.InTagName = 3] = "InTagName", m[m.InSelfClosingTag = 4] = "InSelfClosingTag", m[m.BeforeClosingTagName = 5] = "BeforeClosingTagName", m[m.InClosingTagName = 6] = "InClosingTagName", m[m.AfterClosingTagName = 7] = "AfterClosingTagName", m[m.BeforeAttributeName = 8] = "BeforeAttributeName", m[m.InAttributeName = 9] = "InAttributeName", m[m.AfterAttributeName = 10] = "AfterAttributeName", m[m.BeforeAttributeValue = 11] = "BeforeAttributeValue", m[m.InAttributeValueDq = 12] = "InAttributeValueDq", m[m.InAttributeValueSq = 13] = "InAttributeValueSq", m[m.InAttributeValueNq = 14] = "InAttributeValueNq", m[m.BeforeDeclaration = 15] = "BeforeDeclaration", m[m.InDeclaration = 16] = "InDeclaration", m[m.InProcessingInstruction = 17] = "InProcessingInstruction", m[m.BeforeComment = 18] = "BeforeComment", m[m.CDATASequence = 19] = "CDATASequence", m[m.InSpecialComment = 20] = "InSpecialComment", m[m.InCommentLike = 21] = "InCommentLike", m[m.BeforeSpecialS = 22] = "BeforeSpecialS", m[m.BeforeSpecialT = 23] = "BeforeSpecialT", m[m.SpecialStartSequence = 24] = "SpecialStartSequence", m[m.InSpecialTag = 25] = "InSpecialTag", m[m.InEntity = 26] = "InEntity", (f = ee || (ee = {}))[f.NoValue = 0] = "NoValue", f[f.Unquoted = 1] = "Unquoted", f[f.Single = 2] = "Single", f[f.Double = 3] = "Double";
    let nm = {
        Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
        CdataEnd: new Uint8Array([93, 93, 62]),
        CommentEnd: new Uint8Array([45, 45, 62]),
        ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
        StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
        TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),
        TextareaEnd: new Uint8Array([60, 47, 116, 101, 120, 116, 97, 114, 101, 97]),
        XmpEnd: new Uint8Array([60, 47, 120, 109, 112])
    };
    class nf {
        constructor({
            xmlMode: e = !1,
            decodeEntities: t = !0
        }, r) {
            this.cbs = r, this.state = X.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.entityStart = 0, this.baseState = X.Text, this.isSpecial = !1, this.running = !0, this.offset = 0, this.currentSequence = void 0, this.sequenceIndex = 0, this.xmlMode = e, this.decodeEntities = t, this.entityDecoder = new np(e ? nu : nc, (e, t) => this.emitCodePoint(e, t))
        }
        reset() {
            this.state = X.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = X.Text, this.currentSequence = void 0, this.running = !0, this.offset = 0
        }
        write(e) {
            this.offset += this.buffer.length, this.buffer = e, this.parse()
        }
        end() {
            this.running && this.finish()
        }
        pause() {
            this.running = !1
        }
        resume() {
            this.running = !0, this.index < this.buffer.length + this.offset && this.parse()
        }
        stateText(e) {
            e === $.Lt || !this.decodeEntities && this.fastForwardTo($.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = X.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && e === $.Amp && this.startEntity()
        }
        stateSpecialStartSequence(e) {
            let t = this.sequenceIndex === this.currentSequence.length;
            if (t ? nh(e) : (32 | e) === this.currentSequence[this.sequenceIndex]) {
                if (!t) return void this.sequenceIndex++
            } else this.isSpecial = !1;
            this.sequenceIndex = 0, this.state = X.InTagName, this.stateInTagName(e)
        }
        stateInSpecialTag(e) {
            if (this.sequenceIndex === this.currentSequence.length) {
                if (e === $.Gt || nA(e)) {
                    let t = this.index - this.currentSequence.length;
                    if (this.sectionStart < t) {
                        let e = this.index;
                        this.index = t, this.cbs.ontext(this.sectionStart, t), this.index = e
                    }
                    this.isSpecial = !1, this.sectionStart = t + 2, this.stateInClosingTagName(e);
                    return
                }
                this.sequenceIndex = 0
            }(32 | e) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : 0 === this.sequenceIndex ? this.currentSequence === nm.TitleEnd ? this.decodeEntities && e === $.Amp && this.startEntity() : this.fastForwardTo($.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = Number(e === $.Lt)
        }
        stateCDATASequence(e) {
            e === nm.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === nm.Cdata.length && (this.state = X.InCommentLike, this.currentSequence = nm.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = X.InDeclaration, this.stateInDeclaration(e))
        }
        fastForwardTo(e) {
            for (; ++this.index < this.buffer.length + this.offset;)
                if (this.buffer.charCodeAt(this.index - this.offset) === e) return !0;
            return this.index = this.buffer.length + this.offset - 1, !1
        }
        stateInCommentLike(e) {
            e === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === nm.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = X.Text) : 0 === this.sequenceIndex ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : e !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0)
        }
        isTagStartChar(e) {
            return this.xmlMode ? !nh(e) : e >= $.LowerA && e <= $.LowerZ || e >= $.UpperA && e <= $.UpperZ
        }
        startSpecial(e, t) {
            this.isSpecial = !0, this.currentSequence = e, this.sequenceIndex = t, this.state = X.SpecialStartSequence
        }
        stateBeforeTagName(e) {
            if (e === $.ExclamationMark) this.state = X.BeforeDeclaration, this.sectionStart = this.index + 1;
            else if (e === $.Questionmark) this.state = X.InProcessingInstruction, this.sectionStart = this.index + 1;
            else if (this.isTagStartChar(e)) {
                let t = 32 | e;
                this.sectionStart = this.index, this.xmlMode ? this.state = X.InTagName : t === nm.ScriptEnd[2] ? this.state = X.BeforeSpecialS : t === nm.TitleEnd[2] || t === nm.XmpEnd[2] ? this.state = X.BeforeSpecialT : this.state = X.InTagName
            } else e === $.Slash ? this.state = X.BeforeClosingTagName : (this.state = X.Text, this.stateText(e))
        }
        stateInTagName(e) {
            nh(e) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = X.BeforeAttributeName, this.stateBeforeAttributeName(e))
        }
        stateBeforeClosingTagName(e) {
            nA(e) || (e === $.Gt ? this.state = X.Text : (this.state = this.isTagStartChar(e) ? X.InClosingTagName : X.InSpecialComment, this.sectionStart = this.index))
        }
        stateInClosingTagName(e) {
            (e === $.Gt || nA(e)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = X.AfterClosingTagName, this.stateAfterClosingTagName(e))
        }
        stateAfterClosingTagName(e) {
            (e === $.Gt || this.fastForwardTo($.Gt)) && (this.state = X.Text, this.sectionStart = this.index + 1)
        }
        stateBeforeAttributeName(e) {
            e === $.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = X.InSpecialTag, this.sequenceIndex = 0) : this.state = X.Text, this.sectionStart = this.index + 1) : e === $.Slash ? this.state = X.InSelfClosingTag : nA(e) || (this.state = X.InAttributeName, this.sectionStart = this.index)
        }
        stateInSelfClosingTag(e) {
            e === $.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = X.Text, this.sectionStart = this.index + 1, this.isSpecial = !1) : nA(e) || (this.state = X.BeforeAttributeName, this.stateBeforeAttributeName(e))
        }
        stateInAttributeName(e) {
            (e === $.Eq || nh(e)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = X.AfterAttributeName, this.stateAfterAttributeName(e))
        }
        stateAfterAttributeName(e) {
            e === $.Eq ? this.state = X.BeforeAttributeValue : e === $.Slash || e === $.Gt ? (this.cbs.onattribend(ee.NoValue, this.sectionStart), this.sectionStart = -1, this.state = X.BeforeAttributeName, this.stateBeforeAttributeName(e)) : nA(e) || (this.cbs.onattribend(ee.NoValue, this.sectionStart), this.state = X.InAttributeName, this.sectionStart = this.index)
        }
        stateBeforeAttributeValue(e) {
            e === $.DoubleQuote ? (this.state = X.InAttributeValueDq, this.sectionStart = this.index + 1) : e === $.SingleQuote ? (this.state = X.InAttributeValueSq, this.sectionStart = this.index + 1) : nA(e) || (this.sectionStart = this.index, this.state = X.InAttributeValueNq, this.stateInAttributeValueNoQuotes(e))
        }
        handleInAttributeValue(e, t) {
            e === t || !this.decodeEntities && this.fastForwardTo(t) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(t === $.DoubleQuote ? ee.Double : ee.Single, this.index + 1), this.state = X.BeforeAttributeName) : this.decodeEntities && e === $.Amp && this.startEntity()
        }
        stateInAttributeValueDoubleQuotes(e) {
            this.handleInAttributeValue(e, $.DoubleQuote)
        }
        stateInAttributeValueSingleQuotes(e) {
            this.handleInAttributeValue(e, $.SingleQuote)
        }
        stateInAttributeValueNoQuotes(e) {
            nA(e) || e === $.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(ee.Unquoted, this.index), this.state = X.BeforeAttributeName, this.stateBeforeAttributeName(e)) : this.decodeEntities && e === $.Amp && this.startEntity()
        }
        stateBeforeDeclaration(e) {
            e === $.OpeningSquareBracket ? (this.state = X.CDATASequence, this.sequenceIndex = 0) : this.state = e === $.Dash ? X.BeforeComment : X.InDeclaration
        }
        stateInDeclaration(e) {
            (e === $.Gt || this.fastForwardTo($.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = X.Text, this.sectionStart = this.index + 1)
        }
        stateInProcessingInstruction(e) {
            (e === $.Gt || this.fastForwardTo($.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = X.Text, this.sectionStart = this.index + 1)
        }
        stateBeforeComment(e) {
            e === $.Dash ? (this.state = X.InCommentLike, this.currentSequence = nm.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = X.InDeclaration
        }
        stateInSpecialComment(e) {
            (e === $.Gt || this.fastForwardTo($.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = X.Text, this.sectionStart = this.index + 1)
        }
        stateBeforeSpecialS(e) {
            let t = 32 | e;
            t === nm.ScriptEnd[3] ? this.startSpecial(nm.ScriptEnd, 4) : t === nm.StyleEnd[3] ? this.startSpecial(nm.StyleEnd, 4) : (this.state = X.InTagName, this.stateInTagName(e))
        }
        stateBeforeSpecialT(e) {
            switch (32 | e) {
                case nm.TitleEnd[3]:
                    this.startSpecial(nm.TitleEnd, 4);
                    break;
                case nm.TextareaEnd[3]:
                    this.startSpecial(nm.TextareaEnd, 4);
                    break;
                case nm.XmpEnd[3]:
                    this.startSpecial(nm.XmpEnd, 4);
                    break;
                default:
                    this.state = X.InTagName, this.stateInTagName(e)
            }
        }
        startEntity() {
            this.baseState = this.state, this.state = X.InEntity, this.entityStart = this.index, this.entityDecoder.startEntity(this.xmlMode ? Z.Strict : this.baseState === X.Text || this.baseState === X.InSpecialTag ? Z.Legacy : Z.Attribute)
        }
        stateInEntity() {
            let e = this.index - this.offset,
                t = this.entityDecoder.write(this.buffer, e);
            if (t >= 0) this.state = this.baseState, 0 === t && (this.index -= 1);
            else {
                if (e < this.buffer.length && this.buffer.charCodeAt(e) === $.Amp) {
                    this.state = this.baseState, this.index -= 1;
                    return
                }
                this.index = this.offset + this.buffer.length - 1
            }
        }
        cleanup() {
            this.running && this.sectionStart !== this.index && (this.state === X.Text || this.state === X.InSpecialTag && 0 === this.sequenceIndex ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === X.InAttributeValueDq || this.state === X.InAttributeValueSq || this.state === X.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index))
        }
        shouldContinue() {
            return this.index < this.buffer.length + this.offset && this.running
        }
        parse() {
            for (; this.shouldContinue();) {
                let e = this.buffer.charCodeAt(this.index - this.offset);
                switch (this.state) {
                    case X.Text:
                        this.stateText(e);
                        break;
                    case X.SpecialStartSequence:
                        this.stateSpecialStartSequence(e);
                        break;
                    case X.InSpecialTag:
                        this.stateInSpecialTag(e);
                        break;
                    case X.CDATASequence:
                        this.stateCDATASequence(e);
                        break;
                    case X.InAttributeValueDq:
                        this.stateInAttributeValueDoubleQuotes(e);
                        break;
                    case X.InAttributeName:
                        this.stateInAttributeName(e);
                        break;
                    case X.InCommentLike:
                        this.stateInCommentLike(e);
                        break;
                    case X.InSpecialComment:
                        this.stateInSpecialComment(e);
                        break;
                    case X.BeforeAttributeName:
                        this.stateBeforeAttributeName(e);
                        break;
                    case X.InTagName:
                        this.stateInTagName(e);
                        break;
                    case X.InClosingTagName:
                        this.stateInClosingTagName(e);
                        break;
                    case X.BeforeTagName:
                        this.stateBeforeTagName(e);
                        break;
                    case X.AfterAttributeName:
                        this.stateAfterAttributeName(e);
                        break;
                    case X.InAttributeValueSq:
                        this.stateInAttributeValueSingleQuotes(e);
                        break;
                    case X.BeforeAttributeValue:
                        this.stateBeforeAttributeValue(e);
                        break;
                    case X.BeforeClosingTagName:
                        this.stateBeforeClosingTagName(e);
                        break;
                    case X.AfterClosingTagName:
                        this.stateAfterClosingTagName(e);
                        break;
                    case X.BeforeSpecialS:
                        this.stateBeforeSpecialS(e);
                        break;
                    case X.BeforeSpecialT:
                        this.stateBeforeSpecialT(e);
                        break;
                    case X.InAttributeValueNq:
                        this.stateInAttributeValueNoQuotes(e);
                        break;
                    case X.InSelfClosingTag:
                        this.stateInSelfClosingTag(e);
                        break;
                    case X.InDeclaration:
                        this.stateInDeclaration(e);
                        break;
                    case X.BeforeDeclaration:
                        this.stateBeforeDeclaration(e);
                        break;
                    case X.BeforeComment:
                        this.stateBeforeComment(e);
                        break;
                    case X.InProcessingInstruction:
                        this.stateInProcessingInstruction(e);
                        break;
                    case X.InEntity:
                        this.stateInEntity()
                }
                this.index++
            }
            this.cleanup()
        }
        finish() {
            this.state === X.InEntity && (this.entityDecoder.end(), this.state = this.baseState), this.handleTrailingData(), this.cbs.onend()
        }
        handleTrailingData() {
            let e = this.buffer.length + this.offset;
            this.sectionStart >= e || (this.state === X.InCommentLike ? this.currentSequence === nm.CdataEnd ? this.cbs.oncdata(this.sectionStart, e, 0) : this.cbs.oncomment(this.sectionStart, e, 0) : this.state === X.InTagName || this.state === X.BeforeAttributeName || this.state === X.BeforeAttributeValue || this.state === X.AfterAttributeName || this.state === X.InAttributeName || this.state === X.InAttributeValueSq || this.state === X.InAttributeValueDq || this.state === X.InAttributeValueNq || this.state === X.InClosingTagName || this.cbs.ontext(this.sectionStart, e))
        }
        emitCodePoint(e, t) {
            this.baseState !== X.Text && this.baseState !== X.InSpecialTag ? (this.sectionStart < this.entityStart && this.cbs.onattribdata(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + t, this.index = this.sectionStart - 1, this.cbs.onattribentity(e)) : (this.sectionStart < this.entityStart && this.cbs.ontext(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + t, this.index = this.sectionStart - 1, this.cbs.ontextentity(e, this.sectionStart))
        }
    }
    let ng = new Set(["input", "option", "optgroup", "select", "button", "datalist", "textarea"]),
        ny = new Set(["p"]),
        nT = new Set(["thead", "tbody"]),
        nE = new Set(["dd", "dt"]),
        nb = new Set(["rt", "rp"]),
        nI = new Map([
            ["tr", new Set(["tr", "th", "td"])],
            ["th", new Set(["th"])],
            ["td", new Set(["thead", "th", "td"])],
            ["body", new Set(["head", "link", "script"])],
            ["li", new Set(["li"])],
            ["p", ny],
            ["h1", ny],
            ["h2", ny],
            ["h3", ny],
            ["h4", ny],
            ["h5", ny],
            ["h6", ny],
            ["select", ng],
            ["input", ng],
            ["output", ng],
            ["button", ng],
            ["datalist", ng],
            ["textarea", ng],
            ["option", new Set(["option"])],
            ["optgroup", new Set(["optgroup", "option"])],
            ["dd", nE],
            ["dt", nE],
            ["address", ny],
            ["article", ny],
            ["aside", ny],
            ["blockquote", ny],
            ["details", ny],
            ["div", ny],
            ["dl", ny],
            ["fieldset", ny],
            ["figcaption", ny],
            ["figure", ny],
            ["footer", ny],
            ["form", ny],
            ["header", ny],
            ["hr", ny],
            ["main", ny],
            ["nav", ny],
            ["ol", ny],
            ["pre", ny],
            ["section", ny],
            ["table", ny],
            ["ul", ny],
            ["rt", nb],
            ["rp", nb],
            ["tbody", nT],
            ["tfoot", nT]
        ]),
        nC = new Set(["area", "base", "basefont", "br", "col", "command", "embed", "frame", "hr", "img", "input", "isindex", "keygen", "link", "meta", "param", "source", "track", "wbr"]),
        nS = new Set(["math", "svg"]),
        n_ = new Set(["mi", "mo", "mn", "ms", "mtext", "annotation-xml", "foreignobject", "desc", "title"]),
        nN = /\s|\//;
    class nx {
        constructor(e, t = {}) {
            var r, a, n, i, s, o;
            this.options = t, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = null != e ? e : {}, this.htmlMode = !this.options.xmlMode, this.lowerCaseTagNames = null != (r = t.lowerCaseTags) ? r : this.htmlMode, this.lowerCaseAttributeNames = null != (a = t.lowerCaseAttributeNames) ? a : this.htmlMode, this.recognizeSelfClosing = null != (n = t.recognizeSelfClosing) ? n : !this.htmlMode, this.tokenizer = new(null != (i = t.Tokenizer) ? i : nf)(this.options, this), this.foreignContext = [!this.htmlMode], null == (o = (s = this.cbs).onparserinit) || o.call(s, this)
        }
        ontext(e, t) {
            var r, a;
            let n = this.getSlice(e, t);
            this.endIndex = t - 1, null == (a = (r = this.cbs).ontext) || a.call(r, n), this.startIndex = t
        }
        ontextentity(e, t) {
            var r, a;
            this.endIndex = t - 1, null == (a = (r = this.cbs).ontext) || a.call(r, ns(e)), this.startIndex = t
        }
        isVoidElement(e) {
            return this.htmlMode && nC.has(e)
        }
        onopentagname(e, t) {
            this.endIndex = t;
            let r = this.getSlice(e, t);
            this.lowerCaseTagNames && (r = r.toLowerCase()), this.emitOpenTag(r)
        }
        emitOpenTag(e) {
            var t, r, a, n;
            this.openTagStart = this.startIndex, this.tagname = e;
            let i = this.htmlMode && nI.get(e);
            if (i)
                for (; this.stack.length > 0 && i.has(this.stack[0]);) {
                    let e = this.stack.shift();
                    null == (r = (t = this.cbs).onclosetag) || r.call(t, e, !0)
                }!this.isVoidElement(e) && (this.stack.unshift(e), this.htmlMode && (nS.has(e) ? this.foreignContext.unshift(!0) : n_.has(e) && this.foreignContext.unshift(!1))), null == (n = (a = this.cbs).onopentagname) || n.call(a, e), this.cbs.onopentag && (this.attribs = {})
        }
        endOpenTag(e) {
            var t, r;
            this.startIndex = this.openTagStart, this.attribs && (null == (r = (t = this.cbs).onopentag) || r.call(t, this.tagname, this.attribs, e), this.attribs = null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = ""
        }
        onopentagend(e) {
            this.endIndex = e, this.endOpenTag(!1), this.startIndex = e + 1
        }
        onclosetag(e, t) {
            var r, a, n, i, s, o, l, c;
            this.endIndex = t;
            let u = this.getSlice(e, t);
            if (this.lowerCaseTagNames && (u = u.toLowerCase()), this.htmlMode && (nS.has(u) || n_.has(u)) && this.foreignContext.shift(), this.isVoidElement(u)) this.htmlMode && "br" === u && (null == (i = (n = this.cbs).onopentagname) || i.call(n, "br"), null == (o = (s = this.cbs).onopentag) || o.call(s, "br", {}, !0), null == (c = (l = this.cbs).onclosetag) || c.call(l, "br", !1));
            else {
                let e = this.stack.indexOf(u);
                if (-1 !== e)
                    for (let t = 0; t <= e; t++) {
                        let n = this.stack.shift();
                        null == (a = (r = this.cbs).onclosetag) || a.call(r, n, t !== e)
                    } else this.htmlMode && "p" === u && (this.emitOpenTag("p"), this.closeCurrentTag(!0))
            }
            this.startIndex = t + 1
        }
        onselfclosingtag(e) {
            this.endIndex = e, this.recognizeSelfClosing || this.foreignContext[0] ? (this.closeCurrentTag(!1), this.startIndex = e + 1) : this.onopentagend(e)
        }
        closeCurrentTag(e) {
            var t, r;
            let a = this.tagname;
            this.endOpenTag(e), this.stack[0] === a && (null == (r = (t = this.cbs).onclosetag) || r.call(t, a, !e), this.stack.shift())
        }
        onattribname(e, t) {
            this.startIndex = e;
            let r = this.getSlice(e, t);
            this.attribname = this.lowerCaseAttributeNames ? r.toLowerCase() : r
        }
        onattribdata(e, t) {
            this.attribvalue += this.getSlice(e, t)
        }
        onattribentity(e) {
            this.attribvalue += ns(e)
        }
        onattribend(e, t) {
            var r, a;
            this.endIndex = t, null == (a = (r = this.cbs).onattribute) || a.call(r, this.attribname, this.attribvalue, e === ee.Double ? '"' : e === ee.Single ? "'" : e === ee.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = ""
        }
        getInstructionName(e) {
            let t = e.search(nN),
                r = t < 0 ? e : e.substr(0, t);
            return this.lowerCaseTagNames && (r = r.toLowerCase()), r
        }
        ondeclaration(e, t) {
            this.endIndex = t;
            let r = this.getSlice(e, t);
            if (this.cbs.onprocessinginstruction) {
                let e = this.getInstructionName(r);
                this.cbs.onprocessinginstruction(`!${e}`, `!${r}`)
            }
            this.startIndex = t + 1
        }
        onprocessinginstruction(e, t) {
            this.endIndex = t;
            let r = this.getSlice(e, t);
            if (this.cbs.onprocessinginstruction) {
                let e = this.getInstructionName(r);
                this.cbs.onprocessinginstruction(`?${e}`, `?${r}`)
            }
            this.startIndex = t + 1
        }
        oncomment(e, t, r) {
            var a, n, i, s;
            this.endIndex = t, null == (n = (a = this.cbs).oncomment) || n.call(a, this.getSlice(e, t - r)), null == (s = (i = this.cbs).oncommentend) || s.call(i), this.startIndex = t + 1
        }
        oncdata(e, t, r) {
            var a, n, i, s, o, l, c, u, d, p;
            this.endIndex = t;
            let A = this.getSlice(e, t - r);
            !this.htmlMode || this.options.recognizeCDATA ? (null == (n = (a = this.cbs).oncdatastart) || n.call(a), null == (s = (i = this.cbs).ontext) || s.call(i, A), null == (l = (o = this.cbs).oncdataend) || l.call(o)) : (null == (u = (c = this.cbs).oncomment) || u.call(c, `[CDATA[${A}]]`), null == (p = (d = this.cbs).oncommentend) || p.call(d)), this.startIndex = t + 1
        }
        onend() {
            var e, t;
            if (this.cbs.onclosetag) {
                this.endIndex = this.startIndex;
                for (let e = 0; e < this.stack.length; e++) this.cbs.onclosetag(this.stack[e], !0)
            }
            null == (t = (e = this.cbs).onend) || t.call(e)
        }
        reset() {
            var e, t, r, a;
            null == (t = (e = this.cbs).onreset) || t.call(e), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, null == (a = (r = this.cbs).onparserinit) || a.call(r, this), this.buffers.length = 0, this.foreignContext.length = 0, this.foreignContext.unshift(!this.htmlMode), this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1
        }
        parseComplete(e) {
            this.reset(), this.end(e)
        }
        getSlice(e, t) {
            for (; e - this.bufferOffset >= this.buffers[0].length;) this.shiftBuffer();
            let r = this.buffers[0].slice(e - this.bufferOffset, t - this.bufferOffset);
            for (; t - this.bufferOffset > this.buffers[0].length;) this.shiftBuffer(), r += this.buffers[0].slice(0, t - this.bufferOffset);
            return r
        }
        shiftBuffer() {
            this.bufferOffset += this.buffers[0].length, this.writeIndex--, this.buffers.shift()
        }
        write(e) {
            var t, r;
            if (this.ended) {
                null == (r = (t = this.cbs).onerror) || r.call(t, Error(".write() after done!"));
                return
            }
            this.buffers.push(e), this.tokenizer.running && (this.tokenizer.write(e), this.writeIndex++)
        }
        end(e) {
            var t, r;
            if (this.ended) {
                null == (r = (t = this.cbs).onerror) || r.call(t, Error(".end() after done!"));
                return
            }
            e && this.write(e), this.ended = !0, this.tokenizer.end()
        }
        pause() {
            this.tokenizer.pause()
        }
        resume() {
            for (this.tokenizer.resume(); this.tokenizer.running && this.writeIndex < this.buffers.length;) this.tokenizer.write(this.buffers[this.writeIndex++]);
            this.ended && this.tokenizer.end()
        }
        parseChunk(e) {
            this.write(e)
        }
        done(e) {
            this.end(e)
        }
    }
    var nk = e.i(436186),
        nk = nk;
    let nD = null != (et = Object.hasOwn) ? et : (e, t) => Object.prototype.hasOwnProperty.call(e, t),
        nv = /\s+/,
        nw = "data-",
        nO = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
        nR = /^{[^]*}$|^\[[^]*]$/;

    function nM(e, t, r) {
        if (e && rJ(e)) {
            if (null != e.attribs || (e.attribs = {}), !t) return e.attribs;
            if (nD(e.attribs, t)) return !r && nO.test(t) ? t : e.attribs[t];
            if ("option" === e.name && "value" === t) return a9(e.children);
            if ("input" === e.name && ("radio" === e.attribs.type || "checkbox" === e.attribs.type) && "value" === t) return "on"
        }
    }

    function nL(e, t, r) {
        null === r ? nG(e, t) : e.attribs[t] = `${r}`
    }

    function nB(e, t, r) {
        return t in e ? e[t] : !r && nO.test(t) ? void 0 !== nM(e, t, !1) : nM(e, t, r)
    }

    function nP(e, t, r, a) {
        t in e ? e[t] = r : nL(e, t, !a && nO.test(t) ? r ? "" : null : `${r}`)
    }

    function nF(e, t, r) {
        null != e.data || (e.data = {}), "object" == typeof t ? Object.assign(e.data, t) : "string" == typeof t && void 0 !== r && (e.data[t] = r)
    }

    function nU(e) {
        if ("null" === e) return null;
        if ("true" === e) return !0;
        if ("false" === e) return !1;
        let t = Number(e);
        if (e === String(t)) return t;
        if (nR.test(e)) try {
            return JSON.parse(e)
        } catch {}
        return e
    }

    function nG(e, t) {
        e.attribs && nD(e.attribs, t) && delete e.attribs[t]
    }

    function nH(e) {
        return e ? e.trim().split(nv) : []
    }

    function nj(e) {
        if ("function" == typeof e) return na(this, (t, r) => {
            if (rJ(t)) {
                let a = t.attribs.class || "";
                nj.call([t], e.call(t, r, a))
            }
        });
        if (!e || "string" != typeof e) return this;
        let t = e.split(nv),
            r = this.length;
        for (let e = 0; e < r; e++) {
            let r = this[e];
            if (!rJ(r)) continue;
            let a = nM(r, "class", !1);
            if (a) {
                let e = ` ${a} `;
                for (let r of t) {
                    let t = `${r} `;
                    e.includes(` ${t}`) || (e += t)
                }
                nL(r, "class", e.trim())
            } else nL(r, "class", t.join(" ").trim())
        }
        return this
    }

    function nQ(e) {
        if ("function" == typeof e) return na(this, (t, r) => {
            rJ(t) && nQ.call([t], e.call(t, r, t.attribs.class || ""))
        });
        let t = nH(e),
            r = t.length,
            a = 0 == arguments.length;
        return na(this, e => {
            if (rJ(e))
                if (a) e.attribs.class = "";
                else {
                    let a = nH(e.attribs.class),
                        n = !1;
                    for (let e = 0; e < r; e++) {
                        let r = a.indexOf(t[e]); - 1 !== r && (a.splice(r, 1), n = !0, e--)
                    }
                    n && (e.attribs.class = a.join(" "))
                }
        })
    }

    function nK(e, t) {
        if ("function" == typeof e) return na(this, (r, a) => {
            rJ(r) && nK.call([r], e.call(r, a, r.attribs.class || "", t), t)
        });
        if (!e || "string" != typeof e) return this;
        let r = e.split(nv),
            a = r.length,
            n = "boolean" == typeof t ? t ? 1 : -1 : 0,
            i = this.length;
        for (let e = 0; e < i; e++) {
            let t = this[e];
            if (!rJ(t)) continue;
            let i = nH(t.attribs.class);
            for (let e = 0; e < a; e++) {
                let t = i.indexOf(r[e]);
                n >= 0 && -1 === t ? i.push(r[e]) : n <= 0 && -1 !== t && i.splice(t, 1)
            }
            t.attribs.class = i.join(" ")
        }
        return this
    }
    e.s(["addClass", 0, nj, "attr", 0, function(e, t) {
        if ("object" == typeof e || void 0 !== t) {
            if ("function" == typeof t) {
                if ("string" != typeof e) throw Error("Bad combination of arguments.");
                return na(this, (r, a) => {
                    rJ(r) && nL(r, e, t.call(r, a, r.attribs[e]))
                })
            }
            return na(this, r => {
                if (rJ(r))
                    if ("object" == typeof e)
                        for (let t of Object.keys(e)) {
                            let a = e[t];
                            nL(r, t, a)
                        } else nL(r, e, t)
            })
        }
        return arguments.length > 1 ? this : nM(this[0], e, this.options.xmlMode)
    }, "data", 0, function(e, t) {
        let r = this[0];
        if (!r || !rJ(r)) return;
        if (null != r.data || (r.data = {}), null == e) {
            for (let e of Object.keys(r.attribs)) {
                if (!e.startsWith(nw)) continue;
                let t = e.slice(nw.length).replace(/[._-](\w|$)/g, (e, t) => t.toUpperCase());
                nD(r.data, t) || (r.data[t] = nU(r.attribs[e]))
            }
            return r.data
        }
        if ("object" == typeof e || void 0 !== t) return na(this, r => {
            rJ(r) && ("object" == typeof e ? nF(r, e) : nF(r, e, t))
        }), this;
        let a = nw + e.replace(/[A-Z]/g, "-$&").toLowerCase(),
            n = r.data;
        return nD(n, e) ? n[e] : nD(r.attribs, a) ? n[e] = nU(r.attribs[a]) : void 0
    }, "hasClass", 0, function(e) {
        return this.toArray().some(t => {
            let r = rJ(t) && t.attribs.class,
                a = -1;
            if (r && e.length > 0)
                for (;
                    (a = r.indexOf(e, a + 1)) > -1;) {
                    let t = a + e.length;
                    if ((0 === a || nv.test(r[a - 1])) && (t === r.length || nv.test(r[t]))) return !0
                }
            return !1
        })
    }, "prop", 0, function(e, t) {
        var r;
        if ("string" == typeof e && void 0 === t) {
            let t = this[0];
            if (!t) return;
            switch (e) {
                case "style":
                    {
                        let e = this.css(),
                            t = Object.keys(e);
                        for (let r = 0; r < t.length; r++) e[r] = t[r];
                        return e.length = t.length,
                        e
                    }
                case "tagName":
                case "nodeName":
                    if (!rJ(t)) return;
                    return t.name.toUpperCase();
                case "href":
                case "src":
                    {
                        if (!rJ(t)) return;
                        let a = null == (r = t.attribs) ? void 0 : r[e];
                        if ("u" > typeof URL && ("href" === e && ("a" === t.tagName || "link" === t.tagName) || "src" === e && ("img" === t.tagName || "iframe" === t.tagName || "audio" === t.tagName || "video" === t.tagName || "source" === t.tagName)) && void 0 !== a && this.options.baseURI) return new URL(a, this.options.baseURI).href;
                        return a
                    }
                case "innerText":
                    return aC(t);
                case "textContent":
                    return aI(t);
                case "outerHTML":
                    if (t.type === nk.Root) return this.html();
                    return this.clone().wrap("<container />").parent().html();
                case "innerHTML":
                    return this.html();
                default:
                    if (!rJ(t)) return;
                    return nB(t, e, this.options.xmlMode)
            }
        }
        if ("object" == typeof e || void 0 !== t) {
            if ("function" == typeof t) {
                if ("object" == typeof e) throw TypeError("Bad combination of arguments.");
                return na(this, (r, a) => {
                    rJ(r) && nP(r, e, t.call(r, a, nB(r, e, this.options.xmlMode)), this.options.xmlMode)
                })
            }
            return na(this, r => {
                if (rJ(r))
                    if ("object" == typeof e)
                        for (let t of Object.keys(e)) {
                            let a = e[t];
                            nP(r, t, a, this.options.xmlMode)
                        } else nP(r, e, t, this.options.xmlMode)
            })
        }
    }, "removeAttr", 0, function(e) {
        for (let t of nH(e)) na(this, e => {
            rJ(e) && nG(e, t)
        });
        return this
    }, "removeClass", 0, nQ, "toggleClass", 0, nK, "val", 0, function(e) {
        let t = 0 == arguments.length,
            r = this[0];
        if (!r || !rJ(r)) return t ? void 0 : this;
        switch (r.name) {
            case "textarea":
                return this.text(e);
            case "select":
                {
                    let r = this.find("option:selected");
                    if (!t) {
                        if (null == this.attr("multiple") && "object" == typeof e) return this;
                        for (let t of (this.find("option").removeAttr("selected"), "object" == typeof e ? e : [e])) this.find(`option[value="${t}"]`).attr("selected", "");
                        return this
                    }
                    return this.attr("multiple") ? r.toArray().map(e => a9(e.children)) : r.attr("value")
                }
            case "button":
            case "input":
            case "option":
                return t ? this.attr("value") : this.attr("value", e)
        }
    }], 790693);
    var nY = e.i(790693);
    (g = er || (er = {})).Attribute = "attribute", g.Pseudo = "pseudo", g.PseudoElement = "pseudo-element", g.Tag = "tag", g.Universal = "universal", g.Adjacent = "adjacent", g.Child = "child", g.Descendant = "descendant", g.Parent = "parent", g.Sibling = "sibling", g.ColumnCombinator = "column-combinator", (y = ea || (ea = {})).Any = "any", y.Element = "element", y.End = "end", y.Equals = "equals", y.Exists = "exists", y.Hyphen = "hyphen", y.Not = "not", y.Start = "start";
    let nW = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,
        nq = /\\([\da-f]{1,6}\s?|(\s)|.)/gi,
        nV = new Map([
            [126, ea.Element],
            [94, ea.Start],
            [36, ea.End],
            [42, ea.Any],
            [33, ea.Not],
            [124, ea.Hyphen]
        ]),
        nz = new Set(["has", "not", "matches", "is", "where", "host", "host-context"]);

    function nJ(e) {
        switch (e.type) {
            case er.Adjacent:
            case er.Child:
            case er.Descendant:
            case er.Parent:
            case er.Sibling:
            case er.ColumnCombinator:
                return !0;
            default:
                return !1
        }
    }
    let nZ = new Set(["contains", "icontains"]);

    function n$(e, t, r) {
        let a = parseInt(t, 16) - 65536;
        return a != a || r ? t : a < 0 ? String.fromCharCode(a + 65536) : String.fromCharCode(a >> 10 | 55296, 1023 & a | 56320)
    }

    function nX(e) {
        return e.replace(nq, n$)
    }

    function n0(e) {
        return 39 === e || 34 === e
    }

    function n1(e) {
        return 32 === e || 9 === e || 10 === e || 12 === e || 13 === e
    }

    function n2(e) {
        let t = [],
            r = function e(t, r, a) {
                let n = [];

                function i(e) {
                    let t = r.slice(a + e).match(nW);
                    if (!t) throw Error(`Expected name, found ${r.slice(a)}`);
                    let [n] = t;
                    return a += e + n.length, nX(n)
                }

                function s(e) {
                    for (a += e; a < r.length && n1(r.charCodeAt(a));) a++
                }

                function o() {
                    let e = a += 1,
                        t = 1;
                    for (; t > 0 && a < r.length; a++) 40 !== r.charCodeAt(a) || l(a) ? 41 === r.charCodeAt(a) && !l(a) && t-- : t++;
                    if (t) throw Error("Parenthesis not matched");
                    return nX(r.slice(e, a - 1))
                }

                function l(e) {
                    let t = 0;
                    for (; 92 === r.charCodeAt(--e);) t++;
                    return (1 & t) == 1
                }

                function c() {
                    if (n.length > 0 && nJ(n[n.length - 1])) throw Error("Did not expect successive traversals.")
                }

                function u(e) {
                    if (n.length > 0 && n[n.length - 1].type === er.Descendant) {
                        n[n.length - 1].type = e;
                        return
                    }
                    c(), n.push({
                        type: e
                    })
                }

                function d(e, t) {
                    n.push({
                        type: er.Attribute,
                        name: e,
                        action: t,
                        value: i(1),
                        namespace: null,
                        ignoreCase: "quirks"
                    })
                }

                function p() {
                    if (n.length && n[n.length - 1].type === er.Descendant && n.pop(), 0 === n.length) throw Error("Empty sub-selector");
                    t.push(n)
                }
                if (s(0), r.length === a) return a;
                t: for (; a < r.length;) {
                    let t = r.charCodeAt(a);
                    switch (t) {
                        case 32:
                        case 9:
                        case 10:
                        case 12:
                        case 13:
                            (0 === n.length || n[0].type !== er.Descendant) && (c(), n.push({
                                type: er.Descendant
                            })), s(1);
                            break;
                        case 62:
                            u(er.Child), s(1);
                            break;
                        case 60:
                            u(er.Parent), s(1);
                            break;
                        case 126:
                            u(er.Sibling), s(1);
                            break;
                        case 43:
                            u(er.Adjacent), s(1);
                            break;
                        case 46:
                            d("class", ea.Element);
                            break;
                        case 35:
                            d("id", ea.Equals);
                            break;
                        case 91:
                            {
                                let e;s(1);
                                let t = null;124 === r.charCodeAt(a) ? e = i(1) : r.startsWith("*|", a) ? (t = "*", e = i(2)) : (e = i(0), 124 === r.charCodeAt(a) && 61 !== r.charCodeAt(a + 1) && (t = e, e = i(1))),
                                s(0);
                                let o = ea.Exists,
                                    c = nV.get(r.charCodeAt(a));
                                if (c) {
                                    if (o = c, 61 !== r.charCodeAt(a + 1)) throw Error("Expected `=`");
                                    s(2)
                                } else 61 === r.charCodeAt(a) && (o = ea.Equals, s(1));
                                let u = "",
                                    d = null;
                                if ("exists" !== o) {
                                    if (n0(r.charCodeAt(a))) {
                                        let e = r.charCodeAt(a),
                                            t = a + 1;
                                        for (; t < r.length && (r.charCodeAt(t) !== e || l(t));) t += 1;
                                        if (r.charCodeAt(t) !== e) throw Error("Attribute value didn't end");
                                        u = nX(r.slice(a + 1, t)), a = t + 1
                                    } else {
                                        let e = a;
                                        for (; a < r.length && (!n1(r.charCodeAt(a)) && 93 !== r.charCodeAt(a) || l(a));) a += 1;
                                        u = nX(r.slice(e, a))
                                    }
                                    s(0);
                                    let e = 32 | r.charCodeAt(a);
                                    115 === e ? (d = !1, s(1)) : 105 === e && (d = !0, s(1))
                                }
                                if (93 !== r.charCodeAt(a)) throw Error("Attribute selector didn't terminate");a += 1;
                                let p = {
                                    type: er.Attribute,
                                    name: e,
                                    action: o,
                                    value: u,
                                    namespace: t,
                                    ignoreCase: d
                                };n.push(p);
                                break
                            }
                        case 58:
                            {
                                if (58 === r.charCodeAt(a + 1)) {
                                    n.push({
                                        type: er.PseudoElement,
                                        name: i(2).toLowerCase(),
                                        data: 40 === r.charCodeAt(a) ? o() : null
                                    });
                                    continue
                                }
                                let t = i(1).toLowerCase(),
                                    s = null;
                                if (40 === r.charCodeAt(a))
                                    if (nz.has(t)) {
                                        if (n0(r.charCodeAt(a + 1))) throw Error(`Pseudo-selector ${t} cannot be quoted`);
                                        if (a = e(s = [], r, a + 1), 41 !== r.charCodeAt(a)) throw Error(`Missing closing parenthesis in :${t} (${r})`);
                                        a += 1
                                    } else {
                                        if (s = o(), nZ.has(t)) {
                                            let e = s.charCodeAt(0);
                                            e === s.charCodeAt(s.length - 1) && n0(e) && (s = s.slice(1, -1))
                                        }
                                        s = nX(s)
                                    }
                                n.push({
                                    type: er.Pseudo,
                                    name: t,
                                    data: s
                                });
                                break
                            }
                        case 44:
                            p(), n = [], s(1);
                            break;
                        default:
                            {
                                let e;
                                if (r.startsWith("/*", a)) {
                                    let e = r.indexOf("*/", a + 2);
                                    if (e < 0) throw Error("Comment was not terminated");
                                    a = e + 2, 0 === n.length && s(0);
                                    break
                                }
                                let o = null;
                                if (42 === t) a += 1,
                                e = "*";
                                else if (124 === t) {
                                    if (e = "", 124 === r.charCodeAt(a + 1)) {
                                        u(er.ColumnCombinator), s(2);
                                        break
                                    }
                                } else if (nW.test(r.slice(a))) e = i(0);
                                else break t;124 === r.charCodeAt(a) && 124 !== r.charCodeAt(a + 1) && (o = e, 42 === r.charCodeAt(a + 1) ? (e = "*", a += 2) : e = i(1)),
                                n.push("*" === e ? {
                                    type: er.Universal,
                                    namespace: o
                                } : {
                                    type: er.Tag,
                                    name: e,
                                    namespace: o
                                })
                            }
                    }
                }
                return p(), a
            }(t, `${e}`, 0);
        if (r < e.length) throw Error(`Unmatched selector: ${e.slice(r)}`);
        return t
    }

    function n5(e) {
        if (e.prev && (e.prev.next = e.next), e.next && (e.next.prev = e.prev), e.parent) {
            let t = e.parent.children,
                r = t.lastIndexOf(e);
            r >= 0 && t.splice(r, 1)
        }
        e.next = null, e.prev = null, e.parent = null
    }

    function n6(e, t) {
        let r = t.prev = e.prev;
        r && (r.next = t);
        let a = t.next = e.next;
        a && (a.prev = t);
        let n = t.parent = e.parent;
        if (n) {
            let r = n.children;
            r[r.lastIndexOf(e)] = t, e.parent = null
        }
    }

    function n3(e, t) {
        if (n5(t), t.next = null, t.parent = e, e.children.push(t) > 1) {
            let r = e.children[e.children.length - 2];
            r.next = t, t.prev = r
        } else t.prev = null
    }

    function n4(e, t) {
        n5(t);
        let {
            parent: r
        } = e, a = e.next;
        if (t.next = a, t.prev = e, e.next = t, t.parent = r, a) {
            if (a.prev = t, r) {
                let e = r.children;
                e.splice(e.lastIndexOf(a), 0, t)
            }
        } else r && r.children.push(t)
    }

    function n8(e, t) {
        if (n5(t), t.parent = e, t.prev = null, 1 !== e.children.unshift(t)) {
            let r = e.children[1];
            r.prev = t, t.next = r
        } else t.next = null
    }

    function n9(e, t) {
        n5(t);
        let {
            parent: r
        } = e;
        if (r) {
            let a = r.children;
            a.splice(a.indexOf(e), 0, t)
        }
        e.prev && (e.prev.next = t), t.parent = r, t.prev = e.prev, t.next = e, e.prev = t
    }
    e.i(63080), e.i(748294), e.i(650874), e.s(["append", 0, n4, "appendChild", 0, n3, "prepend", 0, n9, "prependChild", 0, n8, "removeElement", 0, n5, "replaceElement", 0, n6], 377496), e.i(377496), e.i(614790), e.i(368047), e.i(195862), e.i(30744), e.s(["DocumentPosition", 0, Y, "append", 0, n4, "appendChild", 0, n3, "compareDocumentPosition", 0, az, "existsOne", 0, aB, "filter", 0, aO, "find", 0, aR, "findAll", 0, aP, "findOne", 0, aL, "findOneChild", 0, aM, "getAttributeValue", 0, ax, "getChildren", 0, aS, "getElementById", 0, aK, "getElements", 0, aQ, "getElementsByClassName", 0, aW, "getElementsByTagName", 0, aY, "getElementsByTagType", 0, aq, "getFeed", 0, aZ, "getInnerHTML", 0, aE, "getName", 0, aD, "getOuterHTML", 0, aT, "getParent", 0, a_, "getSiblings", 0, aN, "getText", 0, ab, "hasAttrib", 0, ak, "hasChildren", 0, r2, "innerText", 0, aC, "isCDATA", 0, rZ, "isComment", 0, rX, "isDocument", 0, r1, "isTag", 0, rJ, "isText", 0, r$, "nextElementSibling", 0, av, "prepend", 0, n9, "prependChild", 0, n8, "prevElementSibling", 0, aw, "removeElement", 0, n5, "removeSubsets", 0, aV, "replaceElement", 0, n6, "testElement", 0, aj, "textContent", 0, aI, "uniqueSort", 0, aJ], 979098);
    var n7 = e.i(979098),
        ie = e.i(713947);
    let it = new Map([
        [er.Universal, 50],
        [er.Tag, 30],
        [er.Attribute, 1],
        [er.Pseudo, 0]
    ]);

    function ir(e) {
        return !it.has(e.type)
    }
    let ia = new Map([
        [ea.Exists, 10],
        [ea.Equals, 8],
        [ea.Not, 7],
        [ea.Start, 6],
        [ea.End, 6],
        [ea.Any, 5]
    ]);

    function ii(e) {
        let t = e.map(is);
        for (let r = 1; r < e.length; r++) {
            let a = t[r];
            if (!(a < 0))
                for (let n = r - 1; n >= 0 && a < t[n]; n--) {
                    let r = e[n + 1];
                    e[n + 1] = e[n], e[n] = r, t[n + 1] = t[n], t[n] = a
                }
        }
    }

    function is(e) {
        var t, r;
        let a = null != (t = it.get(e.type)) ? t : -1;
        return e.type === er.Attribute ? (a = null != (r = ia.get(e.action)) ? r : 4, e.action === ea.Equals && "id" === e.name && (a = 9), e.ignoreCase && (a >>= 1)) : e.type === er.Pseudo && (e.data ? "has" === e.name || "contains" === e.name ? a = 0 : Array.isArray(e.data) ? (a = Math.min(...e.data.map(e => Math.min(...e.map(is))))) < 0 && (a = 0) : a = 2 : a = 3), a
    }
    let io = /[-[\]{}()*+?.,\\^$|#\s]/g;

    function il(e) {
        return e.replace(io, "\\$&")
    }
    let ic = new Set(["accept", "accept-charset", "align", "alink", "axis", "bgcolor", "charset", "checked", "clear", "codetype", "color", "compact", "declare", "defer", "dir", "direction", "disabled", "enctype", "face", "frame", "hreflang", "http-equiv", "lang", "language", "link", "media", "method", "multiple", "nohref", "noresize", "noshade", "nowrap", "readonly", "rel", "rev", "rules", "scope", "scrolling", "selected", "shape", "target", "text", "type", "valign", "valuetype", "vlink"]);

    function iu(e, t) {
        return "boolean" == typeof e.ignoreCase ? e.ignoreCase : "quirks" === e.ignoreCase ? !!t.quirksMode : !t.xmlMode && ic.has(e.name)
    }
    let id = {
            equals(e, t, r) {
                let {
                    adapter: a
                } = r, {
                    name: n
                } = t, {
                    value: i
                } = t;
                return iu(t, r) ? (i = i.toLowerCase(), t => {
                    let r = a.getAttributeValue(t, n);
                    return null != r && r.length === i.length && r.toLowerCase() === i && e(t)
                }) : t => a.getAttributeValue(t, n) === i && e(t)
            },
            hyphen(e, t, r) {
                let {
                    adapter: a
                } = r, {
                    name: n
                } = t, {
                    value: i
                } = t, s = i.length;
                return iu(t, r) ? (i = i.toLowerCase(), function(t) {
                    let r = a.getAttributeValue(t, n);
                    return null != r && (r.length === s || "-" === r.charAt(s)) && r.substr(0, s).toLowerCase() === i && e(t)
                }) : function(t) {
                    let r = a.getAttributeValue(t, n);
                    return null != r && (r.length === s || "-" === r.charAt(s)) && r.substr(0, s) === i && e(t)
                }
            },
            element(e, t, r) {
                let {
                    adapter: a
                } = r, {
                    name: n,
                    value: i
                } = t;
                if (/\s/.test(i)) return ie.default.falseFunc;
                let s = RegExp(`(?:^|\\s)${il(i)}(?:$|\\s)`, iu(t, r) ? "i" : "");
                return function(t) {
                    let r = a.getAttributeValue(t, n);
                    return null != r && r.length >= i.length && s.test(r) && e(t)
                }
            },
            exists: (e, {
                name: t
            }, {
                adapter: r
            }) => a => r.hasAttrib(a, t) && e(a),
            start(e, t, r) {
                let {
                    adapter: a
                } = r, {
                    name: n
                } = t, {
                    value: i
                } = t, s = i.length;
                return 0 === s ? ie.default.falseFunc : iu(t, r) ? (i = i.toLowerCase(), t => {
                    let r = a.getAttributeValue(t, n);
                    return null != r && r.length >= s && r.substr(0, s).toLowerCase() === i && e(t)
                }) : t => {
                    var r;
                    return !!(null == (r = a.getAttributeValue(t, n)) ? void 0 : r.startsWith(i)) && e(t)
                }
            },
            end(e, t, r) {
                let {
                    adapter: a
                } = r, {
                    name: n
                } = t, {
                    value: i
                } = t, s = -i.length;
                return 0 === s ? ie.default.falseFunc : iu(t, r) ? (i = i.toLowerCase(), t => {
                    var r;
                    return (null == (r = a.getAttributeValue(t, n)) ? void 0 : r.substr(s).toLowerCase()) === i && e(t)
                }) : t => {
                    var r;
                    return !!(null == (r = a.getAttributeValue(t, n)) ? void 0 : r.endsWith(i)) && e(t)
                }
            },
            any(e, t, r) {
                let {
                    adapter: a
                } = r, {
                    name: n,
                    value: i
                } = t;
                if ("" === i) return ie.default.falseFunc;
                if (iu(t, r)) {
                    let t = RegExp(il(i), "i");
                    return function(r) {
                        let s = a.getAttributeValue(r, n);
                        return null != s && s.length >= i.length && t.test(s) && e(r)
                    }
                }
                return t => {
                    var r;
                    return !!(null == (r = a.getAttributeValue(t, n)) ? void 0 : r.includes(i)) && e(t)
                }
            },
            not(e, t, r) {
                let {
                    adapter: a
                } = r, {
                    name: n
                } = t, {
                    value: i
                } = t;
                return "" === i ? t => !!a.getAttributeValue(t, n) && e(t) : iu(t, r) ? (i = i.toLowerCase(), t => {
                    let r = a.getAttributeValue(t, n);
                    return (null == r || r.length !== i.length || r.toLowerCase() !== i) && e(t)
                }) : t => a.getAttributeValue(t, n) !== i && e(t)
            }
        },
        ip = new Set([9, 10, 12, 13, 32]);

    function iA(e) {
        return function(e) {
            let t = e[0],
                r = e[1] - 1;
            if (r < 0 && t <= 0) return ie.default.falseFunc;
            if (-1 === t) return e => e <= r;
            if (0 === t) return e => e === r;
            if (1 === t) return r < 0 ? ie.default.trueFunc : e => e >= r;
            let a = Math.abs(t),
                n = (r % a + a) % a;
            return t > 1 ? e => e >= r && e % a === n : e => e <= r && e % a === n
        }(function(e) {
            if ("even" === (e = e.trim().toLowerCase())) return [2, 0];
            if ("odd" === e) return [2, 1];
            let t = 0,
                r = 0,
                a = i(),
                n = s();
            if (t < e.length && "n" === e.charAt(t) && (t++, r = a * (null != n ? n : 1), o(), t < e.length ? (a = i(), o(), n = s()) : a = n = 0), null === n || t < e.length) throw Error(`n-th rule couldn't be parsed ('${e}')`);
            return [r, a * n];

            function i() {
                return "-" === e.charAt(t) ? (t++, -1) : ("+" === e.charAt(t) && t++, 1)
            }

            function s() {
                let r = t,
                    a = 0;
                for (; t < e.length && e.charCodeAt(t) >= 48 && 57 >= e.charCodeAt(t);) a = 10 * a + (e.charCodeAt(t) - 48), t++;
                return t === r ? null : a
            }

            function o() {
                for (; t < e.length && ip.has(e.charCodeAt(t));) t++
            }
        }(e))
    }

    function ih(e, t) {
        return r => {
            let a = t.getParent(r);
            return null != a && t.isTag(a) && e(r)
        }
    }
    let im = {
        contains: (e, t, {
            adapter: r
        }) => function(a) {
            return e(a) && r.getText(a).includes(t)
        },
        icontains(e, t, {
            adapter: r
        }) {
            let a = t.toLowerCase();
            return function(t) {
                return e(t) && r.getText(t).toLowerCase().includes(a)
            }
        },
        "nth-child" (e, t, {
            adapter: r,
            equals: a
        }) {
            let n = iA(t);
            return n === ie.default.falseFunc ? ie.default.falseFunc : n === ie.default.trueFunc ? ih(e, r) : function(t) {
                let i = r.getSiblings(t),
                    s = 0;
                for (let e = 0; e < i.length && !a(t, i[e]); e++) r.isTag(i[e]) && s++;
                return n(s) && e(t)
            }
        },
        "nth-last-child" (e, t, {
            adapter: r,
            equals: a
        }) {
            let n = iA(t);
            return n === ie.default.falseFunc ? ie.default.falseFunc : n === ie.default.trueFunc ? ih(e, r) : function(t) {
                let i = r.getSiblings(t),
                    s = 0;
                for (let e = i.length - 1; e >= 0 && !a(t, i[e]); e--) r.isTag(i[e]) && s++;
                return n(s) && e(t)
            }
        },
        "nth-of-type" (e, t, {
            adapter: r,
            equals: a
        }) {
            let n = iA(t);
            return n === ie.default.falseFunc ? ie.default.falseFunc : n === ie.default.trueFunc ? ih(e, r) : function(t) {
                let i = r.getSiblings(t),
                    s = 0;
                for (let e = 0; e < i.length; e++) {
                    let n = i[e];
                    if (a(t, n)) break;
                    r.isTag(n) && r.getName(n) === r.getName(t) && s++
                }
                return n(s) && e(t)
            }
        },
        "nth-last-of-type" (e, t, {
            adapter: r,
            equals: a
        }) {
            let n = iA(t);
            return n === ie.default.falseFunc ? ie.default.falseFunc : n === ie.default.trueFunc ? ih(e, r) : function(t) {
                let i = r.getSiblings(t),
                    s = 0;
                for (let e = i.length - 1; e >= 0; e--) {
                    let n = i[e];
                    if (a(t, n)) break;
                    r.isTag(n) && r.getName(n) === r.getName(t) && s++
                }
                return n(s) && e(t)
            }
        },
        root: (e, t, {
            adapter: r
        }) => t => {
            let a = r.getParent(t);
            return (null == a || !r.isTag(a)) && e(t)
        },
        scope(e, t, r, a) {
            let {
                equals: n
            } = r;
            return a && 0 !== a.length ? 1 === a.length ? t => n(a[0], t) && e(t) : t => a.includes(t) && e(t) : im.root(e, t, r)
        },
        hover: ig("isHovered"),
        visited: ig("isVisited"),
        active: ig("isActive")
    };

    function ig(e) {
        return function(t, r, {
            adapter: a
        }) {
            let n = a[e];
            return "function" != typeof n ? ie.default.falseFunc : function(e) {
                return n(e) && t(e)
            }
        }
    }
    let iy = {
        empty: (e, {
            adapter: t
        }) => !t.getChildren(e).some(e => t.isTag(e) || "" !== t.getText(e)),
        "first-child" (e, {
            adapter: t,
            equals: r
        }) {
            if (t.prevElementSibling) return null == t.prevElementSibling(e);
            let a = t.getSiblings(e).find(e => t.isTag(e));
            return null != a && r(e, a)
        },
        "last-child" (e, {
            adapter: t,
            equals: r
        }) {
            let a = t.getSiblings(e);
            for (let n = a.length - 1; n >= 0; n--) {
                if (r(e, a[n])) return !0;
                if (t.isTag(a[n])) break
            }
            return !1
        },
        "first-of-type" (e, {
            adapter: t,
            equals: r
        }) {
            let a = t.getSiblings(e),
                n = t.getName(e);
            for (let i = 0; i < a.length; i++) {
                let s = a[i];
                if (r(e, s)) return !0;
                if (t.isTag(s) && t.getName(s) === n) break
            }
            return !1
        },
        "last-of-type" (e, {
            adapter: t,
            equals: r
        }) {
            let a = t.getSiblings(e),
                n = t.getName(e);
            for (let i = a.length - 1; i >= 0; i--) {
                let s = a[i];
                if (r(e, s)) return !0;
                if (t.isTag(s) && t.getName(s) === n) break
            }
            return !1
        },
        "only-of-type" (e, {
            adapter: t,
            equals: r
        }) {
            let a = t.getName(e);
            return t.getSiblings(e).every(n => r(e, n) || !t.isTag(n) || t.getName(n) !== a)
        },
        "only-child": (e, {
            adapter: t,
            equals: r
        }) => t.getSiblings(e).every(a => r(e, a) || !t.isTag(a))
    };

    function iT(e, t, r, a) {
        if (null === r) {
            if (e.length > a) throw Error(`Pseudo-class :${t} requires an argument`)
        } else if (e.length === a) throw Error(`Pseudo-class :${t} doesn't have any arguments`)
    }
    let iE = {
            "any-link": ":is(a, area, link)[href]",
            link: ":any-link:not(:visited)",
            disabled: `:is(
        :is(button, input, select, textarea, optgroup, option)[disabled],
        optgroup[disabled] > option,
        fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
    )`,
            enabled: ":not(:disabled)",
            checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",
            required: ":is(input, select, textarea)[required]",
            optional: ":is(input, select, textarea):not([required])",
            selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
            checkbox: "[type=checkbox]",
            file: "[type=file]",
            password: "[type=password]",
            radio: "[type=radio]",
            reset: "[type=reset]",
            image: "[type=image]",
            submit: "[type=submit]",
            parent: ":not(:empty)",
            header: ":is(h1, h2, h3, h4, h5, h6)",
            button: ":is(button, input[type=button])",
            input: ":is(input, textarea, select, button)",
            text: "input:is(:not([type!='']), [type=text])"
        },
        ib = {};

    function iI(e, t) {
        return e === ie.default.falseFunc ? ie.default.falseFunc : r => t.isTag(r) && e(r)
    }

    function iC(e, t) {
        let r = t.getSiblings(e);
        if (r.length <= 1) return [];
        let a = r.indexOf(e);
        return a < 0 || a === r.length - 1 ? [] : r.slice(a + 1).filter(t.isTag)
    }

    function iS(e) {
        return {
            xmlMode: !!e.xmlMode,
            lowerCaseAttributeNames: !!e.lowerCaseAttributeNames,
            lowerCaseTags: !!e.lowerCaseTags,
            quirksMode: !!e.quirksMode,
            cacheResults: !!e.cacheResults,
            pseudos: e.pseudos,
            adapter: e.adapter,
            equals: e.equals
        }
    }
    let i_ = (e, t, r, a, n) => {
            let i = n(t, iS(r), a);
            return i === ie.default.trueFunc ? e : i === ie.default.falseFunc ? ie.default.falseFunc : t => i(t) && e(t)
        },
        iN = {
            is: i_,
            matches: i_,
            where: i_,
            not(e, t, r, a, n) {
                let i = n(t, iS(r), a);
                return i === ie.default.falseFunc ? e : i === ie.default.trueFunc ? ie.default.falseFunc : t => !i(t) && e(t)
            },
            has(e, t, r, a, n) {
                let {
                    adapter: i
                } = r, s = iS(r);
                s.relativeSelector = !0;
                let o = t.some(e => e.some(ir)) ? [ib] : void 0,
                    l = n(t, s, o);
                if (l === ie.default.falseFunc) return ie.default.falseFunc;
                let c = iI(l, i);
                if (o && l !== ie.default.trueFunc) {
                    let {
                        shouldTestNextSiblings: t = !1
                    } = l;
                    return r => {
                        if (!e(r)) return !1;
                        o[0] = r;
                        let a = i.getChildren(r),
                            n = t ? [...a, ...iC(r, i)] : a;
                        return i.existsOne(c, n)
                    }
                }
                return t => e(t) && i.existsOne(c, i.getChildren(t))
            }
        };

    function ix(e, t) {
        let r = t.getParent(e);
        return r && t.isTag(r) ? r : null
    }

    function ik(e, t, r) {
        return iR("string" == typeof e ? n2(e) : e, t, r)
    }

    function iD(e) {
        return e.type === er.Pseudo && ("scope" === e.name || Array.isArray(e.data) && e.data.some(e => e.some(iD)))
    }
    let iv = {
            type: er.Descendant
        },
        iw = {
            type: "_flexibleDescendant"
        },
        iO = {
            type: er.Pseudo,
            name: "scope",
            data: null
        };

    function iR(e, t, r) {
        var a;
        e.forEach(ii);
        let n = Array.isArray(r = null != (a = t.context) ? a : r),
            i = r && (Array.isArray(r) ? r : [r]);
        if (!1 !== t.relativeSelector) ! function(e, {
            adapter: t
        }, r) {
            let a = !!(null == r ? void 0 : r.every(e => {
                let r = t.isTag(e) && t.getParent(e);
                return e === ib || r && t.isTag(r)
            }));
            for (let t of e) {
                if (t.length > 0 && ir(t[0]) && t[0].type !== er.Descendant);
                else {
                    if (!a || t.some(iD)) continue;
                    t.unshift(iv)
                }
                t.unshift(iO)
            }
        }(e, t, i);
        else if (e.some(e => e.length > 0 && ir(e[0]))) throw Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");
        let s = !1,
            o = e.map(e => {
                var r, a, o, l;
                if (e.length >= 2) {
                    let [t, r] = e;
                    t.type !== er.Pseudo || "scope" !== t.name || (n && r.type === er.Descendant ? e[1] = iw : (r.type === er.Adjacent || r.type === er.Sibling) && (s = !0))
                }
                return r = e, a = t, o = i, r.reduce((e, t) => e === ie.default.falseFunc ? ie.default.falseFunc : function(e, t, r, a, n) {
                    let {
                        adapter: i,
                        equals: s
                    } = r;
                    switch (t.type) {
                        case er.PseudoElement:
                            throw Error("Pseudo-elements are not supported by css-select");
                        case er.ColumnCombinator:
                            throw Error("Column combinators are not yet supported by css-select");
                        case er.Attribute:
                            if (null != t.namespace) throw Error("Namespaced attributes are not yet supported by css-select");
                            return (!r.xmlMode || r.lowerCaseAttributeNames) && (t.name = t.name.toLowerCase()), id[t.action](e, t, r);
                        case er.Pseudo:
                            return function(e, t, r, a, n) {
                                var i;
                                let {
                                    name: s,
                                    data: o
                                } = t;
                                if (Array.isArray(o)) {
                                    if (!(s in iN)) throw Error(`Unknown pseudo-class :${s}(${o})`);
                                    return iN[s](e, o, r, a, n)
                                }
                                let l = null == (i = r.pseudos) ? void 0 : i[s],
                                    c = "string" == typeof l ? l : iE[s];
                                if ("string" == typeof c) {
                                    if (null != o) throw Error(`Pseudo ${s} doesn't have any arguments`);
                                    let t = n2(c);
                                    return iN.is(e, t, r, a, n)
                                }
                                if ("function" == typeof l) return iT(l, s, o, 1), t => l(t, o) && e(t);
                                if (s in im) return im[s](e, o, r, a);
                                if (s in iy) {
                                    let t = iy[s];
                                    return iT(t, s, o, 2), a => t(a, r, o) && e(a)
                                }
                                throw Error(`Unknown pseudo-class :${s}`)
                            }(e, t, r, a, n);
                        case er.Tag:
                            {
                                if (null != t.namespace) throw Error("Namespaced tag names are not yet supported by css-select");
                                let {
                                    name: a
                                } = t;
                                return (!r.xmlMode || r.lowerCaseTags) && (a = a.toLowerCase()),
                                function(t) {
                                    return i.getName(t) === a && e(t)
                                }
                            }
                        case er.Descendant:
                            {
                                if (!1 === r.cacheResults || "u" < typeof WeakSet) return function(t) {
                                    let r = t;
                                    for (; r = ix(r, i);)
                                        if (e(r)) return !0;
                                    return !1
                                };
                                let t = new WeakSet;
                                return function(r) {
                                    let a = r;
                                    for (; a = ix(a, i);)
                                        if (!t.has(a)) {
                                            if (i.isTag(a) && e(a)) return !0;
                                            t.add(a)
                                        }
                                    return !1
                                }
                            }
                        case "_flexibleDescendant":
                            return function(t) {
                                let r = t;
                                do
                                    if (e(r)) return !0; while (r = ix(r, i)) return !1
                            };
                        case er.Parent:
                            return function(t) {
                                return i.getChildren(t).some(t => i.isTag(t) && e(t))
                            };
                        case er.Child:
                            return function(t) {
                                let r = i.getParent(t);
                                return null != r && i.isTag(r) && e(r)
                            };
                        case er.Sibling:
                            return function(t) {
                                let r = i.getSiblings(t);
                                for (let a = 0; a < r.length; a++) {
                                    let n = r[a];
                                    if (s(t, n)) break;
                                    if (i.isTag(n) && e(n)) return !0
                                }
                                return !1
                            };
                        case er.Adjacent:
                            if (i.prevElementSibling) return function(t) {
                                let r = i.prevElementSibling(t);
                                return null != r && e(r)
                            };
                            return function(t) {
                                let r, a = i.getSiblings(t);
                                for (let e = 0; e < a.length; e++) {
                                    let n = a[e];
                                    if (s(t, n)) break;
                                    i.isTag(n) && (r = n)
                                }
                                return !!r && e(r)
                            };
                        case er.Universal:
                            if (null != t.namespace && "*" !== t.namespace) throw Error("Namespaced universal selectors are not yet supported by css-select");
                            return e
                    }
                }(e, t, a, o, iR), null != (l = a.rootFunc) ? l : ie.default.trueFunc)
            }).reduce(iM, ie.default.falseFunc);
        return o.shouldTestNextSiblings = s, o
    }

    function iM(e, t) {
        return t === ie.default.falseFunc || e === ie.default.trueFunc ? e : e === ie.default.falseFunc || t === ie.default.trueFunc ? t : function(r) {
            return e(r) || t(r)
        }
    }
    let iL = (e, t) => e === t,
        iB = {
            adapter: n7,
            equals: iL
        };

    function iP(e) {
        var t, r;
        let a = null != e ? e : iB;
        return null != a.adapter || (a.adapter = n7), null != a.equals || (a.equals = null != (r = null == (t = a.adapter) ? void 0 : t.equals) ? r : iL), a
    }

    function iF(e) {
        return function(t, r, a) {
            return e(t, iP(r), a)
        }
    }
    iF(function(e, t, r) {
        return iI(ik(e, t, r), t.adapter)
    }), iF(ik);
    let iU = iF(iR);

    function iG(e) {
        return function(t, r, a) {
            let n = iP(a);
            "function" != typeof t && (t = ik(t, n, r));
            let i = iH(r, n.adapter, t.shouldTestNextSiblings);
            return e(t, i, n)
        }
    }

    function iH(e, t, r = !1) {
        return r && (e = function(e, t) {
            let r = Array.isArray(e) ? e.slice(0) : [e],
                a = r.length;
            for (let e = 0; e < a; e++) {
                let a = iC(r[e], t);
                r.push(...a)
            }
            return r
        }(e, t)), Array.isArray(e) ? t.removeSubsets(e) : t.getChildren(e)
    }
    iG((e, t, r) => e !== ie.default.falseFunc && t && 0 !== t.length ? r.adapter.findAll(e, t) : []), iG((e, t, r) => e !== ie.default.falseFunc && t && 0 !== t.length ? r.adapter.findOne(e, t) : null);
    let ij = new Set(["first", "last", "eq", "gt", "nth", "lt", "even", "odd"]);

    function iQ(e) {
        return "pseudo" === e.type && (!!ij.has(e.name) || !!("not" === e.name && Array.isArray(e.data)) && e.data.some(e => e.some(iQ)))
    }

    function iK(e) {
        let t = [],
            r = [];
        for (let a of e) a.some(iQ) ? t.push(a) : r.push(a);
        return [r, t]
    }
    let iY = {
            type: er.Universal,
            namespace: null
        },
        iW = {
            type: er.Pseudo,
            name: "scope",
            data: null
        };

    function iq(e, t, r = {}) {
        return iV([e], t, r)
    }

    function iV(e, t, r = {}) {
        if ("function" == typeof t) return e.some(t);
        let [a, n] = iK(n2(t));
        return a.length > 0 && e.some(iU(a, r)) || n.some(t => iZ(t, e, r).length > 0)
    }

    function iz(e, t, r = {}) {
        return iJ(n2(e), t, r)
    }

    function iJ(e, t, r) {
        let a;
        if (0 === t.length) return [];
        let [n, i] = iK(e);
        if (n.length) {
            let e = i1(t, n, r);
            if (0 === i.length) return e;
            e.length && (a = new Set(e))
        }
        for (let e = 0; e < i.length && (null == a ? void 0 : a.size) !== t.length; e++) {
            let n = i[e];
            if (0 === (a ? t.filter(e => n7.isTag(e) && !a.has(e)) : t).length) break;
            let s = iZ(n, t, r);
            if (s.length)
                if (a) s.forEach(e => a.add(e));
                else {
                    if (e === i.length - 1) return s;
                    a = new Set(s)
                }
        }
        return void 0 !== a ? a.size === t.length ? t : t.filter(e => a.has(e)) : []
    }

    function iZ(e, t, r) {
        var a;
        if (e.some(nJ)) {
            let n = null != (a = r.root) ? a : function(e) {
                    for (; e.parent;) e = e.parent;
                    return e
                }(t[0]),
                i = { ...r,
                    context: t,
                    relativeSelector: !1
                };
            return e.push(iW), i$(n, e, i, !0, t.length)
        }
        return i$(t, e, r, !1, t.length)
    }

    function i$(e, t, r, a, n) {
        let i = t.findIndex(iQ),
            s = t.slice(0, i),
            o = t[i],
            l = t.length - 1 === i ? n : 1 / 0,
            c = function(e, t, r) {
                let a = null != t ? parseInt(t, 10) : NaN;
                switch (e) {
                    case "first":
                        return 1;
                    case "nth":
                    case "eq":
                        return isFinite(a) ? a >= 0 ? a + 1 : 1 / 0 : 0;
                    case "lt":
                        return isFinite(a) ? a >= 0 ? Math.min(a, r) : 1 / 0 : 0;
                    case "gt":
                        return isFinite(a) ? 1 / 0 : 0;
                    case "odd":
                        return 2 * r;
                    case "even":
                        return 2 * r - 1;
                    case "last":
                    case "not":
                        return 1 / 0
                }
            }(o.name, o.data, l);
        if (0 === c) return [];
        let u = (0 !== s.length || Array.isArray(e) ? 0 === s.length ? (Array.isArray(e) ? e : [e]).filter(n7.isTag) : a || s.some(nJ) ? iX(e, [s], r, c) : i1(e, [s], r) : n7.getChildren(e).filter(n7.isTag)).slice(0, c),
            d = function(e, t, r, a) {
                let n = "string" == typeof r ? parseInt(r, 10) : NaN;
                switch (e) {
                    case "first":
                    case "lt":
                        return t;
                    case "last":
                        return t.length > 0 ? [t[t.length - 1]] : t;
                    case "nth":
                    case "eq":
                        return isFinite(n) && Math.abs(n) < t.length ? [n < 0 ? t[t.length + n] : t[n]] : [];
                    case "gt":
                        return isFinite(n) ? t.slice(n + 1) : [];
                    case "even":
                        return t.filter((e, t) => t % 2 == 0);
                    case "odd":
                        return t.filter((e, t) => t % 2 == 1);
                    case "not":
                        {
                            let e = new Set(iJ(r, t, a));
                            return t.filter(t => !e.has(t))
                        }
                }
            }(o.name, u, o.data, r);
        if (0 === d.length || t.length === i + 1) return d;
        let p = t.slice(i + 1),
            A = p.some(nJ);
        if (A) {
            if (nJ(p[0])) {
                let {
                    type: e
                } = p[0];
                (e === er.Sibling || e === er.Adjacent) && (d = iH(d, n7, !0)), p.unshift(iY)
            }
            r = { ...r,
                relativeSelector: !1,
                rootFunc: e => d.includes(e)
            }
        } else r.rootFunc && r.rootFunc !== ie.trueFunc && (r = { ...r,
            rootFunc: ie.trueFunc
        });
        return p.some(iQ) ? i$(d, p, r, !1, n) : A ? iX(d, [p], r, n) : i1(d, [p], r)
    }

    function iX(e, t, r, a) {
        let n = iU(t, r, e);
        return i0(e, n, a)
    }

    function i0(e, t, r = 1 / 0) {
        let a = iH(e, n7, t.shouldTestNextSiblings);
        return n7.find(e => n7.isTag(e) && t(e), a, !0, r)
    }

    function i1(e, t, r) {
        let a = (Array.isArray(e) ? e : [e]).filter(n7.isTag);
        if (0 === a.length) return a;
        let n = iU(t, r);
        return n === ie.trueFunc ? a : a.filter(n)
    }
    let i2 = /^\s*(?:[+~]|:scope\b)/;

    function i5(e) {
        return function(t, ...r) {
            return function(a) {
                var n;
                let i = e(t, this);
                return a && (i = su(i, a, this.options.xmlMode, null == (n = this._root) ? void 0 : n[0])), this._make(this.length > 1 && i.length > 1 ? r.reduce((e, t) => t(e), i) : i)
            }
        }
    }
    let i6 = i5((e, t) => {
            let r = [];
            for (let a = 0; a < t.length; a++) {
                let n = e(t[a]);
                n.length > 0 && (r = r.concat(n))
            }
            return r
        }),
        i3 = i5((e, t) => {
            let r = [];
            for (let a = 0; a < t.length; a++) {
                let n = e(t[a]);
                null !== n && r.push(n)
            }
            return r
        });

    function i4(e, ...t) {
        let r = null,
            a = i5((e, t) => {
                let a = [];
                return na(t, t => {
                    for (let n;
                        (n = e(t)) && (null == r || !r(n, a.length)); t = n) a.push(n)
                }), a
            })(e, ...t);
        return function(e, t) {
            r = "string" == typeof e ? t => iq(t, e, this.options) : e ? sc(e) : null;
            let n = a.call(this, t);
            return r = null, n
        }
    }

    function i8(e) {
        return e.length > 1 ? Array.from(new Set(e)) : e
    }
    let i9 = i3(({
            parent: e
        }) => e && !r1(e) ? e : null, i8),
        i7 = i6(e => {
            let t = [];
            for (; e.parent && !r1(e.parent);) t.push(e.parent), e = e.parent;
            return t
        }, aJ, e => e.reverse()),
        se = i4(({
            parent: e
        }) => e && !r1(e) ? e : null, aJ, e => e.reverse()),
        st = i3(e => av(e)),
        sr = i6(e => {
            let t = [];
            for (; e.next;) rJ(e = e.next) && t.push(e);
            return t
        }, i8),
        sa = i4(e => av(e), i8),
        sn = i3(e => aw(e)),
        si = i6(e => {
            let t = [];
            for (; e.prev;) rJ(e = e.prev) && t.push(e);
            return t
        }, i8),
        ss = i4(e => aw(e), i8),
        so = i6(e => aN(e).filter(t => rJ(t) && t !== e), aJ),
        sl = i6(e => aS(e).filter(rJ), i8);

    function sc(e) {
        return "function" == typeof e ? (t, r) => e.call(t, r, t) : nr(e) ? t => Array.prototype.includes.call(e, t) : function(t) {
            return e === t
        }
    }

    function su(e, t, r, a) {
        return "string" == typeof t ? iz(t, e, {
            xmlMode: r,
            root: a
        }) : e.filter(sc(t))
    }
    e.s(["_findBySelector", 0, function(e, t) {
        var r;
        let a = this.toArray(),
            n = i2.test(e) ? a : this.children().toArray(),
            i = {
                context: a,
                root: null == (r = this._root) ? void 0 : r[0],
                xmlMode: this.options.xmlMode,
                lowerCaseTags: this.options.lowerCaseTags,
                lowerCaseAttributeNames: this.options.lowerCaseAttributeNames,
                pseudos: this.options.pseudos,
                quirksMode: this.options.quirksMode
            };
        return this._make(function(e, t, r = {}, a = 1 / 0) {
            if ("function" == typeof e) return i0(t, e);
            let [n, i] = iK(n2(e)), s = i.map(e => i$(t, e, r, !0, a));
            return (n.length && s.push(iX(t, n, r, a)), 0 === s.length) ? [] : 1 === s.length ? s[0] : n7.uniqueSort(s.reduce((e, t) => [...e, ...t]))
        }(e, n, i, t))
    }, "add", 0, function(e, t) {
        let r = this._make(e, t),
            a = aJ([...this.get(), ...r.get()]);
        return this._make(a)
    }, "addBack", 0, function(e) {
        return this.prevObject ? this.add(e ? this.prevObject.filter(e) : this.prevObject) : this
    }, "children", 0, sl, "closest", 0, function(e) {
        var t;
        let r = [];
        if (!e) return this._make(r);
        let a = {
                xmlMode: this.options.xmlMode,
                root: null == (t = this._root) ? void 0 : t[0]
            },
            n = "string" == typeof e ? t => iq(t, e, a) : sc(e);
        return na(this, e => {
            for (!e || r1(e) || rJ(e) || (e = e.parent); e && rJ(e);) {
                if (n(e, 0)) {
                    r.includes(e) || r.push(e);
                    break
                }
                e = e.parent
            }
        }), this._make(r)
    }, "contents", 0, function() {
        let e = this.toArray().reduce((e, t) => r2(t) ? e.concat(t.children) : e, []);
        return this._make(e)
    }, "each", 0, function(e) {
        let t = 0,
            r = this.length;
        for (; t < r && !1 !== e.call(this[t], t, this[t]);) ++t;
        return this
    }, "end", 0, function() {
        var e;
        return null != (e = this.prevObject) ? e : this._make([])
    }, "eq", 0, function(e) {
        var t;
        return 0 == (e *= 1) && this.length <= 1 ? this : (e < 0 && (e = this.length + e), this._make(null != (t = this[e]) ? t : []))
    }, "filter", 0, function(e) {
        var t;
        return this._make(su(this.toArray(), e, this.options.xmlMode, null == (t = this._root) ? void 0 : t[0]))
    }, "filterArray", 0, su, "find", 0, function(e) {
        if (!e) return this._make([]);
        if ("string" != typeof e) {
            let t = nr(e) ? e.toArray() : [e],
                r = this.toArray();
            return this._make(t.filter(e => r.some(t => a7(t, e))))
        }
        return this._findBySelector(e, 1 / 0)
    }, "first", 0, function() {
        return this.length > 1 ? this._make(this[0]) : this
    }, "get", 0, function(e) {
        return null == e ? this.toArray() : this[e < 0 ? this.length + e : e]
    }, "has", 0, function(e) {
        return this.filter("string" == typeof e ? `:has(${e})` : (t, r) => this._make(r).find(e).length > 0)
    }, "index", 0, function(e) {
        let t, r;
        return null == e ? (t = this.parent().children(), r = this[0]) : "string" == typeof e ? (t = this._make(e), r = this[0]) : (t = this, r = nr(e) ? e[0] : e), Array.prototype.indexOf.call(t, r)
    }, "is", 0, function(e) {
        let t = this.toArray();
        return "string" == typeof e ? iV(t.filter(rJ), e, this.options) : !!e && t.some(sc(e))
    }, "last", 0, function() {
        return this.length > 0 ? this._make(this[this.length - 1]) : this
    }, "map", 0, function(e) {
        let t = [];
        for (let r = 0; r < this.length; r++) {
            let a = this[r],
                n = e.call(a, r, a);
            null != n && (t = t.concat(n))
        }
        return this._make(t)
    }, "next", 0, st, "nextAll", 0, sr, "nextUntil", 0, sa, "not", 0, function(e) {
        let t = this.toArray();
        if ("string" == typeof e) {
            let r = new Set(iz(e, t, this.options));
            t = t.filter(e => !r.has(e))
        } else {
            let r = sc(e);
            t = t.filter((e, t) => !r(e, t))
        }
        return this._make(t)
    }, "parent", 0, i9, "parents", 0, i7, "parentsUntil", 0, se, "prev", 0, sn, "prevAll", 0, si, "prevUntil", 0, ss, "siblings", 0, so, "slice", 0, function(e, t) {
        return this._make(Array.prototype.slice.call(this, e, t))
    }, "toArray", 0, function() {
        return Array.prototype.slice.call(this)
    }], 764938);
    var sd = e.i(764938);

    function sp(e, t) {
        let r = Array.isArray(e) ? e : [e];
        t ? t.children = r : t = null;
        for (let e = 0; e < r.length; e++) {
            let a = r[e];
            a.parent && a.parent.children !== r && n5(a), t ? (a.prev = r[e - 1] || null, a.next = r[e + 1] || null) : a.prev = a.next = null, a.parent = t
        }
        return t
    }
    var nk = nk;

    function sA(e) {
        return function(...t) {
            let r = this.length - 1;
            return na(this, (a, n) => {
                if (!r2(a)) return;
                let i = "function" == typeof t[0] ? t[0].call(a, n, this._render(a.children)) : t;
                e(this._makeDomArray(i, n < r), a.children, a)
            })
        }
    }

    function sh(e, t, r, a, n) {
        var i, s;
        let o = [t, r, ...a],
            l = 0 === t ? null : e[t - 1],
            c = t + r >= e.length ? null : e[t + r];
        for (let e = 0; e < a.length; ++e) {
            let r = a[e],
                u = r.parent;
            if (u) {
                let e = u.children.indexOf(r); - 1 !== e && (u.children.splice(e, 1), n === u && t > e && o[0]--)
            }
            r.parent = n, r.prev && (r.prev.next = null != (i = r.next) ? i : null), r.next && (r.next.prev = null != (s = r.prev) ? s : null), r.prev = 0 === e ? l : a[e - 1], r.next = e === a.length - 1 ? c : a[e + 1]
        }
        return l && (l.next = a[0]), c && (c.prev = a[a.length - 1]), e.splice(...o)
    }
    let sm = sA((e, t, r) => {
            sh(t, t.length, 0, e, r)
        }),
        sf = sA((e, t, r) => {
            sh(t, 0, 0, e, r)
        });

    function sg(e) {
        return function(t) {
            let r = this.length - 1,
                a = this.parents().last();
            for (let n = 0; n < this.length; n++) {
                let i = this[n],
                    s = "function" == typeof t ? t.call(i, n, i) : "string" != typeof t || nn(t) ? t : a.find(t).clone(),
                    [o] = this._makeDomArray(s, n < r);
                if (!o || !r2(o)) continue;
                let l = o,
                    c = 0;
                for (; c < l.children.length;) {
                    let e = l.children[c];
                    rJ(e) ? (l = e, c = 0) : c++
                }
                e(i, l, [o])
            }
            return this
        }
    }
    let sy = sg((e, t, r) => {
            let {
                parent: a
            } = e;
            if (!a) return;
            let n = a.children,
                i = n.indexOf(e);
            sp([e], t), sh(n, i, 0, r, a)
        }),
        sT = sg((e, t, r) => {
            r2(e) && (sp(e.children, t), sp(r, e))
        });
    e.s(["_makeDomArray", 0, function(e, t) {
        if (null == e) return [];
        if ("string" == typeof e) return this._parse(e, this.options, !1, null).children.slice(0);
        if ("length" in e) {
            if (1 === e.length) return this._makeDomArray(e[0], t);
            let r = [];
            for (let a = 0; a < e.length; a++) {
                let n = e[a];
                if ("object" == typeof n) {
                    if (null == n) continue;
                    if (!("length" in n)) {
                        r.push(t ? r5(n, !0) : n);
                        continue
                    }
                }
                r.push(...this._makeDomArray(n, t))
            }
            return r
        }
        return [t ? r5(e, !0) : e]
    }, "after", 0, function(...e) {
        let t = this.length - 1;
        return na(this, (r, a) => {
            if (!r2(r) || !r.parent) return;
            let n = r.parent.children,
                i = n.indexOf(r);
            if (-1 === i) return;
            let s = "function" == typeof e[0] ? e[0].call(r, a, this._render(r.children)) : e;
            sh(n, i + 1, 0, this._makeDomArray(s, a < t), r.parent)
        })
    }, "append", 0, sm, "appendTo", 0, function(e) {
        return (nr(e) ? e : this._make(e)).append(this), this
    }, "before", 0, function(...e) {
        let t = this.length - 1;
        return na(this, (r, a) => {
            if (!r2(r) || !r.parent) return;
            let n = r.parent.children,
                i = n.indexOf(r);
            if (-1 === i) return;
            let s = "function" == typeof e[0] ? e[0].call(r, a, this._render(r.children)) : e;
            sh(n, i, 0, this._makeDomArray(s, a < t), r.parent)
        })
    }, "clone", 0, function() {
        let e = Array.prototype.map.call(this.get(), e => r5(e, !0)),
            t = new rV(e);
        for (let r of e) r.parent = t;
        return this._make(e)
    }, "empty", 0, function() {
        return na(this, e => {
            if (r2(e)) {
                for (let t of e.children) t.next = t.prev = t.parent = null;
                e.children.length = 0
            }
        })
    }, "html", 0, function(e) {
        if (void 0 === e) {
            let e = this[0];
            return e && r2(e) ? this._render(e.children) : null
        }
        return na(this, t => {
            if (r2(t)) {
                for (let e of t.children) e.next = e.prev = e.parent = null;
                sp(nr(e) ? e.toArray() : this._parse(`${e}`, this.options, !1, t).children, t)
            }
        })
    }, "insertAfter", 0, function(e) {
        "string" == typeof e && (e = this._make(e)), this.remove();
        let t = [];
        for (let r of this._makeDomArray(e)) {
            let e = this.clone().toArray(),
                {
                    parent: a
                } = r;
            if (!a) continue;
            let n = a.children,
                i = n.indexOf(r); - 1 !== i && (sh(n, i + 1, 0, e, a), t.push(...e))
        }
        return this._make(t)
    }, "insertBefore", 0, function(e) {
        let t = this._make(e);
        this.remove();
        let r = [];
        return na(t, e => {
            let t = this.clone().toArray(),
                {
                    parent: a
                } = e;
            if (!a) return;
            let n = a.children,
                i = n.indexOf(e); - 1 !== i && (sh(n, i, 0, t, a), r.push(...t))
        }), this._make(r)
    }, "prepend", 0, sf, "prependTo", 0, function(e) {
        return (nr(e) ? e : this._make(e)).prepend(this), this
    }, "remove", 0, function(e) {
        return na(e ? this.filter(e) : this, e => {
            n5(e), e.prev = e.next = e.parent = null
        }), this
    }, "replaceWith", 0, function(e) {
        return na(this, (t, r) => {
            let {
                parent: a
            } = t;
            if (!a) return;
            let n = a.children,
                i = "function" == typeof e ? e.call(t, r, t) : e,
                s = this._makeDomArray(i);
            sp(s, null);
            let o = n.indexOf(t);
            sh(n, o, 1, s, a), s.includes(t) || (t.parent = t.prev = t.next = null)
        })
    }, "text", 0, function(e) {
        return void 0 === e ? a9(this) : "function" == typeof e ? na(this, (t, r) => this._make(t).text(e.call(t, r, a9([t])))) : na(this, t => {
            if (r2(t)) {
                for (let e of t.children) e.next = e.prev = e.parent = null;
                sp(new rQ(`${e}`), t)
            }
        })
    }, "toString", 0, function() {
        return this._render(this)
    }, "unwrap", 0, function(e) {
        return this.parent(e).not("body").each((e, t) => {
            this._make(t).replaceWith(t.children)
        }), this
    }, "wrap", 0, sy, "wrapAll", 0, function(e) {
        let t = this[0];
        if (t) {
            let r, a = this._make("function" == typeof e ? e.call(t, 0, t) : e).insertBefore(t);
            for (let e = 0; e < a.length; e++) a[e].type === nk.Tag && (r = a[e]);
            let n = 0;
            for (; r && n < r.children.length;) {
                let e = r.children[n];
                e.type === nk.Tag ? (r = e, n = 0) : n++
            }
            r && this._make(r).append(this)
        }
        return this
    }, "wrapInner", 0, sT], 975689);
    var sE = e.i(975689);

    function sb(e, t) {
        if (!e || !rJ(e)) return;
        let r = function(e) {
            let t;
            if (!(e = (e || "").trim())) return {};
            let r = {};
            for (let a of e.split(";")) {
                let e = a.indexOf(":");
                if (e < 1 || e === a.length - 1) {
                    let e = a.trimEnd();
                    e.length > 0 && void 0 !== t && (r[t] += `;${e}`)
                } else r[t = a.slice(0, e).trim()] = a.slice(e + 1).trim()
            }
            return r
        }(e.attribs.style);
        if ("string" == typeof t) return r[t];
        if (Array.isArray(t)) {
            let e = {};
            for (let a of t) null != r[a] && (e[a] = r[a]);
            return e
        }
        return r
    }
    e.s(["css", 0, function(e, t) {
        return (null == e || null == t) && ("object" != typeof e || Array.isArray(e)) ? 0 !== this.length ? sb(this[0], e) : void 0 : na(this, (r, a) => {
            rJ(r) && function e(t, r, a, n) {
                if ("string" == typeof r) {
                    var i;
                    let e = sb(t),
                        s = "function" == typeof a ? a.call(t, n, e[r]) : a;
                    "" === s ? delete e[r] : null != s && (e[r] = s), t.attribs.style = Object.keys(i = e).reduce((e, t) => `${e}${e?" ":""}${t}: ${i[t]};`, "")
                } else if ("object" == typeof r) {
                    let a = Object.keys(r);
                    for (let n = 0; n < a.length; n++) {
                        let i = a[n];
                        e(t, i, r[i], n)
                    }
                }
            }(r, e, t, a)
        })
    }], 635869);
    var sI = e.i(635869);
    let sC = "input,select,textarea,keygen",
        sS = /%20/g,
        s_ = /\r?\n/g;
    e.s(["serialize", 0, function() {
        return this.serializeArray().map(e => `${encodeURIComponent(e.name)}=${encodeURIComponent(e.value)}`).join("&").replace(sS, "+")
    }, "serializeArray", 0, function() {
        return this.map((e, t) => {
            let r = this._make(t);
            return rJ(t) && "form" === t.name ? r.find(sC).toArray() : r.filter(sC).toArray()
        }).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map((e, t) => {
            var r;
            let a = this._make(t),
                n = a.attr("name"),
                i = null != (r = a.val()) ? r : "";
            return Array.isArray(i) ? i.map(e => ({
                name: n,
                value: e.replace(s_, "\r\n")
            })) : {
                name: n,
                value: i.replace(s_, "\r\n")
            }
        }).toArray()
    }], 531876);
    var sN = e.i(531876);
    e.s(["extract", 0, function(e) {
        let t = {};
        for (let r in e) {
            let a = e[r],
                n = Array.isArray(a),
                {
                    selector: i,
                    value: s
                } = function(e) {
                    var t;
                    return "string" == typeof e ? {
                        selector: e,
                        value: "textContent"
                    } : {
                        selector: e.selector,
                        value: null != (t = e.value) ? t : "textContent"
                    }
                }(n ? a[0] : a),
                o = "function" == typeof s ? s : "string" == typeof s ? e => this._make(e).prop(s) : e => this._make(e).extract(s);
            if (n) t[r] = this._findBySelector(i, 1 / 0).map((e, a) => o(a, r, t)).get();
            else {
                let e = this._findBySelector(i, 1);
                t[r] = e.length > 0 ? o(e[0], r, t) : void 0
            }
        }
        return t
    }], 211546);
    var sx = e.i(211546);
    class sk {
        constructor(e, t, r) {
            if (this.length = 0, this.options = r, this._root = t, e) {
                for (let t = 0; t < e.length; t++) this[t] = e[t];
                this.length = e.length
            }
        }
    }
    sk.prototype.cheerio = "[cheerio object]", sk.prototype.splice = Array.prototype.splice, sk.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator], Object.assign(sk.prototype, nY, sd, sE, sI, sN, sx);
    var nk = nk;
    let sD = new Set([65534, 65535, 131070, 131071, 196606, 196607, 262142, 262143, 327678, 327679, 393214, 393215, 458750, 458751, 524286, 524287, 589822, 589823, 655358, 655359, 720894, 720895, 786430, 786431, 851966, 851967, 917502, 917503, 983038, 983039, 1048574, 1048575, 1114110, 1114111]);
    (T = en || (en = {}))[T.EOF = -1] = "EOF", T[T.NULL = 0] = "NULL", T[T.TABULATION = 9] = "TABULATION", T[T.CARRIAGE_RETURN = 13] = "CARRIAGE_RETURN", T[T.LINE_FEED = 10] = "LINE_FEED", T[T.FORM_FEED = 12] = "FORM_FEED", T[T.SPACE = 32] = "SPACE", T[T.EXCLAMATION_MARK = 33] = "EXCLAMATION_MARK", T[T.QUOTATION_MARK = 34] = "QUOTATION_MARK", T[T.AMPERSAND = 38] = "AMPERSAND", T[T.APOSTROPHE = 39] = "APOSTROPHE", T[T.HYPHEN_MINUS = 45] = "HYPHEN_MINUS", T[T.SOLIDUS = 47] = "SOLIDUS", T[T.DIGIT_0 = 48] = "DIGIT_0", T[T.DIGIT_9 = 57] = "DIGIT_9", T[T.SEMICOLON = 59] = "SEMICOLON", T[T.LESS_THAN_SIGN = 60] = "LESS_THAN_SIGN", T[T.EQUALS_SIGN = 61] = "EQUALS_SIGN", T[T.GREATER_THAN_SIGN = 62] = "GREATER_THAN_SIGN", T[T.QUESTION_MARK = 63] = "QUESTION_MARK", T[T.LATIN_CAPITAL_A = 65] = "LATIN_CAPITAL_A", T[T.LATIN_CAPITAL_Z = 90] = "LATIN_CAPITAL_Z", T[T.RIGHT_SQUARE_BRACKET = 93] = "RIGHT_SQUARE_BRACKET", T[T.GRAVE_ACCENT = 96] = "GRAVE_ACCENT", T[T.LATIN_SMALL_A = 97] = "LATIN_SMALL_A", T[T.LATIN_SMALL_Z = 122] = "LATIN_SMALL_Z";
    let sv = "[CDATA[",
        sw = "doctype",
        sO = "script";

    function sR(e) {
        return e >= 55296 && e <= 57343
    }

    function sM(e) {
        return 32 !== e && 10 !== e && 13 !== e && 9 !== e && 12 !== e && e >= 1 && e <= 31 || e >= 127 && e <= 159
    }

    function sL(e) {
        return e >= 64976 && e <= 65007 || sD.has(e)
    }(E = ei || (ei = {})).controlCharacterInInputStream = "control-character-in-input-stream", E.noncharacterInInputStream = "noncharacter-in-input-stream", E.surrogateInInputStream = "surrogate-in-input-stream", E.nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus", E.endTagWithAttributes = "end-tag-with-attributes", E.endTagWithTrailingSolidus = "end-tag-with-trailing-solidus", E.unexpectedSolidusInTag = "unexpected-solidus-in-tag", E.unexpectedNullCharacter = "unexpected-null-character", E.unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name", E.invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name", E.unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name", E.missingEndTagName = "missing-end-tag-name", E.unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name", E.unknownNamedCharacterReference = "unknown-named-character-reference", E.missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference", E.unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier", E.unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value", E.eofBeforeTagName = "eof-before-tag-name", E.eofInTag = "eof-in-tag", E.missingAttributeValue = "missing-attribute-value", E.missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes", E.missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword", E.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers", E.missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword", E.missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier", E.missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier", E.missingDoctypePublicIdentifier = "missing-doctype-public-identifier", E.missingDoctypeSystemIdentifier = "missing-doctype-system-identifier", E.abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier", E.abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier", E.cdataInHtmlContent = "cdata-in-html-content", E.incorrectlyOpenedComment = "incorrectly-opened-comment", E.eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text", E.eofInDoctype = "eof-in-doctype", E.nestedComment = "nested-comment", E.abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment", E.eofInComment = "eof-in-comment", E.incorrectlyClosedComment = "incorrectly-closed-comment", E.eofInCdata = "eof-in-cdata", E.absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference", E.nullCharacterReference = "null-character-reference", E.surrogateCharacterReference = "surrogate-character-reference", E.characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range", E.controlCharacterReference = "control-character-reference", E.noncharacterCharacterReference = "noncharacter-character-reference", E.missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name", E.missingDoctypeName = "missing-doctype-name", E.invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name", E.duplicateAttribute = "duplicate-attribute", E.nonConformingDoctype = "non-conforming-doctype", E.missingDoctype = "missing-doctype", E.misplacedDoctype = "misplaced-doctype", E.endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element", E.closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements", E.disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head", E.openElementsLeftAfterEof = "open-elements-left-after-eof", E.abandonedHeadElementChild = "abandoned-head-element-child", E.misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element", E.nestedNoscriptInHead = "nested-noscript-in-head", E.eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text";
    class sB {
        constructor(e) {
            this.handler = e, this.html = "", this.pos = -1, this.lastGapPos = -2, this.gapStack = [], this.skipNextNewLine = !1, this.lastChunkWritten = !1, this.endOfChunkHit = !1, this.bufferWaterline = 65536, this.isEol = !1, this.lineStartPos = 0, this.droppedBufferSize = 0, this.line = 1, this.lastErrOffset = -1
        }
        get col() {
            return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos)
        }
        get offset() {
            return this.droppedBufferSize + this.pos
        }
        getError(e, t) {
            let {
                line: r,
                col: a,
                offset: n
            } = this, i = a + t, s = n + t;
            return {
                code: e,
                startLine: r,
                endLine: r,
                startCol: i,
                endCol: i,
                startOffset: s,
                endOffset: s
            }
        }
        _err(e) {
            this.handler.onParseError && this.lastErrOffset !== this.offset && (this.lastErrOffset = this.offset, this.handler.onParseError(this.getError(e, 0)))
        }
        _addGap() {
            this.gapStack.push(this.lastGapPos), this.lastGapPos = this.pos
        }
        _processSurrogate(e) {
            if (this.pos !== this.html.length - 1) {
                let t = this.html.charCodeAt(this.pos + 1);
                if (t >= 56320 && t <= 57343) return this.pos++, this._addGap(), (e - 55296) * 1024 + 9216 + t
            } else if (!this.lastChunkWritten) return this.endOfChunkHit = !0, en.EOF;
            return this._err(ei.surrogateInInputStream), e
        }
        willDropParsedChunk() {
            return this.pos > this.bufferWaterline
        }
        dropParsedChunk() {
            this.willDropParsedChunk() && (this.html = this.html.substring(this.pos), this.lineStartPos -= this.pos, this.droppedBufferSize += this.pos, this.pos = 0, this.lastGapPos = -2, this.gapStack.length = 0)
        }
        write(e, t) {
            this.html.length > 0 ? this.html += e : this.html = e, this.endOfChunkHit = !1, this.lastChunkWritten = t
        }
        insertHtmlAtCurrentPos(e) {
            this.html = this.html.substring(0, this.pos + 1) + e + this.html.substring(this.pos + 1), this.endOfChunkHit = !1
        }
        startsWith(e, t) {
            if (this.pos + e.length > this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, !1;
            if (t) return this.html.startsWith(e, this.pos);
            for (let t = 0; t < e.length; t++)
                if ((32 | this.html.charCodeAt(this.pos + t)) !== e.charCodeAt(t)) return !1;
            return !0
        }
        peek(e) {
            let t = this.pos + e;
            if (t >= this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, en.EOF;
            let r = this.html.charCodeAt(t);
            return r === en.CARRIAGE_RETURN ? en.LINE_FEED : r
        }
        advance() {
            if (this.pos++, this.isEol && (this.isEol = !1, this.line++, this.lineStartPos = this.pos), this.pos >= this.html.length) return this.endOfChunkHit = !this.lastChunkWritten, en.EOF;
            let e = this.html.charCodeAt(this.pos);
            return e === en.CARRIAGE_RETURN ? (this.isEol = !0, this.skipNextNewLine = !0, en.LINE_FEED) : e === en.LINE_FEED && (this.isEol = !0, this.skipNextNewLine) ? (this.line--, this.skipNextNewLine = !1, this._addGap(), this.advance()) : (this.skipNextNewLine = !1, sR(e) && (e = this._processSurrogate(e)), null === this.handler.onParseError || e > 31 && e < 127 || e === en.LINE_FEED || e === en.CARRIAGE_RETURN || e > 159 && e < 64976 || this._checkForProblematicCharacters(e), e)
        }
        _checkForProblematicCharacters(e) {
            sM(e) ? this._err(ei.controlCharacterInInputStream) : sL(e) && this._err(ei.noncharacterInInputStream)
        }
        retreat(e) {
            for (this.pos -= e; this.pos < this.lastGapPos;) this.lastGapPos = this.gapStack.pop(), this.pos--;
            this.isEol = !1
        }
    }

    function sP(e, t) {
        for (let r = e.attrs.length - 1; r >= 0; r--)
            if (e.attrs[r].name === t) return e.attrs[r].value;
        return null
    }(b = es || (es = {}))[b.CHARACTER = 0] = "CHARACTER", b[b.NULL_CHARACTER = 1] = "NULL_CHARACTER", b[b.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", b[b.START_TAG = 3] = "START_TAG", b[b.END_TAG = 4] = "END_TAG", b[b.COMMENT = 5] = "COMMENT", b[b.DOCTYPE = 6] = "DOCTYPE", b[b.EOF = 7] = "EOF", b[b.HIBERNATION = 8] = "HIBERNATION";
    let sF = new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e => e.charCodeAt(0))),
        sU = new Map([
            [0, 65533],
            [128, 8364],
            [130, 8218],
            [131, 402],
            [132, 8222],
            [133, 8230],
            [134, 8224],
            [135, 8225],
            [136, 710],
            [137, 8240],
            [138, 352],
            [139, 8249],
            [140, 338],
            [142, 381],
            [145, 8216],
            [146, 8217],
            [147, 8220],
            [148, 8221],
            [149, 8226],
            [150, 8211],
            [151, 8212],
            [152, 732],
            [153, 8482],
            [154, 353],
            [155, 8250],
            [156, 339],
            [158, 382],
            [159, 376]
        ]);

    function sG(e) {
        return e >= el.ZERO && e <= el.NINE
    }
    eo = String.fromCodePoint, (I = el || (el = {}))[I.NUM = 35] = "NUM", I[I.SEMI = 59] = "SEMI", I[I.EQUALS = 61] = "EQUALS", I[I.ZERO = 48] = "ZERO", I[I.NINE = 57] = "NINE", I[I.LOWER_A = 97] = "LOWER_A", I[I.LOWER_F = 102] = "LOWER_F", I[I.LOWER_X = 120] = "LOWER_X", I[I.LOWER_Z = 122] = "LOWER_Z", I[I.UPPER_A = 65] = "UPPER_A", I[I.UPPER_F = 70] = "UPPER_F", I[I.UPPER_Z = 90] = "UPPER_Z", (C = ec || (ec = {}))[C.VALUE_LENGTH = 49152] = "VALUE_LENGTH", C[C.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", C[C.JUMP_TABLE = 127] = "JUMP_TABLE", (S = eu || (eu = {}))[S.EntityStart = 0] = "EntityStart", S[S.NumericStart = 1] = "NumericStart", S[S.NumericDecimal = 2] = "NumericDecimal", S[S.NumericHex = 3] = "NumericHex", S[S.NamedEntity = 4] = "NamedEntity", (_ = ed || (ed = {}))[_.Legacy = 0] = "Legacy", _[_.Strict = 1] = "Strict", _[_.Attribute = 2] = "Attribute";
    class sH {
        constructor(e, t, r) {
            this.decodeTree = e, this.emitCodePoint = t, this.errors = r, this.state = eu.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = ed.Strict
        }
        startEntity(e) {
            this.decodeMode = e, this.state = eu.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1
        }
        write(e, t) {
            switch (this.state) {
                case eu.EntityStart:
                    if (e.charCodeAt(t) === el.NUM) return this.state = eu.NumericStart, this.consumed += 1, this.stateNumericStart(e, t + 1);
                    return this.state = eu.NamedEntity, this.stateNamedEntity(e, t);
                case eu.NumericStart:
                    return this.stateNumericStart(e, t);
                case eu.NumericDecimal:
                    return this.stateNumericDecimal(e, t);
                case eu.NumericHex:
                    return this.stateNumericHex(e, t);
                case eu.NamedEntity:
                    return this.stateNamedEntity(e, t)
            }
        }
        stateNumericStart(e, t) {
            return t >= e.length ? -1 : (32 | e.charCodeAt(t)) === el.LOWER_X ? (this.state = eu.NumericHex, this.consumed += 1, this.stateNumericHex(e, t + 1)) : (this.state = eu.NumericDecimal, this.stateNumericDecimal(e, t))
        }
        addToNumericResult(e, t, r, a) {
            if (t !== r) {
                let n = r - t;
                this.result = this.result * Math.pow(a, n) + Number.parseInt(e.substr(t, n), a), this.consumed += n
            }
        }
        stateNumericHex(e, t) {
            let r = t;
            for (; t < e.length;) {
                var a;
                let n = e.charCodeAt(t);
                if (!sG(n) && (!((a = n) >= el.UPPER_A) || !(a <= el.UPPER_F)) && (!(a >= el.LOWER_A) || !(a <= el.LOWER_F))) return this.addToNumericResult(e, r, t, 16), this.emitNumericEntity(n, 3);
                t += 1
            }
            return this.addToNumericResult(e, r, t, 16), -1
        }
        stateNumericDecimal(e, t) {
            let r = t;
            for (; t < e.length;) {
                let a = e.charCodeAt(t);
                if (!sG(a)) return this.addToNumericResult(e, r, t, 10), this.emitNumericEntity(a, 2);
                t += 1
            }
            return this.addToNumericResult(e, r, t, 10), -1
        }
        emitNumericEntity(e, t) {
            var r, a, n;
            if (this.consumed <= t) return null == (r = this.errors) || r.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
            if (e === el.SEMI) this.consumed += 1;
            else if (this.decodeMode === ed.Strict) return 0;
            return this.emitCodePoint((a = this.result) >= 55296 && a <= 57343 || a > 1114111 ? 65533 : null != (n = sU.get(a)) ? n : a, this.consumed), this.errors && (e !== el.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed
        }
        stateNamedEntity(e, t) {
            let {
                decodeTree: r
            } = this, a = r[this.treeIndex], n = (a & ec.VALUE_LENGTH) >> 14;
            for (; t < e.length; t++, this.excess++) {
                let i = e.charCodeAt(t);
                if (this.treeIndex = function(e, t, r, a) {
                        let n = (t & ec.BRANCH_LENGTH) >> 7,
                            i = t & ec.JUMP_TABLE;
                        if (0 === n) return 0 !== i && a === i ? r : -1;
                        if (i) {
                            let t = a - i;
                            return t < 0 || t >= n ? -1 : e[r + t] - 1
                        }
                        let s = r,
                            o = s + n - 1;
                        for (; s <= o;) {
                            let t = s + o >>> 1,
                                r = e[t];
                            if (r < a) s = t + 1;
                            else {
                                if (!(r > a)) return e[t + n];
                                o = t - 1
                            }
                        }
                        return -1
                    }(r, a, this.treeIndex + Math.max(1, n), i), this.treeIndex < 0) return 0 === this.result || this.decodeMode === ed.Attribute && (0 === n || function(e) {
                    var t;
                    return e === el.EQUALS || (t = e) >= el.UPPER_A && t <= el.UPPER_Z || t >= el.LOWER_A && t <= el.LOWER_Z || sG(t)
                }(i)) ? 0 : this.emitNotTerminatedNamedEntity();
                if (0 != (n = ((a = r[this.treeIndex]) & ec.VALUE_LENGTH) >> 14)) {
                    if (i === el.SEMI) return this.emitNamedEntityData(this.treeIndex, n, this.consumed + this.excess);
                    this.decodeMode !== ed.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0)
                }
            }
            return -1
        }
        emitNotTerminatedNamedEntity() {
            var e;
            let {
                result: t,
                decodeTree: r
            } = this, a = (r[t] & ec.VALUE_LENGTH) >> 14;
            return this.emitNamedEntityData(t, a, this.consumed), null == (e = this.errors) || e.missingSemicolonAfterCharacterReference(), this.consumed
        }
        emitNamedEntityData(e, t, r) {
            let {
                decodeTree: a
            } = this;
            return this.emitCodePoint(1 === t ? a[e] & ~ec.VALUE_LENGTH : a[e + 1], r), 3 === t && this.emitCodePoint(a[e + 2], r), r
        }
        end() {
            var e;
            switch (this.state) {
                case eu.NamedEntity:
                    return 0 !== this.result && (this.decodeMode !== ed.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
                case eu.NumericDecimal:
                    return this.emitNumericEntity(0, 2);
                case eu.NumericHex:
                    return this.emitNumericEntity(0, 3);
                case eu.NumericStart:
                    return null == (e = this.errors) || e.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
                case eu.EntityStart:
                    return 0
            }
        }
    }(N = ep || (ep = {})).HTML = "http://www.w3.org/1999/xhtml", N.MATHML = "http://www.w3.org/1998/Math/MathML", N.SVG = "http://www.w3.org/2000/svg", N.XLINK = "http://www.w3.org/1999/xlink", N.XML = "http://www.w3.org/XML/1998/namespace", N.XMLNS = "http://www.w3.org/2000/xmlns/", (x = eA || (eA = {})).TYPE = "type", x.ACTION = "action", x.ENCODING = "encoding", x.PROMPT = "prompt", x.NAME = "name", x.COLOR = "color", x.FACE = "face", x.SIZE = "size", (k = eh || (eh = {})).NO_QUIRKS = "no-quirks", k.QUIRKS = "quirks", k.LIMITED_QUIRKS = "limited-quirks", (D = em || (em = {})).A = "a", D.ADDRESS = "address", D.ANNOTATION_XML = "annotation-xml", D.APPLET = "applet", D.AREA = "area", D.ARTICLE = "article", D.ASIDE = "aside", D.B = "b", D.BASE = "base", D.BASEFONT = "basefont", D.BGSOUND = "bgsound", D.BIG = "big", D.BLOCKQUOTE = "blockquote", D.BODY = "body", D.BR = "br", D.BUTTON = "button", D.CAPTION = "caption", D.CENTER = "center", D.CODE = "code", D.COL = "col", D.COLGROUP = "colgroup", D.DD = "dd", D.DESC = "desc", D.DETAILS = "details", D.DIALOG = "dialog", D.DIR = "dir", D.DIV = "div", D.DL = "dl", D.DT = "dt", D.EM = "em", D.EMBED = "embed", D.FIELDSET = "fieldset", D.FIGCAPTION = "figcaption", D.FIGURE = "figure", D.FONT = "font", D.FOOTER = "footer", D.FOREIGN_OBJECT = "foreignObject", D.FORM = "form", D.FRAME = "frame", D.FRAMESET = "frameset", D.H1 = "h1", D.H2 = "h2", D.H3 = "h3", D.H4 = "h4", D.H5 = "h5", D.H6 = "h6", D.HEAD = "head", D.HEADER = "header", D.HGROUP = "hgroup", D.HR = "hr", D.HTML = "html", D.I = "i", D.IMG = "img", D.IMAGE = "image", D.INPUT = "input", D.IFRAME = "iframe", D.KEYGEN = "keygen", D.LABEL = "label", D.LI = "li", D.LINK = "link", D.LISTING = "listing", D.MAIN = "main", D.MALIGNMARK = "malignmark", D.MARQUEE = "marquee", D.MATH = "math", D.MENU = "menu", D.META = "meta", D.MGLYPH = "mglyph", D.MI = "mi", D.MO = "mo", D.MN = "mn", D.MS = "ms", D.MTEXT = "mtext", D.NAV = "nav", D.NOBR = "nobr", D.NOFRAMES = "noframes", D.NOEMBED = "noembed", D.NOSCRIPT = "noscript", D.OBJECT = "object", D.OL = "ol", D.OPTGROUP = "optgroup", D.OPTION = "option", D.P = "p", D.PARAM = "param", D.PLAINTEXT = "plaintext", D.PRE = "pre", D.RB = "rb", D.RP = "rp", D.RT = "rt", D.RTC = "rtc", D.RUBY = "ruby", D.S = "s", D.SCRIPT = "script", D.SEARCH = "search", D.SECTION = "section", D.SELECT = "select", D.SOURCE = "source", D.SMALL = "small", D.SPAN = "span", D.STRIKE = "strike", D.STRONG = "strong", D.STYLE = "style", D.SUB = "sub", D.SUMMARY = "summary", D.SUP = "sup", D.TABLE = "table", D.TBODY = "tbody", D.TEMPLATE = "template", D.TEXTAREA = "textarea", D.TFOOT = "tfoot", D.TD = "td", D.TH = "th", D.THEAD = "thead", D.TITLE = "title", D.TR = "tr", D.TRACK = "track", D.TT = "tt", D.U = "u", D.UL = "ul", D.SVG = "svg", D.VAR = "var", D.WBR = "wbr", D.XMP = "xmp", (v = ef || (ef = {}))[v.UNKNOWN = 0] = "UNKNOWN", v[v.A = 1] = "A", v[v.ADDRESS = 2] = "ADDRESS", v[v.ANNOTATION_XML = 3] = "ANNOTATION_XML", v[v.APPLET = 4] = "APPLET", v[v.AREA = 5] = "AREA", v[v.ARTICLE = 6] = "ARTICLE", v[v.ASIDE = 7] = "ASIDE", v[v.B = 8] = "B", v[v.BASE = 9] = "BASE", v[v.BASEFONT = 10] = "BASEFONT", v[v.BGSOUND = 11] = "BGSOUND", v[v.BIG = 12] = "BIG", v[v.BLOCKQUOTE = 13] = "BLOCKQUOTE", v[v.BODY = 14] = "BODY", v[v.BR = 15] = "BR", v[v.BUTTON = 16] = "BUTTON", v[v.CAPTION = 17] = "CAPTION", v[v.CENTER = 18] = "CENTER", v[v.CODE = 19] = "CODE", v[v.COL = 20] = "COL", v[v.COLGROUP = 21] = "COLGROUP", v[v.DD = 22] = "DD", v[v.DESC = 23] = "DESC", v[v.DETAILS = 24] = "DETAILS", v[v.DIALOG = 25] = "DIALOG", v[v.DIR = 26] = "DIR", v[v.DIV = 27] = "DIV", v[v.DL = 28] = "DL", v[v.DT = 29] = "DT", v[v.EM = 30] = "EM", v[v.EMBED = 31] = "EMBED", v[v.FIELDSET = 32] = "FIELDSET", v[v.FIGCAPTION = 33] = "FIGCAPTION", v[v.FIGURE = 34] = "FIGURE", v[v.FONT = 35] = "FONT", v[v.FOOTER = 36] = "FOOTER", v[v.FOREIGN_OBJECT = 37] = "FOREIGN_OBJECT", v[v.FORM = 38] = "FORM", v[v.FRAME = 39] = "FRAME", v[v.FRAMESET = 40] = "FRAMESET", v[v.H1 = 41] = "H1", v[v.H2 = 42] = "H2", v[v.H3 = 43] = "H3", v[v.H4 = 44] = "H4", v[v.H5 = 45] = "H5", v[v.H6 = 46] = "H6", v[v.HEAD = 47] = "HEAD", v[v.HEADER = 48] = "HEADER", v[v.HGROUP = 49] = "HGROUP", v[v.HR = 50] = "HR", v[v.HTML = 51] = "HTML", v[v.I = 52] = "I", v[v.IMG = 53] = "IMG", v[v.IMAGE = 54] = "IMAGE", v[v.INPUT = 55] = "INPUT", v[v.IFRAME = 56] = "IFRAME", v[v.KEYGEN = 57] = "KEYGEN", v[v.LABEL = 58] = "LABEL", v[v.LI = 59] = "LI", v[v.LINK = 60] = "LINK", v[v.LISTING = 61] = "LISTING", v[v.MAIN = 62] = "MAIN", v[v.MALIGNMARK = 63] = "MALIGNMARK", v[v.MARQUEE = 64] = "MARQUEE", v[v.MATH = 65] = "MATH", v[v.MENU = 66] = "MENU", v[v.META = 67] = "META", v[v.MGLYPH = 68] = "MGLYPH", v[v.MI = 69] = "MI", v[v.MO = 70] = "MO", v[v.MN = 71] = "MN", v[v.MS = 72] = "MS", v[v.MTEXT = 73] = "MTEXT", v[v.NAV = 74] = "NAV", v[v.NOBR = 75] = "NOBR", v[v.NOFRAMES = 76] = "NOFRAMES", v[v.NOEMBED = 77] = "NOEMBED", v[v.NOSCRIPT = 78] = "NOSCRIPT", v[v.OBJECT = 79] = "OBJECT", v[v.OL = 80] = "OL", v[v.OPTGROUP = 81] = "OPTGROUP", v[v.OPTION = 82] = "OPTION", v[v.P = 83] = "P", v[v.PARAM = 84] = "PARAM", v[v.PLAINTEXT = 85] = "PLAINTEXT", v[v.PRE = 86] = "PRE", v[v.RB = 87] = "RB", v[v.RP = 88] = "RP", v[v.RT = 89] = "RT", v[v.RTC = 90] = "RTC", v[v.RUBY = 91] = "RUBY", v[v.S = 92] = "S", v[v.SCRIPT = 93] = "SCRIPT", v[v.SEARCH = 94] = "SEARCH", v[v.SECTION = 95] = "SECTION", v[v.SELECT = 96] = "SELECT", v[v.SOURCE = 97] = "SOURCE", v[v.SMALL = 98] = "SMALL", v[v.SPAN = 99] = "SPAN", v[v.STRIKE = 100] = "STRIKE", v[v.STRONG = 101] = "STRONG", v[v.STYLE = 102] = "STYLE", v[v.SUB = 103] = "SUB", v[v.SUMMARY = 104] = "SUMMARY", v[v.SUP = 105] = "SUP", v[v.TABLE = 106] = "TABLE", v[v.TBODY = 107] = "TBODY", v[v.TEMPLATE = 108] = "TEMPLATE", v[v.TEXTAREA = 109] = "TEXTAREA", v[v.TFOOT = 110] = "TFOOT", v[v.TD = 111] = "TD", v[v.TH = 112] = "TH", v[v.THEAD = 113] = "THEAD", v[v.TITLE = 114] = "TITLE", v[v.TR = 115] = "TR", v[v.TRACK = 116] = "TRACK", v[v.TT = 117] = "TT", v[v.U = 118] = "U", v[v.UL = 119] = "UL", v[v.SVG = 120] = "SVG", v[v.VAR = 121] = "VAR", v[v.WBR = 122] = "WBR", v[v.XMP = 123] = "XMP";
    let sj = new Map([
        [em.A, ef.A],
        [em.ADDRESS, ef.ADDRESS],
        [em.ANNOTATION_XML, ef.ANNOTATION_XML],
        [em.APPLET, ef.APPLET],
        [em.AREA, ef.AREA],
        [em.ARTICLE, ef.ARTICLE],
        [em.ASIDE, ef.ASIDE],
        [em.B, ef.B],
        [em.BASE, ef.BASE],
        [em.BASEFONT, ef.BASEFONT],
        [em.BGSOUND, ef.BGSOUND],
        [em.BIG, ef.BIG],
        [em.BLOCKQUOTE, ef.BLOCKQUOTE],
        [em.BODY, ef.BODY],
        [em.BR, ef.BR],
        [em.BUTTON, ef.BUTTON],
        [em.CAPTION, ef.CAPTION],
        [em.CENTER, ef.CENTER],
        [em.CODE, ef.CODE],
        [em.COL, ef.COL],
        [em.COLGROUP, ef.COLGROUP],
        [em.DD, ef.DD],
        [em.DESC, ef.DESC],
        [em.DETAILS, ef.DETAILS],
        [em.DIALOG, ef.DIALOG],
        [em.DIR, ef.DIR],
        [em.DIV, ef.DIV],
        [em.DL, ef.DL],
        [em.DT, ef.DT],
        [em.EM, ef.EM],
        [em.EMBED, ef.EMBED],
        [em.FIELDSET, ef.FIELDSET],
        [em.FIGCAPTION, ef.FIGCAPTION],
        [em.FIGURE, ef.FIGURE],
        [em.FONT, ef.FONT],
        [em.FOOTER, ef.FOOTER],
        [em.FOREIGN_OBJECT, ef.FOREIGN_OBJECT],
        [em.FORM, ef.FORM],
        [em.FRAME, ef.FRAME],
        [em.FRAMESET, ef.FRAMESET],
        [em.H1, ef.H1],
        [em.H2, ef.H2],
        [em.H3, ef.H3],
        [em.H4, ef.H4],
        [em.H5, ef.H5],
        [em.H6, ef.H6],
        [em.HEAD, ef.HEAD],
        [em.HEADER, ef.HEADER],
        [em.HGROUP, ef.HGROUP],
        [em.HR, ef.HR],
        [em.HTML, ef.HTML],
        [em.I, ef.I],
        [em.IMG, ef.IMG],
        [em.IMAGE, ef.IMAGE],
        [em.INPUT, ef.INPUT],
        [em.IFRAME, ef.IFRAME],
        [em.KEYGEN, ef.KEYGEN],
        [em.LABEL, ef.LABEL],
        [em.LI, ef.LI],
        [em.LINK, ef.LINK],
        [em.LISTING, ef.LISTING],
        [em.MAIN, ef.MAIN],
        [em.MALIGNMARK, ef.MALIGNMARK],
        [em.MARQUEE, ef.MARQUEE],
        [em.MATH, ef.MATH],
        [em.MENU, ef.MENU],
        [em.META, ef.META],
        [em.MGLYPH, ef.MGLYPH],
        [em.MI, ef.MI],
        [em.MO, ef.MO],
        [em.MN, ef.MN],
        [em.MS, ef.MS],
        [em.MTEXT, ef.MTEXT],
        [em.NAV, ef.NAV],
        [em.NOBR, ef.NOBR],
        [em.NOFRAMES, ef.NOFRAMES],
        [em.NOEMBED, ef.NOEMBED],
        [em.NOSCRIPT, ef.NOSCRIPT],
        [em.OBJECT, ef.OBJECT],
        [em.OL, ef.OL],
        [em.OPTGROUP, ef.OPTGROUP],
        [em.OPTION, ef.OPTION],
        [em.P, ef.P],
        [em.PARAM, ef.PARAM],
        [em.PLAINTEXT, ef.PLAINTEXT],
        [em.PRE, ef.PRE],
        [em.RB, ef.RB],
        [em.RP, ef.RP],
        [em.RT, ef.RT],
        [em.RTC, ef.RTC],
        [em.RUBY, ef.RUBY],
        [em.S, ef.S],
        [em.SCRIPT, ef.SCRIPT],
        [em.SEARCH, ef.SEARCH],
        [em.SECTION, ef.SECTION],
        [em.SELECT, ef.SELECT],
        [em.SOURCE, ef.SOURCE],
        [em.SMALL, ef.SMALL],
        [em.SPAN, ef.SPAN],
        [em.STRIKE, ef.STRIKE],
        [em.STRONG, ef.STRONG],
        [em.STYLE, ef.STYLE],
        [em.SUB, ef.SUB],
        [em.SUMMARY, ef.SUMMARY],
        [em.SUP, ef.SUP],
        [em.TABLE, ef.TABLE],
        [em.TBODY, ef.TBODY],
        [em.TEMPLATE, ef.TEMPLATE],
        [em.TEXTAREA, ef.TEXTAREA],
        [em.TFOOT, ef.TFOOT],
        [em.TD, ef.TD],
        [em.TH, ef.TH],
        [em.THEAD, ef.THEAD],
        [em.TITLE, ef.TITLE],
        [em.TR, ef.TR],
        [em.TRACK, ef.TRACK],
        [em.TT, ef.TT],
        [em.U, ef.U],
        [em.UL, ef.UL],
        [em.SVG, ef.SVG],
        [em.VAR, ef.VAR],
        [em.WBR, ef.WBR],
        [em.XMP, ef.XMP]
    ]);

    function sQ(e) {
        var t;
        return null != (t = sj.get(e)) ? t : ef.UNKNOWN
    }
    let sK = ef,
        sY = {
            [ep.HTML]: new Set([sK.ADDRESS, sK.APPLET, sK.AREA, sK.ARTICLE, sK.ASIDE, sK.BASE, sK.BASEFONT, sK.BGSOUND, sK.BLOCKQUOTE, sK.BODY, sK.BR, sK.BUTTON, sK.CAPTION, sK.CENTER, sK.COL, sK.COLGROUP, sK.DD, sK.DETAILS, sK.DIR, sK.DIV, sK.DL, sK.DT, sK.EMBED, sK.FIELDSET, sK.FIGCAPTION, sK.FIGURE, sK.FOOTER, sK.FORM, sK.FRAME, sK.FRAMESET, sK.H1, sK.H2, sK.H3, sK.H4, sK.H5, sK.H6, sK.HEAD, sK.HEADER, sK.HGROUP, sK.HR, sK.HTML, sK.IFRAME, sK.IMG, sK.INPUT, sK.LI, sK.LINK, sK.LISTING, sK.MAIN, sK.MARQUEE, sK.MENU, sK.META, sK.NAV, sK.NOEMBED, sK.NOFRAMES, sK.NOSCRIPT, sK.OBJECT, sK.OL, sK.P, sK.PARAM, sK.PLAINTEXT, sK.PRE, sK.SCRIPT, sK.SECTION, sK.SELECT, sK.SOURCE, sK.STYLE, sK.SUMMARY, sK.TABLE, sK.TBODY, sK.TD, sK.TEMPLATE, sK.TEXTAREA, sK.TFOOT, sK.TH, sK.THEAD, sK.TITLE, sK.TR, sK.TRACK, sK.UL, sK.WBR, sK.XMP]),
            [ep.MATHML]: new Set([sK.MI, sK.MO, sK.MN, sK.MS, sK.MTEXT, sK.ANNOTATION_XML]),
            [ep.SVG]: new Set([sK.TITLE, sK.FOREIGN_OBJECT, sK.DESC]),
            [ep.XLINK]: new Set,
            [ep.XML]: new Set,
            [ep.XMLNS]: new Set
        },
        sW = new Set([sK.H1, sK.H2, sK.H3, sK.H4, sK.H5, sK.H6]),
        sq = new Set([em.STYLE, em.SCRIPT, em.XMP, em.IFRAME, em.NOEMBED, em.NOFRAMES, em.PLAINTEXT]);

    function sV(e, t) {
        return sq.has(e) || t && e === em.NOSCRIPT
    }
    e.s(["ATTRS", 0, eA, "DOCUMENT_MODE", 0, eh, "NS", 0, ep, "NUMBERED_HEADERS", 0, sW, "SPECIAL_ELEMENTS", 0, sY, "TAG_ID", 0, ef, "TAG_NAMES", 0, em, "getTagID", 0, sQ, "hasUnescapedText", 0, sV], 844866), (w = eg || (eg = {}))[w.DATA = 0] = "DATA", w[w.RCDATA = 1] = "RCDATA", w[w.RAWTEXT = 2] = "RAWTEXT", w[w.SCRIPT_DATA = 3] = "SCRIPT_DATA", w[w.PLAINTEXT = 4] = "PLAINTEXT", w[w.TAG_OPEN = 5] = "TAG_OPEN", w[w.END_TAG_OPEN = 6] = "END_TAG_OPEN", w[w.TAG_NAME = 7] = "TAG_NAME", w[w.RCDATA_LESS_THAN_SIGN = 8] = "RCDATA_LESS_THAN_SIGN", w[w.RCDATA_END_TAG_OPEN = 9] = "RCDATA_END_TAG_OPEN", w[w.RCDATA_END_TAG_NAME = 10] = "RCDATA_END_TAG_NAME", w[w.RAWTEXT_LESS_THAN_SIGN = 11] = "RAWTEXT_LESS_THAN_SIGN", w[w.RAWTEXT_END_TAG_OPEN = 12] = "RAWTEXT_END_TAG_OPEN", w[w.RAWTEXT_END_TAG_NAME = 13] = "RAWTEXT_END_TAG_NAME", w[w.SCRIPT_DATA_LESS_THAN_SIGN = 14] = "SCRIPT_DATA_LESS_THAN_SIGN", w[w.SCRIPT_DATA_END_TAG_OPEN = 15] = "SCRIPT_DATA_END_TAG_OPEN", w[w.SCRIPT_DATA_END_TAG_NAME = 16] = "SCRIPT_DATA_END_TAG_NAME", w[w.SCRIPT_DATA_ESCAPE_START = 17] = "SCRIPT_DATA_ESCAPE_START", w[w.SCRIPT_DATA_ESCAPE_START_DASH = 18] = "SCRIPT_DATA_ESCAPE_START_DASH", w[w.SCRIPT_DATA_ESCAPED = 19] = "SCRIPT_DATA_ESCAPED", w[w.SCRIPT_DATA_ESCAPED_DASH = 20] = "SCRIPT_DATA_ESCAPED_DASH", w[w.SCRIPT_DATA_ESCAPED_DASH_DASH = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH", w[w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN", w[w.SCRIPT_DATA_ESCAPED_END_TAG_OPEN = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN", w[w.SCRIPT_DATA_ESCAPED_END_TAG_NAME = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME", w[w.SCRIPT_DATA_DOUBLE_ESCAPE_START = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START", w[w.SCRIPT_DATA_DOUBLE_ESCAPED = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED", w[w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH", w[w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH", w[w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN", w[w.SCRIPT_DATA_DOUBLE_ESCAPE_END = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END", w[w.BEFORE_ATTRIBUTE_NAME = 31] = "BEFORE_ATTRIBUTE_NAME", w[w.ATTRIBUTE_NAME = 32] = "ATTRIBUTE_NAME", w[w.AFTER_ATTRIBUTE_NAME = 33] = "AFTER_ATTRIBUTE_NAME", w[w.BEFORE_ATTRIBUTE_VALUE = 34] = "BEFORE_ATTRIBUTE_VALUE", w[w.ATTRIBUTE_VALUE_DOUBLE_QUOTED = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED", w[w.ATTRIBUTE_VALUE_SINGLE_QUOTED = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED", w[w.ATTRIBUTE_VALUE_UNQUOTED = 37] = "ATTRIBUTE_VALUE_UNQUOTED", w[w.AFTER_ATTRIBUTE_VALUE_QUOTED = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED", w[w.SELF_CLOSING_START_TAG = 39] = "SELF_CLOSING_START_TAG", w[w.BOGUS_COMMENT = 40] = "BOGUS_COMMENT", w[w.MARKUP_DECLARATION_OPEN = 41] = "MARKUP_DECLARATION_OPEN", w[w.COMMENT_START = 42] = "COMMENT_START", w[w.COMMENT_START_DASH = 43] = "COMMENT_START_DASH", w[w.COMMENT = 44] = "COMMENT", w[w.COMMENT_LESS_THAN_SIGN = 45] = "COMMENT_LESS_THAN_SIGN", w[w.COMMENT_LESS_THAN_SIGN_BANG = 46] = "COMMENT_LESS_THAN_SIGN_BANG", w[w.COMMENT_LESS_THAN_SIGN_BANG_DASH = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH", w[w.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH", w[w.COMMENT_END_DASH = 49] = "COMMENT_END_DASH", w[w.COMMENT_END = 50] = "COMMENT_END", w[w.COMMENT_END_BANG = 51] = "COMMENT_END_BANG", w[w.DOCTYPE = 52] = "DOCTYPE", w[w.BEFORE_DOCTYPE_NAME = 53] = "BEFORE_DOCTYPE_NAME", w[w.DOCTYPE_NAME = 54] = "DOCTYPE_NAME", w[w.AFTER_DOCTYPE_NAME = 55] = "AFTER_DOCTYPE_NAME", w[w.AFTER_DOCTYPE_PUBLIC_KEYWORD = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD", w[w.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER", w[w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED", w[w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED", w[w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER", w[w.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS", w[w.AFTER_DOCTYPE_SYSTEM_KEYWORD = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD", w[w.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER", w[w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED", w[w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED", w[w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER", w[w.BOGUS_DOCTYPE = 67] = "BOGUS_DOCTYPE", w[w.CDATA_SECTION = 68] = "CDATA_SECTION", w[w.CDATA_SECTION_BRACKET = 69] = "CDATA_SECTION_BRACKET", w[w.CDATA_SECTION_END = 70] = "CDATA_SECTION_END", w[w.CHARACTER_REFERENCE = 71] = "CHARACTER_REFERENCE", w[w.AMBIGUOUS_AMPERSAND = 72] = "AMBIGUOUS_AMPERSAND";
    let sz = {
        DATA: eg.DATA,
        RCDATA: eg.RCDATA,
        RAWTEXT: eg.RAWTEXT,
        SCRIPT_DATA: eg.SCRIPT_DATA,
        PLAINTEXT: eg.PLAINTEXT,
        CDATA_SECTION: eg.CDATA_SECTION
    };

    function sJ(e) {
        return e >= en.LATIN_CAPITAL_A && e <= en.LATIN_CAPITAL_Z
    }

    function sZ(e) {
        return e >= en.LATIN_SMALL_A && e <= en.LATIN_SMALL_Z || sJ(e)
    }

    function s$(e) {
        return sZ(e) || e >= en.DIGIT_0 && e <= en.DIGIT_9
    }

    function sX(e) {
        return e === en.SPACE || e === en.LINE_FEED || e === en.TABULATION || e === en.FORM_FEED
    }

    function s0(e) {
        return sX(e) || e === en.SOLIDUS || e === en.GREATER_THAN_SIGN
    }
    class s1 {
        constructor(e, t) {
            this.options = e, this.handler = t, this.paused = !1, this.inLoop = !1, this.inForeignNode = !1, this.lastStartTagName = "", this.active = !1, this.state = eg.DATA, this.returnState = eg.DATA, this.entityStartPos = 0, this.consumedAfterSnapshot = -1, this.currentCharacterToken = null, this.currentToken = null, this.currentAttr = {
                name: "",
                value: ""
            }, this.preprocessor = new sB(t), this.currentLocation = this.getCurrentLocation(-1), this.entityDecoder = new sH(sF, (e, t) => {
                this.preprocessor.pos = this.entityStartPos + t - 1, this._flushCodePointConsumedAsCharacterReference(e)
            }, t.onParseError ? {
                missingSemicolonAfterCharacterReference: () => {
                    this._err(ei.missingSemicolonAfterCharacterReference, 1)
                },
                absenceOfDigitsInNumericCharacterReference: e => {
                    this._err(ei.absenceOfDigitsInNumericCharacterReference, this.entityStartPos - this.preprocessor.pos + e)
                },
                validateNumericCharacterReference: e => {
                    let t = function(e) {
                        if (e === en.NULL) return ei.nullCharacterReference;
                        if (e > 1114111) return ei.characterReferenceOutsideUnicodeRange;
                        if (sR(e)) return ei.surrogateCharacterReference;
                        if (sL(e)) return ei.noncharacterCharacterReference;
                        if (sM(e) || e === en.CARRIAGE_RETURN) return ei.controlCharacterReference;
                        return null
                    }(e);
                    t && this._err(t, 1)
                }
            } : void 0)
        }
        _err(e, t = 0) {
            var r, a;
            null == (a = (r = this.handler).onParseError) || a.call(r, this.preprocessor.getError(e, t))
        }
        getCurrentLocation(e) {
            return this.options.sourceCodeLocationInfo ? {
                startLine: this.preprocessor.line,
                startCol: this.preprocessor.col - e,
                startOffset: this.preprocessor.offset - e,
                endLine: -1,
                endCol: -1,
                endOffset: -1
            } : null
        }
        _runParsingLoop() {
            if (!this.inLoop) {
                for (this.inLoop = !0; this.active && !this.paused;) {
                    this.consumedAfterSnapshot = 0;
                    let e = this._consume();
                    this._ensureHibernation() || this._callState(e)
                }
                this.inLoop = !1
            }
        }
        pause() {
            this.paused = !0
        }
        resume(e) {
            if (!this.paused) throw Error("Parser was already resumed");
            this.paused = !1, !this.inLoop && (this._runParsingLoop(), this.paused || null == e || e())
        }
        write(e, t, r) {
            this.active = !0, this.preprocessor.write(e, t), this._runParsingLoop(), this.paused || null == r || r()
        }
        insertHtmlAtCurrentPos(e) {
            this.active = !0, this.preprocessor.insertHtmlAtCurrentPos(e), this._runParsingLoop()
        }
        _ensureHibernation() {
            return !!this.preprocessor.endOfChunkHit && (this.preprocessor.retreat(this.consumedAfterSnapshot), this.consumedAfterSnapshot = 0, this.active = !1, !0)
        }
        _consume() {
            return this.consumedAfterSnapshot++, this.preprocessor.advance()
        }
        _advanceBy(e) {
            this.consumedAfterSnapshot += e;
            for (let t = 0; t < e; t++) this.preprocessor.advance()
        }
        _consumeSequenceIfMatch(e, t) {
            return !!this.preprocessor.startsWith(e, t) && (this._advanceBy(e.length - 1), !0)
        }
        _createStartTagToken() {
            this.currentToken = {
                type: es.START_TAG,
                tagName: "",
                tagID: ef.UNKNOWN,
                selfClosing: !1,
                ackSelfClosing: !1,
                attrs: [],
                location: this.getCurrentLocation(1)
            }
        }
        _createEndTagToken() {
            this.currentToken = {
                type: es.END_TAG,
                tagName: "",
                tagID: ef.UNKNOWN,
                selfClosing: !1,
                ackSelfClosing: !1,
                attrs: [],
                location: this.getCurrentLocation(2)
            }
        }
        _createCommentToken(e) {
            this.currentToken = {
                type: es.COMMENT,
                data: "",
                location: this.getCurrentLocation(e)
            }
        }
        _createDoctypeToken(e) {
            this.currentToken = {
                type: es.DOCTYPE,
                name: e,
                forceQuirks: !1,
                publicId: null,
                systemId: null,
                location: this.currentLocation
            }
        }
        _createCharacterToken(e, t) {
            this.currentCharacterToken = {
                type: e,
                chars: t,
                location: this.currentLocation
            }
        }
        _createAttr(e) {
            this.currentAttr = {
                name: e,
                value: ""
            }, this.currentLocation = this.getCurrentLocation(0)
        }
        _leaveAttrName() {
            var e, t;
            let r = this.currentToken;
            null === sP(r, this.currentAttr.name) ? (r.attrs.push(this.currentAttr), r.location && this.currentLocation && ((null != (e = (t = r.location).attrs) ? e : t.attrs = Object.create(null))[this.currentAttr.name] = this.currentLocation, this._leaveAttrValue())) : this._err(ei.duplicateAttribute)
        }
        _leaveAttrValue() {
            this.currentLocation && (this.currentLocation.endLine = this.preprocessor.line, this.currentLocation.endCol = this.preprocessor.col, this.currentLocation.endOffset = this.preprocessor.offset)
        }
        prepareToken(e) {
            this._emitCurrentCharacterToken(e.location), this.currentToken = null, e.location && (e.location.endLine = this.preprocessor.line, e.location.endCol = this.preprocessor.col + 1, e.location.endOffset = this.preprocessor.offset + 1), this.currentLocation = this.getCurrentLocation(-1)
        }
        emitCurrentTagToken() {
            let e = this.currentToken;
            this.prepareToken(e), e.tagID = sQ(e.tagName), e.type === es.START_TAG ? (this.lastStartTagName = e.tagName, this.handler.onStartTag(e)) : (e.attrs.length > 0 && this._err(ei.endTagWithAttributes), e.selfClosing && this._err(ei.endTagWithTrailingSolidus), this.handler.onEndTag(e)), this.preprocessor.dropParsedChunk()
        }
        emitCurrentComment(e) {
            this.prepareToken(e), this.handler.onComment(e), this.preprocessor.dropParsedChunk()
        }
        emitCurrentDoctype(e) {
            this.prepareToken(e), this.handler.onDoctype(e), this.preprocessor.dropParsedChunk()
        }
        _emitCurrentCharacterToken(e) {
            if (this.currentCharacterToken) {
                switch (e && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = e.startLine, this.currentCharacterToken.location.endCol = e.startCol, this.currentCharacterToken.location.endOffset = e.startOffset), this.currentCharacterToken.type) {
                    case es.CHARACTER:
                        this.handler.onCharacter(this.currentCharacterToken);
                        break;
                    case es.NULL_CHARACTER:
                        this.handler.onNullCharacter(this.currentCharacterToken);
                        break;
                    case es.WHITESPACE_CHARACTER:
                        this.handler.onWhitespaceCharacter(this.currentCharacterToken)
                }
                this.currentCharacterToken = null
            }
        }
        _emitEOFToken() {
            let e = this.getCurrentLocation(0);
            e && (e.endLine = e.startLine, e.endCol = e.startCol, e.endOffset = e.startOffset), this._emitCurrentCharacterToken(e), this.handler.onEof({
                type: es.EOF,
                location: e
            }), this.active = !1
        }
        _appendCharToCurrentCharacterToken(e, t) {
            if (this.currentCharacterToken)
                if (this.currentCharacterToken.type === e) {
                    this.currentCharacterToken.chars += t;
                    return
                } else this.currentLocation = this.getCurrentLocation(0), this._emitCurrentCharacterToken(this.currentLocation), this.preprocessor.dropParsedChunk();
            this._createCharacterToken(e, t)
        }
        _emitCodePoint(e) {
            let t = sX(e) ? es.WHITESPACE_CHARACTER : e === en.NULL ? es.NULL_CHARACTER : es.CHARACTER;
            this._appendCharToCurrentCharacterToken(t, String.fromCodePoint(e))
        }
        _emitChars(e) {
            this._appendCharToCurrentCharacterToken(es.CHARACTER, e)
        }
        _startCharacterReference() {
            this.returnState = this.state, this.state = eg.CHARACTER_REFERENCE, this.entityStartPos = this.preprocessor.pos, this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute() ? ed.Attribute : ed.Legacy)
        }
        _isCharacterReferenceInAttribute() {
            return this.returnState === eg.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === eg.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === eg.ATTRIBUTE_VALUE_UNQUOTED
        }
        _flushCodePointConsumedAsCharacterReference(e) {
            this._isCharacterReferenceInAttribute() ? this.currentAttr.value += String.fromCodePoint(e) : this._emitCodePoint(e)
        }
        _callState(e) {
            switch (this.state) {
                case eg.DATA:
                    this._stateData(e);
                    break;
                case eg.RCDATA:
                    this._stateRcdata(e);
                    break;
                case eg.RAWTEXT:
                    this._stateRawtext(e);
                    break;
                case eg.SCRIPT_DATA:
                    this._stateScriptData(e);
                    break;
                case eg.PLAINTEXT:
                    this._statePlaintext(e);
                    break;
                case eg.TAG_OPEN:
                    this._stateTagOpen(e);
                    break;
                case eg.END_TAG_OPEN:
                    this._stateEndTagOpen(e);
                    break;
                case eg.TAG_NAME:
                    this._stateTagName(e);
                    break;
                case eg.RCDATA_LESS_THAN_SIGN:
                    this._stateRcdataLessThanSign(e);
                    break;
                case eg.RCDATA_END_TAG_OPEN:
                    this._stateRcdataEndTagOpen(e);
                    break;
                case eg.RCDATA_END_TAG_NAME:
                    this._stateRcdataEndTagName(e);
                    break;
                case eg.RAWTEXT_LESS_THAN_SIGN:
                    this._stateRawtextLessThanSign(e);
                    break;
                case eg.RAWTEXT_END_TAG_OPEN:
                    this._stateRawtextEndTagOpen(e);
                    break;
                case eg.RAWTEXT_END_TAG_NAME:
                    this._stateRawtextEndTagName(e);
                    break;
                case eg.SCRIPT_DATA_LESS_THAN_SIGN:
                    this._stateScriptDataLessThanSign(e);
                    break;
                case eg.SCRIPT_DATA_END_TAG_OPEN:
                    this._stateScriptDataEndTagOpen(e);
                    break;
                case eg.SCRIPT_DATA_END_TAG_NAME:
                    this._stateScriptDataEndTagName(e);
                    break;
                case eg.SCRIPT_DATA_ESCAPE_START:
                    this._stateScriptDataEscapeStart(e);
                    break;
                case eg.SCRIPT_DATA_ESCAPE_START_DASH:
                    this._stateScriptDataEscapeStartDash(e);
                    break;
                case eg.SCRIPT_DATA_ESCAPED:
                    this._stateScriptDataEscaped(e);
                    break;
                case eg.SCRIPT_DATA_ESCAPED_DASH:
                    this._stateScriptDataEscapedDash(e);
                    break;
                case eg.SCRIPT_DATA_ESCAPED_DASH_DASH:
                    this._stateScriptDataEscapedDashDash(e);
                    break;
                case eg.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:
                    this._stateScriptDataEscapedLessThanSign(e);
                    break;
                case eg.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:
                    this._stateScriptDataEscapedEndTagOpen(e);
                    break;
                case eg.SCRIPT_DATA_ESCAPED_END_TAG_NAME:
                    this._stateScriptDataEscapedEndTagName(e);
                    break;
                case eg.SCRIPT_DATA_DOUBLE_ESCAPE_START:
                    this._stateScriptDataDoubleEscapeStart(e);
                    break;
                case eg.SCRIPT_DATA_DOUBLE_ESCAPED:
                    this._stateScriptDataDoubleEscaped(e);
                    break;
                case eg.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:
                    this._stateScriptDataDoubleEscapedDash(e);
                    break;
                case eg.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:
                    this._stateScriptDataDoubleEscapedDashDash(e);
                    break;
                case eg.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:
                    this._stateScriptDataDoubleEscapedLessThanSign(e);
                    break;
                case eg.SCRIPT_DATA_DOUBLE_ESCAPE_END:
                    this._stateScriptDataDoubleEscapeEnd(e);
                    break;
                case eg.BEFORE_ATTRIBUTE_NAME:
                    this._stateBeforeAttributeName(e);
                    break;
                case eg.ATTRIBUTE_NAME:
                    this._stateAttributeName(e);
                    break;
                case eg.AFTER_ATTRIBUTE_NAME:
                    this._stateAfterAttributeName(e);
                    break;
                case eg.BEFORE_ATTRIBUTE_VALUE:
                    this._stateBeforeAttributeValue(e);
                    break;
                case eg.ATTRIBUTE_VALUE_DOUBLE_QUOTED:
                    this._stateAttributeValueDoubleQuoted(e);
                    break;
                case eg.ATTRIBUTE_VALUE_SINGLE_QUOTED:
                    this._stateAttributeValueSingleQuoted(e);
                    break;
                case eg.ATTRIBUTE_VALUE_UNQUOTED:
                    this._stateAttributeValueUnquoted(e);
                    break;
                case eg.AFTER_ATTRIBUTE_VALUE_QUOTED:
                    this._stateAfterAttributeValueQuoted(e);
                    break;
                case eg.SELF_CLOSING_START_TAG:
                    this._stateSelfClosingStartTag(e);
                    break;
                case eg.BOGUS_COMMENT:
                    this._stateBogusComment(e);
                    break;
                case eg.MARKUP_DECLARATION_OPEN:
                    this._stateMarkupDeclarationOpen(e);
                    break;
                case eg.COMMENT_START:
                    this._stateCommentStart(e);
                    break;
                case eg.COMMENT_START_DASH:
                    this._stateCommentStartDash(e);
                    break;
                case eg.COMMENT:
                    this._stateComment(e);
                    break;
                case eg.COMMENT_LESS_THAN_SIGN:
                    this._stateCommentLessThanSign(e);
                    break;
                case eg.COMMENT_LESS_THAN_SIGN_BANG:
                    this._stateCommentLessThanSignBang(e);
                    break;
                case eg.COMMENT_LESS_THAN_SIGN_BANG_DASH:
                    this._stateCommentLessThanSignBangDash(e);
                    break;
                case eg.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:
                    this._stateCommentLessThanSignBangDashDash(e);
                    break;
                case eg.COMMENT_END_DASH:
                    this._stateCommentEndDash(e);
                    break;
                case eg.COMMENT_END:
                    this._stateCommentEnd(e);
                    break;
                case eg.COMMENT_END_BANG:
                    this._stateCommentEndBang(e);
                    break;
                case eg.DOCTYPE:
                    this._stateDoctype(e);
                    break;
                case eg.BEFORE_DOCTYPE_NAME:
                    this._stateBeforeDoctypeName(e);
                    break;
                case eg.DOCTYPE_NAME:
                    this._stateDoctypeName(e);
                    break;
                case eg.AFTER_DOCTYPE_NAME:
                    this._stateAfterDoctypeName(e);
                    break;
                case eg.AFTER_DOCTYPE_PUBLIC_KEYWORD:
                    this._stateAfterDoctypePublicKeyword(e);
                    break;
                case eg.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:
                    this._stateBeforeDoctypePublicIdentifier(e);
                    break;
                case eg.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:
                    this._stateDoctypePublicIdentifierDoubleQuoted(e);
                    break;
                case eg.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:
                    this._stateDoctypePublicIdentifierSingleQuoted(e);
                    break;
                case eg.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:
                    this._stateAfterDoctypePublicIdentifier(e);
                    break;
                case eg.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:
                    this._stateBetweenDoctypePublicAndSystemIdentifiers(e);
                    break;
                case eg.AFTER_DOCTYPE_SYSTEM_KEYWORD:
                    this._stateAfterDoctypeSystemKeyword(e);
                    break;
                case eg.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:
                    this._stateBeforeDoctypeSystemIdentifier(e);
                    break;
                case eg.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:
                    this._stateDoctypeSystemIdentifierDoubleQuoted(e);
                    break;
                case eg.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:
                    this._stateDoctypeSystemIdentifierSingleQuoted(e);
                    break;
                case eg.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:
                    this._stateAfterDoctypeSystemIdentifier(e);
                    break;
                case eg.BOGUS_DOCTYPE:
                    this._stateBogusDoctype(e);
                    break;
                case eg.CDATA_SECTION:
                    this._stateCdataSection(e);
                    break;
                case eg.CDATA_SECTION_BRACKET:
                    this._stateCdataSectionBracket(e);
                    break;
                case eg.CDATA_SECTION_END:
                    this._stateCdataSectionEnd(e);
                    break;
                case eg.CHARACTER_REFERENCE:
                    this._stateCharacterReference();
                    break;
                case eg.AMBIGUOUS_AMPERSAND:
                    this._stateAmbiguousAmpersand(e);
                    break;
                default:
                    throw Error("Unknown state")
            }
        }
        _stateData(e) {
            switch (e) {
                case en.LESS_THAN_SIGN:
                    this.state = eg.TAG_OPEN;
                    break;
                case en.AMPERSAND:
                    this._startCharacterReference();
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this._emitCodePoint(e);
                    break;
                case en.EOF:
                    this._emitEOFToken();
                    break;
                default:
                    this._emitCodePoint(e)
            }
        }
        _stateRcdata(e) {
            switch (e) {
                case en.AMPERSAND:
                    this._startCharacterReference();
                    break;
                case en.LESS_THAN_SIGN:
                    this.state = eg.RCDATA_LESS_THAN_SIGN;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this._emitChars("�");
                    break;
                case en.EOF:
                    this._emitEOFToken();
                    break;
                default:
                    this._emitCodePoint(e)
            }
        }
        _stateRawtext(e) {
            switch (e) {
                case en.LESS_THAN_SIGN:
                    this.state = eg.RAWTEXT_LESS_THAN_SIGN;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this._emitChars("�");
                    break;
                case en.EOF:
                    this._emitEOFToken();
                    break;
                default:
                    this._emitCodePoint(e)
            }
        }
        _stateScriptData(e) {
            switch (e) {
                case en.LESS_THAN_SIGN:
                    this.state = eg.SCRIPT_DATA_LESS_THAN_SIGN;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this._emitChars("�");
                    break;
                case en.EOF:
                    this._emitEOFToken();
                    break;
                default:
                    this._emitCodePoint(e)
            }
        }
        _statePlaintext(e) {
            switch (e) {
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this._emitChars("�");
                    break;
                case en.EOF:
                    this._emitEOFToken();
                    break;
                default:
                    this._emitCodePoint(e)
            }
        }
        _stateTagOpen(e) {
            if (sZ(e)) this._createStartTagToken(), this.state = eg.TAG_NAME, this._stateTagName(e);
            else switch (e) {
                case en.EXCLAMATION_MARK:
                    this.state = eg.MARKUP_DECLARATION_OPEN;
                    break;
                case en.SOLIDUS:
                    this.state = eg.END_TAG_OPEN;
                    break;
                case en.QUESTION_MARK:
                    this._err(ei.unexpectedQuestionMarkInsteadOfTagName), this._createCommentToken(1), this.state = eg.BOGUS_COMMENT, this._stateBogusComment(e);
                    break;
                case en.EOF:
                    this._err(ei.eofBeforeTagName), this._emitChars("<"), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.invalidFirstCharacterOfTagName), this._emitChars("<"), this.state = eg.DATA, this._stateData(e)
            }
        }
        _stateEndTagOpen(e) {
            if (sZ(e)) this._createEndTagToken(), this.state = eg.TAG_NAME, this._stateTagName(e);
            else switch (e) {
                case en.GREATER_THAN_SIGN:
                    this._err(ei.missingEndTagName), this.state = eg.DATA;
                    break;
                case en.EOF:
                    this._err(ei.eofBeforeTagName), this._emitChars("</"), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.invalidFirstCharacterOfTagName), this._createCommentToken(2), this.state = eg.BOGUS_COMMENT, this._stateBogusComment(e)
            }
        }
        _stateTagName(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    this.state = eg.BEFORE_ATTRIBUTE_NAME;
                    break;
                case en.SOLIDUS:
                    this.state = eg.SELF_CLOSING_START_TAG;
                    break;
                case en.GREATER_THAN_SIGN:
                    this.state = eg.DATA, this.emitCurrentTagToken();
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), t.tagName += "�";
                    break;
                case en.EOF:
                    this._err(ei.eofInTag), this._emitEOFToken();
                    break;
                default:
                    t.tagName += String.fromCodePoint(sJ(e) ? e + 32 : e)
            }
        }
        _stateRcdataLessThanSign(e) {
            e === en.SOLIDUS ? this.state = eg.RCDATA_END_TAG_OPEN : (this._emitChars("<"), this.state = eg.RCDATA, this._stateRcdata(e))
        }
        _stateRcdataEndTagOpen(e) {
            sZ(e) ? (this.state = eg.RCDATA_END_TAG_NAME, this._stateRcdataEndTagName(e)) : (this._emitChars("</"), this.state = eg.RCDATA, this._stateRcdata(e))
        }
        handleSpecialEndTag(e) {
            if (!this.preprocessor.startsWith(this.lastStartTagName, !1)) return !this._ensureHibernation();
            switch (this._createEndTagToken(), this.currentToken.tagName = this.lastStartTagName, this.preprocessor.peek(this.lastStartTagName.length)) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    return this._advanceBy(this.lastStartTagName.length), this.state = eg.BEFORE_ATTRIBUTE_NAME, !1;
                case en.SOLIDUS:
                    return this._advanceBy(this.lastStartTagName.length), this.state = eg.SELF_CLOSING_START_TAG, !1;
                case en.GREATER_THAN_SIGN:
                    return this._advanceBy(this.lastStartTagName.length), this.emitCurrentTagToken(), this.state = eg.DATA, !1;
                default:
                    return !this._ensureHibernation()
            }
        }
        _stateRcdataEndTagName(e) {
            this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = eg.RCDATA, this._stateRcdata(e))
        }
        _stateRawtextLessThanSign(e) {
            e === en.SOLIDUS ? this.state = eg.RAWTEXT_END_TAG_OPEN : (this._emitChars("<"), this.state = eg.RAWTEXT, this._stateRawtext(e))
        }
        _stateRawtextEndTagOpen(e) {
            sZ(e) ? (this.state = eg.RAWTEXT_END_TAG_NAME, this._stateRawtextEndTagName(e)) : (this._emitChars("</"), this.state = eg.RAWTEXT, this._stateRawtext(e))
        }
        _stateRawtextEndTagName(e) {
            this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = eg.RAWTEXT, this._stateRawtext(e))
        }
        _stateScriptDataLessThanSign(e) {
            switch (e) {
                case en.SOLIDUS:
                    this.state = eg.SCRIPT_DATA_END_TAG_OPEN;
                    break;
                case en.EXCLAMATION_MARK:
                    this.state = eg.SCRIPT_DATA_ESCAPE_START, this._emitChars("<!");
                    break;
                default:
                    this._emitChars("<"), this.state = eg.SCRIPT_DATA, this._stateScriptData(e)
            }
        }
        _stateScriptDataEndTagOpen(e) {
            sZ(e) ? (this.state = eg.SCRIPT_DATA_END_TAG_NAME, this._stateScriptDataEndTagName(e)) : (this._emitChars("</"), this.state = eg.SCRIPT_DATA, this._stateScriptData(e))
        }
        _stateScriptDataEndTagName(e) {
            this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = eg.SCRIPT_DATA, this._stateScriptData(e))
        }
        _stateScriptDataEscapeStart(e) {
            e === en.HYPHEN_MINUS ? (this.state = eg.SCRIPT_DATA_ESCAPE_START_DASH, this._emitChars("-")) : (this.state = eg.SCRIPT_DATA, this._stateScriptData(e))
        }
        _stateScriptDataEscapeStartDash(e) {
            e === en.HYPHEN_MINUS ? (this.state = eg.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-")) : (this.state = eg.SCRIPT_DATA, this._stateScriptData(e))
        }
        _stateScriptDataEscaped(e) {
            switch (e) {
                case en.HYPHEN_MINUS:
                    this.state = eg.SCRIPT_DATA_ESCAPED_DASH, this._emitChars("-");
                    break;
                case en.LESS_THAN_SIGN:
                    this.state = eg.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this._emitChars("�");
                    break;
                case en.EOF:
                    this._err(ei.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
                    break;
                default:
                    this._emitCodePoint(e)
            }
        }
        _stateScriptDataEscapedDash(e) {
            switch (e) {
                case en.HYPHEN_MINUS:
                    this.state = eg.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-");
                    break;
                case en.LESS_THAN_SIGN:
                    this.state = eg.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this.state = eg.SCRIPT_DATA_ESCAPED, this._emitChars("�");
                    break;
                case en.EOF:
                    this._err(ei.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
                    break;
                default:
                    this.state = eg.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e)
            }
        }
        _stateScriptDataEscapedDashDash(e) {
            switch (e) {
                case en.HYPHEN_MINUS:
                    this._emitChars("-");
                    break;
                case en.LESS_THAN_SIGN:
                    this.state = eg.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
                    break;
                case en.GREATER_THAN_SIGN:
                    this.state = eg.SCRIPT_DATA, this._emitChars(">");
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this.state = eg.SCRIPT_DATA_ESCAPED, this._emitChars("�");
                    break;
                case en.EOF:
                    this._err(ei.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
                    break;
                default:
                    this.state = eg.SCRIPT_DATA_ESCAPED, this._emitCodePoint(e)
            }
        }
        _stateScriptDataEscapedLessThanSign(e) {
            e === en.SOLIDUS ? this.state = eg.SCRIPT_DATA_ESCAPED_END_TAG_OPEN : sZ(e) ? (this._emitChars("<"), this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPE_START, this._stateScriptDataDoubleEscapeStart(e)) : (this._emitChars("<"), this.state = eg.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e))
        }
        _stateScriptDataEscapedEndTagOpen(e) {
            sZ(e) ? (this.state = eg.SCRIPT_DATA_ESCAPED_END_TAG_NAME, this._stateScriptDataEscapedEndTagName(e)) : (this._emitChars("</"), this.state = eg.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e))
        }
        _stateScriptDataEscapedEndTagName(e) {
            this.handleSpecialEndTag(e) && (this._emitChars("</"), this.state = eg.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e))
        }
        _stateScriptDataDoubleEscapeStart(e) {
            if (this.preprocessor.startsWith(sO, !1) && s0(this.preprocessor.peek(sO.length))) {
                this._emitCodePoint(e);
                for (let e = 0; e < sO.length; e++) this._emitCodePoint(this._consume());
                this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED
            } else this._ensureHibernation() || (this.state = eg.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(e))
        }
        _stateScriptDataDoubleEscaped(e) {
            switch (e) {
                case en.HYPHEN_MINUS:
                    this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED_DASH, this._emitChars("-");
                    break;
                case en.LESS_THAN_SIGN:
                    this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this._emitChars("�");
                    break;
                case en.EOF:
                    this._err(ei.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
                    break;
                default:
                    this._emitCodePoint(e)
            }
        }
        _stateScriptDataDoubleEscapedDash(e) {
            switch (e) {
                case en.HYPHEN_MINUS:
                    this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH, this._emitChars("-");
                    break;
                case en.LESS_THAN_SIGN:
                    this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars("�");
                    break;
                case en.EOF:
                    this._err(ei.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
                    break;
                default:
                    this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e)
            }
        }
        _stateScriptDataDoubleEscapedDashDash(e) {
            switch (e) {
                case en.HYPHEN_MINUS:
                    this._emitChars("-");
                    break;
                case en.LESS_THAN_SIGN:
                    this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
                    break;
                case en.GREATER_THAN_SIGN:
                    this.state = eg.SCRIPT_DATA, this._emitChars(">");
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars("�");
                    break;
                case en.EOF:
                    this._err(ei.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
                    break;
                default:
                    this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(e)
            }
        }
        _stateScriptDataDoubleEscapedLessThanSign(e) {
            e === en.SOLIDUS ? (this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPE_END, this._emitChars("/")) : (this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e))
        }
        _stateScriptDataDoubleEscapeEnd(e) {
            if (this.preprocessor.startsWith(sO, !1) && s0(this.preprocessor.peek(sO.length))) {
                this._emitCodePoint(e);
                for (let e = 0; e < sO.length; e++) this._emitCodePoint(this._consume());
                this.state = eg.SCRIPT_DATA_ESCAPED
            } else this._ensureHibernation() || (this.state = eg.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(e))
        }
        _stateBeforeAttributeName(e) {
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    break;
                case en.SOLIDUS:
                case en.GREATER_THAN_SIGN:
                case en.EOF:
                    this.state = eg.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e);
                    break;
                case en.EQUALS_SIGN:
                    this._err(ei.unexpectedEqualsSignBeforeAttributeName), this._createAttr("="), this.state = eg.ATTRIBUTE_NAME;
                    break;
                default:
                    this._createAttr(""), this.state = eg.ATTRIBUTE_NAME, this._stateAttributeName(e)
            }
        }
        _stateAttributeName(e) {
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                case en.SOLIDUS:
                case en.GREATER_THAN_SIGN:
                case en.EOF:
                    this._leaveAttrName(), this.state = eg.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(e);
                    break;
                case en.EQUALS_SIGN:
                    this._leaveAttrName(), this.state = eg.BEFORE_ATTRIBUTE_VALUE;
                    break;
                case en.QUOTATION_MARK:
                case en.APOSTROPHE:
                case en.LESS_THAN_SIGN:
                    this._err(ei.unexpectedCharacterInAttributeName), this.currentAttr.name += String.fromCodePoint(e);
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this.currentAttr.name += "�";
                    break;
                default:
                    this.currentAttr.name += String.fromCodePoint(sJ(e) ? e + 32 : e)
            }
        }
        _stateAfterAttributeName(e) {
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    break;
                case en.SOLIDUS:
                    this.state = eg.SELF_CLOSING_START_TAG;
                    break;
                case en.EQUALS_SIGN:
                    this.state = eg.BEFORE_ATTRIBUTE_VALUE;
                    break;
                case en.GREATER_THAN_SIGN:
                    this.state = eg.DATA, this.emitCurrentTagToken();
                    break;
                case en.EOF:
                    this._err(ei.eofInTag), this._emitEOFToken();
                    break;
                default:
                    this._createAttr(""), this.state = eg.ATTRIBUTE_NAME, this._stateAttributeName(e)
            }
        }
        _stateBeforeAttributeValue(e) {
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    break;
                case en.QUOTATION_MARK:
                    this.state = eg.ATTRIBUTE_VALUE_DOUBLE_QUOTED;
                    break;
                case en.APOSTROPHE:
                    this.state = eg.ATTRIBUTE_VALUE_SINGLE_QUOTED;
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.missingAttributeValue), this.state = eg.DATA, this.emitCurrentTagToken();
                    break;
                default:
                    this.state = eg.ATTRIBUTE_VALUE_UNQUOTED, this._stateAttributeValueUnquoted(e)
            }
        }
        _stateAttributeValueDoubleQuoted(e) {
            switch (e) {
                case en.QUOTATION_MARK:
                    this.state = eg.AFTER_ATTRIBUTE_VALUE_QUOTED;
                    break;
                case en.AMPERSAND:
                    this._startCharacterReference();
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this.currentAttr.value += "�";
                    break;
                case en.EOF:
                    this._err(ei.eofInTag), this._emitEOFToken();
                    break;
                default:
                    this.currentAttr.value += String.fromCodePoint(e)
            }
        }
        _stateAttributeValueSingleQuoted(e) {
            switch (e) {
                case en.APOSTROPHE:
                    this.state = eg.AFTER_ATTRIBUTE_VALUE_QUOTED;
                    break;
                case en.AMPERSAND:
                    this._startCharacterReference();
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this.currentAttr.value += "�";
                    break;
                case en.EOF:
                    this._err(ei.eofInTag), this._emitEOFToken();
                    break;
                default:
                    this.currentAttr.value += String.fromCodePoint(e)
            }
        }
        _stateAttributeValueUnquoted(e) {
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    this._leaveAttrValue(), this.state = eg.BEFORE_ATTRIBUTE_NAME;
                    break;
                case en.AMPERSAND:
                    this._startCharacterReference();
                    break;
                case en.GREATER_THAN_SIGN:
                    this._leaveAttrValue(), this.state = eg.DATA, this.emitCurrentTagToken();
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this.currentAttr.value += "�";
                    break;
                case en.QUOTATION_MARK:
                case en.APOSTROPHE:
                case en.LESS_THAN_SIGN:
                case en.EQUALS_SIGN:
                case en.GRAVE_ACCENT:
                    this._err(ei.unexpectedCharacterInUnquotedAttributeValue), this.currentAttr.value += String.fromCodePoint(e);
                    break;
                case en.EOF:
                    this._err(ei.eofInTag), this._emitEOFToken();
                    break;
                default:
                    this.currentAttr.value += String.fromCodePoint(e)
            }
        }
        _stateAfterAttributeValueQuoted(e) {
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    this._leaveAttrValue(), this.state = eg.BEFORE_ATTRIBUTE_NAME;
                    break;
                case en.SOLIDUS:
                    this._leaveAttrValue(), this.state = eg.SELF_CLOSING_START_TAG;
                    break;
                case en.GREATER_THAN_SIGN:
                    this._leaveAttrValue(), this.state = eg.DATA, this.emitCurrentTagToken();
                    break;
                case en.EOF:
                    this._err(ei.eofInTag), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.missingWhitespaceBetweenAttributes), this.state = eg.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e)
            }
        }
        _stateSelfClosingStartTag(e) {
            switch (e) {
                case en.GREATER_THAN_SIGN:
                    this.currentToken.selfClosing = !0, this.state = eg.DATA, this.emitCurrentTagToken();
                    break;
                case en.EOF:
                    this._err(ei.eofInTag), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.unexpectedSolidusInTag), this.state = eg.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(e)
            }
        }
        _stateBogusComment(e) {
            let t = this.currentToken;
            switch (e) {
                case en.GREATER_THAN_SIGN:
                    this.state = eg.DATA, this.emitCurrentComment(t);
                    break;
                case en.EOF:
                    this.emitCurrentComment(t), this._emitEOFToken();
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), t.data += "�";
                    break;
                default:
                    t.data += String.fromCodePoint(e)
            }
        }
        _stateMarkupDeclarationOpen(e) {
            this._consumeSequenceIfMatch("--", !0) ? (this._createCommentToken(3), this.state = eg.COMMENT_START) : this._consumeSequenceIfMatch(sw, !1) ? (this.currentLocation = this.getCurrentLocation(sw.length + 1), this.state = eg.DOCTYPE) : this._consumeSequenceIfMatch(sv, !0) ? this.inForeignNode ? this.state = eg.CDATA_SECTION : (this._err(ei.cdataInHtmlContent), this._createCommentToken(sv.length + 1), this.currentToken.data = "[CDATA[", this.state = eg.BOGUS_COMMENT) : this._ensureHibernation() || (this._err(ei.incorrectlyOpenedComment), this._createCommentToken(2), this.state = eg.BOGUS_COMMENT, this._stateBogusComment(e))
        }
        _stateCommentStart(e) {
            switch (e) {
                case en.HYPHEN_MINUS:
                    this.state = eg.COMMENT_START_DASH;
                    break;
                case en.GREATER_THAN_SIGN:
                    {
                        this._err(ei.abruptClosingOfEmptyComment),
                        this.state = eg.DATA;
                        let e = this.currentToken;this.emitCurrentComment(e);
                        break
                    }
                default:
                    this.state = eg.COMMENT, this._stateComment(e)
            }
        }
        _stateCommentStartDash(e) {
            let t = this.currentToken;
            switch (e) {
                case en.HYPHEN_MINUS:
                    this.state = eg.COMMENT_END;
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.abruptClosingOfEmptyComment), this.state = eg.DATA, this.emitCurrentComment(t);
                    break;
                case en.EOF:
                    this._err(ei.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
                    break;
                default:
                    t.data += "-", this.state = eg.COMMENT, this._stateComment(e)
            }
        }
        _stateComment(e) {
            let t = this.currentToken;
            switch (e) {
                case en.HYPHEN_MINUS:
                    this.state = eg.COMMENT_END_DASH;
                    break;
                case en.LESS_THAN_SIGN:
                    t.data += "<", this.state = eg.COMMENT_LESS_THAN_SIGN;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), t.data += "�";
                    break;
                case en.EOF:
                    this._err(ei.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
                    break;
                default:
                    t.data += String.fromCodePoint(e)
            }
        }
        _stateCommentLessThanSign(e) {
            let t = this.currentToken;
            switch (e) {
                case en.EXCLAMATION_MARK:
                    t.data += "!", this.state = eg.COMMENT_LESS_THAN_SIGN_BANG;
                    break;
                case en.LESS_THAN_SIGN:
                    t.data += "<";
                    break;
                default:
                    this.state = eg.COMMENT, this._stateComment(e)
            }
        }
        _stateCommentLessThanSignBang(e) {
            e === en.HYPHEN_MINUS ? this.state = eg.COMMENT_LESS_THAN_SIGN_BANG_DASH : (this.state = eg.COMMENT, this._stateComment(e))
        }
        _stateCommentLessThanSignBangDash(e) {
            e === en.HYPHEN_MINUS ? this.state = eg.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH : (this.state = eg.COMMENT_END_DASH, this._stateCommentEndDash(e))
        }
        _stateCommentLessThanSignBangDashDash(e) {
            e !== en.GREATER_THAN_SIGN && e !== en.EOF && this._err(ei.nestedComment), this.state = eg.COMMENT_END, this._stateCommentEnd(e)
        }
        _stateCommentEndDash(e) {
            let t = this.currentToken;
            switch (e) {
                case en.HYPHEN_MINUS:
                    this.state = eg.COMMENT_END;
                    break;
                case en.EOF:
                    this._err(ei.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
                    break;
                default:
                    t.data += "-", this.state = eg.COMMENT, this._stateComment(e)
            }
        }
        _stateCommentEnd(e) {
            let t = this.currentToken;
            switch (e) {
                case en.GREATER_THAN_SIGN:
                    this.state = eg.DATA, this.emitCurrentComment(t);
                    break;
                case en.EXCLAMATION_MARK:
                    this.state = eg.COMMENT_END_BANG;
                    break;
                case en.HYPHEN_MINUS:
                    t.data += "-";
                    break;
                case en.EOF:
                    this._err(ei.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
                    break;
                default:
                    t.data += "--", this.state = eg.COMMENT, this._stateComment(e)
            }
        }
        _stateCommentEndBang(e) {
            let t = this.currentToken;
            switch (e) {
                case en.HYPHEN_MINUS:
                    t.data += "--!", this.state = eg.COMMENT_END_DASH;
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.incorrectlyClosedComment), this.state = eg.DATA, this.emitCurrentComment(t);
                    break;
                case en.EOF:
                    this._err(ei.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
                    break;
                default:
                    t.data += "--!", this.state = eg.COMMENT, this._stateComment(e)
            }
        }
        _stateDoctype(e) {
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    this.state = eg.BEFORE_DOCTYPE_NAME;
                    break;
                case en.GREATER_THAN_SIGN:
                    this.state = eg.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e);
                    break;
                case en.EOF:
                    {
                        this._err(ei.eofInDoctype),
                        this._createDoctypeToken(null);
                        let e = this.currentToken;e.forceQuirks = !0,
                        this.emitCurrentDoctype(e),
                        this._emitEOFToken();
                        break
                    }
                default:
                    this._err(ei.missingWhitespaceBeforeDoctypeName), this.state = eg.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(e)
            }
        }
        _stateBeforeDoctypeName(e) {
            if (sJ(e)) this._createDoctypeToken(String.fromCharCode(e + 32)), this.state = eg.DOCTYPE_NAME;
            else switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), this._createDoctypeToken("�"), this.state = eg.DOCTYPE_NAME;
                    break;
                case en.GREATER_THAN_SIGN:
                    {
                        this._err(ei.missingDoctypeName),
                        this._createDoctypeToken(null);
                        let e = this.currentToken;e.forceQuirks = !0,
                        this.emitCurrentDoctype(e),
                        this.state = eg.DATA;
                        break
                    }
                case en.EOF:
                    {
                        this._err(ei.eofInDoctype),
                        this._createDoctypeToken(null);
                        let e = this.currentToken;e.forceQuirks = !0,
                        this.emitCurrentDoctype(e),
                        this._emitEOFToken();
                        break
                    }
                default:
                    this._createDoctypeToken(String.fromCodePoint(e)), this.state = eg.DOCTYPE_NAME
            }
        }
        _stateDoctypeName(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    this.state = eg.AFTER_DOCTYPE_NAME;
                    break;
                case en.GREATER_THAN_SIGN:
                    this.state = eg.DATA, this.emitCurrentDoctype(t);
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), t.name += "�";
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    t.name += String.fromCodePoint(sJ(e) ? e + 32 : e)
            }
        }
        _stateAfterDoctypeName(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    break;
                case en.GREATER_THAN_SIGN:
                    this.state = eg.DATA, this.emitCurrentDoctype(t);
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    this._consumeSequenceIfMatch("public", !1) ? this.state = eg.AFTER_DOCTYPE_PUBLIC_KEYWORD : this._consumeSequenceIfMatch("system", !1) ? this.state = eg.AFTER_DOCTYPE_SYSTEM_KEYWORD : this._ensureHibernation() || (this._err(ei.invalidCharacterSequenceAfterDoctypeName), t.forceQuirks = !0, this.state = eg.BOGUS_DOCTYPE, this._stateBogusDoctype(e))
            }
        }
        _stateAfterDoctypePublicKeyword(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    this.state = eg.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;
                    break;
                case en.QUOTATION_MARK:
                    this._err(ei.missingWhitespaceAfterDoctypePublicKeyword), t.publicId = "", this.state = eg.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
                    break;
                case en.APOSTROPHE:
                    this._err(ei.missingWhitespaceAfterDoctypePublicKeyword), t.publicId = "", this.state = eg.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.missingDoctypePublicIdentifier), t.forceQuirks = !0, this.state = eg.DATA, this.emitCurrentDoctype(t);
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.missingQuoteBeforeDoctypePublicIdentifier), t.forceQuirks = !0, this.state = eg.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
            }
        }
        _stateBeforeDoctypePublicIdentifier(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    break;
                case en.QUOTATION_MARK:
                    t.publicId = "", this.state = eg.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
                    break;
                case en.APOSTROPHE:
                    t.publicId = "", this.state = eg.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.missingDoctypePublicIdentifier), t.forceQuirks = !0, this.state = eg.DATA, this.emitCurrentDoctype(t);
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.missingQuoteBeforeDoctypePublicIdentifier), t.forceQuirks = !0, this.state = eg.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
            }
        }
        _stateDoctypePublicIdentifierDoubleQuoted(e) {
            let t = this.currentToken;
            switch (e) {
                case en.QUOTATION_MARK:
                    this.state = eg.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), t.publicId += "�";
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.abruptDoctypePublicIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = eg.DATA;
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    t.publicId += String.fromCodePoint(e)
            }
        }
        _stateDoctypePublicIdentifierSingleQuoted(e) {
            let t = this.currentToken;
            switch (e) {
                case en.APOSTROPHE:
                    this.state = eg.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), t.publicId += "�";
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.abruptDoctypePublicIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = eg.DATA;
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    t.publicId += String.fromCodePoint(e)
            }
        }
        _stateAfterDoctypePublicIdentifier(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    this.state = eg.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;
                    break;
                case en.GREATER_THAN_SIGN:
                    this.state = eg.DATA, this.emitCurrentDoctype(t);
                    break;
                case en.QUOTATION_MARK:
                    this._err(ei.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t.systemId = "", this.state = eg.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
                    break;
                case en.APOSTROPHE:
                    this._err(ei.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t.systemId = "", this.state = eg.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = eg.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
            }
        }
        _stateBetweenDoctypePublicAndSystemIdentifiers(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    break;
                case en.GREATER_THAN_SIGN:
                    this.emitCurrentDoctype(t), this.state = eg.DATA;
                    break;
                case en.QUOTATION_MARK:
                    t.systemId = "", this.state = eg.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
                    break;
                case en.APOSTROPHE:
                    t.systemId = "", this.state = eg.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = eg.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
            }
        }
        _stateAfterDoctypeSystemKeyword(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    this.state = eg.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;
                    break;
                case en.QUOTATION_MARK:
                    this._err(ei.missingWhitespaceAfterDoctypeSystemKeyword), t.systemId = "", this.state = eg.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
                    break;
                case en.APOSTROPHE:
                    this._err(ei.missingWhitespaceAfterDoctypeSystemKeyword), t.systemId = "", this.state = eg.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.missingDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = eg.DATA, this.emitCurrentDoctype(t);
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = eg.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
            }
        }
        _stateBeforeDoctypeSystemIdentifier(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    break;
                case en.QUOTATION_MARK:
                    t.systemId = "", this.state = eg.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
                    break;
                case en.APOSTROPHE:
                    t.systemId = "", this.state = eg.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.missingDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = eg.DATA, this.emitCurrentDoctype(t);
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = eg.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
            }
        }
        _stateDoctypeSystemIdentifierDoubleQuoted(e) {
            let t = this.currentToken;
            switch (e) {
                case en.QUOTATION_MARK:
                    this.state = eg.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), t.systemId += "�";
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.abruptDoctypeSystemIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = eg.DATA;
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    t.systemId += String.fromCodePoint(e)
            }
        }
        _stateDoctypeSystemIdentifierSingleQuoted(e) {
            let t = this.currentToken;
            switch (e) {
                case en.APOSTROPHE:
                    this.state = eg.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter), t.systemId += "�";
                    break;
                case en.GREATER_THAN_SIGN:
                    this._err(ei.abruptDoctypeSystemIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = eg.DATA;
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    t.systemId += String.fromCodePoint(e)
            }
        }
        _stateAfterDoctypeSystemIdentifier(e) {
            let t = this.currentToken;
            switch (e) {
                case en.SPACE:
                case en.LINE_FEED:
                case en.TABULATION:
                case en.FORM_FEED:
                    break;
                case en.GREATER_THAN_SIGN:
                    this.emitCurrentDoctype(t), this.state = eg.DATA;
                    break;
                case en.EOF:
                    this._err(ei.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
                    break;
                default:
                    this._err(ei.unexpectedCharacterAfterDoctypeSystemIdentifier), this.state = eg.BOGUS_DOCTYPE, this._stateBogusDoctype(e)
            }
        }
        _stateBogusDoctype(e) {
            let t = this.currentToken;
            switch (e) {
                case en.GREATER_THAN_SIGN:
                    this.emitCurrentDoctype(t), this.state = eg.DATA;
                    break;
                case en.NULL:
                    this._err(ei.unexpectedNullCharacter);
                    break;
                case en.EOF:
                    this.emitCurrentDoctype(t), this._emitEOFToken()
            }
        }
        _stateCdataSection(e) {
            switch (e) {
                case en.RIGHT_SQUARE_BRACKET:
                    this.state = eg.CDATA_SECTION_BRACKET;
                    break;
                case en.EOF:
                    this._err(ei.eofInCdata), this._emitEOFToken();
                    break;
                default:
                    this._emitCodePoint(e)
            }
        }
        _stateCdataSectionBracket(e) {
            e === en.RIGHT_SQUARE_BRACKET ? this.state = eg.CDATA_SECTION_END : (this._emitChars("]"), this.state = eg.CDATA_SECTION, this._stateCdataSection(e))
        }
        _stateCdataSectionEnd(e) {
            switch (e) {
                case en.GREATER_THAN_SIGN:
                    this.state = eg.DATA;
                    break;
                case en.RIGHT_SQUARE_BRACKET:
                    this._emitChars("]");
                    break;
                default:
                    this._emitChars("]]"), this.state = eg.CDATA_SECTION, this._stateCdataSection(e)
            }
        }
        _stateCharacterReference() {
            let e = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
            if (e < 0)
                if (this.preprocessor.lastChunkWritten) e = this.entityDecoder.end();
                else {
                    this.active = !1, this.preprocessor.pos = this.preprocessor.html.length - 1, this.consumedAfterSnapshot = 0, this.preprocessor.endOfChunkHit = !0;
                    return
                }
            0 === e ? (this.preprocessor.pos = this.entityStartPos, this._flushCodePointConsumedAsCharacterReference(en.AMPERSAND), this.state = !this._isCharacterReferenceInAttribute() && s$(this.preprocessor.peek(1)) ? eg.AMBIGUOUS_AMPERSAND : this.returnState) : this.state = this.returnState
        }
        _stateAmbiguousAmpersand(e) {
            s$(e) ? this._flushCodePointConsumedAsCharacterReference(e) : (e === en.SEMICOLON && this._err(ei.unknownNamedCharacterReference), this.state = this.returnState, this._callState(e))
        }
    }
    let s2 = new Set([ef.DD, ef.DT, ef.LI, ef.OPTGROUP, ef.OPTION, ef.P, ef.RB, ef.RP, ef.RT, ef.RTC]),
        s5 = new Set([...s2, ef.CAPTION, ef.COLGROUP, ef.TBODY, ef.TD, ef.TFOOT, ef.TH, ef.THEAD, ef.TR]),
        s6 = new Set([ef.APPLET, ef.CAPTION, ef.HTML, ef.MARQUEE, ef.OBJECT, ef.TABLE, ef.TD, ef.TEMPLATE, ef.TH]),
        s3 = new Set([...s6, ef.OL, ef.UL]),
        s4 = new Set([...s6, ef.BUTTON]),
        s8 = new Set([ef.ANNOTATION_XML, ef.MI, ef.MN, ef.MO, ef.MS, ef.MTEXT]),
        s9 = new Set([ef.DESC, ef.FOREIGN_OBJECT, ef.TITLE]),
        s7 = new Set([ef.TR, ef.TEMPLATE, ef.HTML]),
        oe = new Set([ef.TBODY, ef.TFOOT, ef.THEAD, ef.TEMPLATE, ef.HTML]),
        ot = new Set([ef.TABLE, ef.TEMPLATE, ef.HTML]),
        or = new Set([ef.TD, ef.TH]);
    class oa {
        get currentTmplContentOrNode() {
            return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current
        }
        constructor(e, t, r) {
            this.treeAdapter = t, this.handler = r, this.items = [], this.tagIDs = [], this.stackTop = -1, this.tmplCount = 0, this.currentTagId = ef.UNKNOWN, this.current = e
        }
        _indexOf(e) {
            return this.items.lastIndexOf(e, this.stackTop)
        }
        _isInTemplate() {
            return this.currentTagId === ef.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === ep.HTML
        }
        _updateCurrentElement() {
            this.current = this.items[this.stackTop], this.currentTagId = this.tagIDs[this.stackTop]
        }
        push(e, t) {
            this.stackTop++, this.items[this.stackTop] = e, this.current = e, this.tagIDs[this.stackTop] = t, this.currentTagId = t, this._isInTemplate() && this.tmplCount++, this.handler.onItemPush(e, t, !0)
        }
        pop() {
            let e = this.current;
            this.tmplCount > 0 && this._isInTemplate() && this.tmplCount--, this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !0)
        }
        replace(e, t) {
            let r = this._indexOf(e);
            this.items[r] = t, r === this.stackTop && (this.current = t)
        }
        insertAfter(e, t, r) {
            let a = this._indexOf(e) + 1;
            this.items.splice(a, 0, t), this.tagIDs.splice(a, 0, r), this.stackTop++, a === this.stackTop && this._updateCurrentElement(), this.current && void 0 !== this.currentTagId && this.handler.onItemPush(this.current, this.currentTagId, a === this.stackTop)
        }
        popUntilTagNamePopped(e) {
            let t = this.stackTop + 1;
            do t = this.tagIDs.lastIndexOf(e, t - 1); while (t > 0 && this.treeAdapter.getNamespaceURI(this.items[t]) !== ep.HTML) this.shortenToLength(Math.max(t, 0))
        }
        shortenToLength(e) {
            for (; this.stackTop >= e;) {
                let t = this.current;
                this.tmplCount > 0 && this._isInTemplate() && (this.tmplCount -= 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(t, this.stackTop < e)
            }
        }
        popUntilElementPopped(e) {
            let t = this._indexOf(e);
            this.shortenToLength(Math.max(t, 0))
        }
        popUntilPopped(e, t) {
            let r = this._indexOfTagNames(e, t);
            this.shortenToLength(Math.max(r, 0))
        }
        popUntilNumberedHeaderPopped() {
            this.popUntilPopped(sW, ep.HTML)
        }
        popUntilTableCellPopped() {
            this.popUntilPopped(or, ep.HTML)
        }
        popAllUpToHtmlElement() {
            this.tmplCount = 0, this.shortenToLength(1)
        }
        _indexOfTagNames(e, t) {
            for (let r = this.stackTop; r >= 0; r--)
                if (e.has(this.tagIDs[r]) && this.treeAdapter.getNamespaceURI(this.items[r]) === t) return r;
            return -1
        }
        clearBackTo(e, t) {
            let r = this._indexOfTagNames(e, t);
            this.shortenToLength(r + 1)
        }
        clearBackToTableContext() {
            this.clearBackTo(ot, ep.HTML)
        }
        clearBackToTableBodyContext() {
            this.clearBackTo(oe, ep.HTML)
        }
        clearBackToTableRowContext() {
            this.clearBackTo(s7, ep.HTML)
        }
        remove(e) {
            let t = this._indexOf(e);
            t >= 0 && (t === this.stackTop ? this.pop() : (this.items.splice(t, 1), this.tagIDs.splice(t, 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(e, !1)))
        }
        tryPeekProperlyNestedBodyElement() {
            return this.stackTop >= 1 && this.tagIDs[1] === ef.BODY ? this.items[1] : null
        }
        contains(e) {
            return this._indexOf(e) > -1
        }
        getCommonAncestor(e) {
            let t = this._indexOf(e) - 1;
            return t >= 0 ? this.items[t] : null
        }
        isRootHtmlElementCurrent() {
            return 0 === this.stackTop && this.tagIDs[0] === ef.HTML
        }
        hasInDynamicScope(e, t) {
            for (let r = this.stackTop; r >= 0; r--) {
                let a = this.tagIDs[r];
                switch (this.treeAdapter.getNamespaceURI(this.items[r])) {
                    case ep.HTML:
                        if (a === e) return !0;
                        if (t.has(a)) return !1;
                        break;
                    case ep.SVG:
                        if (s9.has(a)) return !1;
                        break;
                    case ep.MATHML:
                        if (s8.has(a)) return !1
                }
            }
            return !0
        }
        hasInScope(e) {
            return this.hasInDynamicScope(e, s6)
        }
        hasInListItemScope(e) {
            return this.hasInDynamicScope(e, s3)
        }
        hasInButtonScope(e) {
            return this.hasInDynamicScope(e, s4)
        }
        hasNumberedHeaderInScope() {
            for (let e = this.stackTop; e >= 0; e--) {
                let t = this.tagIDs[e];
                switch (this.treeAdapter.getNamespaceURI(this.items[e])) {
                    case ep.HTML:
                        if (sW.has(t)) return !0;
                        if (s6.has(t)) return !1;
                        break;
                    case ep.SVG:
                        if (s9.has(t)) return !1;
                        break;
                    case ep.MATHML:
                        if (s8.has(t)) return !1
                }
            }
            return !0
        }
        hasInTableScope(e) {
            for (let t = this.stackTop; t >= 0; t--)
                if (this.treeAdapter.getNamespaceURI(this.items[t]) === ep.HTML) switch (this.tagIDs[t]) {
                    case e:
                        return !0;
                    case ef.TABLE:
                    case ef.HTML:
                        return !1
                }
            return !0
        }
        hasTableBodyContextInTableScope() {
            for (let e = this.stackTop; e >= 0; e--)
                if (this.treeAdapter.getNamespaceURI(this.items[e]) === ep.HTML) switch (this.tagIDs[e]) {
                    case ef.TBODY:
                    case ef.THEAD:
                    case ef.TFOOT:
                        return !0;
                    case ef.TABLE:
                    case ef.HTML:
                        return !1
                }
            return !0
        }
        hasInSelectScope(e) {
            for (let t = this.stackTop; t >= 0; t--)
                if (this.treeAdapter.getNamespaceURI(this.items[t]) === ep.HTML) switch (this.tagIDs[t]) {
                    case e:
                        return !0;
                    case ef.OPTION:
                    case ef.OPTGROUP:
                        break;
                    default:
                        return !1
                }
            return !0
        }
        generateImpliedEndTags() {
            for (; void 0 !== this.currentTagId && s2.has(this.currentTagId);) this.pop()
        }
        generateImpliedEndTagsThoroughly() {
            for (; void 0 !== this.currentTagId && s5.has(this.currentTagId);) this.pop()
        }
        generateImpliedEndTagsWithExclusion(e) {
            for (; void 0 !== this.currentTagId && this.currentTagId !== e && s5.has(this.currentTagId);) this.pop()
        }
    }(O = ey || (ey = {}))[O.Marker = 0] = "Marker", O[O.Element = 1] = "Element";
    let on = {
        type: ey.Marker
    };
    class oi {
        constructor(e) {
            this.treeAdapter = e, this.entries = [], this.bookmark = null
        }
        _getNoahArkConditionCandidates(e, t) {
            let r = [],
                a = t.length,
                n = this.treeAdapter.getTagName(e),
                i = this.treeAdapter.getNamespaceURI(e);
            for (let e = 0; e < this.entries.length; e++) {
                let t = this.entries[e];
                if (t.type === ey.Marker) break;
                let {
                    element: s
                } = t;
                if (this.treeAdapter.getTagName(s) === n && this.treeAdapter.getNamespaceURI(s) === i) {
                    let t = this.treeAdapter.getAttrList(s);
                    t.length === a && r.push({
                        idx: e,
                        attrs: t
                    })
                }
            }
            return r
        }
        _ensureNoahArkCondition(e) {
            if (this.entries.length < 3) return;
            let t = this.treeAdapter.getAttrList(e),
                r = this._getNoahArkConditionCandidates(e, t);
            if (r.length < 3) return;
            let a = new Map(t.map(e => [e.name, e.value])),
                n = 0;
            for (let e = 0; e < r.length; e++) {
                let t = r[e];
                t.attrs.every(e => a.get(e.name) === e.value) && (n += 1) >= 3 && this.entries.splice(t.idx, 1)
            }
        }
        insertMarker() {
            this.entries.unshift(on)
        }
        pushElement(e, t) {
            this._ensureNoahArkCondition(e), this.entries.unshift({
                type: ey.Element,
                element: e,
                token: t
            })
        }
        insertElementAfterBookmark(e, t) {
            let r = this.entries.indexOf(this.bookmark);
            this.entries.splice(r, 0, {
                type: ey.Element,
                element: e,
                token: t
            })
        }
        removeEntry(e) {
            let t = this.entries.indexOf(e); - 1 !== t && this.entries.splice(t, 1)
        }
        clearToLastMarker() {
            let e = this.entries.indexOf(on); - 1 === e ? this.entries.length = 0 : this.entries.splice(0, e + 1)
        }
        getElementEntryInScopeWithTagName(e) {
            let t = this.entries.find(t => t.type === ey.Marker || this.treeAdapter.getTagName(t.element) === e);
            return t && t.type === ey.Element ? t : null
        }
        getElementEntry(e) {
            return this.entries.find(t => t.type === ey.Element && t.element === e)
        }
    }
    let os = {
            createDocument: () => ({
                nodeName: "#document",
                mode: eh.NO_QUIRKS,
                childNodes: []
            }),
            createDocumentFragment: () => ({
                nodeName: "#document-fragment",
                childNodes: []
            }),
            createElement: (e, t, r) => ({
                nodeName: e,
                tagName: e,
                attrs: r,
                namespaceURI: t,
                childNodes: [],
                parentNode: null
            }),
            createCommentNode: e => ({
                nodeName: "#comment",
                data: e,
                parentNode: null
            }),
            createTextNode: e => ({
                nodeName: "#text",
                value: e,
                parentNode: null
            }),
            appendChild(e, t) {
                e.childNodes.push(t), t.parentNode = e
            },
            insertBefore(e, t, r) {
                let a = e.childNodes.indexOf(r);
                e.childNodes.splice(a, 0, t), t.parentNode = e
            },
            setTemplateContent(e, t) {
                e.content = t
            },
            getTemplateContent: e => e.content,
            setDocumentType(e, t, r, a) {
                let n = e.childNodes.find(e => "#documentType" === e.nodeName);
                n ? (n.name = t, n.publicId = r, n.systemId = a) : os.appendChild(e, {
                    nodeName: "#documentType",
                    name: t,
                    publicId: r,
                    systemId: a,
                    parentNode: null
                })
            },
            setDocumentMode(e, t) {
                e.mode = t
            },
            getDocumentMode: e => e.mode,
            detachNode(e) {
                if (e.parentNode) {
                    let t = e.parentNode.childNodes.indexOf(e);
                    e.parentNode.childNodes.splice(t, 1), e.parentNode = null
                }
            },
            insertText(e, t) {
                if (e.childNodes.length > 0) {
                    let r = e.childNodes[e.childNodes.length - 1];
                    if (os.isTextNode(r)) {
                        r.value += t;
                        return
                    }
                }
                os.appendChild(e, os.createTextNode(t))
            },
            insertTextBefore(e, t, r) {
                let a = e.childNodes[e.childNodes.indexOf(r) - 1];
                a && os.isTextNode(a) ? a.value += t : os.insertBefore(e, os.createTextNode(t), r)
            },
            adoptAttributes(e, t) {
                let r = new Set(e.attrs.map(e => e.name));
                for (let a = 0; a < t.length; a++) r.has(t[a].name) || e.attrs.push(t[a])
            },
            getFirstChild: e => e.childNodes[0],
            getChildNodes: e => e.childNodes,
            getParentNode: e => e.parentNode,
            getAttrList: e => e.attrs,
            getTagName: e => e.tagName,
            getNamespaceURI: e => e.namespaceURI,
            getTextNodeContent: e => e.value,
            getCommentNodeContent: e => e.data,
            getDocumentTypeNodeName: e => e.name,
            getDocumentTypeNodePublicId: e => e.publicId,
            getDocumentTypeNodeSystemId: e => e.systemId,
            isTextNode: e => "#text" === e.nodeName,
            isCommentNode: e => "#comment" === e.nodeName,
            isDocumentTypeNode: e => "#documentType" === e.nodeName,
            isElementNode: e => Object.prototype.hasOwnProperty.call(e, "tagName"),
            setNodeSourceCodeLocation(e, t) {
                e.sourceCodeLocation = t
            },
            getNodeSourceCodeLocation: e => e.sourceCodeLocation,
            updateNodeSourceCodeLocation(e, t) {
                e.sourceCodeLocation = { ...e.sourceCodeLocation,
                    ...t
                }
            }
        },
        oo = "html",
        ol = ["+//silmaril//dtd html pro v0r11 19970101//", "-//as//dtd html 3.0 aswedit + extensions//", "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", "-//ietf//dtd html 2.0 level 1//", "-//ietf//dtd html 2.0 level 2//", "-//ietf//dtd html 2.0 strict level 1//", "-//ietf//dtd html 2.0 strict level 2//", "-//ietf//dtd html 2.0 strict//", "-//ietf//dtd html 2.0//", "-//ietf//dtd html 2.1e//", "-//ietf//dtd html 3.0//", "-//ietf//dtd html 3.2 final//", "-//ietf//dtd html 3.2//", "-//ietf//dtd html 3//", "-//ietf//dtd html level 0//", "-//ietf//dtd html level 1//", "-//ietf//dtd html level 2//", "-//ietf//dtd html level 3//", "-//ietf//dtd html strict level 0//", "-//ietf//dtd html strict level 1//", "-//ietf//dtd html strict level 2//", "-//ietf//dtd html strict level 3//", "-//ietf//dtd html strict//", "-//ietf//dtd html//", "-//metrius//dtd metrius presentational//", "-//microsoft//dtd internet explorer 2.0 html strict//", "-//microsoft//dtd internet explorer 2.0 html//", "-//microsoft//dtd internet explorer 2.0 tables//", "-//microsoft//dtd internet explorer 3.0 html strict//", "-//microsoft//dtd internet explorer 3.0 html//", "-//microsoft//dtd internet explorer 3.0 tables//", "-//netscape comm. corp.//dtd html//", "-//netscape comm. corp.//dtd strict html//", "-//o'reilly and associates//dtd html 2.0//", "-//o'reilly and associates//dtd html extended 1.0//", "-//o'reilly and associates//dtd html extended relaxed 1.0//", "-//sq//dtd html 2.0 hotmetal + extensions//", "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", "-//spyglass//dtd html 2.0 extended//", "-//sun microsystems corp.//dtd hotjava html//", "-//sun microsystems corp.//dtd hotjava strict html//", "-//w3c//dtd html 3 1995-03-24//", "-//w3c//dtd html 3.2 draft//", "-//w3c//dtd html 3.2 final//", "-//w3c//dtd html 3.2//", "-//w3c//dtd html 3.2s draft//", "-//w3c//dtd html 4.0 frameset//", "-//w3c//dtd html 4.0 transitional//", "-//w3c//dtd html experimental 19960712//", "-//w3c//dtd html experimental 970421//", "-//w3c//dtd w3 html//", "-//w3o//dtd w3 html 3.0//", "-//webtechs//dtd mozilla html 2.0//", "-//webtechs//dtd mozilla html//"],
        oc = [...ol, "-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//"],
        ou = new Set(["-//w3o//dtd w3 html strict 3.0//en//", "-/w3c/dtd html 4.0 transitional/en", "html"]),
        od = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"],
        op = [...od, "-//w3c//dtd html 4.01 frameset//", "-//w3c//dtd html 4.01 transitional//"];

    function oA(e, t) {
        return t.some(t => e.startsWith(t))
    }
    let oh = new Map(["attributeName", "attributeType", "baseFrequency", "baseProfile", "calcMode", "clipPathUnits", "diffuseConstant", "edgeMode", "filterUnits", "glyphRef", "gradientTransform", "gradientUnits", "kernelMatrix", "kernelUnitLength", "keyPoints", "keySplines", "keyTimes", "lengthAdjust", "limitingConeAngle", "markerHeight", "markerUnits", "markerWidth", "maskContentUnits", "maskUnits", "numOctaves", "pathLength", "patternContentUnits", "patternTransform", "patternUnits", "pointsAtX", "pointsAtY", "pointsAtZ", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", "refX", "refY", "repeatCount", "repeatDur", "requiredExtensions", "requiredFeatures", "specularConstant", "specularExponent", "spreadMethod", "startOffset", "stdDeviation", "stitchTiles", "surfaceScale", "systemLanguage", "tableValues", "targetX", "targetY", "textLength", "viewBox", "viewTarget", "xChannelSelector", "yChannelSelector", "zoomAndPan"].map(e => [e.toLowerCase(), e])),
        om = new Map([
            ["xlink:actuate", {
                prefix: "xlink",
                name: "actuate",
                namespace: ep.XLINK
            }],
            ["xlink:arcrole", {
                prefix: "xlink",
                name: "arcrole",
                namespace: ep.XLINK
            }],
            ["xlink:href", {
                prefix: "xlink",
                name: "href",
                namespace: ep.XLINK
            }],
            ["xlink:role", {
                prefix: "xlink",
                name: "role",
                namespace: ep.XLINK
            }],
            ["xlink:show", {
                prefix: "xlink",
                name: "show",
                namespace: ep.XLINK
            }],
            ["xlink:title", {
                prefix: "xlink",
                name: "title",
                namespace: ep.XLINK
            }],
            ["xlink:type", {
                prefix: "xlink",
                name: "type",
                namespace: ep.XLINK
            }],
            ["xml:lang", {
                prefix: "xml",
                name: "lang",
                namespace: ep.XML
            }],
            ["xml:space", {
                prefix: "xml",
                name: "space",
                namespace: ep.XML
            }],
            ["xmlns", {
                prefix: "",
                name: "xmlns",
                namespace: ep.XMLNS
            }],
            ["xmlns:xlink", {
                prefix: "xmlns",
                name: "xlink",
                namespace: ep.XMLNS
            }]
        ]),
        of = new Map(["altGlyph", "altGlyphDef", "altGlyphItem", "animateColor", "animateMotion", "animateTransform", "clipPath", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "foreignObject", "glyphRef", "linearGradient", "radialGradient", "textPath"].map(e => [e.toLowerCase(), e])),
        og = new Set([ef.B, ef.BIG, ef.BLOCKQUOTE, ef.BODY, ef.BR, ef.CENTER, ef.CODE, ef.DD, ef.DIV, ef.DL, ef.DT, ef.EM, ef.EMBED, ef.H1, ef.H2, ef.H3, ef.H4, ef.H5, ef.H6, ef.HEAD, ef.HR, ef.I, ef.IMG, ef.LI, ef.LISTING, ef.MENU, ef.META, ef.NOBR, ef.OL, ef.P, ef.PRE, ef.RUBY, ef.S, ef.SMALL, ef.SPAN, ef.STRONG, ef.STRIKE, ef.SUB, ef.SUP, ef.TABLE, ef.TT, ef.U, ef.UL, ef.VAR]);

    function oy(e) {
        for (let t = 0; t < e.attrs.length; t++)
            if ("definitionurl" === e.attrs[t].name) {
                e.attrs[t].name = "definitionURL";
                break
            }
    }

    function oT(e) {
        for (let t = 0; t < e.attrs.length; t++) {
            let r = oh.get(e.attrs[t].name);
            null != r && (e.attrs[t].name = r)
        }
    }

    function oE(e) {
        for (let t = 0; t < e.attrs.length; t++) {
            let r = om.get(e.attrs[t].name);
            r && (e.attrs[t].prefix = r.prefix, e.attrs[t].name = r.name, e.attrs[t].namespace = r.namespace)
        }
    }(R = eT || (eT = {}))[R.INITIAL = 0] = "INITIAL", R[R.BEFORE_HTML = 1] = "BEFORE_HTML", R[R.BEFORE_HEAD = 2] = "BEFORE_HEAD", R[R.IN_HEAD = 3] = "IN_HEAD", R[R.IN_HEAD_NO_SCRIPT = 4] = "IN_HEAD_NO_SCRIPT", R[R.AFTER_HEAD = 5] = "AFTER_HEAD", R[R.IN_BODY = 6] = "IN_BODY", R[R.TEXT = 7] = "TEXT", R[R.IN_TABLE = 8] = "IN_TABLE", R[R.IN_TABLE_TEXT = 9] = "IN_TABLE_TEXT", R[R.IN_CAPTION = 10] = "IN_CAPTION", R[R.IN_COLUMN_GROUP = 11] = "IN_COLUMN_GROUP", R[R.IN_TABLE_BODY = 12] = "IN_TABLE_BODY", R[R.IN_ROW = 13] = "IN_ROW", R[R.IN_CELL = 14] = "IN_CELL", R[R.IN_SELECT = 15] = "IN_SELECT", R[R.IN_SELECT_IN_TABLE = 16] = "IN_SELECT_IN_TABLE", R[R.IN_TEMPLATE = 17] = "IN_TEMPLATE", R[R.AFTER_BODY = 18] = "AFTER_BODY", R[R.IN_FRAMESET = 19] = "IN_FRAMESET", R[R.AFTER_FRAMESET = 20] = "AFTER_FRAMESET", R[R.AFTER_AFTER_BODY = 21] = "AFTER_AFTER_BODY", R[R.AFTER_AFTER_FRAMESET = 22] = "AFTER_AFTER_FRAMESET";
    let ob = {
            startLine: -1,
            startCol: -1,
            startOffset: -1,
            endLine: -1,
            endCol: -1,
            endOffset: -1
        },
        oI = new Set([ef.TABLE, ef.TBODY, ef.TFOOT, ef.THEAD, ef.TR]),
        oC = {
            scriptingEnabled: !0,
            sourceCodeLocationInfo: !1,
            treeAdapter: os,
            onParseError: null
        };
    class oS {
        constructor(e, t, r = null, a = null) {
            this.fragmentContext = r, this.scriptHandler = a, this.currentToken = null, this.stopped = !1, this.insertionMode = eT.INITIAL, this.originalInsertionMode = eT.INITIAL, this.headElement = null, this.formElement = null, this.currentNotInHTML = !1, this.tmplInsertionModeStack = [], this.pendingCharacterTokens = [], this.hasNonWhitespacePendingCharacterToken = !1, this.framesetOk = !0, this.skipNextNewLine = !1, this.fosterParentingEnabled = !1, this.options = { ...oC,
                ...e
            }, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = !0), this.document = null != t ? t : this.treeAdapter.createDocument(), this.tokenizer = new s1(this.options, this), this.activeFormattingElements = new oi(this.treeAdapter), this.fragmentContextID = r ? sQ(this.treeAdapter.getTagName(r)) : ef.UNKNOWN, this._setContextModes(null != r ? r : this.document, this.fragmentContextID), this.openElements = new oa(this.document, this.treeAdapter, this)
        }
        static parse(e, t) {
            let r = new this(t);
            return r.tokenizer.write(e, !0), r.document
        }
        static getFragmentParser(e, t) {
            let r = { ...oC,
                ...t
            };
            null != e || (e = r.treeAdapter.createElement(em.TEMPLATE, ep.HTML, []));
            let a = r.treeAdapter.createElement("documentmock", ep.HTML, []),
                n = new this(r, a, e);
            return n.fragmentContextID === ef.TEMPLATE && n.tmplInsertionModeStack.unshift(eT.IN_TEMPLATE), n._initTokenizerForFragmentParsing(), n._insertFakeRootElement(), n._resetInsertionMode(), n._findFormInFragmentContext(), n
        }
        getFragment() {
            let e = this.treeAdapter.getFirstChild(this.document),
                t = this.treeAdapter.createDocumentFragment();
            return this._adoptNodes(e, t), t
        }
        _err(e, t, r) {
            var a;
            if (!this.onParseError) return;
            let n = null != (a = e.location) ? a : ob,
                i = {
                    code: t,
                    startLine: n.startLine,
                    startCol: n.startCol,
                    startOffset: n.startOffset,
                    endLine: r ? n.startLine : n.endLine,
                    endCol: r ? n.startCol : n.endCol,
                    endOffset: r ? n.startOffset : n.endOffset
                };
            this.onParseError(i)
        }
        onItemPush(e, t, r) {
            var a, n;
            null == (n = (a = this.treeAdapter).onItemPush) || n.call(a, e), r && this.openElements.stackTop > 0 && this._setContextModes(e, t)
        }
        onItemPop(e, t) {
            var r, a;
            if (this.options.sourceCodeLocationInfo && this._setEndLocation(e, this.currentToken), null == (a = (r = this.treeAdapter).onItemPop) || a.call(r, e, this.openElements.current), t) {
                let e, t;
                0 === this.openElements.stackTop && this.fragmentContext ? (e = this.fragmentContext, t = this.fragmentContextID) : {
                    current: e,
                    currentTagId: t
                } = this.openElements, this._setContextModes(e, t)
            }
        }
        _setContextModes(e, t) {
            let r = e === this.document || e && this.treeAdapter.getNamespaceURI(e) === ep.HTML;
            this.currentNotInHTML = !r, this.tokenizer.inForeignNode = !r && void 0 !== e && void 0 !== t && !this._isIntegrationPoint(t, e)
        }
        _switchToTextParsing(e, t) {
            this._insertElement(e, ep.HTML), this.tokenizer.state = t, this.originalInsertionMode = this.insertionMode, this.insertionMode = eT.TEXT
        }
        switchToPlaintextParsing() {
            this.insertionMode = eT.TEXT, this.originalInsertionMode = eT.IN_BODY, this.tokenizer.state = sz.PLAINTEXT
        }
        _getAdjustedCurrentElement() {
            return 0 === this.openElements.stackTop && this.fragmentContext ? this.fragmentContext : this.openElements.current
        }
        _findFormInFragmentContext() {
            let e = this.fragmentContext;
            for (; e;) {
                if (this.treeAdapter.getTagName(e) === em.FORM) {
                    this.formElement = e;
                    break
                }
                e = this.treeAdapter.getParentNode(e)
            }
        }
        _initTokenizerForFragmentParsing() {
            if (this.fragmentContext && this.treeAdapter.getNamespaceURI(this.fragmentContext) === ep.HTML) switch (this.fragmentContextID) {
                case ef.TITLE:
                case ef.TEXTAREA:
                    this.tokenizer.state = sz.RCDATA;
                    break;
                case ef.STYLE:
                case ef.XMP:
                case ef.IFRAME:
                case ef.NOEMBED:
                case ef.NOFRAMES:
                case ef.NOSCRIPT:
                    this.tokenizer.state = sz.RAWTEXT;
                    break;
                case ef.SCRIPT:
                    this.tokenizer.state = sz.SCRIPT_DATA;
                    break;
                case ef.PLAINTEXT:
                    this.tokenizer.state = sz.PLAINTEXT
            }
        }
        _setDocumentType(e) {
            let t = e.name || "",
                r = e.publicId || "",
                a = e.systemId || "";
            if (this.treeAdapter.setDocumentType(this.document, t, r, a), e.location) {
                let t = this.treeAdapter.getChildNodes(this.document).find(e => this.treeAdapter.isDocumentTypeNode(e));
                t && this.treeAdapter.setNodeSourceCodeLocation(t, e.location)
            }
        }
        _attachElementToTree(e, t) {
            if (this.options.sourceCodeLocationInfo) {
                let r = t && { ...t,
                    startTag: t
                };
                this.treeAdapter.setNodeSourceCodeLocation(e, r)
            }
            if (this._shouldFosterParentOnInsertion()) this._fosterParentElement(e);
            else {
                let t = this.openElements.currentTmplContentOrNode;
                this.treeAdapter.appendChild(null != t ? t : this.document, e)
            }
        }
        _appendElement(e, t) {
            let r = this.treeAdapter.createElement(e.tagName, t, e.attrs);
            this._attachElementToTree(r, e.location)
        }
        _insertElement(e, t) {
            let r = this.treeAdapter.createElement(e.tagName, t, e.attrs);
            this._attachElementToTree(r, e.location), this.openElements.push(r, e.tagID)
        }
        _insertFakeElement(e, t) {
            let r = this.treeAdapter.createElement(e, ep.HTML, []);
            this._attachElementToTree(r, null), this.openElements.push(r, t)
        }
        _insertTemplate(e) {
            let t = this.treeAdapter.createElement(e.tagName, ep.HTML, e.attrs),
                r = this.treeAdapter.createDocumentFragment();
            this.treeAdapter.setTemplateContent(t, r), this._attachElementToTree(t, e.location), this.openElements.push(t, e.tagID), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(r, null)
        }
        _insertFakeRootElement() {
            let e = this.treeAdapter.createElement(em.HTML, ep.HTML, []);
            this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(e, null), this.treeAdapter.appendChild(this.openElements.current, e), this.openElements.push(e, ef.HTML)
        }
        _appendCommentNode(e, t) {
            let r = this.treeAdapter.createCommentNode(e.data);
            this.treeAdapter.appendChild(t, r), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(r, e.location)
        }
        _insertCharacters(e) {
            let t, r;
            if (this._shouldFosterParentOnInsertion() ? ({
                    parent: t,
                    beforeElement: r
                } = this._findFosterParentingLocation(), r ? this.treeAdapter.insertTextBefore(t, e.chars, r) : this.treeAdapter.insertText(t, e.chars)) : (t = this.openElements.currentTmplContentOrNode, this.treeAdapter.insertText(t, e.chars)), !e.location) return;
            let a = this.treeAdapter.getChildNodes(t),
                n = r ? a.lastIndexOf(r) : a.length,
                i = a[n - 1];
            if (this.treeAdapter.getNodeSourceCodeLocation(i)) {
                let {
                    endLine: t,
                    endCol: r,
                    endOffset: a
                } = e.location;
                this.treeAdapter.updateNodeSourceCodeLocation(i, {
                    endLine: t,
                    endCol: r,
                    endOffset: a
                })
            } else this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(i, e.location)
        }
        _adoptNodes(e, t) {
            for (let r = this.treeAdapter.getFirstChild(e); r; r = this.treeAdapter.getFirstChild(e)) this.treeAdapter.detachNode(r), this.treeAdapter.appendChild(t, r)
        }
        _setEndLocation(e, t) {
            if (this.treeAdapter.getNodeSourceCodeLocation(e) && t.location) {
                let r = t.location,
                    a = this.treeAdapter.getTagName(e),
                    n = t.type === es.END_TAG && a === t.tagName ? {
                        endTag: { ...r
                        },
                        endLine: r.endLine,
                        endCol: r.endCol,
                        endOffset: r.endOffset
                    } : {
                        endLine: r.startLine,
                        endCol: r.startCol,
                        endOffset: r.startOffset
                    };
                this.treeAdapter.updateNodeSourceCodeLocation(e, n)
            }
        }
        shouldProcessStartTagTokenInForeignContent(e) {
            let t, r;
            return !!this.currentNotInHTML && (0 === this.openElements.stackTop && this.fragmentContext ? (t = this.fragmentContext, r = this.fragmentContextID) : {
                current: t,
                currentTagId: r
            } = this.openElements, (e.tagID !== ef.SVG || this.treeAdapter.getTagName(t) !== em.ANNOTATION_XML || this.treeAdapter.getNamespaceURI(t) !== ep.MATHML) && (this.tokenizer.inForeignNode || (e.tagID === ef.MGLYPH || e.tagID === ef.MALIGNMARK) && void 0 !== r && !this._isIntegrationPoint(r, t, ep.HTML)))
        }
        _processToken(e) {
            switch (e.type) {
                case es.CHARACTER:
                    this.onCharacter(e);
                    break;
                case es.NULL_CHARACTER:
                    this.onNullCharacter(e);
                    break;
                case es.COMMENT:
                    this.onComment(e);
                    break;
                case es.DOCTYPE:
                    this.onDoctype(e);
                    break;
                case es.START_TAG:
                    this._processStartTag(e);
                    break;
                case es.END_TAG:
                    this.onEndTag(e);
                    break;
                case es.EOF:
                    this.onEof(e);
                    break;
                case es.WHITESPACE_CHARACTER:
                    this.onWhitespaceCharacter(e)
            }
        }
        _isIntegrationPoint(e, t, r) {
            let a = this.treeAdapter.getNamespaceURI(t),
                n = this.treeAdapter.getAttrList(t);
            return (!r || r === ep.HTML) && function(e, t, r) {
                if (t === ep.MATHML && e === ef.ANNOTATION_XML) {
                    for (let e = 0; e < r.length; e++)
                        if (r[e].name === eA.ENCODING) {
                            let t = r[e].value.toLowerCase();
                            return "text/html" === t || "application/xhtml+xml" === t
                        }
                }
                return t === ep.SVG && (e === ef.FOREIGN_OBJECT || e === ef.DESC || e === ef.TITLE)
            }(e, a, n) || (!r || r === ep.MATHML) && a === ep.MATHML && (e === ef.MI || e === ef.MO || e === ef.MN || e === ef.MS || e === ef.MTEXT)
        }
        _reconstructActiveFormattingElements() {
            let e = this.activeFormattingElements.entries.length;
            if (e) {
                let t = this.activeFormattingElements.entries.findIndex(e => e.type === ey.Marker || this.openElements.contains(e.element)),
                    r = -1 === t ? e - 1 : t - 1;
                for (let e = r; e >= 0; e--) {
                    let t = this.activeFormattingElements.entries[e];
                    this._insertElement(t.token, this.treeAdapter.getNamespaceURI(t.element)), t.element = this.openElements.current
                }
            }
        }
        _closeTableCell() {
            this.openElements.generateImpliedEndTags(), this.openElements.popUntilTableCellPopped(), this.activeFormattingElements.clearToLastMarker(), this.insertionMode = eT.IN_ROW
        }
        _closePElement() {
            this.openElements.generateImpliedEndTagsWithExclusion(ef.P), this.openElements.popUntilTagNamePopped(ef.P)
        }
        _resetInsertionMode() {
            for (let e = this.openElements.stackTop; e >= 0; e--) switch (0 === e && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[e]) {
                case ef.TR:
                    this.insertionMode = eT.IN_ROW;
                    return;
                case ef.TBODY:
                case ef.THEAD:
                case ef.TFOOT:
                    this.insertionMode = eT.IN_TABLE_BODY;
                    return;
                case ef.CAPTION:
                    this.insertionMode = eT.IN_CAPTION;
                    return;
                case ef.COLGROUP:
                    this.insertionMode = eT.IN_COLUMN_GROUP;
                    return;
                case ef.TABLE:
                    this.insertionMode = eT.IN_TABLE;
                    return;
                case ef.BODY:
                    this.insertionMode = eT.IN_BODY;
                    return;
                case ef.FRAMESET:
                    this.insertionMode = eT.IN_FRAMESET;
                    return;
                case ef.SELECT:
                    return void this._resetInsertionModeForSelect(e);
                case ef.TEMPLATE:
                    this.insertionMode = this.tmplInsertionModeStack[0];
                    return;
                case ef.HTML:
                    this.insertionMode = this.headElement ? eT.AFTER_HEAD : eT.BEFORE_HEAD;
                    return;
                case ef.TD:
                case ef.TH:
                    if (e > 0) {
                        this.insertionMode = eT.IN_CELL;
                        return
                    }
                    break;
                case ef.HEAD:
                    if (e > 0) {
                        this.insertionMode = eT.IN_HEAD;
                        return
                    }
            }
            this.insertionMode = eT.IN_BODY
        }
        _resetInsertionModeForSelect(e) {
            if (e > 0)
                for (let t = e - 1; t > 0; t--) {
                    let e = this.openElements.tagIDs[t];
                    if (e === ef.TEMPLATE) break;
                    if (e === ef.TABLE) {
                        this.insertionMode = eT.IN_SELECT_IN_TABLE;
                        return
                    }
                }
            this.insertionMode = eT.IN_SELECT
        }
        _isElementCausesFosterParenting(e) {
            return oI.has(e)
        }
        _shouldFosterParentOnInsertion() {
            return this.fosterParentingEnabled && void 0 !== this.openElements.currentTagId && this._isElementCausesFosterParenting(this.openElements.currentTagId)
        }
        _findFosterParentingLocation() {
            for (let e = this.openElements.stackTop; e >= 0; e--) {
                let t = this.openElements.items[e];
                switch (this.openElements.tagIDs[e]) {
                    case ef.TEMPLATE:
                        if (this.treeAdapter.getNamespaceURI(t) === ep.HTML) return {
                            parent: this.treeAdapter.getTemplateContent(t),
                            beforeElement: null
                        };
                        break;
                    case ef.TABLE:
                        {
                            let r = this.treeAdapter.getParentNode(t);
                            if (r) return {
                                parent: r,
                                beforeElement: t
                            };
                            return {
                                parent: this.openElements.items[e - 1],
                                beforeElement: null
                            }
                        }
                }
            }
            return {
                parent: this.openElements.items[0],
                beforeElement: null
            }
        }
        _fosterParentElement(e) {
            let t = this._findFosterParentingLocation();
            t.beforeElement ? this.treeAdapter.insertBefore(t.parent, e, t.beforeElement) : this.treeAdapter.appendChild(t.parent, e)
        }
        _isSpecialElement(e, t) {
            return sY[this.treeAdapter.getNamespaceURI(e)].has(t)
        }
        onCharacter(e) {
            if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode) {
                var t, r;
                return void(t = this, r = e, t._insertCharacters(r), t.framesetOk = !1)
            }
            switch (this.insertionMode) {
                case eT.INITIAL:
                    ok(this, e);
                    break;
                case eT.BEFORE_HTML:
                    oD(this, e);
                    break;
                case eT.BEFORE_HEAD:
                    ov(this, e);
                    break;
                case eT.IN_HEAD:
                    oR(this, e);
                    break;
                case eT.IN_HEAD_NO_SCRIPT:
                    oM(this, e);
                    break;
                case eT.AFTER_HEAD:
                    oL(this, e);
                    break;
                case eT.IN_BODY:
                case eT.IN_CAPTION:
                case eT.IN_CELL:
                case eT.IN_TEMPLATE:
                    oF(this, e);
                    break;
                case eT.TEXT:
                case eT.IN_SELECT:
                case eT.IN_SELECT_IN_TABLE:
                    this._insertCharacters(e);
                    break;
                case eT.IN_TABLE:
                case eT.IN_TABLE_BODY:
                case eT.IN_ROW:
                    oq(this, e);
                    break;
                case eT.IN_TABLE_TEXT:
                    o$(this, e);
                    break;
                case eT.IN_COLUMN_GROUP:
                    o2(this, e);
                    break;
                case eT.AFTER_BODY:
                    lt(this, e);
                    break;
                case eT.AFTER_AFTER_BODY:
                    lr(this, e)
            }
        }
        onNullCharacter(e) {
            if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode) {
                var t, r;
                return void(t = this, (r = e).chars = "�", t._insertCharacters(r))
            }
            switch (this.insertionMode) {
                case eT.INITIAL:
                    ok(this, e);
                    break;
                case eT.BEFORE_HTML:
                    oD(this, e);
                    break;
                case eT.BEFORE_HEAD:
                    ov(this, e);
                    break;
                case eT.IN_HEAD:
                    oR(this, e);
                    break;
                case eT.IN_HEAD_NO_SCRIPT:
                    oM(this, e);
                    break;
                case eT.AFTER_HEAD:
                    oL(this, e);
                    break;
                case eT.TEXT:
                    this._insertCharacters(e);
                    break;
                case eT.IN_TABLE:
                case eT.IN_TABLE_BODY:
                case eT.IN_ROW:
                    oq(this, e);
                    break;
                case eT.IN_COLUMN_GROUP:
                    o2(this, e);
                    break;
                case eT.AFTER_BODY:
                    lt(this, e);
                    break;
                case eT.AFTER_AFTER_BODY:
                    lr(this, e)
            }
        }
        onComment(e) {
            var t, r, a, n;
            if (this.skipNextNewLine = !1, this.currentNotInHTML) return void oN(this, e);
            switch (this.insertionMode) {
                case eT.INITIAL:
                case eT.BEFORE_HTML:
                case eT.BEFORE_HEAD:
                case eT.IN_HEAD:
                case eT.IN_HEAD_NO_SCRIPT:
                case eT.AFTER_HEAD:
                case eT.IN_BODY:
                case eT.IN_TABLE:
                case eT.IN_CAPTION:
                case eT.IN_COLUMN_GROUP:
                case eT.IN_TABLE_BODY:
                case eT.IN_ROW:
                case eT.IN_CELL:
                case eT.IN_SELECT:
                case eT.IN_SELECT_IN_TABLE:
                case eT.IN_TEMPLATE:
                case eT.IN_FRAMESET:
                case eT.AFTER_FRAMESET:
                    oN(this, e);
                    break;
                case eT.IN_TABLE_TEXT:
                    oX(this, e);
                    break;
                case eT.AFTER_BODY:
                    t = this, r = e, t._appendCommentNode(r, t.openElements.items[0]);
                    break;
                case eT.AFTER_AFTER_BODY:
                case eT.AFTER_AFTER_FRAMESET:
                    a = this, n = e, a._appendCommentNode(n, a.document)
            }
        }
        onDoctype(e) {
            switch (this.skipNextNewLine = !1, this.insertionMode) {
                case eT.INITIAL:
                    ! function(e, t) {
                        e._setDocumentType(t);
                        let r = t.forceQuirks ? eh.QUIRKS : function(e) {
                            if (e.name !== oo) return eh.QUIRKS;
                            let {
                                systemId: t
                            } = e;
                            if (t && "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd" === t.toLowerCase()) return eh.QUIRKS;
                            let {
                                publicId: r
                            } = e;
                            if (null !== r) {
                                if (r = r.toLowerCase(), ou.has(r)) return eh.QUIRKS;
                                let e = null === t ? oc : ol;
                                if (oA(r, e)) return eh.QUIRKS;
                                if (oA(r, e = null === t ? od : op)) return eh.LIMITED_QUIRKS
                            }
                            return eh.NO_QUIRKS
                        }(t);
                        (t.name !== oo || null !== t.publicId || null !== t.systemId && "about:legacy-compat" !== t.systemId) && e._err(t, ei.nonConformingDoctype), e.treeAdapter.setDocumentMode(e.document, r), e.insertionMode = eT.BEFORE_HTML
                    }(this, e);
                    break;
                case eT.BEFORE_HEAD:
                case eT.IN_HEAD:
                case eT.IN_HEAD_NO_SCRIPT:
                case eT.AFTER_HEAD:
                    this._err(e, ei.misplacedDoctype);
                    break;
                case eT.IN_TABLE_TEXT:
                    oX(this, e)
            }
        }
        onStartTag(e) {
            this.skipNextNewLine = !1, this.currentToken = e, this._processStartTag(e), e.selfClosing && !e.ackSelfClosing && this._err(e, ei.nonVoidHtmlElementStartTagWithTrailingSolidus)
        }
        _processStartTag(e) {
            this.shouldProcessStartTagTokenInForeignContent(e) ? function(e, t) {
                let r;
                if ((r = t.tagID) === ef.FONT && t.attrs.some(({
                        name: e
                    }) => e === eA.COLOR || e === eA.SIZE || e === eA.FACE) || og.has(r)) la(e), e._startTagOutsideForeignContent(t);
                else {
                    let r = e._getAdjustedCurrentElement(),
                        a = e.treeAdapter.getNamespaceURI(r);
                    if (a === ep.MATHML) oy(t);
                    else if (a === ep.SVG) {
                        let e;
                        null != (e = of .get(t.tagName)) && (t.tagName = e, t.tagID = sQ(t.tagName)), oT(t)
                    }
                    oE(t), t.selfClosing ? e._appendElement(t, a) : e._insertElement(t, a), t.ackSelfClosing = !0
                }
            }(this, e) : this._startTagOutsideForeignContent(e)
        }
        _startTagOutsideForeignContent(e) {
            switch (this.insertionMode) {
                case eT.INITIAL:
                    ok(this, e);
                    break;
                case eT.BEFORE_HTML:
                    t = this, (r = e).tagID === ef.HTML ? (t._insertElement(r, ep.HTML), t.insertionMode = eT.BEFORE_HEAD) : oD(t, r);
                    break;
                case eT.BEFORE_HEAD:
                    var t, r, a, n, i, s, o, l, c, u, d, p, A = this,
                        h = e;
                    switch (h.tagID) {
                        case ef.HTML:
                            oQ(A, h);
                            break;
                        case ef.HEAD:
                            A._insertElement(h, ep.HTML), A.headElement = A.openElements.current, A.insertionMode = eT.IN_HEAD;
                            break;
                        default:
                            ov(A, h)
                    }
                    break;
                case eT.IN_HEAD:
                    ow(this, e);
                    break;
                case eT.IN_HEAD_NO_SCRIPT:
                    var m = this,
                        f = e;
                    switch (f.tagID) {
                        case ef.HTML:
                            oQ(m, f);
                            break;
                        case ef.BASEFONT:
                        case ef.BGSOUND:
                        case ef.HEAD:
                        case ef.LINK:
                        case ef.META:
                        case ef.NOFRAMES:
                        case ef.STYLE:
                            ow(m, f);
                            break;
                        case ef.NOSCRIPT:
                            m._err(f, ei.nestedNoscriptInHead);
                            break;
                        default:
                            oM(m, f)
                    }
                    break;
                case eT.AFTER_HEAD:
                    var g = this,
                        y = e;
                    switch (y.tagID) {
                        case ef.HTML:
                            oQ(g, y);
                            break;
                        case ef.BODY:
                            g._insertElement(y, ep.HTML), g.framesetOk = !1, g.insertionMode = eT.IN_BODY;
                            break;
                        case ef.FRAMESET:
                            g._insertElement(y, ep.HTML), g.insertionMode = eT.IN_FRAMESET;
                            break;
                        case ef.BASE:
                        case ef.BASEFONT:
                        case ef.BGSOUND:
                        case ef.LINK:
                        case ef.META:
                        case ef.NOFRAMES:
                        case ef.SCRIPT:
                        case ef.STYLE:
                        case ef.TEMPLATE:
                        case ef.TITLE:
                            g._err(y, ei.abandonedHeadElementChild), g.openElements.push(g.headElement, ef.HEAD), ow(g, y), g.openElements.remove(g.headElement);
                            break;
                        case ef.HEAD:
                            g._err(y, ei.misplacedStartTagForHeadElement);
                            break;
                        default:
                            oL(g, y)
                    }
                    break;
                case eT.IN_BODY:
                    oQ(this, e);
                    break;
                case eT.IN_TABLE:
                    oV(this, e);
                    break;
                case eT.IN_TABLE_TEXT:
                    oX(this, e);
                    break;
                case eT.IN_CAPTION:
                    let T;
                    a = this, T = (n = e).tagID, o0.has(T) ? a.openElements.hasInTableScope(ef.CAPTION) && (a.openElements.generateImpliedEndTags(), a.openElements.popUntilTagNamePopped(ef.CAPTION), a.activeFormattingElements.clearToLastMarker(), a.insertionMode = eT.IN_TABLE, oV(a, n)) : oQ(a, n);
                    break;
                case eT.IN_COLUMN_GROUP:
                    o1(this, e);
                    break;
                case eT.IN_TABLE_BODY:
                    o5(this, e);
                    break;
                case eT.IN_ROW:
                    o3(this, e);
                    break;
                case eT.IN_CELL:
                    let E;
                    i = this, E = (s = e).tagID, o0.has(E) ? (i.openElements.hasInTableScope(ef.TD) || i.openElements.hasInTableScope(ef.TH)) && (i._closeTableCell(), o3(i, s)) : oQ(i, s);
                    break;
                case eT.IN_SELECT:
                    o8(this, e);
                    break;
                case eT.IN_SELECT_IN_TABLE:
                    let b;
                    o = this, (b = (l = e).tagID) === ef.CAPTION || b === ef.TABLE || b === ef.TBODY || b === ef.TFOOT || b === ef.THEAD || b === ef.TR || b === ef.TD || b === ef.TH ? (o.openElements.popUntilTagNamePopped(ef.SELECT), o._resetInsertionMode(), o._processStartTag(l)) : o8(o, l);
                    break;
                case eT.IN_TEMPLATE:
                    var I = this,
                        C = e;
                    switch (C.tagID) {
                        case ef.BASE:
                        case ef.BASEFONT:
                        case ef.BGSOUND:
                        case ef.LINK:
                        case ef.META:
                        case ef.NOFRAMES:
                        case ef.SCRIPT:
                        case ef.STYLE:
                        case ef.TEMPLATE:
                        case ef.TITLE:
                            ow(I, C);
                            break;
                        case ef.CAPTION:
                        case ef.COLGROUP:
                        case ef.TBODY:
                        case ef.TFOOT:
                        case ef.THEAD:
                            I.tmplInsertionModeStack[0] = eT.IN_TABLE, I.insertionMode = eT.IN_TABLE, oV(I, C);
                            break;
                        case ef.COL:
                            I.tmplInsertionModeStack[0] = eT.IN_COLUMN_GROUP, I.insertionMode = eT.IN_COLUMN_GROUP, o1(I, C);
                            break;
                        case ef.TR:
                            I.tmplInsertionModeStack[0] = eT.IN_TABLE_BODY, I.insertionMode = eT.IN_TABLE_BODY, o5(I, C);
                            break;
                        case ef.TD:
                        case ef.TH:
                            I.tmplInsertionModeStack[0] = eT.IN_ROW, I.insertionMode = eT.IN_ROW, o3(I, C);
                            break;
                        default:
                            I.tmplInsertionModeStack[0] = eT.IN_BODY, I.insertionMode = eT.IN_BODY, oQ(I, C)
                    }
                    break;
                case eT.AFTER_BODY:
                    c = this, (u = e).tagID === ef.HTML ? oQ(c, u) : lt(c, u);
                    break;
                case eT.IN_FRAMESET:
                    var S = this,
                        _ = e;
                    switch (_.tagID) {
                        case ef.HTML:
                            oQ(S, _);
                            break;
                        case ef.FRAMESET:
                            S._insertElement(_, ep.HTML);
                            break;
                        case ef.FRAME:
                            S._appendElement(_, ep.HTML), _.ackSelfClosing = !0;
                            break;
                        case ef.NOFRAMES:
                            ow(S, _)
                    }
                    break;
                case eT.AFTER_FRAMESET:
                    var N = this,
                        x = e;
                    switch (x.tagID) {
                        case ef.HTML:
                            oQ(N, x);
                            break;
                        case ef.NOFRAMES:
                            ow(N, x)
                    }
                    break;
                case eT.AFTER_AFTER_BODY:
                    d = this, (p = e).tagID === ef.HTML ? oQ(d, p) : lr(d, p);
                    break;
                case eT.AFTER_AFTER_FRAMESET:
                    var k = this,
                        D = e;
                    switch (D.tagID) {
                        case ef.HTML:
                            oQ(k, D);
                            break;
                        case ef.NOFRAMES:
                            ow(k, D)
                    }
            }
        }
        onEndTag(e) {
            this.skipNextNewLine = !1, this.currentToken = e, this.currentNotInHTML ? function(e, t) {
                if (t.tagID === ef.P || t.tagID === ef.BR) {
                    la(e), e._endTagOutsideForeignContent(t);
                    return
                }
                for (let r = e.openElements.stackTop; r > 0; r--) {
                    let a = e.openElements.items[r];
                    if (e.treeAdapter.getNamespaceURI(a) === ep.HTML) {
                        e._endTagOutsideForeignContent(t);
                        break
                    }
                    let n = e.treeAdapter.getTagName(a);
                    if (n.toLowerCase() === t.tagName) {
                        t.tagName = n, e.openElements.shortenToLength(r);
                        break
                    }
                }
            }(this, e) : this._endTagOutsideForeignContent(e)
        }
        _endTagOutsideForeignContent(e) {
            switch (this.insertionMode) {
                case eT.INITIAL:
                    ok(this, e);
                    break;
                case eT.BEFORE_HTML:
                    let t;
                    a = this, ((t = (n = e).tagID) === ef.HTML || t === ef.HEAD || t === ef.BODY || t === ef.BR) && oD(a, n);
                    break;
                case eT.BEFORE_HEAD:
                    let r;
                    i = this, (r = (s = e).tagID) === ef.HEAD || r === ef.BODY || r === ef.HTML || r === ef.BR ? ov(i, s) : i._err(s, ei.endTagWithoutMatchingOpenElement);
                    break;
                case eT.IN_HEAD:
                    var a, n, i, s, o, l, c, u, d, p, A, h, m = this,
                        f = e;
                    switch (f.tagID) {
                        case ef.HEAD:
                            m.openElements.pop(), m.insertionMode = eT.AFTER_HEAD;
                            break;
                        case ef.BODY:
                        case ef.BR:
                        case ef.HTML:
                            oR(m, f);
                            break;
                        case ef.TEMPLATE:
                            oO(m, f);
                            break;
                        default:
                            m._err(f, ei.endTagWithoutMatchingOpenElement)
                    }
                    break;
                case eT.IN_HEAD_NO_SCRIPT:
                    var g = this,
                        y = e;
                    switch (y.tagID) {
                        case ef.NOSCRIPT:
                            g.openElements.pop(), g.insertionMode = eT.IN_HEAD;
                            break;
                        case ef.BR:
                            oM(g, y);
                            break;
                        default:
                            g._err(y, ei.endTagWithoutMatchingOpenElement)
                    }
                    break;
                case eT.AFTER_HEAD:
                    var T = this,
                        E = e;
                    switch (E.tagID) {
                        case ef.BODY:
                        case ef.HTML:
                        case ef.BR:
                            oL(T, E);
                            break;
                        case ef.TEMPLATE:
                            oO(T, E);
                            break;
                        default:
                            T._err(E, ei.endTagWithoutMatchingOpenElement)
                    }
                    break;
                case eT.IN_BODY:
                    oY(this, e);
                    break;
                case eT.TEXT:
                    o = this, e.tagID === ef.SCRIPT && (null == (l = o.scriptHandler) || l.call(o, o.openElements.current)), o.openElements.pop(), o.insertionMode = o.originalInsertionMode;
                    break;
                case eT.IN_TABLE:
                    oz(this, e);
                    break;
                case eT.IN_TABLE_TEXT:
                    oX(this, e);
                    break;
                case eT.IN_CAPTION:
                    var b = this,
                        I = e;
                    let C = I.tagID;
                    switch (C) {
                        case ef.CAPTION:
                        case ef.TABLE:
                            b.openElements.hasInTableScope(ef.CAPTION) && (b.openElements.generateImpliedEndTags(), b.openElements.popUntilTagNamePopped(ef.CAPTION), b.activeFormattingElements.clearToLastMarker(), b.insertionMode = eT.IN_TABLE, C === ef.TABLE && oz(b, I));
                            break;
                        case ef.BODY:
                        case ef.COL:
                        case ef.COLGROUP:
                        case ef.HTML:
                        case ef.TBODY:
                        case ef.TD:
                        case ef.TFOOT:
                        case ef.TH:
                        case ef.THEAD:
                        case ef.TR:
                            break;
                        default:
                            oY(b, I)
                    }
                    break;
                case eT.IN_COLUMN_GROUP:
                    var S = this,
                        _ = e;
                    switch (_.tagID) {
                        case ef.COLGROUP:
                            S.openElements.currentTagId === ef.COLGROUP && (S.openElements.pop(), S.insertionMode = eT.IN_TABLE);
                            break;
                        case ef.TEMPLATE:
                            oO(S, _);
                            break;
                        case ef.COL:
                            break;
                        default:
                            o2(S, _)
                    }
                    break;
                case eT.IN_TABLE_BODY:
                    o6(this, e);
                    break;
                case eT.IN_ROW:
                    o4(this, e);
                    break;
                case eT.IN_CELL:
                    var N = this,
                        x = e;
                    let k = x.tagID;
                    switch (k) {
                        case ef.TD:
                        case ef.TH:
                            N.openElements.hasInTableScope(k) && (N.openElements.generateImpliedEndTags(), N.openElements.popUntilTagNamePopped(k), N.activeFormattingElements.clearToLastMarker(), N.insertionMode = eT.IN_ROW);
                            break;
                        case ef.TABLE:
                        case ef.TBODY:
                        case ef.TFOOT:
                        case ef.THEAD:
                        case ef.TR:
                            N.openElements.hasInTableScope(k) && (N._closeTableCell(), o4(N, x));
                            break;
                        case ef.BODY:
                        case ef.CAPTION:
                        case ef.COL:
                        case ef.COLGROUP:
                        case ef.HTML:
                            break;
                        default:
                            oY(N, x)
                    }
                    break;
                case eT.IN_SELECT:
                    o9(this, e);
                    break;
                case eT.IN_SELECT_IN_TABLE:
                    let D;
                    c = this, (D = (u = e).tagID) === ef.CAPTION || D === ef.TABLE || D === ef.TBODY || D === ef.TFOOT || D === ef.THEAD || D === ef.TR || D === ef.TD || D === ef.TH ? c.openElements.hasInTableScope(D) && (c.openElements.popUntilTagNamePopped(ef.SELECT), c._resetInsertionMode(), c.onEndTag(u)) : o9(c, u);
                    break;
                case eT.IN_TEMPLATE:
                    d = this, (p = e).tagID === ef.TEMPLATE && oO(d, p);
                    break;
                case eT.AFTER_BODY:
                    le(this, e);
                    break;
                case eT.IN_FRAMESET:
                    A = this, e.tagID === ef.FRAMESET && !A.openElements.isRootHtmlElementCurrent() && (A.openElements.pop(), A.fragmentContext || A.openElements.currentTagId === ef.FRAMESET || (A.insertionMode = eT.AFTER_FRAMESET));
                    break;
                case eT.AFTER_FRAMESET:
                    h = this, e.tagID === ef.HTML && (h.insertionMode = eT.AFTER_AFTER_FRAMESET);
                    break;
                case eT.AFTER_AFTER_BODY:
                    lr(this, e)
            }
        }
        onEof(e) {
            switch (this.insertionMode) {
                case eT.INITIAL:
                    ok(this, e);
                    break;
                case eT.BEFORE_HTML:
                    oD(this, e);
                    break;
                case eT.BEFORE_HEAD:
                    ov(this, e);
                    break;
                case eT.IN_HEAD:
                    oR(this, e);
                    break;
                case eT.IN_HEAD_NO_SCRIPT:
                    oM(this, e);
                    break;
                case eT.AFTER_HEAD:
                    oL(this, e);
                    break;
                case eT.IN_BODY:
                case eT.IN_TABLE:
                case eT.IN_CAPTION:
                case eT.IN_COLUMN_GROUP:
                case eT.IN_TABLE_BODY:
                case eT.IN_ROW:
                case eT.IN_CELL:
                case eT.IN_SELECT:
                case eT.IN_SELECT_IN_TABLE:
                    oW(this, e);
                    break;
                case eT.TEXT:
                    var t, r;
                    t = this, r = e, t._err(r, ei.eofInElementThatCanContainOnlyText), t.openElements.pop(), t.insertionMode = t.originalInsertionMode, t.onEof(r);
                    break;
                case eT.IN_TABLE_TEXT:
                    oX(this, e);
                    break;
                case eT.IN_TEMPLATE:
                    o7(this, e);
                    break;
                case eT.AFTER_BODY:
                case eT.IN_FRAMESET:
                case eT.AFTER_FRAMESET:
                case eT.AFTER_AFTER_BODY:
                case eT.AFTER_AFTER_FRAMESET:
                    ox(this, e)
            }
        }
        onWhitespaceCharacter(e) {
            if (this.skipNextNewLine && (this.skipNextNewLine = !1, e.chars.charCodeAt(0) === en.LINE_FEED)) {
                if (1 === e.chars.length) return;
                e.chars = e.chars.substr(1)
            }
            if (this.tokenizer.inForeignNode) return void this._insertCharacters(e);
            switch (this.insertionMode) {
                case eT.IN_HEAD:
                case eT.IN_HEAD_NO_SCRIPT:
                case eT.AFTER_HEAD:
                case eT.TEXT:
                case eT.IN_COLUMN_GROUP:
                case eT.IN_SELECT:
                case eT.IN_SELECT_IN_TABLE:
                case eT.IN_FRAMESET:
                case eT.AFTER_FRAMESET:
                    this._insertCharacters(e);
                    break;
                case eT.IN_BODY:
                case eT.IN_CAPTION:
                case eT.IN_CELL:
                case eT.IN_TEMPLATE:
                case eT.AFTER_BODY:
                case eT.AFTER_AFTER_BODY:
                case eT.AFTER_AFTER_FRAMESET:
                    oP(this, e);
                    break;
                case eT.IN_TABLE:
                case eT.IN_TABLE_BODY:
                case eT.IN_ROW:
                    oq(this, e);
                    break;
                case eT.IN_TABLE_TEXT:
                    oZ(this, e)
            }
        }
    }

    function o_(e, t) {
        for (let r = 0; r < 8; r++) {
            let r = function(e, t) {
                let r = e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);
                return r ? e.openElements.contains(r.element) ? e.openElements.hasInScope(t.tagID) || (r = null) : (e.activeFormattingElements.removeEntry(r), r = null) : oK(e, t), r
            }(e, t);
            if (!r) break;
            let a = function(e, t) {
                let r = null,
                    a = e.openElements.stackTop;
                for (; a >= 0; a--) {
                    let n = e.openElements.items[a];
                    if (n === t.element) break;
                    e._isSpecialElement(n, e.openElements.tagIDs[a]) && (r = n)
                }
                return r || (e.openElements.shortenToLength(Math.max(a, 0)), e.activeFormattingElements.removeEntry(t)), r
            }(e, r);
            if (!a) break;
            e.activeFormattingElements.bookmark = r;
            let n = function(e, t, r) {
                    let a = t,
                        n = e.openElements.getCommonAncestor(t);
                    for (let i = 0, s = n; s !== r; i++, s = n) {
                        n = e.openElements.getCommonAncestor(s);
                        let r = e.activeFormattingElements.getElementEntry(s),
                            o = r && i >= 3;
                        !r || o ? (o && e.activeFormattingElements.removeEntry(r), e.openElements.remove(s)) : (s = function(e, t) {
                            let r = e.treeAdapter.getNamespaceURI(t.element),
                                a = e.treeAdapter.createElement(t.token.tagName, r, t.token.attrs);
                            return e.openElements.replace(t.element, a), t.element = a, a
                        }(e, r), a === t && (e.activeFormattingElements.bookmark = r), e.treeAdapter.detachNode(a), e.treeAdapter.appendChild(s, a), a = s)
                    }
                    return a
                }(e, a, r.element),
                i = e.openElements.getCommonAncestor(r.element);
            e.treeAdapter.detachNode(n), i && function(e, t, r) {
                    let a = sQ(e.treeAdapter.getTagName(t));
                    if (e._isElementCausesFosterParenting(a)) e._fosterParentElement(r);
                    else {
                        let n = e.treeAdapter.getNamespaceURI(t);
                        a === ef.TEMPLATE && n === ep.HTML && (t = e.treeAdapter.getTemplateContent(t)), e.treeAdapter.appendChild(t, r)
                    }
                }(e, i, n),
                function(e, t, r) {
                    let a = e.treeAdapter.getNamespaceURI(r.element),
                        {
                            token: n
                        } = r,
                        i = e.treeAdapter.createElement(n.tagName, a, n.attrs);
                    e._adoptNodes(t, i), e.treeAdapter.appendChild(t, i), e.activeFormattingElements.insertElementAfterBookmark(i, n), e.activeFormattingElements.removeEntry(r), e.openElements.remove(r.element), e.openElements.insertAfter(t, i, n.tagID)
                }(e, a, r)
        }
    }

    function oN(e, t) {
        e._appendCommentNode(t, e.openElements.currentTmplContentOrNode)
    }

    function ox(e, t) {
        if (e.stopped = !0, t.location) {
            let r = 2 * !e.fragmentContext;
            for (let a = e.openElements.stackTop; a >= r; a--) e._setEndLocation(e.openElements.items[a], t);
            if (!e.fragmentContext && e.openElements.stackTop >= 0) {
                let r = e.openElements.items[0],
                    a = e.treeAdapter.getNodeSourceCodeLocation(r);
                if (a && !a.endTag && (e._setEndLocation(r, t), e.openElements.stackTop >= 1)) {
                    let r = e.openElements.items[1],
                        a = e.treeAdapter.getNodeSourceCodeLocation(r);
                    a && !a.endTag && e._setEndLocation(r, t)
                }
            }
        }
    }

    function ok(e, t) {
        e._err(t, ei.missingDoctype, !0), e.treeAdapter.setDocumentMode(e.document, eh.QUIRKS), e.insertionMode = eT.BEFORE_HTML, e._processToken(t)
    }

    function oD(e, t) {
        e._insertFakeRootElement(), e.insertionMode = eT.BEFORE_HEAD, e._processToken(t)
    }

    function ov(e, t) {
        e._insertFakeElement(em.HEAD, ef.HEAD), e.headElement = e.openElements.current, e.insertionMode = eT.IN_HEAD, e._processToken(t)
    }

    function ow(e, t) {
        switch (t.tagID) {
            case ef.HTML:
                oQ(e, t);
                break;
            case ef.BASE:
            case ef.BASEFONT:
            case ef.BGSOUND:
            case ef.LINK:
            case ef.META:
                e._appendElement(t, ep.HTML), t.ackSelfClosing = !0;
                break;
            case ef.TITLE:
                e._switchToTextParsing(t, sz.RCDATA);
                break;
            case ef.NOSCRIPT:
                e.options.scriptingEnabled ? e._switchToTextParsing(t, sz.RAWTEXT) : (e._insertElement(t, ep.HTML), e.insertionMode = eT.IN_HEAD_NO_SCRIPT);
                break;
            case ef.NOFRAMES:
            case ef.STYLE:
                e._switchToTextParsing(t, sz.RAWTEXT);
                break;
            case ef.SCRIPT:
                e._switchToTextParsing(t, sz.SCRIPT_DATA);
                break;
            case ef.TEMPLATE:
                e._insertTemplate(t), e.activeFormattingElements.insertMarker(), e.framesetOk = !1, e.insertionMode = eT.IN_TEMPLATE, e.tmplInsertionModeStack.unshift(eT.IN_TEMPLATE);
                break;
            case ef.HEAD:
                e._err(t, ei.misplacedStartTagForHeadElement);
                break;
            default:
                oR(e, t)
        }
    }

    function oO(e, t) {
        e.openElements.tmplCount > 0 ? (e.openElements.generateImpliedEndTagsThoroughly(), e.openElements.currentTagId !== ef.TEMPLATE && e._err(t, ei.closingOfElementWithOpenChildElements), e.openElements.popUntilTagNamePopped(ef.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode()) : e._err(t, ei.endTagWithoutMatchingOpenElement)
    }

    function oR(e, t) {
        e.openElements.pop(), e.insertionMode = eT.AFTER_HEAD, e._processToken(t)
    }

    function oM(e, t) {
        let r = t.type === es.EOF ? ei.openElementsLeftAfterEof : ei.disallowedContentInNoscriptInHead;
        e._err(t, r), e.openElements.pop(), e.insertionMode = eT.IN_HEAD, e._processToken(t)
    }

    function oL(e, t) {
        e._insertFakeElement(em.BODY, ef.BODY), e.insertionMode = eT.IN_BODY, oB(e, t)
    }

    function oB(e, t) {
        switch (t.type) {
            case es.CHARACTER:
                oF(e, t);
                break;
            case es.WHITESPACE_CHARACTER:
                oP(e, t);
                break;
            case es.COMMENT:
                oN(e, t);
                break;
            case es.START_TAG:
                oQ(e, t);
                break;
            case es.END_TAG:
                oY(e, t);
                break;
            case es.EOF:
                oW(e, t)
        }
    }

    function oP(e, t) {
        e._reconstructActiveFormattingElements(), e._insertCharacters(t)
    }

    function oF(e, t) {
        e._reconstructActiveFormattingElements(), e._insertCharacters(t), e.framesetOk = !1
    }

    function oU(e, t) {
        e._reconstructActiveFormattingElements(), e._appendElement(t, ep.HTML), e.framesetOk = !1, t.ackSelfClosing = !0
    }

    function oG(e) {
        let t = sP(e, eA.TYPE);
        return null != t && "hidden" === t.toLowerCase()
    }

    function oH(e, t) {
        e._switchToTextParsing(t, sz.RAWTEXT)
    }

    function oj(e, t) {
        e._reconstructActiveFormattingElements(), e._insertElement(t, ep.HTML)
    }

    function oQ(e, t) {
        switch (t.tagID) {
            case ef.I:
            case ef.S:
            case ef.B:
            case ef.U:
            case ef.EM:
            case ef.TT:
            case ef.BIG:
            case ef.CODE:
            case ef.FONT:
            case ef.SMALL:
            case ef.STRIKE:
            case ef.STRONG:
                e._reconstructActiveFormattingElements(), e._insertElement(t, ep.HTML), e.activeFormattingElements.pushElement(e.openElements.current, t);
                break;
            case ef.A:
                let r;
                (r = e.activeFormattingElements.getElementEntryInScopeWithTagName(em.A)) && (o_(e, t), e.openElements.remove(r.element), e.activeFormattingElements.removeEntry(r)), e._reconstructActiveFormattingElements(), e._insertElement(t, ep.HTML), e.activeFormattingElements.pushElement(e.openElements.current, t);
                break;
            case ef.H1:
            case ef.H2:
            case ef.H3:
            case ef.H4:
            case ef.H5:
            case ef.H6:
                e.openElements.hasInButtonScope(ef.P) && e._closePElement(), void 0 !== e.openElements.currentTagId && sW.has(e.openElements.currentTagId) && e.openElements.pop(), e._insertElement(t, ep.HTML);
                break;
            case ef.P:
            case ef.DL:
            case ef.OL:
            case ef.UL:
            case ef.DIV:
            case ef.DIR:
            case ef.NAV:
            case ef.MAIN:
            case ef.MENU:
            case ef.ASIDE:
            case ef.CENTER:
            case ef.FIGURE:
            case ef.FOOTER:
            case ef.HEADER:
            case ef.HGROUP:
            case ef.DIALOG:
            case ef.DETAILS:
            case ef.ADDRESS:
            case ef.ARTICLE:
            case ef.SEARCH:
            case ef.SECTION:
            case ef.SUMMARY:
            case ef.FIELDSET:
            case ef.BLOCKQUOTE:
            case ef.FIGCAPTION:
                e.openElements.hasInButtonScope(ef.P) && e._closePElement(), e._insertElement(t, ep.HTML);
                break;
            case ef.LI:
            case ef.DD:
            case ef.DT:
                e.framesetOk = !1;
                let a = t.tagID;
                for (let t = e.openElements.stackTop; t >= 0; t--) {
                    let r = e.openElements.tagIDs[t];
                    if (a === ef.LI && r === ef.LI || (a === ef.DD || a === ef.DT) && (r === ef.DD || r === ef.DT)) {
                        e.openElements.generateImpliedEndTagsWithExclusion(r), e.openElements.popUntilTagNamePopped(r);
                        break
                    }
                    if (r !== ef.ADDRESS && r !== ef.DIV && r !== ef.P && e._isSpecialElement(e.openElements.items[t], r)) break
                }
                e.openElements.hasInButtonScope(ef.P) && e._closePElement(), e._insertElement(t, ep.HTML);
                break;
            case ef.BR:
            case ef.IMG:
            case ef.WBR:
            case ef.AREA:
            case ef.EMBED:
            case ef.KEYGEN:
                oU(e, t);
                break;
            case ef.HR:
                e.openElements.hasInButtonScope(ef.P) && e._closePElement(), e._appendElement(t, ep.HTML), e.framesetOk = !1, t.ackSelfClosing = !0;
                break;
            case ef.RB:
            case ef.RTC:
                e.openElements.hasInScope(ef.RUBY) && e.openElements.generateImpliedEndTags(), e._insertElement(t, ep.HTML);
                break;
            case ef.RT:
            case ef.RP:
                e.openElements.hasInScope(ef.RUBY) && e.openElements.generateImpliedEndTagsWithExclusion(ef.RTC), e._insertElement(t, ep.HTML);
                break;
            case ef.PRE:
            case ef.LISTING:
                e.openElements.hasInButtonScope(ef.P) && e._closePElement(), e._insertElement(t, ep.HTML), e.skipNextNewLine = !0, e.framesetOk = !1;
                break;
            case ef.XMP:
                e.openElements.hasInButtonScope(ef.P) && e._closePElement(), e._reconstructActiveFormattingElements(), e.framesetOk = !1, e._switchToTextParsing(t, sz.RAWTEXT);
                break;
            case ef.SVG:
                e._reconstructActiveFormattingElements(), oT(t), oE(t), t.selfClosing ? e._appendElement(t, ep.SVG) : e._insertElement(t, ep.SVG), t.ackSelfClosing = !0;
                break;
            case ef.HTML:
                0 === e.openElements.tmplCount && e.treeAdapter.adoptAttributes(e.openElements.items[0], t.attrs);
                break;
            case ef.BASE:
            case ef.LINK:
            case ef.META:
            case ef.STYLE:
            case ef.TITLE:
            case ef.SCRIPT:
            case ef.BGSOUND:
            case ef.BASEFONT:
            case ef.TEMPLATE:
                ow(e, t);
                break;
            case ef.BODY:
                let n;
                (n = e.openElements.tryPeekProperlyNestedBodyElement()) && 0 === e.openElements.tmplCount && (e.framesetOk = !1, e.treeAdapter.adoptAttributes(n, t.attrs));
                break;
            case ef.FORM:
                let i;
                i = e.openElements.tmplCount > 0, (!e.formElement || i) && (e.openElements.hasInButtonScope(ef.P) && e._closePElement(), e._insertElement(t, ep.HTML), i || (e.formElement = e.openElements.current));
                break;
            case ef.NOBR:
                e._reconstructActiveFormattingElements(), e.openElements.hasInScope(ef.NOBR) && (o_(e, t), e._reconstructActiveFormattingElements()), e._insertElement(t, ep.HTML), e.activeFormattingElements.pushElement(e.openElements.current, t);
                break;
            case ef.MATH:
                e._reconstructActiveFormattingElements(), oy(t), oE(t), t.selfClosing ? e._appendElement(t, ep.MATHML) : e._insertElement(t, ep.MATHML), t.ackSelfClosing = !0;
                break;
            case ef.TABLE:
                e.treeAdapter.getDocumentMode(e.document) !== eh.QUIRKS && e.openElements.hasInButtonScope(ef.P) && e._closePElement(), e._insertElement(t, ep.HTML), e.framesetOk = !1, e.insertionMode = eT.IN_TABLE;
                break;
            case ef.INPUT:
                e._reconstructActiveFormattingElements(), e._appendElement(t, ep.HTML), oG(t) || (e.framesetOk = !1), t.ackSelfClosing = !0;
                break;
            case ef.PARAM:
            case ef.TRACK:
            case ef.SOURCE:
                e._appendElement(t, ep.HTML), t.ackSelfClosing = !0;
                break;
            case ef.IMAGE:
                t.tagName = em.IMG, t.tagID = ef.IMG, oU(e, t);
                break;
            case ef.BUTTON:
                e.openElements.hasInScope(ef.BUTTON) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(ef.BUTTON)), e._reconstructActiveFormattingElements(), e._insertElement(t, ep.HTML), e.framesetOk = !1;
                break;
            case ef.APPLET:
            case ef.OBJECT:
            case ef.MARQUEE:
                e._reconstructActiveFormattingElements(), e._insertElement(t, ep.HTML), e.activeFormattingElements.insertMarker(), e.framesetOk = !1;
                break;
            case ef.IFRAME:
                e.framesetOk = !1, e._switchToTextParsing(t, sz.RAWTEXT);
                break;
            case ef.SELECT:
                e._reconstructActiveFormattingElements(), e._insertElement(t, ep.HTML), e.framesetOk = !1, e.insertionMode = e.insertionMode === eT.IN_TABLE || e.insertionMode === eT.IN_CAPTION || e.insertionMode === eT.IN_TABLE_BODY || e.insertionMode === eT.IN_ROW || e.insertionMode === eT.IN_CELL ? eT.IN_SELECT_IN_TABLE : eT.IN_SELECT;
                break;
            case ef.OPTION:
            case ef.OPTGROUP:
                e.openElements.currentTagId === ef.OPTION && e.openElements.pop(), e._reconstructActiveFormattingElements(), e._insertElement(t, ep.HTML);
                break;
            case ef.NOEMBED:
            case ef.NOFRAMES:
                oH(e, t);
                break;
            case ef.FRAMESET:
                let s;
                s = e.openElements.tryPeekProperlyNestedBodyElement(), e.framesetOk && s && (e.treeAdapter.detachNode(s), e.openElements.popAllUpToHtmlElement(), e._insertElement(t, ep.HTML), e.insertionMode = eT.IN_FRAMESET);
                break;
            case ef.TEXTAREA:
                e._insertElement(t, ep.HTML), e.skipNextNewLine = !0, e.tokenizer.state = sz.RCDATA, e.originalInsertionMode = e.insertionMode, e.framesetOk = !1, e.insertionMode = eT.TEXT;
                break;
            case ef.NOSCRIPT:
                e.options.scriptingEnabled ? oH(e, t) : oj(e, t);
                break;
            case ef.PLAINTEXT:
                e.openElements.hasInButtonScope(ef.P) && e._closePElement(), e._insertElement(t, ep.HTML), e.tokenizer.state = sz.PLAINTEXT;
                break;
            case ef.COL:
            case ef.TH:
            case ef.TD:
            case ef.TR:
            case ef.HEAD:
            case ef.FRAME:
            case ef.TBODY:
            case ef.TFOOT:
            case ef.THEAD:
            case ef.CAPTION:
            case ef.COLGROUP:
                break;
            default:
                oj(e, t)
        }
    }

    function oK(e, t) {
        let r = t.tagName,
            a = t.tagID;
        for (let t = e.openElements.stackTop; t > 0; t--) {
            let n = e.openElements.items[t],
                i = e.openElements.tagIDs[t];
            if (a === i && (a !== ef.UNKNOWN || e.treeAdapter.getTagName(n) === r)) {
                e.openElements.generateImpliedEndTagsWithExclusion(a), e.openElements.stackTop >= t && e.openElements.shortenToLength(t);
                break
            }
            if (e._isSpecialElement(n, i)) break
        }
    }

    function oY(e, t) {
        switch (t.tagID) {
            case ef.A:
            case ef.B:
            case ef.I:
            case ef.S:
            case ef.U:
            case ef.EM:
            case ef.TT:
            case ef.BIG:
            case ef.CODE:
            case ef.FONT:
            case ef.NOBR:
            case ef.SMALL:
            case ef.STRIKE:
            case ef.STRONG:
                o_(e, t);
                break;
            case ef.P:
                e.openElements.hasInButtonScope(ef.P) || e._insertFakeElement(em.P, ef.P), e._closePElement();
                break;
            case ef.DL:
            case ef.UL:
            case ef.OL:
            case ef.DIR:
            case ef.DIV:
            case ef.NAV:
            case ef.PRE:
            case ef.MAIN:
            case ef.MENU:
            case ef.ASIDE:
            case ef.BUTTON:
            case ef.CENTER:
            case ef.FIGURE:
            case ef.FOOTER:
            case ef.HEADER:
            case ef.HGROUP:
            case ef.DIALOG:
            case ef.ADDRESS:
            case ef.ARTICLE:
            case ef.DETAILS:
            case ef.SEARCH:
            case ef.SECTION:
            case ef.SUMMARY:
            case ef.LISTING:
            case ef.FIELDSET:
            case ef.BLOCKQUOTE:
            case ef.FIGCAPTION:
                let r;
                r = t.tagID, e.openElements.hasInScope(r) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(r));
                break;
            case ef.LI:
                e.openElements.hasInListItemScope(ef.LI) && (e.openElements.generateImpliedEndTagsWithExclusion(ef.LI), e.openElements.popUntilTagNamePopped(ef.LI));
                break;
            case ef.DD:
            case ef.DT:
                let a;
                a = t.tagID, e.openElements.hasInScope(a) && (e.openElements.generateImpliedEndTagsWithExclusion(a), e.openElements.popUntilTagNamePopped(a));
                break;
            case ef.H1:
            case ef.H2:
            case ef.H3:
            case ef.H4:
            case ef.H5:
            case ef.H6:
                e.openElements.hasNumberedHeaderInScope() && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilNumberedHeaderPopped());
                break;
            case ef.BR:
                e._reconstructActiveFormattingElements(), e._insertFakeElement(em.BR, ef.BR), e.openElements.pop(), e.framesetOk = !1;
                break;
            case ef.BODY:
                if (e.openElements.hasInScope(ef.BODY) && (e.insertionMode = eT.AFTER_BODY, e.options.sourceCodeLocationInfo)) {
                    let r = e.openElements.tryPeekProperlyNestedBodyElement();
                    r && e._setEndLocation(r, t)
                }
                break;
            case ef.HTML:
                e.openElements.hasInScope(ef.BODY) && (e.insertionMode = eT.AFTER_BODY, le(e, t));
                break;
            case ef.FORM:
                ! function(e) {
                    let t = e.openElements.tmplCount > 0,
                        {
                            formElement: r
                        } = e;
                    t || (e.formElement = null), (r || t) && e.openElements.hasInScope(ef.FORM) && (e.openElements.generateImpliedEndTags(), t ? e.openElements.popUntilTagNamePopped(ef.FORM) : r && e.openElements.remove(r))
                }(e);
                break;
            case ef.APPLET:
            case ef.OBJECT:
            case ef.MARQUEE:
                let n;
                n = t.tagID, e.openElements.hasInScope(n) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(n), e.activeFormattingElements.clearToLastMarker());
                break;
            case ef.TEMPLATE:
                oO(e, t);
                break;
            default:
                oK(e, t)
        }
    }

    function oW(e, t) {
        e.tmplInsertionModeStack.length > 0 ? o7(e, t) : ox(e, t)
    }

    function oq(e, t) {
        if (void 0 !== e.openElements.currentTagId && oI.has(e.openElements.currentTagId)) switch (e.pendingCharacterTokens.length = 0, e.hasNonWhitespacePendingCharacterToken = !1, e.originalInsertionMode = e.insertionMode, e.insertionMode = eT.IN_TABLE_TEXT, t.type) {
            case es.CHARACTER:
                o$(e, t);
                break;
            case es.WHITESPACE_CHARACTER:
                oZ(e, t)
        } else oJ(e, t)
    }

    function oV(e, t) {
        switch (t.tagID) {
            case ef.TD:
            case ef.TH:
            case ef.TR:
                e.openElements.clearBackToTableContext(), e._insertFakeElement(em.TBODY, ef.TBODY), e.insertionMode = eT.IN_TABLE_BODY, o5(e, t);
                break;
            case ef.STYLE:
            case ef.SCRIPT:
            case ef.TEMPLATE:
                ow(e, t);
                break;
            case ef.COL:
                e.openElements.clearBackToTableContext(), e._insertFakeElement(em.COLGROUP, ef.COLGROUP), e.insertionMode = eT.IN_COLUMN_GROUP, o1(e, t);
                break;
            case ef.FORM:
                e.formElement || 0 !== e.openElements.tmplCount || (e._insertElement(t, ep.HTML), e.formElement = e.openElements.current, e.openElements.pop());
                break;
            case ef.TABLE:
                e.openElements.hasInTableScope(ef.TABLE) && (e.openElements.popUntilTagNamePopped(ef.TABLE), e._resetInsertionMode(), e._processStartTag(t));
                break;
            case ef.TBODY:
            case ef.TFOOT:
            case ef.THEAD:
                e.openElements.clearBackToTableContext(), e._insertElement(t, ep.HTML), e.insertionMode = eT.IN_TABLE_BODY;
                break;
            case ef.INPUT:
                oG(t) ? e._appendElement(t, ep.HTML) : oJ(e, t), t.ackSelfClosing = !0;
                break;
            case ef.CAPTION:
                e.openElements.clearBackToTableContext(), e.activeFormattingElements.insertMarker(), e._insertElement(t, ep.HTML), e.insertionMode = eT.IN_CAPTION;
                break;
            case ef.COLGROUP:
                e.openElements.clearBackToTableContext(), e._insertElement(t, ep.HTML), e.insertionMode = eT.IN_COLUMN_GROUP;
                break;
            default:
                oJ(e, t)
        }
    }

    function oz(e, t) {
        switch (t.tagID) {
            case ef.TABLE:
                e.openElements.hasInTableScope(ef.TABLE) && (e.openElements.popUntilTagNamePopped(ef.TABLE), e._resetInsertionMode());
                break;
            case ef.TEMPLATE:
                oO(e, t);
                break;
            case ef.BODY:
            case ef.CAPTION:
            case ef.COL:
            case ef.COLGROUP:
            case ef.HTML:
            case ef.TBODY:
            case ef.TD:
            case ef.TFOOT:
            case ef.TH:
            case ef.THEAD:
            case ef.TR:
                break;
            default:
                oJ(e, t)
        }
    }

    function oJ(e, t) {
        let r = e.fosterParentingEnabled;
        e.fosterParentingEnabled = !0, oB(e, t), e.fosterParentingEnabled = r
    }

    function oZ(e, t) {
        e.pendingCharacterTokens.push(t)
    }

    function o$(e, t) {
        e.pendingCharacterTokens.push(t), e.hasNonWhitespacePendingCharacterToken = !0
    }

    function oX(e, t) {
        let r = 0;
        if (e.hasNonWhitespacePendingCharacterToken)
            for (; r < e.pendingCharacterTokens.length; r++) oJ(e, e.pendingCharacterTokens[r]);
        else
            for (; r < e.pendingCharacterTokens.length; r++) e._insertCharacters(e.pendingCharacterTokens[r]);
        e.insertionMode = e.originalInsertionMode, e._processToken(t)
    }
    let o0 = new Set([ef.CAPTION, ef.COL, ef.COLGROUP, ef.TBODY, ef.TD, ef.TFOOT, ef.TH, ef.THEAD, ef.TR]);

    function o1(e, t) {
        switch (t.tagID) {
            case ef.HTML:
                oQ(e, t);
                break;
            case ef.COL:
                e._appendElement(t, ep.HTML), t.ackSelfClosing = !0;
                break;
            case ef.TEMPLATE:
                ow(e, t);
                break;
            default:
                o2(e, t)
        }
    }

    function o2(e, t) {
        e.openElements.currentTagId === ef.COLGROUP && (e.openElements.pop(), e.insertionMode = eT.IN_TABLE, e._processToken(t))
    }

    function o5(e, t) {
        switch (t.tagID) {
            case ef.TR:
                e.openElements.clearBackToTableBodyContext(), e._insertElement(t, ep.HTML), e.insertionMode = eT.IN_ROW;
                break;
            case ef.TH:
            case ef.TD:
                e.openElements.clearBackToTableBodyContext(), e._insertFakeElement(em.TR, ef.TR), e.insertionMode = eT.IN_ROW, o3(e, t);
                break;
            case ef.CAPTION:
            case ef.COL:
            case ef.COLGROUP:
            case ef.TBODY:
            case ef.TFOOT:
            case ef.THEAD:
                e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = eT.IN_TABLE, oV(e, t));
                break;
            default:
                oV(e, t)
        }
    }

    function o6(e, t) {
        let r = t.tagID;
        switch (t.tagID) {
            case ef.TBODY:
            case ef.TFOOT:
            case ef.THEAD:
                e.openElements.hasInTableScope(r) && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = eT.IN_TABLE);
                break;
            case ef.TABLE:
                e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = eT.IN_TABLE, oz(e, t));
                break;
            case ef.BODY:
            case ef.CAPTION:
            case ef.COL:
            case ef.COLGROUP:
            case ef.HTML:
            case ef.TD:
            case ef.TH:
            case ef.TR:
                break;
            default:
                oz(e, t)
        }
    }

    function o3(e, t) {
        switch (t.tagID) {
            case ef.TH:
            case ef.TD:
                e.openElements.clearBackToTableRowContext(), e._insertElement(t, ep.HTML), e.insertionMode = eT.IN_CELL, e.activeFormattingElements.insertMarker();
                break;
            case ef.CAPTION:
            case ef.COL:
            case ef.COLGROUP:
            case ef.TBODY:
            case ef.TFOOT:
            case ef.THEAD:
            case ef.TR:
                e.openElements.hasInTableScope(ef.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = eT.IN_TABLE_BODY, o5(e, t));
                break;
            default:
                oV(e, t)
        }
    }

    function o4(e, t) {
        switch (t.tagID) {
            case ef.TR:
                e.openElements.hasInTableScope(ef.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = eT.IN_TABLE_BODY);
                break;
            case ef.TABLE:
                e.openElements.hasInTableScope(ef.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = eT.IN_TABLE_BODY, o6(e, t));
                break;
            case ef.TBODY:
            case ef.TFOOT:
            case ef.THEAD:
                (e.openElements.hasInTableScope(t.tagID) || e.openElements.hasInTableScope(ef.TR)) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = eT.IN_TABLE_BODY, o6(e, t));
                break;
            case ef.BODY:
            case ef.CAPTION:
            case ef.COL:
            case ef.COLGROUP:
            case ef.HTML:
            case ef.TD:
            case ef.TH:
                break;
            default:
                oz(e, t)
        }
    }

    function o8(e, t) {
        switch (t.tagID) {
            case ef.HTML:
                oQ(e, t);
                break;
            case ef.OPTION:
                e.openElements.currentTagId === ef.OPTION && e.openElements.pop(), e._insertElement(t, ep.HTML);
                break;
            case ef.OPTGROUP:
                e.openElements.currentTagId === ef.OPTION && e.openElements.pop(), e.openElements.currentTagId === ef.OPTGROUP && e.openElements.pop(), e._insertElement(t, ep.HTML);
                break;
            case ef.HR:
                e.openElements.currentTagId === ef.OPTION && e.openElements.pop(), e.openElements.currentTagId === ef.OPTGROUP && e.openElements.pop(), e._appendElement(t, ep.HTML), t.ackSelfClosing = !0;
                break;
            case ef.INPUT:
            case ef.KEYGEN:
            case ef.TEXTAREA:
            case ef.SELECT:
                e.openElements.hasInSelectScope(ef.SELECT) && (e.openElements.popUntilTagNamePopped(ef.SELECT), e._resetInsertionMode(), t.tagID !== ef.SELECT && e._processStartTag(t));
                break;
            case ef.SCRIPT:
            case ef.TEMPLATE:
                ow(e, t)
        }
    }

    function o9(e, t) {
        switch (t.tagID) {
            case ef.OPTGROUP:
                e.openElements.stackTop > 0 && e.openElements.currentTagId === ef.OPTION && e.openElements.tagIDs[e.openElements.stackTop - 1] === ef.OPTGROUP && e.openElements.pop(), e.openElements.currentTagId === ef.OPTGROUP && e.openElements.pop();
                break;
            case ef.OPTION:
                e.openElements.currentTagId === ef.OPTION && e.openElements.pop();
                break;
            case ef.SELECT:
                e.openElements.hasInSelectScope(ef.SELECT) && (e.openElements.popUntilTagNamePopped(ef.SELECT), e._resetInsertionMode());
                break;
            case ef.TEMPLATE:
                oO(e, t)
        }
    }

    function o7(e, t) {
        e.openElements.tmplCount > 0 ? (e.openElements.popUntilTagNamePopped(ef.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode(), e.onEof(t)) : ox(e, t)
    }

    function le(e, t) {
        var r;
        if (t.tagID === ef.HTML) {
            if (e.fragmentContext || (e.insertionMode = eT.AFTER_AFTER_BODY), e.options.sourceCodeLocationInfo && e.openElements.tagIDs[0] === ef.HTML) {
                e._setEndLocation(e.openElements.items[0], t);
                let a = e.openElements.items[1];
                !a || (null == (r = e.treeAdapter.getNodeSourceCodeLocation(a)) ? void 0 : r.endTag) || e._setEndLocation(a, t)
            }
        } else lt(e, t)
    }

    function lt(e, t) {
        e.insertionMode = eT.IN_BODY, oB(e, t)
    }

    function lr(e, t) {
        e.insertionMode = eT.IN_BODY, oB(e, t)
    }

    function la(e) {
        for (; e.treeAdapter.getNamespaceURI(e.openElements.current) !== ep.HTML && void 0 !== e.openElements.currentTagId && !e._isIntegrationPoint(e.openElements.currentTagId, e.openElements.current);) e.openElements.pop()
    }

    function ln(e, t) {
        return function(r) {
            let a, n = 0,
                i = "";
            for (; a = e.exec(r);) n !== a.index && (i += r.substring(n, a.index)), i += t.get(a[0].charCodeAt(0)), n = a.index + 1;
            return i + r.substring(n)
        }
    }
    String.prototype.codePointAt;
    let li = ln(/["&\u00A0]/g, new Map([
            [34, "&quot;"],
            [38, "&amp;"],
            [160, "&nbsp;"]
        ])),
        ls = ln(/[&<>\u00A0]/g, new Map([
            [38, "&amp;"],
            [60, "&lt;"],
            [62, "&gt;"],
            [160, "&nbsp;"]
        ])),
        lo = new Set([em.AREA, em.BASE, em.BASEFONT, em.BGSOUND, em.BR, em.COL, em.EMBED, em.FRAME, em.HR, em.IMG, em.INPUT, em.KEYGEN, em.LINK, em.META, em.PARAM, em.SOURCE, em.TRACK, em.WBR]),
        ll = {
            treeAdapter: os,
            scriptingEnabled: !0
        };
    var lc = e.i(844866),
        lc = lc;

    function lu(e) {
        let t = e.includes('"') ? "'" : '"';
        return t + e + t
    }
    let ld = {
            isCommentNode: rX,
            isElementNode: rJ,
            isTextNode: r$,
            createDocument() {
                let e = new rV([]);
                return e["x-mode"] = lc.DOCUMENT_MODE.NO_QUIRKS, e
            },
            createDocumentFragment: () => new rV([]),
            createElement(e, t, r) {
                let a = Object.create(null),
                    n = Object.create(null),
                    i = Object.create(null);
                for (let e = 0; e < r.length; e++) {
                    let t = r[e].name;
                    a[t] = r[e].value, n[t] = r[e].namespace, i[t] = r[e].prefix
                }
                let s = new rz(e, a, []);
                return s.namespace = t, s["x-attribsNamespace"] = n, s["x-attribsPrefix"] = i, s
            },
            createCommentNode: e => new rK(e),
            createTextNode: e => new rQ(e),
            appendChild(e, t) {
                let r = e.children[e.children.length - 1];
                r && (r.next = t, t.prev = r), e.children.push(t), t.parent = e
            },
            insertBefore(e, t, r) {
                let a = e.children.indexOf(r),
                    {
                        prev: n
                    } = r;
                n && (n.next = t, t.prev = n), r.prev = t, t.next = r, e.children.splice(a, 0, t), t.parent = e
            },
            setTemplateContent(e, t) {
                ld.appendChild(e, t)
            },
            getTemplateContent: e => e.children[0],
            setDocumentType(e, t, r, a) {
                let n, i = (n = "!DOCTYPE ", t && (n += t), r ? n += ` PUBLIC ${lu(r)}` : a && (n += " SYSTEM"), a && (n += ` ${lu(a)}`), n),
                    s = e.children.find(e => r0(e) && "!doctype" === e.name);
                s ? s.data = null != i ? i : null : (s = new rY("!doctype", i), ld.appendChild(e, s)), s["x-name"] = t, s["x-publicId"] = r, s["x-systemId"] = a
            },
            setDocumentMode(e, t) {
                e["x-mode"] = t
            },
            getDocumentMode: e => e["x-mode"],
            detachNode(e) {
                if (e.parent) {
                    let t = e.parent.children.indexOf(e),
                        {
                            prev: r,
                            next: a
                        } = e;
                    e.prev = null, e.next = null, r && (r.next = a), a && (a.prev = r), e.parent.children.splice(t, 1), e.parent = null
                }
            },
            insertText(e, t) {
                let r = e.children[e.children.length - 1];
                r && r$(r) ? r.data += t : ld.appendChild(e, ld.createTextNode(t))
            },
            insertTextBefore(e, t, r) {
                let a = e.children[e.children.indexOf(r) - 1];
                a && r$(a) ? a.data += t : ld.insertBefore(e, ld.createTextNode(t), r)
            },
            adoptAttributes(e, t) {
                for (let r = 0; r < t.length; r++) {
                    let a = t[r].name;
                    void 0 === e.attribs[a] && (e.attribs[a] = t[r].value, e["x-attribsNamespace"][a] = t[r].namespace, e["x-attribsPrefix"][a] = t[r].prefix)
                }
            },
            getFirstChild: e => e.children[0],
            getChildNodes: e => e.children,
            getParentNode: e => e.parent,
            getAttrList: e => e.attributes,
            getTagName: e => e.name,
            getNamespaceURI: e => e.namespace,
            getTextNodeContent: e => e.data,
            getCommentNodeContent: e => e.data,
            getDocumentTypeNodeName(e) {
                var t;
                return null != (t = e["x-name"]) ? t : ""
            },
            getDocumentTypeNodePublicId(e) {
                var t;
                return null != (t = e["x-publicId"]) ? t : ""
            },
            getDocumentTypeNodeSystemId(e) {
                var t;
                return null != (t = e["x-systemId"]) ? t : ""
            },
            isDocumentTypeNode: e => r0(e) && "!doctype" === e.name,
            setNodeSourceCodeLocation(e, t) {
                t && (e.startIndex = t.startOffset, e.endIndex = t.endOffset), e.sourceCodeLocation = t
            },
            getNodeSourceCodeLocation: e => e.sourceCodeLocation,
            updateNodeSourceCodeLocation(e, t) {
                null != t.endOffset && (e.endIndex = t.endOffset), e.sourceCodeLocation = { ...e.sourceCodeLocation,
                    ...t
                }
            }
        },
        lp = {
            treeAdapter: ld
        },
        lA = (M = (e, t, r, a) => {
            var n, i, s;
            let o, l;
            return t._useHtmlParser2 ? (new nx(o = new r4(void 0, t), t).end(e), o.root) : (null != t.treeAdapter || (t.treeAdapter = ld), !1 !== t.scriptingEnabled && (t.scriptingEnabled = !0), r ? oS.parse(e, t) : (n = a, i = e, s = t, "string" == typeof n && (s = i, i = n, n = null), (l = oS.getFragmentParser(n, s)).tokenizer.write(i, !0), l.getFragment()))
        }, L = function(e, t, r, a) {
            if (void 0 !== no.Buffer && no.Buffer.isBuffer(e) && (e = e.toString()), "string" == typeof e) return M(e, t, r, a);
            let n = e;
            if (!Array.isArray(n) && r1(n)) return n;
            let i = new rV([]);
            return sp(n, i), i
        }, B = (e, t) => t._useHtmlParser2 ? af(e, t) : function(e) {
            let t = "length" in e ? e : [e];
            for (let e = 0; e < t.length; e += 1) {
                let r = t[e];
                r1(r) && Array.prototype.splice.call(t, e, 1, ...r.children)
            }
            let r = "";
            for (let e = 0; e < t.length; e += 1) {
                var a;
                r += (a = t[e], function e(t, r) {
                    return r.treeAdapter.isElementNode(t) ? function(t, r) {
                        let a = r.treeAdapter.getTagName(t);
                        return `<${a}${function(e,{treeAdapter:t}){let r="";for(let a of t.getAttrList(e)){if(r+=" ",a.namespace)switch(a.namespace){case ep.XML:r+=`
                        xml: $ {
                            a.name
                        }
                        `;break;case ep.XMLNS:"xmlns"!==a.name&&(r+="xmlns:"),r+=a.name;break;case ep.XLINK:r+=`
                        xlink: $ {
                            a.name
                        }
                        `;break;default:r+=`
                        $ {
                            a.prefix
                        }: $ {
                            a.name
                        }
                        `}else r+=a.name;r+=` = "${li(a.value)}"
                        `}return r}(t,r)}>${r.treeAdapter.isElementNode(t)&&r.treeAdapter.getNamespaceURI(t)===ep.HTML&&lo.has(r.treeAdapter.getTagName(t))?"":`${function(t,r){let a="",n=r.treeAdapter.isElementNode(t)&&r.treeAdapter.getTagName(t)===em.TEMPLATE&&r.treeAdapter.getNamespaceURI(t)===ep.HTML?r.treeAdapter.getTemplateContent(t):t,i=r.treeAdapter.getChildNodes(n);if(i)for(let t of i)a+=e(t,r);return a}(t,r)}</${a}>`}`
                    }(t, r) : r.treeAdapter.isTextNode(t) ? function(e, t) {
                        let {
                            treeAdapter: r
                        } = t, a = r.getTextNodeContent(e), n = r.getParentNode(e), i = n && r.isElementNode(n) && r.getTagName(n);
                        return i && r.getNamespaceURI(n) === ep.HTML && sV(i, t.scriptingEnabled) ? a : ls(a)
                    }(t, r) : r.treeAdapter.isCommentNode(t) ? function(e, {
                        treeAdapter: t
                    }) {
                        return `<!--${t.getCommentNodeContent(e)}-->`
                    }(t, r) : r.treeAdapter.isDocumentTypeNode(t) ? function(e, {
                        treeAdapter: t
                    }) {
                        return `<!DOCTYPE ${t.getDocumentTypeNodeName(e)}>`
                    }(t, r) : ""
                }(a, { ...ll,
                    ...lp
                }))
            }
            return r
        }(e), function e(t, r, a = !0) {
            if (null == t) throw Error("cheerio.load() expects a string");
            let n = a4(r),
                i = L(t, n, a, null);
            class s extends sk {
                _make(e, t) {
                    let r = o(e, t);
                    return r.prevObject = this, r
                }
                _parse(e, t, r, a) {
                    return L(e, t, r, a)
                }
                _render(e) {
                    return B(e, this.options)
                }
            }

            function o(e, t, r = i, a) {
                var l;
                if (e && nr(e)) return e;
                let c = a4(a, n),
                    u = "string" == typeof r ? [L(r, c, !1, null)] : "length" in r ? r : [r],
                    d = nr(u) ? u : new s(u, null, c);
                if (d._root = d, !e) return new s(void 0, d, c);
                let p = "string" == typeof e && nn(e) ? L(e, c, !1, null).children : (l = e).name || l.type === nk.Root || l.type === nk.Text || l.type === nk.Comment ? [e] : Array.isArray(e) ? e : void 0,
                    A = new s(p, d, c);
                if (p) return A;
                if ("string" != typeof e) throw TypeError("Unexpected type of selector");
                let h = e,
                    m = t ? "string" == typeof t ? nn(t) ? new s([L(t, c, !1, null)], d, c) : (h = `${t} ${h}`, d) : nr(t) ? t : new s(Array.isArray(t) ? t : [t], d, c) : d;
                return m ? m.find(h) : A
            }
            return Object.assign(o, nt, {
                load: e,
                _root: i,
                _options: n,
                fn: s.prototype,
                prototype: s.prototype
            }), o
        }),
        lh = /^(fc|frog|og:image|og:title)/;
    async function lm(e) {
        try {
            let t = await fetch(e).then(e => e.text()),
                r = lA(t),
                a = [];
            return r("meta").each((e, t) => {
                let n = r(t).attr("property"),
                    i = r(t).attr("content");
                n ? .match(lh) && a.push({
                    property: n,
                    content: i ? ? ""
                })
            }), a
        } catch (t) {
            throw Error(`Failed to extract frame meta tags from "${e}".

Error: ${t instanceof Error?t.message:String(t)}`, {
                cause: t
            })
        }
    }
    let lf = "Live events where you can predict the words and phrases that will be said.",
        lg = [...tj, {
            name: "title",
            content: "Mentions Polymarkets | Polymarket"
        }, {
            name: "description",
            content: lf
        }, {
            property: "og:title",
            content: "Mentions Polymarkets | Polymarket"
        }, {
            property: "og:description",
            content: lf
        }, {
            property: "og:image",
            content: tR.DEFAULT_TWITTER_IMG
        }, {
            name: "twitter:image:src",
            content: tR.DEFAULT_TWITTER_IMG
        }, {
            name: "twitter:image",
            content: tR.DEFAULT_TWITTER_IMG
        }],
        ly = ({
            searchQuery: e,
            sortParam: t,
            tagSlug: r,
            locale: a = "en",
            isPredictionsPage: n,
            currentDate: i,
            messages: s
        }) => {
            let o, l, c, u = r ? (0, tw.sanitizeSlug)(r) : void 0,
                d = tQ(s),
                p = (() => {
                    if (e) return d.searchMeta.searchResultsTitle.replace("{query}", e);
                    if (u) {
                        let e = tB((0, tv.tagToReadableString)(u));
                        return n ? t$(d.predictionsPage.title.replace("{tag}", e)) : t$(d.searchMeta.tagTitle.replace("{tag}", e))
                    }
                    return n ? d.predictionsHub.title : "volume" === t ? d.searchMeta.volumeTitle : "competitive" === t ? d.searchMeta.competitiveTitle : "ending_soon" === t ? d.searchMeta.endingSoonTitle : "liquidity" === t ? d.searchMeta.liquidityTitle : "newest" === t ? d.searchMeta.newestTitle : d.searchMeta.exploreTitle
                })(),
                A = (() => {
                    if (e) return d.searchMeta.searchResultsDescription.replace("{query}", e);
                    if (u) {
                        let e = tB((0, tv.tagToReadableString)(u));
                        return n ? tD({
                            tag: e,
                            currentDate: i,
                            locale: a,
                            messages: s
                        }) : d.searchMeta.tagDescription.replace("{tag}", e)
                    }
                    return n ? d.predictionsHub.description : d.searchMeta.defaultDescription
                })(),
                h = (o = new URLSearchParams, e && o.append("_q", (0, tv.normalizeSearchQueryForUrl)(e)), t && o.append("_sort", t), l = o.toString(), u ? `${tO.CURRENT_ORIGIN}/predictions/${u}` : n ? `${tO.CURRENT_ORIGIN}/predictions` : l ? `${tO.CURRENT_ORIGIN}/search?${l}` : `${tO.CURRENT_ORIGIN}/search`),
                m = (0, tW.appendOgTid)((c = new URLSearchParams, e && c.append("_q", e), u && c.append("tag", u), a && "en" !== a && c.append("locale", a), c.toString() ? `${tO.CURRENT_ORIGIN}/api/og/search?${c.toString()}` : `${tO.CURRENT_ORIGIN}/api/og/search`));
            return [...tj, {
                name: "title",
                content: p
            }, {
                name: "description",
                content: A
            }, {
                property: "og:title",
                content: p
            }, {
                property: "og:description",
                content: A
            }, {
                property: "og:url",
                content: h
            }, {
                property: "og:image",
                content: m
            }, {
                name: "twitter:description",
                content: A
            }, {
                name: "twitter:image",
                content: m
            }, {
                name: "twitter:image:src",
                content: m
            }]
        },
        lT = [...tj, {
            property: "og:image",
            content: tR.DEFAULT_TWITTER_IMG
        }, {
            name: "twitter:image:src",
            content: tR.DEFAULT_TWITTER_IMG
        }, {
            name: "twitter:image",
            content: tR.DEFAULT_TWITTER_IMG
        }],
        lE = "Trump won, now what? | Polymarket",
        lb = "Trump won the 2024 US Presidential Election, now what? Explore the latest polymarkets on Trump's policies and cabinet picks ahead of his inauguration.",
        lI = `${tO.CURRENT_ORIGIN}/dashboards/trump`,
        lC = `${tO.CURRENT_ORIGIN}/images/trump/trump-won-og-image.png`,
        lS = [...tj, {
            name: "title",
            content: lE
        }, {
            name: "description",
            content: lb
        }, {
            property: "og:title",
            content: lE
        }, {
            property: "og:description",
            content: lb
        }, {
            property: "og:image",
            content: lC
        }, {
            property: "og:url",
            content: lI
        }, {
            name: "twitter:description",
            content: lb
        }, {
            name: "twitter:image:src",
            content: lC
        }, {
            name: "twitter:image",
            content: lC
        }, {
            name: "twitter:url",
            content: lI
        }],
        l_ = "Polymarket | USA Waitlist",
        lN = "Polymarket | USA Waitlist",
        lx = `${tO.CURRENT_ORIGIN}/images/us/us-og.png`,
        lk = [...tj, {
            name: "title",
            content: l_
        }, {
            name: "description",
            content: lN
        }, {
            property: "og:title",
            content: l_
        }, {
            property: "og:description",
            content: lN
        }, {
            property: "og:image",
            content: lx
        }, {
            name: "twitter:image:src",
            content: lx
        }, {
            name: "twitter:image",
            content: lx
        }],
        lD = {
            temperature: "Temperature",
            "high-temperature": "High Temp",
            "low-temperature": "Low Temp",
            precipitation: "Precipitation",
            global: "Global",
            tornadoes: "Tornadoes",
            hurricanes: "Hurricanes",
            earthquakes: "Earthquakes",
            volcanoes: "Volcanoes",
            pandemics: "Pandemics"
        },
        lv = {
            temperature: "temperature",
            "high-temperature": "highTemperature",
            "low-temperature": "lowTemperature",
            precipitation: "precipitation",
            global: "global",
            tornadoes: "tornadoes",
            hurricanes: "hurricanes",
            earthquakes: "earthquakes",
            volcanoes: "volcanoes",
            pandemics: "pandemics"
        },
        lw = e => {
            let t = e.filter || "",
                r = e.currentDate || new Date,
                a = e.locale || "en",
                {
                    messages: n
                } = e,
                i = tQ(n),
                s = t.toLowerCase(),
                o = s in lD,
                l = o ? lv[s] : void 0,
                c = o ? n.weather[l] : n.weather.title,
                u = tN(r, a),
                d = t$(`${c} ${i.event.oddsAndPredictions}${i.titleSuffix}`),
                p = i.weatherMeta.description.replace("{category}", c).replace("{date}", u),
                A = a && "en" !== a ? `/${a}` : "";
            return [...tj, {
                name: "title",
                content: d
            }, {
                name: "description",
                content: p
            }, {
                property: "og:title",
                content: d
            }, {
                property: "og:description",
                content: p
            }, {
                property: "og:url",
                content: `${tO.CURRENT_ORIGIN}${A}/predictions/${o?s:"weather"}`
            }, {
                property: "og:image",
                content: tR.DEFAULT_TWITTER_IMG
            }, {
                name: "twitter:description",
                content: p
            }, {
                name: "twitter:image",
                content: tR.DEFAULT_TWITTER_IMG
            }, {
                name: "keywords",
                content: "weather predictions, climate forecast, temperature odds, hurricane predictions, weather markets, tornado predictions, earthquake odds"
            }]
        };
    e.s(["WEATHER_FILTER_NAMES", 0, lD, "getWeatherPageMetaTags", 0, lw], 50836);
    let lO = "https://polymarket-upload.s3.us-east-2.amazonaws.com/breakingog.png",
        lR = ["politics", "world", "sports", "crypto", "finance", "tech", "culture"],
        lM = e => lR.includes(e);

    function lL(e, t) {
        return [...tj, {
            name: "title",
            content: e
        }, {
            name: "description",
            content: t
        }, {
            property: "og:title",
            content: e
        }, {
            property: "og:description",
            content: t
        }, {
            property: "og:image",
            content: lO
        }, {
            name: "twitter:image:src",
            content: lO
        }, {
            name: "twitter:image",
            content: lO
        }]
    }

    function lB(e, t) {
        if (e) {
            let r = t ? .breaking ? .meta ? .[e];
            return lL(r ? .title ? ? "", r ? .description ? ? "")
        }
        return lL(t ? .breaking ? .meta ? .defaultTitle ? ? "", t ? .breaking ? .meta ? .defaultDescription ? ? "")
    }
    e.s(["getBreakingCategoryMeta", 0, function(e, t) {
        return t ? .breaking ? .meta ? .[e]
    }, "getBreakingPageMetaTags", 0, lB, "isValidBreakingCategory", 0, lM], 35479);
    let lP = "NYC Mayoral Election | Polymarket",
        lF = "Will Mamdani take down Cuomo? Trust markets, not polls. Live and accurate forecasts by the world's largest prediction market.",
        lU = `${tO.CURRENT_ORIGIN}/nyc`,
        lG = `${tO.CURRENT_ORIGIN}/images/elections/nyc/assets/ny-election-og.png`,
        lH = [...tj, {
            name: "title",
            content: lP
        }, {
            name: "description",
            content: lF
        }, {
            property: "og:title",
            content: lP
        }, {
            property: "og:description",
            content: lF
        }, {
            property: "og:image",
            content: lG
        }, {
            property: "og:url",
            content: lU
        }, {
            name: "twitter:image:src",
            content: lG
        }, {
            name: "twitter:image",
            content: lG
        }],
        lj = eC.default.createContext({}),
        lQ = "https://polymarket.com",
        lK = Object.keys(to.LANGUAGES);

    function lY() {
        return eC.default.useContext(lj).serverDate
    }

    function lW(e) {
        return "og:image" !== e.property && "og:title" !== e.property
    }

    function lq(e, t) {
        return e[t.property] = t.content, e
    }

    function lV(e) {
        let [t, r] = e;
        return {
            key: t,
            property: t,
            content: r
        }
    }

    function lz(e) {
        return "name" in e && "twitter:title" === e.name
    }

    function lJ(e) {
        return "property" in e && "og:title" === e.property
    }

    function lZ(e) {
        let [t, r] = e;
        return {
            key: t,
            property: t,
            content: r
        }
    }

    function l$(e) {
        return (0, eE.jsx)(eC.default.Fragment, {
            children: "title" === e.name && e.content ? (0, eE.jsx)("title", {
                children: e.content
            }, `title-${String(e.key??e.name??e.property)}`) : (0, eE.jsx)("meta", { ...e
            }, e.key ? ? e.name ? ? e.property)
        }, `fragment-${String(e.key??e.name??e.property)}`)
    }

    function lX(e) {
        return (0, eE.jsx)("link", {
            rel: "alternate",
            hrefLang: e.hreflang,
            href: e.href
        }, `hreflang-${e.hreflang}`)
    }
    e.s(["MetaContextProvider", 0, e => {
        let t, r, a, n, i, s, o, l, c, u, d, p, A, h, m, f, g, y, T = (0, eb.c)(131),
            {
                children: E,
                frameMetadata: b,
                serverDate: I
            } = e;
        I && (0, tC.initFromServerDate)(I);
        let C = (0, eD.useQueryClient)(),
            S = (0, eS.useRouter)(),
            _ = (0, e_.useTranslations)(),
            N = (0, tl.useLocale)(),
            x = (0, tl.useMessages)();
        T[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {}, T[0] = t) : t = T[0];
        let [k, D] = eC.default.useState(t);
        T[1] === Symbol.for("react.memo_cache_sentinel") ? (r = async e => {
            try {
                let t = (await lm(`https://embed.polymarket.com/market.html?market=${e}`)).filter(lW).reduce(lq, {});
                D(t)
            } catch (t) {
                (0, tS.handleError)(t, "[MetaContext] error fetching frame metadata", "nouser", "", {
                    marketSlug: e
                })
            }
        }, T[1] = r) : r = T[1];
        let v = r;
        if (T[2] !== b || T[3] !== k || T[4] !== N || T[5] !== x || T[6] !== C || T[7] !== S.asPath || T[8] !== S.pathname || T[9] !== S.query.category || T[10] !== S.query.slug || T[11] !== I || T[12] !== _) {
            e: {
                var w, O;
                let e, t, {
                        page: r,
                        segments: n
                    } = (0, tW.getPage)(S.asPath),
                    i = I ? new Date(I) : new Date,
                    s = tN(i),
                    o = N && "en" !== N ? `/${N}` : "";
                if ("activity" === r) {
                    let e, t;
                    if (T[14] !== x) {
                        let t, r, a;
                        r = (t = tQ(x)).activity.title, e = [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: a = t.activity.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: a
                        }, {
                            property: "og:image",
                            content: tR.DEFAULT_TWITTER_IMG
                        }, {
                            name: "twitter:image:src",
                            content: tR.DEFAULT_TWITTER_IMG
                        }, {
                            name: "twitter:image",
                            content: tR.DEFAULT_TWITTER_IMG
                        }], T[14] = x, T[15] = e
                    } else e = T[15];
                    T[16] !== e ? (t = {
                        metatags: e
                    }, T[16] = e, T[17] = t) : t = T[17], a = t;
                    break e
                }
                if ("elections" === r) {
                    let e;
                    a = {
                        metatags: [...tj, {
                            name: "title",
                            content: rm
                        }, {
                            name: "description",
                            content: e = tk("2024 Presidential Election", i, void 0, "en", void 0, x)
                        }, {
                            property: "og:title",
                            content: rm
                        }, {
                            property: "og:description",
                            content: e
                        }, {
                            property: "og:image",
                            content: rf
                        }, {
                            name: "twitter:image:src",
                            content: rf
                        }, {
                            name: "twitter:image",
                            content: rf
                        }]
                    };
                    break e
                }
                if ("usa" === r) {
                    let e;
                    T[18] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        metatags: lk
                    }, T[18] = e) : e = T[18], a = e;
                    break e
                }
                if ("trump" === r) {
                    let e;
                    T[19] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        metatags: lS
                    }, T[19] = e) : e = T[19], a = e;
                    break e
                }
                if ("profile" === r) {
                    let e;
                    T[20] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        metatags: [],
                        canonicalHref: void 0
                    }, T[20] = e) : e = T[20], a = e;
                    break e
                }
                if ("portfolio" === r) {
                    let e, t, r, n;
                    T[21] !== _ ? (e = _("portfolio.meta.title"), T[21] = _, T[22] = e) : e = T[22];
                    let i = String(e);
                    T[23] !== _ ? (t = _("portfolio.meta.description"), T[23] = _, T[24] = t) : t = T[24];
                    let s = String(t);
                    if (T[25] !== x || T[26] !== i || T[27] !== s) {
                        let e, t, a, n;
                        e = tQ(x), t = `${tO.CURRENT_ORIGIN}/portfolio`, a = i || e.portfolio.title, r = [...tj, {
                            name: "title",
                            content: a
                        }, {
                            name: "description",
                            content: n = s || e.portfolio.description
                        }, {
                            property: "og:title",
                            content: a
                        }, {
                            property: "og:description",
                            content: n
                        }, {
                            property: "og:url",
                            content: t
                        }, {
                            name: "twitter:description",
                            content: n
                        }], T[25] = x, T[26] = i, T[27] = s, T[28] = r
                    } else r = T[28];
                    let l = `${tO.CURRENT_ORIGIN}${o}/portfolio`;
                    T[29] !== r || T[30] !== l ? (n = {
                        metatags: r,
                        canonicalHref: l
                    }, T[29] = r, T[30] = l, T[31] = n) : n = T[31], a = n;
                    break e
                }
                if ("search" === r) {
                    let e = new URLSearchParams(S.asPath.split("?")[1] || ""),
                        t = e.get("_q") || void 0,
                        r = t ? (0, tv.denormalizeSearchQueryFromUrl)(t) : void 0,
                        i = e.get("_sort") || void 0,
                        s = n[1] || void 0,
                        l = ly({
                            searchQuery: r,
                            sortParam: i,
                            tagSlug: s,
                            locale: N,
                            messages: x
                        });
                    if (r) {
                        a = {
                            metatags: l,
                            canonicalHref: void 0
                        };
                        break e
                    }
                    let c = new URLSearchParams;
                    i && c.append("_sort", i);
                    let u = c.toString();
                    a = {
                        metatags: l,
                        canonicalHref: s ? `${tO.CURRENT_ORIGIN}${o}/predictions/${s}` : u ? `${tO.CURRENT_ORIGIN}${o}/search?${u}` : `${tO.CURRENT_ORIGIN}${o}/search`
                    };
                    break e
                }
                if ("predictions" === r) {
                    let e;
                    T[32] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        metatags: [],
                        canonicalHref: void 0
                    }, T[32] = e) : e = T[32], a = e;
                    break e
                }
                if ("event" === r) {
                    let {
                        metatags: e,
                        marketSlug: t
                    } = (({
                        queryClient: e,
                        segments: t,
                        currentDate: r,
                        locale: a = "en",
                        urlParams: n,
                        messages: i
                    }) => {
                        let s, o, l, c, u = tQ(i),
                            d = tK(i);
                        if (t.length < 2) return {
                            metatags: d
                        };
                        let p = t[1],
                            A = t.length > 2 ? t[2] : void 0,
                            h = e.getQueryData(["/api/event/slug", p]);
                        if (!h) return {
                            metatags: d
                        };
                        if (!A) {
                            let e = h.markets.filter(e => h ? .closed ? (rg.ONLY_ACTIVE_MARKETS && e.active || !rg.ONLY_ACTIVE_MARKETS) && !e.archived : !e.closed && (rg.ONLY_ACTIVE_MARKETS && e.active || !rg.ONLY_ACTIVE_MARKETS) && !e.archived).sort((e, t) => e.groupItemThreshold - t.groupItemThreshold);
                            e.length && (e.length, A = e[0].slug)
                        }
                        if (!A) return {
                            metatags: d
                        };
                        let m = h.markets.find(e => e.slug === A);
                        if (!m) return {
                            metatags: d
                        };
                        let f = (0, ry.isUpDownSlug)(h.slug) ? h.series ? .[0] ? .title ? ? null : null;
                        if (f) {
                            let e = (0, tv.truncateStringForSeo)(`${f} ${u.event.predictionsAndOdds}`, 60);
                            s = e ? t$(`${e}${u.titleSuffix}`, {
                                skipIfYearPresent: !0
                            }) : u.defaultTitle, o = t.length > 2 && m.question || f, l = tk(f, r, h.closed, a, h.volume, i), c = tk(f, r, h.closed, a, h.volume, i)
                        } else if (h.seriesSlug || h.markets.some(e => e.sportsMarketType)) {
                            let e = rk(h, a, i, r);
                            if (e) s = t$(e.title, {
                                skipIfYearPresent: !0
                            }), l = e.description, c = e.description;
                            else {
                                let e = rS(h),
                                    n = e ? ` (${e})` : "";
                                s = t$(`${h.title} ${u.event.bettingOddsAndPredictions}${n}${u.titleSuffix}`, {
                                    skipIfYearPresent: !0
                                }), l = tk(h.title, r, h.closed, a, h.volume, i), c = tk(2 === t.length ? h.title : m.question || h.title, r, h.closed, a, h.volume, i)
                            }
                            o = t.length > 2 && m.question || h.title
                        } else {
                            let e = (0, tv.truncateStringForSeo)(`${h.title} ${u.event.predictionsAndOdds}`, 60);
                            s = e ? t$(`${e}${u.titleSuffix}`, {
                                skipIfYearPresent: !0
                            }) : u.defaultTitle, l = tk(h.title, r, h.closed, a, h.volume, i), c = tk(o = t.length > 2 && m.question || h.title, r, h.closed, a, h.volume, i)
                        }
                        let g = a && "en" !== a ? `&locale=${a}` : "",
                            y = 2 === t.length ? `${tO.CURRENT_ORIGIN}/api/og?eslug=${p}${g}` : `${tO.CURRENT_ORIGIN}/api/og?mslug=${m.slug}${g}`,
                            T = new URLSearchParams,
                            E = n ? .get("d"),
                            b = n ? .get("o");
                        E && T.set("d", E), b && T.set("o", b);
                        let I = T.toString(),
                            C = (0, tW.appendOgTid)(I ? `${y}&${I}` : y),
                            S = `${tO.CURRENT_ORIGIN}/event/${p}`,
                            _ = function({
                                event: e,
                                market: t
                            }) {
                                let r = e.closed ? "resolved" : "active",
                                    a = "active" === r,
                                    n = t.endDate || e.endDate,
                                    i = [{
                                        property: "og:temporal:status",
                                        content: r
                                    }, {
                                        property: "og:temporal:link_preview_rendering_style",
                                        content: "enhanced_image_forward"
                                    }, {
                                        property: "og:temporal:trade_eligibility_US",
                                        content: "False"
                                    }, {
                                        property: "og:image:alt",
                                        content: e.title
                                    }];
                                if (a && n) {
                                    let e = new Date(n).toISOString();
                                    i.push({
                                        property: "og:temporal:next_update_time",
                                        content: e
                                    }, {
                                        property: "og:temporal:next_update_label",
                                        content: "Market resolves in <dynamic_time_string_placeholder>"
                                    })
                                }
                                if (e.tags ? .length) {
                                    let t = tU(e.tags);
                                    t[0] && i.push({
                                        property: "og:temporal:event_category",
                                        content: t[0].label
                                    }), t[1] && i.push({
                                        property: "og:temporal:event_subcategory",
                                        content: t[1].label
                                    })
                                }
                                if (!a) {
                                    let r = t.closedTime || t.closed_time || e.closedTime,
                                        a = function(e) {
                                            if (!e.outcomes || !e.outcomePrices) return null;
                                            let t = (0, tL.findWinningIndex)(e);
                                            return t < 0 ? null : (0, tL.outcomeNameFromIndex)(e, t)
                                        }(t),
                                        n = `"${e.title}" has resolved`,
                                        s = a ? `The winning outcome is ${a}.` : "This market has been resolved.";
                                    i.push({
                                        property: "og:temporal:event_update",
                                        content: n
                                    }, {
                                        property: "og:temporal:event_update:description",
                                        content: s
                                    }, {
                                        property: "og:temporal:event_update:priority_level",
                                        content: "major"
                                    }), r && i.push({
                                        property: "og:temporal:event_update:time",
                                        content: new Date(r).toISOString()
                                    })
                                }
                                return i
                            }({
                                event: h,
                                market: m
                            });
                        return {
                            metatags: [...tj, {
                                name: "title",
                                content: s
                            }, {
                                name: "description",
                                content: (0, tv.truncateStringForSeo)(l, 160)
                            }, {
                                property: "og:title",
                                content: o
                            }, {
                                property: "og:description",
                                content: (0, tv.truncateStringForSeo)(c, 160)
                            }, {
                                property: "og:image",
                                content: C
                            }, {
                                property: "og:url",
                                content: S
                            }, ..._, {
                                name: "twitter:image:src",
                                content: C
                            }, {
                                name: "twitter:image",
                                content: C
                            }, {
                                name: "twitter:description",
                                content: c
                            }],
                            conditionId: m.conditionId,
                            marketSlug: m.slug
                        }
                    })({
                        queryClient: C,
                        segments: n,
                        currentDate: i,
                        locale: N,
                        urlParams: new URLSearchParams(S.asPath.split("?")[1] || ""),
                        messages: x
                    }), r = b || k;
                    r && (r = { ...r
                    }, delete r["og:image"], delete r["og:title"]), a = {
                        metatags: [...e, ...Object.entries(r).map(lV)],
                        canonicalHref: `${tO.CURRENT_ORIGIN}${o}/event/${n[1]}`,
                        eventMarketSlug: t
                    };
                    break e
                }
                if ("sports" === r || "esports" === r) {
                    let e = (({
                        segments: e,
                        queryClient: t,
                        currentDate: r,
                        locale: a = "en",
                        messages: n
                    }) => {
                        let i, s = tQ(n),
                            o = "esports" === e[0],
                            l = e[e.length - 1],
                            c = !!l && !(l.split("-").length < 6) && (0, ek.hasDateSuffix)(l),
                            u = c ? (0, tW.appendOgTid)(`${tO.CURRENT_ORIGIN}/api/og?eslug=${l}&layout=single`) : void 0;
                        c && t && (i = t.getQueryData(["/api/event/slug", l]));
                        let d = [...tj],
                            p = s.sports.title,
                            A = s.sports.description;
                        if (i) {
                            let e = rk(i, a, n, r);
                            if (e) p = e.title, A = e.description;
                            else {
                                let e = rS(i),
                                    t = e ? ` (${e})` : "";
                                p = `${i.title} ${s.event.bettingOddsAndPredictions}${t}${s.titleSuffix}`, A = tk(i.title, r, i.closed, a, i.volume, n)
                            }
                        } else if (o && e.length >= 2) {
                            let r = e[1],
                                a = e.length > 2 ? e[2] : void 0;
                            if ("live" === r) p = s.esports.categoryTitle, A = s.esports.categoryDescription;
                            else if ("soon" === r) p = s.esports.upcomingCategoryTitle, A = s.esports.upcomingCategoryDescription;
                            else if (r && a && "games" !== a && "props" !== a) {
                                let e = (e => {
                                        let t = (0, ek.canonicalSportSlug)(e),
                                            r = eL.sportMap[t];
                                        if (!r) return rx(e);
                                        let {
                                            displayHeader: a,
                                            displayNav: n
                                        } = r;
                                        return n && n !== a ? `${a} (${n})` : a
                                    })(r),
                                    a = t ? .getQueryData(["esportsTournamentName"]);
                                if (a) p = s.esports.tournamentTitle.replace("{game}", e).replace("{tournament}", a), A = s.esports.tournamentDescription.replace("{game}", e).replace("{tournament}", a);
                                else {
                                    let e = rx(r);
                                    p = s.esports.subcategoryTitle.replace("{game}", e), A = s.esports.subcategoryDescription.replaceAll("{game}", e)
                                }
                            } else if (r) {
                                let e = rx(r);
                                p = s.esports.subcategoryTitle.replace("{game}", e), A = s.esports.subcategoryDescription.replaceAll("{game}", e)
                            }
                        } else if (e.length >= 2 && "sports" === e[0]) {
                            let t = e[1],
                                r = e.length > 2 ? e[2] : void 0,
                                a = e.length > 3 ? e[3] : void 0,
                                n = e.length > 4 ? e[4] : void 0,
                                i = "week" === a && null != n && Number.isFinite(parseInt(n, 10)) ? ` Week ${n}` : "";
                            if ("futures" === t && r) {
                                let e = r.toUpperCase();
                                p = `${e} Futures ${s.event.bettingOddsAndPredictions}${s.titleSuffix}`, A = s.sports.futuresDescription
                            } else if ("live" === t) p = s.sports.categoryTitle, A = s.sports.categoryDescription;
                            else if (t && r) {
                                let e = rx(t);
                                "props" === r ? (p = `${e} Props ${s.event.bettingOddsAndPredictions}${i}${s.titleSuffix}`, A = (0, eL.isEsportsSlug)(t) ? s.esports.propsDescription.replaceAll("{game}", e) : s.sports.propsDescription.replaceAll("{league}", e)) : (p = s.sports.subcategoryTitle.replace("{league}", e), A = s.sports.subcategoryDescription.replaceAll("{league}", e))
                            } else if (t) {
                                let e = rx(t);
                                p = `${e} ${s.event.bettingOddsAndPredictions}${s.titleSuffix}`
                            }
                        }
                        let h = t$(p, {
                            skipIfYearPresent: !0
                        });
                        d.push({
                            name: "title",
                            content: h
                        }, {
                            property: "og:title",
                            content: h
                        }), d.push({
                            name: "description",
                            content: A
                        }, {
                            property: "og:description",
                            content: A
                        }, {
                            name: "twitter:description",
                            content: A
                        }), u && d.push({
                            property: "og:image",
                            content: u
                        }, {
                            name: "twitter:image:src",
                            content: u
                        }, {
                            name: "twitter:image",
                            content: u
                        });
                        let m = a && "en" !== a ? `/${a}` : "",
                            f = `${tO.CURRENT_ORIGIN}${m}/${e.join("/")}`;
                        if (e.length >= 3 && "sports" === e[0] && "futures" === e[2]) {
                            let t = e[1];
                            f = `${tO.CURRENT_ORIGIN}${m}/sports/futures/${t}`
                        }
                        if (5 === e.length && "sports" === e[0] && "games" === e[2] && "week" === e[3]) {
                            let t = e[1];
                            f = `${tO.CURRENT_ORIGIN}${m}/sports/${t}/games`
                        }
                        return d.push({
                            property: "og:url",
                            content: f
                        }), {
                            metatags: d,
                            canonicalHref: f
                        }
                    })({
                        segments: n,
                        queryClient: C,
                        currentDate: i,
                        locale: N,
                        messages: x
                    });
                    a = {
                        metatags: e.metatags,
                        canonicalHref: e.canonicalHref
                    };
                    break e
                }
                if ("leaderboard" === r) {
                    let e = n[1] || "overall",
                        t = n[2] || "monthly",
                        r = n[3] || "profit";
                    a = {
                        metatags: (({
                            category: e,
                            timeRange: t,
                            sort: r,
                            locale: a = "en",
                            messages: n
                        }) => {
                            let i = tQ(n),
                                s = i.leaderboard.title,
                                o = i.leaderboard.description,
                                l = a && "en" !== a ? `&locale=${a}` : "",
                                c = (0, tW.appendOgTid)(`${tO.CURRENT_ORIGIN}/api/og?leaderboard=true&category=${e||"overall"}&time=${{today:"1d",weekly:"7d",monthly:"30d",all:"all"}[t||"monthly"]||"30d"}&sort=${r||"profit"}${l}`);
                            return [...tj.filter(e => "og:image" !== e.property && "twitter:image" !== e.name && "twitter:image:src" !== e.name), {
                                name: "title",
                                content: s
                            }, {
                                name: "description",
                                content: o
                            }, {
                                property: "og:title",
                                content: s
                            }, {
                                property: "og:description",
                                content: o
                            }, {
                                property: "og:image",
                                content: c
                            }, {
                                name: "twitter:image",
                                content: c
                            }, {
                                name: "twitter:image:src",
                                content: c
                            }]
                        })({
                            category: e,
                            timeRange: t,
                            sort: r,
                            locale: N,
                            messages: x
                        }),
                        canonicalHref: `${tO.CURRENT_ORIGIN}${o}/leaderboard/${e}/${t}/${r}`
                    };
                    break e
                }
                if ("accuracy" === r) {
                    let e, t;
                    T[33] !== N || T[34] !== x ? (e = ((e, t = "en") => {
                        let r = tQ(e),
                            a = r.accuracy.title,
                            n = r.accuracy.description,
                            i = t && "en" !== t ? `&locale=${t}` : "",
                            s = (0, tW.appendOgTid)(`${tq}${i}`);
                        return [...tj, {
                            name: "title",
                            content: a
                        }, {
                            name: "description",
                            content: n
                        }, {
                            property: "og:title",
                            content: a
                        }, {
                            property: "og:description",
                            content: n
                        }, {
                            property: "og:image",
                            content: s
                        }, {
                            property: "og:url",
                            content: "https://polymarket.com/accuracy"
                        }, {
                            name: "twitter:image",
                            content: s
                        }]
                    })(x, N), T[33] = N, T[34] = x, T[35] = e) : e = T[35];
                    let r = `${tO.CURRENT_ORIGIN}${o}/accuracy`;
                    T[36] !== e || T[37] !== r ? (t = {
                        metatags: e,
                        canonicalHref: r
                    }, T[36] = e, T[37] = r, T[38] = t) : t = T[38], a = t;
                    break e
                }
                if ("brand" === r) {
                    let e;
                    T[39] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        metatags: tZ
                    }, T[39] = e) : e = T[39], a = e;
                    break e
                }
                if ("suggestions" === r) {
                    a = {
                        metatags: (({
                            segments: e
                        }) => {
                            let t = `${e.length<=2?"Create Market":"Edit Market"} | Polymarket`;
                            return [...lT, {
                                name: "title",
                                content: t
                            }, {
                                name: "description",
                                content: t
                            }, {
                                property: "og:title",
                                content: t
                            }, {
                                property: "og:description",
                                content: t
                            }]
                        })({
                            segments: n
                        })
                    };
                    break e
                }
                if ("rewards" === r) {
                    let e, t;
                    if (T[40] !== x) {
                        let t, r, a;
                        r = (t = tQ(x)).rewards.title, e = [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: a = t.rewards.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: a
                        }, {
                            property: "og:image",
                            content: tR.DEFAULT_TWITTER_IMG
                        }, {
                            name: "twitter:image:src",
                            content: tR.DEFAULT_TWITTER_IMG
                        }, {
                            name: "twitter:image",
                            content: tR.DEFAULT_TWITTER_IMG
                        }], T[40] = x, T[41] = e
                    } else e = T[41];
                    T[42] !== e ? (t = {
                        metatags: e
                    }, T[42] = e, T[43] = t) : t = T[43], a = t;
                    break e
                }
                if ("mentions" === r) {
                    let e, t;
                    T[44] === Symbol.for("react.memo_cache_sentinel") ? (e = lg, T[44] = e) : e = T[44];
                    let r = `${tO.CURRENT_ORIGIN}${o}/mentions`;
                    T[45] !== r ? (t = {
                        metatags: e,
                        canonicalHref: r
                    }, T[45] = r, T[46] = t) : t = T[46], a = t;
                    break e
                }
                if ("dashboards" === r) {
                    let {
                        metatags: e,
                        canonicalHref: t
                    } = (({
                        segments: e
                    }) => {
                        if (2 === e.length) {
                            let t = e[1],
                                r = `${tO.CURRENT_ORIGIN}/dashboards/${t}`;
                            if ("trump" === t) return {
                                metatags: rh,
                                canonicalHref: r
                            };
                            if ("global-elections" === t) return {
                                metatags: t9,
                                canonicalHref: r
                            };
                            if ("fed-rates" === t) return {
                                metatags: t3,
                                canonicalHref: r
                            };
                            if ("macro" === t) return {
                                metatags: rt,
                                canonicalHref: r
                            };
                            if ("oscars" === t) return {
                                metatags: rs,
                                canonicalHref: r
                            };
                            if ("primaries" === t) return {
                                metatags: rc,
                                canonicalHref: r
                            }
                        }
                        return {
                            metatags: tY
                        }
                    })({
                        segments: n
                    }), r = n ? .[1] === "trump" ? rp : t, i = r ? `${r.replace(tO.CURRENT_ORIGIN,"")}` : void 0;
                    a = {
                        metatags: e,
                        canonicalHref: i ? `${tO.CURRENT_ORIGIN}${o}${i}` : void 0
                    };
                    break e
                }
                if ("breaking" === r) {
                    let e, t, r = n[1];
                    if (r && lM(r)) {
                        a = {
                            metatags: lB(r, x),
                            canonicalHref: `${tO.CURRENT_ORIGIN}${o}/breaking/${r}`
                        };
                        break e
                    }
                    T[47] !== x ? (e = lB(void 0, x), T[47] = x, T[48] = e) : e = T[48];
                    let i = `${tO.CURRENT_ORIGIN}${o}/breaking`;
                    T[49] !== e || T[50] !== i ? (t = {
                        metatags: e,
                        canonicalHref: i
                    }, T[49] = e, T[50] = i, T[51] = t) : t = T[51], a = t;
                    break e
                }
                if ("finance" === r) {
                    let e, t, r, i, s, l, c, u = new URLSearchParams(S.asPath.split("?")[1] || ""),
                        d = (u.get("tab") || u.get("filter") || "").toLowerCase(),
                        p = (n ? .[1] || "").toLowerCase() || d,
                        A = p ? `${tO.CURRENT_ORIGIN}${o}/finance/${p}` : `${tO.CURRENT_ORIGIN}${o}/finance`;
                    a = {
                        metatags: (e = (w = {
                            tab: p,
                            locale: N,
                            messages: x
                        }).locale || "en", t = tQ(w.messages), i = t$((r = rv[(w ? .tab || "").toLowerCase()]) ? `${r} ${t.event.oddsAndPredictions}${t.titleSuffix}` : `${t.categories.finance.title}${t.titleSuffix}`), s = t.financeMeta.description, l = e && "en" !== e ? `&locale=${e}` : "", [...tj, {
                            name: "title",
                            content: i
                        }, {
                            name: "description",
                            content: s
                        }, {
                            property: "og:title",
                            content: i
                        }, {
                            property: "og:description",
                            content: s
                        }, {
                            property: "og:image",
                            content: c = (0, tW.appendOgTid)(`${rD}${l}`)
                        }, {
                            name: "twitter:image",
                            content: c
                        }]),
                        canonicalHref: A
                    };
                    break e
                }
                if ("crypto" === r) {
                    let e, t, r, i, s = new URLSearchParams(S.asPath.split("?")[1] || ""),
                        l = (s.get("tab") || s.get("filter") || "").toLowerCase(),
                        c = n ? .[1] || "",
                        u = c.toLowerCase(),
                        d = c || l,
                        p = d ? `${tO.CURRENT_ORIGIN}${o}/crypto/${d}` : `${tO.CURRENT_ORIGIN}${o}/crypto`;
                    a = {
                        metatags: (e = tQ((O = {
                            tab: u || l,
                            messages: x
                        }).messages), r = t$((t = t2[(O ? .tab || "").toLowerCase()]) ? `${t} ${e.event.oddsAndPredictions}${e.titleSuffix}` : `${e.categories.crypto.title}${e.titleSuffix}`), [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: i = e.cryptoMeta.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: i
                        }, {
                            property: "og:image",
                            content: t1
                        }, {
                            property: "og:url",
                            content: `${tO.CURRENT_ORIGIN}/crypto`
                        }, {
                            name: "twitter:description",
                            content: i
                        }, {
                            name: "twitter:image",
                            content: t1
                        }, {
                            name: "keywords",
                            content: "crypto predictions, bitcoin odds, ethereum forecast, cryptocurrency markets, btc price prediction, eth odds, crypto trading, defi markets"
                        }]),
                        canonicalHref: p
                    };
                    break e
                }
                if ("weather" === r) {
                    let e = (n ? .[1] || "").toLowerCase(),
                        t = lD[e] ? e : "weather",
                        r = `${tO.CURRENT_ORIGIN}${o}/predictions/${t}`;
                    a = {
                        metatags: lw({
                            filter: e,
                            currentDate: i,
                            locale: N,
                            messages: x
                        }),
                        canonicalHref: r
                    };
                    break e
                }
                if ("nyc" === r || "nyc-mayoral-2025" === r) {
                    let e;
                    T[52] === Symbol.for("react.memo_cache_sentinel") ? (e = {
                        metatags: lH
                    }, T[52] = e) : e = T[52], a = e;
                    break e
                }
                if ("settings" === r) {
                    let e, t;
                    if (T[53] !== x) {
                        let t, r, a;
                        r = (t = tQ(x)).settings.title, e = [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: a = t.settings.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: a
                        }, {
                            property: "og:url",
                            content: `${tO.CURRENT_ORIGIN}/settings`
                        }, {
                            name: "twitter:description",
                            content: a
                        }], T[53] = x, T[54] = e
                    } else e = T[54];
                    T[55] !== e ? (t = {
                        metatags: e
                    }, T[55] = e, T[56] = t) : t = T[56], a = t;
                    break e
                }
                if ("earnings" === r) {
                    let e, t;
                    if (T[57] !== x) {
                        let t, r, a;
                        r = (t = tQ(x)).earnings.title, e = [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: a = t.earnings.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: a
                        }, {
                            property: "og:url",
                            content: `${tO.CURRENT_ORIGIN}/earnings`
                        }, {
                            name: "twitter:description",
                            content: a
                        }], T[57] = x, T[58] = e
                    } else e = T[58];
                    T[59] !== e ? (t = {
                        metatags: e
                    }, T[59] = e, T[60] = t) : t = T[60], a = t;
                    break e
                }
                if ("fees" === r) {
                    let e, t;
                    if (T[61] !== x) {
                        let t, r, a;
                        r = (t = tQ(x)).fees.title, e = [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: a = t.fees.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: a
                        }, {
                            property: "og:url",
                            content: `${tO.CURRENT_ORIGIN}/fees`
                        }, {
                            property: "og:image",
                            content: `${tO.CURRENT_ORIGIN}/images/homepage-twitter-card.png`
                        }, {
                            name: "twitter:image",
                            content: `${tO.CURRENT_ORIGIN}/images/homepage-twitter-card.png`
                        }], T[61] = x, T[62] = e
                    } else e = T[62];
                    let r = `${tO.CURRENT_ORIGIN}${o}/fees`;
                    T[63] !== e || T[64] !== r ? (t = {
                        metatags: e,
                        canonicalHref: r
                    }, T[63] = e, T[64] = r, T[65] = t) : t = T[65], a = t;
                    break e
                }
                if ("tos" === r) {
                    let e, t;
                    if (T[66] !== x) {
                        let t, r, a;
                        r = (t = tQ(x)).tos.title, e = [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: a = t.tos.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: a
                        }, {
                            property: "og:url",
                            content: `${tO.CURRENT_ORIGIN}/tos`
                        }, {
                            name: "twitter:description",
                            content: a
                        }], T[66] = x, T[67] = e
                    } else e = T[67];
                    T[68] !== e ? (t = {
                        metatags: e
                    }, T[68] = e, T[69] = t) : t = T[69], a = t;
                    break e
                }
                if ("privacy" === r) {
                    let e, t;
                    if (T[70] !== x) {
                        let t, r, a;
                        r = (t = tQ(x)).privacy.title, e = [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: a = t.privacy.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: a
                        }, {
                            property: "og:url",
                            content: `${tO.CURRENT_ORIGIN}/privacy`
                        }, {
                            name: "twitter:description",
                            content: a
                        }], T[70] = x, T[71] = e
                    } else e = T[71];
                    T[72] !== e ? (t = {
                        metatags: e
                    }, T[72] = e, T[73] = t) : t = T[73], a = t;
                    break e
                }
                if ("create" === r) {
                    let e, t;
                    if (T[74] !== x) {
                        let t, r, a;
                        r = (t = tQ(x)).create.title, e = [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: a = t.create.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: a
                        }, {
                            property: "og:url",
                            content: `${tO.CURRENT_ORIGIN}/create`
                        }, {
                            name: "twitter:description",
                            content: a
                        }], T[74] = x, T[75] = e
                    } else e = T[75];
                    T[76] !== e ? (t = {
                        metatags: e
                    }, T[76] = e, T[77] = t) : t = T[77], a = t;
                    break e
                }
                if ("404" === r) {
                    let e, t;
                    if (T[78] !== x) {
                        let t, r, a;
                        r = (t = tQ(x)).fourOhFour.title, e = [...tj, {
                            name: "title",
                            content: r
                        }, {
                            name: "description",
                            content: a = t.fourOhFour.description
                        }, {
                            property: "og:title",
                            content: r
                        }, {
                            property: "og:description",
                            content: a
                        }, {
                            property: "og:url",
                            content: `${tO.CURRENT_ORIGIN}/404`
                        }, {
                            name: "twitter:description",
                            content: a
                        }], T[78] = x, T[79] = e
                    } else e = T[79];
                    T[80] !== e ? (t = {
                        metatags: e
                    }, T[80] = e, T[81] = t) : t = T[81], a = t;
                    break e
                }
                let l = function({
                    pathname: e,
                    segments: t,
                    queryCategory: r,
                    querySlug: a
                }) {
                    if ("/[category]" !== e && "/[category]/[slug]" !== e) return null;
                    let n = "string" == typeof r ? r : t[0];
                    if (!n || td(n)) return null;
                    if ("/[category]" === e) return n;
                    let i = "string" == typeof a ? a : t[1];
                    return i || null
                }({
                    pathname: S.pathname,
                    segments: n,
                    queryCategory: S.query.category,
                    querySlug: S.query.slug
                });
                if (l) {
                    a = {
                        metatags: ly({
                            tagSlug: l,
                            locale: N,
                            isPredictionsPage: !0,
                            currentDate: i,
                            messages: x
                        }),
                        canonicalHref: `${tO.CURRENT_ORIGIN}${o}/predictions/${l}`
                    };
                    break e
                }
                if (["politics", "tech", "culture", "pop-culture", "world", "economy", "geopolitics", "business", "science", "ai", "middle-east", "new"].includes(r)) {
                    let e, t = n[1],
                        i = t ? `${tO.CURRENT_ORIGIN}${o}/predictions/${t}` : `${tO.CURRENT_ORIGIN}${o}/${r}`,
                        l = ((e, t, r, a = "en") => {
                            let n = tQ(r),
                                i = t0[e.toLowerCase()] || e.toLowerCase(),
                                s = n.categories[i],
                                o = s ? .title || n.categories.fallbackTitle.replace("{category}", e.charAt(0).toUpperCase() + e.slice(1)),
                                l = s ? .description || n.categories.fallbackDescription.replace("{category}", e),
                                c = t$(`${o}${n.titleSuffix}`),
                                u = t || tN(new Date, a),
                                d = `${l} ${n.categories.asOf.replace("{date}",u)}`;
                            return [...tj, {
                                name: "title",
                                content: c
                            }, {
                                name: "description",
                                content: d
                            }, {
                                property: "og:title",
                                content: c
                            }, {
                                property: "og:description",
                                content: d
                            }, {
                                property: "og:url",
                                content: "trending" === e ? tO.CURRENT_ORIGIN : `${tO.CURRENT_ORIGIN}/${e}`
                            }, {
                                name: "twitter:description",
                                content: d
                            }, {
                                name: "keywords",
                                content: tX[e.toLowerCase()] || `${e} predictions, ${e} markets, ${e} odds`
                            }]
                        })(r, s, x, N),
                        c = t ? l.map(e => e ? .property === "og:url" ? { ...e,
                            content: i
                        } : e) : l;
                    T[82] !== i || T[83] !== c ? (e = {
                        metatags: c,
                        canonicalHref: i
                    }, T[82] = i, T[83] = c, T[84] = e) : e = T[84], a = e;
                    break e
                }
                if ("homepage" === r) {
                    let e, t;
                    T[85] !== x ? (e = tK(x), T[85] = x, T[86] = e) : e = T[86];
                    let r = `${tO.CURRENT_ORIGIN}${o}`;
                    T[87] !== e || T[88] !== r ? (t = {
                        metatags: e,
                        canonicalHref: r
                    }, T[87] = e, T[88] = r, T[89] = t) : t = T[89], a = t;
                    break e
                }
                T[90] !== x ? (e = tK(x), T[90] = x, T[91] = e) : e = T[91],
                T[92] !== e ? (t = {
                    metatags: e
                }, T[92] = e, T[93] = t) : t = T[93],
                a = t
            }
            T[2] = b,
            T[3] = k,
            T[4] = N,
            T[5] = x,
            T[6] = C,
            T[7] = S.asPath,
            T[8] = S.pathname,
            T[9] = S.query.category,
            T[10] = S.query.slug,
            T[11] = I,
            T[12] = _,
            T[13] = a
        }
        else a = T[13];
        let {
            metatags: R,
            canonicalHref: M,
            eventMarketSlug: L
        } = a;
        T[94] !== L || T[95] !== b ? (n = () => {
            L && !b && v(L)
        }, i = [L, b, v], T[94] = L, T[95] = b, T[96] = n, T[97] = i) : (n = T[96], i = T[97]), eC.default.useEffect(n, i), T[98] !== R ? (s = Array.isArray(R) ? R : [], T[98] = R, T[99] = s) : s = T[99];
        let B = s;
        T[100] !== B ? (o = B.some(lz), T[100] = B, T[101] = o) : o = T[101];
        let P = o;
        T[102] !== B ? (l = B.find(lJ), T[102] = B, T[103] = l) : l = T[103];
        let F = l;
        T[104] !== P || T[105] !== F ? (c = !P && F ? .content ? [{
            name: "twitter:title",
            content: F.content
        }] : [], T[104] = P, T[105] = F, T[106] = c) : c = T[106];
        let U = c;
        T[107] !== k ? (u = Object.entries(k).map(lZ), T[107] = k, T[108] = u) : u = T[108], T[109] !== B || T[110] !== u || T[111] !== U ? (d = [...B, ...U, ...u], T[109] = B, T[110] = u, T[111] = U, T[112] = d) : d = T[112];
        let G = d;
        T[113] !== S.asPath ? (p = function(e) {
            let t = function(e) {
                    let t = e.split("?")[0].split("#")[0].split("/");
                    if (t[1] && lK.includes(t[1])) {
                        let e = t.slice(2).map(e => (0, tw.sanitizeSlug)(e)).join("/");
                        return e ? `/${e}` : "/"
                    }
                    return t.map(e => (0, tw.sanitizeSlug)(e)).join("/").replace(/\/+/g, "/") || "/"
                }(e),
                r = "/" === t ? "" : t,
                a = [];
            for (let e of lK) {
                let t = "en" === e ? `${lQ}${r}` : `${lQ}/${e}${r}`;
                a.push({
                    hreflang: e,
                    href: t
                })
            }
            return a.push({
                hreflang: "x-default",
                href: `${lQ}${r}`
            }), a
        }(S.asPath), T[113] = S.asPath, T[114] = p) : p = T[114];
        let H = p;
        T[115] !== I ? (A = {
            serverDate: I
        }, T[115] = I, T[116] = A) : A = T[116];
        let j = A;
        return T[117] !== G ? (h = G.map(l$), T[117] = G, T[118] = h) : h = T[118], T[119] !== M ? (m = M && (0, eE.jsx)("link", {
            rel: "canonical",
            href: M
        }, "canonical"), T[119] = M, T[120] = m) : m = T[120], T[121] !== H ? (f = H.map(lX), T[121] = H, T[122] = f) : f = T[122], T[123] !== h || T[124] !== m || T[125] !== f ? (g = (0, eE.jsxs)(tI.default, {
            children: [h, m, f]
        }), T[123] = h, T[124] = m, T[125] = f, T[126] = g) : g = T[126], T[127] !== E || T[128] !== j || T[129] !== g ? (y = (0, eE.jsxs)(lj.Provider, {
            value: j,
            children: [g, E]
        }), T[127] = E, T[128] = j, T[129] = g, T[130] = y) : y = T[130], y
    }, "useServerDate", 0, lY], 627287);
    var l0 = e.i(454955);
    let l1 = [{
            key: "esports",
            href: "/esports/live"
        }, {
            key: "weather",
            href: "/weather"
        }, {
            key: "elections",
            href: "/elections"
        }, {
            key: "bitcoin",
            href: "/crypto/bitcoin"
        }, {
            key: "crypto",
            href: "/crypto"
        }, {
            key: "culture",
            href: "/pop-culture"
        }, {
            key: "earnings",
            href: "/earnings"
        }, {
            key: "economy",
            href: "/economy"
        }, {
            key: "finance",
            href: "/finance"
        }, {
            key: "geopolitics",
            href: "/geopolitics"
        }, {
            key: "mentions",
            href: "/mentions"
        }, {
            key: "politics",
            href: "/politics"
        }, {
            key: "sports",
            href: "/sports/live"
        }, {
            key: "tech",
            href: "/tech"
        }, {
            key: "world",
            href: "/world"
        }],
        l2 = [{
            key: "learn",
            href: `${tO.POLYMARKET_DOCS_LINK}/concepts`,
            external: !0
        }, {
            key: "xTwitter",
            href: tO.POLYMARKET_SOCIAL_LINKS.twitter,
            external: !0
        }, {
            key: "instagram",
            href: tO.POLYMARKET_SOCIAL_LINKS.instagram,
            external: !0
        }, {
            key: "discord",
            href: tO.POLYMARKET_SOCIAL_LINKS.discord,
            external: !0
        }, {
            key: "tiktok",
            href: tO.POLYMARKET_SOCIAL_LINKS.tiktok,
            external: !0
        }, {
            key: "news",
            href: tO.POLYMARKET_NEWS_LINK,
            external: !0
        }, {
            key: "contactUs",
            href: tO.POLYMARKET_SOCIAL_LINKS.email,
            external: !0
        }, {
            key: "helpCenter",
            href: tO.POLYMARKET_HELP_CENTER_LINK,
            external: !0
        }],
        l5 = [{
            key: "rewards",
            href: "/rewards"
        }, {
            key: "apis",
            href: `${tO.POLYMARKET_DOCS_LINK}/api-reference`,
            external: !0
        }, {
            key: "leaderboard",
            href: "/leaderboard"
        }, {
            key: "accuracy",
            href: "/accuracy"
        }, {
            key: "brand",
            href: "/brand"
        }, {
            key: "activity",
            href: "/activity"
        }, {
            key: "careers",
            href: "https://careers.polymarket.com",
            external: !0
        }, {
            key: "press",
            href: "mailto:press@polymarket.com",
            external: !0
        }];

    function l6(e) {
        let t = e ? ? new Date,
            r = new Date(t.getFullYear(), 0, 0);
        return Math.floor((t.getTime() - r.getTime()) / 864e5)
    }

    function l3() {
        let e, t, r, a, n, i, s, o, l, c, u, d, p, A, h, m, f, g, y, T, E, b, I, C, S, _, N, x, k, D, v = (0, eb.c)(83),
            w = (0, e_.useTranslations)(),
            O = (0, tl.useLocale)();
        v[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], v[0] = e) : e = v[0];
        let {
            authenticated: R
        } = (0, tb.useAccountContext)(e), [M, L] = (0, eC.useState)(!1);
        v[1] !== O ? (t = tT.queryKeys[tE.QueryKey.Tags].filteredTagsBySlug("all", "active", O), v[1] = O, v[2] = t) : t = v[2];
        let B = !R;
        v[3] !== t.queryKey || v[4] !== B ? (r = {
            queryKey: t.queryKey,
            queryFn: ty.getFilteredTagsBySlugFetcher,
            staleTime: 3e5,
            gcTime: 3e5,
            enabled: B
        }, v[3] = t.queryKey, v[4] = B, v[5] = r) : r = v[5];
        let {
            data: P
        } = (0, tg.useQuery)(r), F = lY();
        v[6] !== F ? (a = () => l6(F ? new Date(F) : void 0), v[6] = F, v[7] = a) : a = v[7];
        let [U, G] = (0, eC.useState)(a);
        v[8] === Symbol.for("react.memo_cache_sentinel") ? (n = () => {
            G(l6())
        }, i = [], v[8] = n, v[9] = i) : (n = v[8], i = v[9]), (0, eC.useEffect)(n, i);
        e: {
            let e;
            if (!P) {
                let e;
                v[10] === Symbol.for("react.memo_cache_sentinel") ? (e = [], v[10] = e) : e = v[10], s = e;
                break e
            }
            v[11] !== U || v[12] !== P ? (e = function(e, t) {
                if (0 === e.length) return e;
                let r = t % e.length;
                return [...e.slice(r), ...e.slice(0, r)]
            }(P.filter(l8).map(l4), U), v[11] = U, v[12] = P, v[13] = e) : e = v[13],
            s = e
        }
        let H = s,
            j = !R && H.length > 0;
        if (v[14] !== M || v[15] !== j || v[16] !== w || v[17] !== H) {
            let e, t, r, a, n = H.slice(0, 14),
                i = H.slice(14);
            v[30] !== w ? (e = e => "learn" === e ? w("footer.learn") : "helpCenter" === e ? w("footer.helpCenter") : w(`footer.links.${e}`), v[30] = w, v[31] = e) : e = v[31], d = e, v[32] !== w ? (t = e => "press" === e ? w("footer.press") : "careers" === e ? w("footer.careers") : "brand" === e ? w("footer.brand") : w(`footer.links.${e}`), v[32] = w, v[33] = t) : t = v[33], u = t, v[34] !== w ? (r = e => w(`footer.homepageCategories.${e}.title`), v[34] = w, v[35] = r) : r = v[35], c = r, v[36] !== w ? (a = e => w(`footer.homepageCategories.${e}.subtitle`), v[36] = w, v[37] = a) : a = v[37], l = a, f = "grid grid-cols-2 gap-8 lg:gap-16 lg:grid-cols-[1fr_auto_auto]", o = tn, v[38] !== w ? (h = w("footer.marketsByCategory"), v[38] = w, v[39] = h) : h = v[39], m = "col-span-2 lg:col-span-1", g = "grid grid-cols-2 lg:grid-cols-3 gap-x-12 gap-y-3", y = j && n.map(e => (0, eE.jsxs)(l0.FooterLink, {
                href: e.href,
                children: [e.label, (0, eE.jsx)("span", {
                    className: "block text-xs text-text-tertiary",
                    children: w("footer.predictionsAndOdds")
                })]
            }, e.href)), v[40] !== M || v[41] !== j || v[42] !== w ? (p = j && !M && (0, eE.jsxs)("button", {
                type: "button",
                onClick: () => L(!0),
                className: "flex items-center gap-1 text-sm font-medium text-text-secondary hover:text-text-tertiary transition-colors cursor-pointer self-start",
                children: [(0, eE.jsx)("span", {
                    children: w("footer.viewMore")
                }), (0, eE.jsx)(ts.IconChevronDownOutline12, {
                    className: "w-3 h-3"
                })]
            }), v[40] = M, v[41] = j, v[42] = w, v[43] = p) : p = v[43], A = j && M && i.map(e => (0, eE.jsxs)(l0.FooterLink, {
                href: e.href,
                children: [e.label, (0, eE.jsx)("span", {
                    className: "block text-xs text-text-tertiary",
                    children: w("footer.predictionsAndOdds")
                })]
            }, e.href)), v[14] = M, v[15] = j, v[16] = w, v[17] = H, v[18] = o, v[19] = l, v[20] = c, v[21] = u, v[22] = d, v[23] = p, v[24] = A, v[25] = h, v[26] = m, v[27] = f, v[28] = g, v[29] = y
        } else o = v[18], l = v[19], c = v[20], u = v[21], d = v[22], p = v[23], A = v[24], h = v[25], m = v[26], f = v[27], g = v[28], y = v[29];
        return v[44] !== l || v[45] !== c || v[46] !== M || v[47] !== j ? (T = (!j || M) && l1.map(e => (0, eE.jsxs)(l0.FooterLink, {
            href: e.href,
            children: [(0, eE.jsx)("span", {
                className: "block",
                children: c(e.key)
            }), (0, eE.jsx)("span", {
                className: "block text-xs text-text-tertiary",
                children: l(e.key)
            })]
        }, e.href)), v[44] = l, v[45] = c, v[46] = M, v[47] = j, v[48] = T) : T = v[48], v[49] !== M || v[50] !== j || v[51] !== w ? (E = j && M && (0, eE.jsxs)("button", {
            type: "button",
            onClick: () => L(!1),
            className: "flex items-center gap-1 text-sm font-medium text-text-secondary hover:text-text-tertiary transition-colors cursor-pointer self-start",
            children: [(0, eE.jsx)("span", {
                children: w("footer.viewLess")
            }), (0, eE.jsx)(ts.IconChevronDownOutline12, {
                className: "w-3 h-3 rotate-180"
            })]
        }), v[49] = M, v[50] = j, v[51] = w, v[52] = E) : E = v[52], v[53] !== p || v[54] !== A || v[55] !== T || v[56] !== E || v[57] !== g || v[58] !== y ? (b = (0, eE.jsxs)("div", {
            className: g,
            children: [y, p, A, T, E]
        }), v[53] = p, v[54] = A, v[55] = T, v[56] = E, v[57] = g, v[58] = y, v[59] = b) : b = v[59], v[60] !== o || v[61] !== h || v[62] !== m || v[63] !== b ? (I = (0, eE.jsx)(o, {
            title: h,
            className: m,
            children: b
        }), v[60] = o, v[61] = h, v[62] = m, v[63] = b, v[64] = I) : I = v[64], v[65] !== w ? (C = w("footer.supportAndSocial"), v[65] = w, v[66] = C) : C = v[66], v[67] !== d ? (S = l2.map(e => (0, eE.jsx)(l0.FooterLink, {
            href: e.href,
            external: e.external,
            children: d(e.key)
        }, e.href + e.key)), v[67] = d, v[68] = S) : S = v[68], v[69] !== S ? (_ = (0, eE.jsx)("div", {
            className: "flex flex-col gap-3",
            children: S
        }), v[69] = S, v[70] = _) : _ = v[70], v[71] !== C || v[72] !== _ ? (N = (0, eE.jsx)(tn, {
            title: C,
            children: _
        }), v[71] = C, v[72] = _, v[73] = N) : N = v[73], v[74] !== u ? (x = l5.map(e => (0, eE.jsx)(l0.FooterLink, {
            href: e.href,
            external: e.external,
            children: u(e.key)
        }, e.href)), v[74] = u, v[75] = x) : x = v[75], v[76] !== x ? (k = (0, eE.jsx)(tn, {
            title: "Polymarket",
            children: (0, eE.jsx)("div", {
                className: "flex flex-col gap-3",
                children: x
            })
        }), v[76] = x, v[77] = k) : k = v[77], v[78] !== f || v[79] !== I || v[80] !== N || v[81] !== k ? (D = (0, eE.jsxs)("div", {
            className: f,
            children: [I, N, k]
        }), v[78] = f, v[79] = I, v[80] = N, v[81] = k, v[82] = D) : D = v[82], D
    }

    function l4(e) {
        return {
            href: `/predictions/${e.slug}`,
            label: e.label
        }
    }

    function l8(e) {
        return "breaking-news" !== e.slug
    }

    function l9(e) {
        let t, r, a, n, i, s, o, l = (0, eb.c)(34),
            {
                data: c
            } = e,
            u = (0, e_.useTranslations)();
        if (l[0] !== c.categoryName || l[1] !== c.categorySlug || l[2] !== c.newestMarkets || l[3] !== c.popularMarkets || l[4] !== c.relatedTags || l[5] !== u) {
            let e, s, o, d = tA(c.categorySlug, c.categoryName, u);
            if (l[11] !== c.relatedTags || l[12] !== u) {
                let t;
                l[14] !== u ? (t = e => ({
                    href: `/predictions/${e.slug}`,
                    label: e.label,
                    sublabel: u("footer.predictionsAndOdds")
                }), l[14] = u, l[15] = t) : t = l[15], e = c.relatedTags.map(t), l[11] = c.relatedTags, l[12] = u, l[13] = e
            } else e = l[13];
            let p = e;
            l[16] !== c.popularMarkets ? (s = c.popularMarkets.map(ce), l[16] = c.popularMarkets, l[17] = s) : s = l[17];
            let A = s;
            l[18] !== c.newestMarkets ? (o = c.newestMarkets.map(l7), l[18] = c.newestMarkets, l[19] = o) : o = l[19];
            let h = o,
                m = p.length > 0;
            a = `grid grid-cols-1 gap-8 lg:gap-16 ${m?"lg:grid-cols-3":"lg:grid-cols-2"}`, l[20] !== m || l[21] !== p || l[22] !== u ? (n = m && (0, eE.jsx)("div", {
                className: "order-3 lg:order-1",
                children: (0, eE.jsx)(tc, {
                    title: u("footer.relatedCategoriesTitle"),
                    items: p,
                    visibleCount: 10
                })
            }), l[20] = m, l[21] = p, l[22] = u, l[23] = n) : n = l[23];
            let f = A.length > 0 ? (0, eE.jsx)(tc, {
                title: u("footer.popularMarketsTitle", {
                    category: d
                }),
                items: A,
                visibleCount: 10
            }) : (0, eE.jsx)(tn, {
                title: u("footer.popularMarketsTitle", {
                    category: d
                }),
                children: (0, eE.jsx)("p", {
                    className: "text-sm text-text-tertiary",
                    children: u("footer.noMarkets")
                })
            });
            l[24] !== f ? (i = (0, eE.jsx)("div", {
                className: "order-1 lg:order-2",
                children: f
            }), l[24] = f, l[25] = i) : i = l[25], t = "order-2 lg:order-3", r = h.length > 0 ? (0, eE.jsx)(tc, {
                title: u("footer.newMarketsTitle", {
                    category: d
                }),
                items: h,
                visibleCount: 10
            }) : (0, eE.jsx)(tn, {
                title: u("footer.newMarketsTitle", {
                    category: d
                }),
                children: (0, eE.jsx)("p", {
                    className: "text-sm text-text-tertiary",
                    children: u("footer.noMarkets")
                })
            }), l[0] = c.categoryName, l[1] = c.categorySlug, l[2] = c.newestMarkets, l[3] = c.popularMarkets, l[4] = c.relatedTags, l[5] = u, l[6] = t, l[7] = r, l[8] = a, l[9] = n, l[10] = i
        } else t = l[6], r = l[7], a = l[8], n = l[9], i = l[10];
        return l[26] !== t || l[27] !== r ? (s = (0, eE.jsx)("div", {
            className: t,
            children: r
        }), l[26] = t, l[27] = r, l[28] = s) : s = l[28], l[29] !== a || l[30] !== n || l[31] !== i || l[32] !== s ? (o = (0, eE.jsxs)("div", {
            className: a,
            children: [n, i, s]
        }), l[29] = a, l[30] = n, l[31] = i, l[32] = s, l[33] = o) : o = l[33], o
    }

    function l7(e) {
        return {
            href: `/event/${e.slug}`,
            label: e.title
        }
    }

    function ce(e) {
        return {
            href: `/event/${e.slug}`,
            label: e.title
        }
    }
    e.s(["Footer", 0, function(e) {
        let t, r, a, n, i, s, o, l = (0, eb.c)(15),
            {
                variant: c,
                footerData: u,
                beforeContent: d
            } = e,
            p = void 0 === c ? "homepage" : c,
            A = (0, e_.useTranslations)();
        l[0] !== u || l[1] !== p ? (t = () => "category" === p && u ? .variant === "category" ? (0, eE.jsx)(th, {
            data: u
        }) : "market" === p && u ? .variant === "market" ? (0, eE.jsx)(l9, {
            data: u
        }) : (0, eE.jsx)(l3, {}), l[0] = u, l[1] = p, l[2] = t) : t = l[2];
        let h = t;
        return l[3] === Symbol.for("react.memo_cache_sentinel") ? (r = (0, eE.jsx)(tr.default, {
            href: "/",
            className: "block",
            children: (0, eE.jsx)(tt.default, {
                src: "/images/brand/logo-black.png",
                alt: "Polymarket",
                width: 180,
                height: 33,
                className: "dark:invert"
            })
        }), l[3] = r) : r = l[3], l[4] !== A ? (a = A("footer.tagline"), l[4] = A, l[5] = a) : a = l[5], l[6] !== a ? (n = (0, eE.jsxs)("div", {
            className: "flex flex-col gap-2 items-start",
            children: [r, (0, eE.jsx)("p", {
                className: "text-base font-medium text-text",
                children: a
            })]
        }), l[6] = a, l[7] = n) : n = l[7], l[8] !== h ? (i = h(), l[8] = h, l[9] = i) : i = l[9], l[10] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, eE.jsx)(ta.FooterBottomRow, {}), l[10] = s) : s = l[10], l[11] !== d || l[12] !== n || l[13] !== i ? (o = (0, eE.jsx)(te, {
            brand: n,
            beforeContent: d,
            content: i,
            bottom: s
        }), l[11] = d, l[12] = n, l[13] = i, l[14] = o) : o = l[14], o
    }], 165799);
    var ct = e.i(149534);
    e.s(["IconCircleChartLine2Outline18", 0, ({
        strokeWidth: e = 1.5,
        ...t
    }) => eC.default.createElement(ct.Icon, {
        size: "18px",
        ...t
    }, eC.default.createElement("path", {
        d: "M15.769 6.399L11.437 10.73C11.242 10.925 10.925 10.925 10.73 10.73L7.26999 7.27C7.07499 7.075 6.75799 7.075 6.56299 7.27L2.23001 11.599",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }), eC.default.createElement("path", {
        d: "M16.139 10.2713C15.5386 13.6696 12.5709 16.25 9 16.25C4.996 16.25 1.75 13.004 1.75 9C1.75 4.996 4.996 1.75 9 1.75C12.088 1.75 14.724 3.68 15.77 6.399",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }))], 559363), e.s(["IconHouse4Outline18", 0, ({
        strokeWidth: e = 1.5,
        ...t
    }) => eC.default.createElement(ct.Icon, {
        size: "18px",
        ...t
    }, eC.default.createElement("path", {
        d: "M14.855 5.95L9.605 1.96C9.247 1.688 8.752 1.688 8.395 1.96L3.145 5.95C2.896 6.139 2.75 6.434 2.75 6.747V14.251C2.75 15.356 3.645 16.251 4.75 16.251H7.25V12.251C7.25 11.699 7.698 11.251 8.25 11.251H9.75C10.302 11.251 10.75 11.699 10.75 12.251V16.251H13.25C14.355 16.251 15.25 15.356 15.25 14.251V6.746C15.25 6.433 15.104 6.14 14.855 5.95Z",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }))], 44899), e.s(["IconChartLineOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...t
    }) => eC.default.createElement(ct.Icon, {
        size: "18px",
        ...t
    }, eC.default.createElement("path", {
        d: "M2.75,10.75l3.646-3.646c.195-.195,.512-.195,.707,0l3.293,3.293c.195,.195,.512,.195,.707,0l4.146-4.146",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), eC.default.createElement("path", {
        d: "M2.75,2.75V12.75c0,1.105,.895,2,2,2H15.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))], 169177), e.s(["IconMenuOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...t
    }) => eC.default.createElement(ct.Icon, {
        size: "18px",
        ...t
    }, eC.default.createElement("line", {
        x1: "2.25",
        y1: "9",
        x2: "15.75",
        y2: "9",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), eC.default.createElement("line", {
        x1: "2.25",
        y1: "3.75",
        x2: "15.75",
        y2: "3.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), eC.default.createElement("line", {
        x1: "2.25",
        y1: "14.25",
        x2: "15.75",
        y2: "14.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))], 930266)
}, 569442, e => {
    "use strict";
    let t;
    var r = e.i(322324),
        a = e.i(461327),
        n = e.i(165974);
    let i = (0, r.create)()((0, a.persist)((0, n.immer)(e => ({
        portfolioHidden: !1,
        ...t,
        togglePortfolio: () => {
            e(e => {
                e.portfolioHidden = !e.portfolioHidden
            })
        },
        setPortfolioHidden: t => {
            e(e => {
                e.portfolioHidden = t
            })
        }
    })), {
        name: "polymarket.store.balance-visibility",
        version: 1
    }));
    e.s(["useBalanceVisibilityStore", 0, i], 569442)
}, 643244, 507909, 357325, 229339, 961828, 28589, 385773, 330959, 512662, 892165, 424134, e => {
    "use strict";
    var t, r = e.i(221628),
        a = e.i(999061),
        n = e.i(86831);
    e.s(["HiddenDots", 0, function(e) {
        let t, i, s = (0, a.c)(4),
            {
                className: o
            } = e;
        return s[0] !== o ? (t = (0, n.cn)("tracking-wide", o), s[0] = o, s[1] = t) : t = s[1], s[2] !== t ? (i = (0, r.jsx)("span", {
            className: t,
            children: "••••"
        }), s[2] = t, s[3] = i) : i = s[3], i
    }], 643244);
    var i = e.i(23128),
        s = e.i(219469),
        o = e.i(215959),
        l = e.i(416340),
        c = e.i(180715);
    let u = ({
            strokeWidth: e = 1.5,
            ...t
        }) => l.default.createElement(c.Icon, {
            size: "12px",
            ...t
        }, l.default.createElement("line", {
            x1: "6",
            y1: "11",
            x2: "6",
            y2: "1.25",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e,
            "data-color": "color-2"
        }), l.default.createElement("polyline", {
            points: "9.25 4.25 6 1 2.75 4.25",
            fill: "none",
            stroke: "currentColor",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            strokeWidth: e
        })),
        d = {
            duration: .15,
            ease: [.26, .08, .25, 1]
        };
    e.s(["layoutTransition", 0, {
        type: "spring",
        stiffness: 2300,
        damping: 200,
        mass: 6
    }, "opacityTransition", 0, d, "transition", 0, {
        duration: .27,
        ease: [.26, .08, .25, 1]
    }], 507909);
    var p = e.i(604777);
    let A = {
            initial: {
                opacity: 0
            },
            animate: {
                opacity: 1
            },
            exit: {
                opacity: 0
            }
        },
        h = {
            desktop: "fixed left-[calc(50vw-11.375rem)] -translate-x-1/2 bottom-10 z-50",
            centered: "hidden lg:fixed lg:block left-1/2 -translate-x-1/2 bottom-10 z-50",
            mobile: "absolute right-4 top-0 -translate-y-full -mt-4"
        },
        m = ["/predictions/midterms"];

    function f() {
        window.scrollTo({
            top: 0,
            behavior: "smooth"
        })
    }

    function g(e) {
        return window.location.pathname.startsWith(e)
    }
    e.s(["BackToTop", 0, function(e) {
        let t, n, c, y, T = (0, a.c)(8),
            {
                variant: E
            } = e,
            b = (0, p.useTranslations)(),
            [I, C] = l.default.useState(!1);
        return T[0] === Symbol.for("react.memo_cache_sentinel") ? (t = () => {
            if (m.some(g)) return;
            let e = null,
                t = () => {
                    e = null, C(window.scrollY > 600)
                },
                r = () => {
                    null === e && (e = requestAnimationFrame(t))
                };
            return t(), window.addEventListener("scroll", r, {
                passive: !0
            }), () => {
                window.removeEventListener("scroll", r), null !== e && cancelAnimationFrame(e)
            }
        }, n = [], T[0] = t, T[1] = n) : (t = T[0], n = T[1]), l.default.useEffect(t, n), T[2] !== I || T[3] !== b || T[4] !== E ? (c = I && (0, r.jsx)(o.motion.div, {
            variants: A,
            initial: "initial",
            animate: "animate",
            exit: "exit",
            transition: d,
            className: h[E],
            children: (0, r.jsxs)(i.Button, {
                onClick: f,
                variant: "secondary",
                size: "sm",
                className: "rounded-full gap-1 shadow-sm bg-background",
                children: [(0, r.jsx)("span", {
                    className: "text-sm font-medium leading-none",
                    children: b("backToTop")
                }), (0, r.jsx)(u, {})]
            })
        }), T[2] = I, T[3] = b, T[4] = E, T[5] = c) : c = T[5], T[6] !== c ? (y = (0, r.jsx)(s.AnimatePresence, {
            children: c
        }), T[6] = c, T[7] = y) : y = T[7], y
    }], 357325), e.s(["useCooldownValue", 0, function(e, t) {
        let r = (0, l.useRef)(e),
            [a, n] = (0, l.useState)(!1),
            i = (0, l.useRef)(!1);
        return t || a || (r.current = e), (0, l.useEffect)(() => {
            if (t) i.current = !0, n(!0);
            else if (i.current) {
                i.current = !1;
                let e = setTimeout(() => n(!1), 15e3);
                return () => clearTimeout(e)
            }
        }, [t]), t || a ? r.current : e
    }], 229339);
    var y = e.i(211721),
        T = e.i(253264),
        E = e.i(336896),
        b = e.i(525962),
        I = e.i(184612),
        C = e.i(827681),
        S = e.i(863828),
        _ = e.i(668122),
        N = e.i(79075),
        x = e.i(305457);

    function k() {
        let e, t = (0, a.c)(1);
        return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, r.jsxs)("p", {
            className: "text-xs text-text-tertiary",
            children: ["Trading is subject to eligibility requirements and", " ", (0, r.jsx)("a", {
                href: "/tos",
                target: "_blank",
                rel: "noopener noreferrer",
                className: "underline hover:text-text-primary transition-colors",
                children: "Terms of Use"
            }), "."]
        }), t[0] = e) : e = t[0], e
    }
    let D = e => {
        let t, n, s, o, c, u, d, A, h, m, f, g, y, T, D, v, w = (0, a.c)(48),
            {
                open: O,
                onOpenChange: R,
                completionEvent: M
            } = e,
            [L, B] = (0, l.useState)(1),
            {
                setConnectorRoute: P,
                setOpen: F
            } = (0, S.useSiwx)(),
            U = (0, E.useRouter)(),
            G = (0, p.useTranslations)(),
            H = U.pathname ? ? "";
        if (w[0] !== H || w[1] !== G) t = [{
            image: "/images/how-it-works/1.png",
            alt: G("howItWorks.slide1.alt"),
            title: G("/events" === H ? "howItWorks.slide1.titleEvents" : "howItWorks.slide1.title"),
            description: G("howItWorks.slide1.description")
        }, {
            image: "/images/how-it-works/2.png",
            alt: G("howItWorks.slide2.alt"),
            title: G("howItWorks.slide2.title"),
            description: G("howItWorks.slide2.description")
        }, {
            image: "/images/how-it-works/3.png",
            alt: G("howItWorks.slide3.alt"),
            title: G("howItWorks.slide3.title"),
            description: G("howItWorks.slide3.description"),
            isLastSlide: !0
        }], w[0] = H, w[1] = G, w[2] = t;
        else t = w[2];
        let j = t,
            Q = (0, x.useAmplitudeAnalytics)();
        w[3] !== O ? (n = () => {
            O && B(1)
        }, s = [O], w[3] = O, w[4] = n, w[5] = s) : (n = w[4], s = w[5]), (0, l.useEffect)(n, s), w[6] !== L || w[7] !== j.length ? (o = () => {
            L < j.length && B(L + 1)
        }, w[6] = L, w[7] = j.length, w[8] = o) : o = w[8];
        let K = o;
        w[9] !== Q || w[10] !== M || w[11] !== R || w[12] !== P || w[13] !== F ? (c = () => {
            let e = Date.now();
            Q.trackEvent(M), (0, N.markSignupPromptOpened)("how_it_works", {
                now: e,
                route: "signup"
            }), Q.trackEvent(_.Events.SignupPromptOpened, (0, N.getSignupPromptOpenedEventProperties)({
                source: "how_it_works",
                route: "signup"
            })), R(!1), P(C.ConnectorRoute.SIGNUP), F(!0)
        }, w[9] = Q, w[10] = M, w[11] = R, w[12] = P, w[13] = F, w[14] = c) : c = w[14];
        let Y = c;
        w[15] !== R ? (u = e => {
            e && B(1), R(e)
        }, w[15] = R, w[16] = u) : u = w[16];
        let W = u,
            q = j[L - 1],
            V = L === j.length;
        if (w[17] !== L || w[18] !== j) {
            let e;
            w[20] !== L ? (e = (e, t) => (0, r.jsx)(I.default, {
                src: e.image,
                alt: e.alt,
                width: 1290,
                height: 969,
                priority: !0,
                className: `w-full h-auto ${t===L-1?"":"absolute inset-0 invisible"}`
            }, e.image), w[20] = L, w[21] = e) : e = w[21], d = j.map(e), w[17] = L, w[18] = j, w[19] = d
        } else d = w[19];
        w[22] !== d ? (A = (0, r.jsx)("div", {
            className: "-mx-6 -mt-6 md:mx-0 md:mt-0 relative",
            children: d
        }), w[22] = d, w[23] = A) : A = w[23], w[24] !== q.title ? (h = (0, r.jsx)(b.ModalHeader, {
            showClose: !1,
            children: (0, r.jsx)(b.ModalTitle, {
                children: q.title
            })
        }), w[24] = q.title, w[25] = h) : h = w[25], w[26] !== q.description ? (m = (0, r.jsx)(b.ModalDescription, {
            children: q.description
        }), w[26] = q.description, w[27] = m) : m = w[27], w[28] !== V ? (f = V && (0, r.jsx)(k, {}), w[28] = V, w[29] = f) : f = w[29];
        let z = V ? Y : K;
        return w[30] !== V || w[31] !== G ? (g = G(V ? "howItWorks.getStarted" : "howItWorks.next"), w[30] = V, w[31] = G, w[32] = g) : g = w[32], w[33] !== z || w[34] !== g ? (y = (0, r.jsx)(b.ModalFooter, {
            children: (0, r.jsx)(i.Button, {
                onClick: z,
                size: "lg",
                children: g
            })
        }), w[33] = z, w[34] = g, w[35] = y) : y = w[35], w[36] !== h || w[37] !== m || w[38] !== f || w[39] !== y ? (T = (0, r.jsxs)("div", {
            className: "flex flex-col gap-4 md:px-6 md:pt-4 md:pb-6",
            children: [h, m, f, y]
        }), w[36] = h, w[37] = m, w[38] = f, w[39] = y, w[40] = T) : T = w[40], w[41] !== A || w[42] !== T ? (D = (0, r.jsxs)(b.ModalContent, {
            className: "md:max-w-[448px] p-0 gap-0",
            children: [A, T]
        }), w[41] = A, w[42] = T, w[43] = D) : D = w[43], w[44] !== W || w[45] !== O || w[46] !== D ? (v = (0, r.jsx)(b.Modal, {
            open: O,
            onOpenChange: W,
            children: D
        }), w[44] = W, w[45] = O, w[46] = D, w[47] = v) : v = w[47], v
    };
    e.s(["default", 0, D], 961828);
    var v = e.i(149285),
        w = (t = function(e, r) {
            return (t = Object.setPrototypeOf || ({
                __proto__: []
            }) instanceof Array && function(e, t) {
                e.__proto__ = t
            } || function(e, t) {
                for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r])
            })(e, r)
        }, function(e, r) {
            if ("function" != typeof r && null !== r) throw TypeError("Class extends value " + String(r) + " is not a constructor or null");

            function a() {
                this.constructor = e
            }
            t(e, r), e.prototype = null === r ? Object.create(r) : (a.prototype = r.prototype, new a)
        }),
        O = "html",
        R = function(e, t) {
            var r, a, n, i = null != (r = e.ownerDocument) ? r : document,
                s = null != (n = null != (a = i.defaultView) ? a : i.parentWindow) ? n : window;
            switch (t) {
                case O:
                    return e instanceof s.HTMLElement;
                case "svg":
                    return e instanceof s.SVGElement;
                default:
                    throw Error('Unrecognized element type "'.concat(t, '" for validateElementType.'))
            }
        },
        M = function(e, t) {
            var r, a, n, i, s, o = {};
            switch (e) {
                case O:
                    s = document.createElement(null != (r = null == t ? void 0 : t.containerElement) ? r : "div");
                    break;
                case "svg":
                    s = document.createElementNS("http://www.w3.org/2000/svg", null != (a = null == t ? void 0 : t.containerElement) ? a : "g");
                    break;
                default:
                    throw Error('Invalid element type "'.concat(e, '" for createPortalNode: must be "html" or "svg".'))
            }
            if (t && "object" == typeof t && t.attributes)
                for (var l = 0, c = Object.entries(t.attributes); l < c.length; l++) {
                    var u = c[l],
                        d = u[0],
                        p = u[1];
                    s.setAttribute(d, p)
                }
            var A = {
                element: s,
                elementType: e,
                setPortalProps: function(e) {
                    o = e
                },
                getInitialPortalProps: function() {
                    return o
                },
                mount: function(t, r) {
                    if (r !== i) {
                        if (A.unmount(), t !== n && !R(t, e)) throw Error('Invalid element type for portal: "'.concat(e, '" portalNodes must be used with ').concat(e, " elements, but OutPortal is within <").concat(t.tagName, ">."));
                        t.replaceChild(A.element, r), n = t, i = r
                    }
                },
                unmount: function(e) {
                    (!e || e === i) && n && i && (n.replaceChild(i, A.element), n = void 0, i = void 0)
                }
            };
            return A
        },
        L = function(e) {
            function t(t) {
                var r = e.call(this, t) || this;
                return r.addPropsChannel = function() {
                    Object.assign(r.props.node, {
                        setPortalProps: function(e) {
                            r.setState({
                                nodeProps: e
                            })
                        }
                    })
                }, r.state = {
                    nodeProps: r.props.node.getInitialPortalProps()
                }, r
            }
            return w(t, e), t.prototype.componentDidMount = function() {
                this.addPropsChannel()
            }, t.prototype.componentDidUpdate = function() {
                this.addPropsChannel()
            }, t.prototype.render = function() {
                var e = this,
                    t = this.props,
                    r = t.children,
                    a = t.node;
                return v.createPortal(l.Children.map(r, function(t) {
                    return l.isValidElement(t) ? l.cloneElement(t, e.state.nodeProps) : t
                }), a.element)
            }, t
        }(l.PureComponent),
        B = function(e) {
            function t(t) {
                var r = e.call(this, t) || this;
                return r.placeholderNode = l.createRef(), r.passPropsThroughPortal(), r
            }
            return w(t, e), t.prototype.passPropsThroughPortal = function() {
                var e = Object.assign({}, this.props, {
                    node: void 0
                });
                this.props.node.setPortalProps(e)
            }, t.prototype.componentDidMount = function() {
                var e = this.props.node;
                this.currentPortalNode = e;
                var t = this.placeholderNode.current,
                    r = t.parentNode;
                e.mount(r, t), this.passPropsThroughPortal()
            }, t.prototype.componentDidUpdate = function() {
                var e = this.props.node;
                this.currentPortalNode && e !== this.currentPortalNode && (this.currentPortalNode.unmount(this.placeholderNode.current), this.currentPortalNode.setPortalProps({}), this.currentPortalNode = e);
                var t = this.placeholderNode.current,
                    r = t.parentNode;
                e.mount(r, t), this.passPropsThroughPortal()
            }, t.prototype.componentWillUnmount = function() {
                var e = this.props.node;
                e.unmount(this.placeholderNode.current), e.setPortalProps({})
            }, t.prototype.render = function() {
                var e = this.props.node.element.tagName,
                    t = this.props.node.elementType === O ? e.toLowerCase() : e;
                return l.createElement(t, {
                    ref: this.placeholderNode
                })
            }, t
        }(l.PureComponent),
        P = M.bind(null, O);
    M.bind(null, "svg");
    var F = e.i(134709),
        U = e.i(473765);

    function G(e) {
        return "__isServerSidePortalNode" in e
    }

    function H(...e) {
        if (!U.isBrowser) {
            let [t] = e;
            return {
                element: {
                    tagName: t ? .containerElement ? ? "div"
                },
                __isServerSidePortalNode: !0
            }
        }
        return P(...e)
    }

    function j(e) {
        let t, n, i, s = (0, a.c)(6);
        s[0] !== e ? ({
            node: t,
            ...n
        } = e, s[0] = e, s[1] = t, s[2] = n) : (t = s[1], n = s[2]);
        let o = (0, F.default)();
        return G(t) || !o ? null : (s[3] !== t || s[4] !== n ? (i = (0, r.jsx)(L, {
            node: t,
            ...n
        }), s[3] = t, s[4] = n, s[5] = i) : i = s[5], i)
    }
    e.s(["InPortal", 0, j, "OutPortal", 0, function(e) {
        let t, n, i, s = (0, a.c)(8);
        if (s[0] !== e ? ({
                node: t,
                ...n
            } = e, s[0] = e, s[1] = t, s[2] = n) : (t = s[1], n = s[2]), G(t)) {
            let e, r = t.element.tagName;
            return s[3] !== r ? (e = (0, l.createElement)(r), s[3] = r, s[4] = e) : e = s[4], e
        }
        return s[5] !== t || s[6] !== n ? (i = (0, r.jsx)(B, {
            node: t,
            ...n
        }), s[5] = t, s[6] = n, s[7] = i) : i = s[7], i
    }, "createHtmlPortalNode", 0, H], 28589);
    var Q = e.i(784521);
    let K = (0, e.i(322324).create)()(() => ({
        smpDrawerControlsPortalNode: H(),
        buySellWidgetPortalNode: H({
            attributes: {
                style: "display: contents"
            }
        })
    }));

    function Y(e) {
        return e.smpDrawerControlsPortalNode
    }

    function W() {}
    e.s(["useVisualStateStore", 0, K], 385773), e.s(["default", 0, () => {
        let e, t, n, i, c, u, d, A, h, m, f, g, b = (0, a.c)(23),
            I = (0, E.useRouter)(),
            C = (0, p.useTranslations)();
        b[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], b[0] = e) : e = b[0];
        let {
            authenticated: S
        } = (0, Q.useAccountContext)(e), N = K(Y), k = "/" === I.pathname || I.pathname.includes("/event"), [v, w] = (0, l.useState)(!1), [O, R] = (0, l.useState)(!1), [M, L] = (0, l.useState)(!1);
        b[1] === Symbol.for("react.memo_cache_sentinel") ? (t = () => {
            if ("true" !== localStorage.getItem("howItWorksButtonHidden")) {
                let e = setTimeout(() => {
                    L(!0)
                }, 3e3);
                return () => clearTimeout(e)
            }
            return W
        }, n = [], b[1] = t, b[2] = n) : (t = b[1], n = b[2]), (0, l.useEffect)(t, n), b[3] !== M ? (i = () => {
            M && R(!0)
        }, c = [M], b[3] = M, b[4] = i, b[5] = c) : (i = b[4], c = b[5]), (0, l.useEffect)(i, c);
        let B = (0, x.useAmplitudeAnalytics)();
        b[6] !== B ? (u = () => {
            B.trackEvent(_.Events.HowItWorksFooterClicked), w(!0)
        }, b[6] = B, b[7] = u) : u = b[7];
        let P = u;
        b[8] === Symbol.for("react.memo_cache_sentinel") ? (d = () => {
            R(!1), localStorage.setItem("howItWorksButtonHidden", "true")
        }, b[8] = d) : d = b[8];
        let F = d;
        return !S && k && O ? (b[9] !== O || b[10] !== P || b[11] !== C ? (A = O && (0, r.jsxs)(o.motion.div, {
            className: "w-full bg-background text-brand-500 font-medium text-center py-3 relative rounded-t-lg border-t border-border flex items-center justify-center gap-1.5 lg:hidden",
            initial: {
                y: 100,
                opacity: 0
            },
            animate: {
                y: 0,
                opacity: 1
            },
            exit: {
                y: 100,
                opacity: 0
            },
            transition: {
                type: "spring",
                damping: 20,
                stiffness: 300,
                duration: .5
            },
            children: [(0, r.jsxs)("button", {
                type: "button",
                onClick: P,
                onKeyDown: e => {
                    ("Enter" === e.key || " " === e.key) && P()
                },
                className: "flex items-center justify-center gap-2 cursor-pointer w-full bg-transparent border-0",
                children: [(0, r.jsx)(T.IconCircleInfoFill18, {
                    size: 16
                }), (0, r.jsx)("span", {
                    className: "text-sm font-semibold whitespace-nowrap text-brand-500",
                    children: C("howItWorks.text")
                })]
            }), (0, r.jsx)("button", {
                type: "button",
                onClick: F,
                className: "absolute right-3 bg-transparent border-0 cursor-pointer flex items-center justify-center p-1",
                "aria-label": "Dismiss how it works button",
                children: (0, r.jsx)(y.IconXmarkOutline12, {})
            })]
        }), b[9] = O, b[10] = P, b[11] = C, b[12] = A) : A = b[12], b[13] !== A ? (h = (0, r.jsx)(s.AnimatePresence, {
            children: A
        }), b[13] = A, b[14] = h) : h = b[14], b[15] !== N || b[16] !== h ? (m = (0, r.jsx)(j, {
            node: N,
            children: h
        }), b[15] = N, b[16] = h, b[17] = m) : m = b[17], b[18] !== v ? (f = (0, r.jsx)(D, {
            open: v,
            onOpenChange: w,
            completionEvent: _.Events.HowItWorksFooterCompleted
        }), b[18] = v, b[19] = f) : f = b[19], b[20] !== f || b[21] !== m ? (g = (0, r.jsxs)(r.Fragment, {
            children: [m, f]
        }), b[20] = f, b[21] = m, b[22] = g) : g = b[22], g) : null
    }], 330959);
    var q = e.i(197994);
    e.s(["IconCircleDollarFill18", 0, ({ ...e
    }) => l.default.createElement(q.Icon, {
        size: "18px",
        ...e
    }, l.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M9 1C4.58168 1 1 4.58179 1 9C1 13.4182 4.58168 17 9 17C13.4183 17 17 13.4182 17 9C17 4.58179 13.4183 1 9 1ZM9.7499 5.2499C9.7499 4.83569 9.41411 4.4999 8.9999 4.4999C8.58569 4.4999 8.2499 4.83569 8.2499 5.2499V5.50371C7.13452 5.56836 6.25 6.49332 6.25 7.6249C6.25 8.79813 7.201 9.7501 8.3748 9.7501H9.6251C9.97019 9.7501 10.2499 10.0298 10.2499 10.3749C10.2499 10.7201 9.97012 10.9998 9.6251 10.9998H7.2499C6.83569 10.9998 6.4999 11.3356 6.4999 11.7498C6.4999 12.164 6.83569 12.4998 7.2499 12.4998H8.2499V12.7499C8.2499 13.1641 8.58569 13.4999 8.9999 13.4999C9.41411 13.4999 9.7499 13.1641 9.7499 12.7499V12.4962C10.8654 12.4316 11.7499 11.5065 11.7499 10.3749C11.7499 9.20139 10.7986 8.2501 9.6251 8.2501H8.3748C8.03 8.2501 7.75 7.97027 7.75 7.6249C7.75 7.27981 8.02971 7.0001 8.3748 7.0001H10.75C11.1642 7.0001 11.5 6.66431 11.5 6.2501C11.5 5.83589 11.1642 5.5001 10.75 5.5001H9.7499V5.2499Z",
        fill: "currentColor"
    }))], 512662), e.s(["IconMoonFill18", 0, ({ ...e
    }) => l.default.createElement(q.Icon, {
        size: "18px",
        ...e
    }, l.default.createElement("path", {
        d: "M16.705,10.223c-.246-.183-.579-.197-.838-.037-.868,.532-1.859,.813-2.867,.813-3.033,0-5.5-2.467-5.5-5.5,0-1.146,.354-2.247,1.023-3.186,.177-.249,.186-.581,.021-.839-.164-.258-.467-.386-.77-.334C3.994,1.847,1.25,5.152,1.25,9c0,4.411,3.589,8,8,8,3.638,0,6.819-2.461,7.735-5.986,.077-.296-.034-.609-.28-.791Z",
        fill: "currentColor"
    }))], 892165), e.s(["IconPlug2Fill18", 0, ({ ...e
    }) => l.default.createElement(q.Icon, {
        size: "18px",
        ...e
    }, l.default.createElement("path", {
        d: "M9.47,9.97l-1.025,1.025-1.439-1.44,1.025-1.025c.293-.293,.293-.768,0-1.061s-.768-.293-1.061,0l-1.025,1.025-.311-.311c-.682-.683-1.793-.683-2.475,0l-.28,.28c-.89,.889-1.379,2.071-1.379,3.328,0,1.003,.323,1.95,.9,2.747l-1.181,1.181c-.293,.293-.293,.768,0,1.061,.146,.146,.338,.22,.53,.22s.384-.073,.53-.22l1.181-1.181c.796,.577,1.743,.9,2.746,.9,1.258,0,2.439-.49,3.328-1.379l.28-.28c.683-.682,.683-1.792,0-2.475l-.311-.311,1.025-1.025c.293-.293,.293-.768,0-1.061s-.768-.293-1.061,0Z",
        fill: "currentColor"
    }), l.default.createElement("path", {
        d: "M15.72,1.22l-1.181,1.181c-.796-.577-1.743-.9-2.746-.9-1.258,0-2.439,.49-3.328,1.379l-.28,.28c-.683,.682-.683,1.792,0,2.475l4.182,4.182c.341,.341,.789,.512,1.237,.512s.896-.17,1.237-.512l.28-.28c.89-.889,1.379-2.071,1.379-3.328,0-1.003-.323-1.95-.9-2.747l1.181-1.181c.293-.293,.293-.768,0-1.061s-.768-.293-1.061,0Z",
        fill: "currentColor",
        "data-color": "color-2"
    }))], 424134)
}, 806421, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(197994);
    e.s(["IconTrophyFill18", 0, ({ ...e
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...e
    }, t.default.createElement("path", {
        d: "M10.2939 12.0781C10.3408 12.3118 10.4361 12.639 10.6285 12.9951C11.0023 13.6866 11.7768 14.5533 13.4544 15.0284C13.8145 15.1304 14.0444 15.4824 13.9929 15.8532C13.9414 16.224 13.6244 16.5 13.25 16.5H4.75C4.37565 16.5 4.05862 16.224 4.00713 15.8532C3.95564 15.4824 4.18545 15.1304 4.54564 15.0284C6.2232 14.5533 6.99773 13.6866 7.37146 12.9951C7.56392 12.639 7.65918 12.3118 7.70606 12.0781H10.2939Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), t.default.createElement("path", {
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M4.25 1.5C4.03804 1.5 3.83598 1.58969 3.69379 1.74688C3.5516 1.90407 3.48257 2.11409 3.50376 2.32499C3.52672 2.55341 3.55114 2.77843 3.57705 3H1.75C1.35136 3 1.02231 3.31315 1.001 3.71122C0.987039 4.01409 0.996998 4.31866 1.01745 4.62094C1.05313 5.1484 1.14387 5.86677 1.37026 6.59708C1.59529 7.32297 1.9692 8.10879 2.60261 8.71957C3.25428 9.34795 4.1396 9.75 5.28601 9.75C5.29876 9.75 5.31143 9.74968 5.32402 9.74905C6.12239 11.2878 7.22471 12.3377 8.6817 12.4956C8.88758 12.5179 9.11171 12.518 9.3183 12.4956C10.7753 12.3377 11.8776 11.2878 12.676 9.74905C12.6886 9.74968 12.7012 9.75 12.714 9.75C13.8606 9.75 14.746 9.348 15.3978 8.7196C16.0313 8.10879 16.4052 7.32294 16.6301 6.59701C16.8565 5.86668 16.9471 5.14829 16.9827 4.62082C17.0032 4.3177 17.0109 4.01342 16.9989 3.70977C16.9775 3.31176 16.6486 3 16.25 3H14.423C14.4489 2.77843 14.4733 2.55341 14.4962 2.32499C14.5174 2.11409 14.4484 1.90407 14.3062 1.74688C14.164 1.58969 13.962 1.5 13.75 1.5H4.25ZM14.2165 4.5C13.9925 5.89928 13.6993 7.13285 13.3361 8.18527C13.7707 8.08802 14.0984 7.88879 14.3566 7.63978C14.7441 7.26621 15.0156 6.73956 15.1974 6.15299C15.3633 5.61745 15.4504 5.05862 15.4874 4.5H14.2165ZM4.66387 8.18523C4.30067 7.13281 4.00755 5.89927 3.78351 4.5H2.51272C2.54985 5.05861 2.63699 5.61741 2.803 6.15292C2.98485 6.73953 3.25638 7.26621 3.64381 7.6398C3.90202 7.88878 4.22956 8.08797 4.66387 8.18523Z",
        fill: "currentColor"
    }))])
}, 636071, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(149534);
    e.s(["IconGearOutline18", 0, ({
        strokeWidth: e = 1.5,
        ...a
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...a
    }, t.default.createElement("path", {
        d: "M9 11.2495C10.2426 11.2495 11.25 10.2422 11.25 8.99951C11.25 7.75687 10.2426 6.74951 9 6.74951C7.75736 6.74951 6.75 7.75687 6.75 8.99951C6.75 10.2422 7.75736 11.2495 9 11.2495Z",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }), t.default.createElement("path", {
        d: "M16.25 9.35449V8.6445C16.25 8.1345 15.867 7.70651 15.36 7.65051L14.266 7.5285L13.763 6.31451L14.451 5.45551C14.769 5.05751 14.738 4.4845 14.377 4.1235L13.875 3.62149C13.515 3.26149 12.941 3.22949 12.543 3.54749L11.684 4.2355L10.47 3.73251L10.348 2.63849C10.292 2.13249 9.86405 1.7485 9.35405 1.7485H8.64405C8.13405 1.7485 7.70605 2.13149 7.65005 2.63849L7.52805 3.73251L6.31404 4.2355L5.45505 3.54849C5.05705 3.23049 4.48405 3.2615 4.12305 3.6225L3.62104 4.12451C3.26104 4.48451 3.22905 5.05851 3.54705 5.45651L4.23505 6.31549L3.73204 7.52951L2.63805 7.65149C2.13205 7.70749 1.74805 8.13551 1.74805 8.64551V9.3555C1.74805 9.8655 2.13105 10.2935 2.63805 10.3495L3.73204 10.4715L4.23505 11.6855L3.54805 12.5445C3.23005 12.9425 3.26105 13.5165 3.62205 13.8765L4.12405 14.3785C4.48405 14.7385 5.05805 14.7705 5.45605 14.4525L6.31504 13.7645L7.52905 14.2675L7.65105 15.3615C7.70705 15.8675 8.13505 16.2515 8.64505 16.2515H9.35505C9.86505 16.2515 10.293 15.8685 10.349 15.3615L10.471 14.2675L11.685 13.7645L12.544 14.4525C12.942 14.7705 13.515 14.7395 13.876 14.3785L14.378 13.8765C14.738 13.5165 14.77 12.9425 14.452 12.5445L13.765 11.6855L14.268 10.4715L15.362 10.3495C15.868 10.2935 16.252 9.8655 16.252 9.3555L16.25 9.35449Z",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }))])
}, 15727, 334986, 868469, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340);

    function a() {
        window.Intercom && window.Intercom("showMessages")
    }
    e.s(["useIntercomSupport", 0, () => {
        let e, r = (0, t.c)(1);
        return r[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
            openSupport: a
        }, r[0] = e) : e = r[0], e
    }], 15727);
    var n = e.i(221628),
        i = e.i(158789),
        s = e.i(219469),
        o = e.i(215959),
        l = e.i(481640),
        c = e.i(188634),
        u = e.i(366718);
    let d = "locale-prompt-dismissed";

    function p() {
        try {
            localStorage.setItem(d, "true")
        } catch {}
    }
    let A = (0, r.createContext)(null);

    function h() {
        let e = (0, t.c)(1),
            a = (0, r.useContext)(A);
        if (!a) {
            let t;
            return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {
                showPrompt: !1,
                startOpenTimer: y,
                cancelOpenTimer: g,
                markAsSeenImmediate: f,
                completeInteraction: m
            }, e[0] = t) : t = e[0], t
        }
        return a
    }

    function m() {}

    function f() {}

    function g() {}

    function y() {}
    e.s(["LocalePromptProvider", 0, function(e) {
        let a, i, s, o, l, c, u, h, m, f, g = (0, t.c)(20),
            {
                children: y
            } = e,
            [T, E] = (0, r.useState)(!1),
            [b, I] = (0, r.useState)(!1),
            C = (0, r.useRef)(null);
        g[0] === Symbol.for("react.memo_cache_sentinel") ? (a = () => {
            E(! function() {
                try {
                    return "true" === localStorage.getItem(d)
                } catch {
                    return !0
                }
            }() && !("u" < typeof navigator || (navigator.language || "en").toLowerCase().startsWith("en")))
        }, i = [], g[0] = a, g[1] = i) : (a = g[0], i = g[1]), (0, r.useEffect)(a, i), g[2] === Symbol.for("react.memo_cache_sentinel") ? (s = () => () => {
            C.current && clearTimeout(C.current)
        }, o = [], g[2] = s, g[3] = o) : (s = g[2], o = g[3]), (0, r.useEffect)(s, o), g[4] !== b || g[5] !== T ? (l = () => {
            T && !b && (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
                I(!0), p()
            }, 3e3))
        }, g[4] = b, g[5] = T, g[6] = l) : l = g[6];
        let S = l;
        g[7] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
            C.current && (clearTimeout(C.current), C.current = null)
        }, g[7] = c) : c = g[7];
        let _ = c;
        g[8] !== T ? (u = () => {
            T && (_(), E(!1), p())
        }, g[8] = T, g[9] = u) : u = g[9];
        let N = u;
        g[10] !== b ? (h = () => {
            _(), b && (E(!1), I(!1))
        }, g[10] = b, g[11] = h) : h = g[11];
        let x = h;
        return g[12] !== x || g[13] !== N || g[14] !== T || g[15] !== S ? (m = {
            showPrompt: T,
            startOpenTimer: S,
            cancelOpenTimer: _,
            markAsSeenImmediate: N,
            completeInteraction: x
        }, g[12] = x, g[13] = N, g[14] = T, g[15] = S, g[16] = m) : m = g[16], g[17] !== y || g[18] !== m ? (f = (0, n.jsx)(A.Provider, {
            value: m,
            children: y
        }), g[17] = y, g[18] = m, g[19] = f) : f = g[19], f
    }, "useLocalePrompt", 0, h], 334986);
    var T = e.i(446789);
    let E = Object.values(T.LANGUAGES);

    function b(e) {
        return (e + 1) % E.length
    }

    function I(e) {
        let a, i, l, u, d, p, A, h, m, f, g, y, T, I, C = (0, t.c)(26),
            {
                mobile: S,
                locale: _
            } = e,
            N = void 0 !== S && S,
            x = function(e) {
                let a, n, i, s = (0, t.c)(4);
                s[0] !== e ? (a = E.findIndex(t => t.code === e), s[0] = e, s[1] = a) : a = s[1];
                let o = Math.max(0, a),
                    [l, c] = r.default.useState(o);
                return s[2] === Symbol.for("react.memo_cache_sentinel") ? (n = () => {
                    let e = setInterval(() => {
                        c(b)
                    }, 2e3);
                    return () => clearInterval(e)
                }, i = [], s[2] = n, s[3] = i) : (n = s[2], i = s[3]), r.default.useEffect(n, i), E[l]
            }(_),
            k = `relative overflow-hidden inline-flex items-center ${N?"h-7 w-5":"h-5 w-4"}`;
        C[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
            y: "100%",
            opacity: 0
        }, i = {
            y: 0,
            opacity: 1
        }, l = {
            y: "-100%",
            opacity: 0
        }, u = {
            duration: .2,
            ease: "easeInOut"
        }, C[0] = a, C[1] = i, C[2] = l, C[3] = u) : (a = C[0], i = C[1], l = C[2], u = C[3]);
        let D = x.countryCode,
            v = `${N?"size-5":"size-4"} rounded-sm object-cover`;
        C[4] !== D || C[5] !== v ? (d = (0, n.jsx)(c.FlagIcon, {
            countryCode: D,
            className: v
        }), C[4] = D, C[5] = v, C[6] = d) : d = C[6], C[7] !== x.code || C[8] !== d ? (p = (0, n.jsx)(s.AnimatePresence, {
            mode: "popLayout",
            initial: !1,
            children: (0, n.jsx)(o.motion.span, {
                initial: a,
                animate: i,
                exit: l,
                transition: u,
                className: "absolute left-0 flex items-center leading-none",
                "aria-hidden": "true",
                children: d
            }, x.code)
        }), C[7] = x.code, C[8] = d, C[9] = p) : p = C[9], C[10] !== p || C[11] !== k ? (A = (0, n.jsx)("span", {
            className: k,
            children: p
        }), C[10] = p, C[11] = k, C[12] = A) : A = C[12];
        let w = `relative overflow-hidden inline-flex items-center ${N?"h-7 w-[110px]":"h-5 w-[75px]"}`;
        return C[13] === Symbol.for("react.memo_cache_sentinel") ? (h = {
            y: "100%",
            opacity: 0
        }, m = {
            y: 0,
            opacity: 1
        }, f = {
            y: "-100%",
            opacity: 0
        }, g = {
            duration: .2,
            ease: "easeInOut"
        }, C[13] = h, C[14] = m, C[15] = f, C[16] = g) : (h = C[13], m = C[14], f = C[15], g = C[16]), C[17] !== x.code || C[18] !== x.languageWord ? (y = (0, n.jsx)(s.AnimatePresence, {
            mode: "popLayout",
            initial: !1,
            children: (0, n.jsx)(o.motion.span, {
                initial: h,
                animate: m,
                exit: f,
                transition: g,
                className: "absolute left-0 flex items-center whitespace-nowrap",
                children: x.languageWord
            }, x.code)
        }), C[17] = x.code, C[18] = x.languageWord, C[19] = y) : y = C[19], C[20] !== w || C[21] !== y ? (T = (0, n.jsx)("span", {
            className: w,
            children: y
        }), C[20] = w, C[21] = y, C[22] = T) : T = C[22], C[23] !== A || C[24] !== T ? (I = (0, n.jsxs)("span", {
            className: "inline-flex items-center gap-2",
            children: [A, T]
        }), C[23] = A, C[24] = T, C[25] = I) : I = C[25], I
    }

    function C(e) {
        return (0, n.jsxs)(i.DropdownMenuRadioItem, {
            value: e.code,
            children: [(0, n.jsx)(c.FlagIcon, {
                countryCode: e.countryCode,
                className: "size-4 rounded-sm object-cover"
            }), e.nativeName]
        }, e.code)
    }
    e.s(["LanguageSelector", 0, () => {
        let e, r, a, s, o, c, d, p, A, m = (0, t.c)(20),
            {
                currentLanguage: f,
                handleLanguageChange: g
            } = (0, u.useLanguageSelector)(),
            {
                showPrompt: y,
                markAsSeenImmediate: E
            } = h();
        m[0] !== E ? (e = e => e && E(), m[0] = E, m[1] = e) : e = m[1], m[2] !== f.code ? (r = (0, n.jsx)(I, {
            locale: f.code
        }), m[2] = f.code, m[3] = r) : r = m[3], m[4] !== y ? (a = y && (0, n.jsx)("div", {
            className: "size-2 rounded-full border-[1.5px] border-background group-hover:border-neutral-50 group-data-[state=open]:border-neutral-50 bg-bg-brand transition-all duration-200"
        }), m[4] = y, m[5] = a) : a = m[5], m[6] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, n.jsx)(l.IconChevronRightOutline12, {
            className: "size-3.5 text-text-tertiary"
        }), m[6] = s) : s = m[6], m[7] !== a ? (o = (0, n.jsxs)("span", {
            className: "ml-auto shrink-0 flex items-center gap-1.5",
            children: [a, s]
        }), m[7] = a, m[8] = o) : o = m[8], m[9] !== r || m[10] !== o ? (c = (0, n.jsxs)(i.DropdownMenuSubTrigger, {
            className: "group w-full h-10 px-3 rounded-md text-text-secondary [&>svg]:hidden",
            children: [r, o]
        }), m[9] = r, m[10] = o, m[11] = c) : c = m[11];
        let b = f.code;
        return m[12] === Symbol.for("react.memo_cache_sentinel") ? (d = Object.values(T.LANGUAGES).map(C), m[12] = d) : d = m[12], m[13] !== f.code || m[14] !== g ? (p = (0, n.jsx)(i.DropdownMenuSubContent, {
            sideOffset: 2,
            className: "max-h-[310px]",
            children: (0, n.jsx)(i.DropdownMenuRadioGroup, {
                value: b,
                onValueChange: g,
                children: d
            })
        }), m[13] = f.code, m[14] = g, m[15] = p) : p = m[15], m[16] !== e || m[17] !== c || m[18] !== p ? (A = (0, n.jsxs)(i.DropdownMenuSub, {
            onOpenChange: e,
            children: [c, p]
        }), m[16] = e, m[17] = c, m[18] = p, m[19] = A) : A = m[19], A
    }, "MobileLanguageSelector", 0, () => {
        let e, a, i, l, d, p, A, m, f, g = (0, t.c)(28),
            {
                currentLanguage: y,
                handleLanguageChange: E
            } = (0, u.useLanguageSelector)(),
            [b, C] = r.default.useState(!1),
            {
                ref: S,
                showTop: _,
                showBottom: N
            } = function() {
                let e, a, n, i, s = (0, t.c)(7),
                    [o, l] = r.default.useState(!1),
                    [c, u] = r.default.useState(!0),
                    [d, p] = r.default.useState(null);
                s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = e => {
                    p(e)
                }, s[0] = e) : e = s[0];
                let A = e;
                return s[1] !== d ? (a = () => {
                    if (!d) return;
                    let e = () => {
                        let {
                            scrollTop: e,
                            scrollHeight: t,
                            clientHeight: r
                        } = d;
                        l(e > 0), u(e < t - r - 1)
                    };
                    return e(), d.addEventListener("scroll", e), () => d.removeEventListener("scroll", e)
                }, n = [d], s[1] = d, s[2] = a, s[3] = n) : (a = s[2], n = s[3]), r.default.useEffect(a, n), s[4] !== c || s[5] !== o ? (i = {
                    ref: A,
                    showTop: o,
                    showBottom: c
                }, s[4] = c, s[5] = o, s[6] = i) : i = s[6], i
            }(),
            {
                showPrompt: x,
                markAsSeenImmediate: k
            } = h();
        g[0] !== b || g[1] !== k ? (e = () => {
            let e = !b;
            e && k(), C(e)
        }, g[0] = b, g[1] = k, g[2] = e) : e = g[2];
        let D = e;
        return g[3] !== y.code ? (a = (0, n.jsx)(I, {
            mobile: !0,
            locale: y.code
        }), g[3] = y.code, g[4] = a) : a = g[4], g[5] !== y.nativeName ? (i = (0, n.jsx)("span", {
            className: "text-sm text-text-tertiary truncate",
            children: y.nativeName
        }), g[5] = y.nativeName, g[6] = i) : i = g[6], g[7] !== x ? (l = x && (0, n.jsx)("div", {
            className: "size-2 rounded-full border-[1.5px] border-background bg-bg-brand shrink-0"
        }), g[7] = x, g[8] = l) : l = g[8], g[9] !== i || g[10] !== l ? (d = (0, n.jsxs)("span", {
            className: "flex items-center gap-1.5",
            children: [i, l]
        }), g[9] = i, g[10] = l, g[11] = d) : d = g[11], g[12] !== D || g[13] !== a || g[14] !== d ? (p = (0, n.jsxs)("button", {
            type: "button",
            className: "h-[30px] text-[20px] font-medium flex items-center w-full justify-between cursor-pointer",
            onClick: D,
            children: [a, d]
        }), g[12] = D, g[13] = a, g[14] = d, g[15] = p) : p = g[15], g[16] !== y.code || g[17] !== E || g[18] !== b || g[19] !== S || g[20] !== N || g[21] !== _ ? (A = b && (0, n.jsx)(o.motion.div, {
            initial: {
                height: 0,
                opacity: 0
            },
            animate: {
                height: "auto",
                opacity: 1
            },
            exit: {
                height: 0,
                opacity: 0
            },
            transition: {
                duration: .2,
                ease: "easeInOut"
            },
            className: "overflow-hidden",
            children: (0, n.jsxs)("div", {
                className: "relative mt-2 ml-2",
                children: [(0, n.jsx)("div", {
                    className: `pointer-events-none absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-background to-transparent z-10 transition-opacity duration-200 ${_?"opacity-100":"opacity-0"}`
                }), (0, n.jsx)("div", {
                    ref: S,
                    className: "flex flex-col max-h-[200px] overflow-y-auto",
                    children: Object.values(T.LANGUAGES).map(e => {
                        let t = e.code === y.code;
                        return (0, n.jsxs)("button", {
                            type: "button",
                            onClick: () => E(e.code),
                            className: `flex items-center justify-between py-2.5 px-3 pr-8 rounded-md hover:bg-neutral-50 text-left cursor-pointer text-sm font-medium relative ${t?"text-text-primary":""}`,
                            children: [(0, n.jsxs)("span", {
                                className: "flex items-center gap-2",
                                children: [(0, n.jsx)(c.FlagIcon, {
                                    countryCode: e.countryCode,
                                    className: "size-4 rounded-sm object-cover"
                                }), e.nativeName]
                            }), t && (0, n.jsx)("span", {
                                className: "absolute right-3 top-1/2 -translate-y-1/2",
                                children: (0, n.jsx)("div", {
                                    className: "size-1.5 rounded-full bg-text-brand"
                                })
                            })]
                        }, e.code)
                    })
                }), (0, n.jsx)("div", {
                    className: `pointer-events-none absolute bottom-0 left-0 right-0 h-6 bg-gradient-to-t from-background to-transparent z-10 transition-opacity duration-200 ${N?"opacity-100":"opacity-0"}`
                })]
            })
        }), g[16] = y.code, g[17] = E, g[18] = b, g[19] = S, g[20] = N, g[21] = _, g[22] = A) : A = g[22], g[23] !== A ? (m = (0, n.jsx)(s.AnimatePresence, {
            initial: !1,
            children: A
        }), g[23] = A, g[24] = m) : m = g[24], g[25] !== p || g[26] !== m ? (f = (0, n.jsxs)("div", {
            className: "flex flex-col",
            children: [p, m]
        }), g[25] = p, g[26] = m, g[27] = f) : f = g[27], f
    }], 868469)
}, 918997, e => {
    "use strict";
    var t = e.i(999061),
        r = e.i(416340),
        a = e.i(429411);

    function n() {}
    e.s(["useControllableState", 0, function(e) {
        let i, s, o, l = (0, t.c)(11),
            {
                prop: c,
                defaultProp: u,
                onChange: d
            } = e,
            p = void 0 === d ? n : d;
        l[0] !== u || l[1] !== p ? (i = {
            defaultProp: u,
            onChange: p
        }, l[0] = u, l[1] = p, l[2] = i) : i = l[2];
        let [A, h] = function(e) {
            let n, i, s = (0, t.c)(4),
                {
                    defaultProp: o,
                    onChange: l
                } = e,
                c = r.default.useState(o),
                [u] = c,
                d = r.default.useRef(u),
                p = (0, a.useCallbackRef)(l);
            return s[0] !== p || s[1] !== u ? (n = () => {
                d.current !== u && (p(u), d.current = u)
            }, i = [u, d, p], s[0] = p, s[1] = u, s[2] = n, s[3] = i) : (n = s[2], i = s[3]), r.default.useEffect(n, i), c
        }(i), m = void 0 !== c, f = m ? c : A, g = (0, a.useCallbackRef)(p);
        l[3] !== g || l[4] !== m || l[5] !== c || l[6] !== h ? (s = e => {
            if (m) {
                let t = "function" == typeof e ? e(c) : e;
                t !== c && g(t)
            } else h(e)
        }, l[3] = g, l[4] = m, l[5] = c, l[6] = h, l[7] = s) : s = l[7];
        let y = s;
        return l[8] !== y || l[9] !== f ? (o = [f, y], l[8] = y, l[9] = f, l[10] = o) : o = l[10], o
    }], 918997)
}, 313314, 468540, 523410, 621920, 273430, 796850, 882960, 949287, 588146, 137446, 148858, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(219469),
        n = e.i(215959),
        i = e.i(23128),
        s = e.i(208956),
        o = e.i(425010),
        l = e.i(512662),
        c = e.i(892165),
        u = e.i(424134),
        d = e.i(951194),
        p = e.i(806421),
        A = e.i(636071),
        h = e.i(416340),
        m = e.i(827681),
        f = e.i(789608),
        g = e.i(863828),
        y = e.i(15727),
        T = e.i(668122),
        E = e.i(79075),
        b = e.i(868469),
        I = e.i(945930),
        C = e.i(604777),
        S = e.i(784521),
        _ = e.i(305457),
        N = e.i(336896),
        x = e.i(429411),
        k = e.i(918997);
    let D = (e = 500) => ({
        reset: h.default.useCallback(t => {
            setTimeout(() => {
                if ("u" < typeof document) return;
                let e = document.getElementById("__pm_body");
                e && (e.style.pointerEvents = "auto")
            }, t || e)
        }, [e])
    });
    e.s(["useResetPointerEvents", 0, D], 468540);
    let v = h.default.createContext({
            isOpen: !1,
            isMobileMenuOpen: !1,
            isMobileSearchOpen: !1,
            setIsOpen: e => {
                throw Error("BottomDrawerContext must export an `setActiveMarketSlug` function.")
            },
            setIsMobileMenuOpen: e => {
                throw Error("BottomDrawerContext must export an `setMobileMenuOpen` function.")
            },
            setIsMobileSearchOpen: e => {
                throw Error("BottomDrawerContext must export an `setMobileSearchOpen` function.")
            },
            resetDrawer: () => {}
        }),
        w = () => h.default.useContext(v);
    e.s(["BottomDrawerContextProvider", 0, e => {
        let a, n, i, s, o, l, c, u, d, p, A, m, f = (0, r.c)(38),
            {
                children: y
            } = e,
            {
                open: T,
                setOpen: E
            } = (0, g.useSiwx)(),
            {
                reset: b
            } = D(),
            [I, C] = h.default.useState(!1),
            [S, _] = h.default.useState(!1);
        f[0] !== T || f[1] !== E ? (a = {
            prop: T,
            defaultProp: T,
            onChange: E
        }, f[0] = T, f[1] = E, f[2] = a) : a = f[2];
        let [w, O] = (0, k.useControllableState)(a), R = void 0 !== w && w;
        f[3] !== O ? (n = e => {
            C(e), e && (O(!1), _(!1))
        }, f[3] = O, f[4] = n) : n = f[4], f[5] !== I || f[6] !== n ? (i = {
            prop: I,
            defaultProp: !1,
            onChange: n
        }, f[5] = I, f[6] = n, f[7] = i) : i = f[7];
        let [M, L] = (0, k.useControllableState)(i), B = void 0 !== M && M;
        f[8] !== O ? (s = e => {
            _(e), e && (O(!1), C(!1))
        }, f[8] = O, f[9] = s) : s = f[9], f[10] !== S || f[11] !== s ? (o = {
            prop: S,
            defaultProp: !1,
            onChange: s
        }, f[10] = S, f[11] = s, f[12] = o) : o = f[12];
        let [P, F] = (0, k.useControllableState)(o), U = void 0 !== P && P;
        f[13] !== L || f[14] !== F || f[15] !== O ? (l = () => {
            O(!1), L(!1), F(!1)
        }, f[13] = L, f[14] = F, f[15] = O, f[16] = l) : l = f[16];
        let G = l,
            H = (0, x.useCallbackRef)(G);
        f[17] !== R || f[18] !== b || f[19] !== L || f[20] !== F ? (c = () => {
            if (R) {
                L(!1), F(!1);
                for (let e = 0; e < 3; e++) b(200 * e)
            }
        }, f[17] = R, f[18] = b, f[19] = L, f[20] = F, f[21] = c) : c = f[21], f[22] !== R ? (u = [R], f[22] = R, f[23] = u) : u = f[23], h.default.useEffect(c, u), f[24] !== H ? (d = () => (N.default.events.on("routeChangeStart", () => {
            H()
        }), () => {
            N.default.events.off("routeChangeStart", () => {
                H()
            })
        }), p = [H], f[24] = H, f[25] = d, f[26] = p) : (d = f[25], p = f[26]), h.default.useEffect(d, p), f[27] !== B || f[28] !== U || f[29] !== R || f[30] !== G || f[31] !== O || f[32] !== L || f[33] !== F ? (A = {
            isOpen: R,
            isMobileMenuOpen: B,
            isMobileSearchOpen: U,
            setIsOpen: O,
            setIsMobileMenuOpen: L,
            setIsMobileSearchOpen: F,
            resetDrawer: G
        }, f[27] = B, f[28] = U, f[29] = R, f[30] = G, f[31] = O, f[32] = L, f[33] = F, f[34] = A) : A = f[34];
        let j = A;
        return f[35] !== y || f[36] !== j ? (m = (0, t.jsx)(v.Provider, {
            value: j,
            children: y
        }), f[35] = y, f[36] = j, f[37] = m) : m = f[37], m
    }, "useBottomDrawerContext", 0, w], 523410);
    var O = e.i(664063),
        R = e.i(871150),
        M = e.i(213759),
        L = e.i(864076),
        B = e.i(631222),
        P = e.i(363966),
        F = e.i(333223);

    function U(e) {
        return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
    }
    var G = e.i(702502),
        H = e.i(288026),
        j = e.i(138567),
        Q = e.i(598440),
        K = e.i(83602),
        Y = e.i(5146),
        W = e.i(571333),
        q = e.i(313582);
    let V = e => e && (0, W.isAddress)(e) ? `${e.slice(0,6)}...${e.slice(e.length-4,e.length)}` : "";
    e.s(["parseAddress", 0, V, "parseUsername", 0, (e, t) => {
        let r = t ? q.USERNAME_MAX_DISPLAY_LENGTH_MOBILE : q.USERNAME_MAX_DISPLAY_LENGTH;
        return e.length > r ? e.substring(0, r).concat("...") : e
    }], 621920);
    var z = e.i(684686),
        J = e.i(799471);
    let Z = () => {
        let e, a, n, i, s, o, l = (0, r.c)(14),
            c = (0, C.useTranslations)();
        l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress"], l[0] = e) : e = l[0];
        let {
            proxyAddress: u
        } = (0, S.useAccountContext)(e), d = (() => {
            let e, t, a, n = (0, r.c)(7),
                i = (0, z.useGeoStore)($);
            n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress", "closedDynamic", "authenticationType"], n[0] = e) : e = n[0];
            let {
                proxyAddress: s,
                closedDynamic: o,
                authenticationType: l
            } = (0, S.useAccountContext)(e), {
                proxyUsdcBalanceMetadata: c
            } = (0, Y.default)();
            n[1] !== o || n[2] !== i || n[3] !== s ? (t = (0, J.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(s, i, o), n[1] = o, n[2] = i, n[3] = s, n[4] = t) : t = n[4];
            let u = t;
            try {
                let e;
                n[5] !== c.currentBalance ? (e = c.currentBalance.replace("$", "").replaceAll(",", ""), n[5] = c.currentBalance, n[6] = e) : e = n[6];
                let t = e;
                a = parseFloat(t) > .01
            } catch {
                a = !1
            }
            let d = a;
            return "magic" === l || !u.canDeposit && !d
        })();
        l[1] !== u ? (a = u && u.length ? V(u) : null, l[1] = u, l[2] = a) : a = l[2];
        let p = a;
        if (d) return null;
        l[3] !== p ? (n = e => (0, t.jsxs)("div", {
            className: "flex items-center gap-2 text-text-secondary",
            children: [(0, t.jsx)("p", {
                className: "text-xs",
                children: p
            }), e ? (0, t.jsx)(j.IconCheckOutline18, {
                size: 14
            }) : (0, t.jsx)(Q.IconCopyOutline18, {
                size: 14
            })]
        }), l[3] = p, l[4] = n) : n = l[4], l[5] !== c ? (i = c("navbar.copyAddress"), l[5] = c, l[6] = i) : i = l[6], l[7] !== c ? (s = c("navbar.copied"), l[7] = c, l[8] = s) : s = l[8];
        let A = u ? ? "";
        return l[9] !== n || l[10] !== i || l[11] !== s || l[12] !== A ? (o = (0, t.jsx)(K.default, {
            injectedComponent: n,
            restingTooltipCopy: i,
            copiedTooltipCopy: s,
            copyContent: A,
            tooltipSide: "bottom"
        }), l[9] = n, l[10] = i, l[11] = s, l[12] = A, l[13] = o) : o = l[13], o
    };

    function $(e) {
        return e.permissions
    }
    let X = () => {
        let e, a, n, i, o = (0, r.c)(13);
        o[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated", "proxyAddress"], o[0] = e) : e = o[0];
        let {
            authenticated: l,
            proxyAddress: c
        } = (0, S.useAccountContext)(e), {
            accountProfile: u
        } = (0, F.default)(), d = (0, H.default)(), p = !!d ? .width && d.width < 768;
        e: {
            if (u ? .username && c && u.username !== c) {
                a = u.username;
                break e
            }
            a = ""
        }
        let A = a;
        o[1] !== A ? (n = {
            text: A
        }, o[1] = A, o[2] = n) : n = o[2];
        let {
            containerRef: m,
            truncatedText: f,
            needsTruncation: g,
            isCalculating: y
        } = function(e) {
            let t, a, n, i = (0, r.c)(8),
                {
                    text: s,
                    suffix: o
                } = e,
                l = void 0 === o ? "..." : o,
                c = (0, h.useRef)(null),
                [u, d] = (0, h.useState)(null),
                [p, A] = (0, h.useState)(!1);
            i[0] !== l || i[1] !== s ? (t = () => {
                let e = c.current;
                if (!e || !s) {
                    d(s || ""), A(!1);
                    return
                }
                let t = !1,
                    r = () => {
                        if (t) return;
                        let r = e.getBoundingClientRect().width;
                        if (0 === r) return;
                        let a = getComputedStyle(e),
                            n = document.createElement("div");
                        if (n.style.cssText = `
        position: absolute;
        visibility: hidden;
        white-space: nowrap;
        width: auto;
        font-family: ${a.fontFamily};
        font-size: ${a.fontSize};
        font-weight: ${a.fontWeight};
        line-height: ${a.lineHeight};
        letter-spacing: ${a.letterSpacing};
      `, e.appendChild(n), n.innerHTML = U(s), n.getBoundingClientRect().width <= r) {
                            A(!1), d(s), e.removeChild(n);
                            return
                        }
                        A(!0);
                        let i = 0,
                            o = s.length,
                            c = "";
                        for (; i <= o;) {
                            let e = Math.floor((i + o) / 2);
                            n.innerHTML = U(s.slice(0, e)) + U(l), n.getBoundingClientRect().width <= r ? (c = s.slice(0, e), i = e + 1) : o = e - 1
                        }
                        d(c), e.removeChild(n)
                    };
                t || (document.fonts ? .ready ? document.fonts.ready.then(() => {
                    t || r()
                }) : r());
                let a = new ResizeObserver(() => {
                    t || r()
                });
                return a.observe(e), () => {
                    t = !0, a.disconnect()
                }
            }, a = [s, l], i[0] = l, i[1] = s, i[2] = t, i[3] = a) : (t = i[2], a = i[3]), (0, h.useLayoutEffect)(t, a);
            let m = null === u;
            return i[4] !== p || i[5] !== m || i[6] !== u ? (n = {
                containerRef: c,
                truncatedText: u,
                needsTruncation: p,
                isCalculating: m
            }, i[4] = p, i[5] = m, i[6] = u, i[7] = n) : n = i[7], n
        }(n);
        return o[3] !== u || o[4] !== l || o[5] !== m || o[6] !== y || o[7] !== p || o[8] !== g || o[9] !== c || o[10] !== f || o[11] !== A ? (i = l && u ? (0, t.jsxs)("div", {
            className: `w-full transition-all duration-200 ease-in-out flex flex-row items-center cursor-auto hover:bg-transparent ${p?"gap-4":"gap-3"}`,
            children: [(0, t.jsx)(s.default, {
                href: (0, G.createProfileUrl)({
                    proxyWallet: c ? ? "",
                    name: u ? .username
                }),
                className: "shrink-0 cursor-pointer",
                children: (0, t.jsx)(P.default, {
                    address: u.proxyWallet,
                    alt: "profile photo",
                    className: "rounded-full min-w-8 shrink-0",
                    profileImage: u ? .profile_image,
                    height: p ? 50 : 32,
                    width: p ? 50 : 32,
                    quality: 100
                })
            }), (0, t.jsxs)("div", {
                className: "flex flex-col gap-[2px] min-w-0 overflow-hidden",
                children: [(0, t.jsx)(s.default, {
                    href: (0, G.createProfileUrl)({
                        proxyWallet: c ? ? "",
                        name: u ? .username
                    }),
                    className: "block min-w-0",
                    children: (0, t.jsx)("div", {
                        ref: m,
                        className: `text-text-primary font-semibold leading-[1.25] hover:text-text-secondary transition-colors duration-200 truncate ${p?"text-[18px]":"text-[15px]"}`,
                        children: y ? (0, t.jsx)("span", {
                            className: "truncate block",
                            children: A
                        }) : (0, t.jsxs)("span", {
                            className: "truncate block",
                            children: [f, g && "..."]
                        })
                    })
                }), (0, t.jsx)(Z, {})]
            })]
        }) : null, o[3] = u, o[4] = l, o[5] = m, o[6] = y, o[7] = p, o[8] = g, o[9] = c, o[10] = f, o[11] = A, o[12] = i) : i = o[12], i
    };
    e.s(["default", 0, X], 273430);
    let ee = "h-[30px] text-[20px] font-medium flex items-center",
        et = () => {
            let e, a, n, N, x, k, D, v, P, F, U, G, H, j, Q, K, Y, W, q, V, z, J, Z, $, et, ea, en, ei, es, eo, el, ec, eu, ed, ep, eA, eh, em, ef, eg = (0, r.c)(98),
                ey = (0, _.useAmplitudeAnalytics)(),
                eT = (0, _.useGoogleAnalytics)(),
                {
                    setOpen: eE,
                    setConnectorRoute: eb
                } = (0, g.useSiwx)();
            eg[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated"], eg[0] = e) : e = eg[0];
            let {
                authenticated: eI
            } = (0, S.useAccountContext)(e), {
                disconnect: eC
            } = (0, f.useDisconnect)(), {
                setIsMobileSearchOpen: eS,
                setIsMobileMenuOpen: e_
            } = w(), {
                setTheme: eN,
                resolvedTheme: ex
            } = (0, o.useTheme)();
            eg[1] !== ex || eg[2] !== eN ? (a = () => eN("dark" === ex ? "light" : "dark"), eg[1] = ex, eg[2] = eN, eg[3] = a) : a = eg[3];
            let ek = a,
                eD = (0, C.useTranslations)(),
                [ev, ew] = (0, h.useState)(!1);
            eg[4] !== ev ? (n = () => {
                let e = setTimeout(er, 5e3);
                return ev && (e = setTimeout(() => {
                    ew(!1)
                }, 5e3)), () => clearTimeout(e)
            }, N = [ev], eg[4] = ev, eg[5] = n, eg[6] = N) : (n = eg[5], N = eg[6]), (0, h.useEffect)(n, N), eg[7] !== ey || eg[8] !== eT || eg[9] !== eb || eg[10] !== eE ? (x = () => {
                let e = Date.now();
                (0, E.markSignupPromptOpened)("mobile_navbar", {
                    now: e,
                    route: "login"
                }), ey.trackEvent(T.Events.SignupPromptOpened, (0, E.getSignupPromptOpenedEventProperties)({
                    source: "mobile_navbar",
                    route: "login"
                })), eb(m.ConnectorRoute.LOGIN), eE(!0), eT.trackClickEvent("LoginButtonConnectClick")
            }, eg[7] = ey, eg[8] = eT, eg[9] = eb, eg[10] = eE, eg[11] = x) : x = eg[11];
            let eO = x;
            eg[12] !== ey || eg[13] !== eT || eg[14] !== eb || eg[15] !== eE ? (k = () => {
                let e = Date.now();
                (0, E.markSignupPromptOpened)("mobile_navbar", {
                    now: e,
                    route: "signup"
                }), ey.trackEvent(T.Events.SignupPromptOpened, (0, E.getSignupPromptOpenedEventProperties)({
                    source: "mobile_navbar",
                    route: "signup"
                })), eb(m.ConnectorRoute.SIGNUP), eE(!0), eT.trackClickEvent("SignupButtonConnectClick")
            }, eg[12] = ey, eg[13] = eT, eg[14] = eb, eg[15] = eE, eg[16] = k) : k = eg[16];
            let eR = k;
            eg[17] !== eC || eg[18] !== e_ || eg[19] !== eS || eg[20] !== eE ? (D = () => {
                (0, I.setLogoutTrigger)({
                    reason: "user_logout",
                    initiator: "user",
                    trigger: "mobile_sidebar_logout"
                }), eC(), eE(!1), eS(!1), e_(!1)
            }, eg[17] = eC, eg[18] = e_, eg[19] = eS, eg[20] = eE, eg[21] = D) : D = eg[21];
            let eM = D,
                {
                    openSupport: eL
                } = (0, y.useIntercomSupport)();
            eg[22] !== eI ? (v = eI && (0, t.jsxs)("div", {
                className: "list-none items-center mb-[10px] flex gap-3",
                children: [(0, t.jsx)("div", {
                    className: "min-w-0 flex-1",
                    children: (0, t.jsx)(X, {})
                }), (0, t.jsx)(s.default, {
                    href: "/settings",
                    target: "_self",
                    className: "shrink-0",
                    children: (0, t.jsx)(i.Button, {
                        variant: "ghost",
                        size: "icon",
                        children: (0, t.jsx)(A.IconGearOutline18, {
                            size: 24
                        })
                    })
                })]
            }), eg[22] = eI, eg[23] = v) : v = eg[23], eg[24] === Symbol.for("react.memo_cache_sentinel") ? (P = (0, t.jsx)(p.IconTrophyFill18, {
                size: 20,
                color: "#FFB700"
            }), eg[24] = P) : P = eg[24], eg[25] !== eD ? (F = eD("navbar.leaderboard"), eg[25] = eD, eg[26] = F) : F = eg[26], eg[27] !== F ? (U = (0, t.jsxs)(s.default, {
                href: "/leaderboard",
                className: ee,
                children: [P, (0, t.jsx)("span", {
                    className: "ml-2",
                    children: F
                })]
            }), eg[27] = F, eg[28] = U) : U = eg[28];
            let eB = "dark" === ex ? "#379C65" : "#00B955";
            eg[29] !== eB ? (G = (0, t.jsx)(l.IconCircleDollarFill18, {
                size: 20,
                color: eB
            }), eg[29] = eB, eg[30] = G) : G = eg[30], eg[31] !== eD ? (H = eD("navbar.rewards"), eg[31] = eD, eg[32] = H) : H = eg[32], eg[33] !== H ? (j = (0, t.jsx)("span", {
                className: "ml-2",
                children: H
            }), eg[33] = H, eg[34] = j) : j = eg[34], eg[35] !== G || eg[36] !== j ? (Q = (0, t.jsxs)(s.default, {
                href: "/rewards",
                className: ee,
                children: [G, j]
            }), eg[35] = G, eg[36] = j, eg[37] = Q) : Q = eg[37];
            let eP = "dark" === ex ? "#C03065" : "#FF005E";
            return eg[38] !== eP ? (K = (0, t.jsx)(u.IconPlug2Fill18, {
                size: 20,
                color: eP
            }), eg[38] = eP, eg[39] = K) : K = eg[39], eg[40] !== eD ? (Y = eD("navbar.apis"), eg[40] = eD, eg[41] = Y) : Y = eg[41], eg[42] !== Y ? (W = (0, t.jsx)("span", {
                className: "ml-2",
                children: Y
            }), eg[42] = Y, eg[43] = W) : W = eg[43], eg[44] !== K || eg[45] !== W ? (q = (0, t.jsxs)(s.default, {
                href: `${B.POLYMARKET_DOCS_LINK}/api-reference`,
                target: "_blank",
                rel: "noopener noreferrer",
                className: ee,
                children: [K, W]
            }), eg[44] = K, eg[45] = W, eg[46] = q) : q = eg[46], eg[47] === Symbol.for("react.memo_cache_sentinel") ? (V = (0, t.jsx)("hr", {
                className: "my-3 h-px bg-border"
            }), eg[47] = V) : V = eg[47], eg[48] !== eD ? (z = eD("navbar.accuracy"), eg[48] = eD, eg[49] = z) : z = eg[49], eg[50] !== z ? (J = (0, t.jsx)(s.default, {
                href: "/accuracy",
                className: ee,
                children: z
            }), eg[50] = z, eg[51] = J) : J = eg[51], eg[52] !== eI || eg[53] !== eL || eg[54] !== eD ? (Z = eI && (0, t.jsx)("button", {
                type: "button",
                onClick: () => eL(),
                className: ee,
                children: eD("navbar.support")
            }), eg[52] = eI, eg[53] = eL, eg[54] = eD, eg[55] = Z) : Z = eg[55], eg[56] !== eD ? ($ = eD("navbar.documentation"), eg[56] = eD, eg[57] = $) : $ = eg[57], eg[58] !== $ ? (et = (0, t.jsx)(s.default, {
                href: B.POLYMARKET_DOCS_LINK,
                target: "_blank",
                rel: "noopener noreferrer",
                className: ee,
                children: $
            }), eg[58] = $, eg[59] = et) : et = eg[59], eg[60] !== eD ? (ea = eD("navbar.helpCenter"), eg[60] = eD, eg[61] = ea) : ea = eg[61], eg[62] !== ea ? (en = (0, t.jsx)(s.default, {
                href: B.POLYMARKET_HELP_CENTER_LINK,
                target: "_blank",
                rel: "noopener noreferrer",
                className: ee,
                children: ea
            }), eg[62] = ea, eg[63] = en) : en = eg[63], eg[64] !== eD ? (ei = eD("navbar.termsOfUse"), eg[64] = eD, eg[65] = ei) : ei = eg[65], eg[66] !== ei ? (es = (0, t.jsx)(s.default, {
                href: B.POLYMARKET_TOS_LINK,
                target: "_blank",
                rel: "noopener noreferrer",
                className: ee,
                children: ei
            }), eg[66] = ei, eg[67] = es) : es = eg[67], eg[68] === Symbol.for("react.memo_cache_sentinel") ? (eo = (0, t.jsx)(b.MobileLanguageSelector, {}), eg[68] = eo) : eo = eg[68], eg[69] !== J || eg[70] !== Z || eg[71] !== et || eg[72] !== en || eg[73] !== es ? (el = (0, t.jsxs)("div", {
                className: "flex flex-col gap-2 text-text-secondary",
                children: [J, Z, et, en, es, eo]
            }), eg[69] = J, eg[70] = Z, eg[71] = et, eg[72] = en, eg[73] = es, eg[74] = el) : el = eg[74], eg[75] === Symbol.for("react.memo_cache_sentinel") ? (ec = (0, t.jsx)("a", {
                href: B.POLYMARKET_SOCIAL_LINKS.twitter,
                target: "_blank",
                rel: "noopener noreferrer",
                children: (0, t.jsx)(i.Button, {
                    variant: "ghost",
                    size: "icon",
                    children: (0, t.jsx)(L.TwitterIcon, {
                        className: "[&_path]:fill-(--color-text-primary)"
                    })
                })
            }), eg[75] = ec) : ec = eg[75], eg[76] === Symbol.for("react.memo_cache_sentinel") ? (eu = (0, t.jsx)("a", {
                href: B.POLYMARKET_SOCIAL_LINKS.discord,
                target: "_blank",
                rel: "noopener noreferrer",
                children: (0, t.jsx)(i.Button, {
                    variant: "ghost",
                    size: "icon",
                    children: (0, t.jsx)(O.DiscordIcon, {
                        className: "[&_path]:fill-(--color-text-primary)"
                    })
                })
            }), eg[76] = eu) : eu = eg[76], eg[77] === Symbol.for("react.memo_cache_sentinel") ? (ed = (0, t.jsx)("a", {
                href: B.POLYMARKET_SOCIAL_LINKS.instagram,
                target: "_blank",
                rel: "noopener noreferrer",
                children: (0, t.jsx)(i.Button, {
                    variant: "ghost",
                    size: "icon",
                    children: (0, t.jsx)(R.InstagramIcon, {
                        className: "[&_path]:fill-(--color-text-primary)"
                    })
                })
            }), eg[77] = ed) : ed = eg[77], eg[78] === Symbol.for("react.memo_cache_sentinel") ? (ep = (0, t.jsx)("a", {
                href: B.POLYMARKET_SOCIAL_LINKS.tiktok,
                target: "_blank",
                rel: "noopener noreferrer",
                children: (0, t.jsx)(i.Button, {
                    variant: "ghost",
                    size: "icon",
                    children: (0, t.jsx)(M.TikTokIcon, {
                        className: "[&_path]:fill-(--color-text-primary)"
                    })
                })
            }), eg[78] = ep) : ep = eg[78], eg[79] !== ex ? (eA = "light" === ex ? (0, t.jsx)(c.IconMoonFill18, {
                style: {
                    width: "24px",
                    height: "24px"
                }
            }) : (0, t.jsx)(d.IconSunFill18, {
                style: {
                    width: "24px",
                    height: "24px"
                }
            }), eg[79] = ex, eg[80] = eA) : eA = eg[80], eg[81] !== ek || eg[82] !== eA ? (eh = (0, t.jsxs)("div", {
                className: "w-full mt-4 gap-2 flex",
                children: [ec, eu, ed, ep, (0, t.jsx)(i.Button, {
                    variant: "ghost",
                    size: "icon",
                    onClick: ek,
                    children: eA
                })]
            }), eg[81] = ek, eg[82] = eA, eg[83] = eh) : eh = eg[83], eg[84] !== eI || eg[85] !== eO || eg[86] !== eM || eg[87] !== eR || eg[88] !== eD ? (em = (0, t.jsx)("div", {
                className: "w-full mt-4 flex-col gap-2 flex",
                children: eI ? (0, t.jsx)(i.Button, {
                    onClick: eM,
                    variant: "outline",
                    className: "text-base text-[#AA3535]",
                    children: eD("navbar.logout")
                }) : (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)(i.Button, {
                        variant: "outline",
                        onClick: eO,
                        className: "text-base",
                        children: eD("auth.logIn")
                    }), (0, t.jsx)(i.Button, {
                        variant: "default",
                        onClick: eR,
                        className: "text-base",
                        children: eD("auth.signUp")
                    })]
                })
            }), eg[84] = eI, eg[85] = eO, eg[86] = eM, eg[87] = eR, eg[88] = eD, eg[89] = em) : em = eg[89], eg[90] !== U || eg[91] !== Q || eg[92] !== q || eg[93] !== el || eg[94] !== eh || eg[95] !== em || eg[96] !== v ? (ef = (0, t.jsxs)("div", {
                className: "flex flex-col justify-end font-normal w-full relative gap-[10px] flex-1 p-5 pb-[calc(60px+24px)]",
                children: [v, U, Q, q, V, el, eh, em]
            }), eg[90] = U, eg[91] = Q, eg[92] = q, eg[93] = el, eg[94] = eh, eg[95] = em, eg[96] = v, eg[97] = ef) : ef = eg[97], ef
        };

    function er() {
        return null
    }
    e.s(["default", 0, () => {
        let e, i, s = (0, r.c)(5),
            {
                isMobileMenuOpen: o,
                setIsMobileMenuOpen: l
            } = w();
        return s[0] !== o || s[1] !== l ? (e = o && (0, t.jsxs)(t.Fragment, {
            children: [(0, t.jsx)(n.motion.div, {
                className: "w-screen h-full fixed top-0 left-0 bottom-0 z-[105] bg-black/40",
                onClick: () => l(!1),
                initial: {
                    opacity: 0
                },
                animate: {
                    opacity: 1
                },
                exit: {
                    opacity: 0
                },
                transition: {
                    duration: .5,
                    ease: [.32, .72, 0, 1]
                }
            }), (0, t.jsx)(n.motion.div, {
                className: "fixed top-0 left-0 bottom-0 w-[85vw] z-[110] bg-background",
                initial: {
                    x: "-100%"
                },
                animate: {
                    x: 0
                },
                exit: {
                    x: "-100%"
                },
                transition: {
                    duration: .5,
                    ease: [.32, .72, 0, 1]
                },
                children: (0, t.jsx)(et, {})
            })]
        }), s[0] = o, s[1] = l, s[2] = e) : e = s[2], s[3] !== e ? (i = (0, t.jsx)(a.AnimatePresence, {
            children: e
        }), s[3] = e, s[4] = i) : i = s[4], i
    }], 313314), e.s(["default", 0, () => null], 796850);
    var ea = e.i(950495);
    let en = new Set,
        ei = !1,
        es = e => {
            let t = e.target;
            en.forEach(e => {
                let {
                    ref: r,
                    callback: a
                } = e;
                r.current && !r.current.contains(t) && a()
            })
        },
        eo = () => {
            ei && 0 === en.size && (document.removeEventListener("mousedown", es), document.removeEventListener("touchstart", es), ei = !1)
        },
        el = new Map,
        ec = !1,
        eu = e => {
            let t = el.get(e.key);
            if (t)
                for (let e of t) e()
        };

    function ed(e, t = !0) {
        let r = (0, h.useRef)(e);
        r.current = e;
        let a = (0, h.useCallback)(() => {
            r.current()
        }, []);
        (0, h.useEffect)(() => {
            if (!t) return;
            el.has("Escape") || el.set("Escape", new Set);
            let e = el.get("Escape");
            return e && e.add(a), ec || (document.addEventListener("keydown", eu, !0), ec = !0), () => {
                let e = el.get("Escape");
                e && (e.delete(a), 0 === e.size && el.delete("Escape")), 0 === el.size && ec && (document.removeEventListener("keydown", eu, !0), ec = !1)
            }
        }, [t, a])
    }
    let ep = new Set,
        eA = !1,
        eh = e => {
            for (let t of ep) t(e)
        };
    e.s(["useGlobalEscapeKey", 0, ed, "useGlobalKeydown", 0, function(e, t = !0) {
        let r = (0, h.useRef)(e);
        r.current = e;
        let a = (0, h.useCallback)(e => {
            r.current(e)
        }, []);
        (0, h.useEffect)(() => {
            if (t) return ep.add(a), eA || (document.addEventListener("keydown", eh, !0), eA = !0), () => {
                ep.delete(a), 0 === ep.size && eA && (document.removeEventListener("keydown", eh, !0), eA = !1)
            }
        }, [t, a])
    }], 882960), e.s(["useSearchSuggestions", 0, function(e) {
        let t, a, n, i, s, o, l, c, u, d, p, A, m = (0, r.c)(21),
            {
                debounceMs: f,
                containerRef: g
            } = e,
            y = void 0 === f ? 150 : f,
            T = (0, h.useRef)(0),
            [E, b] = (0, h.useState)(""),
            [I, C] = (0, h.useState)(""),
            [S, _] = (0, h.useState)(!1),
            [N, x] = (0, h.useState)(),
            [k, D] = (0, h.useState)(!1),
            v = (0, h.useRef)(null),
            w = g ? ? v,
            O = (0, h.useRef)(null);
        m[0] !== E ? (t = () => {
                C(E)
            }, a = [E], m[0] = E, m[1] = t, m[2] = a) : (t = m[1], a = m[2]), m[3] !== y ? (n = {
                wait: y,
                trailing: !0,
                leading: !1
            }, m[3] = y, m[4] = n) : n = m[4], (0, ea.useDebounceEffect)(t, a, n), m[5] === Symbol.for("react.memo_cache_sentinel") ? (i = () => _(!1), m[5] = i) : i = m[5],
            function(e, t, r = !0) {
                let a = (0, h.useRef)(e);
                a.current = e;
                let n = (0, h.useCallback)(() => {
                        a.current()
                    }, []),
                    i = (0, h.useRef)(null);
                (0, h.useEffect)(() => {
                    if (!r) {
                        i.current && (en.delete(i.current), i.current = null, eo());
                        return
                    }
                    let e = {
                        ref: t,
                        callback: n
                    };
                    return i.current = e, en.add(e), ei || (document.addEventListener("mousedown", es), document.addEventListener("touchstart", es), ei = !0), () => {
                        i.current && (en.delete(i.current), i.current = null, eo())
                    }
                }, [r, t, n])
            }(i, w, S), m[6] === Symbol.for("react.memo_cache_sentinel") ? (s = () => {
                O.current ? .blur(), _(!1)
            }, m[6] = s) : s = m[6], ed(s, S);
        let R = (0, h.useRef)(I);
        m[7] !== I ? (o = () => {
            R.current !== I && (R.current = I, x(void 0), D(!1))
        }, l = [I], m[7] = I, m[8] = o, m[9] = l) : (o = m[8], l = m[9]), (0, h.useEffect)(o, l), m[10] === Symbol.for("react.memo_cache_sentinel") ? (u = () => {
            let e = e => {
                if ("ArrowUp" !== e.key && "ArrowDown" !== e.key) return;
                let t = e.target;
                if ("INPUT" === t.tagName && t !== O.current || document.activeElement !== O.current) return;
                e.preventDefault(), e.stopPropagation();
                let r = "ArrowUp" === e.key,
                    a = T.current;
                0 !== a && (D(!0), x(e => r ? void 0 === e || 0 === e ? a - 1 : e - 1 : void 0 === e || e === a - 1 ? 0 : e + 1))
            };
            return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e)
        }, c = [], m[10] = c, m[11] = u) : (c = m[10], u = m[11]), (0, h.useEffect)(u, c), m[12] === Symbol.for("react.memo_cache_sentinel") ? (d = e => {
            T.current = e
        }, m[12] = d) : d = m[12];
        let M = d;
        m[13] === Symbol.for("react.memo_cache_sentinel") ? (p = () => {
            b(""), C(""), x(void 0), D(!1), O.current && (O.current.value = "", O.current.dispatchEvent(new Event("input", {
                bubbles: !0
            })))
        }, m[13] = p) : p = m[13];
        let L = p;
        return m[14] !== w || m[15] !== I || m[16] !== S || m[17] !== E || m[18] !== N || m[19] !== k ? (A = {
            query: E,
            setQuery: b,
            debouncedQuery: I,
            isOpen: S,
            setIsOpen: _,
            selectedIndex: N,
            setSelectedIndex: x,
            suppressFormSubmit: k,
            setSuppressFormSubmit: D,
            clearSearch: L,
            setTotalItems: M,
            containerRef: w,
            inputRef: O
        }, m[14] = w, m[15] = I, m[16] = S, m[17] = E, m[18] = N, m[19] = k, m[20] = A) : A = m[20], A
    }], 949287);
    var em = e.i(86831);
    e.s(["SearchSuggestionItem", 0, function(e) {
        let a, n, i, s, o, l, c = (0, r.c)(12);
        return c[0] !== e ? ({
            selected: s,
            children: a,
            className: n,
            ...i
        } = e, c[0] = e, c[1] = a, c[2] = n, c[3] = i, c[4] = s) : (a = c[1], n = c[2], i = c[3], s = c[4]), c[5] !== n ? (o = (0, em.cn)("flex items-center rounded-sm w-full gap-4 px-2 py-2", "hover:bg-neutral-50 data-[selected=true]:bg-neutral-100", n), c[5] = n, c[6] = o) : o = c[6], c[7] !== a || c[8] !== i || c[9] !== s || c[10] !== o ? (l = (0, t.jsx)("div", {
            "data-polykit": !0,
            "data-slot": "search-suggestion-item",
            "data-selected": s,
            className: o,
            ...i,
            children: a
        }), c[7] = a, c[8] = i, c[9] = s, c[10] = o, c[11] = l) : l = c[11], l
    }, "SearchSuggestionSectionLabel", 0, function(e) {
        let a, n, i, s, o, l = (0, r.c)(10);
        return l[0] !== e ? ({
            children: a,
            className: n,
            ...i
        } = e, l[0] = e, l[1] = a, l[2] = n, l[3] = i) : (a = l[1], n = l[2], i = l[3]), l[4] !== n ? (s = (0, em.cn)("text-[10px] font-medium text-text-secondary uppercase tracking-wider", n), l[4] = n, l[5] = s) : s = l[5], l[6] !== a || l[7] !== i || l[8] !== s ? (o = (0, t.jsx)("p", {
            "data-polykit": !0,
            "data-slot": "search-suggestion-section-label",
            className: s,
            ...i,
            children: a
        }), l[6] = a, l[7] = i, l[8] = s, l[9] = o) : o = l[9], o
    }, "SearchSuggestionsDropdown", 0, function(e) {
        let a, n, i = (0, r.c)(5),
            {
                open: s,
                children: o,
                className: l
            } = e;
        return s ? (i[0] !== l ? (a = (0, em.cn)("border border-t-0 p-2 pt-3 bg-background dark:bg-background rounded-t-none rounded-b-lg shadow-md", l), i[0] = l, i[1] = a) : a = i[1], i[2] !== o || i[3] !== a ? (n = (0, t.jsx)("div", {
            "data-polykit": !0,
            "data-slot": "search-suggestions-dropdown",
            className: a,
            children: o
        }), i[2] = o, i[3] = a, i[4] = n) : n = i[4], n) : null
    }], 588146);
    var ef = e.i(766181),
        eg = e.i(479399),
        ey = e.i(174617),
        eT = e.i(608652),
        eE = e.i(142953),
        eb = e.i(169525),
        eI = e.i(600317),
        eC = e.i(974539),
        eS = e.i(199786),
        e_ = e.i(40266),
        eN = "Tabs",
        [ex, ek] = (0, eT.createContextScope)(eN, [eE.createRovingFocusGroupScope]),
        eD = (0, eE.createRovingFocusGroupScope)(),
        [ev, ew] = ex(eN),
        eO = h.forwardRef((e, r) => {
            let {
                __scopeTabs: a,
                value: n,
                onValueChange: i,
                defaultValue: s,
                orientation: o = "horizontal",
                dir: l,
                activationMode: c = "automatic",
                ...u
            } = e, d = (0, eC.useDirection)(l), [p, A] = (0, eS.useControllableState)({
                prop: n,
                onChange: i,
                defaultProp: s ? ? "",
                caller: eN
            });
            return (0, t.jsx)(ev, {
                scope: a,
                baseId: (0, e_.useId)(),
                value: p,
                onValueChange: A,
                orientation: o,
                dir: d,
                activationMode: c,
                children: (0, t.jsx)(eI.Primitive.div, {
                    dir: d,
                    "data-orientation": o,
                    ...u,
                    ref: r
                })
            })
        });
    eO.displayName = eN;
    var eR = "TabsList",
        eM = h.forwardRef((e, r) => {
            let {
                __scopeTabs: a,
                loop: n = !0,
                ...i
            } = e, s = ew(eR, a), o = eD(a);
            return (0, t.jsx)(eE.Root, {
                asChild: !0,
                ...o,
                orientation: s.orientation,
                dir: s.dir,
                loop: n,
                children: (0, t.jsx)(eI.Primitive.div, {
                    role: "tablist",
                    "aria-orientation": s.orientation,
                    ...i,
                    ref: r
                })
            })
        });
    eM.displayName = eR;
    var eL = "TabsTrigger",
        eB = h.forwardRef((e, r) => {
            let {
                __scopeTabs: a,
                value: n,
                disabled: i = !1,
                ...s
            } = e, o = ew(eL, a), l = eD(a), c = eU(o.baseId, n), u = eG(o.baseId, n), d = n === o.value;
            return (0, t.jsx)(eE.Item, {
                asChild: !0,
                ...l,
                focusable: !i,
                active: d,
                children: (0, t.jsx)(eI.Primitive.button, {
                    type: "button",
                    role: "tab",
                    "aria-selected": d,
                    "aria-controls": u,
                    "data-state": d ? "active" : "inactive",
                    "data-disabled": i ? "" : void 0,
                    disabled: i,
                    id: c,
                    ...s,
                    ref: r,
                    onMouseDown: (0, ey.composeEventHandlers)(e.onMouseDown, e => {
                        i || 0 !== e.button || !1 !== e.ctrlKey ? e.preventDefault() : o.onValueChange(n)
                    }),
                    onKeyDown: (0, ey.composeEventHandlers)(e.onKeyDown, e => {
                        [" ", "Enter"].includes(e.key) && o.onValueChange(n)
                    }),
                    onFocus: (0, ey.composeEventHandlers)(e.onFocus, () => {
                        let e = "manual" !== o.activationMode;
                        d || i || !e || o.onValueChange(n)
                    })
                })
            })
        });
    eB.displayName = eL;
    var eP = "TabsContent",
        eF = h.forwardRef((e, r) => {
            let {
                __scopeTabs: a,
                value: n,
                forceMount: i,
                children: s,
                ...o
            } = e, l = ew(eP, a), c = eU(l.baseId, n), u = eG(l.baseId, n), d = n === l.value, p = h.useRef(d);
            return h.useEffect(() => {
                let e = requestAnimationFrame(() => p.current = !1);
                return () => cancelAnimationFrame(e)
            }, []), (0, t.jsx)(eb.Presence, {
                present: i || d,
                children: ({
                    present: a
                }) => (0, t.jsx)(eI.Primitive.div, {
                    "data-state": d ? "active" : "inactive",
                    "data-orientation": l.orientation,
                    role: "tabpanel",
                    "aria-labelledby": c,
                    hidden: !a,
                    id: u,
                    tabIndex: 0,
                    ...o,
                    ref: r,
                    style: { ...e.style,
                        animationDuration: p.current ? "0s" : void 0
                    },
                    children: a && s
                })
            })
        });

    function eU(e, t) {
        return `${e}-trigger-${t}`
    }

    function eG(e, t) {
        return `${e}-content-${t}`
    }
    eF.displayName = eP, e.s(["Content", 0, eF, "List", 0, eM, "Root", 0, eO, "Tabs", 0, eO, "TabsContent", 0, eF, "TabsList", 0, eM, "TabsTrigger", 0, eB, "Trigger", 0, eB, "createTabsScope", 0, ek], 170702);
    var eH = e.i(170702);
    e.s(["Tabs", 0, eH], 137446);
    var eH = eH;
    let ej = eH.Root,
        eQ = h.createContext(void 0),
        eK = (0, ef.cva)("absolute pointer-events-none", {
            variants: {
                variant: {
                    highlight: "top-1/2 -translate-y-1/2 h-8 rounded-sm h-8 bg-tabs-highlight-bg",
                    underline: "bottom-0 h-0.5 rounded-none bg-tabs-underline-bg",
                    hidden: ""
                }
            },
            defaultVariants: {
                variant: "highlight"
            }
        }),
        eY = (0, ef.cva)("relative inline-flex h-9 items-center justify-center p-1 text-zinc-500 group", {
            variants: {
                variant: {
                    hidden: "p-1 bg-transparent",
                    highlight: "rounded-lg bg-transparent p-1 text-sm gap-x-1",
                    underline: "bg-transparent"
                },
                defaultVariants: {
                    variant: "highlight"
                }
            }
        });
    e.s(["Tabs", 0, ej, "TabsContent", 0, function(e) {
        let a, n, i, s, o = (0, r.c)(8);
        return o[0] !== e ? ({
            className: a,
            ...n
        } = e, o[0] = e, o[1] = a, o[2] = n) : (a = o[1], n = o[2]), o[3] !== a ? (i = (0, em.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand transition focus-visible:ring-offset-0 data-[state=inactive]:hidden", a), o[3] = a, o[4] = i) : i = o[4], o[5] !== n || o[6] !== i ? (s = (0, t.jsx)(eH.Content, {
            className: i,
            forceMount: !0,
            ...n
        }), o[5] = n, o[6] = i, o[7] = s) : s = o[7], s
    }, "TabsList", 0, function(e) {
        let a, i, s, o, l, c, u, d, p, A, m, f, g, y, T, E, b, I, C, S, _, N = (0, r.c)(46);
        N[0] !== e ? ({
            className: a,
            variant: l,
            indicatorClassName: s,
            wrapperClassName: c,
            ref: i,
            ...o
        } = e, N[0] = e, N[1] = a, N[2] = i, N[3] = s, N[4] = o, N[5] = l, N[6] = c) : (a = N[1], i = N[2], s = N[3], o = N[4], l = N[5], c = N[6]);
        let x = h.useRef(null);
        N[7] === Symbol.for("react.memo_cache_sentinel") ? (u = {
            left: 0,
            width: 0,
            paddingLeft: "0",
            paddingRight: "0"
        }, N[7] = u) : u = N[7];
        let [k, D] = h.useState(u), [v, w] = h.useState(!1), [O, R] = h.useState(!1);
        return N[8] !== O ? (d = () => {
            let e = () => {
                if (!x.current) return;
                let e = x.current.querySelector('[data-state="active"]');
                if (e) {
                    let t = x.current.getBoundingClientRect(),
                        r = e.getBoundingClientRect(),
                        a = getComputedStyle(e),
                        {
                            paddingLeft: n
                        } = a,
                        {
                            paddingRight: i
                        } = a;
                    D({
                        left: r.left - t.left,
                        width: r.width,
                        paddingLeft: n,
                        paddingRight: i
                    }), O || R(!0)
                }
            };
            e(), window.addEventListener("resize", e);
            let t = new MutationObserver(e);
            return x.current && t.observe(x.current, {
                attributes: !0,
                subtree: !0,
                attributeFilter: ["data-state"]
            }), () => {
                window.removeEventListener("resize", e), t.disconnect()
            }
        }, p = [O], N[8] = O, N[9] = d, N[10] = p) : (d = N[9], p = N[10]), h.useEffect(d, p), N[11] !== v || N[12] !== O ? (A = () => {
            if (O && !v) {
                let e = requestAnimationFrame(() => {
                    w(!0)
                });
                return () => cancelAnimationFrame(e)
            }
        }, m = [O, v], N[11] = v, N[12] = O, N[13] = A, N[14] = m) : (A = N[13], m = N[14]), h.useEffect(A, m), N[15] !== O ? (f = {
            hasMeasured: O
        }, N[15] = O, N[16] = f) : f = N[16], N[17] !== c ? (g = (0, em.cn)("relative", c), N[17] = c, N[18] = g) : g = N[18], N[19] !== i ? (y = e => {
            x.current = e, "function" == typeof i ? i(e) : i && (i.current = e)
        }, N[19] = i, N[20] = y) : y = N[20], N[21] !== a || N[22] !== l ? (T = (0, em.cn)(eY({
            variant: l
        }), a), N[21] = a, N[22] = l, N[23] = T) : T = N[23], N[24] !== o || N[25] !== y || N[26] !== T ? (E = (0, t.jsx)(eH.List, {
            ref: y,
            className: T,
            ...o
        }), N[24] = o, N[25] = y, N[26] = T, N[27] = E) : E = N[27], N[28] !== s || N[29] !== l ? (b = (0, em.cn)(eK({
            variant: l
        }), s), N[28] = s, N[29] = l, N[30] = b) : b = N[30], N[31] !== v || N[32] !== O || N[33] !== k || N[34] !== l ? (I = (({
            indicatorStyle: e,
            variant: t,
            animationEnabled: r,
            hasMeasured: a
        }) => {
            let n = {
                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: n,
                exit: n,
                transition: {
                    default: {
                        duration: .35 * !!r,
                        ease: (0, eg.cubicBezier)(.26, .08, .25, 1)
                    },
                    opacity: {
                        duration: .2 * !!a,
                        ease: (0, eg.cubicBezier)(.26, .08, .25, 1)
                    }
                }
            }
        })({
            indicatorStyle: k,
            variant: l,
            animationEnabled: v,
            hasMeasured: O
        }), N[31] = v, N[32] = O, N[33] = k, N[34] = l, N[35] = I) : I = N[35], N[36] !== b || N[37] !== I ? (C = (0, t.jsx)(n.motion.div, {
            className: b,
            ...I
        }), N[36] = b, N[37] = I, N[38] = C) : C = N[38], N[39] !== E || N[40] !== C || N[41] !== g ? (S = (0, t.jsxs)("div", {
            className: g,
            children: [E, C]
        }), N[39] = E, N[40] = C, N[41] = g, N[42] = S) : S = N[42], N[43] !== S || N[44] !== f ? (_ = (0, t.jsx)(eQ.Provider, {
            value: f,
            children: S
        }), N[43] = S, N[44] = f, N[45] = _) : _ = N[45], _
    }, "TabsTrigger", 0, function(e) {
        let a, n, i, s, o = (0, r.c)(10);
        o[0] !== e ? ({
            className: a,
            ...n
        } = e, o[0] = e, o[1] = a, o[2] = n) : (a = o[1], n = o[2]);
        let l = h.useContext(eQ),
            c = l ? .hasMeasured ? ? !1,
            u = c ? "data-[state=active]:text-tabs-text-active" : "",
            d = c ? "" : "data-[state=active]:text-tabs-text";
        return o[3] !== a || o[4] !== u || o[5] !== d ? (i = (0, em.cn)("z-1 inline-flex cursor-pointer h-full items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-heading-lg font-semibold ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 text-tabs-text hover:text-tabs-text-hover", u, a, d), o[3] = a, o[4] = u, o[5] = d, o[6] = i) : i = o[6], o[7] !== n || o[8] !== i ? (s = (0, t.jsx)(eH.Trigger, {
            className: i,
            ...n
        }), o[7] = n, o[8] = i, o[9] = s) : s = o[9], s
    }], 148858)
}, 449004, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(180715);
    e.s(["IconArrowRightOutline12", 0, ({
        strokeWidth: e = 1.5,
        ...a
    }) => t.default.createElement(r.Icon, {
        size: "12px",
        ...a
    }, t.default.createElement("line", {
        x1: "1",
        y1: "6",
        x2: "10.75",
        y2: "6",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), t.default.createElement("polyline", {
        points: "7.75 9.25 11 6 7.75 2.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }))])
}, 775691, 673280, 75576, 756428, 606811, 610951, 337345, 259760, 810123, 171047, 790268, 180970, 738880, 955916, 657638, 588885, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(208956),
        n = e.i(336896),
        i = e.i(559363),
        s = e.i(44899),
        o = e.i(169177),
        l = e.i(736556),
        c = e.i(930266),
        u = e.i(416340),
        d = e.i(149285),
        p = e.i(863828),
        A = e.i(569442),
        h = e.i(643244),
        m = e.i(357325),
        f = e.i(67670),
        g = e.i(502475),
        y = e.i(5146),
        T = e.i(229339),
        E = e.i(330959),
        b = e.i(313314),
        I = e.i(944891),
        C = e.i(28589),
        S = e.i(604777),
        _ = e.i(784521),
        N = e.i(523410),
        x = e.i(385773),
        k = e.i(248131),
        D = e.i(196593),
        v = e.i(796850),
        w = e.i(827525),
        O = e.i(415142),
        R = e.i(23128),
        M = e.i(435894),
        L = e.i(949287),
        B = e.i(211721),
        P = e.i(444298),
        F = e.i(588146),
        U = e.i(148858),
        G = e.i(122538),
        H = e.i(964974),
        j = e.i(66199),
        Q = e.i(902268),
        K = e.i(148121),
        Y = e.i(449004),
        W = e.i(149534);
    let q = ({
        strokeWidth: e = 1.5,
        ...t
    }) => u.default.createElement(W.Icon, {
        size: "18px",
        ...t
    }, u.default.createElement("path", {
        d: "M1.75,12.25l3.646-3.646c.195-.195,.512-.195,.707,0l3.293,3.293c.195,.195,.512,.195,.707,0l6.146-6.146",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), u.default.createElement("polyline", {
        points: "11.25 5.75 16.25 5.75 16.25 10.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));
    e.s(["IconArrowTrendUpOutline18", 0, q], 673280);
    let V = ({
        strokeWidth: e = 1.5,
        ...t
    }) => u.default.createElement(W.Icon, {
        size: "18px",
        ...t
    }, u.default.createElement("path", {
        d: "M13.25 13.25V15.25C13.25 15.802 12.802 16.25 12.25 16.25H6.75C6.198 16.25 5.75 15.802 5.75 15.25V13.25",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }), u.default.createElement("path", {
        d: "M12.25 5.75C12.25 6.855 11.355 7.75 10.25 7.75H7.58002",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }), u.default.createElement("path", {
        d: "M4.018 6.751C3.848 6.457 3.75 6.115 3.75 5.75V5.25C3.75 3.593 5.093 2.25 6.75 2.25H12.25C13.907 2.25 15.25 3.593 15.25 5.25V10.25C15.25 11.907 13.907 13.25 12.25 13.25H5.25C3.593 13.25 2.25 11.907 2.25 10.25V8.75C2.25 7.645 3.145 6.75 4.25 6.75H6C6.966 6.75 7.75 7.534 7.75 8.5C7.75 9.467 6.966 10.25 6 10.25H5.25",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }));
    e.s(["IconBoxingGloveOutline18", 0, V], 75576);
    let z = ({
        strokeWidth: e = 1.5,
        ...t
    }) => u.default.createElement(W.Icon, {
        size: "18px",
        ...t
    }, u.default.createElement("polyline", {
        points: "9 4.75 9 9 12.25 11.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), u.default.createElement("path", {
        d: "M9,1.75c4.004,0,7.25,3.246,7.25,7.25s-3.246,7.25-7.25,7.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), u.default.createElement("circle", {
        cx: "3.873",
        cy: "14.127",
        r: ".75",
        fill: "currentColor",
        "data-stroke": "none"
    }), u.default.createElement("circle", {
        cx: "1.75",
        cy: "9",
        r: ".75",
        fill: "currentColor",
        "data-stroke": "none"
    }), u.default.createElement("circle", {
        cx: "3.873",
        cy: "3.873",
        r: ".75",
        fill: "currentColor",
        "data-stroke": "none"
    }), u.default.createElement("circle", {
        cx: "6.226",
        cy: "15.698",
        r: ".75",
        fill: "currentColor",
        "data-stroke": "none"
    }), u.default.createElement("circle", {
        cx: "2.302",
        cy: "11.774",
        r: ".75",
        fill: "currentColor",
        "data-stroke": "none"
    }), u.default.createElement("circle", {
        cx: "2.302",
        cy: "6.226",
        r: ".75",
        fill: "currentColor",
        "data-stroke": "none"
    }), u.default.createElement("circle", {
        cx: "6.226",
        cy: "2.302",
        r: ".75",
        fill: "currentColor",
        "data-stroke": "none"
    }));
    e.s(["IconCircleHalfDottedClockOutline18", 0, z], 756428);
    let J = ({
        strokeWidth: e = 1.5,
        ...t
    }) => u.default.createElement(W.Icon, {
        size: "18px",
        ...t
    }, u.default.createElement("path", {
        d: "m9,16.25c3.038,0,5.5-2.47,5.5-5.517,0-4.191-3.083-5.983-5.5-8.983-2.417,3-5.5,4.792-5.5,8.983,0,3.047,2.462,5.517,5.5,5.517Z",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), u.default.createElement("path", {
        d: "m9,13.25c-1.3784,0-2.5-1.1289-2.5-2.5166",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }));
    e.s(["IconDropletOutline18", 0, J], 606811);
    let Z = ({
        strokeWidth: e = 1.5,
        ...t
    }) => u.default.createElement(W.Icon, {
        size: "18px",
        ...t
    }, u.default.createElement("path", {
        d: "M6.962,16.25c-.28-2.75,1.803-2.097,1.875-4.501,1.581,.851,2.239,2.987,2.2,4.465",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), u.default.createElement("path", {
        d: "M11.037,16.214c3.901-1.516,4.725-5.833,1.964-9.85",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), u.default.createElement("path", {
        d: "M10.533,7.37s.696-3.766-2.044-5.62c-.364,4.375-5.109,4.531-5.109,9.237,0,2.117,1.096,4.402,3.582,5.263",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));
    e.s(["IconFireFlameOutline18", 0, Z], 610951);
    let $ = ({
        strokeWidth: e = 1.5,
        ...t
    }) => u.default.createElement(W.Icon, {
        size: "18px",
        ...t
    }, u.default.createElement("path", {
        d: "m3.5417,3.6104l-1.7538,4.5807c-.1547.4042.1872.8238.6143.7539l4.8771-.7986c.4271-.0699.6173-.5768.3418-.9105l-3.1233-3.7821c-.2735-.3312-.8025-.2446-.9561.1566Z",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }), u.default.createElement("circle", {
        cx: "13.5",
        cy: "4.5",
        r: "2.75",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e,
        "data-color": "color-2"
    }), u.default.createElement("path", {
        d: "m14.25,12.5167h0c-1.274.9216-2.2147,2.2316-2.681,3.7333h0s0,0,0,0c-.9216-1.274-2.2316-2.2147-3.7333-2.681h0,0c1.274-.9216,2.2147-2.2316,2.681-3.7333h0s0,0,0,0c.9216,1.274,2.2316,2.2147,3.7333,2.681h0Z",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));
    e.s(["IconPopOutline18", 0, $], 337345);
    var X = e.i(363966),
        ee = e.i(935786),
        et = e.i(134709),
        er = e.i(668122),
        ea = e.i(675215),
        en = e.i(649480),
        ei = e.i(301713),
        es = e.i(305457),
        eo = e.i(399841),
        el = e.i(684686),
        ec = e.i(702502),
        eu = e.i(76095);
    let ed = (e, t, r) => {
        if (!e) return;
        let a = {
                id: e.id,
                title: e.title,
                volume: e.volume,
                liquidity: e.liquidity,
                icon: e.icon,
                image: e.image,
                slug: e.slug,
                series: e.series ? e.series.map(({
                    title: e,
                    recurrence: t
                }) => ({
                    title: e,
                    recurrence: t
                })) : null,
                markets: e.markets.filter(e => e.active && !e.closed).map(({
                    question: e,
                    slug: t,
                    volume: r,
                    liquidity: a,
                    image: n
                }) => ({
                    question: e,
                    slug: t,
                    volume: r,
                    liquidity: a,
                    image: n
                }))
            },
            n = t ? JSON.parse(t) : [],
            i = n && n.length ? n.filter(e => e.id !== a.id && e.title !== a.title) : [];
        i.unshift(a), r(JSON.stringify(i.slice(0, 5)))
    };
    var ep = e.i(405891),
        eA = e.i(491163),
        eh = e.i(256244),
        em = e.i(96515),
        ef = e.i(215959),
        eg = e.i(267905);

    function ey(e) {
        let t = e + .12 * (0 - e) + .06 * (.2 * Math.sin(Date.now() / 600)) + (Math.random() - .5) * .7;
        return t > 1 && (t = 1), t < -1 && (t = -1), t
    }

    function eT(e) {
        let a, n, i, s, o, l, c, d, p, A, h, m, f, g, y, T, E, b, I, C, S, _ = (0, r.c)(63),
            {
                width: N,
                height: x,
                stroke: k,
                backgroundClassName: D,
                durationMs: v,
                points: w
            } = e,
            O = void 0 === N ? 120 : N,
            R = void 0 === x ? 24 : x,
            M = void 0 === k ? "currentColor" : k,
            L = void 0 === v ? 400 : v,
            B = void 0 === w ? 12 : w,
            P = (0, u.useId)(),
            [F, U] = (0, u.useState)("");
        _[0] === Symbol.for("react.memo_cache_sentinel") ? (a = [], _[0] = a) : a = _[0];
        let G = (0, u.useRef)(a),
            H = (0, u.useRef)(!1),
            j = (0, eg.useAnimation)(),
            Q = (0, eg.useAnimation)(),
            K = (0, u.useRef)(0);
        _[1] === Symbol.for("react.memo_cache_sentinel") ? (n = () => (H.current = !0, () => {
            H.current = !1
        }), i = [], _[1] = n, _[2] = i) : (n = _[1], i = _[2]), (0, u.useEffect)(n, i);
        let Y = B > 1 ? O / (B - 1) : O;
        _[3] !== Y ? (s = e => e * Y, _[3] = Y, _[4] = s) : s = _[4];
        let W = s;
        _[5] !== R ? (o = e => {
            let t = .75 * R;
            return t + (e + 1) / 2 * (.25 * R - t)
        }, _[5] = R, _[6] = o) : o = _[6];
        let q = o;
        e: {
            let e = Math.round(10 / Math.max(1e-6, Y));
            if (e < 0) {
                l = 0;
                break e
            }
            if (e > B - 1) {
                l = B - 1;
                break e
            }
            l = e
        }
        let V = l;
        _[7] !== W || _[8] !== q ? (c = e => {
            if (!e.length) return "";
            let t = e.map((e, t) => ({
                    x: W(t),
                    y: q(e)
                })),
                r = `M${t[0].x},${t[0].y}`;
            for (let e = 0; e < t.length - 1; e++) {
                let a = e > 0 ? t[e - 1] : t[e],
                    n = t[e],
                    i = t[e + 1],
                    s = e + 2 < t.length ? t[e + 2] : t[e + 1],
                    o = n.x + (i.x - a.x) / 6,
                    l = n.y + (i.y - a.y) / 6,
                    c = i.x - (s.x - n.x) / 6,
                    u = i.y - (s.y - n.y) / 6;
                r += `C${o},${l},${c},${u},${i.x},${i.y}`
            }
            return r
        }, _[7] = W, _[8] = q, _[9] = c) : c = _[9];
        let z = c;
        _[10] !== z || _[11] !== Q || _[12] !== V || _[13] !== B || _[14] !== O || _[15] !== q ? (d = () => {
            let e = [],
                t = .2 * Math.random();
            for (let r = 0; r < B; r++) {
                let a = .6 * Math.sin(r / B * Math.PI * 2);
                t = ey(t), e.push(.6 * a + .4 * t)
            }
            G.current = e, U(z(e));
            let r = Math.max(0, e.length - 1 - V),
                a = q(e[r]);
            H.current && Q.set({
                cx: O - 10,
                cy: a
            })
        }, p = [B, z, V, q, O, Q], _[10] = z, _[11] = Q, _[12] = V, _[13] = B, _[14] = O, _[15] = q, _[16] = d, _[17] = p) : (d = _[16], p = _[17]), (0, u.useEffect)(d, p), _[18] !== z || _[19] !== Q || _[20] !== V || _[21] !== L || _[22] !== j || _[23] !== O || _[24] !== Y || _[25] !== q ? (A = () => {
            if (!G.current.length) return;
            let e = !1,
                t = K.current = K.current + 1;
            async function r() {
                if (e || !H.current || K.current !== t) return;
                let a = G.current,
                    n = a.length ? a[a.length - 1] : 0;
                a.push(ey(n)), U(z(a));
                let i = Math.max(0, a.length - 1 - V),
                    s = q(a[i]);
                H.current && K.current === t && Q.start({
                    cx: O - 10,
                    cy: s,
                    transition: {
                        duration: L / 1e3,
                        ease: "linear"
                    }
                }), H.current && K.current === t && (await j.start({
                    x: -Y,
                    transition: {
                        duration: L / 1e3,
                        ease: "linear"
                    }
                }), e || K.current !== t || (H.current && j.set({
                    x: 0
                }), a.shift(), r()))
            }
            return r(), () => {
                e = !0, K.current = K.current + 1;
                try {
                    j.stop()
                } catch {}
                try {
                    Q.stop()
                } catch {}
            }
        }, h = [L, Y, j, Q, V, q, O, z], _[18] = z, _[19] = Q, _[20] = V, _[21] = L, _[22] = j, _[23] = O, _[24] = Y, _[25] = q, _[26] = A, _[27] = h) : (A = _[26], h = _[27]), (0, u.useEffect)(A, h), _[28] !== R || _[29] !== O ? (m = {
            width: O,
            height: R
        }, _[28] = R, _[29] = O, _[30] = m) : m = _[30];
        let J = `0 0 ${O} ${R}`;
        _[31] !== R || _[32] !== O ? (f = (0, t.jsx)("rect", {
            width: O,
            height: R,
            rx: 2,
            ry: 2
        }), _[31] = R, _[32] = O, _[33] = f) : f = _[33], _[34] !== P || _[35] !== f ? (g = (0, t.jsx)("defs", {
            children: (0, t.jsx)("clipPath", {
                id: P,
                children: f
            })
        }), _[34] = P, _[35] = f, _[36] = g) : g = _[36];
        let Z = `url(#${P})`;
        _[37] === Symbol.for("react.memo_cache_sentinel") ? (y = {
            x: 0
        }, _[37] = y) : y = _[37], _[38] !== F || _[39] !== M ? (T = (0, t.jsx)("path", {
            stroke: M,
            strokeWidth: 2,
            fill: "none",
            strokeLinecap: "round",
            strokeLinejoin: "round",
            d: F
        }), _[38] = F, _[39] = M, _[40] = T) : T = _[40], _[41] !== j || _[42] !== Z || _[43] !== T ? (E = (0, t.jsx)(ef.motion.g, {
            clipPath: Z,
            animate: j,
            initial: y,
            children: T
        }), _[41] = j, _[42] = Z, _[43] = T, _[44] = E) : E = _[44];
        let $ = O - 10,
            X = R / 2;
        return _[45] !== $ || _[46] !== X ? (b = {
            cx: $,
            cy: X
        }, _[45] = $, _[46] = X, _[47] = b) : b = _[47], _[48] !== Q || _[49] !== M || _[50] !== b ? (I = (0, t.jsx)(ef.motion.circle, {
            r: 4,
            fill: M,
            stroke: "var(--color-background)",
            strokeWidth: 2,
            animate: Q,
            initial: b
        }), _[48] = Q, _[49] = M, _[50] = b, _[51] = I) : I = _[51], _[52] !== R || _[53] !== J || _[54] !== g || _[55] !== E || _[56] !== I || _[57] !== O ? (C = (0, t.jsxs)("svg", {
            width: O,
            height: R,
            viewBox: J,
            children: [g, E, I]
        }), _[52] = R, _[53] = J, _[54] = g, _[55] = E, _[56] = I, _[57] = O, _[58] = C) : C = _[58], _[59] !== D || _[60] !== m || _[61] !== C ? (S = (0, t.jsx)("div", {
            className: D,
            style: m,
            children: C
        }), _[59] = D, _[60] = m, _[61] = C, _[62] = S) : S = _[62], S
    }
    let eE = e => {
            let n, i, s, o, l, c, u, d, p, A, h, m, f = (0, r.c)(34),
                {
                    callout: g,
                    clearSearch: y,
                    handleAfterNavigation: T
                } = e,
                E = (0, es.useAmplitudeAnalytics)();
            f[0] !== g ? (n = g.getHref ? .() ? ? g.href, f[0] = g, f[1] = n) : n = f[1];
            let b = n;
            f[2] !== E || f[3] !== g.abbreviation || f[4] !== g.label || f[5] !== y || f[6] !== T || f[7] !== b ? (i = () => {
                E.trackEvent(er.Events.SearchCryptoCalloutClick, {
                    abbreviation: g.abbreviation,
                    label: g.label,
                    href: b,
                    searchContext: "navbar"
                }), y(), T()
            }, f[2] = E, f[3] = g.abbreviation, f[4] = g.label, f[5] = y, f[6] = T, f[7] = b, f[8] = i) : i = f[8], f[9] !== g.color ? (s = {
                "--crypto-color": g.color
            }, f[9] = g.color, f[10] = s) : s = f[10];
            let I = s;
            f[11] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)("div", {
                className: "text-[var(--crypto-color)] flex items-center min-w-[57px] max-w-[57px] shrink-0 overflow-clip",
                children: (0, t.jsx)(eT, {
                    width: 64,
                    height: 44
                })
            }), f[11] = o) : o = f[11];
            let C = em.PriceMarketAssetColorMap[g.abbreviation];
            f[12] !== C ? (l = {
                "--crypto-color": C
            }, f[12] = C, f[13] = l) : l = f[13];
            let S = l,
                _ = g.icon;
            return f[14] !== S || f[15] !== _ ? (c = (0, t.jsx)("div", {
                style: S,
                className: "text-[var(--crypto-color)] absolute top-1/2 -translate-y-1/2 opacity-10 dark:opacity-15 left-2",
                children: _
            }), f[14] = S, f[15] = _, f[16] = c) : c = f[16], f[17] !== g.label ? (u = (0, t.jsx)("p", {
                className: "text-heading-base mb-0.5 font-medium",
                children: g.label
            }), f[17] = g.label, f[18] = u) : u = f[18], f[19] !== g.subtitle ? (d = (0, t.jsx)("p", {
                className: "text-body-sm font-normal text-text-primary/60",
                children: g.subtitle
            }), f[19] = g.subtitle, f[20] = d) : d = f[20], f[21] !== u || f[22] !== d ? (p = (0, t.jsxs)("div", {
                className: "flex flex-col gap-0.5",
                children: [u, d]
            }), f[21] = u, f[22] = d, f[23] = p) : p = f[23], f[24] === Symbol.for("react.memo_cache_sentinel") ? (A = (0, t.jsx)(Y.IconArrowRightOutline12, {
                className: "shrink-0 text-[var(--crypto-color)] ml-auto transition-transform duration-200 group-hover:translate-x-0.5"
            }), f[24] = A) : A = f[24], f[25] !== g.label || f[26] !== c || f[27] !== p || f[28] !== I ? (h = (0, t.jsxs)("div", {
                style: I,
                className: "flex items-center gap-3 py-3 pl-0 group pr-4 relative rounded-md border transition-all duration-200 cursor-pointer mb-2 bg-[var(--crypto-color)]/5 border-[var(--crypto-color)]/30 hover:border-[var(--crypto-color)]/40",
                children: [o, c, p, A]
            }, g.label), f[25] = g.label, f[26] = c, f[27] = p, f[28] = I, f[29] = h) : h = f[29], f[30] !== b || f[31] !== h || f[32] !== i ? (m = (0, t.jsx)(a.default, {
                href: b,
                prefetch: !1,
                onClick: i,
                className: "mx-1.5",
                children: h
            }), f[30] = b, f[31] = h, f[32] = i, f[33] = m) : m = f[33], m
        },
        eb = e => {
            let n, i, s, o, l, c, d, p, A, h = (0, r.c)(31),
                {
                    callout: m,
                    clearSearch: f,
                    handleAfterNavigation: g
                } = e,
                y = (0, es.useAmplitudeAnalytics)();
            h[0] !== y || h[1] !== m.href || h[2] !== m.label || h[3] !== m.type || h[4] !== f || h[5] !== g ? (n = () => {
                y.trackEvent(er.Events.SearchCustomCalloutClick, {
                    label: m.label,
                    href: m.href,
                    searchContext: "navbar",
                    type: m.type
                }), f(), g()
            }, h[0] = y, h[1] = m.href, h[2] = m.label, h[3] = m.type, h[4] = f, h[5] = g, h[6] = n) : n = h[6];
            let T = `flex items-center gap-3 py-3 pl-3 group overflow-hidden pr-4 relative rounded-md border cursor-pointer mb-2 bg-surface-1 border-border hover:border-border-hover ${m.bgClassName||""}`,
                E = `flex items-center justify-center shrink-0 size-12 ${m.iconClassName||""}`;
            return h[7] !== m.icon || h[8] !== m.iconClassName || h[9] !== m.label ? (i = "string" == typeof m.icon && m.icon.startsWith("https://") ? (0, t.jsx)("div", {
                className: "size-12 shrink-0 relative rounded-sm overflow-hidden",
                children: (0, t.jsx)(ep.default, {
                    src: m.icon,
                    alt: m.label,
                    className: "object-contain",
                    fill: !0
                })
            }) : "string" == typeof m.icon ? (0, t.jsx)("span", {
                className: "text-2xl",
                children: m.icon
            }) : "function" == typeof m.icon ? (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)("div", {
                    className: "absolute -bottom-4 -left-4 opacity-10",
                    "aria-hidden": "true",
                    children: u.default.createElement(m.icon, {
                        size: 80,
                        className: m.iconClassName
                    })
                }), u.default.createElement(m.icon, {
                    size: 32,
                    className: m.iconClassName
                })]
            }) : m.icon, h[7] = m.icon, h[8] = m.iconClassName, h[9] = m.label, h[10] = i) : i = h[10], h[11] !== E || h[12] !== i ? (s = (0, t.jsx)("div", {
                className: E,
                children: i
            }), h[11] = E, h[12] = i, h[13] = s) : s = h[13], h[14] !== m.label ? (o = (0, t.jsx)("p", {
                className: "text-heading-base font-medium",
                children: m.label
            }), h[14] = m.label, h[15] = o) : o = h[15], h[16] !== m.subtitle ? (l = (0, t.jsx)("p", {
                className: "text-body-sm font-normal text-text-primary/60",
                children: m.subtitle
            }), h[16] = m.subtitle, h[17] = l) : l = h[17], h[18] !== o || h[19] !== l ? (c = (0, t.jsxs)("div", {
                className: "flex flex-col gap-0.5",
                children: [o, l]
            }), h[18] = o, h[19] = l, h[20] = c) : c = h[20], h[21] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)(Y.IconArrowRightOutline12, {
                className: "shrink-0 ml-auto transition-transform duration-200 group-hover:translate-x-0.5"
            }), h[21] = d) : d = h[21], h[22] !== m.label || h[23] !== T || h[24] !== s || h[25] !== c ? (p = (0, t.jsxs)("div", {
                className: T,
                children: [s, c, d]
            }, m.label), h[22] = m.label, h[23] = T, h[24] = s, h[25] = c, h[26] = p) : p = h[26], h[27] !== m.href || h[28] !== n || h[29] !== p ? (A = (0, t.jsx)(a.default, {
                href: m.href,
                prefetch: !1,
                onClick: n,
                className: "mx-1.5",
                children: p
            }), h[27] = m.href, h[28] = n, h[29] = p, h[30] = A) : A = h[30], A
        },
        eI = e => {
            let n, i, s, o, l, c, d, p, A, h = (0, r.c)(30),
                {
                    callout: m,
                    clearSearch: f,
                    handleAfterNavigation: g
                } = e,
                y = (0, es.useAmplitudeAnalytics)();
            h[0] !== y || h[1] !== m.href || h[2] !== m.label || h[3] !== m.type || h[4] !== f || h[5] !== g ? (n = () => {
                y.trackEvent(er.Events.SearchCustomCalloutClick, {
                    label: m.label,
                    href: m.href,
                    searchContext: "navbar",
                    type: m.type
                }), f(), g()
            }, h[0] = y, h[1] = m.href, h[2] = m.label, h[3] = m.type, h[4] = f, h[5] = g, h[6] = n) : n = h[6];
            let T = `flex items-center justify-center shrink-0 ${m.iconClassName||""}`;
            return h[7] !== m.icon || h[8] !== m.iconClassName || h[9] !== m.label ? (i = "string" == typeof m.icon && m.icon.startsWith("https://") ? (0, t.jsx)("div", {
                className: "size-12 shrink-0 relative border rounded-sm overflow-hidden",
                children: (0, t.jsx)(ep.default, {
                    src: m.icon,
                    alt: m.label,
                    className: "object-cover",
                    fill: !0
                })
            }) : "string" == typeof m.icon ? (0, t.jsx)("span", {
                className: "text-2xl",
                children: m.icon
            }) : "function" == typeof m.icon ? u.default.createElement(m.icon, {
                size: 24,
                className: m.iconClassName
            }) : m.icon, h[7] = m.icon, h[8] = m.iconClassName, h[9] = m.label, h[10] = i) : i = h[10], h[11] !== T || h[12] !== i ? (s = (0, t.jsx)("div", {
                className: T,
                children: i
            }), h[11] = T, h[12] = i, h[13] = s) : s = h[13], h[14] !== m.label ? (o = (0, t.jsx)("p", {
                className: "text-heading-base mb-0.5 font-medium",
                children: m.label
            }), h[14] = m.label, h[15] = o) : o = h[15], h[16] !== m.subtitle ? (l = (0, t.jsx)("p", {
                className: "text-body-sm font-normal text-text-primary/60",
                children: m.subtitle
            }), h[16] = m.subtitle, h[17] = l) : l = h[17], h[18] !== o || h[19] !== l ? (c = (0, t.jsxs)("div", {
                className: "flex flex-col gap-0.5",
                children: [o, l]
            }), h[18] = o, h[19] = l, h[20] = c) : c = h[20], h[21] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)(Y.IconArrowRightOutline12, {
                className: "shrink-0 ml-auto transition-transform duration-200 group-hover:translate-x-0.5"
            }), h[21] = d) : d = h[21], h[22] !== m.label || h[23] !== s || h[24] !== c ? (p = (0, t.jsxs)("div", {
                className: "flex items-center gap-3 py-3 pl-3 group pr-4 relative rounded-md border cursor-pointer mb-2 bg-surface-1 border-border hover:border-border-hover",
                children: [s, c, d]
            }, m.label), h[22] = m.label, h[23] = s, h[24] = c, h[25] = p) : p = h[25], h[26] !== m.href || h[27] !== n || h[28] !== p ? (A = (0, t.jsx)(a.default, {
                href: m.href,
                prefetch: !1,
                onClick: n,
                className: "mx-1.5",
                children: p
            }), h[26] = m.href, h[27] = n, h[28] = p, h[29] = A) : A = h[29], A
        };
    var eC = e.i(186273);
    let eS = e => !!e && !!(e.id || e.address || e.proxyWallet),
        e_ = u.default.memo(e => {
            let a, n, i, s, o, l, c, u, d, p, A, h, m = (0, r.c)(35),
                {
                    event: f,
                    query: g,
                    isSelected: y
                } = e,
                T = void 0 !== y && y,
                E = f.ended;
            m[0] !== f ? (a = (0, eh.isEventResolved)(f), m[0] = f, m[1] = a) : a = m[1];
            let b = a;
            m[2] !== f || m[3] !== g ? (n = (0, eh.getResultData)(f, g), m[2] = f, m[3] = g, m[4] = n) : n = m[4];
            let I = n,
                C = E || b;
            m[5] !== f.image || m[6] !== f.title ? (i = (0, t.jsx)("div", {
                className: "size-12 lg:size-10 shrink-0 relative border rounded-sm overflow-hidden",
                children: (0, t.jsx)(ep.default, {
                    src: f.image,
                    alt: f.title,
                    className: "object-cover",
                    fill: !0,
                    sizes: "96px"
                })
            }), m[5] = f.image, m[6] = f.title, m[7] = i) : i = m[7], m[8] !== I.event_title ? (s = (0, t.jsx)("div", {
                className: "flex flex-col gap-0.5",
                children: (0, t.jsx)("p", {
                    className: "text-body-base font-medium text-text ml-0.5 line-clamp-3 lg:line-clamp-2 text-pretty",
                    children: I.event_title
                })
            }), m[8] = I.event_title, m[9] = s) : s = m[9], m[10] !== C || m[11] !== i || m[12] !== s ? (o = (0, t.jsxs)("div", {
                "data-ended": C,
                className: "flex gap-x-2 items-center data-[ended=true]:opacity-40",
                children: [i, s]
            }), m[10] = C, m[11] = i, m[12] = s, m[13] = o) : o = m[13];
            let S = E || b,
                _ = E || b;
            return m[14] !== _ || m[15] !== I.title ? (l = (0, t.jsx)("p", {
                "data-ended": _,
                className: "font-medium text-right whitespace-nowrap text-heading-lg text-text data-[ended=true]:text-body-base",
                children: I.title
            }), m[14] = _, m[15] = I.title, m[16] = l) : l = m[16], m[17] !== I.outcome ? (c = "yes" === I.outcome && (0, t.jsx)(Q.IconCircleCheckFill12, {
                className: "text-green-600 dark:text-green-500"
            }), m[17] = I.outcome, m[18] = c) : c = m[18], m[19] !== I.outcome ? (u = "no" === I.outcome && (0, t.jsx)(K.IconCircleXmarkFill12, {
                className: "text-red-500"
            }), m[19] = I.outcome, m[20] = u) : u = m[20], m[21] !== l || m[22] !== c || m[23] !== u ? (d = (0, t.jsxs)("div", {
                className: "flex items-center gap-1.5",
                children: [l, c, u]
            }), m[21] = l, m[22] = c, m[23] = u, m[24] = d) : d = m[24], m[25] !== I.subtitle ? (p = I.subtitle && (0, t.jsx)("p", {
                className: "text-body-sm font-normal text-text-secondary text-right line-clamp-1",
                children: I.subtitle
            }), m[25] = I.subtitle, m[26] = p) : p = m[26], m[27] !== d || m[28] !== p || m[29] !== S ? (A = (0, t.jsxs)("div", {
                "data-ended": S,
                className: "flex flex-col items-end data-[ended=true]:opacity-40 data-[ended=true]:gap-1",
                children: [d, p]
            }), m[27] = d, m[28] = p, m[29] = S, m[30] = A) : A = m[30], m[31] !== T || m[32] !== A || m[33] !== o ? (h = (0, t.jsxs)(F.SearchSuggestionItem, {
                selected: T,
                className: "group justify-between gap-4 px-2 py-3 lg:py-2",
                children: [o, A]
            }), m[31] = T, m[32] = A, m[33] = o, m[34] = h) : h = m[34], h
        });
    e_.displayName = "MarketSearchResultCard";
    let eN = e => {
            let n, i, s, o, l, c, u, d, p, A, h = (0, r.c)(26),
                {
                    item: m,
                    clearSearch: f,
                    handleAfterNavigation: g
                } = e;
            h[0] !== m ? (n = m.getHref(), h[0] = m, h[1] = n) : n = h[1];
            let y = n;
            h[2] !== f || h[3] !== g ? (i = () => {
                f(), g()
            }, h[2] = f, h[3] = g, h[4] = i) : i = h[4], h[5] !== m.color ? (s = {
                "--item-color": m.color
            }, h[5] = m.color, h[6] = s) : s = h[6];
            let T = s;
            return h[7] !== m.icon ? (o = (0, t.jsx)("div", {
                className: "size-10 shrink-0 flex items-center justify-center rounded-sm border text-(--item-color) bg-(--item-color)/10",
                children: m.icon
            }), h[7] = m.icon, h[8] = o) : o = h[8], h[9] !== m.label ? (l = (0, t.jsx)("p", {
                className: "text-body-base font-medium text-text",
                children: m.label
            }), h[9] = m.label, h[10] = l) : l = h[10], h[11] !== m.subtitle ? (c = (0, t.jsx)("p", {
                className: "text-body-sm text-text-secondary line-clamp-1",
                children: m.subtitle
            }), h[11] = m.subtitle, h[12] = c) : c = h[12], h[13] !== l || h[14] !== c ? (u = (0, t.jsxs)("div", {
                className: "flex flex-col gap-0.5 min-w-0",
                children: [l, c]
            }), h[13] = l, h[14] = c, h[15] = u) : u = h[15], h[16] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)(Y.IconArrowRightOutline12, {
                className: "shrink-0 text-text-tertiary ml-auto group-hover:translate-x-px transition-transform duration-200"
            }), h[16] = d) : d = h[16], h[17] !== T || h[18] !== o || h[19] !== u ? (p = (0, t.jsxs)("div", {
                style: T,
                className: "flex items-center gap-3 px-2 py-3 lg:py-2 rounded-sm hover:bg-neutral-50 w-full group",
                children: [o, u, d]
            }), h[17] = T, h[18] = o, h[19] = u, h[20] = p) : p = h[20], h[21] !== y || h[22] !== m.label || h[23] !== p || h[24] !== i ? (A = (0, t.jsx)(a.default, {
                href: y,
                prefetch: !1,
                onClick: i,
                children: p
            }, m.label), h[21] = y, h[22] = m.label, h[23] = p, h[24] = i, h[25] = A) : A = h[25], A
        },
        ex = e => {
            let a, n, i = (0, r.c)(9),
                {
                    items: s,
                    clearSearch: o,
                    handleAfterNavigation: l
                } = e;
            if (i[0] !== o || i[1] !== l || i[2] !== s) {
                let e;
                i[4] !== o || i[5] !== l ? (e = e => (0, t.jsx)(eN, {
                    item: e,
                    clearSearch: o,
                    handleAfterNavigation: l
                }, e.label), i[4] = o, i[5] = l, i[6] = e) : e = i[6], a = s.map(e), i[0] = o, i[1] = l, i[2] = s, i[3] = a
            } else a = i[3];
            return i[7] !== a ? (n = (0, t.jsx)("div", {
                className: "flex flex-col",
                children: a
            }), i[7] = a, i[8] = n) : n = i[8], n
        },
        ek = ({
            query: e,
            clearSearch: i,
            handleAfterNavigation: s,
            isMobile: o = !1,
            selectedIndex: l,
            setResultCount: c
        }) => {
            let d = (0, S.useTranslations)(),
                p = (0, n.useRouter)(),
                A = (0, es.useAmplitudeAnalytics)(),
                h = (0, ea.useTrackingEmail)(),
                m = (0, et.default)(),
                [f, g] = (0, u.useState)("markets"),
                y = "v3" === (0, eo.useFeatureFlagVariant)("search_v3") ? "v3" : "v2",
                T = (0, u.useRef)(""),
                E = (0, u.useRef)(!0);
            (0, u.useEffect)(() => {
                E.current && (E.current = !1)
            }, []), (0, u.useEffect)(() => {
                if (!e || E.current) return;
                let t = setTimeout(() => {
                    let t = e.trim();
                    t.length >= 3 && t !== T.current && (T.current = t, A.trackEvent(er.Events.SearchNavbar, {
                        query: t,
                        search_variant: y
                    }), (0, en.trackMetaEvent)({
                        eventName: "Search",
                        params: {
                            search_string: t
                        },
                        email: h
                    }), (0, ei.trackRedditEvent)({
                        eventName: "Search",
                        params: {
                            search_string: t
                        },
                        email: h
                    }))
                }, 1e3);
                return () => {
                    clearTimeout(t)
                }
            }, [e, A, h]);
            let b = (0, u.useMemo)(() => (0, eC.getSearchOverride)(e), [e]),
                {
                    data: I,
                    fetchStatus: C
                } = (0, H.useQuery)({
                    queryKey: ["markets", "search", e, y],
                    queryFn: async () => await (0, eA.searchEventsGlobal)({
                        q: e
                    }, y),
                    placeholderData: G.keepPreviousData,
                    enabled: !!e && e.length > 0 && !b,
                    staleTime: 1e4,
                    gcTime: 3e4,
                    refetchOnWindowFocus: !1,
                    retry: 1
                }),
                _ = (0, u.useRef)(e),
                N = (0, u.useMemo)(() => "" !== e && "" === _.current && "fetching" === C, [e, C]);
            (0, u.useEffect)(() => {
                _.current = e
            }, [e]);
            let x = (0, el.useGeoStore)(e => e.isTurkey),
                k = (0, u.useMemo)(() => ((e = !1, t) => {
                    let r = {
                            label: t("search.categories.sports"),
                            href: "/sports/live",
                            image: "/images/sports/nba.png"
                        },
                        a = {
                            label: t("search.categories.ai"),
                            href: "/predictions/ai",
                            image: "/images/nav-markets-ai.png"
                        },
                        n = {
                            label: t("search.categories.science"),
                            href: "/predictions/science",
                            image: "/images/science.png"
                        },
                        i = {
                            label: t("search.categories.interestRates"),
                            href: "/predictions/fed-interest-rates",
                            image: "/images/fed-interest-rates.png"
                        },
                        s = {
                            label: t("search.categories.tech"),
                            href: "/predictions/tech",
                            image: "/images/nav-markets-tech.png"
                        },
                        o = {
                            label: t("search.categories.business"),
                            href: "/predictions/business",
                            image: "/images/nav-markets-business.png"
                        },
                        l = {
                            label: t("search.categories.middleEast"),
                            href: "/predictions/middle-east",
                            image: "/images/nav-markets-middle-east.png"
                        },
                        c = {
                            label: t("search.categories.politics"),
                            href: "/predictions/politics",
                            image: "/images/nav-markets-politics.png"
                        },
                        u = {
                            label: t("search.categories.crypto"),
                            href: "/predictions/crypto",
                            image: "/images/nav-markets-crypto.png"
                        },
                        d = {
                            label: t("search.categories.popCulture"),
                            href: "/predictions/pop-culture",
                            image: "/images/nav-markets-pop-culture.png"
                        },
                        p = {
                            label: t("search.categories.liveCrypto"),
                            href: "/event/bitcoin-up-or-down-august-22-9pm-et/live",
                            image: "/images/nav-live-crypto.png"
                        };
                    return e ? [c, u, d, a, n, i, s, o] : [p, c, l, u, r, d, s, a]
                })(x, d), [x, d]),
                D = (0, u.useMemo)(() => [{
                    label: d("navbar.new"),
                    href: "/predictions?_sort=newest",
                    icon: (0, t.jsx)($, {})
                }, {
                    label: d("navbar.trending"),
                    href: "/predictions",
                    icon: (0, t.jsx)(q, {})
                }, {
                    label: d("search.popular"),
                    href: "/predictions?_sort=volume",
                    icon: (0, t.jsx)(Z, {})
                }, {
                    label: d("search.liquid"),
                    href: "/predictions?_sort=liquidity",
                    icon: (0, t.jsx)(J, {})
                }, {
                    label: d("search.endingSoon"),
                    href: "/predictions?_sort=ending_soon",
                    icon: (0, t.jsx)(z, {})
                }, {
                    label: d("search.competitive"),
                    href: "/predictions?_sort=competitive",
                    icon: (0, t.jsx)(V, {})
                }], [d]),
                [v, w] = (0, j.useLocalStorageState)("LS_RECENTLY_VIEWED_SEARCHES"),
                O = (0, u.useMemo)(() => "string" == typeof v ? JSON.parse(v) : [], [v]),
                M = (0, u.useMemo)(() => I ? .pagination ? .hasMore ? ? !1, [I]),
                L = (0, u.useMemo)(() => {
                    let e = I ? .events ? ? [],
                        t = (I ? .profiles ? ? []).filter(eS);
                    return {
                        events: e.slice(0, 6),
                        hasMore: e.length > 6,
                        tags: I ? .tags ? .filter(e => "hide-from-new" !== e.slug) ? ? [],
                        profiles: t.slice(0, 5)
                    }
                }, [I]);
            (0, u.useEffect)(() => {
                c(e ? L.events.length : O ? .length ? ? 0)
            }, [e, L.events.length, O ? .length, c]);
            let Q = (0, u.useCallback)(e => {
                    "string" != typeof e && ed(e, v, w);
                    let t = "string" == typeof e ? e : 1 === e.markets.length ? `/market/${e.markets[0].slug}` : `/event/${e.slug}`;
                    p.push(t), i(), s()
                }, [p, i, s, v, w]),
                K = (0, u.useCallback)((t = !1) => {
                    let r = document.getElementById("search-input"),
                        a = r ? .value ? .trim() ? ? "",
                        n = ("" !== a ? a : e).trim();
                    (n.length >= 3 && n !== T.current && (T.current = n, A.trackEvent(er.Events.SearchNavbar, {
                        query: n,
                        search_variant: y
                    }), (0, en.trackMetaEvent)({
                        eventName: "Search",
                        params: {
                            search_string: n
                        },
                        email: h
                    }), (0, ei.trackRedditEvent)({
                        eventName: "Search",
                        params: {
                            search_string: n
                        },
                        email: h
                    })), t) ? Q("" !== n ? `/predictions/${encodeURIComponent((0,P.normalizeSearchQueryForUrl)(n))}` : "/predictions"): void 0 !== l ? "" === n ? Q(O[l]) : l < L.events.length ? Q(L.events[l]) : Q("" !== n ? `/predictions/${encodeURIComponent((0,P.normalizeSearchQueryForUrl)(n))}` : "/predictions") : "" !== n && Q(`/predictions/${encodeURIComponent((0,P.normalizeSearchQueryForUrl)(n))}`)
                }, [l, e, O, L.events, Q, A, h]);
            (0, u.useEffect)(() => {
                let e = e => {
                    if ("Enter" !== e.key) return;
                    let t = document.getElementById("search-input");
                    if ("/create" === p.pathname || "/usa" === p.pathname) return;
                    let r = e.target;
                    if ("INPUT" === r.tagName && r !== t) return;
                    e.preventDefault(), e.stopPropagation();
                    let a = !!t && document.activeElement === t;
                    K(o && !a)
                };
                return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e)
            }, [K, p.pathname, o]), (0, u.useEffect)(() => () => {
                T.current = ""
            }, []);
            let W = (0, u.useCallback)((t, r) => {
                    A.trackEvent(er.Events.SearchNavbarMarketClick, {
                        eventId: r.id,
                        eventSlug: r.slug,
                        eventTitle: r.title,
                        query: e,
                        search_variant: y
                    }), ed(r, v, w), t.persist(), t.nativeEvent.ctrlKey || t.nativeEvent.metaKey || (i(), s())
                }, [v, w, i, s, A, e, y]),
                X = (0, eh.getCallout)(e);
            return (0, t.jsx)(F.SearchSuggestionsDropdown, {
                open: !0,
                className: "lg:p-2 mt-4 lg:pt-3 lg:mt-0 p-0 flex flex-col overflow-hidden z-[1001] max-lg:border-none max-lg:shadow-none",
                children: !e || N ? (0, t.jsxs)("div", {
                    className: "flex flex-col gap-2",
                    children: [(0, t.jsxs)("div", {
                        className: "flex flex-col pb-2 lg:p-2 gap-2",
                        children: [(0, t.jsx)(F.SearchSuggestionSectionLabel, {
                            children: d("search.browse")
                        }), (0, t.jsx)("div", {
                            className: "flex gap-2 flex-wrap",
                            children: D.map(e => (0, t.jsx)(a.default, {
                                href: e.href,
                                onClick: () => {
                                    i(), s()
                                },
                                children: (0, t.jsxs)("div", {
                                    className: "py-1.5 rounded-lg border flex items-center pr-3 pl-2.5 text-text hover:bg-neutral-50 gap-1.5 cursor-pointer",
                                    children: [e.icon, (0, t.jsx)("p", {
                                        className: "text-body-base font-medium ml-0.5",
                                        children: e.label
                                    })]
                                })
                            }, e.label))
                        })]
                    }), m && O && O.length > 0 ? (0, t.jsxs)("div", {
                        className: "flex flex-col gap-1",
                        children: [(0, t.jsx)(F.SearchSuggestionSectionLabel, {
                            className: "lg:pl-2",
                            children: d("search.recent")
                        }), (0, t.jsx)("div", {
                            className: "flex flex-col",
                            children: O.map((r, n) => {
                                let i = (0, ee.getEventOrSportsLinkFromSlug)("latest", r.slug).url;
                                return (0, t.jsx)(a.default, {
                                    href: i,
                                    prefetch: !1,
                                    onClick: e => W(e, r),
                                    className: "w-full",
                                    children: (0, t.jsxs)(F.SearchSuggestionItem, {
                                        selected: "" === e && l === n,
                                        className: "justify-between gap-4 p-2",
                                        children: [(0, t.jsxs)("div", {
                                            className: "flex gap-x-2 items-center",
                                            children: [(0, t.jsx)("div", {
                                                className: "h-8 w-8 shrink-0 relative border rounded-sm overflow-hidden",
                                                children: (0, t.jsx)(ep.default, {
                                                    src: r.image,
                                                    alt: r.title,
                                                    className: "object-cover",
                                                    fill: !0,
                                                    sizes: "96px"
                                                })
                                            }), (0, t.jsx)("p", {
                                                className: "text-body-base font-medium text-text ml-0.5 line-clamp-1",
                                                children: r.title
                                            })]
                                        }), (0, t.jsx)("button", {
                                            type: "button",
                                            "aria-label": "Remove",
                                            onClick: e => {
                                                let t;
                                                e.stopPropagation(), e.preventDefault(), w(JSON.stringify((t = v ? JSON.parse(v) : []) && t.length ? t.filter(e => e.id !== r.id) : []))
                                            },
                                            className: "p-1 shrink-0 text-text-secondary cursor-pointer flex items-center justify-center hover:text-text-tertiary",
                                            children: (0, t.jsx)(B.IconXmarkOutline12, {})
                                        })]
                                    })
                                }, r.id)
                            })
                        })]
                    }) : (0, t.jsxs)("div", {
                        className: "flex flex-col gap-2 py-2 lg:px-2",
                        children: [(0, t.jsx)(F.SearchSuggestionSectionLabel, {
                            children: d("search.topics")
                        }), (0, t.jsx)("div", {
                            className: "grid grid-cols-2 gap-2",
                            children: k.map(e => (0, t.jsx)(a.default, {
                                href: e.href,
                                className: "w-full",
                                prefetch: !1,
                                onClick: () => {
                                    i(), s()
                                },
                                children: (0, t.jsxs)("div", {
                                    className: "flex items-center border rounded-lg gap-x-2 hover:bg-surface p-2",
                                    children: [(0, t.jsx)("div", {
                                        className: "size-8 shrink-0 relative border rounded-lg overflow-hidden",
                                        children: (0, t.jsx)(ep.default, {
                                            src: e.image,
                                            alt: e.label,
                                            className: "object-cover",
                                            fill: !0,
                                            sizes: "96px"
                                        })
                                    }), (0, t.jsx)("p", {
                                        className: "text-body-base font-medium text-text ml-0.5 line-clamp-1",
                                        children: e.label
                                    })]
                                })
                            }, e.label))
                        })]
                    })]
                }) : (0, t.jsxs)("div", {
                    className: "flex flex-col gap-2",
                    children: [(0, t.jsx)(U.Tabs, {
                        value: f,
                        onValueChange: e => {
                            g(e)
                        },
                        children: (0, t.jsxs)(U.TabsList, {
                            variant: "highlight",
                            children: [(0, t.jsx)(U.TabsTrigger, {
                                value: "markets",
                                className: "text-[13px] px-2 [data-state=active]:text-text",
                                children: d("search.markets")
                            }), (0, t.jsx)(U.TabsTrigger, {
                                value: "profiles",
                                className: "text-[13px] px-2 [data-state=active]:text-text",
                                children: d("search.profiles")
                            })]
                        })
                    }), "profiles" === f ? L ? .profiles && L.profiles.length > 0 ? (0, t.jsx)(ev, {
                        profiles: L.profiles,
                        onClick: e => {
                            e.ctrlKey || e.metaKey || (i(), s())
                        }
                    }) : "fetching" !== C && "" !== e && 0 === L.profiles.length ? (0, t.jsx)("div", {
                        className: "flex w-full items-center justify-center p-6",
                        children: (0, t.jsx)("p", {
                            className: "text-xs font-medium text-text-secondary",
                            children: d("search.noResultsFound")
                        })
                    }) : null : (0, t.jsx)("div", {
                        className: "flex flex-col",
                        children: b ? (0, t.jsx)(ex, {
                            items: b.items,
                            clearSearch: i,
                            handleAfterNavigation: s
                        }) : (0, t.jsxs)(t.Fragment, {
                            children: [X ? (e => {
                                let a = (0, r.c)(6);
                                switch (e.callout.type) {
                                    case "crypto":
                                        {
                                            let r;
                                            return a[0] !== e ? (r = (0, t.jsx)(eE, { ...e
                                            }), a[0] = e, a[1] = r) : r = a[1],
                                            r
                                        }
                                    case "sports":
                                        {
                                            let r;
                                            return a[2] !== e ? (r = (0, t.jsx)(eb, { ...e
                                            }), a[2] = e, a[3] = r) : r = a[3],
                                            r
                                        }
                                    case "standard":
                                        {
                                            let r;
                                            return a[4] !== e ? (r = (0, t.jsx)(eI, { ...e
                                            }), a[4] = e, a[5] = r) : r = a[5],
                                            r
                                        }
                                    default:
                                        return null
                                }
                            })({
                                callout: X,
                                clearSearch: i,
                                handleAfterNavigation: s
                            }) : L && L.tags.length > 0 && (0, t.jsx)("div", {
                                className: "flex gap-1.5 items-center flex-wrap px-1 pb-2 pt-1",
                                children: L.tags.map(e => (0, t.jsx)(a.default, {
                                    href: `/predictions/${e.slug}`,
                                    prefetch: !1,
                                    onClick: () => {
                                        i(), s()
                                    },
                                    children: (0, t.jsx)(R.Button, {
                                        variant: "outline",
                                        size: "sm",
                                        className: "rounded-lg px-3",
                                        children: (0, t.jsx)("p", {
                                            className: "text-body-base font-medium",
                                            children: (0, eu.toAdjustedTitleCase)(e.label)
                                        })
                                    })
                                }, e.slug))
                            }), L && L.events.length > 0 ? (0, t.jsxs)("div", {
                                className: "flex flex-col",
                                children: [L.events.map((r, n) => {
                                    let i = `/event/${r.slug}`;
                                    return r ? .seriesSlug && (i = (0, ee.getEventOrSportsLinkFromSeries)(r).url), (0, t.jsx)(a.default, {
                                        tabIndex: 0,
                                        id: r.id.toString(),
                                        "data-slug": r.slug,
                                        "data-search-result": !0,
                                        href: i,
                                        prefetch: !1,
                                        onClick: e => W(e, r),
                                        children: (0, t.jsx)(e_, {
                                            event: r,
                                            query: e,
                                            isSelected: l === n
                                        }, r.id)
                                    }, r.id)
                                }), M && (0, t.jsx)(a.default, {
                                    href: `/predictions/${encodeURIComponent((0,P.normalizeSearchQueryForUrl)(e))}`,
                                    className: "text-sm text-center font-medium mt-1",
                                    onClick: () => {
                                        s(), A.trackEvent(er.Events.SearchNavbarSeeAllResultsClick, {
                                            query: e
                                        })
                                    },
                                    children: (0, t.jsxs)("div", {
                                        className: "w-full h-11 group rounded-sm hover:bg-neutral-50 text-brand-500 hover:text-brand-600 flex items-center justify-start px-2.5 gap-1.5",
                                        children: [(0, t.jsx)("p", {
                                            className: "text-body-base",
                                            children: d("search.seeAllResults")
                                        }), (0, t.jsx)(Y.IconArrowRightOutline12, {
                                            className: "group-hover:translate-x-px transition-transform duration-200"
                                        })]
                                    })
                                })]
                            }, e) : "fetching" !== C && "" !== e && 0 === L.events.length ? (0, t.jsx)("div", {
                                className: "flex w-full items-center justify-center p-6",
                                children: (0, t.jsx)("p", {
                                    className: "text-xs font-medium text-text-secondary",
                                    children: d("search.noResultsFound")
                                })
                            }) : null]
                        })
                    })]
                })
            })
        };
    ek.displayName = "MarketSearchResults";
    let eD = e => {
            let n, i, s, o, l, c, u, d, p = (0, r.c)(28),
                {
                    profile: A,
                    onClick: h
                } = e,
                m = (0, es.useAmplitudeAnalytics)(),
                f = A.username || A.name || "Anon",
                g = A.proxyWallet || A.address || A.id,
                y = A.id || g,
                T = A.username || A.name;
            p[0] !== g || p[1] !== T ? (n = (0, ec.createProfileUrl)({
                name: T,
                proxyWallet: g
            }), p[0] = g, p[1] = T, p[2] = n) : n = p[2];
            let E = n;
            p[3] !== A.profileImage || p[4] !== g ? (i = (0, t.jsx)("div", {
                className: "size-12 lg:size-10 shrink-0 relative border rounded-full overflow-hidden",
                children: (0, t.jsx)(X.default, {
                    profileImage: A.profileImage,
                    address: g,
                    width: "100%",
                    height: "100%",
                    quality: 50,
                    className: "w-full h-full object-cover rounded-none"
                })
            }), p[3] = A.profileImage, p[4] = g, p[5] = i) : i = p[5];
            let b = i;
            p[6] !== m || p[7] !== h || p[8] !== A.id || p[9] !== A.name || p[10] !== A.username || p[11] !== g ? (s = e => {
                m.trackEvent(er.Events.SearchProfileClick, {
                    profileId: A.id || null,
                    profileUsername: A.username || null,
                    profileName: A.name || null,
                    profileAddress: g,
                    searchContext: "navbar"
                }), h(e)
            }, p[6] = m, p[7] = h, p[8] = A.id, p[9] = A.name, p[10] = A.username, p[11] = g, p[12] = s) : s = p[12];
            let I = s;
            return p[13] !== f ? (o = (0, t.jsx)("p", {
                className: "text-sm font-medium text-text ml-0.5 line-clamp-3 lg:line-clamp-2 text-pretty",
                children: f
            }), p[13] = f, p[14] = o) : o = p[14], p[15] !== A.bio ? (l = A.bio && (0, t.jsx)("p", {
                className: "text-xs text-text-secondary ml-0.5 line-clamp-2",
                children: A.bio
            }), p[15] = A.bio, p[16] = l) : l = p[16], p[17] !== o || p[18] !== l ? (c = (0, t.jsxs)("div", {
                className: "flex flex-col gap-0.5",
                children: [o, l]
            }), p[17] = o, p[18] = l, p[19] = c) : c = p[19], p[20] !== b || p[21] !== c ? (u = (0, t.jsx)("div", {
                className: "flex items-center rounded-sm w-full justify-between gap-4 px-2 py-3 lg:py-2 hover:bg-neutral-50",
                children: (0, t.jsxs)("div", {
                    className: "flex gap-x-2 items-center",
                    children: [b, c]
                })
            }), p[20] = b, p[21] = c, p[22] = u) : u = p[22], p[23] !== I || p[24] !== y || p[25] !== E || p[26] !== u ? (d = (0, t.jsx)(a.default, {
                href: E,
                onClick: I,
                children: u
            }, y), p[23] = I, p[24] = y, p[25] = E, p[26] = u, p[27] = d) : d = p[27], d
        },
        ev = e => {
            let a, n, i = (0, r.c)(7),
                {
                    profiles: s,
                    onClick: o
                } = e;
            if (i[0] !== o || i[1] !== s) {
                let e;
                i[3] !== o ? (e = e => (0, t.jsx)(eD, {
                    profile: e,
                    onClick: o
                }, e.id || e.proxyWallet || e.address), i[3] = o, i[4] = e) : e = i[4], a = s.filter(eS).map(e), i[0] = o, i[1] = s, i[2] = a
            } else a = i[2];
            return i[5] !== a ? (n = (0, t.jsx)("div", {
                className: "flex flex-col",
                children: a
            }), i[5] = a, i[6] = n) : n = i[6], n
        },
        ew = e => {
            let a, i, s, o, c, d, p, A, h, m, f, g, y, T, E, b, C, _, N, x = (0, r.c)(70),
                {
                    isMobile: k,
                    closeDialog: D
                } = e,
                v = void 0 !== k && k,
                w = (0, S.useTranslations)(),
                O = (0, n.useRouter)(),
                [F, U] = (0, u.useState)(!1);
            x[0] !== O.pathname ? (a = "/" === O.pathname || O.pathname.startsWith("/search") || O.pathname.startsWith("/predictions"), x[0] = O.pathname, x[1] = a) : a = x[1];
            let G = a,
                H = (0, u.useRef)(null);
            x[2] === Symbol.for("react.memo_cache_sentinel") ? (i = {
                debounceMs: 150,
                containerRef: H
            }, x[2] = i) : i = x[2];
            let {
                query: j,
                setQuery: Q,
                debouncedQuery: K,
                isOpen: Y,
                setIsOpen: W,
                selectedIndex: q,
                setSelectedIndex: V,
                suppressFormSubmit: z,
                setSuppressFormSubmit: J,
                clearSearch: Z,
                setTotalItems: $,
                inputRef: X
            } = (0, L.useSearchSuggestions)(i);
            x[3] !== D || x[4] !== X || x[5] !== v || x[6] !== F || x[7] !== j || x[8] !== O || x[9] !== W || x[10] !== z ? (s = e => {
                if (e.preventDefault(), F) return;
                let t = X.current ? .value ? ? "",
                    r = ("" !== t ? t : j).trim();
                z || "" === r || (O.push(`/predictions/${encodeURIComponent((0,P.normalizeSearchQueryForUrl)(r))}`), X.current ? .blur(), W(!1)), v && D && D()
            }, x[3] = D, x[4] = X, x[5] = v, x[6] = F, x[7] = j, x[8] = O, x[9] = W, x[10] = z, x[11] = s) : s = x[11];
            let ee = s;
            x[12] !== X || x[13] !== G ? (o = () => {
                let e = e => {
                    let t = e.target;
                    ("INPUT" !== t.tagName || t === X.current) && ("/" !== e.key || !G || e.ctrlKey || e.metaKey || (e.preventDefault(), X.current ? .focus()))
                };
                return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e)
            }, c = [G, X], x[12] = X, x[13] = G, x[14] = o, x[15] = c) : (o = x[14], c = x[15]), (0, u.useEffect)(o, c), x[16] !== X || x[17] !== W ? (d = () => {
                X.current ? .blur(), W(!1)
            }, x[16] = X, x[17] = W, x[18] = d) : d = x[18];
            let et = d;
            x[19] !== W ? (p = e => {
                H.current ? .contains(e.relatedTarget) || W(!1)
            }, x[19] = W, x[20] = p) : p = x[20], x[21] === Symbol.for("react.memo_cache_sentinel") ? (A = (0, t.jsx)("div", {
                className: "absolute top-1/2 left-4 -translate-y-1/2 text-text-secondary",
                children: (0, t.jsx)(l.IconMagnifierOutline18, {})
            }), x[21] = A) : A = x[21], x[22] !== G || x[23] !== Y || x[24] !== j ? (h = j || Y || !G ? null : (0, t.jsx)("kbd", {
                className: "hidden lg:block text-text-tertiary pointer-events-none absolute top-1/2 right-4 -translate-y-1/2",
                children: "/"
            }), x[22] = G, x[23] = Y, x[24] = j, x[25] = h) : h = x[25];
            let er = `focus-visible:ring-0 ring-0 pl-11 max-lg:text-[16px]! border border-transparent ${Y?"lg:rounded-b-none !bg-input-outlined-bg !border-input-outlined-border":""}`;
            x[26] !== w ? (m = w("search.placeholder"), x[26] = w, x[27] = m) : m = x[27];
            let ea = `${m} polymarkets...`;
            return x[28] !== Q ? (f = e => {
                Q(e.target.value ? ? ""), U(!0), setTimeout(() => U(!1), 50)
            }, x[28] = Q, x[29] = f) : f = x[29], x[30] !== W ? (g = e => {
                e.preventDefault(), W(!0)
            }, x[30] = W, x[31] = g) : g = x[31], x[32] === Symbol.for("react.memo_cache_sentinel") ? (y = () => {
                U(!1)
            }, x[32] = y) : y = x[32], x[33] !== X || x[34] !== j || x[35] !== er || x[36] !== ea || x[37] !== f || x[38] !== g ? (T = (0, t.jsx)(M.Input, {
                autoComplete: "off",
                variant: "filled",
                id: "search-input",
                ref: X,
                value: j,
                className: er,
                placeholder: ea,
                onChange: f,
                onFocus: g,
                onBlur: y
            }), x[33] = X, x[34] = j, x[35] = er, x[36] = ea, x[37] = f, x[38] = g, x[39] = T) : T = x[39], x[40] !== Z || x[41] !== j ? (E = j ? (0, t.jsx)(R.Button, {
                type: "button",
                variant: "ghost",
                size: "iconSm",
                onClick: Z,
                "aria-label": "Clear search",
                className: "absolute right-2.5 top-1/2 -translate-y-1/2 text-text-secondary hover:bg-transparent hover:text-text-tertiary",
                children: (0, t.jsx)(B.IconXmarkOutline12, {})
            }) : null, x[40] = Z, x[41] = j, x[42] = E) : E = x[42], x[43] !== h || x[44] !== T || x[45] !== E ? (b = (0, t.jsxs)("div", {
                className: "relative",
                children: [A, h, T, E]
            }), x[43] = h, x[44] = T, x[45] = E, x[46] = b) : b = x[46], x[47] !== Z || x[48] !== K || x[49] !== et || x[50] !== Y || x[51] !== q || x[52] !== $ || x[53] !== V || x[54] !== J ? (C = Y && (0, t.jsx)(I.Media, {
                greaterThanOrEqual: "lg",
                children: (0, t.jsx)("div", {
                    className: "min-w-[400px] w-full z-50 absolute",
                    children: (0, t.jsx)(ek, {
                        query: K,
                        clearSearch: Z,
                        setSuppressForm: J,
                        handleAfterNavigation: et,
                        isMobile: !1,
                        selectedIndex: q,
                        setSelectedIndex: V,
                        setResultCount: $
                    })
                })
            }), x[47] = Z, x[48] = K, x[49] = et, x[50] = Y, x[51] = q, x[52] = $, x[53] = V, x[54] = J, x[55] = C) : C = x[55], x[56] !== Z || x[57] !== K || x[58] !== et || x[59] !== q || x[60] !== $ || x[61] !== V || x[62] !== J ? (_ = (0, t.jsx)(I.Media, {
                lessThan: "lg",
                children: (0, t.jsx)("div", {
                    className: "h-full w-full",
                    children: (0, t.jsx)(ek, {
                        query: K,
                        clearSearch: Z,
                        setSuppressForm: J,
                        handleAfterNavigation: et,
                        isMobile: !0,
                        selectedIndex: q,
                        setSelectedIndex: V,
                        setResultCount: $
                    })
                })
            }), x[56] = Z, x[57] = K, x[58] = et, x[59] = q, x[60] = $, x[61] = V, x[62] = J, x[63] = _) : _ = x[63], x[64] !== ee || x[65] !== b || x[66] !== C || x[67] !== _ || x[68] !== p ? (N = (0, t.jsxs)("form", {
                onSubmit: ee,
                ref: H,
                className: "p-4 lg:p-0 lg:max-w-[600px] min-w-[400px] relative w-full",
                onBlur: p,
                children: [b, C, _]
            }), x[64] = ee, x[65] = b, x[66] = C, x[67] = _, x[68] = p, x[69] = N) : N = x[69], N
        };
    e.s(["default", 0, ew], 259760);
    let eO = () => {
        let e, a, n, i, s, o, l = (0, r.c)(11),
            {
                isMobileSearchOpen: c,
                setIsMobileSearchOpen: u
            } = (0, N.useBottomDrawerContext)();
        return l[0] !== u ? (e = e => {
            e || u(!1)
        }, l[0] = u, l[1] = e) : e = l[1], l[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(w.Drawer.Overlay, {
            className: "fixed inset-0 z-101 bg-black/40"
        }), l[2] = a) : a = l[2], l[3] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)(w.Drawer.Handle, {
            className: "mt-1.5"
        }), l[3] = n) : n = l[3], l[4] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsxs)(O.VisuallyHidden.Root, {
            children: [(0, t.jsx)(w.Drawer.Title, {
                children: "Search"
            }), (0, t.jsx)(w.Drawer.Description, {
                children: "Search"
            })]
        }), l[4] = i) : i = l[4], l[5] !== u ? (s = (0, t.jsxs)(w.Drawer.Portal, {
            children: [a, (0, t.jsxs)(w.Drawer.Content, {
                className: "fixed inset-x-0 bottom-0 top-3.5 z-102 flex flex-col rounded-t-2xl bg-(--color-background) pt-2",
                children: [n, i, (0, t.jsx)("div", {
                    className: "h-full overflow-y-auto pt-3 pb-[env(safe-area-inset-bottom)]",
                    children: (0, t.jsx)(ew, {
                        isMobile: !0,
                        closeDialog: () => u(!1)
                    })
                })]
            })]
        }), l[5] = u, l[6] = s) : s = l[6], l[7] !== c || l[8] !== e || l[9] !== s ? (o = (0, t.jsx)(w.Drawer.Root, {
            open: c,
            onOpenChange: e,
            shouldScaleBackground: !1,
            children: s
        }), l[7] = c, l[8] = e, l[9] = s, l[10] = o) : o = l[10], o
    };

    function eR() {
        let e, u, E, b, I, v, w, O, R, M, L, B, P, F, U, G, H, j, Q, K, Y, W, q, V, z = (0, r.c)(75),
            J = (0, n.useRouter)(),
            Z = (0, S.useTranslations)(),
            $ = (0, x.useVisualStateStore)(eB),
            X = (0, A.useBalanceVisibilityStore)(eL),
            {
                isMobileSearchOpen: ee,
                setIsMobileSearchOpen: et,
                isMobileMenuOpen: er,
                setIsMobileMenuOpen: ea
            } = (0, N.useBottomDrawerContext)(),
            {
                setIsOpen: en
            } = (0, N.useBottomDrawerContext)(),
            {
                setOpen: ei,
                preventClose: es
            } = (0, p.useSiwx)();
        z[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated", "proxyAddress"], z[0] = e) : e = z[0];
        let {
            authenticated: eo,
            proxyAddress: el
        } = (0, _.useAccountContext)(e), {
            marketPositionsValue: ec
        } = (0, f.useMarketPositionsValue)(el), {
            trackedProxyUsdcBalance: eu
        } = (0, y.default)();
        z[1] !== el ? (u = {
            proxyAddress: el,
            select: g.pendingTrackedMarketPositionCountSelector
        }, z[1] = el, z[2] = u) : u = z[2];
        let {
            optimisticPositions: ed
        } = (0, g.default)(u), ep = (ec ? ? 0) + eu.current, eA = (0, T.useCooldownValue)(ep, (void 0 === ed ? 0 : ed) > 0), eh = eM;
        z[3] !== ee || z[4] !== et ? (E = () => {
            ee ? et(!1) : ((0, d.flushSync)(() => {
                et(!0)
            }), eh(), window.setTimeout(() => {
                eh()
            }, 280))
        }, z[3] = ee, z[4] = et, z[5] = E) : E = z[5];
        let em = E;
        z[6] !== eA || z[7] !== X ? (b = X ? (0, t.jsxs)(t.Fragment, {
            children: ["$", (0, t.jsx)(h.HiddenDots, {})]
        }) : (0, D.formatToDollar)(eA, {
            minimumFractionDigits: eA >= 100 ? 0 : 2,
            maximumFractionDigits: eA >= 100 ? 0 : 2
        }), z[6] = eA, z[7] = X, z[8] = b) : b = z[8];
        let ef = b;
        z[9] === Symbol.for("react.memo_cache_sentinel") ? (I = (0, t.jsx)(m.BackToTop, {
            variant: "mobile"
        }), z[9] = I) : I = z[9], z[10] !== $ ? (v = (0, t.jsx)(C.OutPortal, {
            node: $
        }, "smp-drawer-controls-portal"), z[10] = $, z[11] = v) : v = z[11], z[12] !== J.pathname || z[13] !== en || z[14] !== ei ? (w = () => {
            ei(!1), en(!1), (J.pathname === k.Location.Home || J.pathname.startsWith("/?") || J.pathname.startsWith("?")) && window ? .scrollTo({
                top: 0,
                behavior: "smooth"
            })
        }, z[12] = J.pathname, z[13] = en, z[14] = ei, z[15] = w) : w = z[15];
        let eg = `shrink-0 transition ${!es&&J.pathname===k.Location.Home&&!ee?"text-text":"text-text-secondary"}`;
        z[16] !== eg ? (O = (0, t.jsx)(s.IconHouse4Outline18, {
            className: eg
        }), z[16] = eg, z[17] = O) : O = z[17];
        let ey = `text-[11px] font-medium transition ${!es&&(J.pathname===k.Location.Home||J.pathname.startsWith("/?")||J.pathname.startsWith("?"))&&!ee?"text-text":"text-text-secondary"}`;
        z[18] !== Z ? (R = Z("navbar.home"), z[18] = Z, z[19] = R) : R = z[19], z[20] !== ey || z[21] !== R ? (M = (0, t.jsx)("p", {
            className: ey,
            children: R
        }), z[20] = ey, z[21] = R, z[22] = M) : M = z[22], z[23] !== M || z[24] !== w || z[25] !== O ? (L = (0, t.jsx)("div", {
            className: "flex flex-1 h-full justify-center items-center",
            children: (0, t.jsx)(a.default, {
                href: k.Location.Home,
                as: k.Location.Home,
                className: "flex w-full h-full",
                children: (0, t.jsxs)("div", {
                    className: "flex flex-col justify-between items-center w-full h-full py-3 px-2",
                    onClick: w,
                    children: [O, M]
                })
            })
        }), z[23] = M, z[24] = w, z[25] = O, z[26] = L) : L = z[26], z[27] !== em ? (B = e => {
            ("Enter" === e.key || " " === e.key) && (e.preventDefault(), em())
        }, z[27] = em, z[28] = B) : B = z[28];
        let eT = `shrink-0 transition ${!es&&ee?"text-text":"text-text-secondary"}`;
        z[29] !== eT ? (P = (0, t.jsx)(l.IconMagnifierOutline18, {
            className: eT
        }), z[29] = eT, z[30] = P) : P = z[30];
        let eE = `text-[11px] font-medium transition ${!es&&ee?"text-text":"text-text-secondary"}`;
        z[31] !== Z ? (F = Z("navbar.search"), z[31] = Z, z[32] = F) : F = z[32], z[33] !== eE || z[34] !== F ? (U = (0, t.jsx)("p", {
            className: eE,
            children: F
        }), z[33] = eE, z[34] = F, z[35] = U) : U = z[35], z[36] !== em || z[37] !== B || z[38] !== P || z[39] !== U ? (G = (0, t.jsx)("div", {
            className: "flex flex-1 h-full justify-center items-center",
            children: (0, t.jsxs)("button", {
                type: "button",
                className: "flex flex-col justify-between items-center w-full h-full py-3 px-2 bg-transparent border-none",
                tabIndex: 0,
                "aria-label": "Search",
                onKeyDown: B,
                onClick: em,
                children: [P, U]
            })
        }), z[36] = em, z[37] = B, z[38] = P, z[39] = U, z[40] = G) : G = z[40], z[41] !== J.pathname || z[42] !== en || z[43] !== ei ? (H = () => {
            ei(!1), en(!1), (J.pathname === k.Location.Breaking || J.pathname.startsWith("/?") || J.pathname.startsWith("?")) && window ? .scrollTo({
                top: 0,
                behavior: "smooth"
            })
        }, z[41] = J.pathname, z[42] = en, z[43] = ei, z[44] = H) : H = z[44];
        let eb = `shrink-0 transition ${!es&&J.pathname===k.Location.Breaking&&!ee?"text-text":"text-text-secondary"}`;
        z[45] !== eb ? (j = (0, t.jsx)(i.IconCircleChartLine2Outline18, {
            className: eb
        }), z[45] = eb, z[46] = j) : j = z[46];
        let eI = `text-[11px] font-medium transition ${!es&&(J.pathname===k.Location.Breaking||J.pathname.startsWith("/?")||J.pathname.startsWith("?"))&&!ee?"text-text":"text-text-secondary"}`;
        return z[47] !== Z ? (Q = Z("navbar.breaking"), z[47] = Z, z[48] = Q) : Q = z[48], z[49] !== eI || z[50] !== Q ? (K = (0, t.jsx)("p", {
            className: eI,
            children: Q
        }), z[49] = eI, z[50] = Q, z[51] = K) : K = z[51], z[52] !== H || z[53] !== j || z[54] !== K ? (Y = (0, t.jsx)("div", {
            className: "flex flex-1 h-full justify-center items-center",
            children: (0, t.jsx)(a.default, {
                href: k.Location.Breaking,
                as: k.Location.Breaking,
                className: "flex w-full h-full",
                children: (0, t.jsxs)("div", {
                    className: "flex flex-col justify-between items-center w-full h-full py-3 px-2",
                    onClick: H,
                    children: [j, K]
                })
            })
        }), z[52] = H, z[53] = j, z[54] = K, z[55] = Y) : Y = z[55], z[56] !== eo || z[57] !== ef || z[58] !== er || z[59] !== ee || z[60] !== es || z[61] !== J.pathname || z[62] !== ea || z[63] !== en || z[64] !== ei || z[65] !== Z ? (W = eo ? (0, t.jsx)("div", {
            className: "flex flex-1 h-full justify-center items-center",
            children: (0, t.jsx)(a.default, {
                href: k.Location.Portfolio,
                as: k.Location.Portfolio,
                className: "flex w-full h-full",
                children: (0, t.jsxs)("div", {
                    className: "flex flex-col justify-between items-center w-full h-full py-3 px-2",
                    onClick: () => {
                        ei(!1), en(!1), J.pathname.startsWith(k.Location.Portfolio) && window ? .scrollTo({
                            top: 0,
                            behavior: "smooth"
                        })
                    },
                    children: [(0, t.jsx)(o.IconChartLineOutline18, {
                        className: `shrink-0 transition ${!es&&J.pathname.includes(k.Location.Portfolio)&&!ee?"text-text":"text-text-secondary"}`
                    }), (0, t.jsx)("p", {
                        className: `text-[11px] font-medium transition ${!es&&J.pathname.includes(k.Location.Portfolio)&&!ee?"text-text":"text-text-secondary"}`,
                        children: ef
                    })]
                })
            })
        }) : (0, t.jsx)("div", {
            className: "flex flex-1 h-full justify-center items-center",
            children: (0, t.jsxs)("button", {
                type: "button",
                className: "flex flex-col justify-between items-center w-full h-full py-3 px-2 bg-transparent border-none",
                tabIndex: 0,
                "aria-label": "More menu",
                onKeyDown: e => {
                    ("Enter" === e.key || " " === e.key) && (e.preventDefault(), ea(!er))
                },
                onClick: () => ea(!er),
                children: [(0, t.jsx)(c.IconMenuOutline18, {
                    className: `shrink-0 transition ${!es&&er?"text-text":"text-text-secondary"}`
                }), (0, t.jsx)("p", {
                    className: `text-[11px] font-medium transition ${!es&&er?"text-text":"text-text-secondary"}`,
                    children: Z("navbar.more")
                })]
            })
        }), z[56] = eo, z[57] = ef, z[58] = er, z[59] = ee, z[60] = es, z[61] = J.pathname, z[62] = ea, z[63] = en, z[64] = ei, z[65] = Z, z[66] = W) : W = z[66], z[67] !== L || z[68] !== G || z[69] !== Y || z[70] !== W ? (q = (0, t.jsxs)("div", {
            className: "flex h-15 justify-between border-t items-center bg-background w-full",
            children: [L, G, Y, W]
        }), z[67] = L, z[68] = G, z[69] = Y, z[70] = W, z[71] = q) : q = z[71], z[72] !== q || z[73] !== v ? (V = (0, t.jsxs)("nav", {
            className: "web-shell-bottom-nav flex z-102 fixed overflow-visible left-0 right-0 items-end bg-background bottom-0 box-content pb-safe touch-none transition-[padding-bottom] duration-250 ease-[cubic-bezier(0.42,0,0.58,1)] lg:hidden",
            "aria-label": "Primary navigation",
            children: [I, (0, t.jsxs)("div", {
                className: "flex flex-col w-full relative overflow-hidden h-fit",
                children: [v, q]
            })]
        }), z[72] = q, z[73] = v, z[74] = V) : V = z[74], V
    }

    function eM() {
        let e = document.querySelector("[data-slot='drawer-content'][data-state='open']") ? .querySelector("#search-input") ? ? document.getElementById("search-input");
        if (!(e instanceof HTMLInputElement)) return;
        e.focus({
            preventScroll: !0
        });
        let t = e.value.length;
        e.setSelectionRange(t, t)
    }

    function eL(e) {
        return e.portfolioHidden
    }

    function eB(e) {
        return e.smpDrawerControlsPortalNode
    }
    e.s(["default", 0, () => {
        let e, a = (0, r.c)(1);
        return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsxs)(I.Media, {
            lessThan: "lg",
            children: [(0, t.jsx)(b.default, {}), (0, t.jsx)(eO, {}), (0, t.jsx)(v.default, {}), (0, t.jsx)(E.default, {}), (0, t.jsx)(eR, {})]
        }), a[0] = e) : e = a[0], e
    }], 775691);
    var eP = e.i(86831);
    e.s(["TopNavbar", 0, function(e) {
        let a, n, i, s, o, l, c = (0, r.c)(17),
            {
                left: u,
                center: d,
                right: p,
                secondary: A,
                className: h,
                primaryRowClassName: m,
                secondaryRowClassName: f
            } = e;
        return c[0] !== h ? (a = (0, eP.cn)("flex flex-col inset-x-0 w-full sticky top-0 z-30 bg-background box-border overflow-visible", h), c[0] = h, c[1] = a) : a = c[1], c[2] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)("div", {
            className: "pointer-events-none absolute bottom-0 left-0 right-0 h-px bg-border"
        }), c[2] = n) : n = c[2], c[3] !== m ? (i = (0, eP.cn)("max-w-[1350px] w-full pt-3 pb-1 md:pb-2 z-31 flex gap-4 mx-auto items-center px-4 lg:px-6 justify-between md:min-h-[68px]", m), c[3] = m, c[4] = i) : i = c[4], c[5] !== d || c[6] !== u || c[7] !== p || c[8] !== i ? (s = (0, t.jsxs)("div", {
            className: i,
            children: [u, d, p]
        }), c[5] = d, c[6] = u, c[7] = p, c[8] = i, c[9] = s) : s = c[9], c[10] !== A || c[11] !== f ? (o = A && (0, t.jsx)("div", {
            className: (0, eP.cn)("max-w-[1350px] w-full flex px-4 lg:px-6 mx-auto min-w-0 overflow-x-auto", f),
            children: A
        }), c[10] = A, c[11] = f, c[12] = o) : o = c[12], c[13] !== a || c[14] !== s || c[15] !== o ? (l = (0, t.jsxs)("nav", {
            "aria-label": "Main",
            className: a,
            children: [n, s, o]
        }), c[13] = a, c[14] = s, c[15] = o, c[16] = l) : l = c[16], l
    }], 810123);
    var eF = e.i(918007),
        eU = e.i(188634),
        eG = e.i(448030);

    function eH(e) {
        let n, i, s, o, l, c, u = (0, r.c)(13),
            {
                onLogoClick: d
            } = e,
            p = (0, el.useGeoStore)(ej);
        u[0] !== p ? (n = p && "US" !== p.toUpperCase(), u[0] = p, u[1] = n) : n = u[1];
        let A = n;
        u[2] !== p || u[3] !== A ? (i = A ? (0, eU.getCountryCodeFromIso2)(p) : void 0, u[2] = p, u[3] = A, u[4] = i) : i = u[4];
        let h = i;
        return u[5] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)(eF.PolymarketLogoFull, {
            className: "h-6.5 w-auto cursor-pointer [&_path]:fill-text-primary px-2.5"
        }), u[5] = s) : s = u[5], u[6] !== d ? (o = (0, t.jsx)(a.default, {
            href: k.Location.Home,
            "aria-label": "Polymarket Logo",
            onClick: d,
            children: s
        }), u[6] = d, u[7] = o) : o = u[7], u[8] !== h ? (l = h && (0, t.jsx)(eU.FlagIcon, {
            countryCode: h,
            className: "size-6 rounded-sm object-cover"
        }), u[8] = h, u[9] = l) : l = u[9], u[10] !== o || u[11] !== l ? (c = (0, t.jsxs)("div", {
            className: "w-fit shrink-0 h-10 cursor-pointer flex items-center gap-1",
            children: [o, l]
        }), u[10] = o, u[11] = l, u[12] = c) : c = u[12], c
    }

    function ej(e) {
        return e.rawCountry
    }

    function eQ() {
        let e, a = (0, r.c)(2),
            n = (0, eG.useDiscoveryFeedStore)(eK);
        return a[0] !== n ? (e = (0, t.jsx)(eH, {
            onLogoClick: () => n("trending")
        }), a[0] = n, a[1] = e) : e = a[1], e
    }

    function eK(e) {
        return e.onPrimaryTagChange
    }

    function eY() {
        let e, a = (0, r.c)(1);
        return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(eH, {}), a[0] = e) : e = a[0], e
    }
    e.s(["DesktopNavigationMenuLeft", 0, function(e) {
        let a, n = (0, r.c)(2),
            {
                isDiscoveryPage: i
            } = e,
            s = void 0 !== i && i;
        return n[0] !== s ? (a = s ? (0, t.jsx)(eQ, {}) : (0, t.jsx)(eY, {}), n[0] = s, n[1] = a) : a = n[1], a
    }], 171047), e.s(["UserMenuHeader", 0, function(e) {
        let a, n, i, s, o, l, c = (0, r.c)(13),
            {
                profileLink: u,
                settingsLink: d,
                className: p
            } = e;
        return c[0] !== p ? (a = (0, eP.cn)("w-full overflow-hidden px-4 py-3.5", p), c[0] = p, c[1] = a) : a = c[1], c[2] !== u ? (n = (0, t.jsx)("div", {
            className: "min-w-0 flex-1",
            children: u
        }), c[2] = u, c[3] = n) : n = c[3], c[4] !== d || c[5] !== n ? (i = (0, t.jsxs)("div", {
            className: "flex items-center justify-between w-full gap-3",
            children: [n, d]
        }), c[4] = d, c[5] = n, c[6] = i) : i = c[6], c[7] !== a || c[8] !== i ? (s = (0, t.jsx)("div", {
            className: a,
            children: i
        }), c[7] = a, c[8] = i, c[9] = s) : s = c[9], c[10] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsx)("hr", {
            className: "h-px bg-border w-full"
        }), c[10] = o) : o = c[10], c[11] !== s ? (l = (0, t.jsxs)(t.Fragment, {
            children: [s, o]
        }), c[11] = s, c[12] = l) : l = c[12], l
    }], 790268);
    var eW = e.i(197994);
    e.s(["IconMenuFill18", 0, ({ ...e
    }) => u.default.createElement(eW.Icon, {
        size: "18px",
        ...e
    }, u.default.createElement("path", {
        d: "M15.75,9.75H2.25c-.414,0-.75-.336-.75-.75s.336-.75,.75-.75H15.75c.414,0,.75,.336,.75,.75s-.336,.75-.75,.75Z",
        fill: "currentColor",
        "data-color": "color-2"
    }), u.default.createElement("path", {
        d: "M15.75,4.5H2.25c-.414,0-.75-.336-.75-.75s.336-.75,.75-.75H15.75c.414,0,.75,.336,.75,.75s-.336,.75-.75,.75Z",
        fill: "currentColor"
    }), u.default.createElement("path", {
        d: "M15.75,15H2.25c-.414,0-.75-.336-.75-.75s.336-.75,.75-.75H15.75c.414,0,.75,.336,.75,.75s-.336,.75-.75,.75Z",
        fill: "currentColor"
    }))], 180970);
    var eq = e.i(664318);
    e.s(["NavbarBalancePill", 0, function(e) {
        let a, n, i, s, o = (0, r.c)(13),
            {
                label: l,
                value: c,
                isLoading: u,
                isPending: d,
                hidden: p,
                className: A
            } = e,
            h = void 0 !== u && u,
            m = void 0 !== d && d,
            f = void 0 !== p && p;
        return o[0] !== A ? (a = (0, eP.cn)("flex flex-col items-center h-11 py-1 px-2.5 rounded-sm hover:bg-button-ghost-bg-hover cursor-pointer leading-[1.2] transition-colors duration-150", A), o[0] = A, o[1] = a) : a = o[1], o[2] !== l ? (n = (0, t.jsx)("div", {
            className: "text-xs text-text-secondary font-medium whitespace-nowrap",
            children: l
        }), o[2] = l, o[3] = n) : n = o[3], o[4] !== f || o[5] !== h || o[6] !== m || o[7] !== c ? (i = h ? (0, t.jsx)(eq.Skeleton, {
            className: "w-11.5 h-5"
        }) : (0, t.jsx)("div", {
            className: (0, eP.cn)("text-green-600 dark:text-green-500 font-semibold text-heading-lg", m && "animate-pulse"),
            children: f ? "$••••" : c
        }), o[4] = f, o[5] = h, o[6] = m, o[7] = c, o[8] = i) : i = o[8], o[9] !== a || o[10] !== n || o[11] !== i ? (s = (0, t.jsxs)("div", {
            className: a,
            children: [n, i]
        }), o[9] = a, o[10] = n, o[11] = i, o[12] = s) : s = o[12], s
    }], 738880);
    var eV = e.i(827681),
        ez = e.i(79075);
    e.s(["default", 0, function() {
        let e, a, n, i, s = (0, r.c)(12),
            o = (0, S.useTranslations)(),
            l = (0, es.useGoogleAnalytics)(),
            c = (0, es.useAmplitudeAnalytics)(),
            {
                setConnectorRoute: u,
                setOpen: d
            } = (0, p.useSiwx)();
        s[0] !== c || s[1] !== l || s[2] !== u || s[3] !== d ? (e = () => {
            let e = Date.now();
            (0, ez.markSignupPromptOpened)("navbar", {
                now: e,
                route: "login"
            }), c.trackEvent(er.Events.SignupPromptOpened, (0, ez.getSignupPromptOpenedEventProperties)({
                source: "navbar",
                route: "login"
            })), u(eV.ConnectorRoute.LOGIN), d(!0), c.trackEvent(er.Events.Login), l.trackClickEvent("LoginButtonConnectClick")
        }, s[0] = c, s[1] = l, s[2] = u, s[3] = d, s[4] = e) : e = s[4];
        let A = e;
        return s[5] !== o ? (a = o("auth.logIn"), s[5] = o, s[6] = a) : a = s[6], s[7] !== a ? (n = (0, t.jsx)("span", {
            className: "truncate md:text-clip md:overflow-visible md:whitespace-normal",
            children: a
        }), s[7] = a, s[8] = n) : n = s[8], s[9] !== A || s[10] !== n ? (i = (0, t.jsx)(R.Button, {
            variant: "ghost",
            className: "text-text-brand shrink min-w-0 md:shrink-0 md:min-w-fit",
            onClick: A,
            children: n
        }), s[9] = A, s[10] = n, s[11] = i) : i = s[11], i
    }], 955916), e.s(["default", 0, function() {
        let e, a, n, i, s = (0, r.c)(12),
            o = (0, S.useTranslations)(),
            l = (0, es.useAmplitudeAnalytics)(),
            c = (0, es.useGoogleAnalytics)(),
            {
                setConnectorRoute: u,
                setOpen: d
            } = (0, p.useSiwx)();
        s[0] !== l || s[1] !== c || s[2] !== u || s[3] !== d ? (e = () => {
            let e = Date.now();
            (0, ez.markSignupPromptOpened)("navbar", {
                now: e,
                route: "signup"
            }), l.trackEvent(er.Events.SignupPromptOpened, (0, ez.getSignupPromptOpenedEventProperties)({
                source: "navbar",
                route: "signup"
            })), u(eV.ConnectorRoute.SIGNUP), d(!0), l.trackEvent(er.Events.SignUp), c.trackClickEvent("SignupButtonConnectClick")
        }, s[0] = l, s[1] = c, s[2] = u, s[3] = d, s[4] = e) : e = s[4];
        let A = e;
        return s[5] !== o ? (a = o("auth.signUp"), s[5] = o, s[6] = a) : a = s[6], s[7] !== a ? (n = (0, t.jsx)("span", {
            className: "truncate md:text-clip md:overflow-visible md:whitespace-normal",
            children: a
        }), s[7] = a, s[8] = n) : n = s[8], s[9] !== A || s[10] !== n ? (i = (0, t.jsx)(R.Button, {
            className: "shrink min-w-0 md:shrink-0 md:min-w-fit",
            onClick: A,
            children: n
        }), s[9] = A, s[10] = n, s[11] = i) : i = s[11], i
    }], 657638);
    var eJ = e.i(425010),
        eZ = e.i(512662),
        e$ = e.i(635486),
        eX = e.i(892165),
        e0 = e.i(424134);
    let e1 = ({ ...e
    }) => u.default.createElement(eW.Icon, {
        size: "18px",
        ...e
    }, u.default.createElement("path", {
        d: "M13.25,2H4.75c-1.517,0-2.75,1.233-2.75,2.75V13.25c0,1.517,1.233,2.75,2.75,2.75H13.25c1.517,0,2.75-1.233,2.75-2.75V4.75c0-1.517-1.233-2.75-2.75-2.75ZM6.28,12.78c-.146,.146-.338,.22-.53,.22s-.384-.073-.53-.22c-.293-.293-.293-.768,0-1.061l1.97-1.97-1.97-1.97c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l2.5,2.5c.293,.293,.293,.768,0,1.061l-2.5,2.5Zm5.97,.22h-2.5c-.414,0-.75-.336-.75-.75s.336-.75,.75-.75h2.5c.414,0,.75,.336,.75,.75s-.336,.75-.75,.75Z",
        fill: "currentColor"
    }));
    var e2 = e.i(806421),
        e5 = e.i(789608),
        e6 = e.i(15727),
        e3 = e.i(868469),
        e4 = e.i(945930),
        e8 = e.i(631222),
        e9 = e.i(158789),
        e7 = e.i(489397);

    function te(e) {
        let n, i, s, o, l, c, u, d, p, A = (0, r.c)(18);
        A[0] !== e ? ({
            children: n,
            title: u,
            coerceToNextLink: s,
            href: o,
            secondary: c,
            className: i,
            ...l
        } = e, A[0] = e, A[1] = n, A[2] = i, A[3] = s, A[4] = o, A[5] = l, A[6] = c, A[7] = u) : (n = A[1], i = A[2], s = A[3], o = A[4], l = A[5], c = A[6], u = A[7]), A[8] !== i || A[9] !== c ? (d = (0, e9.dropdownMenuLinkClassName)({
            secondary: c,
            className: i
        }), A[8] = i, A[9] = c, A[10] = d) : d = A[10];
        let h = d;
        return A[11] !== n || A[12] !== s || A[13] !== o || A[14] !== h || A[15] !== l || A[16] !== u ? (p = (0, t.jsx)("li", {
            className: "w-full",
            children: s ? (0, t.jsx)(a.default, {
                href: o,
                className: h,
                ...l,
                children: n ? ? u
            }) : (0, t.jsx)("a", {
                href: o,
                className: h,
                ...l,
                children: n ? ? u
            })
        }), A[11] = n, A[12] = s, A[13] = o, A[14] = h, A[15] = l, A[16] = u, A[17] = p) : p = A[17], p
    }

    function tt(e) {
        let a, n, i, s, o, l, c = (0, r.c)(11);
        c[0] !== e ? ({
            children: a,
            title: s,
            secondary: i,
            ...n
        } = e, c[0] = e, c[1] = a, c[2] = n, c[3] = i, c[4] = s) : (a = c[1], n = c[2], i = c[3], s = c[4]), c[5] !== i ? (o = (0, e9.dropdownMenuLinkClassName)({
            secondary: i,
            className: "w-full cursor-pointer text-left border-none bg-transparent"
        }), c[5] = i, c[6] = o) : o = c[6];
        let u = a ? ? s;
        return c[7] !== n || c[8] !== o || c[9] !== u ? (l = (0, t.jsx)("li", {
            className: "w-full",
            children: (0, t.jsx)("button", {
                type: "button",
                className: o,
                ...n,
                children: u
            })
        }), c[7] = n, c[8] = o, c[9] = u, c[10] = l) : l = c[10], l
    }

    function tr(e) {
        let a, n, i, s, o, l, c, u, d, p, A, h = (0, r.c)(20);
        h[0] !== e ? ({
            children: n,
            title: l,
            checked: a,
            onCheckedChange: s,
            className: i,
            ...o
        } = e, h[0] = e, h[1] = a, h[2] = n, h[3] = i, h[4] = s, h[5] = o, h[6] = l) : (a = h[1], n = h[2], i = h[3], s = h[4], o = h[5], l = h[6]), h[7] !== i ? (c = (0, eP.cn)("hover:bg-neutral-50 w-full rounded-md h-10 px-3 text-sm font-normal cursor-pointer inline-flex items-center justify-between", i), h[7] = i, h[8] = c) : c = h[8];
        let m = n ? ? l;
        return h[9] !== m ? (u = (0, t.jsx)("div", {
            className: "text-sm font-medium text-center",
            children: m
        }), h[9] = m, h[10] = u) : u = h[10], h[11] === Symbol.for("react.memo_cache_sentinel") ? (d = (0, t.jsx)(e7.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]"
        }), h[11] = d) : d = h[11], h[12] !== a || h[13] !== s ? (p = (0, t.jsx)(e7.Switch.Root, {
            checked: a,
            onCheckedChange: s,
            className: "relative h-[20px] min-w-[35px] w-[35px] rounded-full data-[state=unchecked]:bg-neutral-100 data-[state=unchecked]:dark:bg-neutral-200 shadow-sm outline-none focus:shadow-md data-[state=checked]:bg-brand-500 cursor-pointer",
            children: d
        }), h[12] = a, h[13] = s, h[14] = p) : p = h[14], h[15] !== o || h[16] !== c || h[17] !== u || h[18] !== p ? (A = (0, t.jsxs)("li", {
            className: c,
            ...o,
            children: [u, p]
        }), h[15] = o, h[16] = c, h[17] = u, h[18] = p, h[19] = A) : A = h[19], A
    }
    let ta = e => {
        let a, n = (0, r.c)(2),
            {
                children: i
            } = e;
        return n[0] !== i ? (a = (0, t.jsx)("div", {
            className: "p-1.5 flex flex-col w-full",
            children: i
        }), n[0] = i, n[1] = a) : a = n[1], a
    };
    e.s(["UserAreaAuthedNavigationLinks", 0, () => {
        let e, a, n, i, s, o, l, c, u, d, p, A, h, m, f, g, y, T, E, b, I, C, _, N, x, k, D, v, w, O, R, M, L, B, P, F, U = (0, r.c)(88),
            {
                setTheme: G,
                resolvedTheme: H
            } = (0, eJ.useTheme)();
        U[0] !== H || U[1] !== G ? (e = () => G("dark" === H ? "light" : "dark"), U[0] = H, U[1] = G, U[2] = e) : e = U[2];
        let j = e,
            Q = (0, S.useTranslations)();
        U[3] !== Q ? (a = Q("navbar.leaderboard"), U[3] = Q, U[4] = a) : a = U[4], U[5] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)(e2.IconTrophyFill18, {
            size: 16,
            color: "#FFB700"
        }), U[5] = n) : n = U[5], U[6] !== Q ? (i = Q("navbar.leaderboard"), U[6] = Q, U[7] = i) : i = U[7], U[8] !== i ? (s = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium",
            children: [n, (0, t.jsx)("span", {
                children: i
            })]
        }), U[8] = i, U[9] = s) : s = U[9], U[10] !== a || U[11] !== s ? (o = (0, t.jsx)(te, {
            href: "/leaderboard",
            title: a,
            coerceToNextLink: !0,
            children: s
        }), U[10] = a, U[11] = s, U[12] = o) : o = U[12], U[13] !== Q ? (l = Q("navbar.rewards"), U[13] = Q, U[14] = l) : l = U[14];
        let K = "dark" === H ? "#379C65" : "#00B955";
        U[15] !== K ? (c = (0, t.jsx)(eZ.IconCircleDollarFill18, {
            size: 16,
            color: K
        }), U[15] = K, U[16] = c) : c = U[16], U[17] !== Q ? (u = Q("navbar.rewards"), U[17] = Q, U[18] = u) : u = U[18], U[19] !== u ? (d = (0, t.jsx)("span", {
            children: u
        }), U[19] = u, U[20] = d) : d = U[20], U[21] !== d || U[22] !== c ? (p = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium",
            children: [c, d]
        }), U[21] = d, U[22] = c, U[23] = p) : p = U[23], U[24] !== p || U[25] !== l ? (A = (0, t.jsx)(te, {
            href: "/rewards",
            title: l,
            coerceToNextLink: !0,
            children: p
        }), U[24] = p, U[25] = l, U[26] = A) : A = U[26], U[27] !== Q ? (h = Q("navbar.apis"), U[27] = Q, U[28] = h) : h = U[28];
        let Y = "dark" === H ? "#C03065" : "#FF005E";
        U[29] !== Y ? (m = (0, t.jsx)(e0.IconPlug2Fill18, {
            size: 16,
            color: Y
        }), U[29] = Y, U[30] = m) : m = U[30], U[31] !== Q ? (f = Q("navbar.apis"), U[31] = Q, U[32] = f) : f = U[32], U[33] !== f ? (g = (0, t.jsx)("span", {
            children: f
        }), U[33] = f, U[34] = g) : g = U[34], U[35] !== m || U[36] !== g ? (y = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium",
            children: [m, g]
        }), U[35] = m, U[36] = g, U[37] = y) : y = U[37], U[38] !== h || U[39] !== y ? (T = (0, t.jsx)(te, {
            href: `${e8.POLYMARKET_DOCS_LINK}/api-reference`,
            title: h,
            target: "_blank",
            rel: "noopener noreferrer",
            children: y
        }), U[38] = h, U[39] = y, U[40] = T) : T = U[40], U[41] !== Q ? (E = Q("navbar.referAndEarn"), U[41] = Q, U[42] = E) : E = U[42];
        let W = "dark" === H ? "#CE3AA4" : "#FF09BA";
        U[43] !== W ? (b = (0, t.jsx)(e$.IconGiftFill18, {
            size: 16,
            color: W
        }), U[43] = W, U[44] = b) : b = U[44], U[45] !== Q ? (I = Q("navbar.referAndEarn"), U[45] = Q, U[46] = I) : I = U[46], U[47] !== I ? (C = (0, t.jsx)("span", {
            children: I
        }), U[47] = I, U[48] = C) : C = U[48], U[49] !== b || U[50] !== C ? (_ = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium",
            children: [b, C]
        }), U[49] = b, U[50] = C, U[51] = _) : _ = U[51], U[52] !== E || U[53] !== _ ? (N = (0, t.jsx)(te, {
            href: "/refer",
            title: E,
            coerceToNextLink: !0,
            children: _
        }), U[52] = E, U[53] = _, U[54] = N) : N = U[54], U[55] !== Q ? (x = Q("navbar.builders"), U[55] = Q, U[56] = x) : x = U[56];
        let q = "dark" === H ? "#6B7280" : "#374151";
        U[57] !== q ? (k = (0, t.jsx)(e1, {
            size: 16,
            color: q
        }), U[57] = q, U[58] = k) : k = U[58], U[59] !== Q ? (D = Q("navbar.builders"), U[59] = Q, U[60] = D) : D = U[60], U[61] !== D ? (v = (0, t.jsx)("span", {
            children: D
        }), U[61] = D, U[62] = v) : v = U[62], U[63] !== k || U[64] !== v ? (w = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium",
            children: [k, v]
        }), U[63] = k, U[64] = v, U[65] = w) : w = U[65], U[66] !== x || U[67] !== w ? (O = (0, t.jsx)(te, {
            href: "/settings?tab=builder",
            title: x,
            coerceToNextLink: !0,
            children: w
        }), U[66] = x, U[67] = w, U[68] = O) : O = U[68];
        let V = "dark" === H;
        return U[69] !== j ? (R = () => j(), U[69] = j, U[70] = R) : R = U[70], U[71] === Symbol.for("react.memo_cache_sentinel") ? (M = (0, t.jsx)(eX.IconMoonFill18, {
            size: 16,
            color: "#2F63DD"
        }), U[71] = M) : M = U[71], U[72] !== Q ? (L = Q("navbar.darkMode"), U[72] = Q, U[73] = L) : L = U[73], U[74] !== L ? (B = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium whitespace-nowrap",
            children: [M, (0, t.jsx)("span", {
                children: L
            })]
        }), U[74] = L, U[75] = B) : B = U[75], U[76] !== j || U[77] !== V || U[78] !== R || U[79] !== B ? (P = (0, t.jsx)(tr, {
            checked: V,
            onCheckedChange: j,
            onClick: R,
            className: "gap-2",
            children: B
        }), U[76] = j, U[77] = V, U[78] = R, U[79] = B, U[80] = P) : P = U[80], U[81] !== A || U[82] !== T || U[83] !== N || U[84] !== O || U[85] !== P || U[86] !== o ? (F = (0, t.jsxs)(ta, {
            children: [o, A, T, N, O, P]
        }), U[81] = A, U[82] = T, U[83] = N, U[84] = O, U[85] = P, U[86] = o, U[87] = F) : F = U[87], F
    }, "UserAreaBottomNavigationLinks", 0, () => {
        let e, a, n, i, s, o, l, c, u, d, p, A, h, m, f, g, y, T, E = (0, r.c)(43),
            {
                disconnect: b
            } = (0, e5.useDisconnect)(),
            {
                openSupport: I
            } = (0, e6.useIntercomSupport)(),
            C = (0, S.useTranslations)();
        return E[0] !== C ? (e = C("navbar.accuracy"), E[0] = C, E[1] = e) : e = E[1], E[2] !== e ? (a = (0, t.jsx)(te, {
            href: "/accuracy",
            title: e,
            coerceToNextLink: !0,
            secondary: !0
        }), E[2] = e, E[3] = a) : a = E[3], E[4] !== C ? (n = C("navbar.support"), E[4] = C, E[5] = n) : n = E[5], E[6] !== I ? (i = () => I(), E[6] = I, E[7] = i) : i = E[7], E[8] !== n || E[9] !== i ? (s = (0, t.jsx)(tt, {
            title: n,
            secondary: !0,
            onClick: i
        }), E[8] = n, E[9] = i, E[10] = s) : s = E[10], E[11] !== C ? (o = C("navbar.documentation"), E[11] = C, E[12] = o) : o = E[12], E[13] !== o ? (l = (0, t.jsx)(te, {
            href: e8.POLYMARKET_DOCS_LINK,
            title: o,
            target: "_blank",
            rel: "noopener noreferrer",
            secondary: !0
        }), E[13] = o, E[14] = l) : l = E[14], E[15] !== C ? (c = C("navbar.helpCenter"), E[15] = C, E[16] = c) : c = E[16], E[17] !== c ? (u = (0, t.jsx)(te, {
            href: e8.POLYMARKET_HELP_CENTER_LINK,
            title: c,
            target: "_blank",
            rel: "noopener noreferrer",
            secondary: !0
        }), E[17] = c, E[18] = u) : u = E[18], E[19] !== C ? (d = C("navbar.termsOfUse"), E[19] = C, E[20] = d) : d = E[20], E[21] !== d ? (p = (0, t.jsx)(te, {
            href: e8.POLYMARKET_TOS_LINK,
            title: d,
            target: "_blank",
            rel: "noopener noreferrer",
            secondary: !0
        }), E[21] = d, E[22] = p) : p = E[22], E[23] === Symbol.for("react.memo_cache_sentinel") ? (A = (0, t.jsx)(e3.LanguageSelector, {}), E[23] = A) : A = E[23], E[24] !== b ? (h = () => {
            (0, e4.setLogoutTrigger)({
                reason: "user_logout",
                initiator: "user",
                trigger: "navbar_logout"
            }), b()
        }, E[24] = b, E[25] = h) : h = E[25], E[26] !== C ? (m = C("navbar.logout"), E[26] = C, E[27] = m) : m = E[27], E[28] !== C ? (f = C("navbar.logout"), E[28] = C, E[29] = f) : f = E[29], E[30] !== f ? (g = (0, t.jsx)("div", {
            className: "font-medium text-red-500",
            children: f
        }), E[30] = f, E[31] = g) : g = E[31], E[32] !== h || E[33] !== m || E[34] !== g ? (y = (0, t.jsx)(te, {
            onClick: h,
            title: m,
            className: "cursor-pointer hover:bg-red-500/8",
            children: g
        }), E[32] = h, E[33] = m, E[34] = g, E[35] = y) : y = E[35], E[36] !== a || E[37] !== p || E[38] !== y || E[39] !== s || E[40] !== l || E[41] !== u ? (T = (0, t.jsxs)(ta, {
            children: [a, s, l, u, p, A, y]
        }), E[36] = a, E[37] = p, E[38] = y, E[39] = s, E[40] = l, E[41] = u, E[42] = T) : T = E[42], T
    }, "UserAreaUnauthedNavigationLinks", 0, () => {
        let e, a, n, i, s, o, l, c, u, d, p, A, h, m, f, g, y, T, E, b, I, C, N, x, k, D, v, w, O, R, M, L, B, P, F, U, G, H, j = (0, r.c)(90),
            {
                setTheme: Q,
                resolvedTheme: K
            } = (0, eJ.useTheme)();
        j[0] !== K || j[1] !== Q ? (e = () => Q("dark" === K ? "light" : "dark"), j[0] = K, j[1] = Q, j[2] = e) : e = j[2];
        let Y = e,
            W = (0, S.useTranslations)();
        j[3] === Symbol.for("react.memo_cache_sentinel") ? (a = ["authenticated"], j[3] = a) : a = j[3];
        let {
            authenticated: q
        } = (0, _.useAccountContext)(a), {
            openSupport: V
        } = (0, e6.useIntercomSupport)();
        j[4] !== W ? (n = W("navbar.leaderboard"), j[4] = W, j[5] = n) : n = j[5], j[6] === Symbol.for("react.memo_cache_sentinel") ? (i = (0, t.jsx)(e2.IconTrophyFill18, {
            size: 16,
            color: "#FFB700"
        }), j[6] = i) : i = j[6], j[7] !== W ? (s = W("navbar.leaderboard"), j[7] = W, j[8] = s) : s = j[8], j[9] !== s ? (o = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium",
            children: [i, (0, t.jsx)("span", {
                children: s
            })]
        }), j[9] = s, j[10] = o) : o = j[10], j[11] !== n || j[12] !== o ? (l = (0, t.jsx)(te, {
            href: "/leaderboard",
            title: n,
            coerceToNextLink: !0,
            children: o
        }), j[11] = n, j[12] = o, j[13] = l) : l = j[13], j[14] !== W ? (c = W("navbar.rewards"), j[14] = W, j[15] = c) : c = j[15];
        let z = "dark" === K ? "#379C65" : "#00B955";
        j[16] !== z ? (u = (0, t.jsx)(eZ.IconCircleDollarFill18, {
            size: 16,
            color: z
        }), j[16] = z, j[17] = u) : u = j[17], j[18] !== W ? (d = W("navbar.rewards"), j[18] = W, j[19] = d) : d = j[19], j[20] !== d ? (p = (0, t.jsx)("span", {
            children: d
        }), j[20] = d, j[21] = p) : p = j[21], j[22] !== p || j[23] !== u ? (A = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium",
            children: [u, p]
        }), j[22] = p, j[23] = u, j[24] = A) : A = j[24], j[25] !== A || j[26] !== c ? (h = (0, t.jsx)(te, {
            href: "/rewards",
            title: c,
            coerceToNextLink: !0,
            children: A
        }), j[25] = A, j[26] = c, j[27] = h) : h = j[27], j[28] !== W ? (m = W("navbar.apis"), j[28] = W, j[29] = m) : m = j[29];
        let J = "dark" === K ? "#C03065" : "#FF005E";
        j[30] !== J ? (f = (0, t.jsx)(e0.IconPlug2Fill18, {
            size: 16,
            color: J
        }), j[30] = J, j[31] = f) : f = j[31], j[32] !== W ? (g = W("navbar.apis"), j[32] = W, j[33] = g) : g = j[33], j[34] !== g ? (y = (0, t.jsx)("span", {
            children: g
        }), j[34] = g, j[35] = y) : y = j[35], j[36] !== f || j[37] !== y ? (T = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium",
            children: [f, y]
        }), j[36] = f, j[37] = y, j[38] = T) : T = j[38], j[39] !== m || j[40] !== T ? (E = (0, t.jsx)(te, {
            href: `${e8.POLYMARKET_DOCS_LINK}/api-reference`,
            title: m,
            target: "_blank",
            rel: "noopener noreferrer",
            children: T
        }), j[39] = m, j[40] = T, j[41] = E) : E = j[41];
        let Z = "dark" === K;
        return j[42] !== Y ? (b = () => Y(), j[42] = Y, j[43] = b) : b = j[43], j[44] === Symbol.for("react.memo_cache_sentinel") ? (I = (0, t.jsx)(eX.IconMoonFill18, {
            size: 16,
            color: "#2F63DD"
        }), j[44] = I) : I = j[44], j[45] !== W ? (C = W("navbar.darkMode"), j[45] = W, j[46] = C) : C = j[46], j[47] !== C ? (N = (0, t.jsxs)("div", {
            className: "flex items-center gap-2 font-medium whitespace-nowrap",
            children: [I, (0, t.jsx)("span", {
                children: C
            })]
        }), j[47] = C, j[48] = N) : N = j[48], j[49] !== Y || j[50] !== Z || j[51] !== b || j[52] !== N ? (x = (0, t.jsx)(tr, {
            checked: Z,
            onCheckedChange: Y,
            onClick: b,
            className: "gap-2",
            children: N
        }), j[49] = Y, j[50] = Z, j[51] = b, j[52] = N, j[53] = x) : x = j[53], j[54] !== h || j[55] !== E || j[56] !== x || j[57] !== l ? (k = (0, t.jsxs)(ta, {
            children: [l, h, E, x]
        }), j[54] = h, j[55] = E, j[56] = x, j[57] = l, j[58] = k) : k = j[58], j[59] === Symbol.for("react.memo_cache_sentinel") ? (D = (0, t.jsx)("hr", {
            className: "h-px bg-border w-full"
        }), j[59] = D) : D = j[59], j[60] !== W ? (v = W("navbar.accuracy"), j[60] = W, j[61] = v) : v = j[61], j[62] !== v ? (w = (0, t.jsx)(te, {
            href: "/accuracy",
            title: v,
            coerceToNextLink: !0,
            secondary: !0
        }), j[62] = v, j[63] = w) : w = j[63], j[64] !== q || j[65] !== V || j[66] !== W ? (O = q && (0, t.jsx)(tt, {
            title: W("navbar.support"),
            secondary: !0,
            onClick: () => V()
        }), j[64] = q, j[65] = V, j[66] = W, j[67] = O) : O = j[67], j[68] !== W ? (R = W("navbar.documentation"), j[68] = W, j[69] = R) : R = j[69], j[70] !== R ? (M = (0, t.jsx)(te, {
            href: e8.POLYMARKET_DOCS_LINK,
            title: R,
            target: "_blank",
            rel: "noopener noreferrer",
            secondary: !0
        }), j[70] = R, j[71] = M) : M = j[71], j[72] !== W ? (L = W("navbar.helpCenter"), j[72] = W, j[73] = L) : L = j[73], j[74] !== L ? (B = (0, t.jsx)(te, {
            href: e8.POLYMARKET_HELP_CENTER_LINK,
            title: L,
            target: "_blank",
            rel: "noopener noreferrer",
            secondary: !0
        }), j[74] = L, j[75] = B) : B = j[75], j[76] !== W ? (P = W("navbar.termsOfUse"), j[76] = W, j[77] = P) : P = j[77], j[78] !== P ? (F = (0, t.jsx)(te, {
            href: e8.POLYMARKET_TOS_LINK,
            title: P,
            target: "_blank",
            rel: "noopener noreferrer",
            secondary: !0
        }), j[78] = P, j[79] = F) : F = j[79], j[80] === Symbol.for("react.memo_cache_sentinel") ? (U = (0, t.jsx)(e3.LanguageSelector, {}), j[80] = U) : U = j[80], j[81] !== w || j[82] !== O || j[83] !== M || j[84] !== B || j[85] !== F ? (G = (0, t.jsxs)(ta, {
            children: [w, O, M, B, F, U]
        }), j[81] = w, j[82] = O, j[83] = M, j[84] = B, j[85] = F, j[86] = G) : G = j[86], j[87] !== k || j[88] !== G ? (H = (0, t.jsxs)(t.Fragment, {
            children: [k, D, G]
        }), j[87] = k, j[88] = G, j[89] = H) : H = j[89], H
    }], 588885)
}, 702056, e => {
    "use strict";
    let t = "pm_navbar_balances";
    e.s(["readNavbarBalances", 0, function(e) {
        try {
            let r = localStorage.getItem(t);
            if (!r) return null;
            let a = JSON.parse(r);
            if (Date.now() - a.timestamp > 18e5 || e && a.proxyAddress !== e) return null;
            return {
                portfolio: a.portfolio,
                cash: a.cash
            }
        } catch {
            return null
        }
    }, "saveNavbarBalances", 0, function(e, r, a) {
        try {
            let n = {
                proxyAddress: e,
                portfolio: r,
                cash: a,
                timestamp: Date.now()
            };
            localStorage.setItem(t, JSON.stringify(n))
        } catch {}
        try {
            let t = `${e}:${r.toFixed(2)}:${a.toFixed(2)}`;
            document.cookie = `pm_balances=${t}; path=/; max-age=1800; SameSite=Lax`
        } catch {}
    }])
}, 444357, e => {
    "use strict";
    var t = e.i(416340),
        r = e.i(197994);
    e.s(["IconCircleArrowDownFill18", 0, ({ ...e
    }) => t.default.createElement(r.Icon, {
        size: "18px",
        ...e
    }, t.default.createElement("path", {
        d: "M9,1C4.589,1,1,4.589,1,9s3.589,8,8,8,8-3.589,8-8S13.411,1,9,1Zm3.03,9.28l-2.5,2.5c-.146,.146-.338,.22-.53,.22s-.384-.073-.53-.22l-2.5-2.5c-.293-.293-.293-.768,0-1.061s.768-.293,1.061,0l1.22,1.22V5.75c0-.414,.336-.75,.75-.75s.75,.336,.75,.75v4.689l1.22-1.22c.293-.293,.768-.293,1.061,0s.293,.768,0,1.061Z",
        fill: "currentColor"
    }))])
}, 348262, 719902, 900519, 497986, e => {
    "use strict";
    var t = e.i(196593),
        r = e.i(156591);
    e.s(["convertPriceRowsToPriceAndSizeAndNet", 0, e => e.map(e => ({
        price: `${e.price}`,
        size: `${e.size}`,
        value: `${e.value}`,
        netSize: `${e.netSize}`,
        netValue: `${e.netValue}`
    })), "delayInMs", 0, e => {
        let t = "string" == typeof e ? parseInt(e, 10) : e;
        return Number.isFinite(t) ? 1e3 * t : 0
    }, "findMatchingAmount", 0, (e, t) => {
        try {
            let r = parseFloat(e) > 0 ? parseFloat(e) : 0,
                a = parseFloat(t) > 0 ? parseFloat(t) : 0;
            if (r > 0 && a > 0) return Math.min(r, a);
            return 0
        } catch {
            return 0
        }
    }, "generateRegExp", 0, e => RegExp(`^$|^\\d{1,${e}}$`), "getValueFromClick", 0, (e, a) => {
        let n = a ? ? .01,
            i = (0, r.getPrecisionFromTickSize)(n),
            s = +(parseFloat(e) * n).toFixed(5);
        return (0, t.nDecimals)(100 * s, i - 2)
    }, "handleConditionalPadding", 0, (e, t, r) => 3 === r && (2 === e.length && "." === t[2] ? e.padEnd(r, "0") : 1 === e.length && `0${e}0`), "handleStep", 0, (e, t, a, n, i) => {
        if ("string" != typeof e) return "0";
        let s = "number" == typeof n,
            o = parseInt("" === e ? "0" : e, 10);
        if (Number.isNaN(o)) return "0";
        let l = Math.max("increment" === t ? o + a : o - a, 0);
        if (!s) return i ? .max !== void 0 && (l = Math.min(l, i.max)), i ? .min !== void 0 && (l = Math.max(i.min, l)), l.toString();
        let c = (0, r.getPrecisionFromTickSize)(n),
            u = "9".padEnd(c, "9"),
            d = l.toString().padStart(c, "0");
        return parseInt(d, 10) < parseInt(u, 10) ? d : u
    }, "parseMaskedPriceUnits", 0, (e, t) => {
        let [r, a] = e.replace("¢", "").split("."), n = (r || "0").trim().padStart(2, "0"), i = t > 2 ? (a || "").trim().padEnd(t - 2, "0") : "";
        return `${n}${i}`
    }], 348262);
    var a = e.i(322467),
        n = 0;
    e.s(["uniqueId", 0, function(e) {
        var t = ++n;
        return (0, a.default)(e) + t
    }], 719902);
    var i = e.i(740594),
        s = e.i(458164);
    let o = ({
        value: e,
        precision: t
    }) => {
        if (3 === t) {
            let [t, r = "0"] = e.split("."), a = parseInt(t || "0", 10), n = parseInt(r || "0", 10);
            return `${(10*a+n).toString().padStart(3,"0")}`
        }
        return e.padStart(2, "0")
    };
    e.s(["cashBalanceFormatter", 0, ({
        balance: e,
        cashLabel: t = "cash"
    }) => {
        let r = e.toLocaleString("en-US", {
            minimumFractionDigits: 2,
            maximumFractionDigits: 2
        });
        return `$${r} ${t}`
    }, "formatPaddedCents", 0, (e, t) => {
        if (2 === t) return `${e}\xa2`.replace(/^0+(?=\d)/, "");
        let r = e.slice(0, 2),
            a = e.slice(2, t);
        return `${r.replace(/^0+(?=\d)/,"")}.${a}\xa2`
    }, "padValue", 0, o, "unpadValue", 0, ({
        value: e,
        precision: t
    }) => {
        if (!e) return 0;
        let r = parseInt(e, 10);
        if (3 === t) {
            let e = Math.floor(r / 10);
            return parseFloat(`${e}.${r%10}`)
        }
        return r
    }], 900519);
    let l = [i.Side.BUY, i.Side.SELL],
        c = ["0", "1"],
        u = Object.values(s.OrderType),
        d = e => Number.isFinite(parseFloat(e)),
        p = e => Number.isFinite(parseFloat(e)),
        A = e => {
            let t = parseInt(e, 10);
            return !!Number.isFinite(t) && t > Math.floor(Date.now() / 1e3)
        };
    e.s(["handleTradeParamsFromQuery", 0, ({
        url: e,
        setSide: t,
        setOrderType: a,
        setSelectedOutcomeIdx: n,
        setShares: i,
        setPrice: s,
        setPriceUpdateLocation: h,
        setAmountUpdateLocation: m,
        setOrderExpiration: f,
        setActiveMarketFromSlug: g,
        setMarketForMobile: y,
        precision: T
    }) => {
        let E = T,
            b = e.searchParams.get("marketSlug");
        if (b) {
            let t = g(b);
            t ? .orderPriceMinTickSize && (E = (0, r.getPrecisionFromTickSize)(t.orderPriceMinTickSize)), e.searchParams.delete("marketSlug"), e.search = e.searchParams.toString()
        }
        return [{
            key: "side",
            validValues: l,
            setter: t
        }, {
            key: "orderType",
            validValues: u,
            setter: a
        }, {
            key: "outcomeIndex",
            validValues: c,
            setter: e => (Number.isFinite(e) && n(e), n(Number(e)))
        }, {
            key: "shares",
            validValues: d,
            setter: e => {
                m("click"), i(e)
            }
        }, {
            key: "price",
            validValues: p,
            setter: e => {
                let t = o({
                    value: e,
                    precision: E
                });
                h("click"), s(t)
            }
        }, {
            key: "expiration",
            validValues: A,
            setter: e => f(parseInt(e, 10))
        }, {
            key: "conditionId",
            validValues: e => !!e,
            setter: y
        }].reduce((e, {
            key: t,
            validValues: r,
            setter: a
        }) => {
            let n;
            return (n = e.searchParams.get(t)) && (Array.isArray(r) ? r.includes(n) : r(n)) && (a(n), e.searchParams.delete(t), e.search = e.searchParams.toString()), e
        }, e)
    }], 497986)
}, 88240, 880809, 273587, 378876, 450091, 494316, 22026, 921807, 460649, 720756, 343999, 436127, 772281, 394341, 835893, 99417, 196144, 838900, 551068, 187150, 822315, 618808, 979983, 771596, e => {
    "use strict";
    let t;
    e.s(["TransactionResponseState", () => ru, "useCreateOrder", () => rd], 88240);
    var r, a, n, i = e.i(740594),
        s = e.i(318594),
        o = e.i(416340),
        l = e.i(882860),
        c = e.i(478088),
        u = e.i(423708),
        d = e.i(723823),
        p = e.i(567692),
        A = e.i(675702),
        h = e.i(488549),
        m = e.i(348262),
        f = e.i(79126),
        g = e.i(200036),
        y = e.i(246290),
        T = e.i(249792),
        E = e.i(606572),
        b = e.i(305457),
        I = e.i(784521),
        C = e.i(400819),
        S = e.i(399336),
        _ = e.i(684686),
        N = e.i(221628),
        x = e.i(970863),
        k = e.i(518321),
        D = e.i(328113),
        v = e.i(66199),
        w = e.i(719902),
        O = e.i(63238),
        R = e.i(458164),
        M = e.i(497986),
        L = e.i(918997),
        B = e.i(210308),
        P = e.i(134709),
        F = e.i(987222),
        U = e.i(922445),
        G = e.i(313582),
        H = e.i(196593),
        j = e.i(631222),
        Q = e.i(156591),
        K = e.i(354712);
    let Y = (0, K.createSplitContext)("TradeContext", {
            cursorActive: !1,
            setMarketForMobile: () => {},
            marketForMobile: null,
            isSellAmountPrefilled: !1,
            defaultOrderType: R.OrderType.Market,
            handleResetPriceState: () => {},
            hasClicked: !1,
            hasTouchedAllFields: !1,
            hasTouchedPrice: !1,
            hasTouchedShares: !1,
            mergeDialogOpen: !1,
            orderError: void 0,
            orderExpiration: void 0,
            orderType: R.OrderType.Market,
            price: "",
            priceFieldKey: "",
            priceUpdateLocation: "type",
            amountUpdateLocation: "type",
            priceUsdc: 0 n,
            selectedOutcome: null,
            selectedOutcomeIdx: 0,
            setCursorActive: () => {},
            setDefaultOrderType: () => {},
            setHasClicked: () => {},
            setHasTouchedAllFields: () => {},
            setHasTouchedPrice: () => {},
            setHasTouchedShares: () => {},
            setMergeDialogOpen: () => {},
            setOrderError: () => {},
            setOrderExpiration: () => {},
            setOrderType: () => {},
            setPrice: () => {},
            setPriceUpdateLocation: () => {},
            setAmountUpdateLocation: () => {},
            setSellAmountPrefilled: () => {},
            setPricesAfterTrade: () => {},
            setSelectedOutcomeIdx: () => {},
            setShares: () => {},
            setSide: () => {},
            setSlippageConstraintSatisfied: () => {},
            setSlippageHelperMessage: () => {},
            setShouldShowSlippageWarning: () => {},
            setSplitDialogOpen: () => {},
            shares: "",
            sharesUsdc: 0 n,
            side: i.Side.BUY,
            shouldShowSlippageWarning: !1,
            slippageConstraintSatisfied: !0,
            slippageHelperMessage: "",
            slippageTolerance: 0,
            splitDialogOpen: !1,
            disableErrorComponent: !1,
            setDisableErrorComponent: () => {}
        }),
        W = e => (0, K.useSplitContext)(Y, e);
    e.s(["TradeContextProvider", 0, ({
        forcedSelectedOutcomeIdx: e,
        forcedOrderType: t,
        forcedSide: r,
        initialShares: a,
        children: n
    }) => {
        let s = (0, P.default)(),
            {
                activeMarket: l,
                setActiveMarketFromSlug: c
            } = (0, S.useEventActiveMarketContext)(["activeMarket", "setActiveMarketFromSlug"]),
            [u, d] = (0, k.useCookieState)(G.LS_MARKET_INITIAL_OUTCOME_IDX, {
                path: "/"
            }),
            A = o.default.useRef(null),
            [h] = (0, o.useState)(() => {
                let t = 0,
                    r = !1;
                return e && (t = e), u && (t = parseInt(u, 10), r = !0), r && (A.current = setTimeout(() => d(void 0, {
                    path: "/"
                }), 1e3)), t
            }),
            [m, f] = (0, o.useState)(!1),
            [g, y] = (0, o.useState)(!1),
            [T, E] = (0, o.useState)(!1),
            [b = h, I] = (0, L.useControllableState)({
                defaultProp: h
            }),
            C = (0, o.useMemo)(() => Array.isArray(l.outcomes) && l.outcomes.length > b ? l.outcomes[b] : null, [l, b]),
            [_, K] = (0, k.useCookieState)(G.COOKIE_DEFAULT_ORDER_TYPE, {
                path: "/"
            }),
            [W, q] = (0, o.useState)(!1),
            V = (0, o.useMemo)(() => (0, F.matchesShortDurationUpDown)(l ? .slug), [l ? .slug]),
            [z] = (0, k.useCookieState)(G.COOKIE_SLIPPAGE_TOLERANCE, {
                defaultValue: j.DEFAULT_SLIPPAGE_LIMIT.toFixed(2),
                path: "/"
            }),
            J = (0, o.useMemo)(() => {
                let e = parseFloat(z),
                    t = Number.isFinite(e) ? e : j.DEFAULT_SLIPPAGE_LIMIT;
                return V ? Math.max(t, j.CRYPTO_SHORT_DURATION_DEFAULT_SLIPPAGE_LIMIT) : t
            }, [z, V]),
            [Z, $] = (0, o.useState)(!1),
            [X, ee] = (0, v.useLocalStorageState)(G.LS_MARKET_ORDER_TYPE, {
                defaultValue: R.OrderType.Market
            }),
            et = (0, o.useCallback)(() => t || _ || ("string" == typeof X ? X : R.OrderType.Market), [_, X, t]),
            [er, ea] = (0, o.useState)(() => et()),
            [en, ei] = (0, o.useState)(!1),
            es = (0, o.useCallback)(e => {
                t || (ea(e), ei(!1), ey(!1), X !== e && ee(e))
            }, [ee, X, t]),
            eo = o.default.useRef(!0);
        (0, o.useEffect)(() => {
            if (eo.current) {
                eo.current = !1;
                return
            }
            es(et())
        }, [l ? .conditionId]);
        let [el, ec] = (0, o.useState)(() => r ? ? i.Side.BUY), eu = (0, o.useCallback)(e => {
            ec(e), ei(!1), ey(!1)
        }, []), [ed, ep] = (0, o.useState)(""), [eA, eh] = (0, o.useState)("type"), [em, ef] = (0, o.useState)("type"), [eg, ey] = (0, o.useState)(!1), eT = (0, o.useMemo)(() => (0, O.parseUnits)(ed || "0", (0, Q.getParseUnitsFromTickSize)(l.orderPriceMinTickSize)), [ed, l.orderPriceMinTickSize]), [eE, eb] = (0, o.useState)(a ? .toString() ? ? ""), eI = (0, o.useMemo)(() => {
            try {
                return (0, H.parseUSDCUnits)(eE || "0")
            } catch {
                return (0, H.parseUSDCUnits)((0, H.nDecimals)(eE, 6))
            }
        }, [eE]), [eC, eS] = (0, v.useLocalStorageState)("pm_expiration", {
            defaultValue: void 0
        }), [e_, eN] = (0, o.useState)(), [ex, ek] = (0, o.useState)(!0), [eD, ev] = (0, o.useState)(""), [ew, eO] = (0, o.useState)(), eR = (0, B.useDeepCompareMemo)(() => ew, [ew]), [eM, eL] = (0, o.useState)(!1), [eB, eP] = (0, o.useState)(!1), [eF, eU] = (0, o.useState)(!1), [eG, eH] = (0, o.useState)(""), ej = (0, o.useCallback)(e => {
            ep("string" == typeof e ? e : ""), eH((0, w.uniqueId)("__price_field")), eh("click")
        }, [ep, eH, eh]);
        (0, o.useEffect)(() => {
            er === R.OrderType.Limit && eB && eM || er === R.OrderType.Market && eM ? eU(!0) : eU(!1)
        }, [eB, eM, er, eU]);
        let [eQ, eK] = (0, o.useState)(null);
        (0, o.useEffect)(() => {
            let e = new URL(window.location.href),
                t = document.cookie.split("; ").find(e => e.startsWith("pm_trade_redirect_params="));
            if (t) {
                try {
                    let r = t.substring(25);
                    new URLSearchParams(decodeURIComponent(r)).forEach((t, r) => {
                        "slug" === r || e.searchParams.has(r) || e.searchParams.set(r, t)
                    })
                } catch {}
                document.cookie = "pm_trade_redirect_params=; max-age=0; path=/"
            }
            if (!Array.from(e.searchParams.keys()).length) return;
            let r = e.searchParams.has("side") || e.searchParams.has("price") || e.searchParams.has("shares") || e.searchParams.has("orderType"),
                a = e.searchParams.has("conditionId"),
                n = (0, M.handleTradeParamsFromQuery)({
                    url: e,
                    setSide: eu,
                    setSelectedOutcomeIdx: I,
                    setShares: eb,
                    setPrice: ep,
                    setPriceUpdateLocation: eh,
                    setAmountUpdateLocation: ef,
                    setOrderExpiration: eS,
                    setActiveMarketFromSlug: c,
                    setOrderType: es,
                    setMarketForMobile: eK,
                    precision: (0, Q.getPrecisionFromTickSize)(l.orderPriceMinTickSize)
                });
            r && !a && eK(l.conditionId), window.history.replaceState(window.history.state, "", n.toString())
        }, []), (0, o.useEffect)(() => {
            s && !(0, U.isNarrowViewport)() && $(!0)
        }, [s]), (0, o.useEffect)(() => {
            void 0 === a || eM || eb(a.toString())
        }, [a]), (0, o.useEffect)(() => () => {
            A.current && clearTimeout(A.current)
        }, []);
        let eY = (0, p.useBoundBookStore)(),
            eW = (0, D.useLatest)(ed),
            eq = (0, D.useLatest)(er),
            eV = (0, o.useCallback)(e => {
                let t = eW.current;
                if (t) {
                    if (.01 === e && 3 === t.length) {
                        let e = t.slice(0, -1),
                            r = parseFloat(e);
                        r >= 1 && r <= 99 || (e = ""), ep(e), eh("click")
                    } else if (.001 === e && 2 === t.length) {
                        let e = `${t}0`,
                            r = parseFloat(e);
                        r >= 1 && r <= 999 || (e = ""), ep(e), eh("click")
                    }
                }
            }, [ep, eh]);
        o.default.useEffect(() => {
            let e = (0, x.getAssetId)(l);
            return eY.subscribe((t, r) => {
                let a = t.byAsset[e] ? .tickSizes ? .market,
                    n = r.byAsset[e] ? .tickSizes ? .market,
                    i = a && n && a < n,
                    s = eq.current === R.OrderType.Limit;
                i && s && eV(a)
            })
        }, [l.slug]);
        let ez = (0, o.useMemo)(() => ({
            amountUpdateLocation: em,
            cursorActive: Z,
            defaultOrderType: _,
            handleResetPriceState: ej,
            hasClicked: en,
            isSellAmountPrefilled: eg,
            hasTouchedAllFields: eF,
            hasTouchedPrice: eB,
            hasTouchedShares: eM,
            orderError: eR,
            orderExpiration: eC,
            orderType: er,
            price: ed,
            priceFieldKey: eG,
            priceUpdateLocation: eA,
            priceUsdc: eT,
            pricesAfterTrade: e_,
            selectedOutcome: C,
            selectedOutcomeIdx: b,
            setAmountUpdateLocation: ef,
            setCursorActive: $,
            setDefaultOrderType: K,
            setSellAmountPrefilled: ey,
            setHasClicked: ei,
            setHasTouchedAllFields: eU,
            setHasTouchedPrice: eP,
            setHasTouchedShares: eL,
            setOrderError: eO,
            setOrderExpiration: eS,
            setOrderType: es,
            setPrice: ep,
            setPriceUpdateLocation: eh,
            setPricesAfterTrade: eN,
            setSelectedOutcomeIdx: I,
            setShares: eb,
            setSide: eu,
            setShouldShowSlippageWarning: q,
            setSlippageConstraintSatisfied: ek,
            setSlippageHelperMessage: ev,
            shares: eE,
            sharesUsdc: eI,
            side: el,
            shouldShowSlippageWarning: W,
            slippageConstraintSatisfied: ex,
            slippageHelperMessage: eD,
            slippageTolerance: J,
            mergeDialogOpen: m,
            setMergeDialogOpen: f,
            splitDialogOpen: g,
            setSplitDialogOpen: y,
            marketForMobile: eQ,
            setMarketForMobile: eK,
            disableErrorComponent: T,
            setDisableErrorComponent: E
        }), [eQ, eK, em, Z, _, ej, en, eg, eF, eB, eM, eR, eC, er, ed, eG, eA, eT, e_, C, b, ef, $, K, ey, ei, eU, eP, eL, eO, eS, es, ep, eh, I, eb, eu, ek, ev, q, eE, eI, el, W, ex, eD, J, m, f, g, y, T, E]);
        return (0, N.jsx)(Y.Provider, {
            values: ez,
            children: n
        })
    }, "useTradeContext", 0, W, "useTradeContextValue", 0, () => (0, K.useSplitContextValue)(Y)], 880809);
    var q = e.i(668122),
        V = e.i(119332),
        z = e.i(999061),
        J = e.i(635868);

    function Z() {
        let e, t, r, a, n = (0, z.c)(10);
        n[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["market"], n[0] = e) : e = n[0];
        let {
            market: i
        } = (0, J.useBookContext)(e), s = (0, d.useLastTradedPrice)(i, 0), o = (0, d.useLastTradedPrice)(i, 1);
        return n[1] !== s.price || n[2] !== s.side ? (t = {
            price: s.price,
            side: s.side
        }, n[1] = s.price, n[2] = s.side, n[3] = t) : t = n[3], n[4] !== o.price || n[5] !== o.side ? (r = {
            price: o.price,
            side: o.side
        }, n[4] = o.price, n[5] = o.side, n[6] = r) : r = n[6], n[7] !== t || n[8] !== r ? (a = {
            zeroLastPrice: t,
            oneLastPrice: r
        }, n[7] = t, n[8] = r, n[9] = a) : a = n[9], a
    }
    e.s(["useLastExecutedTrade", 0, Z], 273587);
    var $ = e.i(502475),
        X = e.i(527084);
    e.s(["TransactionStoreContextProvider", () => e$, "useTransactionStore", () => eX], 921807);
    var ee = e.i(157815);

    function et(e, t = {}) {
        let r = function(e, t = {}) {
            try {
                return e.getClient(t)
            } catch {
                return
            }
        }(e, t);
        return r ? .extend(ee.publicActions)
    }
    var er = e.i(337439),
        ea = e.i(912504),
        en = e.i(144333),
        ei = e.i(866674),
        es = e.i(5146),
        eo = e.i(600326),
        el = e.i(53950);
    let ec = (e, t, r = 6) => {
            if (0 n === t) return 0;
            let a = 10 n ** BigInt(r);
            return Number(e * a / t) / Number(a)
        },
        eu = (e, t, r = 6) => {
            let a = 10 n ** BigInt(r);
            return e * BigInt(Math.round(t * Number(a))) / a
        };
    e.s(["calcPrice", 0, e => {
        if (2 !== e.length) return [0, 0];
        let [t, r] = e, a = t + r;
        return 0 n === a ? [.5, .5] : [ec(r, a), ec(t, a)]
    }, "divBigInt", 0, ec, "mulBigInt", 0, eu], 378876);
    let ed = e => {
            let {
                outcomeTokenPrices: t,
                conditions: r
            } = e.market || {}, a = r && r[0] && r[0].payouts;
            return parseFloat(a ? a[parseInt(e.outcomeIndex, 10)] : t[parseInt(e.outcomeIndex, 10)])
        },
        ep = e => {
            try {
                return eu(BigInt(e.netQuantity), ed(e))
            } catch {
                return 0 n
            }
        },
        eA = e => {
            try {
                return ec(BigInt(e.valueBought), BigInt(e.quantityBought))
            } catch {
                return 0
            }
        },
        eh = e => {
            try {
                return eu(BigInt(e.netQuantity), eA(e))
            } catch {
                return 0 n
            }
        },
        em = e => ep(e) - eh(e);
    e.s(["getAveragePricePerShare", 0, eA, "getCurrentProfit", 0, em, "getCurrentSharePrice", 0, ed, "getCurrentValueOfPosition", 0, ep, "getProfitPercent", 0, (e, t = !1) => {
        let r = t ? (e => {
            try {
                return ec(BigInt(e.totalValueBought), BigInt(e.totalQuantityBought))
            } catch {
                return 0
            }
        })(e) : eA(e);
        return 0 === r && (r = .01), 100 * ((ed(e) - r) / r)
    }, "getTotalProfit", 0, e => em(e) + BigInt(e.realizedProfit || "0"), "getValuePaidForShares", 0, eh], 450091);
    let ef = (e, t) => t.some(t => {
            if (t.type === eo.TxnType.AMM || t.type === eo.TxnType.CTF) {
                let r = t.metadata;
                switch (r.ctfTxnType) {
                    case eo.CTFTxnType.Redeem:
                    case eo.CTFTxnType.Split:
                    case eo.CTFTxnType.Merge:
                    case eo.CTFTxnType.RemoveLiquidity:
                        return !0;
                    case eo.CTFTxnType.Sell:
                    case eo.CTFTxnType.Buy:
                        return r.outcomeIndex === e;
                    case eo.CTFTxnType.AddLiquidity:
                    default:
                        return !1
                }
            }
            return t.metadata.outcomeIndex === e
        }),
        eg = (e, t) => e.reduce((e, r) => {
            let a = t.filter(e => e.conditionId.toLowerCase() === r.market.id.toLowerCase() && (e.type !== eo.TxnType.CLOB && (e.type !== eo.TxnType.AMM || e.metadata.ctfTxnType !== eo.CTFTxnType.Buy && e.metadata.ctfTxnType !== eo.CTFTxnType.Sell) || e.metadata.outcomeIndex === parseInt(r.outcomeIndex, 10)));
            if (a.length) {
                let n = ((e, t) => {
                    let r, a, n, s, o, l, c, u, d, p, A, h, m, f, g, y, T, E, b, I, C, {
                            quantityBought: S,
                            netQuantity: _,
                            totalQuantityBought: N
                        } = (r = parseInt(e.outcomeIndex, 10), a = e.trackedPositionMetadata ? e.trackedPositionMetadata.quantityBought.current : parseFloat((0, H.formatUSDCUnits)(BigInt(e.quantityBought))), n = e.trackedPositionMetadata ? e.trackedPositionMetadata.totalQuantityBought.current : parseFloat((0, H.formatUSDCUnits)(BigInt(e.totalQuantityBought))), s = t.reduce((e, t) => e + t.metadata.positionChangeData.shareQty[r], 0), o = !1, l = t.reduce((e, t) => {
                            if (t.type === eo.TxnType.AMM || t.type === eo.TxnType.CTF) {
                                let a = t.metadata;
                                a.ctfTxnType === eo.CTFTxnType.Redeem ? o = !0 : (a.ctfTxnType === eo.CTFTxnType.Buy && t.metadata.outcomeIndex === r || a.ctfTxnType === eo.CTFTxnType.Split) && (e[0] += a.positionChangeData.shareQty[r]), e[1] += a.positionChangeData.shareQty[r]
                            } else {
                                let a = t.metadata;
                                a.side === i.Side.BUY && t.metadata.outcomeIndex === r && (e[0] += a.positionChangeData.shareQty[r]), e[1] += a.positionChangeData.shareQty[r]
                            }
                            return e
                        }, [0, 0]), c = e.trackedPositionMetadata ? e.trackedPositionMetadata.netQuantity.current : parseFloat((0, H.formatUSDCUnits)(BigInt(e.netQuantity))), u = o ? -c : l[1], el.logger.debug("[computeTrackedQuantities]", {
                            marketPosition: e,
                            positionChangeData: t.map(e => e.metadata.positionChangeData),
                            outcomeIndex: r,
                            currentQuantityBought: a,
                            pendingShareQuantities: s,
                            coerceNetQuantityToZero: o,
                            pendingQuantities: l,
                            currentNetQuantity: c,
                            pendingNetQuantity: u
                        }), {
                            quantityBought: {
                                current: a,
                                pending: l[0],
                                optimistic: a + l[0]
                            },
                            totalQuantityBought: {
                                current: n,
                                pending: l[0],
                                optimistic: n + l[0]
                            },
                            netQuantity: {
                                current: c,
                                pending: u,
                                optimistic: c + u
                            }
                        }),
                        {
                            valueBought: x,
                            netValue: k,
                            totalValueBought: D,
                            realizedProfit: v
                        } = (d = t.reduce((e, t) => e = e || t.type === eo.TxnType.CTF && t.metadata.ctfTxnType === eo.CTFTxnType.Redeem, !1), p = ed(e), A = _.current * p, h = d ? -A : _.pending * p, f = "number" == typeof(m = e.trackedPositionMetadata ? .valueBought ? .current) && Number.isFinite(m) ? m : parseFloat((0, H.formatUSDCUnits)(BigInt(e.valueBought))), g = parseInt(e.outcomeIndex, 10), y = t.reduce((e, t) => {
                            if (t.type === eo.TxnType.AMM || t.type === eo.TxnType.CTF) {
                                let r = t.metadata;
                                if (r.ctfTxnType === eo.CTFTxnType.Buy && t.metadata.outcomeIndex === g || r.ctfTxnType === eo.CTFTxnType.Split) {
                                    let r = t.metadata.positionChangeData.shareValue[g];
                                    return e + ("number" == typeof r && Number.isFinite(r) ? Math.abs(r) : 0)
                                }
                                return e
                            }
                            if (t.metadata.side === i.Side.BUY && t.metadata.outcomeIndex === g) {
                                let r = t.metadata.positionChangeData.shareValue[g];
                                return e + ("number" == typeof r && Number.isFinite(r) ? Math.abs(r) : 0)
                            }
                            return e
                        }, 0), E = "number" == typeof(T = e.trackedPositionMetadata ? .totalValueBought ? .current) && Number.isFinite(T) ? T : parseFloat((0, H.formatUSDCUnits)(BigInt(e.totalValueBought))), I = "number" == typeof(b = e.trackedPositionMetadata ? .realizedProfit ? .current) && Number.isFinite(b) ? b : parseFloat((0, H.formatUSDCUnits)(BigInt(e.realizedProfit))), C = _.pending < 0 ? Math.abs(h) - Math.abs(_.pending) * eA(e) : 0, el.logger.debug("[computeTrackedValues]", {
                            marketPosition: e,
                            pendingTransactions: t,
                            coerceNetValueToZero: d,
                            currentSharePrice: p,
                            currentNetValue: A,
                            pendingNetValue: h,
                            currentValueBought: f,
                            pendingValueBought: y,
                            quantityBought: S,
                            netQuantity: _,
                            currentTotalValueBought: E,
                            currentRealizedProfit: I,
                            pendingRealizedProfit: C
                        }), {
                            valueBought: {
                                current: f,
                                pending: y,
                                optimistic: f + y
                            },
                            netValue: {
                                current: A,
                                pending: h,
                                optimistic: A + h
                            },
                            totalValueBought: {
                                current: E,
                                pending: y,
                                optimistic: E + y
                            },
                            realizedProfit: {
                                current: I,
                                pending: C,
                                optimistic: I + C
                            }
                        }),
                        w = { ...e,
                            isPending: ef(parseInt(e.outcomeIndex, 10), t),
                            trackedPositionMetadata: {
                                quantityBought: S,
                                netQuantity: _,
                                totalQuantityBought: N,
                                valueBought: x,
                                netValue: k,
                                totalValueBought: D,
                                realizedProfit: v
                            }
                        };
                    return el.logger.debug("[updateTrackedPositionFromTransactions]", {
                        position: w,
                        quantityBought: S,
                        totalQuantityBought: N,
                        netQuantity: _,
                        valueBought: x,
                        netValue: k,
                        totalValueBought: D,
                        realizedProfit: v
                    }), w
                })(r, a);
                el.logger.debug("[updateTrackedPositionsFromTransactions]", {
                    marketPositionBefore: r,
                    marketPositionAfter: n,
                    pendingTransactionsBeforeFilter: t,
                    pendingTransactionsAfterFilter: a
                }), e.push(n)
            }
            return e
        }, []),
        ey = (e, t, r) => e ? .find(e => e.market.id.toLowerCase() === t.toLowerCase() && parseInt(e.outcomeIndex, 10) === r),
        eT = e => (0, H.parseUSDCUnits)(e.toString()).toString(),
        eE = (e, t, r) => {
            let a = e.metadata.positionChangeData.shareQty[t],
                n = Math.abs(e.metadata.positionChangeData.shareValue[t]),
                i = {
                    market: r ? { ...r,
                        id: e.conditionId.toLowerCase(),
                        outcomeTokenPrices: r ? .outcomePrices ? ? ["0", "0"],
                        conditions: [{
                            payouts: r ? .closed ? r.outcomePrices : null
                        }],
                        negRisk: r ? .negRisk ? ? !1,
                        closed: r ? .closed ? ? !1
                    } : {
                        id: e.conditionId.toLowerCase(),
                        outcomeTokenPrices: ["0", "0"],
                        conditions: [{
                            payouts: null
                        }],
                        negRisk: !1,
                        closed: !1
                    },
                    outcomeIndex: t.toString(),
                    quantityBought: eT(a),
                    netQuantity: eT(a),
                    valueBought: eT(n),
                    netValue: eT(n),
                    totalQuantityBought: eT(a),
                    totalValueBought: eT(n),
                    realizedProfit: "0",
                    isPending: !0,
                    pendingSince: Date.now(),
                    trackedPositionMetadata: {
                        quantityBought: {
                            current: 0,
                            pending: a,
                            optimistic: a
                        },
                        netQuantity: {
                            current: 0,
                            pending: a,
                            optimistic: a
                        },
                        valueBought: {
                            current: 0,
                            pending: n,
                            optimistic: n
                        },
                        netValue: {
                            current: 0,
                            pending: n,
                            optimistic: n
                        },
                        realizedProfit: {
                            current: 0,
                            pending: 0,
                            optimistic: 0
                        },
                        totalQuantityBought: {
                            current: 0,
                            pending: a,
                            optimistic: a
                        },
                        totalValueBought: {
                            current: 0,
                            pending: n,
                            optimistic: n
                        }
                    }
                };
            return el.logger.debug("[assembleUntrackedPositionByIndex]", {
                result: i,
                transaction: e,
                outcomeIndex: t,
                partialMarket: r
            }), i
        },
        eb = (e, t, r) => e.reduce((e, a) => {
            let n = ey(t, a.conditionId, 0),
                s = ey(t, a.conditionId, 1);
            return (a.type === eo.TxnType.CLOB && a.metadata.side === i.Side.BUY || a.type === eo.TxnType.AMM && a.metadata.ctfTxnType === eo.CTFTxnType.Buy) && (0 !== a.metadata.outcomeIndex || n || e.push(eE(a, 0, r ? .find(e => e.conditionId.toLowerCase() === a.conditionId.toLowerCase()))), 1 !== a.metadata.outcomeIndex || s || e.push(eE(a, 1, r ? .find(e => e.conditionId.toLowerCase() === a.conditionId.toLowerCase())))), (a.type === eo.TxnType.CTF && a.metadata.ctfTxnType === eo.CTFTxnType.Split || a.type === eo.TxnType.AMM && a.metadata.ctfTxnType === eo.CTFTxnType.RemoveLiquidity) && (n || e.push(eE(a, 0, r ? .find(e => e.conditionId.toLowerCase() === a.conditionId.toLowerCase()))), s || e.push(eE(a, 1, r ? .find(e => e.conditionId.toLowerCase() === a.conditionId.toLowerCase())))), e
        }, []),
        eI = (e, t, r, a) => {
            let n = e ? e.trackedPositionMetadata ? .quantityBought.optimistic || parseFloat((0, H.formatUSDCUnits)(BigInt(e.quantityBought))) : 0,
                i = e ? e.trackedPositionMetadata ? .valueBought.optimistic || parseFloat((0, H.formatUSDCUnits)(BigInt(e.valueBought))) : 0,
                s = t[a],
                o = s * r[a],
                l = e ? e.trackedPositionMetadata ? .totalQuantityBought.optimistic || parseFloat((0, H.formatUSDCUnits)(BigInt(e.totalQuantityBought))) : 0,
                c = e ? e.trackedPositionMetadata ? .totalValueBought.optimistic || parseFloat((0, H.formatUSDCUnits)(BigInt(e.totalValueBought))) : 0,
                u = e ? e.trackedPositionMetadata ? .realizedProfit.optimistic || parseFloat((0, H.formatUSDCUnits)(BigInt(e.realizedProfit))) : 0;
            return el.logger.debug("[getUpdatedCurrentPositionValues]", {
                position: e,
                newShareBalances: t,
                lastOutcomePrices: r,
                outcomeIndex: a,
                newCurrentQuantityBought: n,
                newCurrentValueBought: i,
                newCurrentNetQuantity: s,
                newCurrentNetValue: o,
                newCurrentTotalQuantityBought: l,
                newCurrentTotalValueBought: c,
                newCurrentRealizedProfit: u
            }), {
                newCurrentQuantityBought: Math.max(n, 0),
                newCurrentNetQuantity: Math.max(s, 0),
                newCurrentValueBought: Math.max(i, 0),
                newCurrentNetValue: Math.max(o, 0),
                newCurrentTotalQuantityBought: Math.max(l, 0),
                newCurrentTotalValueBought: Math.max(c, 0),
                newCurrentRealizedProfit: u
            }
        };
    var eC = e.i(660006),
        eS = e.i(502980),
        e_ = e.i(510954),
        eN = e.i(57096);
    class ex {
        queryClient;
        constructor(e) {
            this.queryClient = e
        }
        setQueryClient(e) {
            this.queryClient = e
        }
        getCachedPartialMarkets(e) {
            return (0, $.getOptimisticPositions)({
                queryClient: this.queryClient,
                proxyAddress: e,
                select: (0, $.getPartialPositionMarketSelector)()
            })
        }
        getCachedPartialMarket(e, t, r) {
            let a;
            t ? a = {
                conditionId: t
            } : r && (a = {
                tokenId: r
            });
            let n = (0, $.getOptimisticPositions)({
                queryClient: this.queryClient,
                proxyAddress: e,
                select: (0, $.getPartialPositionMarketSelector)(a)
            });
            return n && n.length ? n[0] : void 0
        }
        getCachedPositions(e, t) {
            return (0, $.getOptimisticPositions)({
                queryClient: this.queryClient,
                proxyAddress: e,
                select: (0, $.getTrackedMarketPositionsSelector)(t)
            })
        }
        getCachedPosition(e, t, r) {
            return (0, $.getOptimisticPositions)({
                queryClient: this.queryClient,
                proxyAddress: e,
                select: (0, $.getTrackedMarketPositionSelector)(t, r.toString())
            })
        }
        updateCachedPositions(e, t, r, a) {
            (0, $.updateOptimisticPositions)({
                queryClient: this.queryClient,
                positions: t,
                proxyAddress: e,
                source: r,
                transactionMeta: a
            })
        }
        getCachedUsdcBalance(e, t) {
            let r = this.queryClient.getQueryData(e_.queryKeys[eN.QueryKey.TokenBalance].token(e, (0, es.getChainSpecificUsdcAddress)(t), t).queryKey);
            return el.logger.debug("[TransactionCacheManager > getCachedUsdcBalance]", {
                cachedUsdcBalance: r,
                proxyAddress: e
            }), r
        }
        setCachedUsdcBalance(e, t, r) {
            var a;
            el.logger.debug("[TransactionCacheManager > setCachedUsdcBalance]", {
                trackedUsdcBalance: r,
                proxyAddress: e
            });
            let n = e_.queryKeys[eN.QueryKey.TokenBalance].token(e, (0, es.getChainSpecificUsdcAddress)(t), t).queryKey;
            a = this.queryClient.getQueryData(n), (a || r) && (!a || !r || a.current !== r.current || a.pending !== r.pending) && this.queryClient.setQueryData(n, r)
        }
        getCachedPendingTxnCount(e, t) {
            let r = this.queryClient.getQueryData(e_.queryKeys[eN.QueryKey.PendingTransactions].count(e, t).queryKey);
            return el.logger.debug("[TransactionCacheManager > getCachedPendingTxnCount]", {
                cachedPendingTxnCount: r,
                proxyAddress: e
            }), r || 0
        }
        setCachedPendingTxnCount(e, t, r) {
            el.logger.debug("[TransactionCacheManager > setCachedPendingTxnCount]", {
                pendingTxnCount: r,
                proxyAddress: e
            });
            let a = e_.queryKeys[eN.QueryKey.PendingTransactions].count(e, t).queryKey;
            this.queryClient.getQueryData(a) !== r && this.queryClient.setQueryData(a, r)
        }
        getCachedTransactions(e, t) {
            let r = this.queryClient.getQueryData(e_.queryKeys[eN.QueryKey.Transactions].txns(e, t).queryKey);
            return el.logger.debug("[TransactionCacheManager > getCachedTransactions]", {
                cachedTransactions: r,
                proxyAddress: e
            }), r
        }
        setCachedTransactions(e, t, r) {
            el.logger.debug("[TransactionCacheManager > setCachedTransactions]", {
                transactions: r,
                proxyAddress: e
            });
            let a = e_.queryKeys[eN.QueryKey.Transactions].txns(e, t).queryKey;
            ((e, t) => {
                if (!e && !t) return !0;
                if (!e || !t || e.locked !== t.locked) return !1;
                let r = e.txns ? ? [],
                    a = t.txns ? ? [];
                return r === a || r.length === a.length && r.every((e, t) => e === a[t])
            })(this.queryClient.getQueryData(a), r) || this.queryClient.setQueryData(a, r)
        }
        getLastPrices(e, t, r, a = !1) {
            let n;
            if (r && (a || !t.metadata.zeroLastPrice || !t.metadata.oneLastPrice) && (n = r), !n && t.metadata.zeroLastPrice && t.metadata.oneLastPrice && (n = [parseFloat(t.metadata.zeroLastPrice), parseFloat(t.metadata.oneLastPrice)]), !n) {
                let r = this.getCachedPartialMarket(e, t.conditionId);
                return r ? r.outcomePrices.map(e => parseFloat(e)) : [0, 0]
            }
            return el.logger.debug("[TransactionCacheManager > getLastPrices]", {
                proxyAddress: e,
                transaction: t,
                lastPrices: n,
                injectedPrices: r
            }), n ? ? [0, 0]
        }
        afterTrade(e, t, r, a, n, i) {
            let s, o = [],
                l = [],
                c = n.some(e => e.type === eo.TxnType.CTF && e.metadata.ctfTxnType === eo.CTFTxnType.Redeem);
            if (n.length) {
                let r = this.getCachedPositions(e, n[0].conditionId),
                    i = r ? .filter(e => ef(parseInt(e.outcomeIndex, 10), n)).sort((e, t) => parseInt(e.outcomeIndex, 10) - parseInt(t.outcomeIndex, 10)),
                    s = r ? .length ? r[0].market.outcomeTokenPrices.map(e => parseFloat(e)) : void 0,
                    c = this.getLastPrices(e, n[0], s, !0);
                if (i)
                    for (let e of i) {
                        let t = parseInt(e.outcomeIndex, 10),
                            {
                                newCurrentQuantityBought: r,
                                newCurrentNetQuantity: n,
                                newCurrentValueBought: i,
                                newCurrentNetValue: s,
                                newCurrentTotalValueBought: l,
                                newCurrentTotalQuantityBought: u,
                                newCurrentRealizedProfit: d
                            } = eI(e, a, c, t);
                        o.push({ ...e,
                            isPending: !1,
                            trackedPositionMetadata: {
                                quantityBought: {
                                    current: r,
                                    pending: 0,
                                    optimistic: r
                                },
                                netQuantity: {
                                    current: n,
                                    pending: 0,
                                    optimistic: n
                                },
                                valueBought: {
                                    current: i,
                                    pending: 0,
                                    optimistic: i
                                },
                                netValue: {
                                    current: s,
                                    pending: 0,
                                    optimistic: s
                                },
                                realizedProfit: {
                                    current: d,
                                    pending: 0,
                                    optimistic: d
                                },
                                totalQuantityBought: {
                                    current: u,
                                    pending: 0,
                                    optimistic: u
                                },
                                totalValueBought: {
                                    current: l,
                                    pending: 0,
                                    optimistic: l
                                }
                            }
                        })
                    }
                let u = n[0].conditionId.toLowerCase(),
                    d = new Set(n.map(e => e.txId)),
                    p = (this.getCachedTransactions(e, t) ? .txns ? ? []).filter(e => (0, eS.isTxnPending)(e) && e.conditionId.toLowerCase() === u && !d.has(e.txId)),
                    A = new Map(o.map(e => [`${e.market.id.toLowerCase()}:${e.outcomeIndex}`, e])),
                    h = r ? .length ? r.map(e => {
                        let t = `${e.market.id.toLowerCase()}:${e.outcomeIndex}`;
                        return A.get(t) ? ? e
                    }) : [...o],
                    m = new Set(h.map(e => `${e.market.id.toLowerCase()}:${e.outcomeIndex}`));
                if (o.forEach(e => {
                        let t = `${e.market.id.toLowerCase()}:${e.outcomeIndex}`;
                        m.has(t) || h.push(e)
                    }), p.length) {
                    let e = new Map(eg(h, p).map(e => [`${e.market.id.toLowerCase()}:${e.outcomeIndex}`, e]));
                    l = h.map(t => {
                        let r = `${t.market.id.toLowerCase()}:${t.outcomeIndex}`;
                        return e.get(r) ? ? t
                    })
                } else l = h
            } else l = o;
            if (i ? .length) {
                let r = this.getCachedUsdcBalance(e, t),
                    a = n.reduce((e, t) => e + t.metadata.positionChangeData.value, 0),
                    i = Math.max((r ? .current || 0) + a, 0),
                    o = (r ? .pending || 0) - a,
                    l = Math.abs(o) > Math.abs(i) ? -i : o;
                s = {
                    current: i,
                    pending: l
                }
            } else s = {
                current: r,
                pending: 0
            };
            el.logger.debug("[TransactionCacheManager > afterTrade]", {
                pendingTxns: i,
                newTrackedBalance: s,
                newUsdcBalance: r,
                finalTrackedPositions: l,
                proxyAddress: e
            }), this.setCachedUsdcBalance(e, t, s), l.length && this.updateCachedPositions(e, l, "TransactionCacheManager.afterTrade"), i ? .length || (this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.LimitOrderHistory]._def
            }), this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.MarketOrderHistory]._def
            }), this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.TradeHistory]._def
            }), this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.OpenOrders]._def
            }), this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.Subgraph].data._def
            }), this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.Subgraph].prices._def
            }), this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.Positions].liquidity._def
            }), this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.Positions].value(e).queryKey
            })), c && (el.logger.info("[TransactionCacheManager > afterTrade > redeem invalidation]", {
                proxyAddress: e,
                chainId: t,
                conditionId: n[0] ? .conditionId,
                completedTxIds: n.map(e => e.txId),
                pendingTxnsCount: i ? .length ? ? 0
            }), this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.Positions].portfolio._def
            }), this.queryClient.invalidateQueries({
                queryKey: e_.queryKeys[eN.QueryKey.Positions].redeemable._def
            }))
        }
    }
    class ek {
        partitionedTransactionMap;
        lockMap;
        constructor() {
            this.partitionedTransactionMap = new Map, this.lockMap = new Map
        }
        getPartitionedMap(e) {
            return this.partitionedTransactionMap.has(e) && void 0 !== this.partitionedTransactionMap.get(e) || this.partitionedTransactionMap.set(e, new Map), this.partitionedTransactionMap.get(e)
        }
        addPromise(e, t, r) {
            this.partitionedTransactionMap.has(e) || this.partitionedTransactionMap.set(e, new Map);
            let a = this.partitionedTransactionMap.get(e);
            el.logger.debug("[TransactionPromiseTracker > addPromise]", {
                conditionId: e,
                innerPromiseMap: a,
                txnHash: t
            }), a.has(t) || a.set(t, r)
        }
        removePromise(e, t) {
            let r = this.partitionedTransactionMap.get(e);
            el.logger.debug("[TransactionPromiseTracker > removePromise]", {
                conditionId: e,
                innerPromiseMap: r,
                txnHash: t
            }), !r || r.has(t) && (r.delete(t), 0 === r.size && this.partitionedTransactionMap.delete(e))
        }
        isLocked(e) {
            return this.lockMap.get(e) || !1
        }
        lock(e) {
            let t = this.lockMap.has(e);
            t || this.lockMap.set(e, !0), el.logger.debug("[TransactionPromiseTracker > lock]", {
                isLocked: t,
                conditionId: e,
                lockMap: this.lockMap
            })
        }
        unlock(e) {
            this.lockMap.delete(e)
        }
        async waitForPromises(e, t, r, a) {
            let n = this.partitionedTransactionMap.get(r);
            if (el.logger.debug("[TransactionPromiseTracker > waitForPromises]", {
                    proxyAddress: e,
                    chainId: t,
                    conditionId: r,
                    afterTransactions: a,
                    marketMakerSpecificPromiseMap: n
                }), !n || this.isLocked(r)) return;
            this.lock(r);
            let i = [];
            do {
                let e = Array.from(n.entries()),
                    t = await Promise.all(e.map(([e, t]) => t));
                for (let [r] of (i = i.concat(t), e)) n.delete(r)
            } while (n.size > 0) el.logger.debug("[TransactionPromiseTracker > waitForPromises]", {
                conditionId: r,
                marketMakerSpecificPromiseMap: n,
                results: i
            }), a && await a(e, t, r, i), this.partitionedTransactionMap.delete(r), this.unlock(r)
        }
    }

    function eD(e) {
        return { ...e,
            isPending: !1,
            pendingSince: void 0,
            ...e.trackedPositionMetadata && {
                trackedPositionMetadata: {
                    netQuantity: {
                        current: e.trackedPositionMetadata.netQuantity.current,
                        pending: 0,
                        optimistic: e.trackedPositionMetadata.netQuantity.current
                    },
                    quantityBought: {
                        current: e.trackedPositionMetadata.quantityBought.current,
                        pending: 0,
                        optimistic: e.trackedPositionMetadata.quantityBought.current
                    },
                    netValue: {
                        current: e.trackedPositionMetadata.netValue.current,
                        pending: 0,
                        optimistic: e.trackedPositionMetadata.netValue.current
                    },
                    valueBought: {
                        current: e.trackedPositionMetadata.valueBought.current,
                        pending: 0,
                        optimistic: e.trackedPositionMetadata.valueBought.current
                    },
                    realizedProfit: {
                        current: e.trackedPositionMetadata.realizedProfit.current,
                        pending: 0,
                        optimistic: e.trackedPositionMetadata.realizedProfit.current
                    },
                    totalQuantityBought: {
                        current: e.trackedPositionMetadata.totalQuantityBought.current,
                        pending: 0,
                        optimistic: e.trackedPositionMetadata.totalQuantityBought.current
                    },
                    totalValueBought: {
                        current: e.trackedPositionMetadata.totalValueBought.current,
                        pending: 0,
                        optimistic: e.trackedPositionMetadata.totalValueBought.current
                    }
                }
            }
        }
    }
    let ev = e => {
        if (!e) return;
        let t = e.metadata,
            r = "number" == typeof t.outcomeIndex && Number.isFinite(t.outcomeIndex) ? t.outcomeIndex : void 0;
        return {
            txId: e.txId,
            tradeIds: e.tradeIds,
            type: e.type,
            status: e.status,
            orderType: t.orderType,
            side: t.side,
            chainId: t.chainId,
            enqueuedAt: "number" == typeof t.enqueuedAt && Number.isFinite(t.enqueuedAt) ? t.enqueuedAt : void 0,
            lastUpdatedAt: "number" == typeof t.lastUpdatedAt && Number.isFinite(t.lastUpdatedAt) ? t.lastUpdatedAt : void 0,
            conditionId: e.conditionId,
            outcomeIndex: r
        }
    };
    class ew {
        publicClient;
        transactionPromiseTracker;
        transactionCacheManager;
        constructor(e, t) {
            this.publicClient = e, this.transactionPromiseTracker = new ek, this.transactionCacheManager = new ex(t)
        }
        setPublicClient(e) {
            this.publicClient = e
        }
        setQueryClient(e) {
            this.transactionCacheManager.setQueryClient(e)
        }
        getTransactionCacheManager() {
            return this.transactionCacheManager
        }
        doesTransactionExist(e, t, r) {
            let a = r.toLowerCase();
            return !!this.transactionCacheManager.getCachedTransactions(e, t) ? .txns ? .find(e => e.txId.toLowerCase() === a || e.tradeIds ? .some(e => e.toLowerCase() === a))
        }
        handleFailedTransaction(e, t, r, a) {
            let n = (this.transactionCacheManager.getCachedTransactions(e, t) ? .txns ? ? []).filter(e => (0, eS.isTxnPending)(e)),
                i = 0 === n.filter(e => r.conditionId.toLowerCase() === e.conditionId.toLowerCase() && r.txId !== e.txId).length,
                s = r.type === eo.TxnType.CLOB || r.type === eo.TxnType.AMM && (r.metadata.ctfTxnType === eo.CTFTxnType.Buy || r.metadata.ctfTxnType === eo.CTFTxnType.Sell),
                o = [];
            if (i) {
                if (s) {
                    let t = this.transactionCacheManager.getCachedPosition(e, r.conditionId, r.metadata.outcomeIndex);
                    t && o.push(t)
                } else {
                    let t = this.transactionCacheManager.getCachedPositions(e, r.conditionId);
                    o.push(...t ? ? [])
                }
                let t = o.map(e => eD(e));
                this.transactionCacheManager.updateCachedPositions(e, t, "TransactionStore.handleFailedTransaction.onlyTxn", ev(r))
            } else {
                let t = this.transactionCacheManager.getCachedPositions(e, r.conditionId) ? ? [],
                    a = n.filter(e => e.conditionId.toLowerCase() === r.conditionId.toLowerCase() && e.txId !== r.txId),
                    i = t.map(e => eD(e));
                if (a.length) {
                    let t = new Map(eg(i, a).map(e => [`${e.market.id.toLowerCase()}:${e.outcomeIndex}`, e])),
                        n = i.map(e => {
                            let r = `${e.market.id.toLowerCase()}:${e.outcomeIndex}`;
                            return t.get(r) ? ? e
                        }),
                        s = eb(a, n, this.transactionCacheManager.getCachedPartialMarkets(e)),
                        o = new Set(n.map(e => `${e.market.id.toLowerCase()}:${e.outcomeIndex}`)),
                        l = [...n, ...s.filter(e => !o.has(`${e.market.id.toLowerCase()}:${e.outcomeIndex}`))];
                    this.transactionCacheManager.updateCachedPositions(e, l, "TransactionStore.handleFailedTransaction.recompute", ev(r))
                } else this.transactionCacheManager.updateCachedPositions(e, i, "TransactionStore.handleFailedTransaction.reset", ev(r))
            }
            this.setTransactionParams(e, t, r.txId, {
                status: eo.TxnStatus.FAILED
            })
        }
        parseErc20BalanceOfResult(e) {
            try {
                if ("success" === e.status && void 0 !== e.result) return parseFloat((0, l.formatUnits)(e.result, 6));
                return 0
            } catch (e) {
                return (0, eC.handleError)(e, "[TransactionStore > parseErc20BalanceOfResult] Error parsing balanceOf response"), 0
            }
        }
        parseConditionalTokensBalanceOfBatchResult(e, t) {
            try {
                if (t ? .length && "success" === e.status && void 0 !== e.result) return [parseFloat((0, l.formatUnits)(e.result[0] || 0 n, 6)), parseFloat((0, l.formatUnits)(e.result[1] || 0 n, 6))];
                return [0, 0]
            } catch (e) {
                return (0, eC.handleError)(e, "[TransactionStore > parseConditionalTokensBalanceOfBatchResult] Error parsing balanceOfBatch response"), [0, 0]
            }
        }
        async afterTransactionsMined(e, t, r, a) {
            if (el.logger.debug("[TransactionStore > afterMarketSpecificTransactions]", {
                    proxyAddress: e,
                    chainId: t,
                    conditionId: r,
                    results: a
                }), !a.length) return;
            let n = this.transactionCacheManager.getCachedPartialMarkets(e) ? .find(e => e.conditionId.toLowerCase() === r.toLowerCase()) ? .clobTokenIds ? ? [],
                {
                    latestUsdcBalance: i,
                    latestShareBalances: s
                } = await this.publicClient.multicall({
                    contracts: [{
                        address: (0, es.getChainSpecificUsdcAddress)(t),
                        abi: ei.erc20Abi,
                        functionName: "balanceOf",
                        args: [e]
                    }, {
                        address: j.CONDITIONAL_TOKENS_ADDRESS,
                        abi: A.ConditionalTokensAbi,
                        functionName: "balanceOfBatch",
                        args: [n.map(() => e), n.map(e => BigInt(e))]
                    }]
                }).then(e => ({
                    latestUsdcBalance: this.parseErc20BalanceOfResult(e[0]),
                    latestShareBalances: this.parseConditionalTokensBalanceOfBatchResult(e[1], n)
                })),
                o = (this.transactionCacheManager.getCachedTransactions(e, t) ? .txns ? ? []).filter(e => e.conditionId.toLowerCase() !== r.toLowerCase() && (0, eS.isTxnPending)(e));
            el.logger.debug("[TransactionStore > afterMarketSpecificTransactions]", {
                latestUsdcBalance: i,
                latestShareBalances: s,
                conditionId: r,
                positionIds: n,
                exclusivePendingTransactions: o,
                proxyAddress: e,
                chainId: t
            }), this.transactionCacheManager.afterTrade(e, t, i, s, a.map(e => e.transaction), o), this.updateTransactions(e, t, e => e.map(e => a.map(e => e.transaction.txId).includes(e.txId) ? { ...e,
                status: eo.TxnStatus.MINED
            } : e))
        }
        updateTransactions(e, t, r, a, n) {
            el.logger.debug("[TransactionStore > updateTransactions]", {
                proxyAddress: e,
                chainId: t
            });
            let i = 0,
                s = r(this.transactionCacheManager.getCachedTransactions(e, t) ? .txns ? ? []).filter(e => !!(0, eS.isTxnPending)(e) || i++ <= 10),
                o = (0, en.isEqual)(this.transactionCacheManager.getCachedTransactions(e, t) ? .txns ? ? [], s);
            if (el.logger.debug("[TransactionStore > updateTransactions]", {
                    proxyAddress: e,
                    chainId: t,
                    transactions: s,
                    areTxnsEqual: o
                }), !o) {
                if (s.length > 0) {
                    let r = s.filter(e => (0, eS.isTxnPending)(e)),
                        i = (0, eS.computePendingUsdcBalance)(s),
                        o = this.transactionCacheManager.getCachedUsdcBalance(e, t);
                    if (el.logger.debug("[TransactionStore > updateTransactions]", {
                            proxyAddress: e,
                            chainId: t,
                            transactions: s,
                            pendingTxns: r,
                            pendingUsdc: i,
                            currentlyCachedUsdcBalance: o
                        }), a && a.status !== eo.TxnStatus.FAILED) {
                        let s = this.transactionCacheManager.getCachedPositions(e),
                            l = [...this.transactionCacheManager.getCachedPartialMarkets(e) ? ? [], ...n ? [(0, X.convertMarketToPartialPositionMarket)(n)] : []],
                            c = eb(r, s, l),
                            u = eg(s ? ? [], r);
                        el.logger.debug("[TransactionStore > updateTransactions > variables]", {
                            pendingTxns: r,
                            pendingUsdc: i,
                            cachedPositions: s,
                            partialMarkets: l,
                            untrackedMarketPositions: c,
                            updatedTrackedPositions: u,
                            currentlyCachedUsdcBalance: o,
                            proxyAddress: e,
                            chainId: t
                        });
                        let d = ev(a);
                        this.transactionCacheManager.updateCachedPositions(e, [...c, ...u], "TransactionStore.updateTransactions", d), this.transactionCacheManager.setCachedUsdcBalance(e, t, {
                            current: o ? .current ? ? 0,
                            pending: i
                        })
                    }
                    this.transactionCacheManager.setCachedPendingTxnCount(e, t, r.length), this.transactionCacheManager.setCachedTransactions(e, t, {
                        txns: s,
                        locked: r.length > 0
                    })
                } else this.transactionCacheManager.setCachedTransactions(e, t, void 0);
                this.waitForPendingTransactions(e, t)
            }
        }
        addTransaction(e, t, r, a) {
            let n = e => {
                    if (e.type !== eo.TxnType.CLOB) return;
                    let t = e.metadata.localOrderId;
                    if ("string" == typeof t && 0 !== t.length) return t.toLowerCase()
                },
                i = n(r);
            this.updateTransactions(e, t, e => [{ ...r,
                status: r.status,
                market: a
            }, ...e.filter(e => e.txId !== r.txId && (!i || n(e) !== i))], r, a)
        }
        forceRefresh(e, t) {
            el.logger.debug("[TransactionStore > forceRefresh]", {
                proxyAddress: e,
                chainId: t
            });
            let r = Date.now();
            this.updateTransactions(e, t, e => e.map(e => ({ ...e,
                ...(0, eS.isTxnPending)(e) && r - e.metadata.enqueuedAt > 12e4 && {
                    status: eo.TxnStatus.MINED
                }
            })))
        }
        clearTransactions(e, t) {
            el.logger.debug("[TransactionStore > clearTransactions]", {
                proxyAddress: e,
                chainId: t
            }), this.updateTransactions(e, t, () => [])
        }
        removeTransaction(e, t, r, a) {
            el.logger.debug("[TransactionStore > removeTransaction]", {
                proxyAddress: e,
                chainId: t,
                txId: r,
                force: a
            }), this.updateTransactions(e, t, e => e.filter(e => r !== e.txId || !a && (0, eS.isTxnPending)(e)))
        }
        setTransactionParams(e, t, r, a, n, i) {
            el.logger.debug("[TransactionStore > setTransactionParams]", {
                proxyAddress: e,
                chainId: t,
                txId: r,
                params: a,
                newTransaction: n
            });
            let s = !1;
            if (this.updateTransactions(e, t, n => n.map(n => {
                    let o = !!i && n.tradeIds ? .some(e => e === i),
                        l = n.txId === r,
                        c = n.metadata ? .hash === r;
                    if (l || c || o) {
                        let o = { ...n,
                            ...a.status && {
                                status: a.status
                            },
                            metadata: { ...n.metadata,
                                ...a.hash && {
                                    hash: a.hash
                                },
                                lastUpdatedAt: Date.now()
                            }
                        };
                        return s = !0, el.logger.debug("[TransactionStore > setTransactionParams > tx to update]", {
                            proxyAddress: e,
                            chainId: t,
                            txId: r,
                            tradeId: i,
                            transaction: n,
                            newTx: o
                        }), o
                    }
                    return n
                }), n), !s) return
        }
        async waitForPendingTransactions(e, t) {
            el.logger.info("[TransactionStore > waitForPendingTransactions]", {
                proxyAddress: e,
                chainId: t
            });
            let r = (this.transactionCacheManager.getCachedTransactions(e, t) ? .txns ? ? []).filter(e => (0, eS.isTxnPending)(e) && !!e.metadata.hash && (!e.tradeIds || 0 === e.tradeIds.length));
            r.length && await Promise.all(r.map(async r => {
                let a = r.conditionId.toLowerCase(),
                    n = r.metadata.hash;
                if (this.transactionPromiseTracker.getPartitionedMap(r.conditionId.toLowerCase()).get(n)) {
                    let r = this.afterTransactionsMined.bind(this);
                    await this.transactionPromiseTracker.waitForPromises(e, t, a, r);
                    return
                }
                let i = async () => {
                    let a = await this.publicClient.waitForTransactionReceipt({
                        hash: n
                    }).then(a => (el.logger.info("[TransactionStore > waitForPendingTransactions]", {
                        res: a,
                        transaction: r,
                        proxyAddress: e,
                        chainId: t
                    }), {
                        res: a,
                        transaction: r,
                        proxyAddress: e,
                        chainId: t
                    })).catch(() => ({
                        res: {},
                        transaction: r,
                        proxyAddress: e,
                        chainId: t,
                        promiseFailed: !0
                    }));
                    for (let e = 0; e < 3 && (await new Promise(e => setTimeout(e, 1e4)), !(await this.publicClient.getTransactionConfirmations({
                            hash: a.res.transactionHash
                        }) >= 5)); e++);
                    return a
                };
                this.transactionPromiseTracker.addPromise(r.conditionId.toLowerCase(), n, i());
                let s = this.afterTransactionsMined.bind(this);
                await this.transactionPromiseTracker.waitForPromises(e, t, r.conditionId.toLowerCase(), s)
            }))
        }
    }
    e.s(["PositionTrackingContextProvider", () => eW, "useMarkClobNotificationsFetched", () => eJ, "useMarkOpenOrdersFetched", () => eV, "useMarkTxnNotificationsFetched", () => ez], 22026);
    var eO = e.i(193790),
        eR = e.i(209246),
        eM = e.i(601550),
        eL = e.i(964974),
        eB = e.i(195453);

    function eP(e, t) {
        return e.conditionId.localeCompare(t.conditionId)
    }

    function eF() {
        return []
    }

    function eU(e) {
        return { ...e,
            isPending: !1,
            pendingSince: void 0
        }
    }
    var eG = e.i(106371);
    let eH = (e, t, r = 1e4, a = !1) => {
            let n = (0, o.useRef)(null),
                i = (0, o.useRef)(e),
                s = (0, o.useCallback)(t, []);
            (0, o.useEffect)(() => {
                if (a) {
                    n.current && (clearTimeout(n.current), n.current = null);
                    return
                }
                return i.current = e, n.current || (n.current = setTimeout(() => {
                    s(), n.current = null
                }, r)), () => {
                    n.current && (clearTimeout(n.current), n.current = null)
                }
            }, [e, r, s, a])
        },
        ej = e => {
            let t, r, a, n, i, s = (0, z.c)(6);
            s[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], s[0] = t) : t = s[0];
            let {
                proxyAddress: o
            } = (0, I.useAccountContext)(t), l = (0, P.default)();
            s[1] === Symbol.for("react.memo_cache_sentinel") ? (r = e_.queryKeys[eN.QueryKey.MarketIdentifiers].positionIds(), s[1] = r) : r = s[1];
            let c = l && !!(e ? ? o);
            s[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                persist: !0
            }, n = [], s[2] = a, s[3] = n) : (a = s[2], n = s[3]), s[4] !== c ? (i = {
                queryKey: r.queryKey,
                queryFn: eK,
                enabled: c,
                refetchOnWindowFocus: !1,
                refetchOnReconnect: !1,
                gcTime: 864e5,
                staleTime: 864e5,
                meta: a,
                placeholderData: n
            }, s[4] = c, s[5] = i) : i = s[5];
            let {
                data: u
            } = (0, eL.useQuery)(i);
            return u
        };

    function eQ(e) {
        return e.toLowerCase()
    }

    function eK() {
        return []
    }
    e.s(["useTokenIdsForPartialMarkets", 0, ej, "useTokenIdsForPartialMarketsMutation", 0, () => {
        let e, t, r = (0, z.c)(4),
            a = (0, s.useQueryClient)();
        r[0] !== a ? (e = {
            mutationKey: e_.queryKeys[eN.QueryKey.MarketIdentifiers].positionIds._def,
            mutationFn: async e => {
                let t = [...new Set([...a.getQueryData(e_.queryKeys[eN.QueryKey.MarketIdentifiers].positionIds().queryKey) ? ? [], ...e.positionIds.map(eQ)])].sort();
                a.setQueryData(e_.queryKeys[eN.QueryKey.MarketIdentifiers].positionIds().queryKey, t)
            }
        }, r[0] = a, r[1] = e) : e = r[1];
        let {
            mutate: n
        } = (0, eM.useMutation)(e);
        return r[2] !== n ? (t = {
            mutate: n
        }, r[2] = n, r[3] = t) : t = r[3], t
    }], 494316);
    let eY = (0, o.createContext)({
            markMarketPositionsFetched: () => null,
            markOpenOrdersFetched: () => null,
            markTxnNotificationsFetched: () => null,
            markClobNotificationsFetched: () => null
        }),
        eW = e => {
            let t, r, a, n, i, l, c = (0, z.c)(7),
                {
                    children: u
                } = e,
                [d, p] = (0, o.useState)(!1),
                [A, h] = (0, o.useState)(!1),
                [m, f] = (0, o.useState)(!1),
                [g, y] = (0, o.useState)(!1);
            c[0] === Symbol.for("react.memo_cache_sentinel") ? (t = () => {
                p(!0)
            }, c[0] = t) : t = c[0];
            let T = t;
            c[1] === Symbol.for("react.memo_cache_sentinel") ? (r = () => {
                h(!0)
            }, c[1] = r) : r = c[1];
            let E = r;
            c[2] === Symbol.for("react.memo_cache_sentinel") ? (a = () => {
                f(!0)
            }, c[2] = a) : a = c[2];
            let b = a;
            c[3] === Symbol.for("react.memo_cache_sentinel") ? (n = () => {
                y(!0)
            }, c[3] = n) : n = c[3];
            let C = n;
            (() => {
                let e, t, r, a, n, i, l = (0, z.c)(15),
                    c = (0, s.useQueryClient)();
                l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated", "proxyAddress"], l[0] = e) : e = l[0];
                let {
                    authenticated: u,
                    proxyAddress: d
                } = (0, I.useAccountContext)(e), p = eX(), A = (() => {
                    let e, t = (0, z.c)(2),
                        r = eX();
                    t[0] !== r ? (e = r.getTransactionCacheManager(), t[0] = r, t[1] = e) : e = t[1];
                    let [a] = (0, o.useState)(e);
                    return a
                })(), h = (0, eO.default)(), m = (0, eR.useMutatePositionMarkets)(), {
                    mutate: f
                } = (() => {
                    let e, t, r = (0, z.c)(4),
                        a = (0, s.useQueryClient)();
                    r[0] !== a ? (e = {
                        mutationKey: e_.queryKeys[eN.QueryKey.Markets].trackedPositions._def,
                        mutationFn: async e => {
                            if (e.clear) return void a.setQueryData(e_.queryKeys[eN.QueryKey.Markets].trackedPositions().queryKey, []);
                            if (e.market) {
                                let t = a.getQueryData(e_.queryKeys[eN.QueryKey.Markets].trackedPositions().queryKey),
                                    r = (0, eB.uniqBy)([...t ? ? [], e.market], "conditionId").sort(eP);
                                a.setQueryData(e_.queryKeys[eN.QueryKey.Markets].trackedPositions().queryKey, r)
                            }
                        }
                    }, r[0] = a, r[1] = e) : e = r[1];
                    let {
                        mutate: n
                    } = (0, eM.useMutation)(e);
                    return r[2] !== n ? (t = {
                        mutate: n
                    }, r[2] = n, r[3] = t) : t = r[3], t
                })(), {
                    data: g
                } = (e => {
                    let t, r, a, n, i, s, o = (0, z.c)(8);
                    o[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], o[0] = t) : t = o[0];
                    let {
                        proxyAddress: l
                    } = (0, I.useAccountContext)(t), c = (0, P.default)();
                    o[1] === Symbol.for("react.memo_cache_sentinel") ? (r = e_.queryKeys[eN.QueryKey.Markets].trackedPositions(), o[1] = r) : r = o[1];
                    let u = c && !!(e ? ? l);
                    o[2] === Symbol.for("react.memo_cache_sentinel") ? (a = {
                        persist: !0
                    }, n = [], o[2] = a, o[3] = n) : (a = o[2], n = o[3]), o[4] !== u ? (i = {
                        queryKey: r.queryKey,
                        queryFn: eF,
                        enabled: u,
                        refetchOnWindowFocus: !1,
                        refetchOnReconnect: !1,
                        gcTime: 864e5,
                        staleTime: 864e5,
                        meta: a,
                        placeholderData: n
                    }, o[4] = u, o[5] = i) : i = o[5];
                    let {
                        data: d
                    } = (0, eL.useQuery)(i);
                    return o[6] !== d ? (s = {
                        data: d
                    }, o[6] = d, o[7] = s) : s = o[7], s
                })(), y = (0, D.useLatest)(g), [T, E] = (0, o.useState)(!1);
                l[1] !== u || l[2] !== T || l[3] !== h || l[4] !== d || l[5] !== p || l[6] !== A ? (t = () => {
                    if (T && u && d && 0 === h) {
                        let e = Date.now(),
                            t = A.getCachedPositions(d);
                        if (!Array.isArray(t)) return;
                        let r = t ? .filter(t => t.isPending && t.pendingSince && e - t.pendingSince > 18e4);
                        if (r ? .length) {
                            p.forceRefresh(d, j.MATIC_CONFIG.chainId);
                            let e = r.map(eU);
                            A.updateCachedPositions(d, e, "useTransactionSweeper.longPending")
                        }
                    }
                }, r = [T, p, A, d, u, h], l[1] = u, l[2] = T, l[3] = h, l[4] = d, l[5] = p, l[6] = A, l[7] = t, l[8] = r) : (t = l[7], r = l[8]), (0, o.useEffect)(t, r), l[9] !== m || l[10] !== f || l[11] !== c ? (a = e => {
                    e.current ? .length && (e.current.forEach(e => {
                        m({
                            market: e
                        })
                    }), f({
                        clear: !0
                    }), c.invalidateQueries({
                        queryKey: e_.queryKeys[eN.QueryKey.Positions].market._def
                    }))
                }, l[9] = m, l[10] = f, l[11] = c, l[12] = a) : a = l[12], ((e, t, r, a, n = 6e4) => {
                    let [i, s] = (0, o.useState)(null), l = (0, o.useCallback)(r, []);
                    (0, o.useEffect)(() => (i && clearTimeout(i), e === t && s(setTimeout(() => {
                        l(a)
                    }, n)), () => {
                        i && clearTimeout(i)
                    }), [e, t, l, a, n])
                })(h, 0, a, y, 6e4), l[13] === Symbol.for("react.memo_cache_sentinel") ? (n = () => {
                    setTimeout(() => E(!0), 5e3)
                }, i = [], l[13] = n, l[14] = i) : (n = l[13], i = l[14]), (0, o.useEffect)(n, i)
            })(), ((e, t, r, a) => {
                let n, i, l, c, u, d, p, A, h = (0, z.c)(24),
                    m = (0, s.useQueryClient)();
                h[0] === Symbol.for("react.memo_cache_sentinel") ? (n = ["proxyAddress", "authenticated"], h[0] = n) : n = h[0];
                let {
                    proxyAddress: f,
                    authenticated: g
                } = (0, I.useAccountContext)(n), y = (0, eG.useConditionIdsForPartialMarkets)(), T = ej(), [E, b] = (0, o.useState)(!1);
                h[1] !== y || h[2] !== T ? (i = JSON.stringify({
                    conditionIds: y ? [...new Set(y)].sort() : [],
                    tokenIds: T ? [...new Set(T)].sort() : []
                }), h[1] = y, h[2] = T, h[3] = i) : i = h[3];
                let C = i;
                h[4] !== a || h[5] !== e || h[6] !== t || h[7] !== r ? (l = JSON.stringify([e, t, r, a]), h[4] = a, h[5] = e, h[6] = t, h[7] = r, h[8] = l) : l = h[8];
                let S = l;
                h[9] !== m ? (c = () => {
                    m.invalidateQueries({
                        queryKey: e_.queryKeys[eN.QueryKey.MarketIdentifiers]._def
                    }).then(async () => {
                        await m.invalidateQueries({
                            queryKey: e_.queryKeys[eN.QueryKey.Markets].positions._def
                        })
                    })
                }, h[9] = m, h[10] = c) : c = h[10];
                let _ = c;
                eH(C, _, 1e4), eH(S, _, 2e3, E), h[11] !== a || h[12] !== e || h[13] !== t || h[14] !== r ? (u = () => {
                    e && t && r && a && b(!0)
                }, d = [e, t, r, a], h[11] = a, h[12] = e, h[13] = t, h[14] = r, h[15] = u, h[16] = d) : (u = h[15], d = h[16]), (0, o.useEffect)(u, d), h[17] !== g || h[18] !== _ || h[19] !== f ? (p = () => {
                    f && g && setTimeout(() => {
                        _(), b(!0)
                    }, 2e4)
                }, h[17] = g, h[18] = _, h[19] = f, h[20] = p) : p = h[20], h[21] !== g || h[22] !== f ? (A = [f, g], h[21] = g, h[22] = f, h[23] = A) : A = h[23], (0, o.useEffect)(p, A)
            })(d, A, m, g), c[4] === Symbol.for("react.memo_cache_sentinel") ? (i = {
                markMarketPositionsFetched: T,
                markOpenOrdersFetched: E,
                markTxnNotificationsFetched: b,
                markClobNotificationsFetched: C
            }, c[4] = i) : i = c[4];
            let S = i;
            return c[5] !== u ? (l = (0, N.jsx)(eY.Provider, {
                value: S,
                children: u
            }), c[5] = u, c[6] = l) : l = c[6], l
        },
        eq = () => (0, o.useContext)(eY),
        eV = () => eq().markOpenOrdersFetched,
        ez = () => eq().markTxnNotificationsFetched,
        eJ = () => eq().markClobNotificationsFetched,
        eZ = (0, o.createContext)(null),
        e$ = e => {
            let r, a, n, i, l, c, u, d, p = (0, z.c)(17),
                {
                    children: A
                } = e,
                h = (0, s.useQueryClient)();
            p[0] === Symbol.for("react.memo_cache_sentinel") ? (r = {
                chainId: j.MATIC_CONFIG.chainId
            }, p[0] = r) : r = p[0];
            let m = function(e = {}) {
                let t = (0, ea.useConfig)(e);
                return (0, er.useSyncExternalStoreWithSelector)(e => (function(e, t) {
                    let {
                        onChange: r
                    } = t;
                    return e.subscribe(() => et(e), r, {
                        equalityFn: (e, t) => e ? .uid === t ? .uid
                    })
                })(t, {
                    onChange: e
                }), () => et(t, e), () => et(t, e), e => e, (e, t) => e ? .uid === t ? .uid)
            }(r);
            p[1] !== m || p[2] !== h ? (a = () => {
                if (t) return t;
                let e = new ew(m, h);
                return t = e, e
            }, p[1] = m, p[2] = h, p[3] = a) : a = p[3];
            let [f] = (0, o.useState)(a);
            return p[4] !== m || p[5] !== f ? (n = () => {
                f.setPublicClient(m)
            }, i = [f, m], p[4] = m, p[5] = f, p[6] = n, p[7] = i) : (n = p[6], i = p[7]), o.default.useEffect(n, i), p[8] !== h || p[9] !== f ? (l = () => {
                f.setQueryClient(h)
            }, c = [f, h], p[8] = h, p[9] = f, p[10] = l, p[11] = c) : (l = p[10], c = p[11]), o.default.useEffect(l, c), p[12] !== A ? (u = (0, N.jsx)(eW, {
                children: A
            }), p[12] = A, p[13] = u) : u = p[13], p[14] !== f || p[15] !== u ? (d = (0, N.jsx)(eZ.Provider, {
                value: f,
                children: u
            }), p[14] = f, p[15] = u, p[16] = d) : d = p[16], d
        },
        eX = () => {
            let e = (0, o.useContext)(eZ);
            if (!e) throw Error("Transaction hooks must be used within TransactionStoreContextProvider");
            return e
        },
        e0 = e => {
            let t, r, a = (0, z.c)(6);
            a[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], a[0] = t) : t = a[0];
            let {
                proxyAddress: n
            } = (0, I.useAccountContext)(t), i = (0, s.useQueryClient)(), o = eX(), l = e ? ? j.MATIC_CONFIG.chainId;
            return a[1] !== l || a[2] !== n || a[3] !== i || a[4] !== o ? (r = async (e, t) => {
                if (!n || !l) throw Error("No address or chain ID found");
                let r = (0, X.convertMarketToPartialPositionMarket)(t);
                (0, $.seedPartialPositionMarket)({
                    queryClient: i,
                    partialPositionMarket: r,
                    proxyAddress: n
                }), o.addTransaction(n, l, e, r)
            }, a[1] = l, a[2] = n, a[3] = i, a[4] = o, a[5] = r) : r = a[5], r
        };
    e.s(["default", 0, e0], 460649);
    let e1 = () => {
        let e, t, r = (0, z.c)(4);
        r[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], r[0] = e) : e = r[0];
        let {
            activeMarket: a
        } = (0, S.useEventActiveMarketContext)(e), n = a ? .feesEnabled || !1, i = 1e3 * !!n;
        return r[1] !== n || r[2] !== i ? (t = {
            feeEnabled: n,
            feeBps: i
        }, r[1] = n, r[2] = i, r[3] = t) : t = r[3], t
    };
    e.s(["useOrderFee", 0, e1], 720756);
    var e2 = e.i(132762),
        e5 = e.i(914640);
    let e6 = eo.TxnType.NOOP,
        e3 = e5.zeroAddress,
        e4 = {
            chainId: -1,
            outcome: "",
            outcomeIndex: -1,
            quantity: 0 n,
            usdc: 0 n,
            enqueuedAt: -1,
            lastUpdatedAt: -1,
            ctfTxnType: eo.CTFTxnType.Noop,
            positionChangeData: {
                value: 0,
                shareQty: [0, 0],
                shareValue: [0, 0]
            }
        };
    class e8 {
        txn;
        constructor(e, t, r, a) {
            this.txn = {
                txId: e,
                status: t,
                type: r ? ? e6,
                metadata: a ? ? e4,
                conditionId: e3
            }
        }
        status(e) {
            return this.txn.status = e, this
        }
        type(e) {
            return this.txn.type = e, this
        }
        conditionId(e) {
            return this.txn.conditionId = e, this
        }
        build() {
            return this.txn
        }
    }
    class e9 extends e8 {
        constructor(e, t) {
            super(e, t, eo.TxnType.CLOB)
        }
        metadata(e) {
            return this.txn.metadata = e, this
        }
        tradeIds(e) {
            return this.txn.tradeIds = e, this
        }
        build() {
            return this.txn
        }
    }
    e.s(["CLOBTxnBuilder", 0, e9, "CTFTxnBuilder", 0, class extends e8 {
        constructor(e, t) {
            super(e, t, eo.TxnType.CTF)
        }
        metadata(e) {
            return this.txn.metadata = e, this
        }
        build() {
            return this.txn
        }
    }], 343999);
    var e7 = j;
    let te = "default",
        tt = ({
            orderType: e,
            side: t,
            amount: r,
            price: a
        }) => ({
            quantity: e === R.OrderType.Limit || t === e2.Side.SELL ? BigInt((1e6 * r).toFixed(0)) : BigInt((r / a * 1e6).toFixed(0)),
            usdc: e === R.OrderType.Limit || t === e2.Side.SELL ? BigInt((a * r * 1e6).toFixed(0)) : BigInt((1e6 * r).toFixed(0))
        }),
        tr = e => {
            let t = Date.now(),
                {
                    orderType: r,
                    args: a,
                    chainId: n = e7.MATIC_CONFIG.chainId
                } = e,
                {
                    quantity: i,
                    usdc: s
                } = (({
                    orderType: e,
                    args: t
                }) => {
                    if (e === R.OrderType.Limit) return tt({
                        orderType: e,
                        side: t.payload.side,
                        amount: t.payload.size,
                        price: t.payload.price
                    });
                    let r = t.response;
                    if (r ? .makingAmount != null && r ? .takingAmount != null) {
                        let e = parseFloat(r.makingAmount),
                            a = parseFloat(r.takingAmount);
                        if (Number.isFinite(e) && e > 0 && Number.isFinite(a) && a > 0) return t.payload.side === e2.Side.BUY ? {
                            quantity: BigInt((1e6 * a).toFixed(0)),
                            usdc: BigInt((1e6 * e).toFixed(0))
                        } : {
                            quantity: BigInt((1e6 * e).toFixed(0)),
                            usdc: BigInt((1e6 * a).toFixed(0))
                        }
                    }
                    return tt({
                        orderType: R.OrderType.Market,
                        side: t.payload.side,
                        amount: t.payload.amount,
                        price: t.payload.price ? ? 0
                    })
                })(e),
                {
                    response: o,
                    payload: l,
                    variables: c
                } = a,
                u = l.side === e2.Side.BUY ? (0, eS.computeClobBuyImpact)(s, i, c.params.selectedOutcomeIdx) : (0, eS.computeClobSellImpact)(s, i, c.params.selectedOutcomeIdx),
                d = new e9(o.orderID, eo.TxnStatus.PENDING).metadata({
                    chainId: n ? ? 137,
                    side: l.side,
                    orderType: r,
                    localOrderId: c.metadata.localOrderID,
                    clobOrderId: o.orderID,
                    ..."number" == typeof c.metadata.positionQtyBeforeSell && Number.isFinite(c.metadata.positionQtyBeforeSell) && {
                        positionQtyBeforeSell: c.metadata.positionQtyBeforeSell
                    },
                    outcome: c.metadata.market.outcomes[c.params.selectedOutcomeIdx],
                    quantity: i,
                    usdc: s,
                    outcomeIndex: c.params.selectedOutcomeIdx,
                    zeroLastPrice: c.metadata.zeroLastPrice,
                    oneLastPrice: c.metadata.oneLastPrice,
                    enqueuedAt: t,
                    lastUpdatedAt: t,
                    ...!!o.transactionsHashes && o.transactionsHashes.length > 0 && {
                        hash: o.transactionsHashes[0]
                    },
                    positionChangeData: u
                });
            return d.conditionId(c.metadata.market.conditionId), o.tradeIds && o.tradeIds.length > 0 && d.tradeIds(o.tradeIds), d.build()
        };
    var ta = e.i(140527),
        tn = e.i(306941),
        ti = e.i(399841),
        ts = e.i(72458),
        to = e.i(35245),
        tl = e.i(817686),
        tc = e.i(711960),
        tu = e.i(867487),
        td = e.i(848872),
        tp = e.i(730474);
    let tA = /maker address not allowed.*deposit wallet flow/i,
        th = [{
            match: tA,
            userMessage: "This account is disabled. Withdraw your funds, create a new Polymarket account, and move them over."
        }],
        tm = e => {
            for (let {
                    match: t,
                    userMessage: r
                } of th)
                if (t.test(e)) return r;
            return e
        },
        tf = () => {
            let e, t, r = (0, z.c)(6),
                a = (0, T.useToast)();
            r[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["baseAddress"], r[0] = e) : e = r[0];
            let {
                baseAddress: n
            } = (0, I.useAccountContext)(e), i = (0, td.useStuckSafeMigrationStore)(tg), s = (0, tp.useModalStore)(ty);
            return r[1] !== n || r[2] !== s || r[3] !== i || r[4] !== a ? (t = e => {
                let t = (0, eS.getOrderToastPosition)(),
                    r = "string" == typeof e.response ? .error ? e.response.error : "object" == typeof e.response ? .error && e.response ? .error !== null ? JSON.stringify(e.response.error) : "";
                return n && r && tA.test(r) ? (el.logger.info("[stuck-safe-migration] BE flagged user for deposit wallet migration", {
                    baseAddress: n
                }), i(n, !0), s(!0)) : "string" == typeof e.response ? .error && "" !== e.response.error ? ((0, eC.handleError)(Error(`Order API error: ${e.response.error}`), "trade_api_response_error", e.variables.metadata.proxyAddress, "high", {
                    localOrderID: e.variables.metadata.localOrderID,
                    orderType: e.orderType,
                    side: e.payload.side,
                    selectedOutcome: e.variables.metadata.market.outcomes[e.variables.params.selectedOutcomeIdx],
                    selectedOutcomeIdx: e.variables.params.selectedOutcomeIdx,
                    activeMarket: {
                        slug: e.variables.metadata.market.slug,
                        conditionId: e.variables.metadata.market.conditionId,
                        question: e.variables.metadata.market.question
                    },
                    orderResponse: {
                        status: e.response.status,
                        orderID: e.response.orderID,
                        error: e.response.error
                    },
                    toastPrice: e.payload.price,
                    toastAmount: e.orderType === R.OrderType.Limit ? e.payload.size : e.payload.amount
                }), e.errorToast && a.error(new E.ToastBuilder().position({
                    side: t
                }).title(`${e.orderType} ${(0,ta.capitalize)(e.payload.side)} ${(0,ta.capitalize)(e.variables.metadata.market.outcomes[e.variables.params.selectedOutcomeIdx])} failed`).description(e.variables.metadata.market.question).subtext(tm(e.response.error)))) : "object" == typeof e.response ? .error && Object.keys(e.response ? .error).length ? ((0, eC.handleError)(Error(`Order API object error: ${JSON.stringify(e.response.error)}`), "trade_api_object_error", e.variables.metadata.proxyAddress, "high", {
                    localOrderID: e.variables.metadata.localOrderID,
                    orderType: e.orderType,
                    side: e.payload.side,
                    selectedOutcome: e.variables.metadata.market.outcomes[e.variables.params.selectedOutcomeIdx],
                    selectedOutcomeIdx: e.variables.params.selectedOutcomeIdx,
                    activeMarket: {
                        slug: e.variables.metadata.market.slug,
                        conditionId: e.variables.metadata.market.conditionId,
                        question: e.variables.metadata.market.question
                    },
                    orderResponse: {
                        status: e.response.status,
                        orderID: e.response.orderID,
                        error: e.response.error
                    },
                    toastPrice: e.payload.price,
                    toastAmount: e.orderType === R.OrderType.Limit ? e.payload.size : e.payload.amount
                }), e.errorToast && a.error(new E.ToastBuilder().position({
                    side: t
                }).title(`${e.orderType} ${(0,ta.capitalize)(e.payload.side)} ${(0,ta.capitalize)(e.variables.metadata.market.outcomes[e.variables.params.selectedOutcomeIdx])} failed`).description(e.variables.metadata.market.question).subtext(tm(JSON.stringify(e.response.error))))) : e.errorToast && a.error(new E.ToastBuilder().position({
                    side: t
                }).title(`${e.orderType} ${(0,ta.capitalize)(e.payload.side)} ${(0,ta.capitalize)(e.variables.metadata.market.outcomes[e.variables.params.selectedOutcomeIdx])} failed`).description(e.variables.metadata.market.question).subtext("Please try again.")), ru.GeneralError
            }, r[1] = n, r[2] = s, r[3] = i, r[4] = a, r[5] = t) : t = r[5], t
        };

    function tg(e) {
        return e.setStuck
    }

    function ty(e) {
        return e.setShowDepositWalletMigrationModal
    }
    var tT = e.i(134850),
        tE = e.i(675215),
        tb = e.i(945930),
        tI = e.i(649480),
        tC = e.i(301713),
        tS = e.i(148716),
        t_ = e.i(499217),
        tN = e.i(894610),
        tx = e.i(510700),
        tk = e.i(486325);

    function tD(e) {
        if (!e || "object" != typeof e || !("response" in e)) return;
        let t = e.response;
        if (!t || "object" != typeof t || !("data" in t)) return;
        let r = t.data;
        if (!r || "object" != typeof r || !("error" in r)) return;
        let a = r.error;
        return "string" == typeof a ? a : void 0
    }
    let tv = (e, t, r) => {
        let a = t ? .error ? ? t ? .errorMsg ? ? (e => {
                if (!e || "object" != typeof e || !("error" in e) || !e.error) return;
                let t = e.error;
                if ("string" == typeof t) {
                    let e = t.toLowerCase();
                    return e.includes("429") || e.includes("too many requests") || e.includes("rate limit") ? "Rate limit exceeded" : e.includes("timeout") || e.includes("aborted") || e.includes("timed out") ? "Request timed out" : e.includes("failed to fetch") || e.includes("network") || e.includes("econnrefused") || e.includes("enotfound") ? "Network error" : t.length > 200 ? `${t.slice(0,197)}...` : t
                }
                if ("object" != typeof t) return;
                let r = "string" == typeof t.message ? t.message : "",
                    a = "string" == typeof t.name ? t.name : "",
                    n = r.toLowerCase(),
                    i = a.toLowerCase();
                return n.includes("429") || n.includes("too many requests") || n.includes("rate limit") ? "Rate limit exceeded" : "aborterror" === i || n.includes("timeout") || n.includes("aborted") || n.includes("timed out") ? "Request timed out" : n.includes("failed to fetch") || n.includes("network") || n.includes("econnrefused") || n.includes("enotfound") || "typeerror" === i && (n.includes("fetch") || n.includes("network")) ? "Network error" : t.code ? `Unknown clob error (code: ${t.code})` : r ? r.length > 200 ? `${r.slice(0,197)}...` : r : void 0
            })(e) ? ? (t ? .status ? `Unknown clob error: ${String(t.status).slice(0,5)}` : "Unknown clob error"),
            n = r ? .connectorName || "unknown",
            i = (e => {
                if (!e) return "Unknown";
                let t = tx.chainConfigs[e];
                return t ? .name || "Unknown"
            })(r ? .chainId);
        return `${a} [wallet: ${n}, chain: ${i}, chainId: ${r?.chainId}]`
    };
    var tw = e.i(636357);

    function tO() {
        let e, t, r, a, n, i = (0, z.c)(11),
            o = (0, s.useQueryClient)();
        i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress"], i[0] = e) : e = i[0];
        let {
            proxyAddress: l
        } = (0, I.useAccountContext)(e);
        i[1] !== l ? (t = ["has-traded", l], r = async () => {
            let e = await fetch(`/api/account/has-traded?address=${l}`);
            if (!e.ok) throw Error(`has-traded returned ${e.status}`);
            return !0 === (await e.json()).hasTraded
        }, i[1] = l, i[2] = t, i[3] = r) : (t = i[2], r = i[3]);
        let c = !!l;
        i[4] !== t || i[5] !== r || i[6] !== c ? (a = {
            queryKey: t,
            queryFn: r,
            enabled: c,
            staleTime: 1 / 0
        }, i[4] = t, i[5] = r, i[6] = c, i[7] = a) : a = i[7];
        let {
            data: u
        } = (0, eL.useQuery)(a);
        return i[8] !== u || i[9] !== o ? (n = e => {
            e.proxyAddress && !1 === u && (o.setQueryData(["has-traded", e.proxyAddress], !0), function({
                tradeParams: e,
                eventSlug: t,
                tradeFeeValue: r,
                proxyAddress: a,
                email: n
            }) {
                let i = { ...e,
                        content_ids: [t],
                        content_type: "market",
                        value: r,
                        currency: "USD"
                    },
                    s = (0, tI.trackMetaEvent)({
                        eventName: "Subscribe",
                        params: i,
                        sendCAPI: !1,
                        email: n,
                        externalId: a
                    });
                (0, tS.trackTikTokEvent)({
                    eventName: "Subscribe",
                    params: i,
                    email: n,
                    externalId: a
                }), (0, t_.trackSnapchatEvent)({
                    eventName: "Subscribe",
                    params: i,
                    email: n,
                    externalId: a
                }), (0, tN.trackTwitterEvent)({
                    eventName: "Subscribe",
                    params: i,
                    email: n,
                    externalId: a
                });
                let {
                    fbp: o,
                    fbc: l
                } = (0, tw.getMetaPixelCookies)(), {
                    uuid: c
                } = (0, tw.getRedditPixelCookies)();
                fetch("/api/account/mark-traded", {
                    method: "POST",
                    headers: {
                        "Content-Type": "application/json"
                    },
                    body: JSON.stringify({
                        address: a,
                        event_id: s,
                        fbp: o,
                        fbc: l,
                        rdt_uuid: c,
                        custom_data: i,
                        event_source_url: window.location.href,
                        client_user_agent: navigator.userAgent,
                        email: n
                    })
                }).catch(() => {})
            }({ ...e,
                proxyAddress: e.proxyAddress
            }))
        }, i[8] = u, i[9] = o, i[10] = n) : n = i[10], n
    }
    let tR = () => {
            let t = (0, b.useGoogleAnalytics)(),
                r = (0, b.useAmplitudeAnalytics)(),
                {
                    connector: a
                } = (0, y.useAccount)(),
                n = (0, c.useChainId)(),
                s = tO(),
                l = (0, tE.useTrackingEmail)();
            return o.default.useCallback(async o => {
                try {
                    let {
                        params: c,
                        response: u
                    } = ((e, t) => {
                        let {
                            variables: r,
                            response: a,
                            payload: n
                        } = e, s = r.params.side === i.Side.BUY ? parseFloat(a ? .takingAmount ? ? "0") : parseFloat(a ? .makingAmount ? ? "0"), o = Number.isFinite(s) && s > 0, l = r.params.feeEnabled && o ? (0, f.calculateOrderFee)(n.price ? ? 0, s, {
                            feeSchedule: r.metadata.market.feeSchedule,
                            feeType: r.metadata.market.feeType
                        }).usdc : 0, c = (0, tk.getCardReferrer)();
                        return {
                            params: {
                                trade_type: R.OrderType.Limit,
                                trade_side: r.params.side,
                                trade_outcome: r.params.selectedOutcomeIdx,
                                trade_order_exp: r.params.expiration,
                                trade_is_rewards_eligible: a ? .status === "live" && (({
                                    orderPrice: e,
                                    orderSize: t,
                                    rewardsMaxSpread: r,
                                    rewardsMinSize: a,
                                    outcomeLastPrice: n
                                }) => {
                                    if (!a || t < a) return !1;
                                    let i = null;
                                    if (n) try {
                                        i = parseFloat(n)
                                    } catch {}
                                    if (!r || !i) return !1;
                                    let [s, o] = [r / 100 + i, i - r / 100];
                                    return e <= s && e >= o
                                })({
                                    rewardsMaxSpread: r.metadata.market.rewardsMaxSpread,
                                    rewardsMinSize: r.metadata.market.rewardsMinSize,
                                    orderPrice: n.price ? ? 0,
                                    orderSize: n.size,
                                    outcomeLastPrice: 0 === r.params.selectedOutcomeIdx ? r.metadata.zeroLastPrice : r.metadata.oneLastPrice
                                }),
                                trade_market: r.metadata.market.slug,
                                event_slug: r.metadata.market.events ? .[0] ? .slug,
                                series_slug: r.metadata.market.events ? .[0] ? .series ? .[0] ? .slug,
                                trade_price: n.price ? ? 0,
                                trade_shares: n.size,
                                trade_size_usdc: n.size * (n.price ? ? 0),
                                trade_fee_value: l,
                                trade_status: a ? .status,
                                trade_id: a ? .orderID,
                                ...!!a ? .transactionsHashes && a ? .transactionsHashes.length > 0 && {
                                    trade_hash: JSON.stringify(a ? .transactionsHashes)
                                },
                                ...!!a ? .tradeIds && a ? .tradeIds.length > 0 && {
                                    trade_ids: JSON.stringify(a ? .tradeIds)
                                },
                                event_status : !a ? .success || "string" == typeof a ? .error || "object" == typeof a ? .error && Object.keys(a ? .error).length ? "error" : "success",
                                ...!a ? .success && {
                                    event_error_msg: tv(e, a, t)
                                },
                                trade_location : r.metadata.trackingParams.page,
                                ...r.metadata.trackingParams.viewMode && {
                                    trade_view_mode: r.metadata.trackingParams.viewMode
                                },
                                ...c && {
                                    card_referrer_page: c.page,
                                    card_referrer_position: c.position,
                                    card_referrer_source: c.source
                                }
                            },
                            response: a
                        }
                    })(o, {
                        connectorName: a ? .name ? ? "no connector",
                        chainId: n
                    });
                    (0, tb.setLastTradeContext)({
                        event: "limit",
                        market_id: o.variables.metadata.market.conditionId,
                        market_slug: o.variables.metadata.market.slug,
                        token_id: o.variables.params.tokenID,
                        side: o.variables.params.side,
                        outcome_index: o.variables.params.selectedOutcomeIdx,
                        amount: c.trade_size_usdc
                    }), t.trackEvent(tT.GAEventAction.TRADE, { ...c,
                        currency: "USD",
                        value: c.trade_size_usdc
                    }), r.trackEvent(q.Events.Trade, { ...c,
                        resp: u
                    }, o.variables.metadata.proxyAddress); {
                        let e = {
                            order_type: "limit",
                            trade_size: c.trade_size_usdc,
                            trade_fee_value: c.trade_fee_value,
                            market_slug: c.trade_market,
                            side: c.trade_side,
                            status: c.trade_status
                        };
                        window.dataLayer ? .push({
                            event: "trade",
                            ...e,
                            currency: "USD",
                            value: c.trade_size_usdc,
                            price: c.trade_price,
                            user_id: o.variables.metadata.proxyAddress || void 0
                        });
                        let t = o.variables.metadata.proxyAddress,
                            r = o.variables.metadata.market.events ? .[0] ? .slug ? ? "";
                        "error" in o || o.response ? .success === !1 || (s({
                            tradeParams: e,
                            eventSlug: r,
                            tradeFeeValue: c.trade_fee_value,
                            proxyAddress: t,
                            email: l
                        }), (0, tI.trackMetaEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                content_ids: [r],
                                content_type: "market",
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }), (0, tC.trackRedditEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }), (0, tS.trackTikTokEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }), (0, t_.trackSnapchatEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }), (0, tN.trackTwitterEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }))
                    }
                    let d = { ...c,
                            order_type: "limit",
                            resp: u,
                            args: o,
                            proxyAddress: o.variables.metadata.proxyAddress,
                            localOrderID: o.variables.metadata.localOrderID,
                            connectorName: a ? .name
                        },
                        p = u ? .error ? ? ("error" in o ? tD(o.error) : void 0) ? ? "";
                    if ("string" == typeof p && p.includes("not enough balance")) try {
                        let {
                            axios: t
                        } = await e.A(742085), {
                            DATA_API: r
                        } = await e.A(982315), a = (await t.get(`${r}/positions`, {
                            params: {
                                user: o.variables.metadata.proxyAddress,
                                market: o.variables.metadata.market.conditionId,
                                sizeThreshold: 0,
                                limit: 10
                            },
                            timeout: 5e3
                        })).data ? ? [], n = a.find(e => e.conditionId === o.variables.metadata.market.conditionId);
                        d.dataApiPosition = n ? {
                            size: n.size,
                            currentValue: n.currentValue,
                            avgPrice: n.avgPrice,
                            asset: n.asset
                        } : null, d.dataApiPositionCount = a.length
                    } catch {}
                    el.logger.info("[useTrackLimitOrderEvent] order result", d)
                } catch {}
            }, [t, r, a, n, s, l])
        },
        tM = e => {
            let {
                id: t,
                owner: r,
                price: a,
                original_size: n,
                size_matched: i,
                side: s,
                market: o,
                outcome: l,
                asset_id: c,
                expiration: u
            } = e;
            return {
                owner: r,
                price: a.padEnd(4, "0"),
                side: s,
                outcome: l,
                orderID: t,
                timestamp: (e => {
                    if (!e) return Date.now().toString();
                    let t = e.toString();
                    return t.length < 11 ? (1e3 * parseInt(t, 10)).toString() : t
                })(e.created_at),
                tokenID: c,
                market: o,
                originalSize: n,
                sizeMatched: i,
                expiration: u
            }
        };
    e.s(["calculateOpenOrderBookInfo", 0, e => {
        let t = 0,
            r = 0,
            a = [];
        for (let n of e) t += parseFloat(n.originalSize) - parseFloat(n.sizeMatched), r += parseFloat(n.originalSize), a.push(n);
        return {
            availableQty: t,
            totalQty: r,
            orders: a
        }
    }, "calculateOrdersValue", 0, e => {
        if (!Array.isArray(e)) return 0 n;
        let t = 10 n ** 6 n;
        return e.filter(e => e.side === i.Side.BUY).reduce((e, r) => {
            try {
                let a = (0, H.parseUSDCUnitsBigInt)(r.originalSize),
                    n = (0, H.parseUSDCUnitsBigInt)(r.sizeMatched),
                    i = (0, H.parseUSDCUnitsBigInt)(r.price);
                e += (a - n) * i / t
            } catch {}
            return e
        }, 0 n)
    }, "createPriceMapKey", 0, (e, t, r) => `${e.padEnd(5,"0").toLowerCase()}-${t}-${r.toLowerCase()}`, "fromNewOrderToOld", 0, tM, "getOppositeOrder", 0, (e, t, r = 2) => {
        var a;
        return { ...e,
            price: (a = e.price, void 0 !== r ? (0, H.nDecimals)(1 - parseFloat(a), r) : (1 - parseFloat(a)).toString()),
            side: e.side === i.Side.BUY ? i.Side.SELL : i.Side.BUY,
            tokenID: ((e, t) => {
                if (!t.includes(e.tokenID)) return "0";
                let [r, a] = t;
                return e.tokenID === r ? a : r
            })(e, t)
        }
    }, "handleOrdersResponse", 0, (e, t) => {
        if (el.logger.debug("[handleOrdersResponse]", {
                response: e,
                openOrders: t
            }), !Array.isArray(t)) return [];
        if ("order" === e.event_type) {
            let r = t.filter(t => t.orderID !== e.id);
            if ("CANCELLATION" === e.type) return el.logger.debug("[handleOrdersResponse > order]", {
                filteredOrders: r
            }), (0, tu.trackEvent)("limit_order_canceled", {
                order_id: e.id,
                market_id: e.market
            }), r;
            if ("PLACEMENT" === e.type || "UPDATE" === e.type) {
                let t = (e => {
                    let {
                        asset_id: t,
                        associate_trades: r,
                        created_at: a,
                        id: n,
                        maker_address: i,
                        market: s,
                        order_type: o,
                        original_size: l,
                        outcome: c,
                        owner: u,
                        price: d,
                        side: p,
                        size_matched: A
                    } = e;
                    return {
                        asset_id: t,
                        associate_trades: r,
                        created_at: a,
                        expiration: e ? .expiration,
                        id: n,
                        maker_address: i,
                        market: s,
                        order_type: o,
                        original_size: l,
                        outcome: c,
                        owner: u,
                        price: d,
                        side: p,
                        size_matched: A,
                        status: e ? .status
                    }
                })(e);
                if (t.size_matched === t.original_size) return r;
                let a = [tM(t), ...r];
                return el.logger.debug("[handleOrdersResponse > order]", {
                    updatedOrders: a
                }), a
            }
        }
        return t
    }], 436127);
    let tL = e => {
        let {
            response: t,
            variables: r
        } = e;
        return !!t && "delayed" === t.status && r.metadata.market ? .secondsDelay && Number(r.metadata.market.secondsDelay) > 0 && t ? .orderID !== ""
    };
    var tB = e.i(635973);
    let tP = e => !e || !e.status || "string" != typeof e.status || !e.status.toLowerCase().includes("fail"),
        tF = (e, t) => {
            let r, a, {
                outcome: n,
                price: i,
                match_time: s,
                taker_order_id: o,
                size: l,
                side: c,
                transaction_hash: u
            } = e;
            try {
                let e = parseFloat(i);
                a = (r = parseFloat(l)) * e
            } catch {
                r = 0, a = 0
            }
            let d = Math.round(new Date(1e3 * Number(s)).getTime()).toString(),
                p = R.FilledOrderType.Market;
            return t && (p = R.FilledOrderType.Limit), {
                outcome: n,
                price: i,
                timestamp: d,
                match_time: s,
                filledSize: r,
                totalValue: a,
                side: c,
                orderID: o,
                type: p,
                isMining: "MATCHED" === e.status,
                transaction_hash: u
            }
        },
        tU = e => {
            if (!e) return [];
            try {
                if ("string" == typeof e) return JSON.parse(e);
                if (Array.isArray(e)) return e;
                return []
            } catch {
                return []
            }
        },
        tG = "trade_executed",
        tH = "limit_order_filled",
        tj = e => {
            let t, r, a, n, i, o = (0, z.c)(13);
            o[0] !== e ? (t = void 0 === e ? {} : e, o[0] = e, o[1] = t) : t = o[1];
            let l = t,
                c = (0, s.useQueryClient)(),
                u = (0, b.useGoogleAnalytics)(),
                {
                    onTradeHistorySettled: d
                } = l;
            o[2] !== u || o[3] !== c ? (r = async e => {
                let {
                    proxyAddress: t,
                    event: r
                } = e, a = e_.queryKeys[eN.QueryKey.TradeHistory].trades(t, r.market).queryKey;
                await c.cancelQueries({
                    queryKey: a
                });
                let n = c.getQueryData(a),
                    i = (e => {
                        let {
                            asset_id: t,
                            fee_rate_bps: r,
                            id: a,
                            last_update: n,
                            maker_address: i,
                            maker_orders: s,
                            market: o,
                            match_time: l,
                            outcome: c,
                            owner: u,
                            price: d,
                            side: p,
                            size: A,
                            status: h,
                            taker_order_id: m,
                            trader_side: f,
                            transaction_hash: g,
                            timestamp: y,
                            trade_owner: T
                        } = e;
                        return {
                            asset_id: t,
                            event_type: "trade",
                            fee_rate_bps: r,
                            id: a,
                            last_update: n,
                            maker_address: i,
                            maker_orders: s,
                            market: o,
                            match_time: l,
                            outcome: c,
                            owner: u,
                            price: d,
                            side: p,
                            size: A,
                            status: h,
                            taker_order_id: m,
                            timestamp: y,
                            trade_owner: T,
                            trader_side: f,
                            transaction_hash: g
                        }
                    })(r),
                    s = {
                        market_id: r.market,
                        side: r.side,
                        price: parseFloat(r.price),
                        size: parseFloat(r.size),
                        amount_usd: parseFloat(r.price) * parseFloat(r.size),
                        tx_id: r.transaction_hash,
                        currency: "USD",
                        value: parseFloat(r.price) * parseFloat(r.size),
                        transaction_id: r.transaction_hash
                    };
                if ((0, tu.trackEvent)("trade_executed", s), u.trackGA4Event(tG, s), "MAKER" === r.trader_side) {
                    let e = Array.isArray(r.maker_orders) ? r.maker_orders.map(tQ).filter(tK) : [],
                        t = {
                            order_id: (0 === e.length ? void 0 : 1 === e.length ? e[0] : e.join(",")) ? ? r.taker_order_id,
                            market_id: r.market,
                            fill_size: parseFloat(r.size),
                            avg_price: parseFloat(r.price)
                        };
                    (0, tu.trackEvent)("limit_order_filled", t), u.trackGA4Event(tH, t)
                }
                let o = ((e, t) => {
                    if (!e || !Array.isArray(e ? .pages) || !Array.isArray(e.pages[0].trades)) return {
                        pages: [{
                            count: 0,
                            limit: 300,
                            next_cursor: "LTE==",
                            trades: t ? [t] : []
                        }],
                        pageParams: ["MA=="]
                    };
                    let r = { ...e.pages[0],
                            trades: [...e.pages[0].trades, t]
                        },
                        a = e.pages.slice(1);
                    return { ...e,
                        pages: [r, ...a]
                    }
                })(n, i);
                return el.logger.debug("[useFilledOrdersMutation > mutateAsync > maker]", {
                    queryKey: a,
                    newTrade: i,
                    updatedTrades: o
                }), c.setQueryData(a, o), o
            }, o[2] = u, o[3] = c, o[4] = r) : r = o[4], o[5] !== d || o[6] !== c ? (a = (e, t, r) => {
                d ? d() : c.invalidateQueries({
                    queryKey: e_.queryKeys[eN.QueryKey.TradeHistory]._def
                })
            }, o[5] = d, o[6] = c, o[7] = a) : a = o[7], o[8] !== r || o[9] !== a ? (n = {
                mutationFn: r,
                onSettled: a
            }, o[8] = r, o[9] = a, o[10] = n) : n = o[10];
            let {
                mutateAsync: p
            } = (0, eM.useMutation)(n);
            return o[11] !== p ? (i = {
                tradesMutation: p
            }, o[11] = p, o[12] = i) : i = o[12], i
        };

    function tQ(e) {
        return e.order_id
    }

    function tK(e) {
        return !!e
    }
    e.s(["useFilledOrdersMutation", 0, tj], 772281);
    let tY = async (e, t, r) => {
            let [a, n, i, s, o, l] = e.queryKey, {
                pageParam: c
            } = e;
            if (!t) return {
                trades: [],
                limit: 0,
                count: 0,
                next_cursor: "LTE"
            };
            try {
                return await t.getTradesPaginated({
                    market: s,
                    asset_id: o,
                    id: l
                }, c && "LTE" !== c ? c : void 0)
            } catch (t) {
                return (0, eC.handleError)(t, "filled_orders_fetch_error", r || "unknown", "medium", {
                    market: s,
                    asset_id: o,
                    id: l,
                    pageParam: c,
                    queryKey: e.queryKey
                }), {
                    trades: [],
                    limit: 0,
                    count: 0,
                    next_cursor: "LTE"
                }
            }
        },
        tW = (e, t) => {
            if (!e || !Array.isArray(e.pages) || !t) return [];
            let r = e.pages.reduce((e, t) => e.concat(t.trades), []),
                a = r.filter(e => "MAKER" === e.trader_side),
                n = r.filter(e => "TAKER" === e.trader_side);
            return [...(!a || !Array.isArray(a) ? [] : a.flatMap(e => ((e, t) => {
                if (!e || !e.maker_orders || !Array.isArray(e.maker_orders)) return [];
                if (e.maker_orders && Array.isArray(e.maker_orders) && tU(e.maker_orders).some(e => e.owner === t)) {
                    let r = tU(e.maker_orders),
                        a = r.filter(({
                            owner: e
                        }) => e === t).map(t => {
                            let {
                                asset_id: r,
                                matched_amount: a,
                                price: n,
                                outcome: s
                            } = t, o = r === e.asset_id, {
                                side: l
                            } = e;
                            return o && (l = e.side === i.Side.BUY ? i.Side.SELL : i.Side.BUY), { ...e,
                                size: (0, H.nDecimals)(a, 6),
                                price: (0, h.cleanValueIfNeeded)(n, 5),
                                asset_id: r,
                                outcome: s,
                                side: l
                            }
                        });
                    return el.logger.debug("[handleMakerTrade]", {
                        trade: e,
                        parsedOrders: r,
                        makerTrades: a
                    }), a
                }
                return []
            })(e, t))).filter(tP).map(e => tF(e, !0)), ...n.filter(tP).map(e => tF(e, !1))].sort((e, t) => Number(t.timestamp) - Number(e.timestamp))
        };

    function tq() {
        let e, t, r, a, n, i, o, l, c, u = (0, z.c)(29),
            {
                tradesMutation: d
            } = tj();
        u[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["activeMarket"], u[0] = e) : e = u[0];
        let {
            activeMarket: p
        } = (0, S.useEventActiveMarketContext)(e), A = (0, C.useClob)();
        u[1] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], u[1] = t) : t = u[1];
        let {
            proxyAddress: h
        } = (0, I.useAccountContext)(t), m = (0, s.useQueryClient)(), f = "string" == typeof h && h !== e5.zeroAddress && "string" == typeof A ? .creds ? .key && "string" == typeof p ? .conditionId;
        u[2] !== p ? .conditionId || u[3] !== h ? (r = e_.queryKeys[eN.QueryKey.TradeHistory].trades(h, p ? .conditionId), u[2] = p ? .conditionId, u[3] = h, u[4] = r) : r = u[4], u[5] !== A || u[6] !== h ? (a = e => tY(e, A, h), u[5] = A, u[6] = h, u[7] = a) : a = u[7], u[8] !== f || u[9] !== r.queryKey || u[10] !== a ? (n = {
            queryKey: r.queryKey,
            queryFn: a,
            enabled: f,
            refetchOnMount: !1,
            refetchOnReconnect: !1,
            refetchOnWindowFocus: !1,
            initialPageParam: "MA==",
            getNextPageParam: tV
        }, u[8] = f, u[9] = r.queryKey, u[10] = a, u[11] = n) : n = u[11];
        let {
            data: g,
            fetchNextPage: y,
            hasNextPage: T,
            isFetching: E,
            isPending: b,
            refetch: _
        } = (0, tB.useInfiniteQuery)(n);
        A ? .creds ? .key;
        let N = A ? .creds ? .key ? ? "";
        u[12] !== g || u[13] !== N ? (i = tW(g, N), u[12] = g, u[13] = N, u[14] = i) : i = u[14];
        let x = i;
        u[15] !== m ? (o = () => m.invalidateQueries({
            queryKey: [e_.queryKeys[eN.QueryKey.TradeHistory]]
        }), u[15] = m, u[16] = o) : o = u[16];
        let k = o;
        u[17] !== A ? .creds ? .key || u[18] !== _ ? (l = async () => {
            let e = await _();
            return e ? .data && A ? .creds ? .key ? tW(e.data, A ? .creds ? .key) : []
        }, u[17] = A ? .creds ? .key, u[18] = _, u[19] = l) : l = u[19], A ? .creds ? .key;
        let D = l;
        return u[20] !== x || u[21] !== y || u[22] !== T || u[23] !== E || u[24] !== b || u[25] !== D || u[26] !== k || u[27] !== d ? (c = {
            fetchNextPage: y,
            filledOrders: x,
            hasNextPage: T,
            isFetching: E,
            isPending: b,
            refetchFilledOrders: D,
            refreshFilledOrders: k,
            tradesMutation: d
        }, u[20] = x, u[21] = y, u[22] = T, u[23] = E, u[24] = b, u[25] = D, u[26] = k, u[27] = d, u[28] = c) : c = u[28], c
    }

    function tV(e) {
        if (e ? .next_cursor) return e.next_cursor
    }
    e.s(["useFilledOrders", 0, tq], 394341);
    var tz = e.i(419160),
        tJ = e.i(778983);
    let tZ = e => {
        let t, r, a = (0, z.c)(5);
        a[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], a[0] = t) : t = a[0];
        let {
            proxyAddress: n
        } = (0, I.useAccountContext)(t), i = eX(), s = e ? ? j.MATIC_CONFIG.chainId;
        return a[1] !== s || a[2] !== n || a[3] !== i ? (r = (e, t, r, a) => {
            if (!n || !s) throw Error("No address or chain ID found");
            r && !i.doesTransactionExist(n, s, e) ? i.addTransaction(n, s, r, void 0) : i.setTransactionParams(n, s, e, t, void 0, a)
        }, a[1] = s, a[2] = n, a[3] = i, a[4] = r) : r = a[4], r
    };
    async function t$(e) {
        return new Promise(t => {
            setTimeout(() => t(), e)
        })
    }
    e.s(["default", 0, tZ], 835893);
    let tX = e => new Promise(t => setTimeout(t, e)),
        t0 = (e, t) => {
            let r = e.queryKey;
            return Array.isArray(r) && r[0] === eN.QueryKey.Positions && "byIds" === r[1] && "string" == typeof r[2] && r[2].toLowerCase() === t
        },
        t1 = (e, t) => new Map(e.getQueryCache().findAll({
            predicate: e => t0(e, t)
        }).map(e => [e.queryHash, e.state.dataUpdatedAt])),
        t2 = (e, t) => {
            let r = e.getQueryData(e_.queryKeys[eN.QueryKey.Positions].optimistic(t).queryKey);
            if (!(r instanceof Map)) return !1;
            let a = Date.now();
            for (let e of r.values())
                if (e && "object" == typeof e && !0 === e.isDirty && ("number" != typeof e.updatedAt || a - e.updatedAt <= 6e4)) return !0;
            return !1
        },
        t5 = () => {
            let e, t, r = (0, z.c)(3),
                a = (0, s.useQueryClient)();
            r[0] === Symbol.for("react.memo_cache_sentinel") ? (e = new Map, r[0] = e) : e = r[0];
            let n = (0, o.useRef)(e);
            return r[1] !== a ? (t = async (e, t) => {
                let r = void 0 === t ? 5 : t;
                if (!e) return;
                let i = e.toLowerCase(),
                    s = n.current.get(i);
                if (s) return void await s;
                let o = async () => {
                        await a.invalidateQueries({
                            predicate: e => t0(e, i)
                        }), await a.refetchQueries({
                            predicate: e => t0(e, i) && "pending" !== e.state.status,
                            type: "active",
                            stale: !0
                        })
                    },
                    l = (async () => {
                        let e = Math.min(Math.max(r, 0), 1),
                            t = t1(a, i);
                        if (0 === t.size) return;
                        let n = Date.now() + 6e4;
                        for (await tX(1500), await o(), e > 0 && (await tX(250), ((e, t) => {
                                if (e.size !== t.size) return !0;
                                for (let [r, a] of t.entries())
                                    if (e.get(r) !== a) return !0;
                                return !1
                            })(t, t1(a, i)) || (await tX(1e3), await o())); Date.now() < n && t2(a, i) && 0 !== t1(a, i).size;) {
                            let e = Math.min(5e3, n - Date.now());
                            if (e <= 0 || (await tX(e), Date.now() >= n)) break;
                            await o()
                        }
                    })().finally(() => {
                        n.current.delete(i)
                    });
                n.current.set(i, l), await l
            }, r[1] = a, r[2] = t) : t = r[2], t
        };
    e.s(["useInvalidatePositions", 0, t5], 99417);
    let t6 = e => !!e && "object" == typeof e && "string" == typeof e.conditionId && "number" == typeof e.outcomeIndex && Number.isFinite(e.outcomeIndex) && "number" == typeof e.size && Number.isFinite(e.size);

    function t3(e) {
        return {
            current: e,
            pending: 0,
            optimistic: e
        }
    }
    let t4 = () => {
        let e = (0, T.useToast)(),
            t = e0(),
            r = tZ(),
            a = eX(),
            n = (0, s.useQueryClient)(),
            {
                refetchFilledOrders: c
            } = tq(),
            u = t5();
        return o.default.useCallback(async s => {
            let o, d = (0, eS.getOrderToastPosition)(),
                p = (0, m.delayInMs)(s.variables.metadata.market.secondsDelay),
                h = Date.now();
            if (s.successToast && e.success(new E.ToastBuilder().position({
                    side: d
                }).title(`${s.orderType} ${(0,ta.capitalize)(s.payload.side)} ${(0,ta.capitalize)(s.variables.metadata.market.outcomes[s.variables.params.selectedOutcomeIdx])} placed`).description(s.variables.metadata.market.question).subtext(`This market has a ${s.variables.metadata.market.secondsDelay} second delay`).icon(tz.ToastIcon.Time)), s.orderType === R.OrderType.Market) {
                let {
                    market: e
                } = s.variables.metadata, r = s.variables.metadata.proxyAddress, {
                    selectedOutcomeIdx: a
                } = s.variables.params, {
                    side: c
                } = s.payload, u = (() => {
                    let e = s.txn.metadata.positionQtyBeforeSell;
                    if ("number" == typeof e && Number.isFinite(e)) return e
                })(), d = c === i.Side.SELL ? (({
                    queryClient: e,
                    conditionId: t,
                    outcomeIndex: r
                }) => {
                    try {
                        for (let [, a] of e.getQueriesData({
                                predicate: e => e.queryKey[0] === eN.QueryKey.Positions
                            }))
                            if (a) {
                                if (Array.isArray(a)) {
                                    let e = a.find(e => t6(e) && e.conditionId.toLowerCase() === t.toLowerCase() && e.outcomeIndex === r);
                                    if (e && t6(e)) return e
                                }
                                if ("object" == typeof a && null !== a && "pages" in a) {
                                    let e = a.pages;
                                    if (!Array.isArray(e)) continue;
                                    for (let a of e) {
                                        if (!Array.isArray(a)) continue;
                                        let e = a.find(e => t6(e) && e.conditionId.toLowerCase() === t.toLowerCase() && e.outcomeIndex === r);
                                        if (e && t6(e)) return e
                                    }
                                }
                            }
                    } catch {}
                })({
                    queryClient: n,
                    conditionId: e.conditionId,
                    outcomeIndex: a
                }) : void 0, p = u ? ? (() => {
                    if (c === i.Side.SELL && r) {
                        try {
                            let t = e_.queryKeys[eN.QueryKey.Positions].optimistic(r).queryKey,
                                i = n.getQueryData(t);
                            if (i instanceof Map) {
                                let t = (0, $.makeOptimisticPositionKey)({
                                        conditionId: e.conditionId,
                                        outcomeIndex: 0 === a ? "0" : "1"
                                    }),
                                    r = i.get(t),
                                    n = r ? .position,
                                    s = n ? .trackedPositionMetadata ? .netQuantity ? .optimistic;
                                if ("number" == typeof s && Number.isFinite(s)) return s;
                                let o = n ? .trackedPositionMetadata ? .netQuantity ? .current;
                                if ("number" == typeof o && Number.isFinite(o)) return o;
                                if (n ? .netQuantity) {
                                    let e = Number.parseFloat((0, H.formatUSDCUnits)(BigInt(n.netQuantity)));
                                    if (Number.isFinite(e)) return e
                                }
                            }
                        } catch {}
                        if ("number" == typeof d ? .size && Number.isFinite(d.size)) return d.size
                    }
                })();
                t({ ...s.txn,
                    status: eo.TxnStatus.DELAY,
                    metadata: { ...s.txn.metadata,
                        isDelayedOrder: !0,
                        ...void 0 !== p && {
                            positionQtyBeforeSell: p
                        }
                    }
                }, e);
                let h = c === i.Side.SELL ? "number" == typeof s.payload.amount ? s.payload.amount : Number.parseFloat(String(s.payload.amount)) : void 0,
                    m = c === i.Side.SELL && "number" == typeof p && "number" == typeof h && Number.isFinite(h) && h > 0 && .01 >= Math.abs(p - h);
                if (c === i.Side.SELL && r) {
                    let {
                        tokenID: t
                    } = s.variables.params, i = j.MATIC_CONFIG.chainId;
                    o = async (s, o = "confirmed") => {
                        try {
                            let c = e_.queryKeys[eN.QueryKey.Positions].optimistic(r).queryKey,
                                u = n.getQueryData(c),
                                f = u instanceof Map ? u : void 0,
                                y = (0, $.makeOptimisticPositionKey)({
                                    conditionId: e.conditionId,
                                    outcomeIndex: 0 === a ? "0" : "1"
                                }),
                                T = f ? .get(y),
                                E = d ? (0, tJ.formatTrackedMarketPosition)({ ...d,
                                    size: 0
                                }) : void 0,
                                b = T ? .position ? ? E;
                            if (!b) return;
                            let I = b.trackedPositionMetadata,
                                C = "number" == typeof d ? .size && Number.isFinite(d.size) ? d.size : void 0,
                                S = I ? .netQuantity ? .optimistic ? ? (() => {
                                    try {
                                        return Number.parseFloat((0, H.formatUSDCUnits)(BigInt(b.netQuantity)))
                                    } catch {
                                        return
                                    }
                                })(),
                                _ = "number" == typeof p && Number.isFinite(p) && "number" == typeof s && Number.isFinite(s) && .1 >= Math.abs(p - s),
                                N = "number" == typeof C && Number.isFinite(C) && "number" == typeof h && Number.isFinite(h) && .1 >= Math.abs(C - h),
                                x = "number" == typeof S && Number.isFinite(S) && S <= .1;
                            if (!(m || _ || N || x)) return;
                            let k = !1;
                            if ("confirmed" === o) {
                                try {
                                    let e = (0, g.createChainAwarePublicClient)({
                                            chainId: i
                                        }),
                                        a = await e.readContract({
                                            address: j.CONDITIONAL_TOKENS_ADDRESS,
                                            abi: A.ConditionalTokensAbi,
                                            functionName: "balanceOf",
                                            args: [r, BigInt(t)]
                                        }),
                                        n = Number.parseFloat((0, l.formatUnits)(a, 6));
                                    Number.isFinite(n) && n > .1 && (k = !0)
                                } catch {}
                                if (k && !m && !_ && !N) return
                            }
                            let D = e => {
                                    if ("string" != typeof e) return 0;
                                    try {
                                        let t = Number.parseFloat((0, H.formatUSDCUnits)(BigInt(e)));
                                        return Number.isFinite(t) ? t : 0
                                    } catch {
                                        return 0
                                    }
                                },
                                v = I ? .quantityBought ? .optimistic ? ? D(b.quantityBought),
                                w = I ? .valueBought ? .optimistic ? ? D(b.valueBought),
                                O = I ? .totalQuantityBought ? .optimistic ? ? D(b.totalQuantityBought),
                                R = I ? .totalValueBought ? .optimistic ? ? D(b.totalValueBought),
                                M = I ? .netQuantity ? .current ? ? D(b.netQuantity),
                                L = I ? .netValue ? .current ? ? D(b.netValue),
                                B = I ? { ...I,
                                    netQuantity: {
                                        current: M,
                                        pending: 0,
                                        optimistic: 0
                                    },
                                    netValue: {
                                        current: L,
                                        pending: 0,
                                        optimistic: 0
                                    }
                                } : void 0,
                                P = "immediate" === o ? { ...b,
                                    isPending: !0,
                                    pendingSince: b.pendingSince ? ? Date.now(),
                                    trackedPositionMetadata: B ? ? {
                                        quantityBought: t3(v),
                                        netQuantity: {
                                            current: M,
                                            pending: 0,
                                            optimistic: 0
                                        },
                                        valueBought: t3(w),
                                        netValue: {
                                            current: L,
                                            pending: 0,
                                            optimistic: 0
                                        },
                                        realizedProfit: t3(I ? .realizedProfit ? .current ? ? 0),
                                        totalQuantityBought: t3(O),
                                        totalValueBought: t3(R)
                                    }
                                } : { ...b,
                                    isPending: !1,
                                    pendingSince: void 0,
                                    quantityBought: b.quantityBought,
                                    netQuantity: "0",
                                    valueBought: b.valueBought,
                                    netValue: "0",
                                    totalQuantityBought: b.totalQuantityBought,
                                    totalValueBought: b.totalValueBought,
                                    realizedProfit: b.realizedProfit ? ? "0",
                                    trackedPositionMetadata: {
                                        quantityBought: t3(v),
                                        netQuantity: t3(0),
                                        valueBought: t3(w),
                                        netValue: t3(0),
                                        realizedProfit: t3(I ? .realizedProfit ? .current ? ? 0),
                                        totalQuantityBought: t3(O),
                                        totalValueBought: t3(R)
                                    }
                                };
                            (0, $.updateOptimisticPositions)({
                                queryClient: n,
                                positions: [P],
                                proxyAddress: r,
                                source: "immediate" === o ? "useHandleDelayedOrder.fullSell.immediate" : "useHandleDelayedOrder.fullSell.onChain"
                            })
                        } catch {}
                    }
                }
                o && m && o(void 0, "immediate")
            }
            return t$(p + 1e3).then(() => c().then(e => {
                let t = s.response.orderID ? .toLowerCase(),
                    n = (s.response.transactionsHashes ? ? []).filter(e => "string" == typeof e).map(e => e.toLowerCase()),
                    i = s.orderType === R.OrderType.Market && "number" == typeof s.payload.amount ? s.payload.amount : s.orderType === R.OrderType.Market ? Number.parseFloat(String(s.payload.amount)) : void 0,
                    l = s.orderType === R.OrderType.Market ? String(s.payload.side).toUpperCase() : void 0,
                    c = e ? .find(e => {
                        if ("string" == typeof t && e ? .orderID ? .toLowerCase() === t) return !0;
                        let r = e ? .transaction_hash ? .toLowerCase();
                        if (r && n.includes(r)) return !0;
                        let a = "string" == typeof l && String(e ? .side ? ? "").toUpperCase() === l,
                            s = "number" == typeof i && Number.isFinite(i) && "number" == typeof e ? .filledSize && Number.isFinite(e.filledSize) && .1 >= Math.abs(e.filledSize - i),
                            o = Number.parseInt(String(e ? .timestamp ? ? ""), 10),
                            c = Number.isFinite(o) && o >= h - 1e4;
                        return a && s && c
                    }),
                    d = !!c,
                    p = "number" == typeof c ? .filledSize && Number.isFinite(c.filledSize) ? c.filledSize : void 0;
                s.orderType === R.OrderType.Market && localStorage.setItem(G.LS_MARKET_ORDER_NOTIFICATION, s.response.orderID.toLowerCase());
                let A = s.orderType === R.OrderType.Market,
                    m = d ? A ? eo.TxnStatus.MATCHED : eo.TxnStatus.PENDING : A ? eo.TxnStatus.DELAY : eo.TxnStatus.FAILED,
                    f = !s.txn.metadata.hash && s.response.transactionsHashes && s.response.transactionsHashes.length > 0 ? s.response.transactionsHashes[0] : void 0,
                    g = (() => {
                        let e = s.variables.metadata.proxyAddress;
                        if (!e) return;
                        let t = (a.getTransactionCacheManager().getCachedTransactions(e, j.MATIC_CONFIG.chainId) ? .txns ? ? []).find(e => e.txId === s.txn.txId);
                        return t ? .status
                    })(),
                    y = g === eo.TxnStatus.MINED || g === eo.TxnStatus.CONFIRMED ? g : m;
                if (y === eo.TxnStatus.FAILED) {
                    let e = s.variables.metadata.proxyAddress;
                    e && a.handleFailedTransaction(e, j.MATIC_CONFIG.chainId, { ...s.txn,
                        metadata: { ...s.txn.metadata,
                            ...f && {
                                hash: f
                            }
                        }
                    }, s.variables.metadata.market)
                } else r(s.txn.txId, {
                    status: y,
                    ...f && {
                        hash: f
                    }
                });
                if (A) {
                    let e = s.variables.metadata.proxyAddress;
                    o ? o(p, "confirmed").then(() => {
                        u(e).then(() => {
                            o ? .(p, "confirmed")
                        })
                    }) : u(e)
                }
                return d || A ? {
                    status: "success",
                    variables: s.variables,
                    payload: s.payload,
                    response: s.response
                } : {
                    status: "failure",
                    variables: s.variables,
                    payload: s.payload,
                    error: Error("Trade not found"),
                    response: s.response
                }
            }))
        }, [e, t, r, a, n, c, u])
    };
    var t8 = {
            success: {
                pattern: [{
                    duration: 30,
                    intensity: .5
                }, {
                    delay: 60,
                    duration: 40,
                    intensity: 1
                }]
            },
            warning: {
                pattern: [{
                    duration: 40,
                    intensity: .8
                }, {
                    delay: 100,
                    duration: 40,
                    intensity: .6
                }]
            },
            error: {
                pattern: [{
                    duration: 40,
                    intensity: .9
                }, {
                    delay: 40,
                    duration: 40,
                    intensity: .9
                }, {
                    delay: 40,
                    duration: 40,
                    intensity: .9
                }]
            },
            light: {
                pattern: [{
                    duration: 15,
                    intensity: .4
                }]
            },
            medium: {
                pattern: [{
                    duration: 25,
                    intensity: .7
                }]
            },
            heavy: {
                pattern: [{
                    duration: 35,
                    intensity: 1
                }]
            },
            soft: {
                pattern: [{
                    duration: 40,
                    intensity: .5
                }]
            },
            rigid: {
                pattern: [{
                    duration: 10,
                    intensity: 1
                }]
            },
            selection: {
                pattern: [{
                    duration: 8,
                    intensity: .3
                }]
            },
            nudge: {
                pattern: [{
                    duration: 80,
                    intensity: .8
                }, {
                    delay: 80,
                    duration: 50,
                    intensity: .3
                }]
            },
            buzz: {
                pattern: [{
                    duration: 1e3,
                    intensity: 1
                }]
            }
        },
        t9 = 0,
        t7 = class e {
            hapticLabel = null;
            domInitialized = !1;
            instanceId;
            debug;
            showSwitch;
            rafId = null;
            patternResolve = null;
            audioCtx = null;
            audioFilter = null;
            audioGain = null;
            audioBuffer = null;
            constructor(e) {
                this.instanceId = ++t9, this.debug = e ? .debug ? ? !1, this.showSwitch = e ? .showSwitch ? ? !1
            }
            static isSupported = "u" > typeof navigator && "function" == typeof navigator.vibrate;
            async trigger(t = [{
                duration: 25,
                intensity: .7
            }], r) {
                let a = function(e) {
                    if ("number" == typeof e) return {
                        vibrations: [{
                            duration: e
                        }]
                    };
                    if ("string" == typeof e) {
                        let t = t8[e];
                        return t ? {
                            vibrations: t.pattern.map(e => ({ ...e
                            }))
                        } : (console.warn(`[web-haptics] Unknown preset: "${e}"`), null)
                    }
                    if (Array.isArray(e)) {
                        if (0 === e.length) return {
                            vibrations: []
                        };
                        if ("number" == typeof e[0]) {
                            let t = [];
                            for (let r = 0; r < e.length; r += 2) {
                                let a = r > 0 ? e[r - 1] : 0;
                                t.push({ ...a > 0 && {
                                        delay: a
                                    },
                                    duration: e[r]
                                })
                            }
                            return {
                                vibrations: t
                            }
                        }
                        return {
                            vibrations: e.map(e => ({ ...e
                            }))
                        }
                    }
                    return {
                        vibrations: e.pattern.map(e => ({ ...e
                        }))
                    }
                }(t);
                if (!a) return;
                let {
                    vibrations: n
                } = a;
                if (0 === n.length) return;
                let i = Math.max(0, Math.min(1, r ? .intensity ? ? .5));
                for (let e of n)
                    if (e.duration > 1e3 && (e.duration = 1e3), !Number.isFinite(e.duration) || e.duration < 0 || void 0 !== e.delay && (!Number.isFinite(e.delay) || e.delay < 0)) return void console.warn("[web-haptics] Invalid vibration values. Durations and delays must be finite non-negative numbers.");
                if (e.isSupported && navigator.vibrate(function(e, t) {
                        let r = [];
                        for (let a = 0; a < e.length; a++) {
                            let n = e[a],
                                i = Math.max(0, Math.min(1, n.intensity ? ? t)),
                                s = n.delay ? ? 0;
                            s > 0 && (r.length > 0 && r.length % 2 == 0 ? r[r.length - 1] += s : (0 === r.length && r.push(0), r.push(s)));
                            let o = function(e, t) {
                                if (t >= 1) return [e];
                                if (t <= 0) return [];
                                let r = Math.max(1, Math.round(20 * t)),
                                    a = 20 - r,
                                    n = [],
                                    i = e;
                                for (; i >= 20;) n.push(r), n.push(a), i -= 20;
                                if (i > 0) {
                                    let e = Math.max(1, Math.round(i * t));
                                    n.push(e);
                                    let r = i - e;
                                    r > 0 && n.push(r)
                                }
                                return n
                            }(n.duration, i);
                            if (0 === o.length) {
                                r.length > 0 && r.length % 2 == 0 ? r[r.length - 1] += n.duration : n.duration > 0 && (r.push(0), r.push(n.duration));
                                continue
                            }
                            for (let e of o) r.push(e)
                        }
                        return r
                    }(n, i)), !e.isSupported || this.debug) {
                    if (this.ensureDOM(), !this.hapticLabel) return;
                    this.debug && await this.ensureAudio(), this.stopPattern();
                    let e = (n[0] ? .delay ? ? 0) === 0;
                    if (e && (this.hapticLabel.click(), this.debug && this.audioCtx)) {
                        let e = Math.max(0, Math.min(1, n[0].intensity ? ? i));
                        this.playClick(e)
                    }
                    await this.runPattern(n, i, e)
                }
            }
            cancel() {
                this.stopPattern(), e.isSupported && navigator.vibrate(0)
            }
            destroy() {
                this.stopPattern(), this.hapticLabel && (this.hapticLabel.remove(), this.hapticLabel = null, this.domInitialized = !1), this.audioCtx && (this.audioCtx.close(), this.audioCtx = null, this.audioFilter = null, this.audioGain = null, this.audioBuffer = null)
            }
            setDebug(e) {
                this.debug = e, !e && this.audioCtx && (this.audioCtx.close(), this.audioCtx = null, this.audioFilter = null, this.audioGain = null, this.audioBuffer = null)
            }
            setShowSwitch(e) {
                if (this.showSwitch = e, this.hapticLabel) {
                    let t = this.hapticLabel.querySelector("input");
                    this.hapticLabel.style.display = e ? "" : "none", t && (t.style.display = e ? "" : "none")
                }
            }
            stopPattern() {
                null !== this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = null), this.patternResolve ? .(), this.patternResolve = null
            }
            runPattern(e, t, r) {
                return new Promise(a => {
                    this.patternResolve = a;
                    let n = [],
                        i = 0;
                    for (let r of e) {
                        let e = Math.max(0, Math.min(1, r.intensity ? ? t)),
                            a = r.delay ? ? 0;
                        a > 0 && (i += a, n.push({
                            end: i,
                            isOn: !1,
                            intensity: 0
                        })), i += r.duration, n.push({
                            end: i,
                            isOn: !0,
                            intensity: e
                        })
                    }
                    let s = i,
                        o = 0,
                        l = -1,
                        c = e => {
                            0 === o && (o = e);
                            let t = e - o;
                            if (t >= s) {
                                this.rafId = null, this.patternResolve = null, a();
                                return
                            }
                            let i = n[0];
                            for (let e of n)
                                if (t < e.end) {
                                    i = e;
                                    break
                                }
                            if (i.isOn) {
                                let t = 16 + (1 - i.intensity) * 184; - 1 === l ? (l = e, r || (this.hapticLabel ? .click(), this.debug && this.audioCtx && this.playClick(i.intensity), r = !0)) : e - l >= t && (this.hapticLabel ? .click(), this.debug && this.audioCtx && this.playClick(i.intensity), l = e)
                            }
                            this.rafId = requestAnimationFrame(c)
                        };
                    this.rafId = requestAnimationFrame(c)
                })
            }
            playClick(e) {
                if (!this.audioCtx || !this.audioFilter || !this.audioGain || !this.audioBuffer) return;
                let t = this.audioBuffer.getChannelData(0);
                for (let e = 0; e < t.length; e++) t[e] = (2 * Math.random() - 1) * Math.exp(-e / 25);
                this.audioGain.gain.value = .5 * e;
                let r = 1 + (Math.random() - .5) * .3;
                this.audioFilter.frequency.value = (2e3 + 2e3 * e) * r;
                let a = this.audioCtx.createBufferSource();
                a.buffer = this.audioBuffer, a.connect(this.audioFilter), a.onended = () => a.disconnect(), a.start()
            }
            async ensureAudio() {
                if (!this.audioCtx && "u" > typeof AudioContext) {
                    this.audioCtx = new AudioContext, this.audioFilter = this.audioCtx.createBiquadFilter(), this.audioFilter.type = "bandpass", this.audioFilter.frequency.value = 4e3, this.audioFilter.Q.value = 8, this.audioGain = this.audioCtx.createGain(), this.audioFilter.connect(this.audioGain), this.audioGain.connect(this.audioCtx.destination), this.audioBuffer = this.audioCtx.createBuffer(1, .004 * this.audioCtx.sampleRate, this.audioCtx.sampleRate);
                    let e = this.audioBuffer.getChannelData(0);
                    for (let t = 0; t < e.length; t++) e[t] = (2 * Math.random() - 1) * Math.exp(-t / 25)
                }
                this.audioCtx ? .state === "suspended" && await this.audioCtx.resume()
            }
            ensureDOM() {
                if (this.domInitialized || typeof document > "u") return;
                let e = `web-haptics-${this.instanceId}`,
                    t = document.createElement("label");
                t.setAttribute("for", e), t.textContent = "Haptic feedback", t.style.position = "fixed", t.style.bottom = "10px", t.style.left = "10px", t.style.padding = "5px 10px", t.style.backgroundColor = "rgba(0, 0, 0, 0.7)", t.style.color = "white", t.style.fontFamily = "sans-serif", t.style.fontSize = "14px", t.style.borderRadius = "4px", t.style.zIndex = "9999", t.style.userSelect = "none", this.hapticLabel = t;
                let r = document.createElement("input");
                r.type = "checkbox", r.setAttribute("switch", ""), r.id = e, r.style.all = "initial", r.style.appearance = "auto", this.showSwitch || (t.style.display = "none", r.style.display = "none"), t.appendChild(r), document.body.appendChild(t), this.domInitialized = !0
            }
        },
        re = e.i(36964);
    let rt = () => {
        let e, t, r, a, n, i = (0, z.c)(8),
            {
                trigger: s
            } = (n = (0, o.useRef)(null), (0, o.useEffect)(() => (n.current = new t7(void 0), () => {
                n.current ? .destroy(), n.current = null
            }), []), (0, o.useEffect)(() => {
                n.current ? .setDebug((void 0) ? ? !1)
            }, [void 0]), (0, o.useEffect)(() => {
                n.current ? .setShowSwitch((void 0) ? ? !1)
            }, [void 0]), {
                trigger: (0, o.useCallback)((e, t) => n.current ? .trigger(e, t), []),
                cancel: (0, o.useCallback)(() => n.current ? .cancel(), []),
                isSupported: t7.isSupported
            }); {
            let t;
            i[0] === Symbol.for("react.memo_cache_sentinel") ? (t = (0, re.isMobile)(), i[0] = t) : t = i[0], e = t
        }
        let l = e;
        i[1] !== s ? (t = () => {
            l && s(12)
        }, i[1] = s, i[2] = t) : t = i[2];
        let c = t;
        i[3] !== s ? (r = () => {
            l && s("success")
        }, i[3] = s, i[4] = r) : r = i[4];
        let u = r;
        return i[5] !== c || i[6] !== u ? (a = {
            hapticsEnabled: l,
            triggerButtonTap: c,
            triggerOrderSuccess: u
        }, i[5] = c, i[6] = u, i[7] = a) : a = i[7], a
    };
    e.s(["useGlobalButtonClickHaptics", 0, () => {
        let e, t, r = (0, z.c)(4),
            {
                hapticsEnabled: a,
                triggerButtonTap: n
            } = rt();
        r[0] !== a || r[1] !== n ? (e = () => {
            if (!a) return;
            let e = e => {
                var t;
                let r = (t = e.target) instanceof Element ? t.closest('button,[role="button"],input[type="button"],input[type="submit"],[data-haptics-click]') : null;
                !r || r.hasAttribute("disabled") || "true" === r.getAttribute("aria-disabled") || "off" === r.getAttribute("data-haptics") || n()
            };
            return document.addEventListener("click", e, {
                capture: !0
            }), () => document.removeEventListener("click", e, {
                capture: !0
            })
        }, t = [a, n], r[0] = a, r[1] = n, r[2] = e, r[3] = t) : (e = r[2], t = r[3]), o.default.useEffect(e, t)
    }, "useHaptics", 0, rt], 196144);
    var rr = e.i(972846);
    let ra = () => {
            let e = e0(),
                t = (0, T.useToast)(),
                r = t5(),
                {
                    orderType: a
                } = (0, rr.useLocalStorageOrderType)(),
                n = (0, s.useQueryClient)(),
                {
                    triggerOrderSuccess: l
                } = rt();
            return o.default.useCallback(async s => {
                let o = (0, eS.getOrderToastPosition)(),
                    c = String(s.response ? .status ? ? "").toLowerCase(),
                    u = Array.isArray(s.response ? .tradeIds) ? s.response ? .tradeIds : void 0,
                    d = Array.isArray(s.response ? .transactionsHashes) ? s.response ? .transactionsHashes : void 0,
                    p = "matched" === c || void 0 !== u && u.length > 0 || void 0 !== d && d.length > 0;
                if (s.orderType === R.OrderType.Market || p) {
                    if (s.orderType === R.OrderType.Market) {
                        let e = s.variables.metadata.market,
                            t = {
                                hasConditionId: "string" == typeof e.conditionId,
                                hasOutcomes: Array.isArray(e.outcomes),
                                hasOutcomePrices: Array.isArray(e.outcomePrices),
                                hasClobTokenIds: Array.isArray(e.clobTokenIds),
                                hasQuestion: "string" == typeof e.question,
                                hasSlug: "string" == typeof e.slug,
                                outcomesLength: Array.isArray(e.outcomes) ? e.outcomes.length : 0,
                                outcomePricesLength: Array.isArray(e.outcomePrices) ? e.outcomePrices.length : 0,
                                clobTokenIdsLength: Array.isArray(e.clobTokenIds) ? e.clobTokenIds.length : 0
                            };
                        t.hasConditionId && t.hasOutcomes && t.hasOutcomePrices && t.hasClobTokenIds && t.hasQuestion && t.hasSlug || el.logger.warn("[useHandleOrderSuccess] incomplete market metadata", {
                            orderId: s.response ? .orderID,
                            localOrderId: s.variables.metadata.localOrderID,
                            proxyAddress: s.variables.metadata.proxyAddress,
                            trackingParams: s.variables.metadata.trackingParams,
                            conditionId: "string" == typeof e.conditionId ? e.conditionId : s.txn ? .conditionId,
                            slug: "string" == typeof e.slug ? e.slug : void 0,
                            diagnostics: t
                        })
                    }
                    let t = s.txn;
                    if (s.payload.side === i.Side.SELL) {
                        let {
                            market: e
                        } = s.variables.metadata, r = s.variables.metadata.proxyAddress, {
                            selectedOutcomeIdx: a
                        } = s.variables.params, i = (() => {
                            let e = s.txn.metadata.positionQtyBeforeSell;
                            if ("number" == typeof e && Number.isFinite(e)) return e
                        })() ? ? (() => {
                            if (r) try {
                                let t = e_.queryKeys[eN.QueryKey.Positions].optimistic(r).queryKey,
                                    i = n.getQueryData(t);
                                if (!(i instanceof Map)) return;
                                let s = (0, $.makeOptimisticPositionKey)({
                                        conditionId: e.conditionId,
                                        outcomeIndex: 0 === a ? "0" : "1"
                                    }),
                                    o = i.get(s),
                                    l = o ? .position,
                                    c = l ? .trackedPositionMetadata ? .netQuantity ? .optimistic;
                                if ("number" == typeof c && Number.isFinite(c)) return c;
                                let u = l ? .trackedPositionMetadata ? .netQuantity ? .current;
                                if ("number" == typeof u && Number.isFinite(u)) return u;
                                if (!l ? .netQuantity) return;
                                let d = Number.parseFloat((0, H.formatUSDCUnits)(BigInt(l.netQuantity)));
                                return Number.isFinite(d) ? d : void 0
                            } catch {
                                return
                            }
                        })();
                        t = { ...s.txn,
                            metadata: { ...s.txn.metadata,
                                ...void 0 !== i && {
                                    positionQtyBeforeSell: i
                                }
                            }
                        }
                    }
                    e(t, s.variables.metadata.market), s.orderType === R.OrderType.Market && r(s.variables.metadata.proxyAddress)
                }
                if (s.orderType === R.OrderType.Market && localStorage.setItem(G.LS_MARKET_ORDER_NOTIFICATION, s.response.orderID.toLowerCase()), s.successToast) {
                    let e = s.orderType === R.OrderType.Market && a === i.OrderType.FAK;
                    if (e) {
                        let r, a = s.response,
                            n = a ? .makingAmount != null ? parseFloat(a.makingAmount) : NaN,
                            l = a ? .takingAmount != null ? parseFloat(a.takingAmount) : NaN,
                            c = Number.isFinite(n) && n > 0 && Number.isFinite(l) && l > 0,
                            u = s.payload.price ? ? 0;
                        if (c && (u = s.payload.side === i.Side.BUY ? n / l : l / n), e && void 0 !== a.makingAmount) {
                            let e = s.payload.amount,
                                t = e - n,
                                a = n / e * 100;
                            t > 1e-4 && a < 99.99 && (r = s.payload.side === i.Side.BUY ? `Partially filled: ${Math.round(n)} of ${Math.round(e)} shares (${Math.round(a)}%)` : `Partially filled: ${Math.round(n)} of ${Math.round(e)} shares sold (${Math.round(a)}%)`)
                        }
                        t.success(new E.ToastBuilder().position({
                            side: o
                        }).title((0, eS.generateToastTitleFromOrderCreation)(s.orderType, s.payload.side, s.variables.metadata.market.outcomes[s.variables.params.selectedOutcomeIdx], s.payload.amount)).description(s.variables.metadata.market.question).subtext(r || (0, eS.generateToastSubtextFromOrder)(s.orderType, s.payload.side, u, c ? n : s.payload.amount, (0, Q.getPrecisionFromTickSize)(s.variables.params.tickSize))))
                    } else t.success(new E.ToastBuilder().position({
                        side: o
                    }).title((0, eS.generateToastTitleFromOrderCreation)(s.orderType, s.payload.side, s.variables.metadata.market.outcomes[s.variables.params.selectedOutcomeIdx], s.orderType === R.OrderType.Limit ? s.payload.size : s.payload.amount)).description(s.variables.metadata.market.question).subtext((0, eS.generateToastSubtextFromOrder)(s.orderType, s.payload.side, s.payload.price ? ? 0, s.orderType === R.OrderType.Limit ? s.payload.size : s.payload.amount, (0, Q.getPrecisionFromTickSize)(s.variables.params.tickSize))))
                }
                return l(), ru.Success
            }, [e, t, r, a, n, l])
        },
        rn = new Map,
        ri = (e, t) => {
            rn.set(e, t)
        };
    e.s(["addFallbackOrder", 0, ri, "getFallbackOrder", 0, e => rn.get(e), "isFallbackOrder", 0, e => rn.has(e), "removeFallbackOrder", 0, e => {
        rn.delete(e)
    }], 838900);
    let rs = () => {
        let e, t, r, a = (0, z.c)(9),
            n = (0, S.useEventActiveMarket)();
        a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["selectedOutcomeIdx"], a[0] = e) : e = a[0];
        let {
            selectedOutcomeIdx: s
        } = W(e), o = (0, d.useAsks)(n, s), l = (0, d.useBids)(n, s), c = (0, p.useBoundBookStore)();
        a[1] !== n.clobTokenIds ? .[0] || a[2] !== o || a[3] !== l || a[4] !== c || a[5] !== s ? (t = (e, t, r, a, u) => {
            let d = void 0 === a ? .01 : a,
                p = void 0 === u ? s : u,
                A = r === i.Side.BUY ? o : l;
            if (p !== s) {
                let e = n.clobTokenIds ? .[0] ? .toLowerCase ? .() ? ? "",
                    t = c.getState(),
                    a = t.byAsset[e] ? .tickSizes.active;
                A = a ? t.byAsset[e] ? .views[String(a)] ? .[0 === p ? "zero" : "one"] ? .[r === i.Side.BUY ? "asks" : "bids"] : void 0
            }
            return r === i.Side.BUY ? (0, h.calculateWorstBuyPrice)((0, m.convertPriceRowsToPriceAndSizeAndNet)(A ? .rows ? ? []), e, t, d) : (0, h.calculateWorstSellPrice)((0, m.convertPriceRowsToPriceAndSizeAndNet)(A ? .rows ? ? []), e, t, d)
        }, a[1] = n.clobTokenIds ? .[0], a[2] = o, a[3] = l, a[4] = c, a[5] = s, a[6] = t) : t = a[6];
        let u = t;
        return a[7] !== u ? (r = {
            calculateWorstPrice: u
        }, a[7] = u, a[8] = r) : r = a[8], r
    };

    function ro(e) {
        let t = "";
        return "string" == typeof e ? t = e : e instanceof Error && (t = e.message), t.toLowerCase().includes("fak")
    }
    e.s(["useCalculateWorstPrice", 0, rs], 551068);
    let rl = () => {
            let t = (0, b.useGoogleAnalytics)(),
                r = (0, b.useAmplitudeAnalytics)(),
                {
                    connector: a
                } = (0, y.useAccount)(),
                n = (0, c.useChainId)(),
                s = tO(),
                l = (0, tE.useTrackingEmail)();
            return o.default.useCallback(async o => {
                try {
                    let {
                        params: c,
                        response: u
                    } = ((e, t) => {
                        let {
                            variables: r,
                            response: a,
                            payload: n
                        } = e, s = n.price ? ? 0, o = r.params.side === i.Side.BUY && s > 0 ? n.amount / s : n.amount, l = r.params.feeEnabled ? (0, f.calculateOrderFee)(s, o, {
                            feeSchedule: r.metadata.market.feeSchedule,
                            feeType: r.metadata.market.feeType
                        }).usdc : 0, c = (0, tk.getCardReferrer)();
                        return {
                            params: {
                                trade_type: R.OrderType.Market,
                                trade_side: r.params.side,
                                trade_outcome: r.params.selectedOutcomeIdx,
                                trade_market: r.metadata.market.slug,
                                event_slug: r.metadata.market.events ? .[0] ? .slug,
                                series_slug: r.metadata.market.events ? .[0] ? .series ? .[0] ? .slug,
                                trade_price: n.price ? ? 0,
                                trade_shares: n.amount,
                                trade_size_usdc: r.params.side === i.Side.BUY ? n.amount : n.amount * (n.price ? ? 0),
                                trade_fee_value: l,
                                trade_is_rewards_eligible: !1,
                                trade_status: a ? .status,
                                trade_id: a ? .orderID,
                                ...!!a ? .transactionsHashes && a ? .transactionsHashes.length > 0 && {
                                    trade_hash: JSON.stringify(a ? .transactionsHashes)
                                },
                                ...!!a ? .tradeIds && a ? .tradeIds.length > 0 && {
                                    trade_ids: JSON.stringify(a ? .tradeIds)
                                },
                                event_status : !a ? .success || "string" == typeof a ? .error || "object" == typeof a ? .error && Object.keys(a ? .error).length ? "error" : "success",
                                ...!a ? .success && {
                                    event_error_msg: tv(e, a, t)
                                },
                                trade_location : r.metadata.trackingParams.page,
                                ...r.metadata.trackingParams.viewMode && {
                                    trade_view_mode: r.metadata.trackingParams.viewMode
                                },
                                ...c && {
                                    card_referrer_page: c.page,
                                    card_referrer_position: c.position,
                                    card_referrer_source: c.source
                                }
                            },
                            response: a
                        }
                    })(o, {
                        connectorName: a ? .name ? ? "no connector",
                        chainId: n
                    });
                    t.trackEvent(tT.GAEventAction.TRADE, { ...c,
                        currency: "USD",
                        value: c.trade_size_usdc
                    }), r.trackEvent(q.Events.Trade, { ...c,
                        resp: u
                    }, o.variables.metadata.proxyAddress); {
                        let e = {
                            order_type: "market",
                            trade_size: c.trade_size_usdc,
                            trade_fee_value: c.trade_fee_value,
                            market_slug: c.trade_market,
                            side: c.trade_side,
                            status: c.trade_status
                        };
                        window.dataLayer ? .push({
                            event: "trade",
                            ...e,
                            currency: "USD",
                            value: c.trade_size_usdc,
                            price: c.trade_price,
                            user_id: o.variables.metadata.proxyAddress || void 0
                        });
                        let t = o.variables.metadata.proxyAddress,
                            r = o.variables.metadata.market.events ? .[0] ? .slug ? ? "";
                        "error" in o || o.response ? .success === !1 || (s({
                            tradeParams: e,
                            eventSlug: r,
                            tradeFeeValue: c.trade_fee_value,
                            proxyAddress: t,
                            email: l
                        }), (0, tI.trackMetaEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                content_ids: [r],
                                content_type: "market",
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }), (0, tC.trackRedditEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }), (0, tS.trackTikTokEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }), (0, t_.trackSnapchatEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }), (0, tN.trackTwitterEvent)({
                            eventName: "Purchase",
                            eventId: o.variables.metadata.localOrderID,
                            params: { ...e,
                                value: c.trade_fee_value,
                                currency: "USD"
                            },
                            email: l,
                            externalId: t || void 0
                        }))
                    }
                    let d = { ...c,
                            order_type: "market",
                            resp: u,
                            variables: o,
                            proxyAddress: o.variables.metadata.proxyAddress,
                            localOrderID: o.variables.metadata.localOrderID,
                            connectorName: a ? .name
                        },
                        p = u ? .error ? ? ("error" in o ? tD(o.error) : void 0) ? ? "";
                    if ("string" == typeof p && p.includes("not enough balance")) try {
                        let {
                            axios: t
                        } = await e.A(742085), {
                            DATA_API: r
                        } = await e.A(982315), a = (await t.get(`${r}/positions`, {
                            params: {
                                user: o.variables.metadata.proxyAddress,
                                market: o.variables.metadata.market.conditionId,
                                sizeThreshold: 0,
                                limit: 10
                            },
                            timeout: 5e3
                        })).data ? ? [], n = a.find(e => e.conditionId === o.variables.metadata.market.conditionId);
                        d.dataApiPosition = n ? {
                            size: n.size,
                            currentValue: n.currentValue,
                            avgPrice: n.avgPrice,
                            asset: n.asset
                        } : null, d.dataApiPositionCount = a.length
                    } catch {}
                    el.logger.info("[useTrackMarketOrderEvent] order result", d)
                } catch {}
            }, [t, r, a, n, s, l])
        },
        rc = e => e instanceof Error ? e.message.toLowerCase().includes("fak") : "string" == typeof e && e.toLowerCase().includes("fak");
    var ru = ((r = {})[r.Success = 1] = "Success", r[r.SignatureError = 2] = "SignatureError", r[r.GeneralError = 3] = "GeneralError", r[r.Break = 4] = "Break", r);
    let rd = () => {
        let e, t, r, a, n, N, x, k, D, v, w, O, M, L, B, P, {
                activeMarket: U
            } = (0, S.useEventActiveMarketContext)(["activeMarket"]),
            {
                orderExpiration: G,
                orderType: K,
                priceUsdc: Y,
                selectedOutcome: J,
                selectedOutcomeIdx: ee,
                shares: et,
                side: er,
                slippageTolerance: ea,
                isSellAmountPrefilled: en,
                setSellAmountPrefilled: ei,
                setShares: ec,
                setAmountUpdateLocation: eu
            } = W(["orderExpiration", "orderType", "priceUsdc", "selectedOutcome", "selectedOutcomeIdx", "shares", "side", "slippageTolerance", "isSellAmountPrefilled", "setSellAmountPrefilled", "setShares", "setAmountUpdateLocation"]),
            {
                setApiErrorMessage: ed,
                clob: ep
            } = (0, C.useClobCredentialContext)(),
            {
                authenticationType: eA,
                walletMode: eh
            } = (0, y.useAccount)(),
            em = (0, c.useChainId)(),
            {
                zeroLastPrice: ef,
                oneLastPrice: eg
            } = Z(),
            {
                feeEnabled: ey,
                feeBps: eT
            } = e1(),
            {
                proxyAddress: eE
            } = (0, I.useAccountContext)(["proxyAddress"]),
            {
                feeAdjustedShares: eb
            } = (0, V.useLocalStorageFeeAdjustedShares)(),
            eI = (0, p.useBoundBookStore)(),
            ex = (0, _.useGeoStore)(e => e.hasFetchedLocation),
            {
                data: ek
            } = (0, u.useWalletClient)({
                chainId: j.MATIC_CONFIG.chainId
            }),
            eD = (() => {
                let {
                    calculateWorstPrice: e
                } = rs(), {
                    authenticationType: t,
                    authenticated: r
                } = (0, I.useAccountContext)(["authenticationType", "authenticated"]), {
                    connector: a
                } = (0, y.useAccount)(), {
                    orderType: n
                } = (0, rr.useLocalStorageOrderType)(), i = (0, b.useAmplitudeAnalytics)(), {
                    activeMarket: s
                } = (0, S.useEventActiveMarketContext)(["activeMarket"]), l = (0, d.useMarketBestPrices)(s), c = (0, tc.useGetTickSize)(), {
                    trackedProxyUsdcBalance: u
                } = (0, es.default)();
                return o.default.useCallback(async (t, r) => {
                    let a, o, d, {
                            onPrepared: p,
                            onSuccess: A,
                            onError: h,
                            recoverClobClient: m
                        } = r ? ? {},
                        {
                            amount: f,
                            side: g,
                            slippageTolerance: y,
                            tokenID: T,
                            tickSize: E,
                            feeEnabled: b,
                            feeBps: I,
                            negRisk: C,
                            clob: S,
                            selectedOutcomeIdx: _,
                            mode: N = "default"
                        } = {
                            amount: (a = t.params).amount,
                            side: a.side,
                            slippageTolerance: a.slippageTolerance,
                            tokenID: a.tokenID,
                            selectedOutcomeIdx: a.selectedOutcomeIdx,
                            tickSize: a.tickSize,
                            feeEnabled: a.feeEnabled,
                            feeBps: a.feeBps,
                            negRisk: void 0 !== a.negRisk && a.negRisk,
                            clob: a.clob,
                            mode: void 0 !== a.mode ? a.mode : "default"
                        },
                        x = c({
                            assetId: T,
                            fallback: E
                        }),
                        k = e(f, y, g, x, _),
                        D = {
                            amount: parseFloat(f),
                            tokenID: T,
                            price: (0, Q.formatPriceForTickSize)(k, x),
                            ...b && {
                                feeRateBps: I
                            },
                            ...g === e2.Side.BUY && Number.isFinite(u.current) && u.current > 0 && {
                                userUSDCBalance: u.current
                            },
                            side: g
                        },
                        v = 0 === _ ? "~zero" : "~one",
                        w = e(f, 0, g, x, _),
                        O = l ? .[v] ? .buy,
                        M = l ? .[v] ? .sell,
                        L = Math.round(100 * y),
                        B = (o = Number(O), d = Number(M), "BUY" === g && o > 0 && w > 0 ? Math.round((w / o - 1) * 1e4) : "SELL" === g && d > 0 && w > 0 ? Math.round((1 - w / d) * 1e4) : void 0),
                        P = null == B ? void 0 : Math.max(0, B),
                        F = D.amount;
                    if (p) try {
                        await p({
                            variables: t,
                            payload: D
                        })
                    } catch (e) {
                        el.logger.warn("[useCreateAndPostMarketOrder > onPrepared error]", {
                            error: e,
                            localOrderID: t.metadata.localOrderID,
                            side: g,
                            amount: f,
                            tokenID: T
                        })
                    }
                    if ("SELL" === g && Number.isFinite(D.amount) && Math.abs(D.amount - F) > 1e-6) {
                        let t = e(D.amount.toString(), y, g, x, _);
                        D.price = (0, Q.formatPriceForTickSize)(t, x)
                    }
                    try {
                        try {
                            let e = l ? .[0 === _ ? "~zero" : "~one"] ? .sell,
                                t = l ? .[0 === _ ? "~zero" : "~one"] ? .buy,
                                r = {
                                    market_id: s.id,
                                    market_slug: s.slug,
                                    outcome_index: _,
                                    token_id: T,
                                    side: g,
                                    order_type: "market",
                                    amount: f,
                                    slippage_tolerance: y,
                                    worst_price: k,
                                    best_bid: e,
                                    best_ask: t
                                };
                            (0, tb.setLastTradeContext)({
                                event: "market",
                                market_id: String(s.id),
                                market_slug: s.slug,
                                outcome_index: _,
                                token_id: T,
                                side: g,
                                amount: f,
                                extra: {
                                    slippage_tolerance: y,
                                    worst_price: k,
                                    best_bid: e,
                                    best_ask: t
                                }
                            }), i.trackEvent(q.Events.OrderUIDetails, r), el.logger.info("[OrderUIDetails]", r)
                        } catch {}
                        let e = await (0, tl.createAndPostOrderWithTickRefresh)({
                                type: "market",
                                assetId: T,
                                payload: { ...D
                                },
                                options: {
                                    tickSize: (0, Q.castToTickSize)(x),
                                    negRisk: C
                                },
                                orderType: n,
                                deferExec: "async" === N,
                                clob: S,
                                recoverClobClient: m
                            }),
                            r = (({
                                response: e,
                                mode: t
                            }) => ({
                                submissionType: t,
                                ...e
                            }))({
                                response: e,
                                mode: N
                            }),
                            a = !r.success || "string" == typeof r ? .error || "object" == typeof r ? .error && Object.keys(r ? .error).length ? {
                                status: "failure",
                                error: "string" == typeof r ? .error ? Error(r.error ? ? "Unknown market order error") : Error(JSON.stringify(r.error ? ? {}))
                            } : {
                                status: "success"
                            };
                        if ("failure" === a.status) {
                            if (ro(a.error)) try {
                                i.trackEvent(q.Events.OrderOutcome, {
                                    market_slug: s.slug,
                                    market_id: s.id,
                                    token_id: T,
                                    outcome_index: _,
                                    side: g,
                                    amount: f,
                                    slippage_tolerance_bps: L,
                                    best_bid: M,
                                    best_ask: O,
                                    quote_worst_price: w,
                                    required_slippage_bps: P,
                                    result: "fail",
                                    error_bucket: "slippage",
                                    error_message: a.error ? .message ? .slice(0, 200)
                                })
                            } catch {}
                            return h ? .({
                                variables: t,
                                payload: D,
                                response: r,
                                error: a.error
                            }), {
                                status: "failure",
                                payload: D,
                                variables: t,
                                response: r,
                                error: a.error
                            }
                        }
                        let o = {
                                status: "success",
                                variables: t,
                                payload: D,
                                response: r
                            },
                            c = tr({
                                orderType: R.OrderType.Market,
                                args: o
                            });
                        try {
                            i.trackEvent(q.Events.OrderOutcome, {
                                market_slug: s.slug,
                                market_id: s.id,
                                token_id: T,
                                outcome_index: _,
                                side: g,
                                amount: f,
                                slippage_tolerance_bps: L,
                                best_bid: M,
                                best_ask: O,
                                quote_worst_price: w,
                                required_slippage_bps: P,
                                result: "success"
                            })
                        } catch {}
                        return A ? .({
                            variables: t,
                            payload: D,
                            response: r,
                            transaction: c
                        }), { ...o,
                            transaction: c
                        }
                    } catch (e) {
                        if ((0, tn.isUserRejection)(e) ? el.logger.warn("[useCreateAndPostMarketOrder > user rejected]", {
                                amount: f,
                                side: g,
                                slippageTolerance: y,
                                tokenID: T,
                                tickSize: x,
                                feeEnabled: b,
                                feeBps: I,
                                negRisk: C,
                                mode: N,
                                error: e
                            }) : el.logger.error("[useCreateAndPostMarketOrder > error]", {
                                amount: f,
                                side: g,
                                slippageTolerance: y,
                                tokenID: T,
                                tickSize: x,
                                feeEnabled: b,
                                feeBps: I,
                                negRisk: C,
                                mode: N,
                                error: e
                            }), ro(e)) try {
                            i.trackEvent(q.Events.OrderOutcome, {
                                market_slug: s.slug,
                                market_id: s.id,
                                token_id: T,
                                outcome_index: _,
                                side: g,
                                amount: f,
                                slippage_tolerance_bps: L,
                                best_bid: M,
                                best_ask: O,
                                quote_worst_price: w,
                                required_slippage_bps: P,
                                result: "fail",
                                error_message: e instanceof Error ? e.message.slice(0, 100) : void 0
                            })
                        } catch {}
                        return h ? .({
                            variables: t,
                            payload: D,
                            response: void 0,
                            error: e
                        }), {
                            status: "failure",
                            payload: D,
                            variables: t,
                            response: void 0,
                            error: e
                        }
                    }
                }, [e, t, r, a, n, i, s, l, u.current])
            })(),
            ev = (() => {
                let {
                    authenticationType: e,
                    authenticated: t
                } = (0, I.useAccountContext)(["authenticationType", "authenticated"]), r = (0, b.useAmplitudeAnalytics)(), {
                    activeMarket: a
                } = (0, S.useEventActiveMarketContext)(["activeMarket"]), {
                    selectedOutcomeIdx: n
                } = W(["selectedOutcomeIdx"]), i = (0, d.useMarketBestPrices)(a), s = (0, tc.useGetTickSize)(), {
                    trackedProxyUsdcBalance: l
                } = (0, es.default)();
                return o.default.useCallback(async (e, t) => {
                    let o, {
                            onSuccess: c,
                            onError: u,
                            recoverClobClient: d
                        } = t ? ? {},
                        {
                            size: p,
                            price: A,
                            expiration: h,
                            side: m,
                            tokenID: f,
                            tickSize: g,
                            feeEnabled: y,
                            feeBps: T,
                            negRisk: E,
                            clob: b,
                            mode: I
                        } = {
                            size: (o = e.params).size,
                            price: o.price,
                            side: o.side,
                            expiration: o.expiration,
                            tokenID: o.tokenID,
                            selectedOutcomeIdx: o.selectedOutcomeIdx,
                            tickSize: o.tickSize,
                            feeEnabled: o.feeEnabled,
                            feeBps: o.feeBps,
                            negRisk: void 0 !== o.negRisk && o.negRisk,
                            clob: o.clob,
                            mode: o.mode ? ? "default"
                        },
                        C = s({
                            assetId: f,
                            fallback: g
                        }),
                        S = {
                            tokenID: f,
                            side: m,
                            size: parseFloat(p),
                            price: A,
                            expiration: h,
                            ...y && {
                                feeRateBps: T
                            },
                            ...m === e2.Side.BUY && Number.isFinite(l.current) && l.current > 0 && {
                                userUSDCBalance: l.current
                            }
                        };
                    try {
                        try {
                            let e = i ? .[0 === n ? "~zero" : "~one"] ? .buy,
                                t = i ? .[0 === n ? "~zero" : "~one"] ? .sell,
                                s = {
                                    market_id: a.id,
                                    market_slug: a.slug,
                                    outcome_index: n,
                                    token_id: f,
                                    side: m,
                                    order_type: "limit",
                                    size: p,
                                    limit_price: A,
                                    best_bid: e,
                                    best_ask: t
                                };
                            r.trackEvent(q.Events.OrderUIDetails, s), el.logger.info("[OrderUIDetails]", s)
                        } catch {}
                        let t = await (0, tl.createAndPostOrderWithTickRefresh)({
                                type: "limit",
                                payload: { ...S
                                },
                                options: {
                                    tickSize: (0, Q.castToTickSize)(C),
                                    negRisk: E
                                },
                                orderType: h ? to.OrderType.GTD : to.OrderType.GTC,
                                deferExec: "async" === I,
                                assetId: f,
                                clob: b,
                                recoverClobClient: d
                            }),
                            s = (({
                                response: e,
                                mode: t
                            }) => ({
                                submissionType: t,
                                ...e
                            }))({
                                response: t,
                                mode: I
                            }),
                            o = !s.success || "string" == typeof s ? .error || "object" == typeof s ? .error && Object.keys(s ? .error).length ? {
                                status: "failure",
                                error: "string" == typeof s ? .error ? Error(s.error ? ? "Error validating limit order") : Error(JSON.stringify(s.error ? ? {}))
                            } : {
                                status: "success"
                            };
                        if ("failure" === o.status) return u ? .({
                            variables: e,
                            payload: S,
                            response: s,
                            error: o.error
                        }), {
                            status: "failure",
                            payload: S,
                            variables: e,
                            response: s,
                            error: o.error
                        };
                        let l = {
                                status: "success",
                                variables: e,
                                payload: S,
                                response: s
                            },
                            g = tr({
                                orderType: R.OrderType.Limit,
                                args: l
                            });
                        return c ? .({
                            variables: e,
                            payload: S,
                            response: s,
                            transaction: g
                        }), (0, tu.trackEvent)("limit_order_placed", {
                            order_id: s.orderID,
                            market_id: e.params.tokenID,
                            side: S.side,
                            price: S.price,
                            size: S.size
                        }), { ...l,
                            transaction: g
                        }
                    } catch (t) {
                        return (0, tn.isUserRejection)(t) ? el.logger.warn("[useCreateAndPostLimitOrder > user rejected]", {
                            size: p,
                            price: A,
                            expiration: h,
                            side: m,
                            tokenID: f,
                            tickSize: C,
                            feeEnabled: y,
                            feeBps: T,
                            negRisk: E,
                            mode: I,
                            error: t
                        }) : el.logger.error("[useCreateAndPostLimitOrder > error]", {
                            size: p,
                            price: A,
                            expiration: h,
                            side: m,
                            tokenID: f,
                            tickSize: C,
                            feeEnabled: y,
                            feeBps: T,
                            negRisk: E,
                            mode: I,
                            error: t
                        }), u ? .({
                            variables: e,
                            payload: S,
                            response: void 0,
                            error: t
                        }), {
                            status: "failure",
                            payload: S,
                            variables: e,
                            response: void 0,
                            error: t
                        }
                    }
                }, [e, t, r, a, n, i, l.current])
            })(),
            ew = e0(),
            eO = eX(),
            eR = (0, s.useQueryClient)(),
            eM = (t = (0, z.c)(4), r = rl(), a = ra(), n = t4(), t[0] !== n || t[1] !== a || t[2] !== r ? (e = async e => {
                if (r(e), tL(e)) return n({
                    txn: e.transaction,
                    orderType: R.OrderType.Market,
                    ...e
                }).then(t => "failure" === t.status ? (e.onError ? .(t), ru.GeneralError) : (e.onSuccess ? .(t), ru.Success));
                let {
                    onSuccess: t,
                    ...i
                } = e;
                return t ? .(i), a({
                    txn: e.transaction,
                    orderType: R.OrderType.Market,
                    ...e
                })
            }, t[0] = n, t[1] = a, t[2] = r, t[3] = e) : e = t[3], e),
            eL = (x = (0, z.c)(3), k = rl(), D = tf(), x[0] !== D || x[1] !== k ? (N = async e => {
                k(e);
                let {
                    onError: t,
                    ...r
                } = e;
                return t ? .(r), D({ ...e,
                    orderType: R.OrderType.Market
                })
            }, x[0] = D, x[1] = k, x[2] = N) : N = x[2], N),
            eB = (() => {
                let e = tR(),
                    t = ra(),
                    r = t4(),
                    a = (0, s.useQueryClient)(),
                    {
                        getApiCredential: n
                    } = (0, C.useClobCredentialContext)();
                return o.default.useCallback(async i => {
                    if (e(i), i.variables.metadata.proxyAddress && (0, $.seedPartialPositionMarket)({
                            queryClient: a,
                            partialPositionMarket: (0, X.convertMarketToPartialPositionMarket)(i.variables.metadata.market),
                            proxyAddress: i.variables.metadata.proxyAddress
                        }), tL(i)) return r({
                        txn: i.transaction,
                        orderType: R.OrderType.Limit,
                        ...i
                    }).then(e => "failure" === e.status ? (i.onError ? .(e), ru.GeneralError) : (i.onSuccess ? .(e), ru.Success));
                    let {
                        onSuccess: s,
                        ...o
                    } = i;
                    s ? .(o);
                    try {
                        let e = i.variables.metadata.proxyAddress ? n(i.variables.metadata.proxyAddress) ? .key : void 0,
                            t = String(i.response ? .status ? ? "").toLowerCase(),
                            r = Array.isArray(i.response ? .tradeIds) && i.response ? .tradeIds.length > 0 || Array.isArray(i.response ? .transactionsHashes) && i.response ? .transactionsHashes.length > 0;
                        if (e && "live" === t && !r) {
                            let t = i.variables.metadata.market.conditionId,
                                r = Date.now(),
                                n = tM({
                                    asset_id: i.variables.params.tokenID,
                                    associate_trades: null,
                                    created_at: r,
                                    expiration: i.variables.params.expiration ? String(i.variables.params.expiration) : void 0,
                                    id: i.response.orderID,
                                    maker_address: i.variables.metadata.proxyAddress ? ? "",
                                    market: t,
                                    order_type: i.variables.params.expiration ? "GTD" : "GTC",
                                    original_size: i.payload.size.toString(),
                                    outcome: i.variables.metadata.market.outcomes[i.variables.params.selectedOutcomeIdx] ? ? "",
                                    owner: e,
                                    price: String(i.payload.price ? ? i.variables.params.price),
                                    side: i.payload.side,
                                    size_matched: "0",
                                    status: void 0
                                }),
                                s = e_.queryKeys[eN.QueryKey.OpenOrders].apiKey(e).queryKey;
                            a.getQueryState(s) && a.setQueryData(s, e => {
                                let t = (Array.isArray(e) ? e : []).filter(e => e ? .orderID !== n.orderID);
                                return [n, ...t]
                            });
                            let o = "string" == typeof t && "" !== t ? e_.queryKeys[eN.QueryKey.OpenOrders].apiKeyAndMarket(e, t).queryKey : void 0,
                                l = o ? a.getQueryState(o) : void 0;
                            o && l && a.setQueryData(o, e => {
                                let t = (Array.isArray(e) ? e : []).filter(e => e ? .orderID !== n.orderID);
                                return [n, ...t]
                            }), a.invalidateQueries({
                                queryKey: e_.queryKeys[eN.QueryKey.OpenOrders].apiKey(e).queryKey
                            }), a.invalidateQueries({
                                queryKey: e_.queryKeys[eN.QueryKey.OpenOrderScoring].tokenId(i.variables.params.tokenID).queryKey
                            })
                        }
                    } catch {}
                    return t({
                        txn: i.transaction,
                        orderType: R.OrderType.Limit,
                        ...i
                    })
                }, [e, t, r, a, n])
            })(),
            eP = (w = (0, z.c)(3), O = tR(), M = tf(), w[0] !== M || w[1] !== O ? (v = async e => {
                O(e);
                let {
                    onError: t,
                    ...r
                } = e;
                return t ? .(r), M({ ...e,
                    orderType: R.OrderType.Limit
                })
            }, w[0] = M, w[1] = O, w[2] = v) : v = w[2], v),
            eF = (B = (0, z.c)(2), P = (0, T.useToast)(), B[0] !== P ? (L = e => {
                let {
                    error: t,
                    localOrderID: r,
                    orderType: a,
                    side: n,
                    selectedOutcome: i,
                    selectedOutcomeIdx: s,
                    proxyAddress: o,
                    trackingParams: l,
                    market: c,
                    chainId: u,
                    clob: d,
                    signer: p,
                    hasFetchedLocation: A,
                    errorToast: h
                } = e, m = void 0 === u ? j.MATIC_CONFIG.chainId : u, f = (0, tn.isUserRejection)(t);
                f ? el.logger.warn("[useCreateOrder] user rejected", {
                    error: t,
                    localOrderID: r
                }) : el.logger.error("[useCreateOrder] catch", {
                    error: t,
                    localOrderID: r
                }), f || (0, eC.handleError)(t, "trade_creation_error", o, "high", {
                    localOrderID: r,
                    orderType: a,
                    side: n,
                    selectedOutcome: i,
                    selectedOutcomeIdx: s,
                    activeMarket: {
                        slug: c.slug,
                        conditionId: c.conditionId,
                        question: c.question
                    },
                    trackingParams: l,
                    hasFetchedLocation: A,
                    hasClob: !!d,
                    hasSigner: !!p,
                    chainId: m
                });
                let g = f ? "Signature rejected" : `${a} ${(0,ta.capitalize)(n)} ${(0,ta.capitalize)(c.outcomes[s])} failed`;
                if (h) {
                    let e = (0, eS.getOrderToastPosition)(),
                        t = new E.ToastBuilder().position({
                            side: e
                        }).title(g).description(c.question);
                    f || t.subtext("Unknown error"), P.error(t)
                }
                return ru.GeneralError
            }, B[0] = P, B[1] = L) : L = B[1], L),
            eU = (0, ti.useFeatureFlag)("async_order_submission") ? "async" : te,
            eG = (0, b.useAmplitudeAnalytics)(),
            eH = (0, T.useToast)(),
            ej = (0, ts.useRecoverClobClient)();
        return o.default.useCallback(async (e, t) => {
            let r, {
                    options: a,
                    values: n,
                    tracking: s
                } = e ? ? {},
                {
                    successToast: o = !0,
                    errorToast: c = !0,
                    submissionType: u = eU
                } = a ? ? {},
                {
                    orderType: p,
                    priceUsdc: y,
                    shares: T,
                    side: b,
                    selectedOutcomeIdx: I,
                    isSellAmountPrefilled: C
                } = n ? ? {},
                S = p ? ? K,
                _ = C ? ? en,
                N = s ? ? {
                    page: "events",
                    source: "buy-sell-widget"
                },
                x = "number" == typeof I && Number.isFinite(I) ? I : ee,
                k = Array.isArray(U.outcomes) && x >= 0 && x < U.outcomes.length ? U.outcomes[x] : J;
            ed(null);
            let D = (({
                selectedOutcome: e,
                activeMarket: t,
                clob: r,
                hasFetchedLocation: a,
                signer: n
            }) => "string" != typeof e ? {
                status: "failure",
                message: "Outcome is not string",
                error: ru.GeneralError
            } : t.clobTokenIds ? r && r ? .creds ? .key ? a ? n ? {
                status: "success"
            } : {
                status: "failure",
                message: "No signer",
                error: ru.GeneralError
            } : {
                status: "failure",
                message: "Has not fetched location yet",
                error: ru.GeneralError
            } : {
                status: "failure",
                message: "No clob",
                error: ru.GeneralError
            } : {
                status: "failure",
                message: "No market",
                error: ru.GeneralError
            })({
                selectedOutcome: k,
                activeMarket: U,
                clob: ep,
                hasFetchedLocation: ex,
                signer: ek
            });
            if ("failure" === D.status) return el.logger.warn("[useCreateOrder] validation failed", {
                message: D.message,
                error: D.error
            }), D.error;
            if (!ep) return 3;
            let v = crypto.randomUUID();
            try {
                var w;
                let e, a, {
                        priceNum: n,
                        shares: s,
                        sharesNum: p,
                        side: I,
                        tokenID: C
                    } = (e = (w = {
                        price: {
                            state: Y,
                            injected: y
                        },
                        shares: {
                            state: et,
                            injected: T
                        },
                        side: {
                            state: er,
                            injected: b
                        },
                        market: U,
                        selectedOutcomeIdx: x
                    }).shares.injected || w.shares.state, a = parseFloat(e), {
                        priceNum: w.price.injected ? parseFloat((0, H.formatUSDCUnits)(w.price.injected)) : parseFloat((0, H.formatUSDCUnits)(w.price.state)),
                        shares: e,
                        sharesNum: a,
                        side: w.side.injected || w.side.state,
                        tokenID: w.market.clobTokenIds[w.selectedOutcomeIdx]
                    }),
                    D = (() => {
                        try {
                            if (!eE) return;
                            return eR.getQueriesData({
                                predicate: e => {
                                    let t = e.queryKey;
                                    return t[0] === eN.QueryKey.Positions && "byIds" === t[1] && t[2] === eE
                                }
                            }).flatMap(([, e]) => Array.isArray(e) ? e : []).filter(e => e ? .conditionId === U.conditionId)
                        } catch {
                            return
                        }
                    })();
                el.logger.info("[useCreateOrder] submitting order", {
                    localOrderID: v,
                    selectedOutcomeIdx: x,
                    selectedOutcome: k,
                    tokenID: C,
                    activeMarket: U,
                    negRisk: !!U.negRisk,
                    priceNum: n,
                    sharesNum: p,
                    orderExpiration: G,
                    trackingParams: N,
                    orderType: S,
                    shares: s,
                    cachedPositions: D
                });
                let O = async e => await ev((({
                    size: e,
                    price: t,
                    expiration: r,
                    side: a,
                    tokenID: n,
                    selectedOutcomeIdx: i,
                    market: s,
                    clob: o,
                    feeEnabled: l,
                    feeBps: c,
                    localOrderID: u,
                    proxyAddress: d,
                    zeroLastPrice: p,
                    oneLastPrice: A,
                    trackingParams: h
                }) => ({
                    params: {
                        size: e,
                        price: t,
                        expiration: r,
                        selectedOutcomeIdx: i,
                        side: a,
                        tokenID: n,
                        tickSize: s.orderPriceMinTickSize,
                        feeEnabled: l,
                        feeBps: c,
                        negRisk: !!s.negRisk,
                        clob: o,
                        mode: te
                    },
                    metadata: {
                        market: s,
                        localOrderID: u,
                        proxyAddress: d,
                        zeroLastPrice: p,
                        oneLastPrice: A,
                        trackingParams: h
                    }
                }))({
                    size: e.size,
                    price: e.price ? ? n,
                    expiration: e.expiration,
                    side: I,
                    tokenID: C,
                    selectedOutcomeIdx: x,
                    market: U,
                    clob: ep,
                    feeEnabled: ey,
                    feeBps: eT,
                    localOrderID: e.localOrderID,
                    proxyAddress: eE,
                    zeroLastPrice: ef ? .price ? .toString(),
                    oneLastPrice: eg ? .price ? .toString(),
                    trackingParams: N
                }), {
                    recoverClobClient: ej,
                    onError: ({
                        variables: t,
                        payload: r,
                        response: a,
                        error: n
                    }) => {
                        el.logger.error(`[Limit Order Failure][${e.localOrderID}][${eE}]`, {
                            variables: t,
                            payload: r,
                            response: a,
                            error: n
                        })
                    }
                });
                if (S === R.OrderType.Market) {
                    let e = (() => {
                            if (I === i.Side.SELL && eE) try {
                                let e = e_.queryKeys[eN.QueryKey.Positions].optimistic(eE).queryKey,
                                    t = eR.getQueryData(e);
                                if (!(t instanceof Map)) return;
                                let r = (0, $.makeOptimisticPositionKey)({
                                        conditionId: U.conditionId,
                                        outcomeIndex: 0 === x ? "0" : "1"
                                    }),
                                    a = t.get(r),
                                    n = a ? .position,
                                    i = n ? .trackedPositionMetadata ? .netQuantity ? .optimistic;
                                if ("number" == typeof i && Number.isFinite(i)) return i;
                                let s = n ? .trackedPositionMetadata ? .netQuantity ? .current;
                                if ("number" == typeof s && Number.isFinite(s)) return s;
                                if (!n ? .netQuantity) return;
                                let o = Number.parseFloat((0, H.formatUSDCUnits)(BigInt(n.netQuantity)));
                                return Number.isFinite(o) ? o : void 0
                            } catch {
                                return
                            }
                        })(),
                        a = "magic" === eA && !!eE,
                        d = !!eE && ("magic" === eA || "eoa" === eA),
                        h = Number.parseFloat(s),
                        m = I === i.Side.SELL && Number.isFinite(h) && h > 0 && "number" == typeof e && Number.isFinite(e) && .01 >= Math.abs(e - h),
                        f = d && _ && m;
                    I === i.Side.SELL && _ && ei(!1);
                    let y = (({
                            shares: e,
                            side: t,
                            slippageTolerance: r,
                            tokenID: a,
                            selectedOutcomeIdx: n,
                            market: i,
                            clob: s,
                            feeEnabled: o,
                            feeBps: l,
                            localOrderID: c,
                            proxyAddress: u,
                            zeroLastPrice: d,
                            oneLastPrice: p,
                            trackingParams: A,
                            submissionType: h,
                            positionQtyBeforeSell: m
                        }) => ({
                            params: {
                                amount: e,
                                side: t,
                                slippageTolerance: r,
                                tokenID: a,
                                selectedOutcomeIdx: n,
                                tickSize: i.orderPriceMinTickSize,
                                feeEnabled: o,
                                feeBps: l,
                                clob: s,
                                negRisk: !!i.negRisk,
                                mode: h || te
                            },
                            metadata: {
                                market: i,
                                localOrderID: c,
                                ..."number" == typeof m && Number.isFinite(m) && {
                                    positionQtyBeforeSell: m
                                },
                                proxyAddress: u,
                                zeroLastPrice: d,
                                oneLastPrice: p,
                                trackingParams: A
                            }
                        }))({
                            shares: s,
                            side: I,
                            slippageTolerance: ea,
                            tokenID: C,
                            selectedOutcomeIdx: x,
                            market: U,
                            clob: ep,
                            feeEnabled: ey,
                            feeBps: eT,
                            localOrderID: v,
                            proxyAddress: eE,
                            zeroLastPrice: ef ? .price ? .toString(),
                            oneLastPrice: eg ? .price ? .toString(),
                            trackingParams: N,
                            submissionType: u,
                            ..."number" == typeof e && Number.isFinite(e) && {
                                positionQtyBeforeSell: e
                            }
                        }),
                        T = await eD(y, {
                            recoverClobClient: ej,
                            onPrepared: async ({
                                variables: e,
                                payload: t
                            }) => {
                                if (a) {
                                    let a = (({
                                        variables: e,
                                        payload: t,
                                        chainId: r = e7.MATIC_CONFIG.chainId
                                    }) => {
                                        let a = Date.now(),
                                            {
                                                quantity: n,
                                                usdc: i
                                            } = tt({
                                                orderType: R.OrderType.Market,
                                                side: t.side,
                                                amount: t.amount,
                                                price: t.price ? ? 0
                                            }),
                                            s = t.side === e2.Side.BUY ? (0, eS.computeClobBuyImpact)(i, n, e.params.selectedOutcomeIdx) : (0, eS.computeClobSellImpact)(i, n, e.params.selectedOutcomeIdx);
                                        return new e9(e.metadata.localOrderID, eo.TxnStatus.PENDING).metadata({
                                            chainId: r ? ? 137,
                                            side: t.side,
                                            orderType: R.OrderType.Market,
                                            localOrderId: e.metadata.localOrderID,
                                            ..."number" == typeof e.metadata.positionQtyBeforeSell && Number.isFinite(e.metadata.positionQtyBeforeSell) && {
                                                positionQtyBeforeSell: e.metadata.positionQtyBeforeSell
                                            },
                                            outcome: e.metadata.market.outcomes[e.params.selectedOutcomeIdx],
                                            quantity: n,
                                            usdc: i,
                                            outcomeIndex: e.params.selectedOutcomeIdx,
                                            zeroLastPrice: e.metadata.zeroLastPrice,
                                            oneLastPrice: e.metadata.oneLastPrice,
                                            enqueuedAt: a,
                                            lastUpdatedAt: a,
                                            positionChangeData: s
                                        }).conditionId(e.metadata.market.conditionId).build()
                                    })({
                                        variables: e,
                                        payload: t,
                                        chainId: em
                                    });
                                    r = a, await ew(a, e.metadata.market).catch(a => {
                                        r = void 0, el.logger.error(`[Magic Market Synthetic Push Failure][${v}]`, {
                                            error: a,
                                            variables: e,
                                            payload: t
                                        })
                                    })
                                }
                                if (f && eE) try {
                                    let r = (0, g.createChainAwarePublicClient)({
                                            chainId: em
                                        }),
                                        a = await r.readContract({
                                            address: j.CONDITIONAL_TOKENS_ADDRESS,
                                            abi: A.ConditionalTokensAbi,
                                            functionName: "balanceOf",
                                            args: [eE, BigInt(C)]
                                        }),
                                        n = Number.parseFloat((0, l.formatUnits)(a, 6));
                                    if (Number.isFinite(n) && n > 0 && Math.abs(n - h) > 1e-6) {
                                        el.logger.info("[full-sell-adjust]", {
                                            parsedShares: h,
                                            onChainSharesForFullSell: n,
                                            diff: n - h
                                        });
                                        let r = n.toFixed(6).replace(/\.?0+$/, ""),
                                            a = Number.parseFloat(r);
                                        t.amount = a, e.params.amount = r, e.metadata.positionQtyBeforeSell = a
                                    }
                                } catch {}
                            },
                            onError: ({
                                variables: e,
                                payload: t,
                                response: r,
                                error: a
                            }) => {
                                el.logger.error(`[Market Order Failure][${v}][${eE}]`, {
                                    variables: e,
                                    payload: t,
                                    response: r,
                                    error: a
                                })
                            }
                        });
                    if ("failure" === T.status) {
                        eE && r && eO.handleFailedTransaction(eE, j.MATIC_CONFIG.chainId, r, U);
                        let e = U.events ? .[0] ? .slug ? ? "",
                            a = (0, F.matchesShortDurationUpDown)(e),
                            i = "BUY" === I,
                            o = "magic" === eA,
                            l = n > 0 ? n : void 0,
                            u = i && l ? p / l : p,
                            d = i ? Math.floor(100 * u) / 100 : u;
                        if (rc(T.error) && a && i && o && l && d >= 5) {
                            let r = ea / 100,
                                a = Math.min(Math.round(l * (1 + r) * 100) / 100, .99),
                                i = Math.floor(Date.now() / 1e3),
                                o = await O({
                                    size: String(d),
                                    price: a,
                                    expiration: i + 65,
                                    localOrderID: crypto.randomUUID()
                                });
                            if (eG.trackEvent(q.Events.FakFallbackOrder, {
                                    market_slug: U.slug,
                                    event_slug: e,
                                    token_id: C,
                                    side: I,
                                    amount: s,
                                    fallback_limit_price: a,
                                    fallback_original_price: n,
                                    fallback_slippage_pct: ea,
                                    fallback_limit_size: d,
                                    fallback_result: o.status
                                }), "success" === o.status) {
                                let e = o.response ? .orderID,
                                    r = String(o.response ? .status ? ? "").toLowerCase(),
                                    n = "matched" === r || Array.isArray(o.response ? .tradeIds) && o.response.tradeIds.length > 0;
                                return n && eG.trackEvent(q.Events.FakFallbackOrderMatched, {
                                    order_id: e,
                                    market: U.conditionId,
                                    side: I,
                                    matched_shares: d,
                                    matched_price: a,
                                    matched_notional_usdc: d * a,
                                    amount: p,
                                    fallback_limit_price: a,
                                    fallback_limit_size: d,
                                    match_source: "immediate"
                                }), e && !n && ri(e, {
                                    outcome: k ? ? "",
                                    question: U.question,
                                    side: I,
                                    amount: p,
                                    price: a,
                                    size: d,
                                    expiresAt: i + 65
                                }), ec(""), eu("click"), eB({ ...o,
                                    successToast: !1,
                                    ...t ? .limit
                                })
                            }
                            return eH.error(new E.ToastBuilder().position({
                                side: (0, eS.getOrderToastPosition)()
                            }).title("Trade failed").description(U.question)), eL({ ...T,
                                errorToast: !1,
                                onError: t ? .market ? .onError
                            })
                        }
                        return eG.trackEvent(q.Events.FakFallbackOrderNotSubmitted, {
                            error_msg: T.error,
                            isFakError: rc(T.error),
                            isShortDurationUpDown: a,
                            isBuySide: i,
                            isUserMagic: o,
                            fallbackPrice: !!l,
                            isLimitSizeOver5: d >= 5,
                            limitSize: d
                        }), eL({ ...T,
                            errorToast: c,
                            onError: t ? .market ? .onError
                        })
                    }
                    return eM({ ...T,
                        successToast: o,
                        ...t ? .market
                    })
                }
                if (S === R.OrderType.Limit) {
                    ec(""), eu("click");
                    let e = Math.floor(Date.now() / 1e3),
                        r = s;
                    if (eb && ey && I === i.Side.BUY) {
                        let e = U.clobTokenIds ? .[0] ? .toLowerCase ? .() ? ? "",
                            t = (0, d.asksSelector)(eI.getState(), e, x),
                            a = t ? (0, m.convertPriceRowsToPriceAndSizeAndNet)(t.rows) : [],
                            {
                                marketableSize: i,
                                unmarketableSize: s
                            } = (0, h.getMarketablePortionOfLimitBuy)(a, p, n);
                        r = String((0, f.computeFeeAdjustedLimitSize)(p, i, s, n, {
                            feeSchedule: U.feeSchedule,
                            feeType: U.feeType
                        }))
                    }
                    let a = await O({
                        size: r,
                        expiration: -1 === G ? e + 90 : G && G > e && G - e <= 60 ? G + 60 : G,
                        localOrderID: v
                    });
                    if ("failure" === a.status) return eP({ ...a,
                        errorToast: c,
                        onError: t ? .limit ? .onError
                    });
                    return eB({ ...a,
                        successToast: o,
                        ...t ? .limit
                    })
                }
                return 3
            } catch (e) {
                return S === R.OrderType.Market && eE && r && eO.handleFailedTransaction(eE, j.MATIC_CONFIG.chainId, r, U), eF({
                    error: e,
                    localOrderID: v,
                    orderType: S,
                    side: b || er,
                    selectedOutcome: k,
                    selectedOutcomeIdx: x,
                    market: U,
                    proxyAddress: eE,
                    trackingParams: N,
                    clob: ep,
                    signer: ek,
                    chainId: em,
                    hasFetchedLocation: ex,
                    errorToast: c
                })
            }
        }, [eE, K, er, eA, eh, ed, Y, et, U, ee, J, G, eD, ea, ep, ey, eT, ef, eg, eL, eM, ev, eP, eB, ex, ek, em, eF, eU, en, ei, ec, eu, eG, eH, ew, eO, eR, eb, eI, ej])
    };
    var rp = e.i(628684),
        rA = e.i(130278);

    function rh(e) {
        if (e && "success" === e[0].status && "success" === e[1].status) {
            let [t, r] = e, a = (0, l.formatUnits)(t.result, r.result);
            return {
                value: t.result,
                formatted: a,
                decimals: r.result
            }
        }
    }

    function rm(e) {
        let t, r, a, n, i, s, o, l, c, u = (0, z.c)(30),
            {
                address: d,
                token: p,
                chainId: A
            } = e;
        u[0] !== d ? (t = [d], u[0] = d, u[1] = t) : t = u[1], u[2] !== A || u[3] !== t || u[4] !== p ? (r = {
            address: p,
            abi: ei.erc20Abi,
            functionName: "balanceOf",
            args: t,
            chainId: A
        }, u[2] = A, u[3] = t, u[4] = p, u[5] = r) : r = u[5], u[6] !== A || u[7] !== p ? (a = {
            address: p,
            abi: ei.erc20Abi,
            functionName: "decimals",
            chainId: A
        }, u[6] = A, u[7] = p, u[8] = a) : a = u[8], u[9] !== r || u[10] !== a ? (n = [r, a], u[9] = r, u[10] = a, u[11] = n) : n = u[11];
        let h = !!d;
        u[12] !== h ? (i = {
            enabled: h
        }, u[12] = h, u[13] = i) : i = u[13], u[14] !== n || u[15] !== i ? (s = {
            contracts: n,
            query: i
        }, u[14] = n, u[15] = i, u[16] = s) : s = u[16];
        let {
            data: m,
            isLoading: f,
            isPending: g,
            isSuccess: y,
            isFetching: T,
            isError: E,
            error: b,
            refetch: I
        } = (0, rA.useReadContracts)(s);
        u[17] !== m ? (o = rh(m), u[17] = m, u[18] = o) : o = u[18];
        let C = o;
        u[19] !== I ? (l = async () => ({
            data: rh((await I()).data)
        }), u[19] = I, u[20] = l) : l = u[20];
        let S = l;
        return u[21] !== b || u[22] !== E || u[23] !== T || u[24] !== f || u[25] !== g || u[26] !== y || u[27] !== C || u[28] !== S ? (c = {
            data: C,
            isLoading: f,
            isPending: g,
            refetch: S,
            isSuccess: y,
            isFetching: T,
            isError: E,
            error: b
        }, u[21] = b, u[22] = E, u[23] = T, u[24] = f, u[25] = g, u[26] = y, u[27] = C, u[28] = S, u[29] = c) : c = u[29], c
    }
    e.s(["useTokenBalance", 0, rm], 187150);
    var rf = e.i(635103);
    e.i(369761);
    var rg = e.i(885370),
        ry = e.i(56339),
        rT = e.i(973518);
    let rE = [{
        type: "constructor",
        inputs: [{
            name: "_conditionalTokens",
            type: "address",
            internalType: "address"
        }, {
            name: "_collateralToken",
            type: "address",
            internalType: "address"
        }, {
            name: "_usdce",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "collateralToken",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "conditionalTokens",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "contract IConditionalTokens"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "mergePositions",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_conditionId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_partition",
            type: "uint256[]",
            internalType: "uint256[]"
        }, {
            name: "_amount",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "onERC1155BatchReceived",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "uint256[]",
            internalType: "uint256[]"
        }, {
            name: "",
            type: "uint256[]",
            internalType: "uint256[]"
        }, {
            name: "",
            type: "bytes",
            internalType: "bytes"
        }],
        outputs: [{
            name: "",
            type: "bytes4",
            internalType: "bytes4"
        }],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "onERC1155Received",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "",
            type: "bytes",
            internalType: "bytes"
        }],
        outputs: [{
            name: "",
            type: "bytes4",
            internalType: "bytes4"
        }],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "redeemPositions",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_conditionId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "",
            type: "uint256[]",
            internalType: "uint256[]"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "splitPosition",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_conditionId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_partition",
            type: "uint256[]",
            internalType: "uint256[]"
        }, {
            name: "_amount",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "usdce",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }];
    (a = n || (n = {})).Invalid = "0", a.Call = "1", a.DelegateCall = "2", e.s(["collateralAdapterOperations", 0, {
        splitPosition: ({
            collateralAdapterAddress: e,
            collateralTokenAddress: t,
            conditionId: r,
            outcomeSlotCount: a,
            amount: i
        }) => {
            let s = rT.zeroHash,
                o = Array.from({
                    length: a
                }, (e, t) => 1 n << BigInt(t));
            return [{
                to: e,
                typeCode: n.Call,
                data: (0, ry.encodeFunctionData)({
                    abi: rE,
                    functionName: "splitPosition",
                    args: [t, s, r, o, i]
                }),
                value: "0"
            }]
        },
        mergePositions: ({
            collateralAdapterAddress: e,
            collateralTokenAddress: t,
            conditionId: r,
            outcomeSlotCount: a,
            amount: i
        }) => {
            let s = rT.zeroHash,
                o = Array.from({
                    length: a
                }, (e, t) => 1 n << BigInt(t));
            return [{
                to: e,
                typeCode: n.Call,
                data: (0, ry.encodeFunctionData)({
                    abi: rE,
                    functionName: "mergePositions",
                    args: [t, s, r, o, i]
                }),
                value: "0"
            }]
        },
        redeemPositions: ({
            collateralAdapterAddress: e,
            collateralTokenAddress: t,
            conditionId: r,
            outcomeSlotCount: a
        }) => {
            let i = rT.zeroHash,
                s = Array.from({
                    length: a
                }, (e, t) => 1 n << BigInt(t));
            return [{
                to: e,
                typeCode: n.Call,
                data: (0, ry.encodeFunctionData)({
                    abi: rE,
                    functionName: "redeemPositions",
                    args: [t, i, r, s]
                }),
                value: "0"
            }]
        }
    }], 822315), (0, e.i(504154).parseAbi)(["function addFunding(address,uint256,uint256[],uint256[],uint256[],uint256[])"]), JSON.parse('[{"inputs":[{"internalType":"address","name":"_ctf","type":"address"},{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"address","name":"_vault","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DeterminedFlagAlreadySet","type":"error"},{"inputs":[],"name":"FeeBipsOutOfBounds","type":"error"},{"inputs":[],"name":"IndexOutOfBounds","type":"error"},{"inputs":[],"name":"InvalidIndexSet","type":"error"},{"inputs":[],"name":"LengthMismatch","type":"error"},{"inputs":[],"name":"MarketAlreadyDetermined","type":"error"},{"inputs":[],"name":"MarketAlreadyPrepared","type":"error"},{"inputs":[],"name":"MarketNotPrepared","type":"error"},{"inputs":[],"name":"NoConvertiblePositions","type":"error"},{"inputs":[],"name":"NotApprovedForAll","type":"error"},{"inputs":[],"name":"OnlyOracle","type":"error"},{"inputs":[],"name":"UnexpectedCollateralToken","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"marketId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeBips","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"MarketPrepared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"marketId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"questionId","type":"bytes32"},{"indexed":false,"internalType":"bool","name":"outcome","type":"bool"}],"name":"OutcomeReported","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"PayoutRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":true,"internalType":"bytes32","name":"marketId","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"indexSet","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionsConverted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionsMerge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"marketId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"questionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"QuestionPrepared","type":"event"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NO_TOKEN_BURN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_owners","type":"address[]"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"col","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"},{"internalType":"uint256","name":"_indexSet","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertPositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ctf","outputs":[{"internalType":"contract IConditionalTokens","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_questionId","type":"bytes32"}],"name":"getConditionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getDetermined","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getFeeBips","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getMarketData","outputs":[{"internalType":"MarketData","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_questionId","type":"bytes32"},{"internalType":"bool","name":"_outcome","type":"bool"}],"name":"getPositionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getQuestionCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"}],"name":"getResult","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collateralToken","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mergePositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mergePositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeBips","type":"uint256"},{"internalType":"bytes","name":"_metadata","type":"bytes"}],"name":"prepareMarket","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_marketId","type":"bytes32"},{"internalType":"bytes","name":"_metadata","type":"bytes"}],"name":"prepareQuestion","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"redeemPositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_questionId","type":"bytes32"},{"internalType":"bool","name":"_outcome","type":"bool"}],"name":"reportOutcome","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"uint256[]","name":"_values","type":"uint256[]"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collateralToken","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"splitPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_conditionId","type":"bytes32"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"splitPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wcol","outputs":[{"internalType":"contract WrappedCollateral","name":"","type":"address"}],"stateMutability":"view","type":"function"}]');
    let rb = [{
        type: "constructor",
        inputs: [{
            name: "_conditionalTokens",
            type: "address",
            internalType: "address"
        }, {
            name: "_collateralToken",
            type: "address",
            internalType: "address"
        }, {
            name: "_usdce",
            type: "address",
            internalType: "address"
        }, {
            name: "_negRiskAdapter",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "collateralToken",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "conditionalTokens",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "contract IConditionalTokens"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "convertPositions",
        inputs: [{
            name: "_marketId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_indexSet",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "_amount",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "mergePositions",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_conditionId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_partition",
            type: "uint256[]",
            internalType: "uint256[]"
        }, {
            name: "_amount",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "negRiskAdapter",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "onERC1155BatchReceived",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "uint256[]",
            internalType: "uint256[]"
        }, {
            name: "",
            type: "uint256[]",
            internalType: "uint256[]"
        }, {
            name: "",
            type: "bytes",
            internalType: "bytes"
        }],
        outputs: [{
            name: "",
            type: "bytes4",
            internalType: "bytes4"
        }],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "onERC1155Received",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "",
            type: "uint256",
            internalType: "uint256"
        }, {
            name: "",
            type: "bytes",
            internalType: "bytes"
        }],
        outputs: [{
            name: "",
            type: "bytes4",
            internalType: "bytes4"
        }],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "redeemPositions",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_conditionId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "",
            type: "uint256[]",
            internalType: "uint256[]"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "splitPosition",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }, {
            name: "",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_conditionId",
            type: "bytes32",
            internalType: "bytes32"
        }, {
            name: "_partition",
            type: "uint256[]",
            internalType: "uint256[]"
        }, {
            name: "_amount",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "usdce",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "wrappedCollateral",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }];
    e.s(["negRiskCollateralAdapterOperations", 0, {
        convertPositions: ({
            negRiskCollateralAdapterAddress: e,
            marketId: t,
            indexSet: r,
            amount: a
        }) => [{
            to: e,
            typeCode: n.Call,
            data: (0, ry.encodeFunctionData)({
                abi: rb,
                functionName: "convertPositions",
                args: [t, r, a]
            }),
            value: "0"
        }],
        splitPosition: ({
            negRiskCollateralAdapterAddress: e,
            collateralTokenAddress: t,
            conditionId: r,
            outcomeSlotCount: a,
            amount: i
        }) => {
            let s = rT.zeroHash,
                o = Array.from({
                    length: a
                }, (e, t) => 1 n << BigInt(t));
            return [{
                to: e,
                typeCode: n.Call,
                data: (0, ry.encodeFunctionData)({
                    abi: rb,
                    functionName: "splitPosition",
                    args: [t, s, r, o, i]
                }),
                value: "0"
            }]
        },
        mergePositions: ({
            negRiskCollateralAdapterAddress: e,
            collateralTokenAddress: t,
            conditionId: r,
            outcomeSlotCount: a,
            amount: i
        }) => {
            let s = rT.zeroHash,
                o = Array.from({
                    length: a
                }, (e, t) => 1 n << BigInt(t));
            return [{
                to: e,
                typeCode: n.Call,
                data: (0, ry.encodeFunctionData)({
                    abi: rb,
                    functionName: "mergePositions",
                    args: [t, s, r, o, i]
                }),
                value: "0"
            }]
        },
        redeemPositions: ({
            negRiskCollateralAdapterAddress: e,
            collateralTokenAddress: t,
            conditionId: r,
            outcomeSlotCount: a
        }) => {
            let i = rT.zeroHash,
                s = Array.from({
                    length: a
                }, (e, t) => 1 n << BigInt(t));
            return [{
                to: e,
                typeCode: n.Call,
                data: (0, ry.encodeFunctionData)({
                    abi: rb,
                    functionName: "redeemPositions",
                    args: [t, i, r, s]
                }),
                value: "0"
            }]
        }
    }], 618808);
    let rI = [{
        type: "constructor",
        inputs: [{
            name: "_owner",
            type: "address",
            internalType: "address"
        }, {
            name: "_admin",
            type: "address",
            internalType: "address"
        }, {
            name: "_collateralToken",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "addAdmin",
        inputs: [{
            name: "_admin",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "cancelOwnershipHandover",
        inputs: [],
        outputs: [],
        stateMutability: "payable"
    }, {
        type: "function",
        name: "collateralToken",
        inputs: [],
        outputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "completeOwnershipHandover",
        inputs: [{
            name: "pendingOwner",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "payable"
    }, {
        type: "function",
        name: "grantRoles",
        inputs: [{
            name: "user",
            type: "address",
            internalType: "address"
        }, {
            name: "roles",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "payable"
    }, {
        type: "function",
        name: "hasAllRoles",
        inputs: [{
            name: "user",
            type: "address",
            internalType: "address"
        }, {
            name: "roles",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [{
            name: "",
            type: "bool",
            internalType: "bool"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "hasAnyRole",
        inputs: [{
            name: "user",
            type: "address",
            internalType: "address"
        }, {
            name: "roles",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [{
            name: "",
            type: "bool",
            internalType: "bool"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "owner",
        inputs: [],
        outputs: [{
            name: "result",
            type: "address",
            internalType: "address"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "ownershipHandoverExpiresAt",
        inputs: [{
            name: "pendingOwner",
            type: "address",
            internalType: "address"
        }],
        outputs: [{
            name: "result",
            type: "uint256",
            internalType: "uint256"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "pause",
        inputs: [{
            name: "_asset",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "paused",
        inputs: [{
            name: "",
            type: "address",
            internalType: "address"
        }],
        outputs: [{
            name: "",
            type: "bool",
            internalType: "bool"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "removeAdmin",
        inputs: [{
            name: "_admin",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "renounceOwnership",
        inputs: [],
        outputs: [],
        stateMutability: "payable"
    }, {
        type: "function",
        name: "renounceRoles",
        inputs: [{
            name: "roles",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "payable"
    }, {
        type: "function",
        name: "requestOwnershipHandover",
        inputs: [],
        outputs: [],
        stateMutability: "payable"
    }, {
        type: "function",
        name: "revokeRoles",
        inputs: [{
            name: "user",
            type: "address",
            internalType: "address"
        }, {
            name: "roles",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "payable"
    }, {
        type: "function",
        name: "rolesOf",
        inputs: [{
            name: "user",
            type: "address",
            internalType: "address"
        }],
        outputs: [{
            name: "roles",
            type: "uint256",
            internalType: "uint256"
        }],
        stateMutability: "view"
    }, {
        type: "function",
        name: "transferOwnership",
        inputs: [{
            name: "newOwner",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "payable"
    }, {
        type: "function",
        name: "unpause",
        inputs: [{
            name: "_asset",
            type: "address",
            internalType: "address"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "function",
        name: "wrap",
        inputs: [{
            name: "_asset",
            type: "address",
            internalType: "address"
        }, {
            name: "_to",
            type: "address",
            internalType: "address"
        }, {
            name: "_amount",
            type: "uint256",
            internalType: "uint256"
        }],
        outputs: [],
        stateMutability: "nonpayable"
    }, {
        type: "event",
        name: "OwnershipHandoverCanceled",
        inputs: [{
            name: "pendingOwner",
            type: "address",
            indexed: !0,
            internalType: "address"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "OwnershipHandoverRequested",
        inputs: [{
            name: "pendingOwner",
            type: "address",
            indexed: !0,
            internalType: "address"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "OwnershipTransferred",
        inputs: [{
            name: "oldOwner",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "newOwner",
            type: "address",
            indexed: !0,
            internalType: "address"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "Paused",
        inputs: [{
            name: "asset",
            type: "address",
            indexed: !0,
            internalType: "address"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "RolesUpdated",
        inputs: [{
            name: "user",
            type: "address",
            indexed: !0,
            internalType: "address"
        }, {
            name: "roles",
            type: "uint256",
            indexed: !0,
            internalType: "uint256"
        }],
        anonymous: !1
    }, {
        type: "event",
        name: "Unpaused",
        inputs: [{
            name: "asset",
            type: "address",
            indexed: !0,
            internalType: "address"
        }],
        anonymous: !1
    }, {
        type: "error",
        name: "AlreadyInitialized",
        inputs: []
    }, {
        type: "error",
        name: "ExpiredDeadline",
        inputs: []
    }, {
        type: "error",
        name: "InvalidAsset",
        inputs: []
    }, {
        type: "error",
        name: "InvalidNonce",
        inputs: []
    }, {
        type: "error",
        name: "InvalidSignature",
        inputs: []
    }, {
        type: "error",
        name: "NewOwnerIsZeroAddress",
        inputs: []
    }, {
        type: "error",
        name: "NoHandoverRequest",
        inputs: []
    }, {
        type: "error",
        name: "OnlyUnpaused",
        inputs: []
    }, {
        type: "error",
        name: "Unauthorized",
        inputs: []
    }];
    e.i(198905);
    var rC = e.i(966727);
    e.i(777038);
    var rS = e.i(415013);
    (0, rS.keccak256)((0, rC.encodePacked)(["string"], ["polymarket-wallet-factory"])), (0, rS.keccak256)(" "), e.s([], 979983);
    var r_ = e.i(631503),
        rN = e.i(423582),
        rx = e.i(392566);
    e.s(["default", 0, () => {
        let [e, t] = (0, o.useState)(!1), {
            proxyAddress: r,
            authenticationType: a,
            walletMode: i
        } = (0, I.useAccountContext)(["proxyAddress", "authenticationType", "walletMode"]), {
            sendTransaction: s
        } = (0, r_.default)(), {
            nonce: l,
            incrementNonce: c,
            refreshNonce: d
        } = (0, rp.useSafe)(), {
            nonce: p,
            incrementNonce: A,
            refreshNonce: h
        } = (0, rf.useDepositWallet)(), m = (0, T.useToast)(), {
            data: f,
            isPending: g
        } = (0, u.useWalletClient)({
            chainId: j.MATIC_CONFIG.chainId
        }), y = "magic" === a, b = (0, o.useCallback)(() => {
            m.error(new E.ToastBuilder().title("Conversion failed").subtext("We couldn’t convert your USDC.e. Please try again."))
        }, [m]), {
            refreshTrackedProxyUsdcBalance: C
        } = (0, es.default)(void 0, j.MATIC_CONFIG.chainId, {
            enabled: !1,
            disablePendingTxnSubscription: !0
        }), {
            data: S,
            isLoading: _,
            refetch: N
        } = rm({
            address: r ? ? e5.zeroAddress,
            token: j.USDCE_ADDRESS,
            chainId: j.MATIC_CONFIG.chainId,
            queryOptions: {
                enabled: !!r,
                gcTime: 6e4
            }
        }), x = (0, o.useMemo)(() => S ? .value ? ? 0 n, [S]), k = (0, o.useMemo)(() => !!x && x > 10000 n, [x]), D = (0, o.useCallback)(async e => {
            let o = `wrap-${crypto.randomUUID()}-${Date.now()}`,
                u = (0, rx.startCtfV2Timer)(),
                m = e ? ? x;
            if (!r) return (0, rx.ctfV2Error)("usdce_wrap_failed", {
                reason: "missing_proxy_address",
                durationMs: (0, rx.durationSince)(u)
            }), {
                state: ru.GeneralError
            };
            if (m <= 0 n || void 0 === e && x <= 0 n) return (0, rx.ctfV2Error)("usdce_wrap_failed", {
                reason: "invalid_or_empty_balance",
                balanceBucket: (0, rx.amountBucket)(x),
                amountBucket: (0, rx.amountBucket)(m),
                durationMs: (0, rx.durationSince)(u)
            }), {
                state: ru.GeneralError
            };
            void 0 === e && m > x && (m = x);
            try {
                t(!0), (0, rx.ctfV2Info)("usdce_wrap_started", {
                    uid: o,
                    authType: a,
                    amountBucket: (0, rx.amountBucket)(m),
                    balanceBucket: (0, rx.amountBucket)(x),
                    isCustomAmount: void 0 !== e,
                    txCount: 2
                });
                let f = {
                        to: j.USDCE_ADDRESS,
                        typeCode: rg.CallType.Call,
                        data: (0, ry.encodeFunctionData)({
                            abi: ei.erc20Abi,
                            functionName: "approve",
                            args: [j.COLLATERAL_ONRAMP_ADDRESS, m]
                        }),
                        value: "0"
                    },
                    g = (({
                        onrampAddress: e,
                        asset: t,
                        to: r,
                        amount: a
                    }) => ({
                        to: e,
                        typeCode: n.Call,
                        data: (0, ry.encodeFunctionData)({
                            abi: rI,
                            functionName: "wrap",
                            args: [t, r, a]
                        }),
                        value: "0"
                    }))({
                        onrampAddress: j.COLLATERAL_ONRAMP_ADDRESS,
                        asset: j.USDCE_ADDRESS,
                        to: r,
                        amount: m
                    }),
                    y = [f, g];
                el.logger.info("[handleUsdceWrap] sending transactions", {
                    txCount: y.length,
                    authType: a,
                    amountBucket: (0, rx.amountBucket)(m),
                    uid: o
                });
                let T = (0, r_.getTransactionType)(i),
                    {
                        data: E
                    } = T === r_.TransactionType.EOA ? await d() : {
                        data: void 0
                    },
                    {
                        data: I
                    } = T === r_.TransactionType.DepositWallet ? await h() : {
                        data: void 0
                    },
                    S = T === r_.TransactionType.DepositWallet ? I ? ? p : T === r_.TransactionType.EOA ? E ? ? l : void 0,
                    _ = await s(T, y, 0, j.Network.Matic, 0, void 0, S, r_.TransactionMetadata.Default.valueOf(), T === r_.TransactionType.DepositWallet ? r : void 0);
                if (T === r_.TransactionType.EOA ? c() : T === r_.TransactionType.DepositWallet && await A(), el.logger.info("[handleUsdceWrap] transaction submitted", {
                        uid: o
                    }), !await (0, rN.waitTillMined)(_)) return (0, rx.ctfV2Error)("usdce_wrap_failed", {
                    reason: "not_mined",
                    authType: a,
                    amountBucket: (0, rx.amountBucket)(m),
                    durationMs: (0, rx.durationSince)(u),
                    uid: o
                }), b(), {
                    state: ru.GeneralError
                };
                return C(), N(), (0, rx.ctfV2Info)("usdce_wrap_succeeded", {
                    authType: a,
                    amountBucket: (0, rx.amountBucket)(m),
                    durationMs: (0, rx.durationSince)(u),
                    uid: o
                }), {
                    state: ru.Success
                }
            } catch (e) {
                return (0, rx.ctfV2Error)("usdce_wrap_failed", {
                    reason: "exception",
                    authType: a,
                    amountBucket: (0, rx.amountBucket)(m),
                    durationMs: (0, rx.durationSince)(u),
                    uid: o,
                    ...(0, rx.getErrorTelemetry)(e)
                }), b(), {
                    state: ru.GeneralError
                }
            } finally {
                t(!1), "depositWallet" === i ? h() : "safe" === i && d()
            }
        }, [r, a, i, x, s, l, c, d, p, A, h, C, N, b]);
        return {
            usdceBalance: x,
            hasUsdceBalance: k,
            isUsdceBalanceLoading: _,
            handleUsdceWrap: D,
            isWrapping: e,
            isSignerLoading: y && g && !f,
            refetchUsdceBalance: N
        }
    }], 771596)
}, 889038, 573451, 167224, 877284, 915813, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(23128),
        n = e.i(158789),
        i = e.i(664318),
        s = e.i(790268),
        o = e.i(169010),
        l = e.i(86831),
        c = e.i(208956),
        u = e.i(501527),
        d = e.i(180970),
        p = e.i(798631),
        A = e.i(636071),
        h = e.i(515264),
        m = e.i(664516),
        f = e.i(738880),
        g = e.i(416340),
        y = e.i(955916),
        T = e.i(657638),
        E = e.i(334986),
        b = e.i(668122),
        I = e.i(922445),
        C = e.i(604777),
        S = e.i(784521),
        _ = e.i(305457),
        N = e.i(523410),
        x = e.i(767074),
        k = e.i(684686),
        D = e.i(799471),
        v = e.i(631222),
        w = e.i(363966),
        O = e.i(333223),
        R = e.i(273430),
        M = e.i(588885),
        L = e.i(702056),
        B = e.i(569442),
        P = e.i(196593),
        F = e.i(444357),
        U = e.i(44326),
        G = e.i(88240),
        H = e.i(827681),
        j = e.i(628684),
        Q = e.i(863828),
        K = e.i(5146),
        Y = e.i(771596),
        W = e.i(200036),
        q = e.i(882860),
        V = e.i(63238),
        z = e.i(306243),
        J = e.i(914640);
    e.i(369761);
    var Z = e.i(885370);
    let $ = [{
        inputs: [{
            internalType: "address",
            name: "tokenIn",
            type: "address"
        }, {
            internalType: "address",
            name: "tokenOut",
            type: "address"
        }, {
            internalType: "uint24",
            name: "fee",
            type: "uint24"
        }, {
            internalType: "uint256",
            name: "amountIn",
            type: "uint256"
        }, {
            internalType: "uint160",
            name: "sqrtPriceLimitX96",
            type: "uint160"
        }],
        name: "quoteExactInputSingle",
        outputs: [{
            internalType: "uint256",
            name: "amountOut",
            type: "uint256"
        }],
        stateMutability: "nonpayable",
        type: "function"
    }];
    var X = e.i(56339),
        ee = e.i(866674),
        et = e.i(8998),
        er = e.i(187150),
        ea = e.i(635103),
        en = e.i(631503),
        ei = e.i(655740),
        es = e.i(53950),
        eo = e.i(423582);
    let el = J.zeroAddress,
        ec = z.maxUint256,
        eu = "0xe592427a0aece92de3edee1f18e0157c05861564",
        ed = "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
        ep = "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
        eA = [{
            type: "function",
            name: "exactInputSingle",
            inputs: [{
                type: "tuple",
                name: "params",
                components: [{
                    type: "address",
                    name: "tokenIn"
                }, {
                    type: "address",
                    name: "tokenOut"
                }, {
                    type: "uint24",
                    name: "fee"
                }, {
                    type: "address",
                    name: "recipient"
                }, {
                    type: "uint256",
                    name: "deadline"
                }, {
                    type: "uint256",
                    name: "amountIn"
                }, {
                    type: "uint256",
                    name: "amountOutMinimum"
                }, {
                    type: "uint160",
                    name: "sqrtPriceLimitX96"
                }]
            }],
            outputs: [{
                type: "uint256",
                name: "amountOut"
            }],
            stateMutability: "payable"
        }],
        eh = {
            137: ed,
            80001: "0x9999f7Fea5938fD3b1E26A12c3f2fb024e194f97"
        },
        em = e => e ? {
            addressIn: ed,
            addressOut: ep
        } : {
            addressIn: ep,
            addressOut: ed
        },
        ef = async (e, t) => {
            let r = (0, W.createChainAwarePublicClient)(),
                a = em(t),
                {
                    result: n
                } = await r.simulateContract({
                    address: "0xb27308f9f90d607463bb33ea1bebb41c27ce5ab6",
                    abi: $,
                    functionName: "quoteExactInputSingle",
                    args: [a.addressIn, a.addressOut, 100, e, 0 n]
                });
            return n
        },
        eg = async e => {
            try {
                await ei.axios.post("/api/slack", {
                    slackMessage: e
                })
            } catch (e) {
                console.error("postToSlack", e)
            }
        },
        ey = ({
            staleTime: e,
            subscribeTrackedProxyUsdcBalance: t = !0,
            trackedProxyUsdcBalance: r
        } = {}) => {
            let [a, n] = (0, g.useState)(!1), i = (0, et.useChains)(), {
                proxyAddress: s,
                walletMode: o
            } = (0, S.useAccountContext)(["proxyAddress", "walletMode"]), l = (0, _.useAmplitudeAnalytics)(), {
                sendTransaction: c
            } = (0, en.default)(), {
                nonce: u,
                incrementNonce: d,
                refreshNonce: p
            } = (0, ea.useDepositWallet)(), [A] = (0, g.useState)([]), h = i[v.WAGMI_CHAIN_INDICES.polygon] ? .id ? ? void 0, {
                refreshTrackedProxyUsdcBalance: m,
                trackedProxyUsdcBalance: f
            } = (0, K.default)(void 0, v.MATIC_CONFIG.chainId, {
                enabled: t,
                disablePendingTxnSubscription: !t
            }), y = (0, g.useMemo)(() => "number" == typeof r ? r : f.current, [r, f.current]), {
                data: T,
                refetch: E
            } = (0, er.useTokenBalance)({
                address: s ? ? el,
                token: eh[h],
                chainId: h,
                queryOptions: {
                    enabled: !!s && !!h,
                    gcTime: 6e4,
                    staleTime: e
                }
            }), I = (0, g.useMemo)(() => T ? .value || 0 n, [T]), C = (0, g.useMemo)(() => !!I && I > 10000 n, [I]), N = (0, g.useMemo)(() => y > 0, [y]), x = (0, g.useCallback)(async (e, t, r, a) => {
                if (!r || !t || "bigint" != typeof t) return null;
                try {
                    let {
                        addressIn: n,
                        addressOut: i
                    } = em(e), o = await ef(t, e), l = 9989 n * t;
                    if (l > 10000 n * o) {
                        let a;
                        return eg((a = l / 1000 n, `Attempting to swap from ${e?"from Native to USDCe":"from USDCe to Native"} failed
	
	
	Proxy Address: ${r} 
	
	
	Amount: ${(0,q.formatUnits)(t,6).toString()}
	
	
	Min Amount: ${(0,q.formatUnits)(a,6).toString()}
	`)), null
                    }
                    let c = 9990 n * o / 10000 n,
                        u = (0, X.encodeFunctionData)({
                            abi: eA,
                            functionName: "exactInputSingle",
                            args: [{
                                tokenIn: n,
                                tokenOut: i,
                                fee: 100,
                                recipient: r,
                                deadline: BigInt(Math.floor(Date.now() / 1e3) + 1200),
                                amountIn: t,
                                amountOutMinimum: c,
                                sqrtPriceLimitX96: 0 n
                            }]
                        });
                    return es.logger.info("[getTradeTx]", {
                        isNativeToUsdcE: e,
                        amount: t.toString(),
                        amountOut: o.toString(),
                        amountOutMinimum: c.toString(),
                        proxyAddress: s,
                        uid: a
                    }), {
                        tradeTx: {
                            data: u,
                            value: "0",
                            to: eu,
                            typeCode: Z.CallType.Call
                        },
                        amountOut: o
                    }
                } catch (e) {
                    return es.logger.error("[getTradeTx]", {
                        error: e,
                        proxyAddress: s,
                        uid: a
                    }), null
                }
            }, [s]), k = (0, g.useCallback)(async (e, t, r) => {
                let a = `${s}-${crypto.randomUUID()}-${Date.now()}`;
                if (!s) return es.logger.error("[handleUsdcSwap > no proxy address]", {
                    uid: a
                }), {
                    state: G.TransactionResponseState.GeneralError
                };
                if (e && !C || !e && !N) return es.logger.error("[handleUsdcSwap > no balance]", {
                    isNativeToUsdcE: e,
                    hasNativeUsdcBalance: C,
                    hasUsdcEBalance: N,
                    proxyAddress: s,
                    uid: a
                }), {
                    state: G.TransactionResponseState.GeneralError
                };
                try {
                    n(!0);
                    let i = "number" == typeof t ? (0, V.parseUnits)(t.toFixed(6), 6) : e ? I : (0, V.parseUnits)(y.toFixed(6), 6);
                    if (es.logger.info("[handleUsdcSwap]", {
                            amountToSwap: i.toString(),
                            DUST: 10000 n.toString(),
                            proxyAddress: s,
                            uid: a
                        }), i < 10000 n) return {
                        state: G.TransactionResponseState.SignatureError
                    };
                    let p = await x(e, i, r ? ? s);
                    if (!p) return {
                        state: G.TransactionResponseState.GeneralError
                    };
                    let {
                        tradeTx: A
                    } = p;
                    if (l.trackEvent(b.Events.StartingUsdcUsdceConversion, {
                            value: A ? Number(A.value) : void 0,
                            isNativeToUsdcE: e
                        }), !A) return es.logger.error("[handleUsdcSwap > no trade tx]", {
                        proxyAddress: s,
                        uid: a
                    }), {
                        state: G.TransactionResponseState.GeneralError
                    };
                    let h = (0, X.encodeFunctionData)({
                        abi: ee.erc20Abi,
                        functionName: "approve",
                        args: [eu, ec]
                    });
                    es.logger.info("[handleUsdcSwap > approveData]", {
                        approveData: h,
                        proxyAddress: s,
                        uid: a
                    });
                    let f = [{
                        to: em(e).addressIn,
                        data: h,
                        typeCode: Z.CallType.Call,
                        value: "0"
                    }, A];
                    es.logger.info("[handleUsdcSwap > txns]", {
                        txns: f,
                        proxyAddress: s,
                        uid: a
                    });
                    let g = (0, en.getTransactionType)(o),
                        T = await c(g, f, 0, v.Network.Matic, 0, void 0, g === en.TransactionType.DepositWallet ? u : void 0, en.TransactionMetadata.Withdraw.valueOf(), g === en.TransactionType.DepositWallet ? s : void 0);
                    g === en.TransactionType.DepositWallet && await d(), es.logger.info("[handleUsdcSwap > txResponse]", {
                        txResponse: T,
                        proxyAddress: s,
                        uid: a
                    });
                    let C = await (0, eo.waitTillMined)(T);
                    return es.logger.info("handleUsdcSwap transaction mined", {
                        proxyAddress: s,
                        uid: a
                    }), C && (m(), E()), l.trackEvent(b.Events.UsdcUsdceConversionSuccess, {
                        value: A ? Number(A.value) : void 0,
                        isNativeToUsdcE: e
                    }), {
                        state: G.TransactionResponseState.Success
                    }
                } catch (e) {
                    return (0, en.getTransactionType)(o) === en.TransactionType.DepositWallet && p(), es.logger.error("[handleUsdcSwap > error]", {
                        error: e,
                        proxyAddress: s,
                        uid: a
                    }), l.trackEvent(b.Events.UsdcUsdceConversionError), {
                        state: G.TransactionResponseState.GeneralError
                    }
                } finally {
                    n(!1)
                }
            }, [l, o, x, C, N, I, s, E, m, c, u, d, p, y]);
            return {
                nativeUsdcBalance: I,
                hasNativeUsdcBalance: C,
                handleUsdcSwap: k,
                isSwapping: a,
                refetchNativeUsdcBalance: E,
                transactionHashes: A
            }
        };
    e.s(["default", 0, ey], 573451);
    var eT = e.i(98191);
    let eE = e => {
        let n, i, s, l, c, u, d = (0, r.c)(14),
            {
                handleClick: p,
                balance: A,
                isSwapping: h
            } = e;
        d[0] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsx)("p", {
            className: "text-base font-semibold mb-4",
            children: "Activate Funds"
        }), d[0] = n) : n = d[0], d[1] !== A ? (i = (0, P.formatNumbers)((0, P.formatUSDCUnits)(A)), d[1] = A, d[2] = i) : i = d[2];
        let m = `$${i}`;
        return d[3] !== m ? (s = (0, t.jsxs)("p", {
            className: "text-sm text-center leading-[21px] font-normal mb-5",
            children: ["Your deposit of", " ", (0, t.jsx)("span", {
                className: "text-green-500 font-bold",
                children: m
            }), " ", "was received. Activate the funds to begin trading"]
        }), d[3] = m, d[4] = s) : s = d[4], d[5] !== h ? (l = h ? (0, t.jsx)(eT.default, {
            height: "32px",
            width: "32px",
            color: "white"
        }) : "Continue", d[5] = h, d[6] = l) : l = d[6], d[7] !== p || d[8] !== h || d[9] !== l ? (c = (0, t.jsx)(a.Button, {
            onClick: p,
            disabled: h,
            className: "min-w-[94px] h-[44px] disabled:opacity-50",
            children: l
        }), d[7] = p, d[8] = h, d[9] = l, d[10] = c) : c = d[10], d[11] !== s || d[12] !== c ? (u = (0, t.jsx)(o.TooltipContent, {
            side: "bottom",
            className: "bg-card-fill rounded-lg shadow-[0_0_16px_rgba(0,0,0,0.25)] p-5 sm:w-[300px] max-sm:w-screen",
            align: "center",
            children: (0, t.jsxs)("div", {
                className: "flex flex-col justify-center items-center",
                children: [n, s, c]
            })
        }), d[11] = s, d[12] = c, d[13] = u) : u = d[13], u
    };
    var eb = e.i(248131);
    let eI = e => {
        let a, n, i, s, o, l, u, d, p = (0, r.c)(31),
            {
                ref: A,
                parsedProxyUsdcBalance: h,
                hasActivationBalance: m,
                isSwapping: g,
                isLoading: y,
                onClick: T,
                actAsLink: E,
                portfolioHidden: b
            } = e,
            I = (0, C.useTranslations)(),
            S = h > 1e3 ? 0 : 2;
        p[0] !== h || p[1] !== S ? (a = (0, P.formatCurrency)(h, {
            decimals: S
        }), p[0] = h, p[1] = S, p[2] = a) : a = p[2];
        let _ = a;
        p[3] !== I ? (n = I("navbar.cash"), p[3] = I, p[4] = n) : n = p[4], p[5] !== n ? (i = (0, t.jsx)("span", {
            children: n
        }), p[5] = n, p[6] = i) : i = p[6], p[7] !== m || p[8] !== g ? (s = m && !g ? (0, t.jsx)(F.IconCircleArrowDownFill18, {
            className: "text-text-brand h-4 w-4"
        }) : null, p[7] = m, p[8] = g, p[9] = s) : s = p[9], p[10] !== m || p[11] !== g ? (o = m && g ? (0, t.jsx)(eT.default, {
            width: "16px",
            height: "16px"
        }) : null, p[10] = m, p[11] = g, p[12] = o) : o = p[12], p[13] !== i || p[14] !== s || p[15] !== o ? (l = (0, t.jsxs)("div", {
            className: "flex items-end",
            children: [i, s, o]
        }), p[13] = i, p[14] = s, p[15] = o, p[16] = l) : l = p[16];
        let N = l;
        p[17] !== _ || p[18] !== y || p[19] !== N || p[20] !== b ? (u = (0, t.jsx)(f.NavbarBalancePill, {
            label: N,
            value: _,
            isLoading: y,
            hidden: b
        }), p[17] = _, p[18] = y, p[19] = N, p[20] = b, p[21] = u) : u = p[21];
        let x = u;
        if (!(void 0 === E || E)) {
            let e, r;
            return p[22] !== T ? (e = e => {
                T ? .(e)
            }, p[22] = T, p[23] = e) : e = p[23], p[24] !== x || p[25] !== A || p[26] !== e ? (r = (0, t.jsx)("button", {
                type: "button",
                ref: A,
                onClick: e,
                className: "inline-flex items-center [-webkit-tap-highlight-color:rgba(0,0,0,0.2)]",
                children: x
            }), p[24] = x, p[25] = A, p[26] = e, p[27] = r) : r = p[27], r
        }
        return p[28] !== x || p[29] !== A ? (d = (0, t.jsx)(c.default, {
            href: eb.Location.Portfolio,
            className: "text-inherit [-webkit-tap-highlight-color:rgba(0,0,0,0.2)]",
            children: (0, t.jsx)("button", {
                type: "button",
                ref: A,
                className: "contents",
                children: x
            })
        }), p[28] = x, p[29] = A, p[30] = d) : d = p[30], d
    };
    eI.displayName = "NavbarBalanceButton";
    let eC = ({
        proxyAddress: e
    }) => {
        let r = (0, B.useBalanceVisibilityStore)(e => e.portfolioHidden),
            a = (0, g.useMemo)(() => (0, L.readNavbarBalances)(e), [e]),
            {
                trackedProxyUsdcBalance: n,
                proxyUsdcBalanceMetadata: i,
                hasPendingProxyUsdcBalance: s,
                isProxyUsdcBalanceLoading: l
            } = (0, K.default)(e),
            {
                authenticationType: c,
                walletMode: u
            } = (0, S.useAccountContext)(["authenticationType", "walletMode"]),
            d = (0, k.useGeoStore)(e => e.permissions.canDeposit),
            {
                isSafeDeployed: p
            } = (0, j.useSafe)(),
            {
                nativeUsdcBalance: A,
                handleUsdcSwap: h,
                hasNativeUsdcBalance: m,
                isSwapping: f
            } = ey({
                subscribeTrackedProxyUsdcBalance: !1,
                trackedProxyUsdcBalance: n.current
            }),
            {
                usdceBalance: y,
                hasUsdceBalance: T,
                isUsdceBalanceLoading: E,
                refetchUsdceBalance: b,
                handleUsdceWrap: I,
                isWrapping: C
            } = (0, Y.default)(),
            _ = (0, g.useCallback)(async () => {
                let {
                    state: e
                } = await h(!0);
                if (e !== G.TransactionResponseState.Success) return;
                let t = await b(),
                    r = t.data ? .value ? ? 0 n;
                r > 0 n && await I(r)
            }, [h, b, I]),
            {
                setOnboardingRoute: N,
                setOpen: x,
                setRoute: D
            } = (0, Q.useSiwx)(),
            v = !l && !E,
            w = null !== a,
            O = (0, g.useMemo)(() => v ? n.current + parseFloat((0, P.formatUSDCUnits)(y)) : a ? .cash ? ? 0, [n.current, y, v, a]),
            R = !v && !w,
            M = !s && m && ("magic" === c || p),
            F = "magic" !== c && (0, en.requiresWalletDeployment)(u) && !p && (d || !s && m),
            [W, q] = (0, g.useState)(R),
            V = (0, g.useCallback)(() => {
                D(H.AuthRoute.ONBOARDING), N(H.OnboardingRoute.ENABLEEOATRADING), x(!0)
            }, [D, N, x]);
        return (0, g.useEffect)(() => {
            W && !R && q(!1)
        }, [R]), (0, t.jsx)(o.TooltipProvider, {
            children: (0, t.jsxs)(U.Tooltip.Root, {
                children: [(0, t.jsx)(o.TooltipTrigger, {
                    asChild: !0,
                    children: (0, t.jsx)(eI, {
                        actAsLink: !F,
                        parsedProxyUsdcBalance: O,
                        hasActivationBalance: m || T,
                        isSwapping: f || C,
                        isLoading: W,
                        portfolioHidden: r,
                        onClick: () => {
                            F && V()
                        }
                    })
                }), s && (0, t.jsx)(o.TooltipContent, {
                    side: "bottom",
                    children: (0, t.jsxs)("div", {
                        className: "flex flex-1 justify-between items-center gap-4",
                        children: [(0, t.jsx)("span", {
                            children: i.pendingDirectionDescription
                        }), (0, t.jsx)("span", {
                            children: i.presentationalPendingBalance
                        })]
                    })
                }), M && !F ? (0, t.jsx)(eE, {
                    balance: A,
                    handleClick: _,
                    isSwapping: f || C
                }) : null]
            })
        })
    };
    var eS = e.i(67670),
        e_ = e.i(502475),
        eN = e.i(229339);
    let ex = e => {
        let a, n, i, s, o, l, u, d, p, A, h, m = (0, r.c)(29),
            {
                proxyAddress: y
            } = e,
            T = (0, C.useTranslations)(),
            E = (0, B.useBalanceVisibilityStore)(ek);
        m[0] !== y ? (a = (0, L.readNavbarBalances)(y), m[0] = y, m[1] = a) : a = m[1];
        let b = a;
        m[2] !== y ? (n = {
            proxyAddress: y,
            select: e_.pendingTrackedMarketPositionCountSelector
        }, m[2] = y, m[3] = n) : n = m[3];
        let {
            optimisticPositions: I
        } = (0, e_.default)(n), {
            marketPositionsValue: S
        } = (0, eS.useMarketPositionsValue)(y), {
            trackedProxyUsdcBalance: _,
            isProxyUsdcBalanceLoading: N
        } = (0, K.default)(y), {
            usdceBalance: x,
            isUsdceBalanceLoading: k
        } = (0, Y.default)(), D = void 0 !== S && !N && !k;
        m[4] !== D || m[5] !== _ || m[6] !== x ? (i = D ? _.current + parseFloat((0, P.formatUSDCUnits)(x)) : void 0, m[4] = D, m[5] = _, m[6] = x, m[7] = i) : i = m[7];
        let v = i,
            w = D ? (S ? ? 0) + (v ? ? 0) : void 0,
            O = null !== b,
            R = !D && !O;
        m[8] !== R ? (s = () => R, m[8] = R, m[9] = s) : s = m[9];
        let [M, F] = (0, g.useState)(s);
        m[10] !== R ? (o = () => {
            R || F(eD)
        }, l = [R], m[10] = R, m[11] = o, m[12] = l) : (o = m[11], l = m[12]), (0, g.useEffect)(o, l);
        let U = w ? ? b ? .portfolio ? ? 0,
            G = (0, eN.useCooldownValue)(U, (void 0 === I ? 0 : I) > 0),
            H = G > 1e3 ? 0 : 2,
            j = G > 1e3 ? 0 : 2;
        m[13] !== G || m[14] !== H || m[15] !== j ? (u = (0, P.formatToDollar)(G, {
            minimumFractionDigits: H,
            maximumFractionDigits: j
        }), m[13] = G, m[14] = H, m[15] = j, m[16] = u) : u = m[16];
        let Q = u;
        return m[17] !== w || m[18] !== v || m[19] !== y ? (d = () => {
            void 0 !== w && void 0 !== v && y && (0, L.saveNavbarBalances)(y, w, v)
        }, p = [w, v, y], m[17] = w, m[18] = v, m[19] = y, m[20] = d, m[21] = p) : (d = m[20], p = m[21]), (0, g.useEffect)(d, p), m[22] !== T ? (A = T("navbar.portfolio"), m[22] = T, m[23] = A) : A = m[23], m[24] !== Q || m[25] !== M || m[26] !== E || m[27] !== A ? (h = (0, t.jsx)(c.default, {
            href: eb.Location.Portfolio,
            children: (0, t.jsx)(f.NavbarBalancePill, {
                label: A,
                value: Q,
                isLoading: M,
                hidden: E
            })
        }), m[24] = Q, m[25] = M, m[26] = E, m[27] = A, m[28] = h) : h = m[28], h
    };

    function ek(e) {
        return e.portfolioHidden
    }

    function eD(e) {
        return !e && e
    }
    var ev = e.i(222163),
        ew = e.i(97271),
        eO = e.i(336896),
        eR = e.i(149534);
    let eM = ({
        strokeWidth: e = 1.5,
        ...t
    }) => g.default.createElement(eR.Icon, {
        size: "18px",
        ...t
    }, g.default.createElement("path", {
        d: "M10.5 15.3843C10.2005 15.9018 9.6409 16.25 9 16.25C8.3591 16.25 7.7995 15.9018 7.5 15.3843",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }), g.default.createElement("path", {
        d: "M9.8082 1.8315C9.5443 1.7861 9.2768 1.75 9 1.75C6.377 1.75 4.25 3.877 4.25 6.5V10.75C4.25 11.855 3.355 12.75 2.25 12.75H15.75C14.645 12.75 13.75 11.855 13.75 10.75V8.25",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        fill: "none"
    }), g.default.createElement("path", {
        d: "M12.75 1.25H16.25L12.75 5.25H16.25",
        stroke: "currentColor",
        strokeWidth: e,
        strokeLinecap: "round",
        strokeLinejoin: "round",
        "data-color": "color-2",
        fill: "none"
    }));
    var eL = e.i(690907),
        eB = e.i(400819),
        eP = e.i(601550),
        eF = e.i(964974),
        eU = e.i(318594),
        eG = e.i(213333),
        eH = e.i(402675),
        ej = e.i(310245),
        eQ = e.i(22026),
        eK = e.i(660006),
        eY = e.i(510954),
        eW = e.i(57096),
        eq = e.i(740594),
        eV = e.i(93641);
    e.i(313582);
    var ez = e.i(293028),
        eJ = e.i(860106);
    let eZ = async (e, t, r, {
            closed: a
        } = {}) => {
            let n = [];
            if (e && Array.isArray(e) && e.length > 0) {
                let t = [...new Set(e)];
                (0, eV.chunk)(t, 100).forEach(e => {
                    n.push({
                        type: "marketMakerAddress",
                        chunk: e
                    })
                })
            }
            if (t && Array.isArray(t) && t.length > 0) {
                let e = [...new Set(t)];
                (0, eV.chunk)(e, 100).forEach(e => {
                    n.push({
                        type: "clobTokenIds",
                        chunk: e
                    })
                })
            }
            if (r && Array.isArray(r) && r.length > 0) {
                let e = [...new Set(r)];
                (0, eV.chunk)(e, 100).forEach(e => {
                    n.push({
                        type: "conditionIds",
                        chunk: e
                    })
                })
            }
            if (Array.isArray(n)) {
                let e = n.map(e => {
                    let t = `${v.GAMMA_API_URL}/markets/information?limit=100`,
                        r = {
                            [e.type]: e.chunk
                        };
                    return null != a && (r.closed = a), ei.axios.post(t, r).then(e => e.data.map(e => ({ ...{ ...e,
                            end_date: e.endDate,
                            outcomes: (0, eJ.parseJsonFromStrapi)(e.outcomes),
                            outcomePrices: (0, eJ.parseJsonFromStrapi)(e.outcomePrices),
                            clobTokenIds: (0, eJ.parseTokenIds)(e),
                            image: (0, ez.getOptimizedImageField)(e, "image"),
                            icon: (0, ez.getOptimizedImageField)(e, "icon")
                        }
                    }))).catch(e => ((0, eK.handleError)(e, "getPartialPositionMarkets - positionIds"), []))
                });
                return (await Promise.all(e)).flat()
            }
            return []
        },
        e$ = async e => {
            let [t, r, a] = e.queryKey, n = a.toLowerCase();
            return ei.axios.post(`${v.GAMMA_API_URL}/markets/abridged?limit=1`, {
                conditionIds: [`${n}`]
            }).then(({
                data: e
            }) => {
                let t = e[0],
                    r = {
                        clobTokenIds: (0, eJ.parseTokenIds)(t),
                        outcomePrices: (0, eJ.parseJsonFromStrapi)(t.outcomePrices),
                        outcomes: (0, eJ.parseJsonFromStrapi)(t.outcomes)
                    };
                return { ...t,
                    ...r
                }
            }).catch(e => {
                (0, eK.handleError)(e, "getMarketForRewards", n)
            })
        },
        eX = async e => {
            let [t, r, a] = e.queryKey;
            return ei.axios.get(`${v.GAMMA_API_URL}/markets/${a}/description`).then(({
                data: e
            }) => e)
        };
    e.s(["getMarketDescriptionFetcher", 0, eX, "getMarketForRewardsFetcher", 0, e$, "getPartialPositionMarkets", 0, eZ], 167224);
    var e0 = e.i(209246),
        e1 = e.i(460649),
        e2 = e.i(378876),
        e5 = e.i(458164),
        e6 = e.i(502980),
        e3 = e.i(921807),
        e4 = e.i(600326);

    function e8() {}

    function e9(e) {
        return e.toString()
    }

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

    function te(e) {
        return e.id
    }

    function tt(e) {
        return (0, ej.coerceMarketOrderNotificationToFOK)(e)
    }

    function tr(e) {
        return (0, ej.coerceMarketOrderNotificationToFOK)(e)
    }

    function ta(e) {
        return (0, ej.convertClobNotificationToUserNotification)(e)
    }

    function tn(e) {
        return e.data.id
    }
    var ti = e.i(189106);

    function ts() {}
    var to = e.i(140527),
        tl = e.i(959831),
        tc = e.i(106371);
    let tu = e => {
        let t, a, n, i, s, o = (0, r.c)(10);
        o[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], o[0] = t) : t = o[0];
        let {
            proxyAddress: l
        } = (0, S.useAccountContext)(t), c = e ? ? v.MATIC_CONFIG.chainId;
        o[1] !== c || o[2] !== l ? (a = eY.queryKeys[eW.QueryKey.Transactions].txns(l, c), o[1] = c, o[2] = l, o[3] = a) : a = o[3];
        let u = !!l && !!c;
        o[4] === Symbol.for("react.memo_cache_sentinel") ? (n = {
            persist: !0
        }, o[4] = n) : n = o[4], o[5] !== a.queryKey || o[6] !== u ? (i = {
            queryKey: a.queryKey,
            queryFn: td,
            enabled: u,
            refetchOnMount: !1,
            refetchOnReconnect: !1,
            refetchOnWindowFocus: !1,
            gcTime: 864e5,
            meta: n
        }, o[5] = a.queryKey, o[6] = u, o[7] = i) : i = o[7];
        let {
            data: d
        } = (0, eF.useQuery)(i);
        return o[8] !== d ? .txns ? (s = d ? .txns ? ? [], o[8] = d ? .txns, o[9] = s) : s = o[9], s
    };

    function td() {
        return {
            txns: []
        }
    }

    function tp(e) {
        return !0 !== e.metadata.suppressNotification
    }

    function tA(e, t) {
        return e.data.metadata.enqueuedAt > t.data.metadata.enqueuedAt ? -1 : 1
    }

    function th(e) {
        return !!e.conditionId
    }

    function tm(e) {
        return e.conditionId ? .toLowerCase() ? ? ""
    }

    function tf(e) {
        return !e.read
    }
    e.s(["default", 0, tu], 877284);
    let tg = (0, ew.default)(() => e.A(495552), {
            loadableGenerated: {
                modules: [952036]
            },
            ssr: !1
        }),
        ty = () => {
            let e, n, i, s, o, l, c, u, d, p, A, h, f = (0, r.c)(28),
                y = (0, C.useTranslations)(),
                [T, E] = (0, g.useState)(!1),
                {
                    notifications: b,
                    unreadNotificationCount: I,
                    markNotificationsRead: _
                } = (() => {
                    let e, t, a, n, i, s = (0, r.c)(15);
                    s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress"], s[0] = e) : e = s[0];
                    let {
                        proxyAddress: o
                    } = (0, S.useAccountContext)(e), {
                        clob: l
                    } = (0, eB.useClobCredentialContext)(), {
                        mutate: c
                    } = (() => {
                        let e, t, a, n, i, s, o = (0, r.c)(11),
                            l = (0, eU.useQueryClient)();
                        o[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress"], o[0] = e) : e = o[0];
                        let {
                            proxyAddress: c
                        } = (0, S.useAccountContext)(e);
                        o[1] === Symbol.for("react.memo_cache_sentinel") ? (t = eY.queryKeys[eW.QueryKey.Notifications].watermark(), o[1] = t) : t = o[1], o[2] !== l ? (a = async e => {
                            l.setQueryData(eY.queryKeys[eW.QueryKey.Notifications].watermark().queryKey, e.value)
                        }, o[2] = l, o[3] = a) : a = o[3], o[4] !== c ? (n = e => {
                            (0, eK.handleError)(e, "[useNotificationWatermark] mutate", c)
                        }, o[4] = c, o[5] = n) : n = o[5], o[6] !== a || o[7] !== n ? (i = {
                            mutationKey: t.queryKey,
                            mutationFn: a,
                            onError: n
                        }, o[6] = a, o[7] = n, o[8] = i) : i = o[8];
                        let {
                            mutate: u
                        } = (0, eP.useMutation)(i);
                        return o[9] !== u ? (s = {
                            mutate: u
                        }, o[9] = u, o[10] = s) : s = o[10], s
                    })(), {
                        marketNotificationsRead: u
                    } = (() => {
                        let e, t, a, n, i, s, o, l = (0, r.c)(14),
                            c = (0, eU.useQueryClient)();
                        l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["proxyAddress"], l[0] = e) : e = l[0];
                        let {
                            proxyAddress: u
                        } = (0, S.useAccountContext)(e), {
                            clob: d
                        } = (0, eB.useClobCredentialContext)();
                        l[1] === Symbol.for("react.memo_cache_sentinel") ? (t = eY.queryKeys[eW.QueryKey.Notifications].clob(), l[1] = t) : t = l[1], l[2] !== d ? (a = async e => {
                            if (!d) throw Error("Clob not initialized");
                            Array.isArray(e.ids) && e.ids.length > 0 && await d.dropNotifications({
                                ids: e.ids.map(e9)
                            })
                        }, l[2] = d, l[3] = a) : a = l[3], l[4] !== c ? (n = async e => {
                            await c.cancelQueries({
                                queryKey: eY.queryKeys[eW.QueryKey.Notifications].clob._def
                            });
                            let t = c.getQueryData(eY.queryKeys[eW.QueryKey.Notifications].cachedClob().queryKey);
                            if (t) {
                                let r = Array.isArray(e.ids) ? e.ids.reduce(e7, {}) : {},
                                    a = e.read ? t.map(e => ({ ...e,
                                        ...r[e.id] && {
                                            read: !0
                                        }
                                    })) : t;
                                c.setQueryData(eY.queryKeys[eW.QueryKey.Notifications].cachedClob().queryKey, a), c.setQueryData(eY.queryKeys[eW.QueryKey.Notifications].clob().queryKey, a)
                            }
                        }, l[4] = c, l[5] = n) : n = l[5], l[6] !== u ? (i = (e, t, r) => {
                            (0, eK.handleError)(e, "[useClobNotifications] mutate", u)
                        }, l[6] = u, l[7] = i) : i = l[7], l[8] !== a || l[9] !== n || l[10] !== i ? (s = {
                            mutationKey: t.queryKey,
                            mutationFn: a,
                            onMutate: n,
                            onError: i
                        }, l[8] = a, l[9] = n, l[10] = i, l[11] = s) : s = l[11];
                        let {
                            mutate: p
                        } = (0, eP.useMutation)(s);
                        return l[12] !== p ? (o = {
                            marketNotificationsRead: p
                        }, l[12] = p, l[13] = o) : o = l[13], o
                    })(), {
                        clobNotifications: d,
                        allClobNotificationIds: p
                    } = (e => {
                        let t, a, n, i, s, o, l, c, u, d, p, A, h, m = (0, r.c)(29),
                            f = (0, eQ.useMarkClobNotificationsFetched)(),
                            y = (0, eU.useQueryClient)();
                        m[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["authenticated", "proxyAddress", "isUserOnboarding"], m[0] = t) : t = m[0];
                        let {
                            authenticated: T,
                            proxyAddress: E,
                            isUserOnboarding: b
                        } = (0, S.useAccountContext)(t), I = (0, g.useRef)(!1);
                        m[1] === Symbol.for("react.memo_cache_sentinel") ? (a = eY.queryKeys[eW.QueryKey.Notifications].clob(), m[1] = a) : a = m[1], m[2] !== e || m[3] !== y ? (n = async () => {
                            if (!e) throw Error("Clob not initialized");
                            let t = await e.getNotifications(),
                                r = y.getQueryData(eY.queryKeys[eW.QueryKey.Notifications].cachedClob().queryKey);
                            if (!t || !Array.isArray(t)) return r ? ? null;
                            let a = [];
                            if (r ? .length) {
                                let e = r.map(te),
                                    n = t.filter(t => !e.includes(t.id));
                                a.push(...n.map(tt)), a.push(...r)
                            } else a.push(...t.map(tr));
                            return a.length && y.setQueryData(eY.queryKeys[eW.QueryKey.Notifications].cachedClob().queryKey, a), a
                        }, m[2] = e, m[3] = y, m[4] = n) : n = m[4];
                        let C = T && !!E && !!e && !b;
                        m[5] === Symbol.for("react.memo_cache_sentinel") ? (i = {
                            errorContext: {
                                tag: "[useClobNotifications] useQuery"
                            }
                        }, m[5] = i) : i = m[5], m[6] !== n || m[7] !== C ? (s = {
                            queryKey: a.queryKey,
                            queryFn: n,
                            enabled: C,
                            refetchOnWindowFocus: !0,
                            refetchOnReconnect: !0,
                            refetchInterval: 2e4,
                            staleTime: 12e4,
                            gcTime: 3e5,
                            meta: i
                        }, m[6] = n, m[7] = C, m[8] = s) : s = m[8];
                        let {
                            data: _
                        } = (0, eF.useQuery)(s);
                        if (m[9] !== _) {
                            let e = _ ? .map(ta);
                            o = e, l = e ? e.map(tn) : [], m[9] = _, m[10] = o, m[11] = l
                        } else o = m[10], l = m[11];
                        m[12] !== o || m[13] !== l ? (c = {
                            notifications: o,
                            allClobNotificationIds: l
                        }, m[12] = o, m[13] = l, m[14] = c) : c = m[14];
                        let {
                            notifications: N,
                            allClobNotificationIds: x
                        } = c;
                        m[15] !== _ || m[16] !== f ? (d = () => {
                            !I.current && _ && (I.current = !0, f())
                        }, u = [_, f], m[15] = _, m[16] = f, m[17] = u, m[18] = d) : (u = m[17], d = m[18]), (0, g.useEffect)(d, u);
                        let k = (e => {
                                let t, a, n, i = (0, r.c)(10);
                                i[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress"], i[0] = t) : t = i[0];
                                let {
                                    proxyAddress: s
                                } = (0, S.useAccountContext)(t), o = (0, e3.useTransactionStore)(), l = (0, e1.default)(e), c = (0, e0.useGetCachedPositionMarket)(), u = e ? ? v.MATIC_CONFIG.chainId;
                                i[1] !== u ? (a = e => {
                                    if (2 !== e.type) return;
                                    let t = Date.now(),
                                        r = e.payload.outcome_index,
                                        a = parseFloat(e.payload.price),
                                        n = (0, P.parseUSDCUnits)(e.payload.matched_size),
                                        i = (0, e2.mulBigInt)(n, a),
                                        s = e.payload.side === eq.Side.BUY ? (0, e6.computeClobBuyImpact)(i, n, r) : (0, e6.computeClobSellImpact)(i, n, r);
                                    return {
                                        txId: e.payload.transaction_hash,
                                        status: e4.TxnStatus.MATCHED,
                                        type: e4.TxnType.CLOB,
                                        metadata: {
                                            chainId: u,
                                            outcome: e.payload.outcome,
                                            outcomeIndex: r,
                                            quantity: n,
                                            usdc: i,
                                            enqueuedAt: t,
                                            lastUpdatedAt: t,
                                            positionChangeData: s,
                                            side: e.payload.side,
                                            orderType: e5.OrderType.Limit,
                                            sizeData: {
                                                originalSize: e.payload.original_size,
                                                matchedSize: (0, P.formatUSDCUnits)(n),
                                                remainingSize: parseFloat(e.payload.remaining_size).toString(),
                                                price: e.payload.price
                                            },
                                            hash: e.payload.transaction_hash
                                        },
                                        conditionId: e.payload.market.toLowerCase()
                                    }
                                }, i[1] = u, i[2] = a) : a = i[2];
                                let d = a;
                                return i[3] !== d || i[4] !== u || i[5] !== c || i[6] !== s || i[7] !== l || i[8] !== o ? (n = async e => {
                                    if (!s || !u) throw Error("No address or chain ID found");
                                    let t = d(e);
                                    if (!t || 2 !== e.type) return;
                                    let r = e.payload.asset_id ? .toLowerCase(),
                                        a = t.conditionId.toLowerCase(),
                                        n = c(s, void 0, r, a);
                                    if (n) return void await l(t, n);
                                    o.addTransaction(s, u, t);
                                    let i = await eZ(void 0, r ? [r] : void 0, a ? [a] : void 0).then(e => {
                                        let t = a.toLowerCase(),
                                            n = e.find(e => e.conditionId.toLowerCase() === t);
                                        return n || (r ? e.find(e => e.clobTokenIds ? .some(e => e.toLowerCase() === r)) : void 0)
                                    }).catch(e8);
                                    i && await l(t, i)
                                }, i[3] = d, i[4] = u, i[5] = c, i[6] = s, i[7] = l, i[8] = o, i[9] = n) : n = i[9], n
                            })(),
                            D = (0, eG.usePrevious)(_);
                        return m[19] !== k || m[20] !== _ || m[21] !== D ? (p = () => {
                            if (_ ? .length && D) {
                                let e = (0, eH.difference)(_, D),
                                    t = window.localStorage.getItem("pm.orders.ids"),
                                    r = t ? JSON.parse(t) : [],
                                    a = [];
                                if (e.length && r.length && e.forEach(e => {
                                        let t = new Date(e.timestamp),
                                            n = 1e4 > Math.abs(new Date().getTime() - t.getTime());
                                        if (2 === e.type && n) {
                                            let t = r.find(t => t === e.payload.order_id);
                                            t && (a.push(t), k(e))
                                        }
                                    }), a.length) {
                                    let e = r.filter(e => !a.includes(e));
                                    window.localStorage.setItem("pm.orders.ids", JSON.stringify(e))
                                }
                            }
                        }, m[19] = k, m[20] = _, m[21] = D, m[22] = p) : p = m[22], m[23] !== _ || m[24] !== D ? (A = [_, D], m[23] = _, m[24] = D, m[25] = A) : A = m[25], (0, g.useEffect)(p, A), m[26] !== x || m[27] !== N ? (h = {
                            clobNotifications: N,
                            allClobNotificationIds: x
                        }, m[26] = x, m[27] = N, m[28] = h) : h = m[28], h
                    })(l), {
                        txnNotifications: A
                    } = (() => {
                        let e, t, a, n, i, s, o = (0, r.c)(14),
                            l = tu(),
                            c = (0, eQ.useMarkTxnNotificationsFetched)(),
                            {
                                mutate: u
                            } = (0, tc.useConditionIdsForPartialMarketsMutation)(),
                            {
                                notificationWatermark: d
                            } = (() => {
                                let e, t, a, n, i, s = (0, r.c)(11),
                                    o = (0, eU.useQueryClient)();
                                s[0] === Symbol.for("react.memo_cache_sentinel") ? (e = ["authenticated", "isUserOnboarding"], s[0] = e) : e = s[0];
                                let {
                                    authenticated: l,
                                    isUserOnboarding: c
                                } = (0, S.useAccountContext)(e);
                                s[1] === Symbol.for("react.memo_cache_sentinel") ? (t = Date.now(), s[1] = t) : t = s[1];
                                let [u, d] = (0, g.useState)(t);
                                return s[2] !== l || s[3] !== o ? (a = () => {
                                    let e = ts;
                                    return l && (e = new ti.QueryObserver(o, {
                                        queryKey: eY.queryKeys[eW.QueryKey.Notifications].watermark().queryKey,
                                        queryFn: async () => o.getQueryData(eY.queryKeys[eW.QueryKey.Notifications].watermark().queryKey) ? ? Date.now(),
                                        staleTime: 6e4,
                                        gcTime: 1 / 0
                                    }).subscribe(e => {
                                        d(e.data ? ? Date.now())
                                    })), e
                                }, s[2] = l, s[3] = o, s[4] = a) : a = s[4], s[5] !== l || s[6] !== c || s[7] !== o ? (n = [o, l, c], s[5] = l, s[6] = c, s[7] = o, s[8] = n) : n = s[8], (0, g.useEffect)(a, n), s[9] !== u ? (i = {
                                    notificationWatermark: u
                                }, s[9] = u, s[10] = i) : i = s[10], i
                            })(),
                            p = (0, eG.usePrevious)(d),
                            A = (0, g.useRef)(!1);
                        o[0] === Symbol.for("react.memo_cache_sentinel") ? (e = [], o[0] = e) : e = o[0];
                        let [h, m] = (0, g.useState)(e);
                        return o[1] !== p || o[2] !== d || o[3] !== l ? (t = () => {
                            d !== p && m(l.filter(tp).map(e => {
                                let t;
                                return t = (e.type === e4.TxnType.CTF || e.type === e4.TxnType.AMM) && (e.metadata.ctfTxnType === e4.CTFTxnType.Split || e.metadata.ctfTxnType === e4.CTFTxnType.Merge), {
                                    id: e.txId,
                                    source: tl.UserNotificationSource.Transaction,
                                    timestamp: e.metadata.enqueuedAt,
                                    lastUpdatedTimestamp: e.metadata.lastUpdatedAt,
                                    read: d > e.metadata.lastUpdatedAt,
                                    persisted: !1,
                                    data: e,
                                    ...(0, e6.isTxnPending)(e) && {
                                        pendingData: {
                                            pending: (0, e6.isTxnPending)(e),
                                            pendingMessage: e.status === e4.TxnStatus.DELAY ? "Delayed" : e.status === e4.TxnStatus.QUEUED ? "Queued" : e.status === e4.TxnStatus.RETRYING ? "Retrying" : e.status === e4.TxnStatus.MATCHED || e.status === e4.TxnStatus.PENDING ? "Confirming" : ""
                                        }
                                    },
                                    ...e.status === e4.TxnStatus.FAILED && {
                                        failed: !0
                                    },
                                    ...(e => {
                                        let t = e.status === e4.TxnStatus.FAILED;
                                        if (e.type === e4.TxnType.AMM || e.type === e4.TxnType.CTF) {
                                            let r = e.metadata;
                                            if (r.ctfTxnType === e4.CTFTxnType.Buy) {
                                                let a = Math.abs(r.positionChangeData.shareQty[e.metadata.outcomeIndex]);
                                                return {
                                                    title: `Buy ${(0,to.capitalize)(r.outcome)}${t?" failed":""}`,
                                                    subtext: `${(0,P.formatNum)(a,{decimals:a>1e3?0:2})} shares`
                                                }
                                            }
                                            if (r.ctfTxnType === e4.CTFTxnType.Sell) {
                                                let a = Math.abs(r.positionChangeData.shareQty[e.metadata.outcomeIndex]);
                                                return {
                                                    title: `Sell ${(0,to.capitalize)(r.outcome)}${t?" failed":""}`,
                                                    subtext: `${(0,P.formatNum)(a,{decimals:a>1e3?0:2})} shares`
                                                }
                                            }
                                            return r.ctfTxnType === e4.CTFTxnType.AddLiquidity ? {
                                                title: `Add liquidity${t?" failed":""}`
                                            } : r.ctfTxnType === e4.CTFTxnType.RemoveLiquidity ? {
                                                title: `Remove liquidity${t?" failed":""}`
                                            } : r.ctfTxnType === e4.CTFTxnType.Merge ? {
                                                title: `Merge shares${t?" failed":""}`,
                                                subtext: `${(0,P.formatNum)(Math.abs(r.positionChangeData.value),{decimals:0})} shares`
                                            } : r.ctfTxnType === e4.CTFTxnType.Split ? {
                                                title: `Split shares${t?" failed":""}`,
                                                subtext: `${(0,P.formatCurrency)(Math.abs(r.positionChangeData.value),{decimals:2})}`
                                            } : {
                                                title: `Redeem shares${t?" failed":""}`,
                                                subtext: `${(0,P.formatCurrency)(r.positionChangeData.value,{decimals:2})}`
                                            }
                                        }
                                        if (e.type === e4.TxnType.CLOB) {
                                            let r = e.metadata;
                                            if (r.side === eq.Side.BUY && r.orderType === e5.OrderType.Market) {
                                                let a = Math.abs(r.positionChangeData.shareQty[e.metadata.outcomeIndex]);
                                                return {
                                                    title: `Buy ${(0,to.capitalize)(r.outcome)}${t?" failed":""}`,
                                                    subtext: `${(0,P.formatNum)(a,{decimals:a>10?0:2})} shares for ${(0,P.formatCurrency)(Math.abs(r.positionChangeData.value),{decimals:2})}`
                                                }
                                            }
                                            if (r.side === eq.Side.SELL && r.orderType === e5.OrderType.Market) {
                                                let a = Math.abs(r.positionChangeData.shareQty[e.metadata.outcomeIndex]);
                                                return {
                                                    title: `Sell ${(0,to.capitalize)(r.outcome)}${t?" failed":""}`,
                                                    subtext: `${(0,P.formatNum)(a,{decimals:a>10?0:2})} shares for ${(0,P.formatCurrency)(Math.abs(r.positionChangeData.value),{decimals:2})}`
                                                }
                                            }
                                            if (r.orderType === e5.OrderType.Limit && r.sizeData ? .originalSize && r.sizeData ? .remainingSize && r.sizeData ? .matchedSize && r.sizeData ? .price) try {
                                                let e = parseFloat(r.sizeData.originalSize),
                                                    t = e - parseFloat(r.sizeData.remainingSize),
                                                    a = parseFloat(r.sizeData.matchedSize),
                                                    n = 100 * parseFloat(r.sizeData.price);
                                                return {
                                                    title: `${r.side===eq.Side.BUY?"Limit Buy":"Limit Sell"} ${(0,to.capitalize)(r.outcome)}${"0"===r.sizeData.remainingSize||"0.01"===r.sizeData.remainingSize?"":" partially"} filled`,
                                                    subtext: `${(0,P.formatNum)(a,{decimals:a>10?0:2})} shares @ ${(0,P.formatNum)(n,{decimals:1,commas:!1})}\xa2 (${(0,P.formatNum)(t,{decimals:t>10?0:2})}/${(0,P.formatNum)(e,{decimals:0})})`
                                                }
                                            } catch (e) {
                                                console.error("Error parsing clob transaction", e)
                                            }
                                            if (r.side === eq.Side.BUY && r.orderType === e5.OrderType.Limit) {
                                                let a = Math.abs(r.positionChangeData.shareQty[e.metadata.outcomeIndex]);
                                                return {
                                                    title: `Limit Buy ${(0,to.capitalize)(r.outcome)}${t?" failed":""}`,
                                                    subtext: `${(0,P.formatNum)(a,{decimals:a>10?0:2})} shares for ${(0,P.formatCurrency)(Math.abs(r.positionChangeData.value),{decimals:2,commas:!1})}`
                                                }
                                            }
                                            if (r.side === eq.Side.SELL && r.orderType === e5.OrderType.Limit) {
                                                let a = Math.abs(r.positionChangeData.shareQty[e.metadata.outcomeIndex]);
                                                return {
                                                    title: `Limit Sell ${(0,to.capitalize)(r.outcome)}${t?" failed":""}`,
                                                    subtext: `${(0,P.formatNum)(a,{decimals:a>10?0:2})} shares for ${(0,P.formatCurrency)(Math.abs(r.positionChangeData.value),{decimals:2,commas:!1})}`
                                                }
                                            }
                                        }
                                        throw Error("Unknown transaction")
                                    })(e),
                                    ...!!e.metadata.hash && !t && {
                                        externalLink: (0, eL.assemblePolygonscanLink)(e.metadata.hash)
                                    },
                                    conditionId: e.conditionId.toString(),
                                    market: e.market
                                }
                            }).sort(tA))
                        }, a = [l, d, p], o[1] = p, o[2] = d, o[3] = l, o[4] = t, o[5] = a) : (t = o[4], a = o[5]), (0, g.useEffect)(t, a), o[6] !== c || o[7] !== u || o[8] !== h ? (n = () => {
                            if (!A.current) {
                                A.current = !0;
                                let e = h.filter(th).map(tm);
                                e.length && u({
                                    conditionIds: e
                                }), c()
                            }
                        }, o[6] = c, o[7] = u, o[8] = h, o[9] = n) : n = o[9], o[10] !== h ? (i = [h, A], o[10] = h, o[11] = i) : i = o[11], (0, g.useEffect)(n, i), o[12] !== h ? (s = {
                            txnNotifications: h
                        }, o[12] = h, o[13] = s) : s = o[13], s
                    })();
                    s[1] !== p || s[2] !== u || s[3] !== c || s[4] !== o ? (t = async () => {
                        c({
                            value: Date.now()
                        }), Array.isArray(p) && p.length > 0 && u({
                            proxyAddress: o,
                            ids: p,
                            read: !0
                        })
                    }, s[1] = p, s[2] = u, s[3] = c, s[4] = o, s[5] = t) : t = s[5];
                    let h = t;
                    if (s[6] !== d || s[7] !== A) {
                        let {
                            cleanedNotifications: e
                        } = A && d ? (0, eL.cleanNotifications)(A, d) : {
                            cleanedNotifications: []
                        };
                        a = (0, eL.dedupeNotificationsById)(e), s[6] = d, s[7] = A, s[8] = a
                    } else a = s[8];
                    let m = a;
                    s[9] !== m ? (n = m.filter(tf), s[9] = m, s[10] = n) : n = s[10];
                    let f = n.length;
                    return s[11] !== h || s[12] !== m || s[13] !== f ? (i = {
                        notifications: m,
                        unreadNotificationCount: f,
                        markNotificationsRead: h
                    }, s[11] = h, s[12] = m, s[13] = f, s[14] = i) : i = s[14], i
                })(),
                N = (0, eO.useRouter)();
            return f[0] !== N.events ? (e = () => {
                let e = () => {
                    E(!1)
                };
                return N.events.on("routeChangeComplete", e), () => {
                    N.events.off("routeChangeComplete", e)
                }
            }, n = [N.events], f[0] = N.events, f[1] = e, f[2] = n) : (e = f[1], n = f[2]), (0, g.useEffect)(e, n), f[3] !== _ ? (i = e => {
                e && _(), E(e)
            }, f[3] = _, f[4] = i) : i = f[4], f[5] === Symbol.for("react.memo_cache_sentinel") ? (s = (0, t.jsx)(m.IconBellOutline18, {
                className: "size-6 text-text-secondary"
            }), f[5] = s) : s = f[5], f[6] !== I ? (o = !!I && (0, t.jsx)("div", {
                className: "size-2 absolute translate-x-[7px] translate-y-[7px] rounded-full border-[1.5px] border-background group-hover:border-button-ghost-bg-hover bg-bg-brand"
            }), f[6] = I, f[7] = o) : o = f[7], f[8] !== o ? (l = (0, t.jsx)(ev.PopoverTrigger, {
                asChild: !0,
                children: (0, t.jsxs)(a.Button, {
                    variant: "ghost",
                    size: "icon",
                    onClick: tT,
                    className: "group rounded-sm",
                    children: [s, o]
                })
            }), f[8] = o, f[9] = l) : l = f[9], f[10] !== y ? (c = y("navbar.notifications"), f[10] = y, f[11] = c) : c = f[11], f[12] !== c ? (u = (0, t.jsx)("div", {
                className: "w-full px-2.5 pt-1.5 items-center justify-between",
                children: (0, t.jsx)("p", {
                    className: "font-medium",
                    children: c
                })
            }), f[12] = c, f[13] = u) : u = f[13], f[14] !== b ? (d = !!b.length && b.map(tb), f[14] = b, f[15] = d) : d = f[15], f[16] !== b.length || f[17] !== y ? (p = !b.length && (0, t.jsxs)("div", {
                className: "flex flex-col items-center justify-center h-28 text-text-secondary gap-3",
                children: [(0, t.jsx)(eM, {
                    size: 24
                }), (0, t.jsx)("p", {
                    className: "text-[13px] font-medium",
                    children: y("navbar.noNotifications")
                })]
            }), f[16] = b.length, f[17] = y, f[18] = p) : p = f[18], f[19] !== u || f[20] !== d || f[21] !== p ? (A = (0, t.jsx)(ev.PopoverContent, {
                side: "bottom",
                align: "end",
                alignOffset: -36,
                sideOffset: 5,
                className: "w-[calc(100vw-32px)] sm:w-[400px] max-h-[50vh] sm:max-h-[500px] overflow-y-auto p-1.5 z-1001",
                onFocusOutside: tE,
                children: (0, t.jsxs)("div", {
                    className: "w-full flex flex-col gap-1.5",
                    children: [u, d, p]
                })
            }), f[19] = u, f[20] = d, f[21] = p, f[22] = A) : A = f[22], f[23] !== T || f[24] !== A || f[25] !== i || f[26] !== l ? (h = (0, t.jsxs)(ev.Popover, {
                open: T,
                onOpenChange: i,
                children: [l, A]
            }), f[23] = T, f[24] = A, f[25] = i, f[26] = l, f[27] = h) : h = f[27], h
        };

    function tT() {
        return null
    }

    function tE(e) {
        e.preventDefault()
    }

    function tb(e) {
        return (0, t.jsx)(tg, {
            notification: e
        }, e.id)
    }
    let tI = () => {
            let e, a = (0, r.c)(1);
            return a[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)("hr", {
                className: "w-full h-px bg-border"
            }), a[0] = e) : e = a[0], e
        },
        tC = e => {
            let a, n = (0, r.c)(5),
                {
                    authenticated: i,
                    accountProfile: s,
                    proxyAddress: o,
                    showLocalePrompt: l
                } = e;
            return n[0] !== s || n[1] !== i || n[2] !== o || n[3] !== l ? (a = i && s && o ? (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsxs)("div", {
                    className: "relative",
                    children: [(0, t.jsx)(w.default, {
                        alt: "profile photo",
                        address: o,
                        className: "rounded-3xl",
                        height: 32,
                        profileImage: s.profile_image,
                        quality: 100,
                        width: 32
                    }), l && (0, t.jsx)("div", {
                        className: "absolute -bottom-0.5 -right-0.5 rounded-full bg-background group-hover:bg-neutral-50 p-[1px] transition-colors duration-200",
                        children: (0, t.jsx)(u.IconGlobe2Fill18, {
                            className: "size-3.5 text-text-brand"
                        })
                    })]
                }), (0, t.jsx)(p.IconChevronDownOutline12, {
                    className: "ml-1.5 text-text-secondary transition-transform duration-200 group-data-[state=open]:rotate-180"
                })]
            }) : (0, t.jsxs)("div", {
                className: "relative",
                children: [(0, t.jsx)(d.IconMenuFill18, {
                    className: "w-6 h-[18px]"
                }), l && (0, t.jsx)("div", {
                    className: "absolute -bottom-1 -right-1 rounded-full bg-background group-hover:bg-neutral-50 p-[1px] transition-colors duration-200",
                    children: (0, t.jsx)(u.IconGlobe2Fill18, {
                        className: "size-3.5 text-text-brand"
                    })
                })]
            }), n[0] = s, n[1] = i, n[2] = o, n[3] = l, n[4] = a) : a = n[4], a
        },
        tS = () => {
            let e, n, o, l = (0, r.c)(3);
            return l[0] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(i.Skeleton, {
                className: "size-8 rounded-full shrink-0"
            }), l[0] = e) : e = l[0], l[1] === Symbol.for("react.memo_cache_sentinel") ? (n = (0, t.jsxs)("div", {
                className: "w-full flex flex-row items-center gap-3",
                children: [e, (0, t.jsxs)("div", {
                    className: "flex flex-col gap-[2px] min-w-0 overflow-hidden",
                    children: [(0, t.jsx)(i.Skeleton, {
                        className: "w-24 h-4"
                    }), (0, t.jsx)(i.Skeleton, {
                        className: "w-16 h-3"
                    })]
                })]
            }), l[1] = n) : n = l[1], l[2] === Symbol.for("react.memo_cache_sentinel") ? (o = (0, t.jsxs)("ul", {
                className: "flex flex-col relative w-full list-none",
                children: [(0, t.jsx)("li", {
                    children: (0, t.jsx)(s.UserMenuHeader, {
                        profileLink: n,
                        settingsLink: (0, t.jsx)(c.default, {
                            href: "/settings",
                            children: (0, t.jsx)(a.Button, {
                                variant: "ghost",
                                size: "icon",
                                className: "h-9 w-9 shrink-0 rounded-full",
                                children: (0, t.jsx)(A.IconGearOutline18, {
                                    size: 20
                                })
                            })
                        })
                    })
                }), (0, t.jsx)(M.UserAreaAuthedNavigationLinks, {}), (0, t.jsx)(tI, {}), (0, t.jsx)(M.UserAreaBottomNavigationLinks, {})]
            }), l[2] = o) : o = l[2], o
        },
        t_ = e => {
            let o, l, u, d, h, m, f, y, T, b, C, S, _, x, k, D, v, L, B = (0, r.c)(69),
                {
                    showUnauthenticatedUI: P,
                    isReconnecting: F,
                    isSessionLoading: U,
                    authenticated: G,
                    proxyAddress: H
                } = e,
                {
                    accountProfile: j
                } = (0, O.default)(),
                [Q, K] = (0, g.useState)(!1),
                Y = g.default.useRef(null),
                {
                    isMobileMenuOpen: W,
                    setIsMobileMenuOpen: q
                } = (0, N.useBottomDrawerContext)(),
                {
                    showPrompt: V,
                    startOpenTimer: z,
                    completeInteraction: J
                } = (0, E.useLocalePrompt)(),
                Z = g.default.useRef(Q),
                $ = g.default.useRef(W),
                [X, ee] = (0, g.useState)(!1);
            B[0] === Symbol.for("react.memo_cache_sentinel") ? (o = () => {
                ee((0, I.isTouchScreenOnlyDevice)())
            }, l = [], B[0] = o, B[1] = l) : (o = B[0], l = B[1]), (0, g.useEffect)(o, l), B[2] !== X ? (u = () => {
                X || (Y.current && (clearTimeout(Y.current), Y.current = null), K(!0))
            }, B[2] = X, B[3] = u) : u = B[3];
            let et = u;
            B[4] !== X ? (d = () => {
                X || (Y.current = setTimeout(() => {
                    K(!1)
                }, 100))
            }, B[4] = X, B[5] = d) : d = B[5];
            let er = d;
            if (B[6] !== J || B[7] !== Q || B[8] !== z ? (h = () => {
                    Q && !Z.current ? z() : !Q && Z.current && J(), Z.current = Q
                }, m = [Q, z, J], B[6] = J, B[7] = Q, B[8] = z, B[9] = h, B[10] = m) : (h = B[9], m = B[10]), g.default.useEffect(h, m), B[11] !== J || B[12] !== W || B[13] !== z ? (f = () => {
                    W && !$.current ? z() : !W && $.current && J(), $.current = W
                }, y = [W, z, J], B[11] = J, B[12] = W, B[13] = z, B[14] = f, B[15] = y) : (f = B[14], y = B[15]), g.default.useEffect(f, y), B[16] === Symbol.for("react.memo_cache_sentinel") ? (b = () => () => {
                    Y.current && clearTimeout(Y.current)
                }, T = [], B[16] = T, B[17] = b) : (T = B[16], b = B[17]), g.default.useEffect(b, T), F) {
                let e, r, a, s, o, l, c, u;
                return B[18] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)("div", {
                    className: "h-5 w-px bg-border -ml-1 hidden md:block"
                }), B[18] = e) : e = B[18], B[19] !== X ? (r = e => {
                    X || (e.stopPropagation(), e.preventDefault())
                }, B[19] = X, B[20] = r) : r = B[20], B[21] === Symbol.for("react.memo_cache_sentinel") ? (a = (0, t.jsx)(i.Skeleton, {
                    className: "size-8 rounded-full"
                }), s = (0, t.jsx)(p.IconChevronDownOutline12, {
                    className: "ml-1.5 text-text-secondary transition-transform duration-200 group-data-[state=open]:rotate-180"
                }), B[21] = a, B[22] = s) : (a = B[21], s = B[22]), B[23] !== et || B[24] !== er || B[25] !== r ? (o = (0, t.jsxs)(n.DropdownMenuTrigger, {
                    "aria-label": "Open user menu",
                    onMouseEnter: et,
                    onMouseLeave: er,
                    onPointerDown: r,
                    className: "group items-center p-2 hidden md:flex cursor-pointer hover:bg-neutral-50 focus:outline-none focus-visible:outline-none transition-none rounded-full",
                    children: [a, s]
                }), B[23] = et, B[24] = er, B[25] = r, B[26] = o) : o = B[26], B[27] === Symbol.for("react.memo_cache_sentinel") ? (l = (0, t.jsx)(tS, {}), B[27] = l) : l = B[27], B[28] !== et || B[29] !== er ? (c = (0, t.jsx)(n.DropdownMenuContent, {
                    sideOffset: 10,
                    align: "end",
                    className: "p-0 gap-0 max-h-[calc(100vh-80px)] -mt-1 w-[240px]",
                    onMouseEnter: et,
                    onMouseLeave: er,
                    children: l
                }), B[28] = et, B[29] = er, B[30] = c) : c = B[30], B[31] !== Q || B[32] !== o || B[33] !== c ? (u = (0, t.jsxs)("div", {
                    className: "flex items-center gap-x-2",
                    children: [e, (0, t.jsxs)(n.DropdownMenu, {
                        open: Q,
                        onOpenChange: K,
                        children: [o, c]
                    })]
                }), B[31] = Q, B[32] = o, B[33] = c, B[34] = u) : u = B[34], u
            }
            if (G) {
                if (U) {
                    let e;
                    return B[36] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(i.Skeleton, {
                        className: "w-8 h-7 ml-3 mr-0 hidden md:block"
                    }), B[36] = e) : e = B[36], e
                }
            } else if (!P) {
                let e;
                return B[35] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsx)(i.Skeleton, {
                    className: "w-8 h-7 ml-3 mr-0 hidden md:block"
                }), B[35] = e) : e = B[35], e
            }
            B[37] !== j ? .profile_image || B[38] !== G || B[39] !== H || B[40] !== q || B[41] !== V ? (C = G && (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)("div", {
                    className: "h-5 w-px bg-border -ml-1 hidden md:block"
                }), (0, t.jsxs)("button", {
                    type: "button",
                    onClick: () => q(!0),
                    className: "group md:hidden cursor-pointer relative",
                    children: [(0, t.jsx)(w.default, {
                        alt: "profile photo",
                        address: H ? ? "",
                        className: "rounded-3xl",
                        height: 32,
                        profileImage: j ? .profile_image,
                        quality: 100,
                        width: 32
                    }), V && (0, t.jsx)("div", {
                        className: "size-2 absolute bottom-0 right-0 rounded-full border-[1.5px] border-background bg-bg-brand"
                    })]
                })]
            }), B[37] = j ? .profile_image, B[38] = G, B[39] = H, B[40] = q, B[41] = V, B[42] = C) : C = B[42], B[43] !== X ? (S = e => {
                X || (e.stopPropagation(), e.preventDefault())
            }, B[43] = X, B[44] = S) : S = B[44];
            let ea = `group items-center p-2 hidden md:flex cursor-pointer hover:bg-neutral-50 focus:outline-none focus-visible:outline-none transition-none ${G?"rounded-full":"rounded-[6px]"}`;
            return B[45] !== j || B[46] !== G || B[47] !== H || B[48] !== V ? (_ = (0, t.jsx)(tC, {
                authenticated: G,
                accountProfile: j,
                proxyAddress: H,
                showLocalePrompt: V
            }), B[45] = j, B[46] = G, B[47] = H, B[48] = V, B[49] = _) : _ = B[49], B[50] !== et || B[51] !== er || B[52] !== S || B[53] !== ea || B[54] !== _ ? (x = (0, t.jsx)(n.DropdownMenuTrigger, {
                "aria-label": "Open user menu",
                onMouseEnter: et,
                onMouseLeave: er,
                onPointerDown: S,
                className: ea,
                children: _
            }), B[50] = et, B[51] = er, B[52] = S, B[53] = ea, B[54] = _, B[55] = x) : x = B[55], B[56] !== G ? (k = (0, t.jsx)("ul", {
                className: "flex flex-col relative w-full list-none",
                children: G ? (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)("li", {
                        children: (0, t.jsx)(s.UserMenuHeader, {
                            profileLink: (0, t.jsx)(R.default, {}),
                            settingsLink: (0, t.jsx)(c.default, {
                                href: "/settings",
                                children: (0, t.jsx)(a.Button, {
                                    variant: "ghost",
                                    size: "icon",
                                    className: "h-9 w-9 shrink-0 rounded-full",
                                    children: (0, t.jsx)(A.IconGearOutline18, {
                                        size: 20
                                    })
                                })
                            })
                        })
                    }), (0, t.jsx)(M.UserAreaAuthedNavigationLinks, {}), (0, t.jsx)(tI, {}), (0, t.jsx)(M.UserAreaBottomNavigationLinks, {})]
                }) : (0, t.jsx)(M.UserAreaUnauthedNavigationLinks, {})
            }), B[56] = G, B[57] = k) : k = B[57], B[58] !== et || B[59] !== er || B[60] !== k ? (D = (0, t.jsx)(n.DropdownMenuContent, {
                sideOffset: 10,
                align: "end",
                className: "p-0 gap-0 max-h-[calc(100vh-80px)] -mt-1 w-[240px]",
                onMouseEnter: et,
                onMouseLeave: er,
                children: k
            }), B[58] = et, B[59] = er, B[60] = k, B[61] = D) : D = B[61], B[62] !== Q || B[63] !== x || B[64] !== D ? (v = (0, t.jsxs)(n.DropdownMenu, {
                open: Q,
                onOpenChange: K,
                children: [x, D]
            }), B[62] = Q, B[63] = x, B[64] = D, B[65] = v) : v = B[65], B[66] !== C || B[67] !== v ? (L = (0, t.jsxs)("div", {
                className: "flex items-center gap-x-2",
                children: [C, v]
            }), B[66] = C, B[67] = v, B[68] = L) : L = B[68], L
        },
        tN = e => {
            let n, s, u, d = (0, r.c)(53),
                {
                    showUnauthenticatedUI: p,
                    isReconnecting: A,
                    authenticated: g,
                    isSessionLoading: E,
                    showDepositButton: I,
                    canDeposit: S,
                    proxyAddress: N
                } = e,
                k = (0, C.useTranslations)(),
                D = (0, _.useAmplitudeAnalytics)(),
                {
                    onBeginCheckout: w
                } = (0, x.useFunkitContext)();
            d[0] !== N ? (n = (0, L.readNavbarBalances)(N), d[0] = N, d[1] = n) : n = d[1];
            let O = n,
                R = (0, B.useBalanceVisibilityStore)(tk);
            d[2] !== D || d[3] !== S || d[4] !== w ? (s = () => {
                S && (D.trackEvent(b.Events.DepositNavbarButtonClicked), w())
            }, d[2] = D, d[3] = S, d[4] = w, d[5] = s) : s = d[5];
            let M = s;
            if (A) {
                let e, r, n, i, s, l, u, p, A, g, y, T, E, b, I = null !== O;
                d[6] !== O || d[7] !== I ? (e = I ? (0, P.formatToDollar)(O.portfolio, {
                    minimumFractionDigits: O.portfolio > 1e3 ? 0 : 2,
                    maximumFractionDigits: O.portfolio > 1e3 ? 0 : 2
                }) : "", d[6] = O, d[7] = I, d[8] = e) : e = d[8];
                let C = e;
                d[9] !== O || d[10] !== I ? (r = I ? (0, P.formatCurrency)(O.cash, {
                    decimals: O.cash > 1e3 ? 0 : 2
                }) : "", d[9] = O, d[10] = I, d[11] = r) : r = d[11];
                let S = r;
                d[12] !== k ? (n = k("navbar.portfolio"), d[12] = k, d[13] = n) : n = d[13];
                let _ = !I;
                d[14] !== C || d[15] !== R || d[16] !== n || d[17] !== _ ? (i = (0, t.jsx)(f.NavbarBalancePill, {
                    label: n,
                    value: C,
                    isLoading: _,
                    hidden: R
                }), d[14] = C, d[15] = R, d[16] = n, d[17] = _, d[18] = i) : i = d[18], d[19] !== k ? (s = k("navbar.cash"), d[19] = k, d[20] = s) : s = d[20];
                let N = !I;
                return d[21] !== S || d[22] !== R || d[23] !== s || d[24] !== N ? (l = (0, t.jsx)(f.NavbarBalancePill, {
                    label: s,
                    value: S,
                    isLoading: N,
                    hidden: R
                }), d[21] = S, d[22] = R, d[23] = s, d[24] = N, d[25] = l) : l = d[25], d[26] !== l || d[27] !== i ? (u = (0, t.jsxs)("div", {
                    className: "gap-x-1 items-center hidden md:flex",
                    children: [i, l]
                }), d[26] = l, d[27] = i, d[28] = u) : u = d[28], d[29] !== k ? (p = k("navbar.deposit"), d[29] = k, d[30] = p) : p = d[30], d[31] !== p ? (A = (0, t.jsx)("span", {
                    className: "hidden md:inline-flex",
                    children: (0, t.jsx)(a.Button, {
                        className: "md:flex",
                        onClick: tD,
                        children: p
                    })
                }), d[31] = p, d[32] = A) : A = d[32], d[33] === Symbol.for("react.memo_cache_sentinel") ? (g = (0, t.jsx)(o.TooltipTrigger, {
                    asChild: !0,
                    children: (0, t.jsx)(a.Button, {
                        variant: "ghost",
                        size: "icon",
                        className: "rounded-sm",
                        asChild: !0,
                        children: (0, t.jsx)(c.default, {
                            href: "/refer",
                            children: (0, t.jsx)(h.IconGiftOutline18, {
                                className: "size-6 text-text-secondary"
                            })
                        })
                    })
                }), d[33] = g) : g = d[33], d[34] !== k ? (y = k("navbar.referAndEarn"), d[34] = k, d[35] = y) : y = d[35], d[36] !== y ? (T = (0, t.jsx)(o.TooltipProvider, {
                    children: (0, t.jsxs)(o.TooltipRoot, {
                        children: [g, (0, t.jsx)(o.TooltipContent, {
                            side: "bottom",
                            sideOffset: 8,
                            children: y
                        })]
                    })
                }), d[36] = y, d[37] = T) : T = d[37], d[38] === Symbol.for("react.memo_cache_sentinel") ? (E = (0, t.jsx)(a.Button, {
                    variant: "ghost",
                    size: "icon",
                    className: "group rounded-sm",
                    onClick: tv,
                    children: (0, t.jsx)(m.IconBellOutline18, {
                        className: "size-6 text-text-secondary"
                    })
                }), d[38] = E) : E = d[38], d[39] !== u || d[40] !== A || d[41] !== T ? (b = (0, t.jsxs)("div", {
                    className: "flex items-center gap-x-2 min-w-0",
                    children: [u, A, T, E]
                }), d[39] = u, d[40] = A, d[41] = T, d[42] = b) : b = d[42], b
            }
            if (g) {
                if (E) {
                    let e;
                    return d[44] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsxs)(t.Fragment, {
                        children: [(0, t.jsx)(i.Skeleton, {
                            className: "w-14 h-7 mr-2 ml-5"
                        }), (0, t.jsx)(i.Skeleton, {
                            className: "w-14 h-7"
                        })]
                    }), d[44] = e) : e = d[44], e
                }
            } else if (!p) {
                let e;
                return d[43] === Symbol.for("react.memo_cache_sentinel") ? (e = (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsx)(i.Skeleton, {
                        className: "w-14 h-7 mr-2 ml-5"
                    }), (0, t.jsx)(i.Skeleton, {
                        className: "w-14 h-7"
                    })]
                }), d[43] = e) : e = d[43], e
            }
            return d[45] !== D || d[46] !== g || d[47] !== S || d[48] !== M || d[49] !== N || d[50] !== I || d[51] !== k ? (u = (0, t.jsx)("div", {
                className: "flex items-center gap-x-2 min-w-0",
                children: g ? (0, t.jsxs)(t.Fragment, {
                    children: [(0, t.jsxs)("div", {
                        className: "gap-x-1 items-center hidden md:flex",
                        children: [(0, t.jsx)(ex, {
                            proxyAddress: N
                        }), (0, t.jsx)(eC, {
                            proxyAddress: N
                        })]
                    }), I && (0, t.jsx)(o.TooltipProvider, {
                        children: (0, t.jsxs)(o.TooltipRoot, {
                            children: [(0, t.jsx)(o.TooltipTrigger, {
                                asChild: !0,
                                children: (0, t.jsx)("span", {
                                    className: "hidden md:inline-flex",
                                    children: (0, t.jsx)(a.Button, {
                                        className: (0, l.cn)("md:flex", !S && "opacity-50 cursor-not-allowed"),
                                        disabled: !S,
                                        onClick: M,
                                        children: k("navbar.deposit")
                                    })
                                })
                            }), !S && (0, t.jsxs)(o.TooltipContent, {
                                side: "bottom",
                                align: "center",
                                sideOffset: 8,
                                className: "py-2",
                                children: [(0, t.jsx)("p", {
                                    children: k("trading.geoRestrictions.depositingUnavailableInRegion")
                                }), (0, t.jsx)(c.default, {
                                    href: `${v.POLYMARKET_DOCS_LINK}/api-reference/geoblock#blocked-countries`,
                                    target: "_blank",
                                    rel: "noopener noreferrer",
                                    className: "underline text-brand-500 hover:opacity-80",
                                    children: k("trading.geoRestrictions.availableRegions")
                                })]
                            })]
                        })
                    }), (0, t.jsx)(o.TooltipProvider, {
                        children: (0, t.jsxs)(o.TooltipRoot, {
                            children: [(0, t.jsx)(o.TooltipTrigger, {
                                asChild: !0,
                                children: (0, t.jsx)(a.Button, {
                                    variant: "ghost",
                                    size: "icon",
                                    className: "rounded-sm",
                                    asChild: !0,
                                    children: (0, t.jsx)(c.default, {
                                        href: "/refer",
                                        onClick: () => D.trackEvent(b.Events.ReferNavbarButtonClicked),
                                        children: (0, t.jsx)(h.IconGiftOutline18, {
                                            className: "size-6 text-text-secondary"
                                        })
                                    })
                                })
                            }), (0, t.jsx)(o.TooltipContent, {
                                side: "bottom",
                                sideOffset: 8,
                                children: k("navbar.referAndEarn")
                            })]
                        })
                    }), (0, t.jsx)(ty, {})]
                }) : (0, t.jsxs)("div", {
                    className: "flex items-center gap-x-1.5 min-w-0 md:min-w-fit",
                    children: [(0, t.jsx)(y.default, {}), (0, t.jsx)(T.default, {})]
                })
            }), d[45] = D, d[46] = g, d[47] = S, d[48] = M, d[49] = N, d[50] = I, d[51] = k, d[52] = u) : u = d[52], u
        };

    function tx(e) {
        return e.permissions
    }

    function tk(e) {
        return e.portfolioHidden
    }

    function tD(e) {
        return e.preventDefault()
    }

    function tv(e) {
        return e.preventDefault()
    }
    e.s(["DesktopNavigationMenuRight", 0, e => {
        let a, n, i, s, o = (0, r.c)(18),
            {
                showUnauthenticatedUI: l,
                isReconnecting: c
            } = e;
        o[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["isSessionLoading", "authenticated", "proxyAddress"], o[0] = a) : a = o[0];
        let {
            isSessionLoading: u,
            authenticated: d,
            proxyAddress: p
        } = (0, S.useAccountContext)(a), {
            isVisible: A,
            canDeposit: h
        } = (e => {
            let t, a, n, i = (0, r.c)(8),
                s = (0, k.useGeoStore)(tx);
            i[0] === Symbol.for("react.memo_cache_sentinel") ? (t = ["proxyAddress", "closedDynamic"], i[0] = t) : t = i[0];
            let {
                proxyAddress: o,
                closedDynamic: l
            } = (0, S.useAccountContext)(t);
            i[1] !== l || i[2] !== s || i[3] !== o ? (a = (0, D.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(o, s, l), i[1] = l, i[2] = s, i[3] = o, i[4] = a) : a = i[4];
            let c = !!e,
                u = !!a.canDeposit;
            return i[5] !== c || i[6] !== u ? (n = {
                isVisible: c,
                canDeposit: u
            }, i[5] = c, i[6] = u, i[7] = n) : n = i[7], n
        })(d);
        return o[1] !== d || o[2] !== h || o[3] !== u || o[4] !== c || o[5] !== p || o[6] !== A || o[7] !== l ? (n = (0, t.jsx)(tN, {
            showUnauthenticatedUI: l,
            isReconnecting: c,
            authenticated: d,
            isSessionLoading: u,
            proxyAddress: p,
            showDepositButton: A,
            canDeposit: h
        }), o[1] = d, o[2] = h, o[3] = u, o[4] = c, o[5] = p, o[6] = A, o[7] = l, o[8] = n) : n = o[8], o[9] !== d || o[10] !== u || o[11] !== c || o[12] !== p || o[13] !== l ? (i = (0, t.jsx)(t_, {
            showUnauthenticatedUI: l,
            isReconnecting: c,
            isSessionLoading: u,
            authenticated: d,
            proxyAddress: p
        }), o[9] = d, o[10] = u, o[11] = c, o[12] = p, o[13] = l, o[14] = i) : i = o[14], o[15] !== n || o[16] !== i ? (s = (0, t.jsxs)("div", {
            className: "flex items-center gap-x-2 min-w-0 ml-auto",
            children: [n, i]
        }), o[15] = n, o[16] = i, o[17] = s) : s = o[17], s
    }], 889038), e.s(["SecondaryTabLink", 0, function(e) {
        let a, n, i, s, o, u = (0, r.c)(11);
        u[0] !== e ? ({
            active: a,
            className: n,
            ...i
        } = e, u[0] = e, u[1] = a, u[2] = n, u[3] = i) : (a = u[1], n = u[2], i = u[3]);
        let d = a ? "page" : void 0,
            p = a ? "font-semibold tracking-[-0.005em] text-text" : "text-text-secondary hover:text-text-tertiary";
        return u[4] !== n || u[5] !== p ? (s = (0, l.cn)("inline-flex cursor-pointer h-full items-center justify-center whitespace-nowrap rounded-md px-2.5 py-1 font-semibold ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 text-body-base gap-1.5 transition-colors duration-150", p, n), u[4] = n, u[5] = p, u[6] = s) : s = u[6], u[7] !== i || u[8] !== d || u[9] !== s ? (o = (0, t.jsx)(c.default, { ...i,
            "aria-current": d,
            className: s,
            children: i.children
        }), u[7] = i, u[8] = d, u[9] = s, u[10] = o) : o = u[10], o
    }], 915813)
}, 254380, 185776, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(416340),
        n = e.i(160809),
        i = e.i(149534);
    let s = ({
        strokeWidth: e = 1.5,
        ...t
    }) => a.default.createElement(i.Icon, {
        size: "18px",
        ...t
    }, a.default.createElement("polyline", {
        points: "6.5 2.75 12.75 9 6.5 15.25",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));
    e.s(["IconChevronRightOutline18", 0, s], 185776);
    var o = e.i(86831);

    function l() {}
    e.s(["ScrollContainer", 0, e => {
        let i, c, u, d, p, A, h, m, f, g, y, T = (0, r.c)(74),
            {
                children: E,
                className: b,
                onScroll: I,
                containerRef: C,
                showArrows: S,
                gradients: _,
                gradientClassName: N,
                scrollDirection: x,
                wrapperClassName: k,
                orientation: D
            } = e,
            v = void 0 !== S && S,
            w = void 0 === _ ? "both" : _,
            O = void 0 === x ? "all" : x,
            [R, M] = (0, a.useState)(!1),
            [L, B] = (0, a.useState)(!1),
            [P, F] = (0, a.useState)(!1),
            U = "vertical" === (void 0 === D ? "horizontal" : D);
        T[0] !== C || T[1] !== U || T[2] !== I ? (i = () => {
            let e = C.current;
            if (e) {
                if (U) {
                    let t = e.scrollHeight > e.clientHeight;
                    F(t), t ? (M(e.scrollTop > 0), B(e.scrollTop < e.scrollHeight - e.clientHeight - 1)) : (M(!1), B(!1))
                } else {
                    let t = e.scrollWidth > e.clientWidth;
                    F(t), t ? (M(e.scrollLeft > 0), B(e.scrollLeft < e.scrollWidth - e.clientWidth - 1)) : (M(!1), B(!1))
                }
                I ? .(e)
            }
        }, T[0] = C, T[1] = U, T[2] = I, T[3] = i) : i = T[3];
        let G = i;
        T[4] !== C ? (c = e => {
            let t = C.current;
            t && t.scrollBy({
                left: "left" === e ? -500 : 500,
                behavior: "smooth"
            })
        }, T[4] = C, T[5] = c) : c = T[5];
        let H = c;
        if (T[6] !== G || T[7] !== C || T[8] !== U || T[9] !== O ? (u = () => {
                let e = C.current;
                if (e) {
                    let t = setTimeout(() => {
                            G()
                        }, 20),
                        r = t => {
                            let r = Math.abs(t.deltaY) > 0,
                                a = Math.abs(t.deltaY) > Math.abs(t.deltaX);
                            "horizontal" === O && r && a && (t.preventDefault(), e.scrollBy({
                                left: t.deltaY,
                                behavior: "auto"
                            }))
                        };
                    return e.addEventListener("scroll", G), U || e.addEventListener("wheel", r), window.addEventListener("resize", G), () => {
                        clearTimeout(t), e.removeEventListener("scroll", G), U || e.removeEventListener("wheel", r), window.removeEventListener("resize", G)
                    }
                }
                return l
            }, T[6] = G, T[7] = C, T[8] = U, T[9] = O, T[10] = u) : u = T[10], T[11] !== G || T[12] !== E || T[13] !== C || T[14] !== U || T[15] !== I || T[16] !== O ? (d = [I, E, C, G, O, U], T[11] = G, T[12] = E, T[13] = C, T[14] = U, T[15] = I, T[16] = O, T[17] = d) : d = T[17], (0, a.useEffect)(u, d), U) {
            let e, r, a, n, i;
            return T[18] !== k ? (e = (0, o.cn)("relative", k), T[18] = k, T[19] = e) : e = T[19], T[20] !== N || T[21] !== w || T[22] !== P || T[23] !== R ? (r = ("both" === w || "left" === w) && (0, t.jsx)("div", {
                className: (0, o.cn)("absolute left-0 right-0 -top-px h-12 bg-gradient-to-b from-background to-transparent z-[2] pointer-events-none transition-opacity duration-200", R && P ? "opacity-100" : "opacity-0", N)
            }), T[20] = N, T[21] = w, T[22] = P, T[23] = R, T[24] = r) : r = T[24], T[25] !== E || T[26] !== b || T[27] !== C ? (a = (0, t.jsx)("div", {
                ref: C,
                className: b,
                children: E
            }), T[25] = E, T[26] = b, T[27] = C, T[28] = a) : a = T[28], T[29] !== N || T[30] !== w || T[31] !== P || T[32] !== L ? (n = ("both" === w || "right" === w) && (0, t.jsx)("div", {
                className: (0, o.cn)("absolute left-0 right-0 -bottom-px h-12 bg-gradient-to-t from-background to-transparent z-[2] pointer-events-none transition-opacity duration-200", L && P ? "opacity-100" : "opacity-0", N)
            }), T[29] = N, T[30] = w, T[31] = P, T[32] = L, T[33] = n) : n = T[33], T[34] !== r || T[35] !== a || T[36] !== n || T[37] !== e ? (i = (0, t.jsxs)("div", {
                className: e,
                children: [r, a, n]
            }), T[34] = r, T[35] = a, T[36] = n, T[37] = e, T[38] = i) : i = T[38], i
        }
        return T[39] !== k ? (p = (0, o.cn)("relative", k), T[39] = k, T[40] = p) : p = T[40], T[41] !== N || T[42] !== w || T[43] !== P || T[44] !== v || T[45] !== R ? (A = ("both" === w || "left" === w) && (0, t.jsx)("div", {
            className: (0, o.cn)("absolute left-0 top-0 bottom-0 w-8 md:w-16 bg-gradient-to-r from-background to-transparent z-[2] pointer-events-none transition-opacity duration-200", v ? "via-background" : "", R && P ? "opacity-100" : "opacity-0", N)
        }), T[41] = N, T[42] = w, T[43] = P, T[44] = v, T[45] = R, T[46] = A) : A = T[46], T[47] !== P || T[48] !== H || T[49] !== v || T[50] !== R ? (h = v && R && P && (0, t.jsx)("button", {
            type: "button",
            className: "hidden lg:flex items-center justify-center absolute left-0 top-1/2 -translate-y-1/2 z-[3] text-text-secondary cursor-pointer hover:text-text w-7 h-7",
            onClick: () => H("left"),
            "aria-label": "Scroll left",
            children: (0, t.jsx)(n.IconChevronLeftOutline18, {
                title: "Scroll left"
            })
        }), T[47] = P, T[48] = H, T[49] = v, T[50] = R, T[51] = h) : h = T[51], T[52] !== E || T[53] !== b || T[54] !== C ? (m = (0, t.jsx)("div", {
            ref: C,
            className: b,
            children: E
        }), T[52] = E, T[53] = b, T[54] = C, T[55] = m) : m = T[55], T[56] !== P || T[57] !== H || T[58] !== v || T[59] !== L ? (f = v && L && P && (0, t.jsx)("button", {
            type: "button",
            className: "hidden lg:flex items-center justify-center absolute right-0 top-1/2 -translate-y-1/2 z-[3] text-text-secondary cursor-pointer hover:text-text w-7 h-7",
            onClick: () => H("right"),
            "aria-label": "Scroll right",
            children: (0, t.jsx)(s, {
                title: "Scroll right"
            })
        }), T[56] = P, T[57] = H, T[58] = v, T[59] = L, T[60] = f) : f = T[60], T[61] !== N || T[62] !== w || T[63] !== P || T[64] !== v || T[65] !== L ? (g = ("both" === w || "right" === w) && (0, t.jsx)("div", {
            className: (0, o.cn)("absolute right-0 top-0 bottom-0 w-8 md:w-16 bg-gradient-to-l from-background to-transparent z-[2] pointer-events-none transition-opacity duration-200", v ? "via-background" : "", L && P ? "opacity-100" : "opacity-0", N)
        }), T[61] = N, T[62] = w, T[63] = P, T[64] = v, T[65] = L, T[66] = g) : g = T[66], T[67] !== A || T[68] !== h || T[69] !== m || T[70] !== f || T[71] !== g || T[72] !== p ? (y = (0, t.jsxs)("div", {
            className: p,
            children: [A, h, m, f, g]
        }), T[67] = A, T[68] = h, T[69] = m, T[70] = f, T[71] = g, T[72] = p, T[73] = y) : y = T[73], y
    }], 254380)
}, 227461, 35261, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(999061),
        a = e.i(23128),
        n = e.i(253264),
        i = e.i(810123),
        s = e.i(416340),
        o = e.i(668122),
        l = e.i(604777),
        c = e.i(635672),
        u = e.i(784521),
        d = e.i(305457),
        p = e.i(171047),
        A = e.i(889038),
        h = e.i(961828),
        m = e.i(259760),
        f = e.i(158789),
        g = e.i(915813),
        y = e.i(254380),
        T = e.i(86831);

    function E(e) {
        let a, n, i, s, o = (0, r.c)(12),
            {
                children: l,
                containerRef: c,
                wrapperClassName: u,
                className: d,
                gradientClassName: p
            } = e;
        return o[0] !== u ? (a = (0, T.cn)("w-full", u), o[0] = u, o[1] = a) : a = o[1], o[2] !== p ? (n = (0, T.cn)("top-1 bottom-1", p), o[2] = p, o[3] = n) : n = o[3], o[4] !== d ? (i = (0, T.cn)("flex overflow-x-auto snap-x scroll-px-3 snap-mandatory min-w-0 no-scrollbar h-12 pl-0 items-center w-full", d), o[4] = d, o[5] = i) : i = o[5], o[6] !== l || o[7] !== c || o[8] !== a || o[9] !== n || o[10] !== i ? (s = (0, t.jsx)(y.ScrollContainer, {
            wrapperClassName: a,
            gradients: "both",
            gradientClassName: n,
            className: i,
            containerRef: c,
            children: l
        }), o[6] = l, o[7] = c, o[8] = a, o[9] = n, o[10] = i, o[11] = s) : s = o[11], s
    }
    var b = e.i(964974),
        I = e.i(318594),
        C = e.i(798631),
        S = e.i(673280),
        _ = e.i(149534);
    let N = ({
        strokeWidth: e = 1.5,
        ...t
    }) => s.default.createElement(_.Icon, {
        size: "18px",
        ...t
    }, s.default.createElement("polyline", {
        points: "2 14 5 10.75 6 13.25 10 6.75 12 12.25 16 4",
        fill: "none",
        stroke: "currentColor",
        strokeLinecap: "round",
        strokeLinejoin: "round",
        strokeWidth: e
    }));
    e.s(["IconChartActivityOutline18", 0, N], 35261);
    var x = e.i(515264),
        k = e.i(822213),
        D = e.i(296831),
        v = e.i(336896),
        w = e.i(864006),
        O = e.i(233522),
        R = e.i(491163),
        M = e.i(177521),
        L = e.i(893299),
        B = e.i(448030),
        P = e.i(870555),
        F = e.i(248131);
    let U = ["all"],
        G = ["trending", "new"],
        H = {
            earnings: "/earnings",
            finance: "/finance",
            crypto: "/crypto",
            sports: "/sports/live",
            esports: "/esports/live",
            weather: "/weather",
            "mention-markets": "/mentions",
            elections: "/elections",
            breaking: "/breaking",
            oscars: "/predictions/oscars/2026"
        },
        j = e => ({
            primaryTagSlug: e.primaryTagSlug,
            onPrimaryTagChange: e.onPrimaryTagChange
        });

    function Q(e) {
        let a, n, i, c, p, A, h, m, y, T, _, O, B, U, j, Q, J, Z, $, X, ee, et, er, ea, en, ei, es, eo, el, ec, eu, ed, ep, eA, eh, em, ef, eg, ey, eT, eE, eb, eI, eC, eS, e_, eN, ex, ek, eD, ev, ew, eO = (0, r.c)(111),
            {
                primaryTagSlug: eR,
                onPrimaryTagChange: eM
            } = e,
            eL = (0, v.useRouter)(),
            {
                asPath: eB
            } = eL,
            eP = (0, I.useQueryClient)(),
            eF = (0, l.useTranslations)(),
            eU = (0, w.useLocale)(),
            eG = (ev = (0, r.c)(25), ew = (0, l.useTranslations)(), ev[0] !== ew ? (eg = ew("navbar.activity"), ev[0] = ew, ev[1] = eg) : eg = ev[1], ev[2] === Symbol.for("react.memo_cache_sentinel") ? (ey = (0, t.jsx)(N, {}), ev[2] = ey) : ey = ev[2], ev[3] !== eg ? (eT = {
                label: eg,
                href: F.Location.Activity,
                icon: ey
            }, ev[3] = eg, ev[4] = eT) : eT = ev[4], ev[5] !== ew ? (eE = ew("navbar.leaderboard"), ev[5] = ew, ev[6] = eE) : eE = ev[6], ev[7] === Symbol.for("react.memo_cache_sentinel") ? (eb = (0, t.jsx)(D.IconTrophyOutline18, {}), ev[7] = eb) : eb = ev[7], ev[8] !== eE ? (eI = {
                label: eE,
                href: F.Location.Leaderboard,
                icon: eb
            }, ev[8] = eE, ev[9] = eI) : eI = ev[9], ev[10] !== ew ? (eC = ew("navbar.dashboards"), ev[10] = ew, ev[11] = eC) : eC = ev[11], ev[12] === Symbol.for("react.memo_cache_sentinel") ? (eS = (0, t.jsx)(k.IconSquareChartOutline18, {}), ev[12] = eS) : eS = ev[12], ev[13] !== eC ? (e_ = {
                label: eC,
                href: F.Location.DashboardsMacro,
                icon: eS
            }, ev[13] = eC, ev[14] = e_) : e_ = ev[14], ev[15] !== ew ? (eN = ew("navbar.rewards"), ev[15] = ew, ev[16] = eN) : eN = ev[16], ev[17] === Symbol.for("react.memo_cache_sentinel") ? (ex = (0, t.jsx)(x.IconGiftOutline18, {}), ev[17] = ex) : ex = ev[17], ev[18] !== eN ? (ek = {
                label: eN,
                href: F.Location.Rewards,
                icon: ex
            }, ev[18] = eN, ev[19] = ek) : ek = ev[19], ev[20] !== ek || ev[21] !== eT || ev[22] !== eI || ev[23] !== e_ ? (eD = [eT, eI, e_, ek], ev[20] = ek, ev[21] = eT, ev[22] = eI, ev[23] = e_, ev[24] = eD) : eD = ev[24], eD),
            eH = (0, d.useAmplitudeAnalytics)();
        eO[0] === Symbol.for("react.memo_cache_sentinel") ? (a = ["authenticated"], eO[0] = a) : a = eO[0];
        let {
            authenticated: ej
        } = (0, u.useAccountContext)(a);
        eO[1] !== eU ? (n = (0, L.topNavTagsQueryOptions)(eU), eO[1] = eU, eO[2] = n) : n = eO[2];
        let {
            data: eQ
        } = (0, b.useQuery)(n);
        eO[3] !== eP ? (i = e => {
            let t = {
                    categorySlug: ["trending", "new"].includes(e) ? "all" : e,
                    sortSpec: "volume_24hr",
                    eventStatus: "active",
                    recurrence: void 0,
                    limitPerType: M.DEFAULT_TAB_MARKET_COUNT.toString(),
                    searchQuery: void 0
                },
                r = (0, R.createEventsQueryKey)(t, !1);
            eP.prefetchInfiniteQuery({
                queryKey: r,
                queryFn: e => {
                    let {
                        pageParam: r
                    } = e;
                    return (0, R.getEventsWithQuery)(t, r ? ? void 0, !1)
                },
                initialPageParam: null,
                staleTime: 6e4
            })
        }, eO[3] = eP, eO[4] = i) : i = eO[4];
        let eK = i,
            [eY, eW] = (0, s.useState)(null),
            [eq, eV] = (0, s.useState)(!1),
            ez = (0, s.useRef)(null),
            eJ = (0, s.useRef)(null),
            eZ = (0, s.useRef)(null);
        eO[5] === Symbol.for("react.memo_cache_sentinel") ? (c = () => {
            eJ.current && (clearTimeout(eJ.current), eJ.current = null), eV(!0)
        }, eO[5] = c) : c = eO[5];
        let e$ = c;
        eO[6] === Symbol.for("react.memo_cache_sentinel") ? (p = () => {
            eJ.current && clearTimeout(eJ.current), eJ.current = setTimeout(() => {
                eV(!1)
            }, 100)
        }, eO[6] = p) : p = eO[6];
        let eX = p;
        if (eO[7] === Symbol.for("react.memo_cache_sentinel") ? (A = () => () => {
                eJ.current && clearTimeout(eJ.current)
            }, h = [], eO[7] = A, eO[8] = h) : (A = eO[7], h = eO[8]), (0, s.useEffect)(A, h), eO[9] !== eF || eO[10] !== eQ) {
            e: {
                let e = (eQ ? ? []).filter(z);
                if (!e.length) {
                    let e;
                    eO[12] === Symbol.for("react.memo_cache_sentinel") ? (e = [], eO[12] = e) : e = eO[12], m = e;
                    break e
                }
                if (!e.some(V)) {
                    let t = e.findIndex(q),
                        r = {
                            id: "esports-nav",
                            slug: "esports",
                            label: eF("navbar.esports")
                        };
                    if (-1 !== t) e.splice(t + 1, 0, r);
                    else {
                        let t = e.findIndex(W);
                        e.splice(-1 !== t ? t + 1 : e.length, 0, r)
                    }
                }
                m = e
            }
            eO[9] = eF,
            eO[10] = eQ,
            eO[11] = m
        }
        else m = eO[11];
        let e0 = m;
        eO[13] !== e0 ? (y = ["trending", "breaking", "new", ...e0.map(Y)], eO[13] = e0, eO[14] = y) : y = eO[14];
        let e1 = y;
        eO[15] !== eB || eO[16] !== eR || eO[17] !== e1 ? (T = () => {
            eW(((e, t, r = []) => {
                if (e.startsWith("/earnings")) return "earnings";
                if (e.startsWith("/breaking")) return "breaking";
                if (e.startsWith("/finance")) return "finance";
                if (e.startsWith("/perps")) return "perps";
                if (e.startsWith("/crypto")) return "crypto";
                if (e.startsWith("/esports")) return "esports";
                if (e.startsWith("/sports")) return "sports";
                if (e.startsWith("/weather")) return "weather";
                if (e.startsWith("/mentions")) return "mention-markets";
                if (e.startsWith("/elections")) return "elections";
                if (e.startsWith("/predictions/oscars/")) return "oscars";
                let a = e.split("?")[0].split("#")[0].split("/").filter(Boolean);
                if (1 === a.length) {
                    let e = a[0];
                    if (r.includes(e) || G.includes(e)) return e
                }
                return [...G, ...Object.keys(H), ...r].includes(t) ? t : null
            })(eB, eR, e1))
        }, _ = [eB, eR, e1], eO[15] = eB, eO[16] = eR, eO[17] = e1, eO[18] = T, eO[19] = _) : (T = eO[18], _ = eO[19]), (0, s.useEffect)(T, _), eO[20] !== e1 ? (O = e => {
            eW(e), window.requestAnimationFrame(() => {
                let t = [...e1].indexOf(e);
                if (eZ.current) {
                    let e = eZ.current.getElementsByTagName("a")[t];
                    if (e) {
                        let t = window.innerWidth,
                            r = e.getBoundingClientRect();
                        (r.right > t - 80 || r.left < 80) && e.scrollIntoView({
                            behavior: "smooth",
                            block: "center",
                            inline: "center"
                        })
                    }
                }
            })
        }, eO[20] = e1, eO[21] = O) : O = eO[21];
        let e2 = O;
        eO[22] !== eH || eO[23] !== ej || eO[24] !== e2 || eO[25] !== eM || eO[26] !== eL ? (B = (e, t) => {
            if (1 === e.button || e.ctrlKey || e.metaKey) return;
            e.preventDefault(), ej && eH.trackEvent(o.Events.PrimaryTagNavbarClick, {
                tag: t
            }), eM ? .(t), e2(t);
            let r = "trending" === t ? "/" : `/${t}`;
            eL.push(r, void 0, {
                shallow: !0
            })
        }, eO[22] = eH, eO[23] = ej, eO[24] = e2, eO[25] = eM, eO[26] = eL, eO[27] = B) : B = eO[27];
        let e5 = B,
            e6 = "trending" === eY;
        eO[28] !== e5 ? (U = e => {
            e5(e, "trending")
        }, eO[28] = e5, eO[29] = U) : U = eO[29], eO[30] !== eK ? (j = () => {
            eK("trending")
        }, eO[30] = eK, eO[31] = j) : j = eO[31], eO[32] === Symbol.for("react.memo_cache_sentinel") ? (Q = (0, t.jsx)(S.IconArrowTrendUpOutline18, {
            size: 18
        }), eO[32] = Q) : Q = eO[32], eO[33] !== eF ? (J = eF("navbar.trending"), eO[33] = eF, eO[34] = J) : J = eO[34], eO[35] !== J ? (Z = (0, t.jsx)("span", {
            children: J
        }), eO[35] = J, eO[36] = Z) : Z = eO[36], eO[37] !== e6 || eO[38] !== U || eO[39] !== j || eO[40] !== Z ? ($ = (0, t.jsxs)(g.SecondaryTabLink, {
            href: "/",
            active: e6,
            onClick: U,
            onMouseEnter: j,
            children: [Q, Z]
        }), eO[37] = e6, eO[38] = U, eO[39] = j, eO[40] = Z, eO[41] = $) : $ = eO[41], eO[42] !== eB || eO[43] !== eY ? (X = "breaking" === eY || eB.startsWith("/breaking"), eO[42] = eB, eO[43] = eY, eO[44] = X) : X = eO[44], eO[45] !== eH || eO[46] !== ej || eO[47] !== e2 || eO[48] !== eL ? (ee = e => {
            0 !== e.button || e.ctrlKey || e.metaKey || (e.preventDefault(), ej && eH.trackEvent(o.Events.PrimaryTagNavbarClick, {
                tag: "breaking"
            }), e2("breaking"), eL.push("/breaking", void 0, {
                shallow: !0
            }))
        }, eO[45] = eH, eO[46] = ej, eO[47] = e2, eO[48] = eL, eO[49] = ee) : ee = eO[49], eO[50] !== eF ? (et = eF("navbar.breaking"), eO[50] = eF, eO[51] = et) : et = eO[51], eO[52] !== X || eO[53] !== ee || eO[54] !== et ? (er = (0, t.jsx)(g.SecondaryTabLink, {
            href: "/breaking",
            prefetch: !1,
            active: X,
            onClick: ee,
            children: et
        }), eO[52] = X, eO[53] = ee, eO[54] = et, eO[55] = er) : er = eO[55];
        let e3 = "new" === eY;
        if (eO[56] !== e5 ? (ea = e => {
                e5(e, "new")
            }, eO[56] = e5, eO[57] = ea) : ea = eO[57], eO[58] !== eK ? (en = () => {
                eK("new")
            }, eO[58] = eK, eO[59] = en) : en = eO[59], eO[60] !== eF ? (ei = eF("navbar.new"), eO[60] = eF, eO[61] = ei) : ei = eO[61], eO[62] !== e3 || eO[63] !== ea || eO[64] !== en || eO[65] !== ei ? (es = (0, t.jsx)(g.SecondaryTabLink, {
                href: "/new",
                active: e3,
                onClick: ea,
                onMouseEnter: en,
                children: ei
            }), eO[62] = e3, eO[63] = ea, eO[64] = en, eO[65] = ei, eO[66] = es) : es = eO[66], eO[67] === Symbol.for("react.memo_cache_sentinel") ? (eo = (0, t.jsx)("div", {
                className: "hidden lg:flex h-3.5 w-0.5 rounded-full bg-neutral-100 mx-2 shrink-0"
            }), eO[67] = eo) : eo = eO[67], eO[68] !== eH || eO[69] !== ej || eO[70] !== e2 || eO[71] !== e5 || eO[72] !== e0 || eO[73] !== eK || eO[74] !== eL || eO[75] !== eY) {
            let e;
            eO[77] !== eH || eO[78] !== ej || eO[79] !== e2 || eO[80] !== e5 || eO[81] !== eK || eO[82] !== eL || eO[83] !== eY ? (e = e => {
                let r = H[e.slug],
                    a = r ? ? `/${e.slug}`;
                return (0, t.jsx)(g.SecondaryTabLink, {
                    href: a,
                    prefetch: !r && void 0,
                    active: eY === e.slug,
                    className: "px-2.5",
                    onClick: t => {
                        if (r) {
                            0 !== t.button || t.ctrlKey || t.metaKey || (t.preventDefault(), ej && eH.trackEvent(o.Events.PrimaryTagNavbarClick, {
                                tag: e.slug
                            }), e2(e.slug), eL.push(r, void 0, {
                                shallow: !0
                            }));
                            return
                        }
                        e5(t, e.slug)
                    },
                    onMouseEnter: r ? void 0 : () => {
                        eK(e.slug)
                    },
                    children: e.label
                }, e.slug)
            }, eO[77] = eH, eO[78] = ej, eO[79] = e2, eO[80] = e5, eO[81] = eK, eO[82] = eL, eO[83] = eY, eO[84] = e) : e = eO[84], el = e0.map(e), eO[68] = eH, eO[69] = ej, eO[70] = e2, eO[71] = e5, eO[72] = e0, eO[73] = eK, eO[74] = eL, eO[75] = eY, eO[76] = el
        } else el = eO[76];
        eO[85] !== eF ? (ec = eF("navbar.more"), eO[85] = eF, eO[86] = ec) : ec = eO[86];
        let e4 = eq && "rotate-180";
        if (eO[87] !== e4 ? (eu = (0, P.cn)("transition-transform duration-200", e4), eO[87] = e4, eO[88] = eu) : eu = eO[88], eO[89] !== eu ? (ed = (0, t.jsx)(C.IconChevronDownOutline12, {
                className: eu
            }), eO[89] = eu, eO[90] = ed) : ed = eO[90], eO[91] !== ec || eO[92] !== ed ? (ep = (0, t.jsxs)(f.DropdownMenuTrigger, {
                ref: ez,
                "aria-label": "Open more navigation links",
                onMouseEnter: e$,
                onMouseLeave: eX,
                onPointerDown: K,
                className: "group hover:text-text-tertiary my-auto hidden lg:flex gap-1.5 font-medium rounded-md text-body-base text-text-secondary cursor-pointer py-1 px-3 h-10 items-center outline-none transition-colors duration-150",
                children: [ec, ed]
            }), eO[91] = ec, eO[92] = ed, eO[93] = ep) : ep = eO[93], eO[94] !== eG || eO[95] !== eL) {
            let e;
            eO[97] !== eL ? (e = e => (0, t.jsxs)(f.DropdownMenuItem, {
                onSelect: () => eL.push(e.href),
                className: "py-2.5",
                children: [e.icon, e.label]
            }, e.href), eO[97] = eL, eO[98] = e) : e = eO[98], eA = eG.map(e), eO[94] = eG, eO[95] = eL, eO[96] = eA
        } else eA = eO[96];
        return eO[99] !== eA ? (eh = (0, t.jsx)(f.DropdownMenuContent, {
            sideOffset: 0,
            align: "start",
            className: "w-44",
            onMouseEnter: e$,
            onMouseLeave: eX,
            children: eA
        }), eO[99] = eA, eO[100] = eh) : eh = eO[100], eO[101] !== eq || eO[102] !== ep || eO[103] !== eh ? (em = (0, t.jsxs)(f.DropdownMenu, {
            open: eq,
            modal: !1,
            children: [ep, eh]
        }), eO[101] = eq, eO[102] = ep, eO[103] = eh, eO[104] = em) : em = eO[104], eO[105] !== $ || eO[106] !== er || eO[107] !== es || eO[108] !== el || eO[109] !== em ? (ef = (0, t.jsxs)(E, {
            containerRef: eZ,
            children: [$, er, es, eo, el, em]
        }), eO[105] = $, eO[106] = er, eO[107] = es, eO[108] = el, eO[109] = em, eO[110] = ef) : ef = eO[110], ef
    }

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

    function Y(e) {
        return e.slug
    }

    function W(e) {
        return "sports" === e.slug
    }

    function q(e) {
        return "crypto" === e.slug
    }

    function V(e) {
        return "esports" === e.slug
    }

    function z(e) {
        return !U.includes(e.slug)
    }

    function J() {
        let e, a, n, i = (0, r.c)(7),
            o = (0, v.useRouter)(),
            {
                primaryTagSlug: l,
                onPrimaryTagChange: c
            } = (0, B.useDiscoveryFeedStore)(j, O.shallow);
        return i[0] !== c || i[1] !== o.query.t ? (e = () => {
            o.query.t && "string" == typeof o.query.t && c(o.query.t)
        }, a = [c, o.query.t], i[0] = c, i[1] = o.query.t, i[2] = e, i[3] = a) : (e = i[2], a = i[3]), (0, s.useEffect)(e, a), i[4] !== c || i[5] !== l ? (n = (0, t.jsx)(Q, {
            primaryTagSlug: l,
            onPrimaryTagChange: c
        }), i[4] = c, i[5] = l, i[6] = n) : n = i[6], n
    }

    function Z() {
        let e, a = (0, r.c)(2),
            n = (0, v.useRouter)(),
            i = "string" == typeof n.query.t ? n.query.t : "";
        return a[0] !== i ? (e = (0, t.jsx)(Q, {
            primaryTagSlug: i
        }), a[0] = i, a[1] = e) : e = a[1], e
    }
    let $ = function(e) {
        let a, n = (0, r.c)(2),
            {
                isDiscoveryPage: i
            } = e,
            s = void 0 !== i && i;
        return n[0] !== s ? (a = s ? (0, t.jsx)(J, {}) : (0, t.jsx)(Z, {}), n[0] = s, n[1] = a) : a = n[1], a
    };

    function X() {
        return !1
    }

    function ee() {
        return !0
    }

    function et() {
        return er
    }

    function er() {}
    e.s(["Navbar", 0, function(e) {
        let f, g, y, T, E, b, I, C, S, _, N, x, k = (0, r.c)(29),
            {
                isDiscoveryPage: D
            } = e,
            v = void 0 !== D && D,
            w = (0, l.useTranslations)(),
            [O, R] = (0, s.useState)(!1);
        k[0] === Symbol.for("react.memo_cache_sentinel") ? (f = ["authenticated", "isSessionLoading"], k[0] = f) : f = k[0];
        let {
            authenticated: M,
            isSessionLoading: L
        } = (0, u.useAccountContext)(f), B = (0, d.useAmplitudeAnalytics)();
        k[1] !== B ? (g = () => {
            B.trackEvent(o.Events.HowItWorksNavbarClicked), R(!0)
        }, k[1] = B, k[2] = g) : g = k[2];
        let P = g,
            F = (0, s.useSyncExternalStore)(et, ee, X);
        k[3] !== F ? (y = F ? (0, c.getSessionHint)() : void 0, k[3] = F, k[4] = y) : y = k[4];
        let U = y,
            G = F && !M && L && !!U,
            H = F && !M && !G;
        return k[5] !== v ? (T = (0, t.jsx)(p.DesktopNavigationMenuLeft, {
            isDiscoveryPage: v
        }), k[5] = v, k[6] = T) : T = k[6], k[7] === Symbol.for("react.memo_cache_sentinel") ? (E = (0, t.jsx)(m.default, {}), k[7] = E) : E = k[7], k[8] !== P || k[9] !== H || k[10] !== w ? (b = H && (0, t.jsxs)(a.Button, {
            variant: "link",
            className: "ml-2 gap-2",
            onClick: P,
            children: [(0, t.jsx)(n.IconCircleInfoFill18, {
                size: 14
            }), (0, t.jsx)("span", {
                className: "whitespace-nowrap",
                children: w("howItWorks.text")
            })]
        }), k[8] = P, k[9] = H, k[10] = w, k[11] = b) : b = k[11], k[12] !== b ? (I = (0, t.jsxs)("div", {
            className: "items-center gap-2 w-full hidden lg:flex",
            children: [E, b]
        }), k[12] = b, k[13] = I) : I = k[13], k[14] !== G || k[15] !== H ? (C = (0, t.jsx)("div", {
            className: "shrink min-w-0 md:shrink-0 md:min-w-fit",
            children: (0, t.jsx)(A.DesktopNavigationMenuRight, {
                showUnauthenticatedUI: H,
                isReconnecting: G
            })
        }), k[14] = G, k[15] = H, k[16] = C) : C = k[16], k[17] !== v ? (S = (0, t.jsx)($, {
            isDiscoveryPage: v
        }), k[17] = v, k[18] = S) : S = k[18], k[19] !== S || k[20] !== T || k[21] !== I || k[22] !== C ? (_ = (0, t.jsx)(i.TopNavbar, {
            className: "web-shell-navbar",
            left: T,
            center: I,
            right: C,
            secondary: S
        }), k[19] = S, k[20] = T, k[21] = I, k[22] = C, k[23] = _) : _ = k[23], k[24] !== O ? (N = (0, t.jsx)(h.default, {
            open: O,
            onOpenChange: R,
            completionEvent: o.Events.HowItWorksNavbarCompleted
        }), k[24] = O, k[25] = N) : N = k[25], k[26] !== _ || k[27] !== N ? (x = (0, t.jsxs)(t.Fragment, {
            children: [_, N]
        }), k[26] = _, k[27] = N, k[28] = x) : x = k[28], x
    }], 227461)
}, 677173, 621320, e => {
    "use strict";
    let t = "pm_shell";

    function r(e) {
        return !!e ? .includes("PolymarketApp")
    }

    function a(e, t = {}) {
        let r;
        return function({
            host: e,
            url: t
        } = {}) {
            let r = e || t ? function({
                host: e,
                url: t
            }) {
                if (e) return (e ? ? "").split(":")[0] ? .toLowerCase() ? ? "";
                if (t) try {
                    return new URL(t, "https://polymarket.com").hostname.toLowerCase()
                } catch {}
                return ""
            }({
                host: e,
                url: t
            }) : window.location.hostname.toLowerCase();
            return ["localhost", "127.0.0.1", "0.0.0.0", "10.0.2.2", "::1"].includes(r) || r.endsWith(".polymarket.dev") || r.endsWith(".vercel.app")
        }(t) && ("1" === (r = Array.isArray(e) ? e[0] : e) || "true" === r)
    }
    e.s(["NATIVE_SHELL_QUERY", 0, t, "isNativeShellQueryEnabled", 0, a, "isNativeShellUserAgent", 0, r], 621320);
    let n = null;

    function i() {
        return null !== n ? n : n = !!window.Capacitor ? .isNativePlatform ? .() || r(navigator.userAgent) || a(new URLSearchParams(window.location.search).get(t)) || "1" === document.documentElement.dataset.nativeShell
    }
    let s = null;

    function o(e) {
        if (!i()) return !1;
        try {
            let t = window.PolymarketShell;
            if (t ? .postMessage) return Reflect.apply(t.postMessage, t, [JSON.stringify(e)]), !0;
            let r = window.webkit ? .messageHandlers ? .PolymarketShell;
            if (r ? .postMessage) return Reflect.apply(r.postMessage, r, [e]), !0
        } catch {}
        return !1
    }
    async function l(e = "medium") {
        if (i() && !o({
                type: "haptic",
                style: e
            })) try {
            let t = window.Capacitor ? .Plugins ? .Haptics;
            if (!t) return;
            await t.impact({
                style: {
                    light: "LIGHT",
                    medium: "MEDIUM",
                    heavy: "HEAVY"
                }[e]
            })
        } catch {}
    }
    let c = null,
        u = null;
    e.s(["installNativeShellInsetsReceiver", 0, function() {
        let e = window.__polymarket_setShellInsets;
        return window.__polymarket_setShellInsets = e => {
            ! function(e) {
                if ("u" < typeof document) return;
                let t = document.documentElement,
                    r = (e, r) => {
                        "number" == typeof r && Number.isFinite(r) && t.style.setProperty(e, `${Math.max(0,r)}px`)
                    };
                r("--pm-native-header-height", e.headerHeight), r("--pm-native-tabbar-height", e.tabBarHeight), r("--pm-safe-area-top", e.safeAreaTop), r("--pm-safe-area-bottom", e.safeAreaBottom)
            }(e)
        }, () => {
            e ? window.__polymarket_setShellInsets = e : delete window.__polymarket_setShellInsets
        }
    }, "isNativeShell", 0, i, "notifyNativeShellRouteChanged", 0, function({
        route: e,
        title: t,
        subtitle: r,
        activeCategory: a,
        variant: n,
        backEnabled: i
    }) {
        o({
            type: "routeChanged",
            route: e,
            title: t,
            subtitle: r,
            activeCategory: a,
            variant: n,
            backEnabled: i
        })
    }, "onNativePrefetchRoutes", 0, function(e) {
        return u = e, window.__polymarket_prefetchRoutes = e => {
            Array.isArray(e) && u ? .(e.filter(e => "string" == typeof e))
        }, () => {
            u = null, delete window.__polymarket_prefetchRoutes
        }
    }, "onNativeTabChange", 0, function(e) {
        return c = e, window.__polymarket_tabChange = (e, t) => {
            c ? .(e, t)
        }, () => {
            c = null, delete window.__polymarket_tabChange
        }
    }, "onNativeTopAction", 0, function(e) {
        return s = e, window.__polymarket_nativeTopAction = async () => {
            try {
                return !!await s ? .()
            } catch {
                return !1
            }
        }, () => {
            s === e && (s = null, delete window.__polymarket_nativeTopAction)
        }
    }, "setNativeShellBackEnabled", 0, function(e) {
        o({
            type: "backState",
            backEnabled: e
        })
    }, "setNativeShellPortfolioValueState", 0, function({
        value: e,
        authenticated: t,
        loading: r,
        hidden: a
    }) {
        o({
            type: "portfolioValueState",
            value: e,
            authenticated: t,
            loading: r,
            hidden: a
        })
    }, "setNativeShellTopActionState", 0, function({
        kind: e,
        label: t,
        enabled: r,
        loading: a
    }) {
        o({
            type: "topActionState",
            kind: e,
            label: t,
            enabled: r,
            loading: a
        })
    }, "triggerHaptic", 0, l, "warmNativeShellRoutes", 0, function(e) {
        if (!i() || 0 === e.length) return !1;
        try {
            let t = window.PolymarketShell;
            if (t ? .warmRoutes) return Reflect.apply(t.warmRoutes, t, [JSON.stringify(e)]), !0
        } catch {}
        return !1
    }], 677173)
}, 355015, e => {
    "use strict";
    var t = e.i(221628),
        r = e.i(766181);
    e.i(893299);
    var a = e.i(215959),
        n = e.i(336896),
        i = e.i(416340),
        s = e.i(863828),
        o = e.i(448030),
        l = e.i(169008),
        c = e.i(630102),
        u = e.i(187835);
    e.i(403591);
    var d = e.i(593332),
        p = e.i(165799),
        A = e.i(775691),
        h = e.i(227461);
    e.i(510954), e.i(57096);
    var m = e.i(938),
        f = e.i(668122),
        g = e.i(28589),
        y = e.i(79075),
        T = e.i(827681),
        E = e.i(870555),
        b = e.i(784521),
        I = e.i(305457),
        C = e.i(523410);
    e.i(399841);
    var S = e.i(767074),
        _ = e.i(684686),
        N = e.i(385773),
        x = e.i(799471),
        k = e.i(618931),
        D = e.i(677173),
        v = e.i(621320);
    let w = (0, r.cva)(["lg:flex lg:relative lg:w-full lg:px-6 lg:gap-2 lg:mx-auto lg:flex-1 lg:max-w-fit lg:h-full lg:box-border"], {
            variants: {
                fullscreen: {
                    true: "lg:px-0 lg:max-w-[100vw] lg:w-full lg:mx-0 lg:min-w-0"
                },
                isCyom: {
                    true: "lg:max-w-[unset]"
                },
                isSportsPage: {
                    true: "lg:max-w-[1350px]"
                }
            }
        }),
        O = (0, r.cva)(["not-lg:flex-1 not-lg:w-full not-lg:flex not-lg:flex-col not-lg:bg-(--color-background) not-lg:z-2", "lg:w-full lg:h-full"], {
            variants: {
                isRewardsPage: {
                    true: "lg:flex-1 lg:w-full lg:max-w-full"
                },
                isSportsPage: {
                    true: "lg:w-full lg:h-full lg:flex lg:flex-col lg:min-w-0"
                }
            }
        }),
        R = ["politics", "sports", "esports", "elections_map", "weather", "crypto", "finance", "geopolitics", "tech", "culture", "world", "economy"];
    e.s(["default", 0, ({
        page: e = "default",
        footerData: r,
        footerBeforeContent: M,
        children: L
    }) => {
        let B = (0, N.useVisualStateStore)(e => e.buySellWidgetPortalNode),
            P = (0, N.useVisualStateStore)(e => e.smpDrawerControlsPortalNode),
            {
                query: F,
                pathname: U
            } = (0, n.useRouter)(),
            {
                sportSlug: G,
                secondarySlug: H
            } = (0, u.getRoutingParams)({
                query: F,
                pathname: U
            }),
            [j, Q] = i.default.useState(!1);
        i.default.useEffect(() => {
            Q((0, v.isNativeShellQueryEnabled)(F.pm_shell) || (0, D.isNativeShell)())
        }, [F.pm_shell]);
        let {
            isSportsPage: K,
            isEsportsPage: Y,
            showFooter: W,
            hideBottomNav: q,
            hideTopNav: V,
            showBuySellWidget: z
        } = i.default.useMemo(() => {
            let t = m.PAGE_LAYOUT_CONFIG[e] || m.PAGE_LAYOUT_CONFIG.default;
            return {
                isSportsPage: "sports" === e || "esports" === e,
                isEsportsPage: "esports" === e,
                showFooter: !j && t.showFooter,
                hideBottomNav: j || !!t.hideBottomNav,
                hideTopNav: j || !!t.hideTopNav,
                showBuySellWidget: ("sports" === e || "esports" === e) && (H === d.SecondarySlug.GAMES || G === d.SportSlug.LIVE) || "event" === e
            }
        }, [e, H, G, j]), J = "suggestions" === e, Z = i.default.useMemo(() => r ? .variant ? r.variant : "event" === e ? "market" : R.includes(e) ? "category" : "homepage", [e, r ? .variant]), $ = (0, n.useRouter)(), X = (0, I.useAmplitudeAnalytics)(), {
            setConnectorRoute: ee,
            setOpen: et,
            isLoggedIn: er
        } = (0, s.useSiwx)(), {
            onBeginCheckout: ea
        } = (0, S.useFunkitContext)(), {
            authenticated: en,
            proxyAddress: ei,
            closedDynamic: es
        } = (0, b.useAccountContext)(["authenticated", "proxyAddress", "closedDynamic"]), eo = (0, _.useGeoStore)(e => e.permissions), el = i.default.useMemo(() => (0, x.modifyPermissionsToMatchCloseOnlyBlockAndAllowLists)(ei, eo, es), [ei, eo, es]);
        (0, i.useEffect)(() => {
            let e;
            if (!$.isReady) return;
            let {
                modal: t,
                mobile_auth: r,
                dub_id: a,
                mt: n,
                r: i,
                ...s
            } = $.query, o = Array.isArray(t) ? t[t.length - 1] : t, l = Array.isArray(r) ? r[r.length - 1] : r, c = Array.isArray(n) ? n[n.length - 1] : n;
            if (a) return;
            if ("true" === l) {
                let t = Date.now();
                (0, y.markSignupPromptOpened)("modal_query", {
                    now: t,
                    route: "login"
                }), X.trackEvent(f.Events.SignupPromptOpened, (0, y.getSignupPromptOpenedEventProperties)({
                    source: "modal_query",
                    route: "login"
                })), (0, k.setMobileAuthMode)(!0), ee(T.ConnectorRoute.LOGIN), e = () => {
                    et(!0), $.replace({
                        pathname: $.pathname,
                        query: s
                    }, void 0, {
                        shallow: !0
                    })
                }
            } else if ("login" === o || "signup" === o) {
                if ("string" != typeof o) return;
                if (er && en) return void $.replace({
                    pathname: $.pathname,
                    query: s
                }, void 0, {
                    shallow: !0
                });
                let t = Date.now();
                (0, y.markSignupPromptOpened)("modal_query", {
                    now: t,
                    route: "login" === o ? "login" : "signup"
                }), X.trackEvent(f.Events.SignupPromptOpened, (0, y.getSignupPromptOpenedEventProperties)({
                    source: "modal_query",
                    route: "login" === o ? "login" : "signup"
                })), ee("login" === o ? T.ConnectorRoute.LOGIN : T.ConnectorRoute.SIGNUP), e = () => {
                    et(!0), $.replace({
                        pathname: $.pathname,
                        query: s
                    }, void 0, {
                        shallow: !0
                    })
                }
            } else {
                if ("deposit" !== o) return;
                e = () => {
                    if (en && er) el.canDeposit && ea();
                    else {
                        let e = Date.now();
                        (0, y.markSignupPromptOpened)("deposit", {
                            now: e,
                            route: "signup"
                        }), X.trackEvent(f.Events.SignupPromptOpened, (0, y.getSignupPromptOpenedEventProperties)({
                            source: "deposit",
                            route: "signup"
                        })), ee(T.ConnectorRoute.SIGNUP), et(!0)
                    }
                    Object.keys(s).length ? $.replace({
                        pathname: $.pathname,
                        query: s
                    }, void 0, {
                        shallow: !0
                    }).catch(() => {}) : window.history.replaceState(null, "", $.pathname)
                }
            }
            let u = setTimeout(e, 1e3 * (c ? parseInt(c, 10) : 12));
            return () => {
                clearTimeout(u)
            }
        }, [X, $.isReady, $.query.modal, $.query.mobile_auth, $.query.dub_id, $.query.mt, er, en, el.canDeposit, ea, ee, et, $.pathname]);
        let ec = "rewards" === e || "discovery" === e || "dashboards" === e || "rfq" === e || "search" === e || "breaking" === e || "leaderboard" === e || "elections" === e || "refer" === e || "elections_map" === e || "fourohfour" === e || "weather" === e || "markets-for-more" === e || "perps" === e,
            eu = "discovery" === e || "rewards" === e || "sports" === e || "esports" === e || "dashboards" === e || "rfq" === e || "search" === e || "suggestions" === e || "breaking" === e || "leaderboard" === e || "elections" === e || "elections_map" === e || "weather" === e || "markets-for-more" === e || "perps" === e,
            ed = (0, t.jsxs)(t.Fragment, {
                children: [(0, t.jsx)("main", {
                    id: "__pm_main",
                    tabIndex: -1,
                    className: (0, E.cn)("size-full z-2 scroll-mt-(--navbar-height)", O({
                        isRewardsPage: "rewards" === e,
                        isSportsPage: K
                    }), {
                        "lg:flex-1 lg:w-full lg:max-w-full min-h-[calc(100dvh-var(--navbar-height))]": eu
                    }, V && "pt-0", "not-lg:[box-sizing:padding-box]"),
                    children: L
                }), z && (0, t.jsx)("div", {
                    className: "flex flex-col w-[372px] sticky top-0 not-lg:hidden",
                    children: (0, t.jsx)(g.OutPortal, {
                        node: B
                    })
                })]
            }),
            ep = (0, t.jsxs)(C.BottomDrawerContextProvider, {
                children: [(0, t.jsxs)("div", {
                    "data-vaul-drawer-wrapper": "",
                    className: "bg-(--color-background)",
                    children: [(0, t.jsx)("a", {
                        href: "#__pm_main",
                        className: "sr-only focus:not-sr-only focus:fixed focus:top-4 focus:left-4 focus:z-50 focus:rounded-lg focus:bg-brand-500 focus:px-4 focus:py-2 focus:text-white focus:text-body-sm focus:font-medium",
                        children: "Skip to main content"
                    }), !V && (0, t.jsx)(h.Navbar, {
                        isDiscoveryPage: "discovery" === e
                    }), (0, t.jsxs)(a.motion.div, {
                        id: "__pm_viewport",
                        layoutScroll: !0,
                        className: "w-full bg-(--color-background) relative z-1 lg:h-full lg:flex lg:flex-col not-lg:overflow-x-clip not-lg:h-fit",
                        children: [(0, t.jsx)("div", {
                            id: "content",
                            className: "flex flex-col relative w-full lg:h-full lg:items-center lg:justify-start lg:flex-1",
                            children: (0, t.jsx)("div", {
                                id: "column-wrapper",
                                className: (0, E.cn)(w({
                                    fullscreen: ec,
                                    isCyom: J,
                                    isSportsPage: K
                                }), !W && !j && "not-lg:pb-[60px]"),
                                children: Y ? (0, t.jsx)(l.default, {
                                    children: ed
                                }) : K && !j ? (0, t.jsx)(c.default, {
                                    children: ed
                                }) : ed
                            })
                        }), W && (0, t.jsx)("div", {
                            className: "web-shell-footer",
                            children: (0, t.jsx)(p.Footer, {
                                variant: Z,
                                footerData: r,
                                beforeContent: M
                            })
                        })]
                    })]
                }), !q && (0, t.jsx)(A.default, {}), j && (0, t.jsx)("div", {
                    "aria-label": "Mobile trading drawer",
                    className: "fixed left-0 right-0 bottom-0 z-102 flex flex-col bg-background pb-safe lg:hidden",
                    children: (0, t.jsx)(g.OutPortal, {
                        node: P
                    })
                })]
            });
        return "discovery" === e ? (0, t.jsx)(o.DiscoveryFeedStoreProvider, {
            children: ep
        }) : ep
    }])
}]);

//# debugId=2cca2563-6a4d-fb59-a6d6-2919182ea197