/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./src/extension.ts":
/*!**************************!*\
  !*** ./src/extension.ts ***!
  \**************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.deactivate = exports.activate = void 0;\r\nconst flashpoint = __webpack_require__(/*! flashpoint-launcher */ \"flashpoint-launcher\");\r\nconst path = __webpack_require__(/*! path */ \"path\");\r\nconst fs = __webpack_require__(/*! fs */ \"fs\");\r\nfunction activate(context) {\r\n    flashpoint.registerDisposable(context.subscriptions, flashpoint.curations.onWillGenCurationWarnings((event) => {\r\n        const { game } = event.curation;\r\n        // Checks for HTTPS and non-existant launch command files\r\n        if (game.launchCommand) {\r\n            const launchWarns = invalidLaunchCommandWarnings(getContentFolder(event.curation.folder), game.launchCommand);\r\n            for (const w of launchWarns) {\r\n                event.warnings.writtenWarnings.push(w);\r\n                event.warnings.fieldWarnings.push('launchCommand');\r\n            }\r\n        }\r\n        // Warn of no notes of Hacked and Partial\r\n        if (game.status && !game.notes) {\r\n            if (game.status.includes('Hacked') || game.status.includes('Partial')) {\r\n                event.warnings.writtenWarnings.push('documentStatus');\r\n                event.warnings.fieldWarnings.push('notes');\r\n            }\r\n        }\r\n    }));\r\n}\r\nexports.activate = activate;\r\n// this method is called when your extension is deactivated (Currently unused)\r\nfunction deactivate() { }\r\nexports.deactivate = deactivate;\r\nfunction getContentFolder(folder) {\r\n    return path.join(flashpoint.curations.getCurationPath(folder), 'content');\r\n}\r\nfunction invalidLaunchCommandWarnings(folderPath, launchCommand) {\r\n    // Keep list of warns for end\r\n    const warns = [];\r\n    // Extract first string from launch command via regex\r\n    const match = launchCommand.match(/[^\\s\"']+|\"([^\"]*)\"|'([^']*)'/);\r\n    if (match) {\r\n        // Match 1 - Inside quotes, Match 0 - No Quotes Found\r\n        let lc = match[1] || match[0];\r\n        // Extract protocol from potential URL\r\n        const protocol = lc.match(/(.+?):\\/\\//);\r\n        if (protocol) {\r\n            // Protocol found, must be URL\r\n            if (protocol[1] !== 'http') {\r\n                // Not using HTTP\r\n                warns.push('ilc_notHttp');\r\n            }\r\n            const ending = lc.split('/').pop();\r\n            // If the string ends in file, cut off parameters\r\n            if (ending && ending.includes('.')) {\r\n                lc = lc.split('?')[0];\r\n            }\r\n            const filePath = path.join(folderPath, unescape(lc).replace(/(^\\w+:|^)\\/\\//, ''));\r\n            // Push a game to the list if its launch command file is missing\r\n            if (!fs.existsSync(filePath)) {\r\n                warns.push('ilc_nonExistant');\r\n            }\r\n        }\r\n    }\r\n    return warns;\r\n}\r\n\n\n//# sourceURL=.././src/extension.ts");

/***/ }),

/***/ "flashpoint-launcher":
/*!**************************************!*\
  !*** external "flashpoint-launcher" ***!
  \**************************************/
/***/ ((module) => {

module.exports = require("flashpoint-launcher");

/***/ }),

/***/ "fs":
/*!*********************!*\
  !*** external "fs" ***!
  \*********************/
/***/ ((module) => {

module.exports = require("fs");

/***/ }),

/***/ "path":
/*!***********************!*\
  !*** external "path" ***!
  \***********************/
/***/ ((module) => {

module.exports = require("path");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = __webpack_require__("./src/extension.ts");
/******/ 	module.exports = __webpack_exports__;
/******/ 	
/******/ })()
;