import { jsx as t, Fragment as s } from "react/jsx-runtime";
import "react";
import { a as p } from "./index-react-spring_web.modern.js";
import { useTransition as v, config as g } from "./index-react-spring_core.modern.js";
const X = (l) => {
  const {
    children: r,
    if: a,
    condition: e,
    animation: n = "fade",
    className: i
  } = l, o = {
    none: {},
    fade: {
      from: {
        opacity: 0
      },
      enter: {
        opacity: 1
      },
      leave: {
        opacity: 0
      }
    },
    slide: {
      from: {
        transform: "translate3d(-100%,0,0)"
      },
      enter: {
        transform: "translate3d(0%,0,0)"
      },
      leave: {
        transform: "translate3d(100%,0,0)"
      }
    },
    zoom: {
      from: {
        transform: "scale(0)"
      },
      enter: {
        transform: "scale(1)"
      },
      leave: {
        transform: "scale(0)"
      }
    },
    flip: {
      from: {
        transform: "rotateX(-180deg)"
      },
      enter: {
        transform: "rotateX(0)"
      },
      leave: {
        transform: "rotateX(180deg)"
      }
    },
    rotate: {
      from: {
        transform: "rotate(-360deg)"
      },
      enter: {
        transform: "rotate(0deg)"
      },
      leave: {
        transform: "rotate(360deg)"
      }
    },
    slideRight: {
      from: {
        transform: "translateX(-100%)"
      },
      enter: {
        transform: "translateX(0%)"
      },
      leave: {
        transform: "translateX(100%)"
      }
    },
    slideUp: {
      from: {
        transform: "translateY(100%)"
      },
      enter: {
        transform: "translateY(0%)"
      },
      leave: {
        transform: "translateY(-100%)"
      }
    },
    slideDown: {
      from: {
        transform: "translateY(-100%)"
      },
      enter: {
        transform: "translateY(0%)"
      },
      leave: {
        transform: "translateY(100%)"
      }
    },
    scale: {
      from: {
        transform: "scale(0.5)",
        opacity: 0
      },
      enter: {
        transform: "scale(1)",
        opacity: 1
      },
      leave: {
        transform: "scale(0.5)",
        opacity: 0
      }
    },
    bounce: {
      from: {
        transform: "translateY(-100%)"
      },
      enter: {
        transform: "translateY(0%)"
      },
      leave: {
        transform: "translateY(100%)"
      },
      config: g.wobbly
    }
  }, m = o[n] || o.none, f = v(e || a, {
    ...m,
    keys: null
  });
  return n === "none" ? e || a ? t(s, {
    children: r
  }) : t(s, {
    children: null
  }) : t("div", {
    style: {
      position: "relative"
    },
    children: f((c, d) => d ? t(p.div, {
      className: i,
      style: {
        ...c,
        position: "absolute",
        width: "100%",
        height: "100%"
        // Ensure it covers the container
      },
      children: r
    }) : null)
  });
};
export {
  X as AnimatedSwitchConditional
};
