"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var React = _interopRequireWildcard(require("react"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/Animate/Animate.tsx",
  _this = void 0;
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/** Animate Component */
var getDelayValue = delay => {
  switch (typeof delay) {
    case 'string':
      return delay;
    case 'number':
      return "".concat(delay, "ms");
    default:
      return undefined;
  }
};
var Animate = /*#__PURE__*/React.forwardRef(function () {
  var {
    dataHook,
    animateClasses,
    delay,
    onStart,
    onEnd,
    children,
    animateInlineStyle
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
    children: undefined
  };
  var ref = arguments.length > 1 ? arguments[1] : undefined;
  return /*#__PURE__*/React.createElement("div", {
    "data-hook": dataHook,
    className: animateClasses,
    style: _objectSpread({
      animationDelay: getDelayValue(delay)
    }, animateInlineStyle),
    onAnimationStart: onStart,
    onAnimationEnd: onEnd,
    ref: ref,
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 5
    }
  }, children && React.Children.only(children));
});
Animate.displayName = 'Animate';
var _default = exports.default = Animate;
//# sourceMappingURL=Animate.js.map