/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ({

/***/ "../src/main.ts":
/*!**********************!*\
  !*** ../src/main.ts ***!
  \**********************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst electron_1 = __webpack_require__(/*! electron */ \"electron\");\nconst path = __webpack_require__(/*! path */ \"path\");\nconst url = __webpack_require__(/*! url */ \"url\");\nconst fs = __webpack_require__(/*! fs */ \"fs\");\nlet settings = JSON.parse(fs.readFileSync(`${__dirname}/settings.json`, { encoding: 'utf8' }));\nif (process.env.TARGET && process.env.TARGET === 'test') {\n    electron_1.app.disableHardwareAcceleration();\n}\nelectron_1.ipcMain.on('api', (event, msg) => {\n    const req = JSON.parse(msg);\n    if (!req.options) {\n        req.options = {};\n    }\n    if (!req.options.method) {\n        req.options.method = 'get';\n    }\n    if (req.endpoint === '/backup') {\n        fs.writeFile(req.options.body.fileName, req.options.body.pk, { encoding: 'utf8' }, (err) => {\n            event.sender.send('api-reply', JSON.stringify({ req: msg, res: { err } }));\n        });\n    }\n    else if (req.endpoint === '/readFile') {\n        const file = fs.readFileSync(req.options.body.fileName, { encoding: 'utf8' });\n        event.sender.send('api-reply', JSON.stringify({ req: msg, res: { file } }));\n    }\n    else if (req.endpoint === '/saveAs') {\n        fs.writeFile(req.options.body.fileName, req.options.body.data, { encoding: 'utf8' }, (err) => {\n            // TODO handling\n        });\n    }\n    else if (req.endpoint === '/localSettings') {\n        if (req.options.method === 'get') {\n            event.sender.send('api-reply', JSON.stringify({ req: msg, res: settings }));\n        }\n        else {\n            settings = req.options.body;\n            fs.writeFileSync(`${__dirname}/settings.json`, JSON.stringify(settings, null, 4));\n            event.sender.send('api-reply', JSON.stringify({ req: msg, res: {} }));\n        }\n    }\n});\n// Keep a global reference of the window object, if you don't, the window will\n// be closed automatically when the JavaScript object is garbage collected.\nlet win = null;\nfunction createWindow() {\n    // Create the browser window.\n    let options = {\n        width: 800,\n        height: 600,\n        icon: path.join(__dirname, 'icon_64.png')\n    };\n    win = new electron_1.BrowserWindow(options);\n    // and load the index.html of the app.\n    win.loadURL(url.format({\n        pathname: path.join(__dirname, 'index.html'),\n        protocol: 'file:',\n        slashes: true\n    }));\n    // Open the DevTools.\n    if (process.env.TARGET === 'dev') {\n        win.webContents.openDevTools();\n    }\n    win.maximize();\n    // Emitted when the window is closed.\n    win.on('closed', () => {\n        // Dereference the window object, usually you would store windows\n        // in an array if your app supports multi windows, this is the time\n        // when you should delete the corresponding element.\n        win = null;\n        electron_1.app.quit();\n    });\n}\n// This method will be called when Electron has finished\n// initialization and is ready to create browser windows.\n// Some APIs can only be used after this event occurs.\nelectron_1.app.on('ready', createWindow);\n// Quit when all windows are closed.\nelectron_1.app.on('window-all-closed', () => {\n    // On macOS it is common for applications and their menu bar\n    // to stay active until the user quits explicitly with Cmd + Q\n    if (process.platform !== 'darwin') {\n        electron_1.app.quit();\n    }\n});\nelectron_1.app.on('activate', () => {\n    // On macOS it's common to re-create a window in the app when the\n    // dock icon is clicked and there are no other windows open.\n    if (win === null) {\n        createWindow();\n    }\n});\n// In this file you can include the rest of your app's specific main process\n// code. You can also put them in separate files and require them here.\n\n\n//# sourceURL=webpack:///../src/main.ts?");

/***/ }),

/***/ 0:
/*!****************************!*\
  !*** multi ../src/main.ts ***!
  \****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

eval("module.exports = __webpack_require__(/*! ../src/main.ts */\"../src/main.ts\");\n\n\n//# sourceURL=webpack:///multi_../src/main.ts?");

/***/ }),

/***/ "electron":
/*!***************************!*\
  !*** external "electron" ***!
  \***************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("module.exports = require(\"electron\");\n\n//# sourceURL=webpack:///external_%22electron%22?");

/***/ }),

/***/ "fs":
/*!*********************!*\
  !*** external "fs" ***!
  \*********************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("module.exports = require(\"fs\");\n\n//# sourceURL=webpack:///external_%22fs%22?");

/***/ }),

/***/ "path":
/*!***********************!*\
  !*** external "path" ***!
  \***********************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("module.exports = require(\"path\");\n\n//# sourceURL=webpack:///external_%22path%22?");

/***/ }),

/***/ "url":
/*!**********************!*\
  !*** external "url" ***!
  \**********************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("module.exports = require(\"url\");\n\n//# sourceURL=webpack:///external_%22url%22?");

/***/ })

/******/ });