import { jsx as o } from "react/jsx-runtime";
import { Button as d } from "@mui/material";
import s from "react-cookie-consent";
import { resetCookieConsentValue as y } from "react-cookie-consent";
import { styled as p } from "../Theme/index.js";
const n = {
  en: {
    content: "We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content, to analyze our website traffic, and to understand where our visitors are coming from.",
    agree: "I Understand"
  },
  zh: {
    content: "我们使用 cookies 和其他跟踪技术来改善您在我们网站上的浏览体验，向您展示个性化的内容，分析我们的网站流量，并了解我们的访问者来自哪里。",
    agree: "我知道了"
  }
};
function u() {
  try {
    return window.self !== window.top;
  } catch {
    return !0;
  }
}
function x(t) {
  return /* @__PURE__ */ o(d, { variant: "contained", ...t });
}
function h({
  children: t,
  locale: e = "en",
  style: r = {},
  displayInIframe: i = !1,
  ...a
}) {
  return !i && u() ? null : (e && !n[e] && (e = "en"), /* @__PURE__ */ o(c, { style: r, children: /* @__PURE__ */ o(
    s,
    {
      disableStyles: !0,
      disableButtonStyles: !0,
      ButtonComponent: x,
      buttonText: n[e].agree,
      buttonStyle: { marginTop: 16, padding: "6px 16px" },
      ...a,
      children: t || /* @__PURE__ */ o("p", { style: { margin: 0 }, children: n[e].content })
    }
  ) }));
}
const c = p("div")`
  box-sizing: border-box;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  max-width: 440px;
  padding: 16px 24px;
  font-size: 16px;
  color: ${({ theme: t }) => t.palette.grey[500]};
  background: ${({ theme: t }) => t.palette.background.paper};
  border: 1px solid ${({ theme: t }) => t.palette.divider};
  border-radius: ${({ theme: t }) => t.shape.borderRadius}px;
  box-shadow: ${({ theme: t }) => t.shadows[4]};
  &:empty {
    display: none;
  }
  button {
    min-width: 200px;
  }

  @media screen and (max-width: 480px) {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
    button {
      display: block;
      width: 100%;
    }
  }
`;
export {
  h as default,
  y as resetCookieConsentValue
};
