import t from"../../@babel/runtime/helpers/esm/defineProperty.js";import e from"../../@babel/runtime/helpers/esm/extends.js";import n from"../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js";import i from"../../@babel/runtime/helpers/esm/assertThisInitialized.js";import r from"../../@babel/runtime/helpers/esm/inheritsLoose.js";import o from"react";import s from"../../prop-types/index.js";import a from"../../classnames/index.js";import p from"../node_modules/react-transition-group/index.js";import{TransitionStatuses as c,mapToCssModules as l,tagPropType as m,TransitionTimeouts as u}from"./utils.js";function E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function d(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?E(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):E(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var h=function(t){function s(e){var n;return(n=t.call(this,e)||this).state={startAnimation:!1},n.onEnter=n.onEnter.bind(i(n)),n.onEntering=n.onEntering.bind(i(n)),n.onExit=n.onExit.bind(i(n)),n.onExiting=n.onExiting.bind(i(n)),n.onExited=n.onExited.bind(i(n)),n}r(s,t);var m=s.prototype;return m.onEnter=function(t,e){this.setState({startAnimation:!1}),this.props.onEnter(t,e)},m.onEntering=function(t,e){var n=t.offsetHeight;return this.setState({startAnimation:!0}),this.props.onEntering(t,e),n},m.onExit=function(t){this.setState({startAnimation:!1}),this.props.onExit(t)},m.onExiting=function(t){this.setState({startAnimation:!0}),t.dispatchEvent(new CustomEvent("slide.bs.carousel")),this.props.onExiting(t)},m.onExited=function(t){t.dispatchEvent(new CustomEvent("slid.bs.carousel")),this.props.onExited(t)},m.render=function(){var t=this,i=this.props,r=i.in,s=i.children,m=i.cssModule,u=i.slide,E=i.tag,d=i.className,h=n(i,["in","children","cssModule","slide","tag","className"]);return o.createElement(p.Transition,e({},h,{enter:u,exit:u,in:r,onEnter:this.onEnter,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),(function(e){var n=t.context.direction,i=e===c.ENTERED||e===c.EXITING,r=(e===c.ENTERING||e===c.EXITING)&&t.state.startAnimation&&("right"===n?"carousel-item-left":"carousel-item-right"),p=e===c.ENTERING&&("right"===n?"carousel-item-next":"carousel-item-prev"),u=l(a(d,"carousel-item",i&&"active",r,p),m);return o.createElement(E,{className:u},s)}))},s}(o.Component);h.propTypes=d(d({},p.Transition.propTypes),{},{tag:m,in:s.bool,cssModule:s.object,children:s.node,slide:s.bool,className:s.string}),h.defaultProps=d(d({},p.Transition.defaultProps),{},{tag:"div",timeout:u.Carousel,slide:!0}),h.contextTypes={direction:s.string};export default h;
//# sourceMappingURL=CarouselItem.js.map
