(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory();
	else if(typeof define === 'function' && define.amd)
		define([], factory);
	else if(typeof exports === 'object')
		exports["tauri"] = factory();
	else
		root["tauri"] = factory();
})(global, function() {
return /******/ (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 = "./src/api/info.ts");
/******/ })
/************************************************************************/
/******/ ({

/***/ "./package.json":
/*!**********************!*\
  !*** ./package.json ***!
  \**********************/
/*! exports provided: name, version, description, bin, funding, scripts, repository, contributors, license, bugs, homepage, publishConfig, engines, dependencies, devDependencies, resolutions, husky, lint-staged, default */
/***/ (function(module) {

module.exports = JSON.parse("{\"name\":\"tauri\",\"version\":\"0.11.0\",\"description\":\"Multi-binding collection of libraries and templates for building Tauri apps\",\"bin\":{\"tauri\":\"./bin/tauri.js\"},\"funding\":{\"type\":\"opencollective\",\"url\":\"https://opencollective.com/tauri\"},\"scripts\":{\"build\":\"yarn build:api && yarn build:webpack\",\"build:webpack\":\"rimraf ./dist && yarn build:typevalidators && webpack --progress\",\"build:typevalidators\":\"node ./build/type-validators\",\"build:api\":\"rimraf ./api && rollup -c --silent\",\"build-release\":\"yarn build --display none --progress false\",\"test\":\"jest --runInBand --no-cache --testPathIgnorePatterns=\\\"(build|dev)\\\"\",\"pretest\":\"yarn build\",\"prepublishOnly\":\"yarn build-release\",\"test:local\":\"jest --runInBand\",\"lint\":\"eslint --ext ts ./src/**/*.ts ./api-src/**/*.ts\",\"lint-fix\":\"eslint --fix --ext ts ./src/**/*.ts\",\"lint:lockfile\":\"lockfile-lint --path yarn.lock --type yarn --validate-https --allowed-hosts npm yarn\",\"build:tauri[rust]\":\"cd ../tauri && TAURI_DIST_DIR=../../test/fixture/dist TAURI_DIR=../test/fixture cargo publish --dry-run --allow-dirty\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tauri-apps/tauri.git\"},\"contributors\":[\"Tauri Team <team@tauri-apps.org> (https://tauri.studio)\",\"Daniel Thompson-Yvetot <denjell@sfosc.org>\",\"Lucas Fernandes Gonçalves Nogueira <lucas@tauri.studio>\"],\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/tauri-apps/tauri/issues\"},\"homepage\":\"https://github.com/tauri-apps/tauri#readme\",\"publishConfig\":{\"access\":\"public\"},\"engines\":{\"node\":\">= 10.17.0\",\"npm\":\">= 6.6.0\",\"yarn\":\">= 1.19.1\"},\"dependencies\":{\"@tauri-apps/tauri-inliner\":\"1.14.1\",\"@tauri-apps/toml\":\"2.2.4\",\"chalk\":\"4.1.0\",\"chokidar\":\"3.4.1\",\"cross-spawn\":\"7.0.3\",\"fast-glob\":\"3.2.4\",\"fs-extra\":\"9.0.1\",\"http-proxy\":\"1.18.1\",\"imagemin\":\"7.0.1\",\"imagemin-optipng\":\"8.0.0\",\"imagemin-pngquant\":\"9.0.0\",\"imagemin-zopfli\":\"7.0.0\",\"inquirer\":\"7.3.2\",\"is-png\":\"2.0.0\",\"is-reachable\":\"4.0.0\",\"isbinaryfile\":\"4.0.6\",\"jsdom\":\"16.3.0\",\"lodash\":\"4.17.19\",\"minimist\":\"1.2.5\",\"ms\":\"2.1.2\",\"png2icons\":\"2.0.1\",\"read-chunk\":\"3.2.0\",\"semver\":\"7.3.2\",\"sharp\":\"0.25.4\",\"webpack-merge\":\"5.0.9\",\"webpack-shell-plugin\":\"0.5.0\"},\"devDependencies\":{\"@babel/core\":\"7.10.5\",\"@babel/preset-env\":\"7.10.4\",\"@babel/preset-typescript\":\"7.10.4\",\"@rollup/plugin-babel\":\"5.1.0\",\"@rollup/plugin-commonjs\":\"14.0.0\",\"@rollup/plugin-json\":\"4.1.0\",\"@rollup/plugin-node-resolve\":\"8.4.0\",\"@rollup/plugin-sucrase\":\"3.1.0\",\"@rollup/plugin-typescript\":\"5.0.2\",\"@types/cross-spawn\":\"6.0.2\",\"@types/fs-extra\":\"9.0.1\",\"@types/http-proxy\":\"1.17.4\",\"@types/imagemin\":\"7.0.0\",\"@types/imagemin-optipng\":\"5.2.0\",\"@types/inquirer\":\"7.3.0\",\"@types/jsdom\":\"16.2.3\",\"@types/lodash\":\"4.14.158\",\"@types/ms\":\"0.7.31\",\"@types/semver\":\"7.3.1\",\"@types/sharp\":\"0.25.1\",\"@types/webpack-merge\":\"4.1.5\",\"@typescript-eslint/eslint-plugin\":\"3.7.0\",\"@typescript-eslint/parser\":\"3.7.0\",\"babel-jest\":\"26.1.0\",\"copy-webpack-plugin\":\"6.0.3\",\"dotenv\":\"8.2.0\",\"eslint\":\"7.5.0\",\"eslint-config-standard-with-typescript\":\"18.0.2\",\"eslint-plugin-import\":\"2.22.0\",\"eslint-plugin-lodash-template\":\"0.19.0\",\"eslint-plugin-node\":\"11.1.0\",\"eslint-plugin-promise\":\"4.2.1\",\"eslint-plugin-security\":\"1.4.0\",\"eslint-plugin-standard\":\"4.0.1\",\"husky\":\"4.2.5\",\"is-running\":\"2.1.0\",\"jest\":\"26.1.0\",\"jest-mock-process\":\"1.4.0\",\"lint-staged\":\"10.2.11\",\"lockfile-lint\":\"4.3.7\",\"promise\":\"8.1.0\",\"raw-loader\":\"4.0.1\",\"rimraf\":\"3.0.2\",\"rollup\":\"2.22.2\",\"rollup-plugin-terser\":\"6.1.0\",\"rollup-plugin-typescript2\":\"0.27.1\",\"toml-loader\":\"1.0.0\",\"ts-loader\":\"8.0.1\",\"tslib\":\"2.0.0\",\"typescript\":\"3.9.7\",\"typescript-json-validator\":\"2.4.2\",\"webpack\":\"4.43.0\",\"webpack-cli\":\"3.3.12\",\"webpack-node-externals\":\"2.5.0\"},\"resolutions\":{\"**/lodash\":\">=4.17.19\"},\"husky\":{\"hooks\":{\"pre-commit\":\"lint-staged\"}},\"lint-staged\":[\"eslint --fix\"]}");

/***/ }),

/***/ "./src/api/dependency-manager/util.ts":
/*!********************************************!*\
  !*** ./src/api/dependency-manager/util.ts ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.semverLt = exports.padVersion = exports.updateNpmPackage = exports.installNpmPackage = exports.getNpmPackageVersion = exports.getNpmLatestVersion = exports.getCrateLatestVersion = void 0;
var https_1 = __importDefault(__webpack_require__(/*! https */ "https"));
var spawn_1 = __webpack_require__(/*! ../../helpers/spawn */ "./src/helpers/spawn.ts");
var cross_spawn_1 = __webpack_require__(/*! cross-spawn */ "cross-spawn");
var app_paths_1 = __webpack_require__(/*! ../../helpers/app-paths */ "./src/helpers/app-paths.ts");
var fs_1 = __webpack_require__(/*! fs */ "fs");
var semver_1 = __importDefault(__webpack_require__(/*! semver */ "semver"));
var BASE_URL = 'https://docs.rs/crate/';
function getCrateLatestVersion(crateName) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0: return [4 /*yield*/, new Promise(function (resolve, reject) {
                        var url = "" + BASE_URL + crateName;
                        https_1.default.get(url, function (res) {
                            if (res.statusCode !== 302 || !res.headers.location) {
                                reject(res);
                            }
                            else {
                                var version = res.headers.location.replace(url + '/', '');
                                resolve(version);
                            }
                        });
                    })];
                case 1: return [2 /*return*/, _a.sent()];
            }
        });
    });
}
exports.getCrateLatestVersion = getCrateLatestVersion;
function getNpmLatestVersion(packageName) {
    var child = cross_spawn_1.sync('npm', ['show', packageName, 'version'], { cwd: app_paths_1.appDir });
    return String(child.output[1]).replace('\n', '');
}
exports.getNpmLatestVersion = getNpmLatestVersion;
function getNpmPackageVersion(packageName) {
    return __awaiter(this, void 0, void 0, function () {
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0: return [4 /*yield*/, new Promise(function (resolve) {
                        var child = cross_spawn_1.sync('npm', ['list', packageName, 'version', '--depth', '0'], { cwd: app_paths_1.appDir });
                        var output = String(child.output[1]);
                        // eslint-disable-next-line security/detect-non-literal-regexp
                        var matches = new RegExp(packageName + '@(\\S+)', 'g').exec(output);
                        if (matches === null || matches === void 0 ? void 0 : matches[1]) {
                            resolve(matches[1]);
                        }
                        else {
                            resolve(null);
                        }
                    })];
                case 1: return [2 /*return*/, _a.sent()];
            }
        });
    });
}
exports.getNpmPackageVersion = getNpmPackageVersion;
function installNpmPackage(packageName) {
    var usesYarn = fs_1.existsSync(app_paths_1.resolve.app('yarn.lock'));
    if (usesYarn) {
        spawn_1.spawnSync('yarn', ['add', packageName], app_paths_1.appDir);
    }
    else {
        spawn_1.spawnSync('npm', ['install', packageName], app_paths_1.appDir);
    }
}
exports.installNpmPackage = installNpmPackage;
function updateNpmPackage(packageName) {
    var usesYarn = fs_1.existsSync(app_paths_1.resolve.app('yarn.lock'));
    if (usesYarn) {
        spawn_1.spawnSync('yarn', ['upgrade', packageName, '--latest'], app_paths_1.appDir);
    }
    else {
        spawn_1.spawnSync('npm', ['install', packageName + "@latest"], app_paths_1.appDir);
    }
}
exports.updateNpmPackage = updateNpmPackage;
function padVersion(version) {
    var _a;
    var count = ((_a = version.match(/\./g)) !== null && _a !== void 0 ? _a : []).length;
    while (count < 2) {
        count++;
        version += '.0';
    }
    return version;
}
exports.padVersion = padVersion;
function semverLt(first, second) {
    return semver_1.default.lt(padVersion(first), padVersion(second));
}
exports.semverLt = semverLt;


/***/ }),

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

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var toml_1 = __importDefault(__webpack_require__(/*! @tauri-apps/toml */ "@tauri-apps/toml"));
var chalk_1 = __importDefault(__webpack_require__(/*! chalk */ "chalk"));
var fs_1 = __importDefault(__webpack_require__(/*! fs */ "fs"));
var os_1 = __importDefault(__webpack_require__(/*! os */ "os"));
var path_1 = __importDefault(__webpack_require__(/*! path */ "path"));
var app_paths_1 = __webpack_require__(/*! ../helpers/app-paths */ "./src/helpers/app-paths.ts");
var cross_spawn_1 = __webpack_require__(/*! cross-spawn */ "cross-spawn");
var non_webpack_require_1 = __importDefault(__webpack_require__(/*! ../helpers/non-webpack-require */ "./src/helpers/non-webpack-require.ts"));
var package_json_1 = __importDefault(__webpack_require__(/*! ../../package.json */ "./package.json"));
var get_script_version_1 = __importDefault(__webpack_require__(/*! ../helpers/get-script-version */ "./src/helpers/get-script-version.ts"));
var util_1 = __webpack_require__(/*! ./dependency-manager/util */ "./src/api/dependency-manager/util.ts");
function crateLatestVersion(name) {
    return __awaiter(this, void 0, void 0, function () {
        var _a;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0:
                    _b.trys.push([0, 2, , 3]);
                    return [4 /*yield*/, util_1.getCrateLatestVersion(name)];
                case 1: return [2 /*return*/, _b.sent()];
                case 2:
                    _a = _b.sent();
                    return [2 /*return*/, undefined];
                case 3: return [2 /*return*/];
            }
        });
    });
}
/* eslint-disable security/detect-non-literal-fs-filename */
function dirTree(filename, recurse) {
    if (recurse === void 0) { recurse = true; }
    var stats = fs_1.default.lstatSync(filename);
    var info = {
        path: filename,
        name: path_1.default.basename(filename)
    };
    if (stats.isDirectory()) {
        info.type = 'folder';
        if (recurse) {
            info.children = fs_1.default.readdirSync(filename).map(function (child) {
                return dirTree(filename + '/' + child, false);
            });
        }
    }
    else {
        info.type = 'file';
    }
    return info;
}
function getVersion(command, args, formatter) {
    if (args === void 0) { args = []; }
    var version = get_script_version_1.default(command, args);
    if (version === null) {
        return chalk_1.default.red('Not installed');
    }
    else {
        return chalk_1.default.green(formatter === undefined ? version : formatter(version));
    }
}
function printInfo(info) {
    var suffix = info.suffix ? " " + info.suffix : '';
    console.log("" + (info.section ? '\n' : '') + info.key + (info.value === undefined ? '' : ' - ' + info.value) + suffix);
}
function printVersion(info) {
    var outdated = info.version && info.targetVersion && util_1.semverLt(info.version, info.targetVersion);
    console.log("" + (info.section ? '\n' : '') + info.key + (info.version ? ' - ' + chalk_1.default.green(info.version) : chalk_1.default.red('Not installed')) + (outdated && info.targetVersion ? " (" + chalk_1.default.red('outdated, latest: ' + info.targetVersion) + ")" : ''));
}
function readTomlFile(filepath) {
    try {
        var file = fs_1.default.readFileSync(filepath).toString();
        return toml_1.default.parse(file);
    }
    catch (_) {
        return null;
    }
}
function printAppInfo(tauriDir) {
    var _a;
    return __awaiter(this, void 0, void 0, function () {
        var lockPath, lock, lockPackages, manifestPath, manifest, tauriVersion, foundTauriVersions, manifestVersion, lockVersion, tauriVersionString, latestTauriCore, tauriMode, configPath, config;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0:
                    printInfo({ key: 'App', section: true });
                    lockPath = path_1.default.join(tauriDir, 'Cargo.lock');
                    lock = readTomlFile(lockPath);
                    lockPackages = lock ? lock.package.filter(function (pkg) { return pkg.name === 'tauri'; }) : [];
                    manifestPath = path_1.default.join(tauriDir, 'Cargo.toml');
                    manifest = readTomlFile(manifestPath);
                    foundTauriVersions = [];
                    if (manifest && lock && lockPackages.length === 1) {
                        // everything looks good
                        foundTauriVersions.push(lockPackages[0].version);
                        tauriVersion = chalk_1.default.green(lockPackages[0].version);
                    }
                    else if (lock && lockPackages.length === 1) {
                        // good lockfile, but no manifest - will cause problems building
                        foundTauriVersions.push(lockPackages[0].version);
                        tauriVersion = chalk_1.default.green(lockPackages[0].version) + " (" + chalk_1.default.red('no manifest') + ")";
                    }
                    else {
                        manifestVersion = function () {
                            var tauri = manifest === null || manifest === void 0 ? void 0 : manifest.dependencies.tauri;
                            if (tauri) {
                                if (typeof tauri === 'string') {
                                    foundTauriVersions.push(tauri);
                                    return chalk_1.default.yellow(tauri);
                                }
                                else if (tauri.version) {
                                    foundTauriVersions.push(tauri.version);
                                    return chalk_1.default.yellow(tauri.version);
                                }
                                else if (tauri.path) {
                                    var manifestPath_1 = path_1.default.resolve(tauriDir, tauri.path, 'Cargo.toml');
                                    var manifestContent = readTomlFile(manifestPath_1);
                                    var pathVersion = manifestContent === null || manifestContent === void 0 ? void 0 : manifestContent.package.version;
                                    pathVersion = pathVersion ? chalk_1.default.yellow(pathVersion) : chalk_1.default.red(pathVersion);
                                    return "path:" + tauri.path + " [" + pathVersion + "]";
                                }
                            }
                            else {
                                return chalk_1.default.red('no manifest');
                            }
                            return chalk_1.default.red('unknown manifest');
                        };
                        lockVersion = void 0;
                        if (lock && lockPackages.length > 0) {
                            lockVersion = chalk_1.default.yellow(lockPackages.map(function (p) { return p.version; }).join(', '));
                        }
                        else if (lock && lockPackages.length === 0) {
                            lockVersion = chalk_1.default.red('unknown lockfile');
                        }
                        else {
                            lockVersion = chalk_1.default.red('no lockfile');
                        }
                        tauriVersion = manifestVersion() + " (" + chalk_1.default.yellow(lockVersion) + ")";
                    }
                    tauriVersionString = foundTauriVersions.reduce(function (old, current) { return util_1.semverLt(old, current) ? current : old; }, '0.0.0');
                    return [4 /*yield*/, crateLatestVersion('tauri')];
                case 1:
                    latestTauriCore = _b.sent();
                    printInfo({
                        key: '  tauri.rs',
                        value: tauriVersion,
                        suffix: tauriVersionString !== '0.0.0' && latestTauriCore && util_1.semverLt(tauriVersionString, latestTauriCore)
                            ? "(" + chalk_1.default.red('outdated, latest: ' + latestTauriCore) + ")"
                            : undefined
                    });
                    try {
                        tauriMode = function (config) {
                            if (config.tauri.embeddedServer) {
                                return chalk_1.default.green(config.tauri.embeddedServer.active ? 'embedded-server' : 'no-server');
                            }
                            return chalk_1.default.red('unset');
                        };
                        configPath = path_1.default.join(tauriDir, 'tauri.conf.json');
                        config = non_webpack_require_1.default(configPath);
                        printInfo({ key: '  mode', value: tauriMode(config) });
                        printInfo({
                            key: '  build-type',
                            value: ((_a = config.tauri.bundle) === null || _a === void 0 ? void 0 : _a.active) ? 'bundle' : 'build'
                        });
                        printInfo({
                            key: '  CSP',
                            value: config.tauri.security ? config.tauri.security.csp : 'unset'
                        });
                        printInfo({
                            key: '  distDir',
                            value: config.build
                                ? chalk_1.default.green(config.build.distDir)
                                : chalk_1.default.red('unset')
                        });
                        printInfo({
                            key: '  devPath',
                            value: config.build
                                ? chalk_1.default.green(config.build.devPath)
                                : chalk_1.default.red('unset')
                        });
                    }
                    catch (_) { }
                    return [2 /*return*/];
            }
        });
    });
}
module.exports = function () { return __awaiter(void 0, void 0, void 0, function () {
    var stdout, match, edgeString, _a, _b, tree, _i, _c, artifact;
    return __generator(this, function (_d) {
        switch (_d.label) {
            case 0:
                printInfo({
                    key: 'Operating System',
                    value: chalk_1.default.green(os_1.default.type() + "(" + os_1.default.release() + ") - " + os_1.default.platform() + "/" + os_1.default.arch()),
                    section: true
                });
                if (os_1.default.platform() === 'win32') {
                    stdout = cross_spawn_1.sync('REG', ['QUERY', 'HKEY_CLASSES_root\\AppX3xxs313wwkfjhythsb8q46xdsq8d2cvv\\Application', '/v', 'ApplicationName']).stdout;
                    match = /{(\S+)}/g.exec(stdout.toString());
                    if (match) {
                        edgeString = match[1];
                        printInfo({ key: 'Microsoft Edge', value: edgeString.split('?')[0].replace('Microsoft.MicrosoftEdge_', '') });
                    }
                }
                printInfo({ key: 'Node.js environment', section: true });
                printVersion({ key: '  Node.js', version: process.version.slice(1), targetVersion: package_json_1.default.engines.node.replace('>= ', '') });
                printVersion({
                    key: '  tauri.js',
                    version: package_json_1.default.version,
                    targetVersion: util_1.getNpmLatestVersion('tauri')
                });
                printInfo({ key: 'Rust environment', section: true });
                printInfo({
                    key: '  rustc',
                    value: getVersion('rustc', [], function (output) { return output.split(' ')[1]; })
                });
                printInfo({
                    key: '  cargo',
                    value: getVersion('cargo', [], function (output) { return output.split(' ')[1]; })
                });
                _a = printVersion;
                _b = {
                    key: '  tauri-bundler',
                    version: get_script_version_1.default('cargo', ['tauri-bundler'])
                };
                return [4 /*yield*/, crateLatestVersion('tauri-bundler')];
            case 1:
                _a.apply(void 0, [(_b.targetVersion = _d.sent(),
                        _b)]);
                printInfo({ key: 'Global packages', section: true });
                printInfo({ key: '  NPM', value: getVersion('npm') });
                printInfo({ key: '  yarn', value: getVersion('yarn') });
                printInfo({ key: 'App directory structure', section: true });
                tree = dirTree(app_paths_1.appDir);
                // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
                for (_i = 0, _c = tree.children || []; _i < _c.length; _i++) {
                    artifact = _c[_i];
                    if (artifact.type === 'folder') {
                        console.log("/" + artifact.name);
                    }
                }
                return [4 /*yield*/, printAppInfo(app_paths_1.tauriDir)];
            case 2:
                _d.sent();
                return [2 /*return*/];
        }
    });
}); };
/* eslint-enable security/detect-non-literal-fs-filename */


/***/ }),

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

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolve = exports.tauriDir = exports.appDir = void 0;
var fs_1 = __webpack_require__(/*! fs */ "fs");
var path_1 = __webpack_require__(/*! path */ "path");
var logger_1 = __importDefault(__webpack_require__(/*! ./logger */ "./src/helpers/logger.ts"));
var chalk_1 = __importDefault(__webpack_require__(/*! chalk */ "chalk"));
var warn = logger_1.default('tauri', chalk_1.default.red);
function resolvePath(basePath, dir) {
    return dir && path_1.isAbsolute(dir)
        ? dir
        : path_1.resolve(basePath, dir);
}
var getAppDir = function () {
    var dir = process.cwd();
    var count = 0;
    // only go up three folders max
    while (dir.length > 0 && !dir.endsWith(path_1.sep) && count <= 2) {
        if (fs_1.existsSync(path_1.join(dir, 'src-tauri', 'tauri.conf.json'))) {
            return dir;
        }
        count++;
        dir = path_1.normalize(path_1.join(dir, '..'));
    }
    warn('Couldn\'t find recognize the current folder as a part of a Tauri project');
    process.exit(1);
};
var appDir = getAppDir();
exports.appDir = appDir;
var tauriDir = path_1.resolve(appDir, 'src-tauri');
exports.tauriDir = tauriDir;
var resolveDir = {
    app: function (dir) { return resolvePath(appDir, dir); },
    tauri: function (dir) { return resolvePath(tauriDir, dir); }
};
exports.resolve = resolveDir;


/***/ }),

/***/ "./src/helpers/get-script-version.ts":
/*!*******************************************!*\
  !*** ./src/helpers/get-script-version.ts ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __spreadArrays = (this && this.__spreadArrays) || function () {
    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
    for (var r = Array(s), k = 0, i = 0; i < il; i++)
        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
            r[k] = a[j];
    return r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var cross_spawn_1 = __webpack_require__(/*! cross-spawn */ "cross-spawn");
function getVersion(command, args) {
    if (args === void 0) { args = []; }
    try {
        var child = cross_spawn_1.sync(command, __spreadArrays(args, ['--version']));
        if (child.status === 0) {
            var output = String(child.output[1]);
            return output.replace(/\n/g, '');
        }
        return null;
    }
    catch (err) {
        return null;
    }
}
exports.default = getVersion;


/***/ }),

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

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var chalk_1 = __importDefault(__webpack_require__(/*! chalk */ "chalk"));
var ms_1 = __importDefault(__webpack_require__(/*! ms */ "ms"));
var prevTime;
exports.default = (function (banner, color) {
    if (color === void 0) { color = chalk_1.default.green; }
    return function (msg) {
        var curr = +new Date();
        var diff = curr - (prevTime || curr);
        prevTime = curr;
        if (msg) {
            console.log(
            // TODO: proper typings for color and banner
            // eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unsafe-call
            " " + color(String(banner)) + " " + msg + " " + chalk_1.default.green("+" + ms_1.default(diff)));
        }
        else {
            console.log();
        }
    };
});


/***/ }),

/***/ "./src/helpers/non-webpack-require.ts":
/*!********************************************!*\
  !*** ./src/helpers/non-webpack-require.ts ***!
  \********************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
// this function has been moved to a module so we can mock it
exports.default = (function (path) {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-return
    return require(path);
});


/***/ }),

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

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.spawnSync = exports.spawn = void 0;
var cross_spawn_1 = __importDefault(__webpack_require__(/*! cross-spawn */ "cross-spawn"));
var logger_1 = __importDefault(__webpack_require__(/*! ./logger */ "./src/helpers/logger.ts"));
var chalk_1 = __importDefault(__webpack_require__(/*! chalk */ "chalk"));
var log = logger_1.default('app:spawn');
var warn = logger_1.default('app:spawn', chalk_1.default.red);
/*
  Returns pid, takes onClose
 */
exports.spawn = function (cmd, params, cwd, onClose) {
    log("Running \"" + cmd + " " + params.join(' ') + "\"");
    log();
    // TODO: move to execa?
    var runner = cross_spawn_1.default(cmd, params, {
        stdio: 'inherit',
        cwd: cwd,
        env: process.env
    });
    runner.on('close', function (code) {
        log();
        if (code) {
            // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
            log("Command \"" + cmd + "\" failed with exit code: " + code);
        }
        // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
        onClose && onClose(code, runner.pid);
    });
    return runner.pid;
};
/*
  Returns nothing, takes onFail
 */
exports.spawnSync = function (cmd, params, cwd, onFail) {
    log("[sync] Running \"" + cmd + " " + params.join(' ') + "\"");
    log();
    var runner = cross_spawn_1.default.sync(cmd, params, {
        stdio: 'inherit',
        cwd: cwd
    });
    // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
    if (runner.status || runner.error) {
        warn();
        // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
        warn("\u26A0\uFE0F  Command \"" + cmd + "\" failed with exit code: " + runner.status);
        if (runner.status === null) {
            warn("\u26A0\uFE0F  Please globally install \"" + cmd + "\"");
        }
        // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
        onFail && onFail();
        process.exit(1);
    }
};


/***/ }),

/***/ "@tauri-apps/toml":
/*!***********************************!*\
  !*** external "@tauri-apps/toml" ***!
  \***********************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports = require("@tauri-apps/toml");

/***/ }),

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

module.exports = require("chalk");

/***/ }),

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

module.exports = require("cross-spawn");

/***/ }),

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

module.exports = require("fs");

/***/ }),

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

module.exports = require("https");

/***/ }),

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

module.exports = require("ms");

/***/ }),

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

module.exports = require("os");

/***/ }),

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

module.exports = require("path");

/***/ }),

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

module.exports = require("semver");

/***/ })

/******/ });
});
//# sourceMappingURL=info.js.map