import { CARD_MOTION_SIZES as o } from "./index-CardMotion.constants.js";
const d = "linear(0, 0.024, 0.087, 0.194, 0.352, 0.604, 0.789, 0.923, 1.012, 1.04, 1.027, 1.008, 1)", l = {
  opacity: 0,
  y: o.genericEntryOffsetY,
  scale: 1,
  blur: 0,
  duration: 0.32,
  delay: 0
}, m = {
  opacity: 0,
  y: o.genericLeaveOffsetY,
  scale: 0.985,
  blur: o.genericLeaveBlur,
  duration: 0.2,
  delay: 0
}, s = {
  y: o.glowEntryOffsetY,
  scale: o.glowEntryScale,
  skewX: o.glowEntrySkewX,
  skewY: o.glowEntrySkewY,
  brightness: 1.08,
  glowAlpha: 1,
  radiusFrom: o.glowEntryRadiusFrom,
  radiusTo: o.glowEntryRadiusTo,
  duration: 1,
  delay: 0,
  contentDelay: 0.25,
  contentDuration: 0.35
}, f = {
  y: o.hoverLiftY,
  scale: 1,
  tension: 400,
  friction: 40
}, u = (r) => {
  if (!r)
    return r;
  const {
    background: n,
    backgroundColor: i,
    ...c
  } = r;
  return c;
}, w = (r) => {
  if (r === void 0)
    return {
      skewX: s.skewX,
      skewY: s.skewY
    };
  const n = 1 / Math.max(1, r);
  return {
    skewX: o.glowMaxSkewX * n,
    skewY: o.glowMaxSkewY * n
  };
}, g = (r, n, i, c, a) => {
  if (r === "glow-in") {
    const t = {
      ...s,
      ...w(c),
      ...a === !1 ? {
        ...s,
        y: 0,
        scale: 1,
        skewX: 0,
        skewY: 0,
        brightness: 1,
        glowAlpha: 0,
        radiusFrom: 12,
        radiusTo: 12,
        duration: 0,
        delay: 0,
        contentDelay: 0,
        contentDuration: 0
      } : a
    };
    return {
      kind: "glow-shell",
      transitionFrom: {
        opacity: 1,
        y: 0,
        scale: 1,
        blur: 0
      },
      transitionEnter: {
        opacity: 1,
        y: 0,
        scale: 1,
        blur: 0
      },
      delayOffset: 0,
      duration: 0,
      shellStyle: {
        ...u(i),
        "--card-motion-delay": `${n + t.delay}s`,
        "--card-motion-duration": `${t.duration}s`,
        "--card-motion-content-delay": `${n + t.contentDelay}s`,
        "--card-motion-content-duration": `${t.contentDuration}s`,
        "--card-motion-ease": d,
        "--card-motion-y-from": `${t.y}px`,
        "--card-motion-scale-from": t.scale,
        "--card-motion-skew-x-from": `${t.skewX}deg`,
        "--card-motion-skew-y-from": `${t.skewY}deg`,
        "--card-motion-radius-from": `${t.radiusFrom}px`,
        "--card-motion-radius-to": `${t.radiusTo}px`,
        "--card-motion-brightness-from": t.brightness,
        "--card-motion-glow-alpha-from": t.glowAlpha,
        "--card-motion-shadow-inset-width": `${o.glowShadowInsetWidth}px`,
        "--card-motion-shadow-offset-y": `${o.glowShadowOffsetY}px`,
        "--card-motion-shadow-blur": `${o.glowShadowBlur}px`,
        "--card-motion-perspective": `${o.transformPerspective}px`,
        "--card-motion-content-blur-from": `${o.contentBlurFrom}px`,
        "--card-motion-content-y-from": `${o.contentOffsetY}px`
      },
      contentStyle: {
        animationDelay: `${n + t.contentDelay}s`,
        animationDuration: `${t.contentDuration}s`
      }
    };
  }
  const e = {
    ...l,
    ...a === !1 ? {
      ...l,
      opacity: 1,
      y: 0,
      scale: 1,
      blur: 0,
      duration: 0,
      delay: 0
    } : a
  };
  return {
    kind: "spring",
    baseStyle: i,
    transitionFrom: {
      opacity: e.opacity,
      y: e.y,
      scale: e.scale,
      blur: e.blur
    },
    transitionEnter: {
      opacity: 1,
      y: 0,
      scale: 1,
      blur: 0
    },
    delayOffset: e.delay,
    duration: e.duration
  };
};
export {
  l as GENERIC_ENTRY,
  m as GENERIC_LEAVE,
  s as GLOW_ENTRY_DEFAULTS,
  f as HOVER_DEFAULTS,
  d as SPRING_EASE_CSS,
  g as getEntryPresetConfig,
  w as getGlowSkewValues,
  u as stripGlowBackground
};
