'use strict'
!(function(require, directRequire) {
  const a = require('react')
  module.exports = class extends a.Component {
    constructor(a) {
      if ((super(a), !this.props.items))
        throw new TypeError(
          'Subpackge Popover component: attribute "items" must be provided'
        )
      this.state = {}
    }
    onClick(a) {
      a.stopPropagation()
    }
    onCancel() {
      this.props.onCancel && this.props.onCancel()
    }
    render() {
      const b = (this.props.items || []).map(b => {
          return a.createElement(
            'div',
            { className: 'packages-item', key: b.name },
            a.createElement('h4', { className: 'packages-item-name' }, b.name),
            a.createElement('p', { className: 'packages-item-size' }, b.size)
          )
        }),
        c = { WebkitAppRegion: 'no-drag', position: 'absolute' }
      return (
        ['left', 'top'].forEach(a => {
          this.props.hasOwnProperty(a) && (c[a] = this.props[a])
        }),
        a.createElement(
          'div',
          { className: 'ui-popover', style: c, onClick: this.onClick },
          a.createElement(
            'div',
            { className: 'packages' },
            a.createElement(
              'div',
              { className: 'packages-hd ui-flex' },
              a.createElement(
                'h3',
                { className: 'packages-title ui-flex-item' },
                this.props.title
              ),
              a.createElement(
                'div',
                { className: 'packages-hd-ext' },
                a.createElement('i', {
                  className: 'ui-icon-notify-close',
                  onClick: this.onCancel.bind(this)
                })
              )
            ),
            a.createElement(
              'div',
              { className: 'packages-bd' },
              a.createElement('div', { className: 'packages-list' }, b)
            )
          )
        )
      )
    }
  }
})(require('lazyload'), require)
