import { jsxs as r, jsx as e } from "react/jsx-runtime";
import g from "@arcblock/react-hooks/lib/useBrowser";
import { Typography as f } from "@mui/material";
import a from "lodash/isUndefined";
import v from "./images/app-store.svg.js";
import b from "./images/google-play.svg.js";
import L from "./images/android_download.svg.js";
import i from "../Button/index.js";
import { mergeProps as k } from "../Util/index.js";
import { styled as x } from "../Theme/index.js";
function D(t) {
  const l = g(), o = Object.assign({}, t);
  a(o.title) && (o.title = "Download DID Wallet"), a(o.layout) && (o.layout = "vertical"), a(o.storeLayout) && (o.storeLayout = "horizontal"), a(o.locale) && (o.locale = "zh"), a(o.iosLink) && (o.iosLink = "https://itunes.apple.com/app/id1460083542"), a(o.androidLink) && (o.androidLink = "https://play.google.com/store/apps/details?id=com.arcblock.wallet.app.product"), a(o.androidDownLoadUrl) && (o.androidDownLoadUrl = "https://releases.arcblockio.cn/arcwallet_android/latest/abtwallet.apk"), a(o.style) && (o.style = {});
  const h = k(o, D, ["style"]), { title: d, children: s, iosLink: c, androidLink: m, androidDownLoadUrl: p, locale: n, ...w } = h, y = l.mobile.android.phone || l.mobile.android.tablet, u = l.mobile.apple.phone || l.mobile.apple.tablet;
  return /* @__PURE__ */ r(N, { ...w, children: [
    /* @__PURE__ */ r("div", { className: "download-text", children: [
      !!d && /* @__PURE__ */ e(f, { className: "download-title", component: "div", children: d }),
      s && /* @__PURE__ */ e(f, { className: "download-extra", component: "div", children: s })
    ] }),
    !l.mobile.any && /* @__PURE__ */ r("div", { className: "download-store-list", children: [
      /* @__PURE__ */ e(i, { className: "download-link", component: "a", href: c, children: /* @__PURE__ */ e(v, {}) }),
      n === "zh" && /* @__PURE__ */ e(i, { component: "a", className: "download-link", href: p, children: /* @__PURE__ */ e(L, {}) }),
      n === "en" && /* @__PURE__ */ e(i, { component: "a", className: "download-link", href: m, children: /* @__PURE__ */ e(b, {}) })
    ] }),
    y && /* @__PURE__ */ r("div", { className: "download-store-list", children: [
      n === "zh" && /* @__PURE__ */ e(i, { component: "a", href: p, variant: "outlined", color: "primary", children: "本地下载" }),
      n === "en" && /* @__PURE__ */ e(i, { component: "a", href: m, variant: "outlined", color: "primary", children: "Download" })
    ] }),
    u && /* @__PURE__ */ e("div", { className: "download-store-list", children: /* @__PURE__ */ e(i, { component: "a", href: c, variant: "outlined", color: "primary", children: "Download" }) })
  ] });
}
const N = x("div")`
  display: flex;
  flex-direction: ${(t) => t.layout === "vertical" ? "column" : "row"};
  align-items: center;

  .download-title {
    margin-right: ${(t) => t.layout === "vertical" ? "0" : "16px"};
    margin-bottom: ${(t) => t.layout === "vertical" ? "16px" : "0"};
  }

  .download-store-list {
    display: flex;
    flex-direction: ${(t) => t.storeLayout === "vertical" ? "column" : "row"};
    justify-content: space-between;
    align-items: center;

    .download-link {
      padding: 0;
      margin: 0;

      margin-right: ${(t) => t.storeLayout === "vertical" ? "0" : "16px"};
      margin-bottom: ${(t) => t.storeLayout === "vertical" ? "16px" : "0"};

      &:last-of-type {
        margin-right: 0;
        margin-bottom: 0;
      }
    }
  }
`;
export {
  D as default
};
