import { NotificationPlacements as i } from "../interface.mjs";
const a = {
  topLeft: "left",
  topRight: "right",
  bottomLeft: "left",
  bottomRight: "right",
  top: "left",
  bottom: "left"
}, c = (t, o) => {
  const {
    componentCls: n
  } = t;
  return {
    [`${n}-${o}`]: {
      [`&${n}-stack > ${n}-notice-wrapper`]: {
        [o.startsWith("top") ? "top" : "bottom"]: 0,
        [a[o]]: {
          value: 0,
          _skip_check_: !0
        }
      }
    }
  };
}, r = (t) => {
  const o = {};
  for (let n = 1; n < t.notificationStackLayer; n++)
    o[`&:nth-last-child(${n + 1})`] = {
      overflow: "hidden",
      [`& > ${t.componentCls}-notice`]: {
        opacity: 0,
        transition: `opacity ${t.motionDurationMid}`
      }
    };
  return Object.assign({
    [`&:not(:nth-last-child(-n+${t.notificationStackLayer}))`]: {
      opacity: 0,
      overflow: "hidden",
      color: "transparent",
      pointerEvents: "none"
    }
  }, o);
}, s = (t) => {
  const o = {};
  for (let n = 1; n < t.notificationStackLayer; n++)
    o[`&:nth-last-child(${n + 1})`] = {
      background: t.colorBgBlur,
      backdropFilter: "blur(10px)",
      "-webkit-backdrop-filter": "blur(10px)"
    };
  return Object.assign({}, o);
}, l = (t) => {
  const {
    componentCls: o
  } = t;
  return Object.assign({
    [`${o}-stack`]: {
      [`& > ${o}-notice-wrapper`]: Object.assign({
        transition: `all ${t.motionDurationSlow}, backdrop-filter 0s`,
        position: "absolute"
      }, r(t))
    },
    [`${o}-stack:not(${o}-stack-expanded)`]: {
      [`& > ${o}-notice-wrapper`]: Object.assign({}, s(t))
    },
    [`${o}-stack${o}-stack-expanded`]: {
      [`& > ${o}-notice-wrapper`]: {
        "&:not(:nth-last-child(-n + 1))": {
          opacity: 1,
          overflow: "unset",
          color: "inherit",
          pointerEvents: "auto",
          [`& > ${t.componentCls}-notice`]: {
            opacity: 1
          }
        },
        "&:after": {
          content: '""',
          position: "absolute",
          height: t.margin,
          width: "100%",
          insetInline: 0,
          bottom: t.calc(t.margin).mul(-1).equal(),
          background: "transparent",
          pointerEvents: "auto"
        }
      }
    }
  }, i.map((n) => c(t, n)).reduce((n, e) => Object.assign(Object.assign({}, n), e), {}));
}, d = l;
export {
  d as default
};
