'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('./3b5f8e2469c474c8d433c1c6926d8999.js'),
    c = require('./59394b696f4be6762ad2b2bf3e1575a7.js'),
    d = require('./a15851ca252a104aad8b3fd3fc114574.js'),
    e = require('./08daeb1466202b05ac4b7f58871f83db.js'),
    f = require('./9fdd4ac31a05c27355910f0d74accd4c.js')
  class g extends a.Component {
    constructor(a) {
      super(a), (this.state = { current: a.current })
    }
    componentDidMount() {}
    componentWillReceiveProps(a) {
      a.show &&
        (a.current == this.props.current ||
          this.setState({ current: a.current }))
    }
    getValue() {
      return this.state.current
    }
    hide() {
      this.props.hidePicker({
        callbackID: this.props.callbackID,
        webviewID: this.props.webviewID,
        res: { errMsg: `${this.props.api}:cancel` }
      })
    }
    confirm() {
      this.props.hidePicker({
        callbackID: this.props.callbackID,
        webviewID: this.props.webviewID,
        res: { errMsg: `${this.props.api}:ok`, current: this.getValue() }
      })
    }
    onPickerSelect(a, b) {
      let c = this.state.current
      ;(c[a] = parseInt(b)),
        this.setState({ current: c }),
        this.props.project.compileType == f.search
          ? e.triggerOnEvent({
              eventName: 'onMultiPickerViewChange',
              data: { column: a, current: b }
            })
          : d.triggerOnEvent({
              webviewID: this.props.webviewID,
              eventName: 'onMultiPickerViewChange',
              data: { column: a, current: b }
            })
    }
    render() {
      let d = this.props,
        e = this.props.array.map((b, d) => {
          return a.createElement(c, {
            key: d,
            array: b,
            current: this.state.current[d],
            onPickerSelect: this.onPickerSelect.bind(this, d)
          })
        })
      return a.createElement(
        'div',
        { style: d.show ? {} : b.displayNone },
        a.createElement('div', {
          className: 'weui-mask weui-animate-fade-in',
          onClick: this.hide.bind(this)
        }),
        a.createElement(
          'div',
          { className: 'weui-picker weui-animate-slide-up' },
          a.createElement(
            'div',
            { className: 'weui-picker__hd' },
            a.createElement(
              'a',
              {
                className: 'weui-picker__action',
                onClick: this.hide.bind(this)
              },
              '\u53D6\u6D88'
            ),
            a.createElement(
              'a',
              {
                className: 'weui-picker__action',
                onClick: this.confirm.bind(this)
              },
              '\u786E\u5B9A'
            )
          ),
          a.createElement('div', { className: 'weui-picker__bd' }, e)
        )
      )
    }
  }
  module.exports = g
})(require('lazyload'), require)
