'use strict'
!(function(require, directRequire) {
  const a = require('react'),
    b = require('./3b5f8e2469c474c8d433c1c6926d8999.js'),
    c = require('./3bfffbe88b3d923921f851c0697974fe.js'),
    d = require('./NavigationBar.js'),
    e = require('./4389a88e405d1d37f36c16fc0ec96540.js'),
    {
      enterBackground: f,
      enterForeground: g
    } = require('./a3959bb900db9f65ed2e9c5dfa6977b7.js')
  class h extends a.Component {
    constructor(a) {
      super(a), (this.state = { scopeList: a.scopeList })
    }
    componentDidMount() {
      f('setting')
    }
    componentWillUnmount() {
      g('setting')
    }
    componentWillReceiveProps(a) {
      let b = {}
      a.scopeList != this.props.scopeList && (b.scopeList = a.scopeList),
        this.setState(b)
    }
    checkboxChange(a) {
      var b = this.state.scopeList
      return () => {
        ;(b[a].state = 1 == b[a].state ? 2 : 1), this.setState({ scopeList: b })
      }
    }
    onLeftBtnClick() {
      let a = this.props
      a.hideSetting({
        scopeList: this.state.scopeList,
        api: a.api,
        callbackID: a.callbackID
      })
    }
    render() {
      let b,
        c = this.props,
        f = this.state.scopeList || [],
        g = f.map((b, c) => {
          let d = 1 == b.state
          return a.createElement(
            'div',
            { className: 'weui-cell weui-cell_switch', key: b.scope },
            a.createElement(
              'div',
              { className: 'weui-cell__bd' },
              b.scope_desc
            ),
            a.createElement(
              'div',
              { className: 'weui-cell__ft' },
              a.createElement('input', {
                className: 'weui-switch auto_test_switch',
                type: 'checkbox',
                checked: d,
                onChange: this.checkboxChange(c)
              })
            )
          )
        })
      return (
        (b = global.onlySimulator
          ? {
              top: 0,
              left: 0,
              display: c.show ? '' : 'none',
              width: c.screenWidth,
              height: c.screenHeight,
              transform: `scale(${c.deviceScale})`,
              transformOrigin: '50% 0'
            }
          : {
              display: c.show ? '' : 'none',
              width: c.screenWidth,
              height: c.screenHeight,
              marginLeft: -c.screenWidth / 2,
              transform: `scale(${c.deviceScale})`,
              transformOrigin: '50% 0'
            }),
        a.createElement(
          'div',
          { className: 'simulator', style: b },
          a.createElement(e, null),
          a.createElement(d, {
            height: c.navigationbarHeight,
            backgroundColor: '#efeff4',
            frontColor: '#000000',
            showLeftBtn: !0,
            title: '\u8BBE\u7F6E',
            onLeftBtnClick: this.onLeftBtnClick.bind(this)
          }),
          a.createElement(
            'div',
            { className: 'webview' },
            a.createElement(
              'div',
              { className: 'user-setting' },
              a.createElement(
                'div',
                { className: 'weui-cells__title' },
                a.createElement(
                  'p',
                  null,
                  '\u5141\u8BB8\u201C',
                  c.appName,
                  '\u201D\u4F7F\u7528\u6211\u7684'
                )
              ),
              a.createElement(
                'div',
                { className: 'weui-cells weui-cells_form' },
                g
              )
            )
          )
        )
      )
    }
  }
  module.exports = h
})(require('lazyload'), require)
