Object.defineProperty(exports, '__esModule', {
  value: true
});

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

/** @babel */
/** @jsx etch.dom */
/* eslint-disable react/no-unknown-property */

var _atom = require('atom');

var _etch = require('etch');

var _etch2 = _interopRequireDefault(_etch);

var _shell = require('shell');

var _shell2 = _interopRequireDefault(_shell);

var _atomLogo = require('./atom-logo');

var _atomLogo2 = _interopRequireDefault(_atomLogo);

var _etchComponent = require('../etch-component');

var _etchComponent2 = _interopRequireDefault(_etchComponent);

var _updateView = require('./update-view');

var _updateView2 = _interopRequireDefault(_updateView);

var AboutView = (function (_EtchComponent) {
  _inherits(AboutView, _EtchComponent);

  function AboutView() {
    _classCallCheck(this, AboutView);

    _get(Object.getPrototypeOf(AboutView.prototype), 'constructor', this).apply(this, arguments);
  }

  _createClass(AboutView, [{
    key: 'handleVersionClick',
    value: function handleVersionClick(e) {
      e.preventDefault();
      atom.clipboard.write(this.props.currentVersion);
    }
  }, {
    key: 'handleReleaseNotesClick',
    value: function handleReleaseNotesClick(e) {
      e.preventDefault();
      _shell2['default'].openExternal(this.props.updateManager.getReleaseNotesURLForAvailableVersion());
    }
  }, {
    key: 'handleLicenseClick',
    value: function handleLicenseClick(e) {
      e.preventDefault();
      atom.commands.dispatch(atom.views.getView(atom.workspace), 'application:open-license');
    }
  }, {
    key: 'handleTermsOfUseClick',
    value: function handleTermsOfUseClick(e) {
      e.preventDefault();
      _shell2['default'].openExternal('https://help.github.com/articles/github-terms-of-service');
    }
  }, {
    key: 'render',
    value: function render() {
      return _etch2['default'].dom(
        'div',
        { className: 'pane-item native-key-bindings about' },
        _etch2['default'].dom(
          'div',
          { className: 'about-container' },
          _etch2['default'].dom(
            'header',
            { className: 'about-header' },
            _etch2['default'].dom(
              'a',
              { className: 'about-atom-io', href: 'https://atom.io/' },
              _etch2['default'].dom(_atomLogo2['default'], null)
            ),
            _etch2['default'].dom(
              'div',
              { className: 'about-header-info' },
              _etch2['default'].dom(
                'span',
                { className: 'about-version-container inline-block', onclick: this.handleVersionClick.bind(this) },
                _etch2['default'].dom(
                  'span',
                  { className: 'about-version' },
                  this.props.currentVersion,
                  ' ',
                  process.arch
                ),
                _etch2['default'].dom('span', { className: 'icon icon-clippy about-copy-version' })
              ),
              _etch2['default'].dom(
                'a',
                { className: 'about-header-release-notes', onclick: this.handleReleaseNotesClick.bind(this) },
                'Release Notes'
              )
            )
          ),
          _etch2['default'].dom(_updateView2['default'], { updateManager: this.props.updateManager, availableVersion: this.props.availableVersion, viewUpdateReleaseNotes: this.handleReleaseNotesClick.bind(this) }),
          _etch2['default'].dom(
            'div',
            { className: 'about-actions group-item' },
            _etch2['default'].dom(
              'div',
              { className: 'btn-group' },
              _etch2['default'].dom(
                'button',
                { className: 'btn view-license', onclick: this.handleLicenseClick.bind(this) },
                'License'
              ),
              _etch2['default'].dom(
                'button',
                { className: 'btn terms-of-use', onclick: this.handleTermsOfUseClick.bind(this) },
                'Terms of Use'
              )
            )
          ),
          _etch2['default'].dom(
            'div',
            { className: 'about-love group-start' },
            _etch2['default'].dom('span', { className: 'icon icon-code' }),
            _etch2['default'].dom(
              'span',
              { className: 'inline' },
              ' with '
            ),
            _etch2['default'].dom('span', { className: 'icon icon-heart' }),
            _etch2['default'].dom(
              'span',
              { className: 'inline' },
              ' by '
            ),
            _etch2['default'].dom('a', { className: 'icon icon-logo-github', href: 'https://github.com' })
          ),
          _etch2['default'].dom(
            'div',
            { className: 'about-credits group-item' },
            _etch2['default'].dom(
              'span',
              { className: 'inline' },
              'And the awesome '
            ),
            _etch2['default'].dom(
              'a',
              { href: 'https://github.com/atom/atom/contributors' },
              'Atom Community'
            )
          )
        )
      );
    }
  }, {
    key: 'serialize',
    value: function serialize() {
      return {
        deserializer: this.constructor.name,
        uri: this.props.uri
      };
    }
  }, {
    key: 'onDidChangeTitle',
    value: function onDidChangeTitle() {
      return new _atom.Disposable();
    }
  }, {
    key: 'onDidChangeModified',
    value: function onDidChangeModified() {
      return new _atom.Disposable();
    }
  }, {
    key: 'getTitle',
    value: function getTitle() {
      return 'About';
    }
  }, {
    key: 'getIconName',
    value: function getIconName() {
      return 'info';
    }
  }]);

  return AboutView;
})(_etchComponent2['default']);

exports['default'] = AboutView;
module.exports = exports['default'];
//# sourceMappingURL=data:application/json;charset=utf-8;base64, 