import {
    G as M,
    av as ee,
    r as w,
    $ as J,
    B as X,
    I as i,
    aw as F,
    ax as te,
    J as e,
    ay as se,
    aq as N,
    N as n,
    ao as U,
    P as s,
    an as m,
    O as l,
    D as ne,
    az as Y,
    z as Z,
    R as G,
    A as ae,
    H as V,
    Q as C,
    au as O,
    K as L,
    M as H,
    F as ie,
    at as z,
    aA as q,
    C as oe,
    E as le,
    aB as ue,
    aC as re
} from "./common.modules-af1f85b9.js";
import {
    a as E,
    c as I,
    _ as j,
    g as de,
    b as ce,
    e as pe,
    j as ve,
    h as K,
    i as fe
} from "./page-activity-ActivityDetail-f7c58355.js";
import {
    L as me,
    E as Q
} from "./page-activity-Bonus-8e38179c.js";
const he = {
        class: "item"
    },
    _e = ["src"],
    ge = {
        class: "right"
    },
    ye = {
        key: 0
    },
    $e = {
        key: 1
    },
    ke = {
        key: 2
    },
    Te = {
        key: 3,
        class: "time"
    },
    we = ["innerHTML"],
    Ce = {
        key: 4,
        class: "time"
    },
    Le = {
        key: 5,
        class: "time"
    },
    Be = {
        class: "foot"
    },
    De = {
        class: "amount"
    },
    Se = M({
        __name: "card",
        props: {
            bgImgWidth: {
                type: String,
                required: !1,
                default: "100%"
            },
            bgImgHeight: {
                type: String,
                required: !1,
                default: "150px"
            },
            itemD: {
                type: null,
                required: !1,
                default: {}
            },
            state: {
                type: Number,
                required: !1
            },
            isRefresh: {
                type: Boolean,
                required: !1,
                default: !1
            }
        },
        emits: ["update:isRefresh"],
        setup(c, {
            emit: g
        }) {
            const v = c;

            function p() {
                if (v.state == 1) {
                    const a = f.value.replace(/-/g, "/"),
                        B = v.itemD.endTime.replace(/-/g, "/");
                    u.value = new Date(B).getTime() - new Date(a).getTime(), u.value > 0 && (k.value = ne({
                        time: u.value,
                        onChange: y
                    }), k.value.start())
                }
            }
            const {
                serviceNowTime: f
            } = E(), {
                isRefresh: t
            } = ee(v, g), u = w(0), k = w();
            J(() => v.itemD.id, a => {
                p()
            }, {
                immediate: !0
            });
            const T = X(() => k.value.current);

            function y(a) {
                a.total == 0 ? t.value = !0 : t.value = !1
            }

            function h(a) {
                const B = String(a.hours).padStart(2, "0"),
                    D = String(a.minutes).padStart(2, "0"),
                    S = String(a.seconds).padStart(2, "0");
                return B + ":" + D + ":" + S
            }
            return (a, B) => (n(), i("div", he, [F(e("img", {
                src: a.itemD.iconUrl,
                alt: "",
                style: se(`width:${a.bgImgWidth};height:${a.bgImgHeight};`)
            }, null, 12, _e), [
                [te, a.itemD.iconUrl]
            ]), e("div", ge, [N(a.$slots, "content", {}, () => {
                var D, S;
                return [e("div", {
                    class: U(["head", `type${a.state}`])
                }, [a.state == 1 ? (n(), i("h1", ye, s(a.$t("cpsTip3")), 1)) : a.state == 0 ? (n(), i("h1", $e, s(a.$t("startTime")), 1)) : a.state == 2 ? (n(), i("h1", ke, s(a.$t("ended")), 1)) : m("v-if", !0), a.state == 1 ? (n(), i("div", Te, [e("p", {
                    innerHTML: a.$t("fifteenDays", [T.value.days])
                }, null, 8, we), e("h6", null, s(h(T.value)), 1)])) : m("v-if", !0), a.state == 0 ? (n(), i("div", Ce, s((D = a.itemD) == null ? void 0 : D.startTime), 1)) : m("v-if", !0), a.state == 2 ? (n(), i("div", Le, "00:00:00")) : m("v-if", !0)], 2), e("div", Be, [e("h1", null, s(a.$t("winTips5")), 1), e("div", De, s(l(I)(((S = a.itemD) == null ? void 0 : S.sumBonus) || 0)), 1)])]
            }, !0)]), N(a.$slots, "footer", {}, void 0, !0)]))
        }
    });
const x = j(Se, [
        ["__scopeId", "data-v-277c60ca"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar031-india-in999/src/components/Activity/Championship/card.vue"]
    ]),
    be = {
        class: "dialog__container",
        role: "dialog",
        tabindex: "0"
    },
    Ie = {
        key: 0,
        class: "dialog__container-img"
    },
    Re = {
        class: "dialog__container-title"
    },
    Ae = {
        class: "dialog__container-content"
    },
    Ne = {
        key: 1,
        class: "dialog__container-footer"
    },
    Oe = ["src"],
    Ue = M({
        __name: "Dialog",
        props: {
            show: {
                type: Boolean,
                default: !1
            },
            title: {
                type: String,
                default: ""
            },
            confirmText: {
                type: String,
                default: ""
            },
            showCancelBtn: {
                type: Boolean,
                default: !0
            },
            cancelText: {
                type: String,
                default: ""
            },
            clickOutSide: {
                type: Boolean,
                default: !1
            },
            isShowHeader: {
                type: Boolean,
                default: !0
            },
            imgUrl: {
                type: String,
                default: "tip"
            },
            showCloseIcon: {
                type: Boolean,
                default: !1
            },
            showFooter: {
                type: Boolean,
                default: !0
            }
        },
        emits: ["update:show", "confirm"],
        setup(c, {
            emit: g
        }) {
            const v = c;
            J(() => v.show, t => {
                t ? window.addEventListener("touchmove", f, {
                    passive: !1
                }) : window.removeEventListener("touchmove", f)
            });

            function p(t) {
                v.clickOutSide && g("update:show", !1)
            }
            const f = t => {};
            return (t, u) => {
                const k = Y("lazy");
                return n(), i("div", {
                    class: U(["dialog", {
                        active: c.show,
                        inactive: !c.show
                    }])
                }, [e("div", be, [c.isShowHeader ? (n(), i("div", Ie, [N(t.$slots, "header", {}, () => [F(e("img", {
                    class: U({
                        succed: c.imgUrl == "succeed"
                    }),
                    alt: ""
                }, null, 2), [
                    [k, l(de)("wallet", c.imgUrl)]
                ])], !0)])) : m("v-if", !0), e("div", Re, [N(t.$slots, "title", {}, () => [e("h1", null, s(c.title), 1)], !0)]), e("div", Ae, [N(t.$slots, "content", {}, void 0, !0)]), c.showFooter ? (n(), i("div", Ne, [N(t.$slots, "footer", {}, () => [e("button", {
                    onClick: u[0] || (u[0] = () => {
                        g("confirm")
                    })
                }, s(c.confirmText || t.$t("confirm")), 1), c.showCancelBtn ? (n(), i("button", {
                    key: 0,
                    onClick: u[1] || (u[1] = () => {
                        g("update:show", !1)
                    })
                }, s(c.cancelText || t.$t("cancel")), 1)) : m("v-if", !0)], !0)])) : m("v-if", !0), c.showCloseIcon ? (n(), i("img", {
                    key: 2,
                    class: "close_img",
                    src: l(ce)("common", "close"),
                    onClick: p
                }, null, 8, Oe)) : m("v-if", !0)]), e("div", {
                    class: "dialog__outside",
                    onClick: p
                })], 2)
            }
        }
    });
const He = j(Ue, [
        ["__scopeId", "data-v-3e71d3da"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar031-india-in999/src/components/common/Dialog.vue"]
    ]),
    Me = {
        class: "championship"
    },
    je = {
        class: "tabs"
    },
    qe = ["onClick"],
    Ve = ["onClick"],
    ze = ["innerHTML"],
    Je = M({
        __name: "index",
        setup(c) {
            const {
                tabList: g,
                serviceNowTime: v,
                type: p
            } = E(), {
                t: f
            } = Z(), t = G(), u = ae({
                state: 1
            }), k = w([]), T = w(), y = w(!1), h = w(""), a = w(!1);
            J(a, r => {
                var o;
                a.value && ((o = T.value) == null || o.resetRefresh())
            });

            function B(r) {
                t.push({
                    name: "Championship-ChampionshipDetail",
                    query: {
                        championId: r
                    }
                })
            }

            function D(r) {
                var o;
                u.state = r, (o = T.value) == null || o.resetRefresh()
            }

            function S(r) {
                v.value = r.serviceNowTime
            }
            const $ = w(null),
                R = async r => {
                    $.value && clearTimeout($.value), $.value = setTimeout(async () => {
                        var _;
                        if (r.isJoin) return;
                        const o = await W(ve({
                            championId: r.id
                        }));
                        if (o)
                            if (o.code == 0) ie(f("success")), (_ = T.value) == null || _.resetRefresh();
                            else if ([803, 804, 805, 807].includes(o.msgCode) && o.data != null) switch (y.value = !0, o.msgCode) {
                            case 803:
                                h.value = f("cpsTip25", [o.data]);
                                break;
                            case 804:
                                h.value = f("cpsTip26", [o.data]);
                                break;
                            case 805:
                                h.value = f("cpsTip27", [p[o.data]]);
                                break;
                            case 807:
                                let b = f("code807", ["{0}", "{1}", "{2}"]);
                                Object.values(o.data || {}).filter(Boolean).forEach((d, A) => {
                                    b = b.replace(`{${A}}`, `<span>${d}</span>`)
                                }), h.value = b;
                                break;
                            default:
                                h.value = f(`code${o.msgCode}`)
                        } else {
                            y.value = !0;
                            let b = f(`code${o.msgCode}`, ["{0}"]);
                            Object.values(o.data || {}).filter(Boolean).forEach((d, A) => {
                                b = b.replace(`{${A}}`, `<span>${d}</span>`)
                            }), h.value = b
                        }
                    }, 100)
                },
                W = async r => await r.then(_ => _ && _.code !== 0 ? [803, 804, 805, 806, 807].includes(_.msgCode) ? _ : (K(_), null) : _).catch(_ => ([806].includes(_.msgCode) || K(_), _));
            return (r, o) => {
                const _ = V("NavBar"),
                    b = V("van-sticky");
                return n(), i("div", Me, [C(b, null, {
                    default: O(() => [C(_, {
                        title: r.$t("cpsTip1"),
                        "left-arrow": "",
                        onClickLeft: o[0] || (o[0] = () => l(t).back())
                    }, null, 8, ["title"]), e("div", je, [(n(!0), i(L, null, H(l(g), d => (n(), i("div", {
                        key: d.key,
                        class: U({
                            active: u.state == d.key
                        }),
                        onClick: A => D(d.key)
                    }, s(d.title), 11, qe))), 128))])]),
                    _: 1
                }), C(me, {
                    list: k.value,
                    "onUpdate:list": o[2] || (o[2] = d => k.value = d),
                    api: l(pe),
                    "page-query": u,
                    "onUpdate:pageQuery": o[3] || (o[3] = d => u = d),
                    distance: 100,
                    ref_key: "listRef",
                    ref: T,
                    "is-auto-load": !0,
                    onListChange: S
                }, {
                    content: O(() => [(n(!0), i(L, null, H(k.value, d => (n(), i("div", {
                        key: d.id
                    }, [C(x, {
                        itemD: d,
                        state: d.state,
                        isRefresh: a.value,
                        "onUpdate:isRefresh": o[1] || (o[1] = A => a.value = A),
                        onClick: A => B(d.id)
                    }, null, 8, ["itemD", "state", "isRefresh", "onClick"]), [1].includes(d.state) ? (n(), i("div", {
                        key: 0,
                        class: U(["btn", {
                            active: !d.isJoin
                        }]),
                        onClick: A => R(d)
                    }, s(d.isJoin ? r.$t("cpsTip8") : r.$t("cpsTip9")), 11, Ve)) : m("v-if", !0)]))), 128))]),
                    _: 1
                }, 8, ["list", "api", "page-query"]), C(He, {
                    show: y.value,
                    "onUpdate:show": o[4] || (o[4] = d => y.value = d),
                    onConfirm: o[5] || (o[5] = () => y.value = !1),
                    showCancelBtn: !1,
                    showCloseIcon: !0,
                    clickOutSide: !0
                }, {
                    content: O(() => [e("h1", {
                        class: "championship-tips",
                        innerHTML: h.value
                    }, null, 8, ze)]),
                    _: 1
                }, 8, ["show"])])
            }
        }
    });
const Ee = j(Je, [
        ["__scopeId", "data-v-5ffc4111"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar031-india-in999/src/views/activity/Championship/index.vue"]
    ]),
    Lt = Object.freeze(Object.defineProperty({
        __proto__: null,
        default: Ee
    }, Symbol.toStringTag, {
        value: "Module"
    })),
    Pe = {
        class: "title"
    },
    We = {
        class: "con"
    },
    Fe = ["innerHTML"],
    Ge = ["innerHTML"],
    Qe = {
        class: "condition"
    },
    Ke = {
        key: 0
    },
    Xe = {
        key: 1
    },
    Ye = {
        key: 2
    },
    Ze = {
        class: "ranking"
    },
    xe = {
        class: "top"
    },
    et = M({
        __name: "rule",
        props: {
            data: {
                type: null,
                required: !1
            }
        },
        setup(c) {
            const {
                t: g
            } = Z(), v = w(["0"]), {
                type: p
            } = E();

            function f(t, u) {
                return t == u ? g("cpsTip20", [t]) : g("cpsTip21", [t, u])
            }
            return (t, u) => {
                const k = V("van-collapse-item"),
                    T = V("van-collapse");
                return n(), z(T, {
                    modelValue: v.value,
                    "onUpdate:modelValue": u[0] || (u[0] = y => v.value = y),
                    class: "rule"
                }, {
                    default: O(() => [C(k, {
                        name: "1"
                    }, {
                        title: O(() => [e("div", Pe, s(t.$t("cpsTip5").toLocaleUpperCase()), 1)]),
                        default: O(() => [e("div", We, [e("h1", null, [e("span", null, s(t.$t("cpsTip11")), 1)]), e("div", {
                            innerHTML: t.$t("cpsTip12", [t.data.vendorCode, t.data.startTime, t.data.endTime])
                        }, null, 8, Fe), e("h1", null, [e("span", null, s(t.$t("awardAmount")), 1)]), e("div", null, [q(s(t.$t("cpsTip13")), 1), e("span", null, s(l(I)(t.data.sumBonus || 0)), 1)]), e("h1", null, [e("span", null, s(t.$t("cpsTip14")), 1)]), e("div", null, [e("div", {
                            innerHTML: t.$t("cpsTip15", [t.data.vendorCode])
                        }, null, 8, Ge), e("div", Qe, [t.data.conditionsBetAmount > 0 ? (n(), i("p", Ke, [q(s(t.$t("betAmounts")) + " ", 1), e("span", null, s(l(I)(t.data.conditionsBetAmount || 0)), 1)])) : m("v-if", !0), t.data.conditionsRechargeAmount > 0 ? (n(), i("p", Xe, [q(s(t.$t("rechageAmount")) + " ", 1), e("span", null, s(l(I)(t.data.conditionsRechargeAmount || 0)), 1)])) : m("v-if", !0), t.data.conditionsBindType ? (n(), i("p", Ye, [q(s(t.$t("toBind")) + " ", 1), e("span", null, s(l(p)[t.data.conditionsBindType]), 1)])) : m("v-if", !0), t.data.conditionsBetAmount == 0 && t.data.conditionsRechargeAmount == 0 && !t.data.conditionsBindType ? (n(), i(L, {
                            key: 3
                        }, [q(s(t.$t("cpsTip10")), 1)], 64)) : m("v-if", !0)])]), e("h1", null, [e("span", null, s(t.$t("binguoPaimin")), 1)]), e("div", Ze, [e("div", xe, [e("span", null, s(t.$t("binguoPaimin")), 1), e("span", null, s(t.$t("k3WarningTip4")), 1)]), (n(!0), i(L, null, H(t.data.rankingAwardsList, (y, h) => (n(), i("div", {
                            class: "info",
                            key: h
                        }, [e("span", null, s(f(y.startRanking, y.endRanking)), 1), e("span", null, s(l(I)(y.awardsAmount || 0)), 1)]))), 128)), t.data.rankingAwardsList.length == 0 ? (n(), z(Q, {
                            key: 0
                        })) : m("v-if", !0)]), e("h1", null, [e("span", null, s(t.$t("cpsTip16")), 1)]), e("div", null, [e("p", null, s(t.$t("cpsTip17")), 1), e("p", null, s(t.$t("cpsTip18")), 1)]), e("h1", null, [e("span", null, s(t.$t("cpsTip19")), 1)]), e("p", null, [e("span", null, s(t.data.vendorCode), 1)])])]),
                        _: 1
                    })]),
                    _: 1
                }, 8, ["modelValue"])
            }
        }
    });
const tt = j(et, [
        ["__scopeId", "data-v-5c0f1c84"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar031-india-in999/src/components/Activity/Championship/rule.vue"]
    ]),
    st = {
        class: "game"
    },
    nt = {
        class: "items"
    },
    at = ["onClick"],
    it = ["onClick"],
    ot = M({
        __name: "game",
        props: {
            data: {
                type: null,
                required: !1
            },
            arLotteryList: {
                type: null,
                required: !1
            }
        },
        setup(c) {
            const {
                onItemClick: g
            } = fe();
            return G(), (v, p) => {
                const f = Y("lazy");
                return n(), i("div", st, [e("h1", null, s(v.$t("cpsTip22")), 1), e("div", nt, [(n(!0), i(L, null, H(v.data, t => (n(), i("div", {
                    class: "item",
                    key: t.gameID,
                    onClick: u => l(g)(t)
                }, [F(e("img", null, null, 512), [
                    [f, t.img]
                ])], 8, at))), 128)), (n(!0), i(L, null, H(v.arLotteryList, (t, u) => (n(), i("div", {
                    class: "lottery",
                    key: u,
                    onClick: k => l(g)(t)
                }, s(t.title), 9, it))), 128)), v.data.length == 0 && v.arLotteryList.length == 0 ? (n(), z(Q, {
                    key: 0
                })) : m("v-if", !0)])])
            }
        }
    });
const lt = j(ot, [
        ["__scopeId", "data-v-303ee053"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar031-india-in999/src/components/Activity/Championship/game.vue"]
    ]),
    P = c => (ue("data-v-a9d644da"), c = c(), re(), c),
    ut = {
        class: "ChampionshipDetail"
    },
    rt = {
        class: "ranking"
    },
    dt = {
        class: "title"
    },
    ct = {
        class: "amount"
    },
    pt = P(() => e("span", null, "--", -1)),
    vt = P(() => e("span", null, "--", -1)),
    ft = P(() => e("span", null, "--", -1)),
    mt = {
        class: "rankingList"
    },
    ht = {
        class: "title"
    },
    _t = P(() => e("span", null, "TOP", -1)),
    gt = {
        key: 0,
        class: "txt"
    },
    yt = {
        class: "refresh"
    },
    $t = M({
        __name: "index",
        setup(c) {
            const {
                tabList: g,
                getChampionTaskDetailV: v,
                championTaskDetailVO: p,
                getTop10UserList: f,
                top10UserListVO: t,
                thirdGameListVO: u,
                arLotteryList: k
            } = E(), T = G(), y = X(() => {
                var $;
                return p.value ? ($ = g.find(R => R.key == p.value.state)) == null ? void 0 : $.title : ""
            }), h = w(), a = w(!1), B = w(null);

            function D() {
                v(h.value)
            }
            J(a, $ => {
                a.value && D()
            });
            const S = () => {
                f(h.value)
            };
            return oe(() => {
                h.value = Number(T.currentRoute.value.query.championId) || 0, h.value != 0 && (D(), S(), B.value = setInterval(S, 10 * 60 * 1e3))
            }), le(() => {
                clearInterval(B.value)
            }), ($, R) => {
                const W = V("NavBar");
                return n(), i("div", ut, [C(W, {
                    title: y.value,
                    "left-arrow": "",
                    onClickLeft: R[0] || (R[0] = () => l(T).back())
                }, null, 8, ["title"]), JSON.stringify(l(p)) !== "{}" ? (n(), i(L, {
                    key: 0
                }, [C(x, {
                    itemD: l(p),
                    state: l(p).state,
                    isRefresh: a.value,
                    "onUpdate:isRefresh": R[1] || (R[1] = r => a.value = r)
                }, null, 8, ["itemD", "state", "isRefresh"]), e("div", rt, [e("div", dt, [e("span", null, s($.$t("binguoPaimin")), 1), e("span", null, s($.$t("betAmounts")), 1), e("span", null, s($.$t("k3WarningTip4")), 1)]), e("div", ct, [l(p) && l(p).userJoinInfo ? (n(), i(L, {
                    key: 0
                }, [e("span", null, s(l(p).userJoinInfo.ranking), 1), e("span", null, s(l(I)(l(p).userJoinInfo.sumBetAmount || 0)), 1), e("span", null, s(l(I)(l(p).userJoinInfo.awardsAmount || 0)), 1)], 64)) : (n(), i(L, {
                    key: 1
                }, [pt, vt, ft], 64))])])], 64)) : m("v-if", !0), e("div", mt, [e("div", ht, [_t, e("span", null, s($.$t("account")), 1), e("span", null, s($.$t("betAmounts")), 1), e("span", null, s($.$t("k3WarningTip4")), 1)]), (n(!0), i(L, null, H(l(t), (r, o) => (n(), i("div", {
                    class: "info",
                    key: o
                }, [
                    [1, 2, 3].includes(r.ranking) ? (n(), i("span", {
                        key: 1,
                        class: U(`top${r.ranking}`)
                    }, null, 2)) : (n(), i("span", gt, s(r.ranking), 1)), e("span", null, s(r.userName), 1), e("span", null, s(l(I)(r.sumBetAmount || 0)), 1), e("span", null, s(l(I)(r.awardsAmount || 0)), 1)
                ]))), 128)), e("div", yt, s($.$t("cpsTip28")), 1), l(t).length == 0 ? (n(), z(Q, {
                    key: 0
                })) : m("v-if", !0)]), C(tt, {
                    data: l(p)
                }, null, 8, ["data"]), C(lt, {
                    data: l(u),
                    arLotteryList: l(k)
                }, null, 8, ["data", "arLotteryList"])])
            }
        }
    });
const kt = j($t, [
        ["__scopeId", "data-v-a9d644da"],
        ["__file", "/usr/local/jenkins-prod/workspace/ar031-india-in999/src/views/activity/Championship/ChampionshipDetail/index.vue"]
    ]),
    Bt = Object.freeze(Object.defineProperty({
        __proto__: null,
        default: kt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
export {
    x as C, He as D, Bt as a, Lt as i
};