import e from"../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";import t from"../../@babel/runtime/helpers/esm/extends.js";import n from"../../@babel/runtime/helpers/esm/assertThisInitialized.js";import r from"../../@babel/runtime/helpers/esm/inheritsLoose.js";import o from"../../prop-types/index.js";import i from"react";import s from"./TransitionGroupContext.js";import{getInitialChildMapping as l,getNextChildMapping as p,getChildMapping as a}from"./utils/ChildMapping.js";var c=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},d=function(o){function d(e,t){var r,i=(r=o.call(this,e,t)||this).handleExited.bind(n(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}r(d,o);var u=d.prototype;return u.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},u.componentWillUnmount=function(){this.mounted=!1},d.getDerivedStateFromProps=function(e,t){var n=t.children,r=t.handleExited;return{children:t.firstRender?l(e,r):p(e,n,r),firstRender:!1}},u.handleExited=function(e,n){var r=a(this.props.children);e.key in r||(e.props.onExited&&e.props.onExited(n),this.mounted&&this.setState((function(n){var r=t({},n.children);return delete r[e.key],{children:r}})))},u.render=function(){var t=this.props,n=t.component,r=t.childFactory,o=e(t,["component","childFactory"]),l=this.state.contextValue,p=c(this.state.children).map(r);return delete o.appear,delete o.enter,delete o.exit,null===n?i.createElement(s.Provider,{value:l},p):i.createElement(s.Provider,{value:l},i.createElement(n,o,p))},d}(i.Component);d.propTypes="production"!==process.env.NODE_ENV?{component:o.any,children:o.node,appear:o.bool,enter:o.bool,exit:o.bool,childFactory:o.func}:{},d.defaultProps={component:"div",childFactory:function(e){return e}};export default d;
//# sourceMappingURL=TransitionGroup.js.map
