import e from"../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";import n from"../../@babel/runtime/helpers/esm/inheritsLoose.js";import r from"../../prop-types/index.js";import t from"react";import o from"../../react-dom/index.js";import i from"./TransitionGroup.js";var l=function(r){function l(){for(var e,n=arguments.length,t=new Array(n),o=0;o<n;o++)t[o]=arguments[o];return(e=r.call.apply(r,[this].concat(t))||this).handleEnter=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onEnter",0,r)},e.handleEntering=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onEntering",0,r)},e.handleEntered=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onEntered",0,r)},e.handleExit=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onExit",1,r)},e.handleExiting=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onExiting",1,r)},e.handleExited=function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];return e.handleLifecycle("onExited",1,r)},e}n(l,r);var a=l.prototype;return a.handleLifecycle=function(e,n,r){var i,l=this.props.children,a=t.Children.toArray(l)[n];if(a.props[e]&&(i=a.props)[e].apply(i,r),this.props[e]){var d=a.props.nodeRef?void 0:o.findDOMNode(this);this.props[e](d)}},a.render=function(){var n=this.props,r=n.children,o=n.in,l=e(n,["children","in"]),a=t.Children.toArray(r),d=a[0],h=a[1];return delete l.onEnter,delete l.onEntering,delete l.onEntered,delete l.onExit,delete l.onExiting,delete l.onExited,t.createElement(i,l,o?t.cloneElement(d,{key:"first",onEnter:this.handleEnter,onEntering:this.handleEntering,onEntered:this.handleEntered}):t.cloneElement(h,{key:"second",onEnter:this.handleExit,onEntering:this.handleExiting,onEntered:this.handleExited}))},l}(t.Component);l.propTypes="production"!==process.env.NODE_ENV?{in:r.bool.isRequired,children:function(e,n){return 2!==t.Children.count(e[n])?new Error('"'+n+'" must be exactly two transition components.'):null}}:{};var a=l;export{a as default};
//# sourceMappingURL=ReplaceTransition.js.map
