import {
    G as R,
    R as N,
    T as H,
    z as M,
    r as c,
    B as k,
    C as V,
    H as O,
    I as u,
    Q as _,
    J as t,
    P as n,
    av as y,
    O as i,
    aB as p,
    ao as h,
    b4 as U,
    q as j,
    n as q,
    N as v,
    K as D,
    M as F,
    b0 as J,
    b1 as G
} from "./common.modules-f9fa5dc7.js";
import {
    y as b,
    L as S,
    A as z,
    cJ as K,
    g as $,
    au as Q,
    _ as W
} from "./page-activity-ActivityDetail-0d51a056.js";
import "./page-turntable-assets-d6267459.js";
import "./native/index-eb46cb93.js";
import "./en-0806f032.js";
const X = {
        class: "promotionShare__container"
    },
    Y = {
        class: "promotionShare__container-tips"
    },
    Z = ["id"],
    x = {
        class: "sContent"
    },
    ee = {
        class: "head1"
    },
    te = ["innerHTML"],
    ne = {
        class: "head3"
    },
    oe = ["src"],
    se = ["src"],
    ae = ["innerHTML"],
    ie = ["id"],
    re = {
        class: "promotionShare__container-slogan"
    },
    le = {
        class: "promotionShare__container-buttons"
    },
    de = R({
        __name: "index",
        setup(ce) {
            const I = N();
            H();
            const {
                t: C
            } = M(), m = c(0), g = c(""), f = c(!1);
            let l = c("");
            const L = e => {},
                P = e => {
                    m.value = e.activeIndex, console.log(e.activeIndex)
                },
                B = () => {
                    I.back()
                };
            k(() => b().getProjectLogo), k(() => b().getProjectName);
            const T = () => {
                S(l.value.toString())
            };
            async function A() {
                const e = await z(K());
                if (console.log("res: ", e.data.url, window.location.origin), e) {
                    g.value = e.data.landingPageUrl, f.value = e.data.isLandingPageEnabled, e.data.url.startsWith("http") ? l.value = e.data.url : l.value = window.location.href.substring(0, window.location.href.lastIndexOf("/#/") + 2) + "/" + e.data.url.substring(e.data.url.lastIndexOf("re"), e.data.url.length);
                    for (let o = 1; o <= 3; o++) U.toCanvas(document.getElementById("qr-code" + o), l.value, a => {
                        a && console.error(a)
                    })
                }
            }
            const E = async e => {
                var o = document.getElementById(e);
                const a = j({
                        message: C("loading"),
                        duration: 0,
                        forbidClick: !0
                    }),
                    s = await q(() =>
                        import ("./common.modules-f9fa5dc7.js").then(r => r.cu), ["assets/js/common.modules-f9fa5dc7.js", "assets/css/common-05d2aa17.css"]),
                    w = s.default || s;
                w && w.toPng(o).then(r => {
                    const d = document.createElement("a");
                    d.href = r, d.download = "share.jpeg", document.body.appendChild(d), d.click(), a.close()
                }).catch(r => {
                    a.close(), console.error("Error generating image:", r)
                })
            };
            return V(() => {
                A()
            }), (e, o) => {
                const a = O("NavBar");
                return v(), u("div", X, [_(a, {
                    title: e.$t("titleInvite"),
                    "left-arrow": "",
                    onClickLeft: B
                }, null, 8, ["title"]), t("div", Y, [t("p", null, n(e.$t("tipSwipeToPickBrochure")), 1)]), _(i(G), {
                    class: "my-swipe",
                    slidesPerView: "auto",
                    centeredSlides: !0,
                    "space-between": 20,
                    onSwiper: L,
                    onSlideChange: P
                }, {
                    default: y(() => [(v(), u(D, null, F(3, s => _(i(J), {
                        key: s
                    }, {
                        default: y(() => [t("div", {
                            class: "promotionShare__container-swiper",
                            id: "share" + (s - 1)
                        }, [t("div", x, [t("div", ee, [t("div", null, n(e.$t("fairAndJust")), 1), t("div", null, n(e.$t("openAndTransparent")), 1)]), t("div", {
                            class: "head2",
                            innerHTML: e.$t("fullOddsReturnRate")
                        }, null, 8, te), t("div", ne, [t("div", null, [t("img", {
                            class: "logo",
                            src: i($)("promotion", "bank"),
                            alt: ""
                        }, null, 8, oe), p(" " + n(e.$t("financialSecurity")), 1)]), t("div", null, [t("img", {
                            class: "logo",
                            src: i($)("promotion", "trucktick"),
                            alt: ""
                        }, null, 8, se), p(" " + n(e.$t("withdrawFast")), 1)])]), t("div", {
                            class: "head4",
                            innerHTML: e.$t("highestRebate", [85])
                        }, null, 8, ae)]), t("canvas", {
                            id: "qr-code" + s
                        }, null, 8, ie)], 8, Z)]),
                        _: 2
                    }, 1024)), 64))]),
                    _: 1
                }), t("div", re, [t("p", null, n(e.$t("inviteFriends")), 1), t("p", null, [p(n(e.$t("divideBonus")) + " ", 1), t("span", null, n(e.$t("tip10billion")), 1), p(" " + n(e.$t("commission")), 1)])]), t("div", le, [i(Q)() ? h("v-if", !0) : (v(), u("div", {
                    key: 0,
                    class: "share",
                    onClick: o[0] || (o[0] = s => E("share" + m.value))
                }, n(e.$t("shareInvitationPoster")), 1)), t("div", {
                    class: "cpy",
                    onClick: T
                }, n(e.$t("copyInvitationLink")), 1), f.value ? (v(), u("div", {
                    key: 1,
                    class: "cpy",
                    onClick: o[1] || (o[1] = s => i(S)(g.value))
                }, n(e.$t("clanding")), 1)) : h("v-if", !0), h(" <div>{{ $t('copyInvitationLink') }}</div> ")])])
            }
        }
    });
const me = W(de, [
    ["__scopeId", "data-v-3b74cce6"],
    ["__file", "/usr/local/jenkins-prod/workspace/AR079-Pages-india-tashanwin/src/views/promotion/PromotionShare/index.vue"]
]);
export {
    me as
    default
};