'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('redux'),
    c = require('./ActionSheet.js'),
    d = require('./ba23d8b47b1f4ea08b9fd49939b9443f.js'),
    e = require('./a1dd553cc059d528bb0ef56afed53968.js'),
    f = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js'),
    { connect: g } = require('react-redux')
  class h extends a.Component {
    constructor(a) {
      super(a)
    }
    onSelect(a) {
      let b = this.props
      if (0 == a && b.shareBtnState.show) {
        let a = {
          path: b.appConfig.pages[0],
          dynamic: !!b.shareBtnState.isDynamic,
          mode: b.shareBtnState.withShareTicket ? 'withShareTicket' : 'common'
        }
        const c = global.windowMap.get('MAIN'),
          d = c.window.document.querySelector(
            `.htmlwebview${b.currentWebviewID}`
          )
        d && (a.webViewUrl = d.src),
          e.triggerOnEvent({
            eventName: 'onShareAppMessage',
            data: a,
            webviewID: b.currentWebviewID
          })
      } else 1 == a && b.showBackToHome && this.props.relaunchToIndexPage()
      this.hide()
    }
    onCancel() {
      this.hide()
    }
    onMaskClick() {
      this.hide()
    }
    hide() {
      this.props.setRightBtnActionSheet({ show: !1 })
    }
    render() {
      let b = this.props
      return a.createElement(c, {
        show: b.show,
        itemList: b.itemList,
        cancelColor: b.cancelColor,
        cancelText: b.cancelText,
        itemColor: b.itemColor,
        onSelect: this.onSelect.bind(this),
        onCancel: this.onCancel.bind(this),
        onMaskClick: this.onMaskClick.bind(this)
      })
    }
  }
  module.exports = g(
    a => {
      let b = a.simulator.rightBtnActionSheet,
        c = a.simulator.currentWebviewID,
        d = a.simulator.webviewInfos[c] || {},
        e = d.shareBtnState || {},
        f = (a.project.current || {}).libVersion || '1.7.0',
        g = d.home,
        h = b.show,
        i = 170 <= parseInt(f.replace(/\./g, '')) && g,
        j = e.show
          ? ['\u8F6C\u53D1']
          : ['\u5F53\u524D\u9875\u9762\u672A\u8BBE\u7F6E\u5206\u4EAB']
      i && j.push('\u56DE\u5230\u9996\u9875')
      let k = a.htmlwebview
      return {
        show: h,
        showBackToHome: i,
        currentWebviewID: c,
        shareBtnState: e,
        itemList: j,
        appConfig: a.simulator.appConfig || {},
        cancelText: '\u53D6\u6D88',
        cancelColor: '#000000',
        itemColor: '#000000',
        alertIndex: -1,
        htmlwebview: k
      }
    },
    a => {
      return {
        setRightBtnActionSheet: f.bindActionCreators(
          d.setRightBtnActionSheet,
          a
        ),
        relaunchToIndexPage: f.bindActionCreators(d.reLaunchToIndexPage, a)
      }
    }
  )(h)
})(require('lazyload'), require)
