'use strict'
var _extends =
  Object.assign ||
  function(a) {
    for (var b, c = 1; c < arguments.length; c++)
      for (var d in ((b = arguments[c]), b))
        Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d])
    return a
  }
!(function(require, directRequire) {
  const a = require('react'),
    b = require('classnames')
  class c extends a.Component {
    constructor(a) {
      super(a),
        (this.onAnimationEnd = () => {
          'hide' === this.state.animationType
            ? (this.setState({ show: !1 }),
              this.props.onAnimationOut && this.props.onAnimationOut())
            : this.props.onAnimationIn && this.props.onAnimationIn()
        }),
        (this.state = { show: !1, animationType: 'none' })
    }
    componentDidMount() {
      this.props.show && this.setState({ show: !0, animationType: 'show' })
    }
    componentWillReceiveProps(a) {
      if (a.show != this.props.show) {
        let b = { animationType: a.show ? 'show' : 'hide' }
        a.show && (b.show = !0), this.setState(b)
      }
    }
    onContainerClick(a) {
      this.props.onClick && this.props.onClick(a)
    }
    render() {
      const c = this.state,
        d = this.props,
        e = _extends({}, d.style, { display: c.show ? '' : 'none' })
      return a.createElement(
        'div',
        {
          style: e,
          className: b({
            [this.props.inClassName]: 'show' == c.animationType,
            [this.props.outClassName]: 'hide' == c.animationType
          }),
          onAnimationEnd: this.onAnimationEnd,
          onClick: this.onContainerClick.bind(this)
        },
        this.props.children
      )
    }
  }
  module.exports = c
})(require('lazyload'), require)
