'use strict'
!(function(require, directRequire) {
  function a() {
    let a = new Date(),
      b = a.getHours(),
      c = a.getMinutes()
    return (c = 9 < c ? c : `0${c}`), { minute: c, hour: b }
  }
  const b = require('react'),
    c = require('classnames'),
    d = require('./56c390e04c10e91a4aa2a2c19d9a885d.js')
  class e extends b.Component {
    constructor(b) {
      super(b)
      let c = new Date(),
        { hour: d, minute: e } = a()
      ;(this.state = { level: 100, hour: d, minute: e }),
        (this.batteryTimer = null)
    }
    componentDidMount() {
      let b = () => {
        navigator.getBattery().then(b => {
          let c = parseInt(100 * b.level),
            { hour: d, minute: e } = a()
          this.setState({ level: c, hour: d, minute: e })
        })
      }
      ;(this.batteryTimer = setInterval(b, 30000)), b()
    }
    componentWillUnmount() {
      clearInterval(this.batteryTimer)
    }
    renderIphoneXStatusBar() {
      let a = this.props,
        d = new Date(),
        e = d.getHours(),
        f = d.getMinutes()
      return (
        (f = 9 < f ? f : `0${f}`),
        b.createElement(
          'div',
          {
            className: c('system-status-bar ui-flex', {
              'system-status-bar-white': 'black' != a.titleStyle,
              'system-status-bar-black': 'black' == a.titleStyle
            }),
            style: {
              backgroundColor:
                a.useCapsuleNavigationBar && a.customNavigationBar
                  ? 'transparent'
                  : a.backgroundColor ||
                    (a.useCapsuleNavigationBar ? '#3267CA' : '#000000'),
              height: a.height,
              transition: a.transition,
              zIndex: 10,
              pointerEvents:
                a.useCapsuleNavigationBar && a.customNavigationBar
                  ? 'none'
                  : void 0
            }
          },
          b.createElement('div', null, b.createElement('p', null, e, ':', f)),
          b.createElement(
            'div',
            null,
            b.createElement(
              'span',
              { className: 'system-status-battery' },
              this.state.level,
              '%'
            ),
            b.createElement(
              'span',
              null,
              b.createElement(
                'div',
                { className: 'ui-icon-battery' },
                b.createElement('i', {
                  style: { width: `${this.state.level}%` }
                })
              )
            )
          )
        )
      )
    }
    render() {
      let a = this.props
      if (a.iphoneX) return this.renderIphoneXStatusBar()
      let e = new Date(),
        f = e.getHours(),
        g = e.getMinutes()
      return (
        (g = 9 < g ? g : `0${g}`),
        b.createElement(
          'div',
          {
            className: c('system-status-bar ui-flex', {
              'system-status-bar-white': 'black' != a.titleStyle,
              'system-status-bar-black': 'black' == a.titleStyle
            }),
            style: {
              backgroundColor:
                a.useCapsuleNavigationBar && a.customNavigationBar
                  ? 'transparent'
                  : a.backgroundColor ||
                    (a.useCapsuleNavigationBar ? '#3267CA' : '#000000'),
              height: a.height,
              transition: a.transition,
              zIndex: 10,
              pointerEvents:
                a.useCapsuleNavigationBar && a.customNavigationBar
                  ? 'none'
                  : void 0
            }
          },
          b.createElement(
            'div',
            null,
            'none' == a.networkType
              ? null
              : b.createElement(
                  'span',
                  null,
                  b.createElement('i', { className: 'ui-icon-signal' })
                ),
            b.createElement(
              'span',
              { style: { position: 'relative' } },
              ' WeChat '
            ),
            b.createElement(
              'span',
              { style: { position: 'relative' } },
              'wifi' == a.networkType
                ? b.createElement('i', { className: 'ui-icon-wifi' })
                : d.NETWORK_STATUS_DISPLAY[a.networkType]
            )
          ),
          b.createElement(
            'div',
            { className: 'system-status-time' },
            b.createElement('p', null, f, ':', g)
          ),
          b.createElement(
            'div',
            null,
            b.createElement(
              'span',
              { className: 'system-status-battery' },
              this.state.level,
              '%'
            ),
            b.createElement(
              'span',
              null,
              b.createElement(
                'div',
                { className: 'ui-icon-battery' },
                b.createElement('i', {
                  style: { width: `${this.state.level}%` }
                })
              )
            )
          )
        )
      )
    }
  }
  module.exports = e
})(require('lazyload'), require)
