"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const react = require("@emotion/react");
const React = require("react");
const jsxRuntime = require("@emotion/react/jsx-runtime");
require("../../node_modules/.pnpm/@google_model-viewer@3.2.1_three@0.154.0/node_modules/@google/model-viewer/lib/model-viewer.js");
const download = require("../../assets/icon/download.png.js");
const music_card = require("../../assets/icon/music_card.png.js");
const mysteryBox = require("../../assets/icon/mysteryBox.jpg.js");
const spinner_black = require("../../assets/icon/spinner_black.svg.js");
const styles = require("../../styles.js");
require("../CheckBox/style.js");
require("../RadioButton/RadioButtonWrap.js");
require("../Select/Select/SelectWrap.js");
require("../Input/style.js");
require("../UploadCell/UploadCellWrap.js");
require("../Loading/Loading/LoadingWrap.js");
require("../Loading/FolderLoading/style.js");
require("../Button/Button/style.js");
require("../Button/NormalButton/style.js");
const index = require("../Button/SmallButton/index.js");
require("../Avatar/style.js");
require("react-dom");
require("../Modal/ModalV1/ModalWrap.js");
require("../Modal/FullScreenModal/style.js");
require("../BottomTabBar/style.js");
require("../Message/index.js");
require("../Divider/styles.js");
require("../Header/styles.js");
const compress = require("../../utils/compress.js");
const constants = require("../../utils/constants.js");
const getPlatform = require("../../utils/getPlatform.js");
const iconStyle = "position: absolute;top: 0;right: 0;bottom: 0;left: 0;max-height: 100%;margin: auto;";
const baseStyle = "border-radius: 12px;";
const backgroundStyle = `background:${styles.colors.nftbg};`;
let contentStyle = `${baseStyle}${backgroundStyle}`;
const Text = function({
  media,
  mediaVisible,
  isDetail
}) {
  const [content, setContent] = React.useState("");
  React.useEffect(() => {
    fetch(media).then((r) => r.text()).then((r) => setContent(r));
  }, [media]);
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
    /* @__PURE__ */ jsxRuntime.jsx(
      Loading,
      {
        cssStyle: react.css`
          display: ${isDetail && content && "none"};
        `,
        isDetail
      }
    ),
    /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        css: react.css`
          ${contentStyle}
          ${isDetail || iconStyle}
          padding: ${mediaVisible ? "10px" : "10px 15px"};
          overflow: ${mediaVisible ? "auto" : "hidden"};
          font-size: ${mediaVisible ? "20px" : "16px"};
          color: ${!isDetail && "white"};
          text-align: left;
          word-break: break-word;
          white-space: pre-wrap;
        `,
        className: "hideScrollbar",
        children: content
      }
    )
  ] });
};
const Html = function({
  media,
  mediaVisible,
  isDetail
}) {
  const contentElement = React.useRef(null);
  const [url, setUrl] = React.useState(media);
  const [iframeVisible, setIframeVisible] = React.useState();
  const [isLoaded, setIsLoaded] = React.useState(false);
  React.useEffect(() => {
    const a = media.lastIndexOf("http");
    if (a === -1)
      return;
    const b = media.slice(a);
    try {
      const c = decodeURIComponent(decodeURIComponent(b));
      if (c.includes("</svg>")) {
        setIframeVisible(false);
        setUrl(
          `data:image/svg+xml;base64,${window.btoa(
            unescape(encodeURIComponent(media))
          )}`
        );
        return;
      }
      setIframeVisible(true);
      setUrl(c);
    } catch {
      try {
        if (media.includes("</svg>")) {
          setIframeVisible(false);
          setUrl(
            `data:image/svg+xml;base64,${window.btoa(
              unescape(encodeURIComponent(media))
            )}`
          );
        } else {
        }
      } catch {
      }
    }
  }, [media]);
  return /* @__PURE__ */ jsxRuntime.jsxs(
    "div",
    {
      ref: contentElement,
      css: react.css`
        ${contentStyle}
        ${isDetail || iconStyle}
        overflow: ${mediaVisible ? "auto" : "hidden"};
        font-size: 20px;
        color: white;
        text-align: left;
        word-break: break-all;
        white-space: pre-line;
      `,
      className: "hideScrollbar",
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          Loading,
          {
            cssStyle: react.css`
          display: ${isDetail && isLoaded && "none"};
          z-index: ${!isDetail && isLoaded ? "-1" : "1"};
          background: ${isDetail && "white"};
        `,
            isDetail
          }
        ),
        iframeVisible ? /* @__PURE__ */ jsxRuntime.jsx(
          "iframe",
          {
            title: "iframe",
            src: url,
            allowFullScreen: true,
            name: "mapFrame",
            scrolling: "no",
            frameBorder: "0",
            width: "100%",
            height: "100%",
            onLoad: () => setIsLoaded(true),
            css: react.css`
            display: block;
            /* position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0; */
          `
          }
        ) : /* @__PURE__ */ jsxRuntime.jsx(
          "img",
          {
            css: react.css`
            ${contentStyle}
            ${isDetail || iconStyle}
            width: 100%;
            object-fit: contain;
            /* position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0; */
          `,
            src: url,
            onLoad: () => setIsLoaded(true)
          }
        )
      ]
    }
  );
};
const Model = function({
  media,
  mediaVisible,
  isDetail
}) {
  const contentElement = React.useRef();
  React.useLayoutEffect(() => {
    var _a, _b, _c;
    if (isDetail)
      return;
    const mv = contentElement.current;
    if (!mv)
      return;
    const shadowRoot = mv.shadowRoot;
    if (!shadowRoot)
      return;
    const button = shadowRoot.querySelectorAll(
      "#default-poster"
    )[0];
    button.style.background = "none";
    const el = (_c = (_b = (_a = mv.parentNode) == null ? void 0 : _a.parentNode) == null ? void 0 : _b.parentNode) == null ? void 0 : _c.parentNode;
    mv.style.opacity = "0";
    mv.style.width = `${el == null ? void 0 : el.offsetWidth}px`;
    mv.style.height = `${el == null ? void 0 : el.offsetHeight}px`;
    setTimeout(
      () => {
        mv.style.opacity = "1";
      },
      mediaVisible ? 800 : 1300
    );
  }, [isDetail, mediaVisible]);
  return /* @__PURE__ */ jsxRuntime.jsxs(
    "div",
    {
      css: react.css`
        ${contentStyle}
        ${isDetail || iconStyle}
        background:${isDetail && "white"}
      `,
      onLoad: (el) => {
        var _a, _b;
        if (!isDetail)
          return;
        const mv = contentElement.current;
        if (!mv)
          return;
        const shadowRoot = mv.shadowRoot;
        if (!shadowRoot)
          return;
        const el2 = (_b = (_a = el == null ? void 0 : el.target.parentNode) == null ? void 0 : _a.parentNode) == null ? void 0 : _b.parentNode;
        mv.style.width = `${el2 == null ? void 0 : el2.offsetWidth}px`;
        mv.style.height = `${el2 == null ? void 0 : el2.offsetWidth}px`;
      },
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          Loading,
          {
            cssStyle: react.css`
          display: none;
        `,
            isDetail
          }
        ),
        /* @__PURE__ */ jsxRuntime.jsx(
          "model-viewer",
          {
            ref: contentElement,
            src: constants.jsonProxy2(constants.revokeJsonProxy(media)),
            ar: true,
            "ar-modes": "webxr scene-viewer quick-look",
            "environment-image": "neutral",
            "auto-rotate": true,
            "camera-controls": true,
            onClick: (e) => {
              e.stopPropagation();
            },
            onError: (e) => {
            },
            onClose: (e) => {
            },
            "model-visibility": (e) => {
            }
          }
        )
      ]
    }
  );
};
const Binary = function({
  media,
  mediaVisible,
  mediaMimeType,
  autoPlay,
  getMedia,
  isDetail,
  imgCssStyle
}) {
  let format;
  media = constants.revokeJsonProxy(media);
  if (media.includes("?")) {
    const base = media.split("?")[0];
    format = base.slice(base.lastIndexOf(".") + 1);
  } else {
    format = media.slice(media.lastIndexOf(".") + 1);
  }
  if (getPlatform.getPlatformType(media) === "IPFS") {
    media = constants.jsonProxy(media);
  }
  switch (format) {
    case "jpg":
    case "png":
    case "jpeg":
    case "bmp":
    case "ico":
    case "webp":
    case "svg":
    case "avif":
      return /* @__PURE__ */ jsxRuntime.jsx(
        Image,
        {
          image: media,
          mediaVisible,
          isDetail,
          imgCssStyle
        }
      );
    case "gif":
      return /* @__PURE__ */ jsxRuntime.jsx(
        Image,
        {
          image: media,
          mediaVisible,
          mediaMimeType: "image/gif",
          isDetail,
          imgCssStyle
        }
      );
    case "mp4":
    case "mov":
    case "ogv":
    case "Ogg":
    case "ogg":
    case "mkv":
    case "webm":
    case "f4v":
      return /* @__PURE__ */ jsxRuntime.jsx(
        Video,
        {
          media,
          autoPlay,
          getMedia,
          mediaVisible
        }
      );
    case "mp3":
    case "flac":
    case "wav":
    case "aac":
    case "m4r":
    case "m4a":
      return mediaVisible ? /* @__PURE__ */ jsxRuntime.jsx(Audio, { media, autoPlay, getMedia }) : /* @__PURE__ */ jsxRuntime.jsx(MusicCard, {});
    case "glb":
    case "gltf":
      return /* @__PURE__ */ jsxRuntime.jsx(Model, { media, mediaVisible, isDetail });
    default:
      return /* @__PURE__ */ jsxRuntime.jsx(
        Download,
        {
          media,
          mediaVisible,
          mediaMimeType
        }
      );
  }
};
const Audio = function({
  media,
  autoPlay,
  getMedia
}) {
  const [hasChangedProxy, setHasChangedProxy] = React.useState(false);
  const [hasRemovedProxy, setHasRemovedProxy] = React.useState(false);
  const audio = React.useRef();
  React.useEffect(() => {
    getMedia(audio.current);
  }, [getMedia]);
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      css: react.css`
        ${contentStyle}
        display: flex;
        align-items: center;
        justify-content: center;
      `,
      children: /* @__PURE__ */ jsxRuntime.jsx(
        "audio",
        {
          css: react.css`
          width: 50%;
        `,
          ref: audio,
          controls: true,
          loop: true,
          src: media,
          autoPlay,
          onError: (el) => {
            if (!hasRemovedProxy) {
              el.currentTarget.src = constants.revokeJsonProxy(el.currentTarget.src);
              const el2 = el.currentTarget;
              const pNode = el.currentTarget.parentNode;
              el.currentTarget.remove();
              pNode == null ? void 0 : pNode.append(el2);
              setHasRemovedProxy(true);
            } else if (!hasChangedProxy) {
              el.currentTarget.src = constants.jsonProxy2(el.currentTarget.src);
              const el2 = el.currentTarget;
              const pNode = el.currentTarget.parentNode;
              el.currentTarget.remove();
              pNode == null ? void 0 : pNode.append(el2);
              setHasChangedProxy(true);
            }
          }
        }
      )
    }
  );
};
const MusicCard = function() {
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      css: react.css`
        ${contentStyle}
        background: rgb(0,1,0);
      `,
      children: /* @__PURE__ */ jsxRuntime.jsx(
        Image,
        {
          image: music_card,
          cssStyle: react.css`
          object-fit: contain !important;
          width: 70% !important;
          background: rgb(0, 1, 0) !important;
        `,
          mediaVisible: true
        }
      )
    }
  );
};
const Video = function({
  media,
  autoPlay,
  mediaVisible,
  getMedia,
  cssStyle
}) {
  const [hasChangedProxy, setHasChangedProxy] = React.useState(false);
  const [hasRemovedProxy, setHasRemovedProxy] = React.useState(false);
  const video = React.useRef();
  React.useEffect(() => {
    getMedia(video.current);
  }, [autoPlay, getMedia]);
  return /* @__PURE__ */ jsxRuntime.jsx(
    "video",
    {
      src: media,
      css: react.css`
        ${contentStyle}
        width: 100%;
        height: 100%;
        ${cssStyle}
      `,
      ref: video,
      autoPlay,
      controls: !!mediaVisible,
      loop: true,
      playsInline: true,
      onError: (el) => {
        if (!hasRemovedProxy) {
          el.currentTarget.src = constants.revokeJsonProxy(el.currentTarget.src);
          const el2 = el.currentTarget;
          const pNode = el.currentTarget.parentNode;
          el.currentTarget.remove();
          pNode == null ? void 0 : pNode.append(el2);
          setHasRemovedProxy(true);
        } else if (!hasChangedProxy) {
          el.currentTarget.src = constants.jsonProxy2(el.currentTarget.src);
          const el2 = el.currentTarget;
          const pNode = el.currentTarget.parentNode;
          el.currentTarget.remove();
          pNode == null ? void 0 : pNode.append(el2);
          setHasChangedProxy(true);
        }
      },
      children: /* @__PURE__ */ jsxRuntime.jsx(
        "source",
        {
          src: media,
          onError: (el) => {
            if (!hasRemovedProxy) {
              el.currentTarget.src = constants.revokeJsonProxy(el.currentTarget.src);
              const el2 = el.currentTarget;
              const pNode = el.currentTarget.parentNode;
              el.currentTarget.remove();
              pNode == null ? void 0 : pNode.append(el2);
              setHasRemovedProxy(true);
            } else if (!hasChangedProxy) {
              el.currentTarget.src = constants.jsonProxy2(el.currentTarget.src);
              const el2 = el.currentTarget;
              const pNode = el.currentTarget.parentNode;
              el.currentTarget.remove();
              pNode == null ? void 0 : pNode.append(el2);
              setHasChangedProxy(true);
            }
          }
        }
      )
    }
  );
};
const Image = function({
  image,
  cssStyle,
  imgCssStyle,
  mediaVisible,
  mediaMimeType,
  needCompress = true,
  onLoad,
  isDetail
}) {
  const [hasChangedProxy, setHasChangedProxy] = React.useState(false);
  const [hasRemovedProxy, setHasRemovedProxy] = React.useState(false);
  const [isLoaded, setIsLoaded] = React.useState(false);
  const isGif = mediaMimeType == null ? void 0 : mediaMimeType.includes("image/gif");
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
    /* @__PURE__ */ jsxRuntime.jsx(
      Loading,
      {
        cssStyle: react.css`
          display: ${isDetail && isLoaded && "none !important"};
          ${cssStyle}
        `,
        isDetail
      }
    ),
    /* @__PURE__ */ jsxRuntime.jsx(
      "img",
      {
        id: "mediaImg",
        css: react.css`
          ${contentStyle}
          ${isDetail || iconStyle}
          width: 100%;
          /* visibility: ${!isGif && "hidden"}; */
          visibility: hidden;
          ${cssStyle};
          ${imgCssStyle};
        `,
        src: image,
        onLoad: (el) => {
          if (isGif || !needCompress || image.includes("https://images.mirror-media.xyz/")) {
            el.target.style.visibility = "visible";
            onLoad && onLoad();
            setIsLoaded && setIsLoaded(true);
            return;
          }
          compress.default(
            el.currentTarget.src,
            el.currentTarget,
            void 0,
            onLoad,
            setIsLoaded
          );
        },
        onError: (el) => {
          if (!hasChangedProxy) {
            const newImage = constants.jsonProxy2(constants.revokeJsonProxy(image));
            setHasChangedProxy(true);
            if (isGif || !needCompress) {
              el.currentTarget.src = newImage;
              return;
            }
            compress.default(newImage, el.currentTarget, true);
          } else if (!hasRemovedProxy) {
            const newImage = constants.revokeJsonProxy2(image);
            setHasRemovedProxy(true);
            if (isGif || !needCompress) {
              el.currentTarget.src = newImage;
              return;
            }
            compress.default(newImage, el.currentTarget, true);
          }
        }
      }
    )
  ] });
};
const Download = function({
  media,
  mediaVisible,
  mediaMimeType,
  cardWidth,
  isDetail
}) {
  if (getPlatform.getPlatformType(media) === "IPFS") {
    media = constants.revokeJsonProxy(media);
  }
  return /* @__PURE__ */ jsxRuntime.jsxs(
    "div",
    {
      css: react.css`
        ${contentStyle}
        ${isDetail || iconStyle}
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: ${mediaVisible ? "10px" : "10px 15px"};
        overflow: ${mediaVisible ? "auto" : "hidden"};
        font-size: 16px;
        color: white;
        text-align: center;
        background-color: white;
      `,
      className: "hideScrollbar",
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          "div",
          {
            css: react.css`
          display: flex;
          align-items: center;
          justify-content: center;
          width: ${cardWidth && cardWidth < 150 ? "100%" : "150px"};
          /* width: 10px; */
          height: 33px;
          padding: 16px 10px;
          background: linear-gradient(
              95.04deg,
              rgba(0, 0, 0, 0) 3.11%,
              rgba(0, 0, 0, 0.12) 94.96%
            ),
            #212426;
          border: 2px solid rgba(0, 0, 0, 0.08);
          border-radius: 100px;
          box-shadow:
            -6px -6px 12px rgba(255, 255, 255, 0.04),
            6px 6px 12px rgba(0, 0, 0, 0.16);
        `,
            children: /* @__PURE__ */ jsxRuntime.jsx(
              "span",
              {
                css: react.css`
            ${styles.ellipsisCSS}
          `,
                children: mediaMimeType && mediaMimeType.split("/")[1] !== void 0 && mediaMimeType.split("/")[1].split(";")[0]
              }
            )
          }
        ),
        /* @__PURE__ */ jsxRuntime.jsx(
          "a",
          {
            target: "_blank",
            rel: "noreferrer noopener",
            download: true,
            href: media,
            css: react.css`
          display: block;
          margin-top: 22px;
        `,
            children: /* @__PURE__ */ jsxRuntime.jsx(
              index.SmallButton,
              {
                content: download,
                tip: "Download File",
                cssStyle: react.css`
            > div {
              margin-top: 16px;
            }
          `,
                borderless: true
              }
            )
          }
        )
      ]
    }
  );
};
const Iframe = ({
  id,
  media,
  onLoad,
  onError,
  cssStyles
}) => /* @__PURE__ */ jsxRuntime.jsx(
  "iframe",
  {
    id,
    title: "iframe",
    src: media,
    allowFullScreen: true,
    name: "mapFrame",
    frameBorder: "0",
    width: "100%",
    height: "100%",
    scrolling: "yes",
    className: "mediaIframe",
    sandbox: "allow-scripts allow-same-origin allow-popups allow-forms allow-top-navigation-by-user-activation",
    onLoad: (e) => onLoad == null ? void 0 : onLoad(e),
    onError: (e) => onError == null ? void 0 : onError(e),
    css: react.css`
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      ${cssStyles};
    `
  }
);
const IframeWithoutSandBox = ({
  media,
  onLoad
}) => /* @__PURE__ */ jsxRuntime.jsx(
  "iframe",
  {
    title: "iframe",
    src: media,
    allowFullScreen: true,
    name: "mapFrame",
    frameBorder: "0",
    width: "100%",
    height: "100%",
    scrolling: "yes",
    onLoad: (e) => {
      onLoad && onLoad(e);
    },
    css: react.css`
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
    `
  }
);
const Empty = function({
  cssStyle,
  children
}) {
  return /* @__PURE__ */ jsxRuntime.jsx(
    "div",
    {
      css: react.css`
        ${contentStyle}
        display: grid;
        place-items: center;
        color: black;
        background: ${styles.colors.nftbg};
        ${cssStyle}
      `,
      children
    }
  );
};
const Loading = function({
  cssStyle,
  isDetail
}) {
  return /* @__PURE__ */ jsxRuntime.jsx(
    Empty,
    {
      cssStyle: react.css`
        background: ${isDetail && "white"};
        ${cssStyle}
      `,
      children: isDetail && /* @__PURE__ */ jsxRuntime.jsx(
        "img",
        {
          src: spinner_black,
          css: react.css`
            @keyframes _18hu3ey0 {
              to {
                transform: rotate(1turn);
              }
            }
            animation: _18hu3ey0 1.4s linear infinite;
            width: 30px;
            height: 30px;
          `
        }
      )
    }
  );
};
const Media = function({
  mediaUrl,
  mediaMimeType,
  autoPlay = false,
  mediaVisible = false,
  needCompress = true,
  isMysteryBox,
  getMedia = () => {
  },
  cardWidth,
  cssStyle,
  imgCssStyle,
  onLoad,
  isDetail
}) {
  contentStyle = mediaVisible ? `${baseStyle}background:none;` : `${baseStyle}${backgroundStyle}`;
  if ((mediaMimeType == null ? void 0 : mediaMimeType.includes("text/xml")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("text/plain")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("text/markdown")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("application/json")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("application/javascript")))
    return /* @__PURE__ */ jsxRuntime.jsx(Text, { media: mediaUrl, mediaVisible, isDetail });
  if (mediaMimeType == null ? void 0 : mediaMimeType.includes("text/html"))
    return /* @__PURE__ */ jsxRuntime.jsx(Html, { media: mediaUrl, mediaVisible, isDetail });
  if (mediaMimeType == null ? void 0 : mediaMimeType.includes("model/gltf")) {
    return /* @__PURE__ */ jsxRuntime.jsx(Model, { media: mediaUrl, mediaVisible, isDetail });
  }
  if ((mediaMimeType == null ? void 0 : mediaMimeType.includes("audio/mp3")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("audio/ogg")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("audio/flac")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("audio/wav")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("audio/vnd.dlna.adts")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("audio/x-m4r")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("audio/m4a")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("audio/mpeg")))
    return mediaVisible ? /* @__PURE__ */ jsxRuntime.jsx(
      Audio,
      {
        media: mediaVisible ? mediaUrl : "",
        autoPlay,
        getMedia
      }
    ) : /* @__PURE__ */ jsxRuntime.jsx(MusicCard, {});
  if ((mediaMimeType == null ? void 0 : mediaMimeType.includes("video/mp4")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("video/quicktime")))
    return /* @__PURE__ */ jsxRuntime.jsx(
      Video,
      {
        media: mediaUrl,
        autoPlay,
        mediaVisible,
        getMedia,
        cssStyle
      }
    );
  if ((mediaMimeType == null ? void 0 : mediaMimeType.includes("image/jpg")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("image/jpeg")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("image/png")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("image/bmp")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("image/gif")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("image/x-icon")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("image/webp")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("image/svg+xml")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("imageViewer")))
    return /* @__PURE__ */ jsxRuntime.jsx(
      Image,
      {
        image: mediaUrl,
        mediaVisible,
        mediaMimeType,
        needCompress,
        cssStyle,
        imgCssStyle,
        onLoad,
        isDetail
      }
    );
  if ((mediaMimeType == null ? void 0 : mediaMimeType.includes("application/octet-stream")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("binary/octet-stream")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("application/wasm")) || (mediaMimeType == null ? void 0 : mediaMimeType.includes("application/json")))
    return /* @__PURE__ */ jsxRuntime.jsx(
      Binary,
      {
        media: mediaUrl,
        mediaMimeType,
        mediaVisible,
        autoPlay,
        getMedia,
        imgCssStyle
      }
    );
  if (mediaMimeType == null ? void 0 : mediaMimeType.includes("application/pdf")) {
    return /* @__PURE__ */ jsxRuntime.jsx(IframeWithoutSandBox, { media: mediaUrl, onLoad });
  }
  if (mediaMimeType === "iframe") {
    return /* @__PURE__ */ jsxRuntime.jsx(Iframe, { media: mediaUrl, onLoad });
  }
  if (mediaUrl)
    return /* @__PURE__ */ jsxRuntime.jsx(
      Download,
      {
        media: mediaUrl,
        mediaVisible,
        mediaMimeType,
        cardWidth,
        isDetail
      }
    );
  if (isMysteryBox)
    return /* @__PURE__ */ jsxRuntime.jsx(Image, { image: mysteryBox });
  return /* @__PURE__ */ jsxRuntime.jsx(Empty, {});
};
exports.Iframe = Iframe;
exports.IframeWithoutSandBox = IframeWithoutSandBox;
exports.Media = Media;
//# sourceMappingURL=index.js.map
