import {
    G as J,
    $ as q,
    r as c,
    z as re,
    R as ce,
    B as W,
    C as ue,
    aK as de,
    H as h,
    aA as ve,
    N as l,
    I as r,
    J as e,
    P as o,
    O as n,
    ao as p,
    au as U,
    av as g,
    Q as y,
    ap as O,
    K as $,
    M as j,
    ax as A,
    aB as pe,
    V as he,
    aC as ye,
    aD as _e
} from "./common.modules-f9fa5dc7.js";
import {
    a1 as fe,
    m as me,
    y as ge,
    a as we,
    i as ke,
    c as H,
    b as w,
    A as Ce,
    a2 as be,
    _ as De
} from "./page-activity-ActivityDetail-0d51a056.js";
import {
    C as Ae
} from "./page-activity-Championship-a046222e.js";
import {
    E as $e
} from "./page-activity-Bonus-f5229d51.js";
const Se = _ => (ye("data-v-4a7709f3"), _ = _(), _e(), _),
    Te = {
        class: "activity-wrapper"
    },
    Re = {
        class: "activity-banner"
    },
    Be = {
        class: "activity-bonus"
    },
    Ie = {
        class: "activity-panel"
    },
    Pe = {
        class: "msg-window"
    },
    Ue = {
        class: "msg-header"
    },
    Oe = {
        class: "msg-footer"
    },
    Le = Se(() => e("div", {
        class: "nowidth"
    }, null, -1)),
    Ee = ["onClick"],
    Ne = {
        class: "activity-panel-content"
    },
    xe = {
        class: "content-para"
    },
    Fe = {
        class: "content-para"
    },
    Ge = {
        key: 0,
        class: "cardBox"
    },
    Me = {
        class: "activitySection__container"
    },
    ze = ["onClick"],
    Ve = ["src", "onError"],
    qe = {
        class: "box-content"
    },
    We = {
        class: "box-title"
    },
    je = {
        class: "dialog-window"
    },
    He = {
        class: "dialog-wrapper"
    },
    Je = {
        class: "dialog-title"
    },
    Ke = {
        class: "dialog-para"
    },
    Qe = J({
        __name: "index",
        props: {
            activityList: {
                type: Array,
                default: () => {}
            }
        },
        setup(_) {
            const {
                getSelfCustomerServiceLink: L
            } = fe({
                ServerType: 2
            }), {
                ActiveSotre: i,
                saveUserGuidelines: S,
                saveUserDayRequest: K,
                getDailyAwardCount: Q,
                allUnAwardCount: T,
                getActive: X
            } = me(), Y = ge(), {
                championEntranceV: R,
                championEntranceVO: E
            } = we(), {
                isOpenInvitedWheel: Z
            } = ke();
            q(() => i.value.isOpenChampion, a => {
                a == 1 && R()
            });
            const k = c(!1);
            q(k, a => {
                k.value && R()
            });
            const N = c(!0),
                x = c(!0),
                F = c([]),
                {
                    t: u
                } = re(),
                B = c(!1),
                I = c(!1),
                P = c(1),
                G = c(!1),
                v = ce(),
                M = W(() => [{
                    name: u("actTip1"),
                    icon: "a1",
                    goPath: "DailyTasks",
                    noread: T.value,
                    show: i.value.isOpenActivityAward
                }, {
                    name: u("invitationBonus"),
                    icon: "a2",
                    goPath: "InvitationBonus",
                    noread: 0,
                    show: i.value.isTaskState
                }, {
                    name: u("laundryAmount"),
                    icon: "a3",
                    goPath: "Laundry",
                    noread: 0,
                    show: i.value.isOpenWashCode
                }, {
                    name: u("superjackpot"),
                    icon: "a4",
                    goPath: "SuperJackpot",
                    noread: i.value.unJackpotCount,
                    show: i.value.isOpenJackpotReward
                }, {
                    name: u("newMenberPackage"),
                    icon: "a5",
                    goPath: "MemberPackage",
                    noread: 0,
                    show: i.value.newMemberGiftPackageSwitch
                }, {
                    name: u("inviteWheel"),
                    icon: "a6",
                    goPath: "turntable",
                    noread: 0,
                    show: Z.value
                }]),
                ee = W(() => M.value.filter(a => a.show).length);

            function ae(a) {
                let t;
                const {
                    bannerID: d,
                    jumpType: C,
                    contents: m
                } = a;
                if (C == 2) {
                    if (m.startsWith("/")) {
                        v.push({
                            path: m
                        });
                        return
                    }
                    window.location.assign(m);
                    return
                } else if (C == 5) return L();
                switch (d) {
                    case 1:
                        t = "DailyTasks";
                        break;
                    case 2:
                        t = "PointMall";
                        break;
                    case 3:
                        t = "InvitationBonus";
                        break;
                    default:
                        t = "ActivityDetail";
                        break
                }
                t == "ActivityDetail" ? v.push({
                    name: t,
                    query: {
                        id: d
                    }
                }) : t && v.push({
                    name: t
                })
            }
            const te = (a, t) => {
                    a.bannerUrl = w("images", "avatar"), he(() => {
                        let d = document.querySelector(`.act_${t}`);
                        d.src = a.bannerUrl, d.style.objectFit = "contain"
                    })
                },
                f = a => {
                    v.push({
                        name: a
                    })
                },
                se = () => {
                    S(), f("DailyTasks")
                },
                z = () => {
                    x.value = !1, N.value = !1
                },
                V = (a = null) => {
                    K(), a && (z(), f("DailyTasks"))
                },
                ne = async () => {
                    const a = await Ce(be({
                        pageNo: P.value,
                        pageSize: 20
                    }));
                    a ? (a.data.totalCount == 0 && (G.value = !0), a.data.totalPage <= P.value && (I.value = !0), a.data.list && F.value.push(...a.data.list), P.value++) : I.value = !0, B.value = !1
                };
            return ue(async () => {
                await X(), i.value.isOpenActivityAward && Q(), i.value.isOpenChampion == 1 && R()
            }), de(() => {
                x.value = !1, N.value = !1
            }), (a, t) => {
                const d = h("van-icon"),
                    C = h("van-popover"),
                    m = h("van-badge"),
                    ie = h("van-list"),
                    oe = h("van-dialog"),
                    b = ve("lazy");
                return l(), r("div", Te, [e("div", Re, [e("ul", Be, [e("li", null, [e("p", null, o(a.$t("todayRewards")), 1), e("h3", null, o(n(H)(n(i).todayRewards)), 1)]), e("li", null, [e("p", null, o(a.$t("totalRewards")), 1), e("h3", null, o(n(H)(n(i).totalRewards)), 1)])]), n(Y).getIsShowRewardCenter ? (l(), r("div", {
                    key: 0,
                    class: "bonus-button",
                    onClick: t[0] || (t[0] = s => n(v).push({
                        name: "Bonus"
                    }))
                }, o(a.$t("bonusDetails")), 1)) : p("v-if", !0)]), e("div", Ie, [n(i).isFinishUserGuidelines && n(i).isOpenActivityAward ? (l(), U(C, {
                    key: 0,
                    show: n(i).isFinishUserGuidelines,
                    "onUpdate:show": t[1] || (t[1] = s => n(i).isFinishUserGuidelines = s),
                    overlay: !0,
                    placement: "top-start",
                    "close-on-click-overlay": !1,
                    onClose: z,
                    class: "arPopover"
                }, {
                    reference: g(() => [Le]),
                    default: g(() => [e("div", Pe, [e("div", Ue, o(a.$t("activityTip8")), 1), e("div", Oe, [e("div", {
                        onClick: se
                    }, [e("span", null, o(a.$t("dragonEntry")), 1), y(d, {
                        name: "arrow-double-right",
                        color: "var(main-color)"
                    })])])])]),
                    _: 1
                }, 8, ["show"])) : p("v-if", !0), e("div", {
                    class: O(["activity-panel-header", ["lg" + ee.value]])
                }, [(l(!0), r($, null, j(M.value, s => (l(), r($, null, [s.show ? (l(), r("div", {
                    key: 0,
                    class: "header-item",
                    onClick: D => f(s.goPath)
                }, [y(m, {
                    content: s.noread,
                    max: "99",
                    "show-zero": s.noread > 0,
                    color: "#FA5B5B"
                }, {
                    default: g(() => [e("div", {
                        class: O([s.icon, "bgcontainer"])
                    }, null, 2)]),
                    _: 2
                }, 1032, ["content", "show-zero"]), e("span", null, o(s.name), 1)], 8, Ee)) : p("v-if", !0)], 64))), 256))], 2), e("div", Ne, [e("div", {
                    class: "content-title",
                    onClick: t[2] || (t[2] = s => f("RedeemGift"))
                }, [A(e("img", null, null, 512), [
                    [b, n(w)("activity/DailyTask", "signInBanner")]
                ]), e("div", xe, o(a.$t("giftExchange")), 1), e("p", null, o(a.$t("activityTip3")), 1)]), e("div", {
                    class: "content-title",
                    onClick: t[3] || (t[3] = s => f("DailySignIn"))
                }, [A(e("img", null, null, 512), [
                    [b, n(w)("activity/DailyTask", "giftRedeem")]
                ]), e("div", Fe, o(a.$t("code8007")), 1), e("p", null, o(a.$t("activityTip4")), 1)])])]), n(i).isOpenChampion == 1 ? (l(), r("div", Ge, [y(Ae, {
                    itemD: n(E),
                    state: n(E).state,
                    isRefresh: k.value,
                    "onUpdate:isRefresh": t[4] || (t[4] = s => k.value = s),
                    bgImgWidth: "100%",
                    bgImgHeight: "150px",
                    onClick: t[5] || (t[5] = () => n(v).push({
                        name: "Championship"
                    }))
                }, null, 8, ["itemD", "state", "isRefresh"])])) : p("v-if", !0), y(ie, {
                    loading: B.value,
                    "onUpdate:loading": t[6] || (t[6] = s => B.value = s),
                    finished: I.value,
                    "finished-text": n(u)("noMoreThere"),
                    onLoad: ne
                }, {
                    default: g(() => [e("div", Me, [(l(!0), r($, null, j(F.value, (s, D) => (l(), r("div", {
                        class: "box",
                        key: D,
                        onClick: le => ae(s)
                    }, [e("img", {
                        src: s.bannerUrl,
                        class: O(`act_${D}`),
                        onError: le => te(s, D)
                    }, null, 42, Ve), e("div", qe, [e("div", We, o(s.bannerTitle), 1)])], 8, ze))), 128))])]),
                    _: 1
                }, 8, ["loading", "finished", "finished-text"]), G.value ? (l(), U($e, {
                    key: 1
                })) : p("v-if", !0), n(T) > 0 && n(i).isOpenActivityAward ? (l(), U(oe, {
                    key: 2,
                    show: n(i).isFirstUserDayRequest,
                    "onUpdate:show": t[9] || (t[9] = s => n(i).isFirstUserDayRequest = s),
                    "show-confirm-button": !1,
                    className: "noOverHidden"
                }, {
                    default: g(() => [e("div", je, [e("div", He, [A(e("img", null, null, 512), [
                        [b, n(w)("activity/DailyTask", "present")]
                    ]), e("div", Je, [pe(o(a.$t("activityTip5")) + " ", 1), e("span", null, o(n(T)), 1)]), e("div", Ke, o(a.$t("activityTip6")), 1), e("div", {
                        class: "dialog-btn",
                        onClick: t[7] || (t[7] = s => V(!0))
                    }, o(a.$t("activityTip7")), 1), e("div", {
                        class: "dialog-footer",
                        onClick: t[8] || (t[8] = s => V())
                    }, [A(e("img", null, null, 512), [
                        [b, n(w)("activity/DailyTask", "close")]
                    ])])])])]),
                    _: 1
                }, 8, ["show"])) : p("v-if", !0)])
            }
        }
    });
const Xe = De(Qe, [
        ["__scopeId", "data-v-4a7709f3"],
        ["__file", "/usr/local/jenkins-prod/workspace/AR079-Pages-india-tashanwin/src/components/Activity/Section/index.vue"]
    ]),
    ta = J({
        __name: "index",
        setup(_) {
            return (L, i) => {
                const S = h("NavBar");
                return l(), r($, null, [y(S, {
                    class: "main",
                    headLogo: !0
                }), y(Xe)], 64)
            }
        }
    });
export {
    ta as _
};