'use strict';

var _electron = require('electron');

const { POI_VERSION, getStore, isMain } = window;

function _ref(plugin) {
  return plugin.enabled;
}

function _ref2(plugin) {
  return `${plugin.id}@${plugin.version}`;
}

function _ref3() {
  const PLUGINS = getStore('plugins') || [];
  const FCD = getStore('fcd.version') || {};

  const pluginMessage = PLUGINS.filter(_ref).map(_ref2).join(', ');

  const fcdMessage = Object.keys(FCD).map(key => `${key}@${FCD[key]}`).join(', ');

  // eslint-disable-next-line no-console
  console.log(`%cThis is poi@${POI_VERSION} on ${process.platform} ${process.arch} with Electron@${process.versions.electron},
        PLUGINS: ${pluginMessage},
        FCD: ${fcdMessage}`, 'font-size: 120%');
}

if (isMain) {
  _electron.remote.getCurrentWebContents().addListener('devtools-opened', _ref3);
}