import * as a from "react";
import k from "../../../@ant-design/icons/es/icons/EyeOutlined.mjs";
import C from "../../../classnames/index.mjs";
import z from "../../../rc-image/es/Image.mjs";
import { useZIndex as V } from "../_util/hooks/useZIndex.mjs";
import { getTransitionName as d } from "../_util/motion.mjs";
import "../config-provider/index.mjs";
import v from "../locale/en_US.mjs";
import L, { icons as G } from "./PreviewGroup.mjs";
import R from "./style/index.mjs";
import $ from "../config-provider/hooks/useCSSVarCls.mjs";
import { ConfigContext as D } from "../config-provider/context.mjs";
var y = globalThis && globalThis.__rest || function(o, n) {
  var t = {};
  for (var e in o)
    Object.prototype.hasOwnProperty.call(o, e) && n.indexOf(e) < 0 && (t[e] = o[e]);
  if (o != null && typeof Object.getOwnPropertySymbols == "function")
    for (var r = 0, e = Object.getOwnPropertySymbols(o); r < e.length; r++)
      n.indexOf(e[r]) < 0 && Object.prototype.propertyIsEnumerable.call(o, e[r]) && (t[e[r]] = o[e[r]]);
  return t;
};
const c = (o) => {
  const {
    prefixCls: n,
    preview: t,
    className: e,
    rootClassName: r,
    style: N
  } = o, x = y(o, ["prefixCls", "preview", "className", "rootClassName", "style"]), {
    getPrefixCls: p,
    locale: b = v,
    getPopupContainer: O,
    image: s
  } = a.useContext(D), i = p("image", n), f = p(), m = b.Image || v.Image, g = $(i), [P, u, w] = R(i, g), I = C(r, u, w, g), j = C(e, u, s == null ? void 0 : s.className), [S] = V("ImagePreview", typeof t == "object" ? t.zIndex : void 0), h = a.useMemo(() => {
    if (t === !1)
      return t;
    const l = typeof t == "object" ? t : {}, {
      getContainer: _
    } = l, T = y(l, ["getContainer"]);
    return Object.assign(Object.assign({
      mask: /* @__PURE__ */ a.createElement("div", {
        className: `${i}-mask-info`
      }, /* @__PURE__ */ a.createElement(k, null), m == null ? void 0 : m.preview),
      icons: G
    }, T), {
      getContainer: _ || O,
      transitionName: d(f, "zoom", l.transitionName),
      maskTransitionName: d(f, "fade", l.maskTransitionName),
      zIndex: S
    });
  }, [t, m]), E = Object.assign(Object.assign({}, s == null ? void 0 : s.style), N);
  return P(/* @__PURE__ */ a.createElement(z, Object.assign({
    prefixCls: i,
    preview: h,
    rootClassName: I,
    className: j,
    style: E
  }, x)));
};
c.PreviewGroup = L;
process.env.NODE_ENV !== "production" && (c.displayName = "Image");
const W = c;
export {
  W as default
};
