import { jsx as n, Fragment as C } from "react/jsx-runtime";
import r, { useState as H } from "react";
import { a as W } from "./index-react-spring_web.modern.js";
import { animationConditionalBaseAnimation as b, animationConditionalgrowHeight as A, animationConditionalGrowWidth as F } from "./index-animated-contitional-animations.js";
const S = (e) => {
  const {
    children: o,
    condition: t,
    animation: i = void 0,
    className: a,
    testId: s
  } = e, {
    fromWidth: l,
    toWidth: d
  } = e, {
    fromHeight: m,
    toHeight: c
  } = e, [f, u] = H(!0), h = (y) => {
    u(y);
  }, g = () => {
    switch (i) {
      case "none":
        return {};
      case "growWidth":
        return F(t ?? !1, l, d);
      case "growHeight":
        return A(t ?? !1, m, c);
      default:
        return b(t ?? !1, h);
    }
  };
  if (i && i === "none")
    return t ? n(r.Fragment, {
      children: o
    }) : n(r.Fragment, {
      children: null
    });
  const w = g();
  return f ? n(W.div, {
    "data-testid": s,
    className: a,
    style: w,
    children: o
  }) : n(C, {
    children: null
  });
};
export {
  S as AnimatedConditional
};
