(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/init.ts");
/******/ })
/************************************************************************/
/******/ ({

/***/ "../../tauri/Cargo.toml":
/*!******************************************************!*\
  !*** /home/runner/work/tauri/tauri/tauri/Cargo.toml ***!
  \******************************************************/
/*! no static exports found */
/***/ (function(module, exports) {

module.exports    = {
	"package": {
		"name": "tauri",
		"version": "0.9.0",
		"authors": [
			"Lucas Fernandes Gonçalves Nogueira <lucas@tauri.studio>",
			"Daniel Thompson-Yvetot <denjell@sfosc.org>",
			"Tensor Programming <tensordeveloper@gmail.com>"
		],
		"categories": [
			"gui",
			"web-programming"
		],
		"license": "MIT",
		"homepage": "https://tauri.studio",
		"repository": "https://github.com/tauri-apps/tauri",
		"description": "Make tiny, secure apps for all desktop platforms with Tauri",
		"edition": "2018",
		"exclude": [
			"test/fixture/**"
		],
		"metadata": {
			"docs": {
				"rs": {
					"features": [
						"all-api"
					]
				}
			}
		}
	},
	"dependencies": {
		"serde_json": "1.0",
		"serde": {
			"version": "1.0",
			"features": [
				"derive"
			]
		},
		"webview_official": "0.0.2",
		"tauri_includedir": "0.6.0",
		"phf": "0.8.0",
		"base64": "0.12.3",
		"webbrowser": "0.5.5",
		"lazy_static": "1.4.0",
		"tiny_http": {
			"version": "0.7",
			"optional": true
		},
		"threadpool": "1.8",
		"uuid": {
			"version": "0.8.1",
			"features": [
				"v4"
			]
		},
		"anyhow": "1.0.31",
		"thiserror": "1.0.20",
		"envmnt": "0.8.4",
		"once_cell": "1.4.0",
		"tauri-api": {
			"version": "0.7.3",
			"path": "../tauri-api"
		},
		"urlencoding": "1.1.1"
	},
	"target": {
		"cfg(target_os = \"windows\")": {
			"dependencies": {
				"runas": "0.2"
			}
		}
	},
	"build-dependencies": {
		"tauri_includedir_codegen": "0.6.2",
		"cfg_aliases": "0.1.0"
	},
	"dev-dependencies": {
		"proptest": "0.10.0",
		"serde_json": "1.0",
		"tauri": {
			"path": ".",
			"features": [
				"all-api"
			]
		},
		"serde": {
			"version": "1.0",
			"features": [
				"derive"
			]
		}
	},
	"features": {
		"cli": [
			"tauri-api/cli"
		],
		"embedded-server": [
			"tiny_http"
		],
		"no-server": [],
		"all-api": [
			"tauri-api/notification"
		],
		"read-text-file": [],
		"read-binary-file": [],
		"write-file": [],
		"read-dir": [],
		"copy-file": [],
		"create-dir": [],
		"remove-dir": [],
		"remove-file": [],
		"rename-file": [],
		"set-title": [],
		"execute": [],
		"open": [],
		"event": [],
		"updater": [],
		"open-dialog": [],
		"save-dialog": [],
		"notification": [
			"tauri-api/notification"
		]
	},
	"example": [
		{
			"name": "communication",
			"path": "examples/communication/src-tauri/src/main.rs"
		}
	]
}

/***/ }),

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

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var template_1 = __webpack_require__(/*! ../template */ "./src/template/index.ts");
module.exports = function (args) {
    return template_1.inject(args.directory, 'all', {
        force: args.force,
        logging: args.logging,
        tauriPath: args.tauriPath
    }, args.customConfig);
};


/***/ }),

/***/ "./src/helpers/copy-templates.ts":
/*!***************************************!*\
  !*** ./src/helpers/copy-templates.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 });
// forked from https://github.com/quasarframework/quasar/blob/master/app/lib/app-extension/Extension.js
var fast_glob_1 = __importDefault(__webpack_require__(/*! fast-glob */ "fast-glob"));
var fs_extra_1 = __importDefault(__webpack_require__(/*! fs-extra */ "fs-extra"));
var isbinaryfile_1 = __webpack_require__(/*! isbinaryfile */ "isbinaryfile");
var lodash_1 = __webpack_require__(/*! lodash */ "lodash");
var path_1 = __webpack_require__(/*! path */ "path");
var copyTemplates = function (_a) {
    var source = _a.source, target = _a.target, scope = _a.scope;
    var files = fast_glob_1.default.sync(['**/*'], {
        cwd: source
    });
    for (var _i = 0, files_1 = files; _i < files_1.length; _i++) {
        var rawPath = files_1[_i];
        var targetRelativePath = rawPath
            .split('/')
            .map(function (name) {
            // dotfiles are ignored when published to npm, therefore in templates
            // we need to use underscore instead (e.g. "_gitignore")
            if (name.startsWith('_') && name.charAt(1) !== '_') {
                return "." + name.slice(1);
            }
            if (name.startsWith('_') && name.charAt(1) === '_') {
                return "" + name.slice(1);
            }
            return name;
        })
            .join('/');
        var targetPath = path_1.join(target, targetRelativePath);
        var sourcePath = path_1.resolve(source, rawPath);
        fs_extra_1.default.ensureFileSync(targetPath);
        if (isbinaryfile_1.isBinaryFileSync(sourcePath)) {
            fs_extra_1.default.copyFileSync(sourcePath, targetPath);
        }
        else {
            // eslint-disable-next-line security/detect-non-literal-fs-filename
            var rawContent = fs_extra_1.default.readFileSync(sourcePath, 'utf-8');
            var compiled = lodash_1.template(rawContent, {
                interpolate: /<%=([\s\S]+?)%>/g
            });
            // eslint-disable-next-line security/detect-non-literal-fs-filename
            fs_extra_1.default.writeFileSync(targetPath, compiled(scope), 'utf-8');
        }
    }
};
exports.default = copyTemplates;


/***/ }),

/***/ "./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/template/defaultConfig.ts":
/*!***************************************!*\
  !*** ./src/template/defaultConfig.ts ***!
  \***************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
    build: {
        distDir: '../dist',
        devPath: 'http://localhost:4000',
        beforeDevCommand: '',
        beforeBuildCommand: ''
    },
    ctx: {},
    tauri: {
        embeddedServer: {
            active: true
        },
        bundle: {
            active: true,
            targets: 'all',
            identifier: 'com.tauri.dev',
            icon: ['icons/32x32.png', 'icons/128x128.png', 'icons/128x128@2x.png', 'icons/icon.icns', 'icons/icon.ico'],
            resources: [],
            externalBin: [],
            copyright: '',
            category: 'DeveloperTool',
            shortDescription: '',
            longDescription: '',
            deb: {
                depends: [],
                useBootstrapper: false
            },
            osx: {
                frameworks: [],
                minimumSystemVersion: '',
                useBootstrapper: false
            },
            exceptionDomain: ''
        },
        allowlist: {
            all: true
        },
        window: {
            title: 'Tauri App',
            width: 800,
            height: 600,
            resizable: true,
            fullscreen: false
        },
        security: {
            csp: "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
        },
        inliner: {
            active: true
        }
    }
};


/***/ }),

/***/ "./src/template/index.ts":
/*!*******************************!*\
  !*** ./src/template/index.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.inject = void 0;
var fs_extra_1 = __webpack_require__(/*! fs-extra */ "fs-extra");
var path_1 = __webpack_require__(/*! path */ "path");
var webpack_merge_1 = __webpack_require__(/*! webpack-merge */ "webpack-merge");
var copy_templates_1 = __importDefault(__webpack_require__(/*! ../helpers/copy-templates */ "./src/helpers/copy-templates.ts"));
var logger_1 = __importDefault(__webpack_require__(/*! ../helpers/logger */ "./src/helpers/logger.ts"));
var defaultConfig_1 = __importDefault(__webpack_require__(/*! ./defaultConfig */ "./src/template/defaultConfig.ts"));
var chalk_1 = __importDefault(__webpack_require__(/*! chalk */ "chalk"));
var log = logger_1.default('app:tauri');
var warn = logger_1.default('app:tauri (template)', chalk_1.default.red);
var injectConfFile = function (injectPath, _a, customConfig) {
    var force = _a.force, logging = _a.logging;
    if (customConfig === void 0) { customConfig = {}; }
    var path = path_1.join(injectPath, 'tauri.conf.json');
    if (fs_extra_1.existsSync(path) && force !== 'conf' && force !== 'all') {
        warn("tauri.conf.json found in " + path + "\n  Run `tauri init --force conf` to overwrite.");
        if (!force)
            return false;
    }
    else {
        fs_extra_1.removeSync(path);
        Object.keys(defaultConfig_1.default).forEach(function (key) {
            // Options marked `null` should be removed
            /* eslint-disable security/detect-object-injection */
            if (customConfig[key] === null) {
                // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
                delete defaultConfig_1.default[key];
                // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
                delete customConfig[key];
            }
            /* eslint-enable security/detect-object-injection */
        });
        var finalConf = webpack_merge_1.merge(defaultConfig_1.default, customConfig);
        fs_extra_1.writeFileSync(path, JSON.stringify(finalConf, undefined, 2));
        if (logging)
            log('Successfully wrote tauri.conf.json');
    }
};
var injectTemplate = function (injectPath, _a) {
    var force = _a.force, logging = _a.logging, tauriPath = _a.tauriPath;
    var dir = path_1.normalize(path_1.join(injectPath, 'src-tauri'));
    if (fs_extra_1.existsSync(dir) && force !== 'template' && force !== 'all') {
        warn("Tauri dir (" + dir + ") not empty.\nRun `tauri init --force template` to overwrite.");
        if (!force)
            return false;
    }
    var resolveTauriPath = function (tauriPath) {
        var resolvedPath = tauriPath.startsWith('/') || /^\S:/g.test(tauriPath)
            ? path_1.join(tauriPath, 'tauri') // we received a full path as argument
            : path_1.join('..', tauriPath, 'tauri'); // we received a relative path
        return resolvedPath.replace(/\\/g, '/');
    };
    var resolveCurrentTauriVersion = function () {
        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-member-access
        var tauriManifest = __webpack_require__(/*! ../../../../tauri/Cargo.toml */ "../../tauri/Cargo.toml");
        var version = tauriManifest.package.version;
        return version.substring(0, version.lastIndexOf('.'));
    };
    var tauriDep = tauriPath
        ? "{ path = \"" + resolveTauriPath(tauriPath) + "\" }"
        : "{ version = \"" + resolveCurrentTauriVersion() + "\" }";
    fs_extra_1.removeSync(dir);
    copy_templates_1.default({
        source: path_1.resolve(__dirname, '../../templates/src-tauri'),
        scope: {
            tauriDep: tauriDep
        },
        target: dir
    });
    if (logging)
        log('Successfully wrote src-tauri');
};
var inject = function (injectPath, type, _a, customConfig) {
    var _b = _a.force, force = _b === void 0 ? false : _b, _c = _a.logging, logging = _c === void 0 ? false : _c, tauriPath = _a.tauriPath;
    if (typeof type !== 'string' || typeof injectPath !== 'string') {
        warn('- internal error. Required params missing.');
        return false;
    }
    if (type === 'template' || type === 'all') {
        injectTemplate(injectPath, { force: force, logging: logging, tauriPath: tauriPath });
    }
    if (type === 'conf' || type === 'all') {
        injectConfFile(path_1.join(injectPath, 'src-tauri'), { force: force, logging: logging }, customConfig);
    }
    return true;
};
exports.inject = inject;


/***/ }),

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

module.exports = require("chalk");

/***/ }),

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

module.exports = require("fast-glob");

/***/ }),

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

module.exports = require("fs-extra");

/***/ }),

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

module.exports = require("isbinaryfile");

/***/ }),

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

module.exports = require("lodash");

/***/ }),

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

module.exports = require("ms");

/***/ }),

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

module.exports = require("path");

/***/ }),

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

module.exports = require("webpack-merge");

/***/ })

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